@authhero/kysely-adapter 10.37.1 → 10.39.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 +373 -0
- package/dist/kysely-adapter.mjs +1620 -1423
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
2
|
var ue = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var Re = (t, e,
|
|
6
|
-
var R = (t, e,
|
|
7
|
-
var
|
|
8
|
-
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as Be, promptSettingSchema as
|
|
5
|
+
var Re = (t, e, a) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
|
+
var R = (t, e, a) => Re(t, typeof e != "symbol" ? e + "" : e, a), X = (t, e, a) => e.has(t) || ue("Cannot " + a);
|
|
7
|
+
var u = (t, e, a) => (X(t, e, "read from private field"), a ? a.call(t) : e.get(t)), O = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), K = (t, e, a, r) => (X(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), p = (t, e, a) => (X(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as Be, promptSettingSchema as qe, formSchema as H, resourceServerSchema as Qe } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
|
-
var
|
|
11
|
-
constructor(e = 500,
|
|
12
|
-
super(
|
|
10
|
+
var q = class extends Error {
|
|
11
|
+
constructor(e = 500, a) {
|
|
12
|
+
super(a == null ? void 0 : a.message, { cause: a == null ? void 0 : a.cause });
|
|
13
13
|
R(this, "res");
|
|
14
14
|
R(this, "status");
|
|
15
|
-
this.res =
|
|
15
|
+
this.res = a == null ? void 0 : a.res, this.status = e;
|
|
16
16
|
}
|
|
17
17
|
getResponse() {
|
|
18
18
|
return this.res ? new Response(this.res.body, {
|
|
@@ -23,23 +23,23 @@ var te = class extends Error {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
27
|
-
return async (e,
|
|
28
|
-
const { identities:
|
|
26
|
+
function We(t) {
|
|
27
|
+
return async (e, a) => {
|
|
28
|
+
const { identities: r, ...n } = a, o = {
|
|
29
29
|
...n,
|
|
30
30
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
31
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
login_count: 0,
|
|
33
33
|
tenant_id: e,
|
|
34
|
-
email_verified:
|
|
35
|
-
is_social:
|
|
36
|
-
app_metadata: JSON.stringify(
|
|
37
|
-
user_metadata: JSON.stringify(
|
|
34
|
+
email_verified: a.email_verified ? 1 : 0,
|
|
35
|
+
is_social: a.is_social ? 1 : 0,
|
|
36
|
+
app_metadata: JSON.stringify(a.app_metadata),
|
|
37
|
+
user_metadata: JSON.stringify(a.user_metadata)
|
|
38
38
|
};
|
|
39
39
|
try {
|
|
40
40
|
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
|
-
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new
|
|
42
|
+
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new q(409, { message: "User already exists" }) : new q(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
...o,
|
|
@@ -55,17 +55,17 @@ function y(t) {
|
|
|
55
55
|
return t;
|
|
56
56
|
if (Array.isArray(t))
|
|
57
57
|
return t.map(
|
|
58
|
-
(
|
|
58
|
+
(a) => (
|
|
59
59
|
// Only recurse into objects; leave primitives untouched
|
|
60
|
-
|
|
60
|
+
a !== null && typeof a == "object" ? y(a) : a
|
|
61
61
|
)
|
|
62
62
|
);
|
|
63
63
|
const e = { ...t };
|
|
64
|
-
for (const
|
|
65
|
-
const
|
|
66
|
-
|
|
64
|
+
for (const a in e) {
|
|
65
|
+
const r = e[a];
|
|
66
|
+
r === null ? delete e[a] : r !== null && typeof r == "object" && (Array.isArray(r) ? e[a] = r.map(
|
|
67
67
|
(n) => n !== null && typeof n == "object" ? y(n) : n
|
|
68
|
-
) : e[
|
|
68
|
+
) : e[a] = y(r));
|
|
69
69
|
}
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
@@ -73,8 +73,8 @@ function pe(t) {
|
|
|
73
73
|
let e = {};
|
|
74
74
|
try {
|
|
75
75
|
e = JSON.parse(t.profileData || "{}");
|
|
76
|
-
} catch (
|
|
77
|
-
console.error("Error parsing profileData",
|
|
76
|
+
} catch (a) {
|
|
77
|
+
console.error("Error parsing profileData", a);
|
|
78
78
|
}
|
|
79
79
|
return {
|
|
80
80
|
connection: t.connection,
|
|
@@ -88,27 +88,27 @@ function pe(t) {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return async (e,
|
|
93
|
-
const [
|
|
94
|
-
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=",
|
|
95
|
-
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=",
|
|
91
|
+
function Ve(t) {
|
|
92
|
+
return async (e, a) => {
|
|
93
|
+
const [r, n] = await Promise.all([
|
|
94
|
+
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
|
|
95
|
+
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).selectAll().execute()
|
|
96
96
|
]);
|
|
97
|
-
if (!
|
|
97
|
+
if (!r)
|
|
98
98
|
return null;
|
|
99
|
-
const { tenant_id: o, ...s } =
|
|
99
|
+
const { tenant_id: o, ...s } = r, i = {
|
|
100
100
|
...s,
|
|
101
|
-
email:
|
|
102
|
-
email_verified:
|
|
103
|
-
is_social:
|
|
104
|
-
app_metadata: JSON.parse(
|
|
105
|
-
user_metadata: JSON.parse(
|
|
101
|
+
email: r.email || "",
|
|
102
|
+
email_verified: r.email_verified === 1,
|
|
103
|
+
is_social: r.is_social === 1,
|
|
104
|
+
app_metadata: JSON.parse(r.app_metadata),
|
|
105
|
+
user_metadata: JSON.parse(r.user_metadata),
|
|
106
106
|
identities: [
|
|
107
107
|
{
|
|
108
|
-
connection:
|
|
109
|
-
provider:
|
|
110
|
-
user_id: ie(
|
|
111
|
-
isSocial: !!
|
|
108
|
+
connection: r.connection,
|
|
109
|
+
provider: r.provider,
|
|
110
|
+
user_id: ie(r.user_id).id,
|
|
111
|
+
isSocial: !!r.is_social
|
|
112
112
|
},
|
|
113
113
|
...n.map(pe)
|
|
114
114
|
]
|
|
@@ -116,25 +116,25 @@ function We(t) {
|
|
|
116
116
|
return y(i);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
121
|
-
let s = o.startsWith("-"), i = null, c = "",
|
|
119
|
+
function S(t, e, a, r) {
|
|
120
|
+
return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
121
|
+
let s = o.startsWith("-"), i = null, c = "", m = !1, _;
|
|
122
122
|
if (o.startsWith("-_exists_:"))
|
|
123
|
-
i = o.substring(10),
|
|
123
|
+
i = o.substring(10), m = !0, s = !0;
|
|
124
124
|
else if (o.startsWith("_exists_:"))
|
|
125
|
-
i = o.substring(9),
|
|
125
|
+
i = o.substring(9), m = !0, s = !1;
|
|
126
126
|
else if (o.includes(":")) {
|
|
127
|
-
const
|
|
128
|
-
i =
|
|
127
|
+
const d = s ? o.substring(1) : o, h = d.indexOf(":");
|
|
128
|
+
i = d.substring(0, h), c = d.substring(h + 1), m = !1, c.startsWith(">=") ? (_ = ">=", c = c.substring(2)) : c.startsWith(">") ? (_ = ">", c = c.substring(1)) : c.startsWith("<=") ? (_ = "<=", c = c.substring(2)) : c.startsWith("<") ? (_ = "<", c = c.substring(1)) : _ = "=";
|
|
129
129
|
} else
|
|
130
|
-
i = null, c = o,
|
|
131
|
-
return { key: i, value: c, isNegation: s, isExistsQuery:
|
|
132
|
-
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator:
|
|
130
|
+
i = null, c = o, m = !1;
|
|
131
|
+
return { key: i, value: c, isNegation: s, isExistsQuery: m, operator: _ };
|
|
132
|
+
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator: m }) => {
|
|
133
133
|
if (o)
|
|
134
134
|
if (c)
|
|
135
135
|
i ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
|
|
136
136
|
else if (i)
|
|
137
|
-
switch (
|
|
137
|
+
switch (m) {
|
|
138
138
|
case ">":
|
|
139
139
|
e = e.where(o, "<=", s);
|
|
140
140
|
break;
|
|
@@ -151,12 +151,12 @@ function T(t, e, r, a) {
|
|
|
151
151
|
e = e.where(o, "!=", s);
|
|
152
152
|
}
|
|
153
153
|
else
|
|
154
|
-
e = e.where(o,
|
|
154
|
+
e = e.where(o, m, s);
|
|
155
155
|
else if (s) {
|
|
156
|
-
const { ref:
|
|
156
|
+
const { ref: _ } = t.dynamic;
|
|
157
157
|
e = e.where(
|
|
158
|
-
(
|
|
159
|
-
|
|
158
|
+
(d) => d.or(
|
|
159
|
+
r.map((h) => d(_(h), "like", `%${s}%`))
|
|
160
160
|
)
|
|
161
161
|
);
|
|
162
162
|
}
|
|
@@ -166,14 +166,14 @@ function x(t) {
|
|
|
166
166
|
return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
|
|
167
167
|
}
|
|
168
168
|
function Ge(t) {
|
|
169
|
-
return async (e,
|
|
170
|
-
const { page:
|
|
169
|
+
return async (e, a = {}) => {
|
|
170
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
171
171
|
let c = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
172
|
-
if (i && (c =
|
|
172
|
+
if (i && (c = S(t, c, i, ["email", "name"])), s && s.sort_by) {
|
|
173
173
|
const { ref: w } = t.dynamic;
|
|
174
174
|
c = c.orderBy(w(s.sort_by), s.sort_order);
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const _ = await c.offset(r * n).limit(n).selectAll().execute(), d = _.map((w) => w.user_id), h = d.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", d).execute() : [], f = _.map((w) => {
|
|
177
177
|
const b = h.filter(
|
|
178
178
|
(D) => D.linked_to === w.user_id
|
|
179
179
|
);
|
|
@@ -204,63 +204,63 @@ function Ge(t) {
|
|
|
204
204
|
const { count: g } = await c.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
205
205
|
return {
|
|
206
206
|
users: f,
|
|
207
|
-
start:
|
|
207
|
+
start: r * n,
|
|
208
208
|
limit: n,
|
|
209
209
|
length: x(g)
|
|
210
210
|
};
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
function He(t) {
|
|
214
|
-
return async (e,
|
|
214
|
+
return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
for (let
|
|
218
|
-
if (Object.prototype.hasOwnProperty.call(t,
|
|
219
|
-
const n = e ? `${e}_${
|
|
220
|
-
typeof o == "object" && o !== null && !Array.isArray(o) ?
|
|
216
|
+
function L(t, e = "", a = {}) {
|
|
217
|
+
for (let r in t)
|
|
218
|
+
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
219
|
+
const n = e ? `${e}_${r}` : r, o = t[r];
|
|
220
|
+
typeof o == "object" && o !== null && !Array.isArray(o) ? L(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
|
|
221
221
|
}
|
|
222
|
-
return
|
|
222
|
+
return a;
|
|
223
223
|
}
|
|
224
224
|
function ge(t, e) {
|
|
225
|
-
const
|
|
226
|
-
for (const [
|
|
225
|
+
const a = {};
|
|
226
|
+
for (const [r, n] of Object.entries(t)) {
|
|
227
227
|
const o = e.find(
|
|
228
|
-
(s) =>
|
|
228
|
+
(s) => r.startsWith(`${s}_`)
|
|
229
229
|
);
|
|
230
230
|
if (!o)
|
|
231
|
-
r
|
|
231
|
+
a[r] = n;
|
|
232
232
|
else {
|
|
233
|
-
const s =
|
|
234
|
-
|
|
235
|
-
...
|
|
233
|
+
const s = r.slice(o.length + 1);
|
|
234
|
+
a[o] = {
|
|
235
|
+
...a[o],
|
|
236
236
|
[s]: n
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
return
|
|
240
|
+
return a;
|
|
241
241
|
}
|
|
242
242
|
function Ye(t) {
|
|
243
|
-
return async (e,
|
|
244
|
-
const n =
|
|
245
|
-
...
|
|
243
|
+
return async (e, a, r) => {
|
|
244
|
+
const n = L({
|
|
245
|
+
...r,
|
|
246
246
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
247
|
-
app_metadata:
|
|
248
|
-
user_metadata:
|
|
247
|
+
app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
|
|
248
|
+
user_metadata: r.user_metadata ? JSON.stringify(r.user_metadata) : void 0
|
|
249
249
|
});
|
|
250
|
-
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=",
|
|
250
|
+
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
253
|
function Xe(t) {
|
|
254
|
-
return async (e,
|
|
254
|
+
return async (e, a, r, n) => {
|
|
255
255
|
const o = { linked_to: null };
|
|
256
|
-
return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${
|
|
256
|
+
return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${n}`).where("users.linked_to", "=", `${a}`).execute()).length === 1;
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
function Ze(t) {
|
|
260
260
|
return {
|
|
261
|
-
create:
|
|
261
|
+
create: We(t),
|
|
262
262
|
remove: He(t),
|
|
263
|
-
get:
|
|
263
|
+
get: Ve(t),
|
|
264
264
|
list: Ge(t),
|
|
265
265
|
update: Ye(t),
|
|
266
266
|
// TODO - think about this more when other issues fixed
|
|
@@ -268,60 +268,60 @@ function Ze(t) {
|
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
const et = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
271
|
-
let
|
|
272
|
-
let e = "",
|
|
271
|
+
let T = (t = 21) => {
|
|
272
|
+
let e = "", a = crypto.getRandomValues(new Uint8Array(t));
|
|
273
273
|
for (; t--; )
|
|
274
|
-
e += et[
|
|
274
|
+
e += et[a[t] & 63];
|
|
275
275
|
return e;
|
|
276
276
|
};
|
|
277
277
|
function tt(t) {
|
|
278
278
|
return async (e) => {
|
|
279
|
-
const
|
|
280
|
-
id: e.id ||
|
|
279
|
+
const a = {
|
|
280
|
+
id: e.id || T(),
|
|
281
281
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
282
282
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
283
283
|
...e
|
|
284
284
|
};
|
|
285
|
-
return await t.insertInto("tenants").values(
|
|
285
|
+
return await t.insertInto("tenants").values(a).execute(), a;
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function at(t) {
|
|
289
289
|
return async (e) => {
|
|
290
|
-
const
|
|
291
|
-
return
|
|
290
|
+
const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
291
|
+
return a ? y(a) : null;
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function rt(t) {
|
|
295
295
|
return async (e) => {
|
|
296
|
-
let
|
|
297
|
-
const { page:
|
|
296
|
+
let a = t.selectFrom("tenants");
|
|
297
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = e;
|
|
298
298
|
if (s && s.sort_by) {
|
|
299
299
|
const { ref: f } = t.dynamic;
|
|
300
|
-
|
|
300
|
+
a = a.orderBy(f(s.sort_by), s.sort_order);
|
|
301
301
|
}
|
|
302
|
-
i && (
|
|
303
|
-
const
|
|
302
|
+
i && (a = a.where((f) => f.or([f("name", "like", `%${i}%`)])));
|
|
303
|
+
const _ = (await a.offset(r * n).limit(n).selectAll().execute()).map(y);
|
|
304
304
|
if (!o)
|
|
305
305
|
return {
|
|
306
|
-
tenants:
|
|
306
|
+
tenants: _
|
|
307
307
|
};
|
|
308
|
-
const { count:
|
|
308
|
+
const { count: d } = await a.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), h = x(d);
|
|
309
309
|
return {
|
|
310
|
-
tenants:
|
|
311
|
-
start:
|
|
310
|
+
tenants: _,
|
|
311
|
+
start: r * n,
|
|
312
312
|
limit: n,
|
|
313
313
|
length: h
|
|
314
314
|
};
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
function nt(t) {
|
|
318
|
-
return async (e,
|
|
319
|
-
const
|
|
320
|
-
...
|
|
318
|
+
return async (e, a) => {
|
|
319
|
+
const r = {
|
|
320
|
+
...a,
|
|
321
321
|
id: e,
|
|
322
322
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
323
323
|
};
|
|
324
|
-
await t.updateTable("tenants").set(
|
|
324
|
+
await t.updateTable("tenants").set(r).where("id", "=", e).execute();
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
function ot(t) {
|
|
@@ -330,8 +330,8 @@ function ot(t) {
|
|
|
330
330
|
function st(t) {
|
|
331
331
|
return {
|
|
332
332
|
create: tt(t),
|
|
333
|
-
get:
|
|
334
|
-
list:
|
|
333
|
+
get: at(t),
|
|
334
|
+
list: rt(t),
|
|
335
335
|
update: nt(t),
|
|
336
336
|
remove: ot(t)
|
|
337
337
|
};
|
|
@@ -341,23 +341,23 @@ function me(t) {
|
|
|
341
341
|
}
|
|
342
342
|
const it = 1024;
|
|
343
343
|
function lt(t) {
|
|
344
|
-
return async (e,
|
|
344
|
+
return async (e, a) => {
|
|
345
345
|
var n, o, s;
|
|
346
|
-
const
|
|
347
|
-
id:
|
|
348
|
-
...
|
|
349
|
-
user_agent:
|
|
346
|
+
const r = {
|
|
347
|
+
id: T(),
|
|
348
|
+
...a,
|
|
349
|
+
user_agent: a.user_agent.slice(0, it)
|
|
350
350
|
};
|
|
351
351
|
return await t.insertInto("logs").values({
|
|
352
|
-
...
|
|
352
|
+
...r,
|
|
353
353
|
// Truncate long strings to avoid database errors
|
|
354
|
-
description: (n =
|
|
355
|
-
isMobile:
|
|
354
|
+
description: (n = r.description) == null ? void 0 : n.substring(0, 256),
|
|
355
|
+
isMobile: a.isMobile ? 1 : 0,
|
|
356
356
|
tenant_id: e,
|
|
357
|
-
scope: (o =
|
|
358
|
-
auth0_client: me(
|
|
359
|
-
details: (s = me(
|
|
360
|
-
}).execute(),
|
|
357
|
+
scope: (o = a.scope) == null ? void 0 : o.join(","),
|
|
358
|
+
auth0_client: me(a.auth0_client),
|
|
359
|
+
details: (s = me(a.details)) == null ? void 0 : s.substring(0, 8192)
|
|
360
|
+
}).execute(), r;
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
function _e(t) {
|
|
@@ -383,37 +383,37 @@ function we(t) {
|
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
385
|
function ct(t) {
|
|
386
|
-
return async (e,
|
|
387
|
-
const { page:
|
|
386
|
+
return async (e, a = {}) => {
|
|
387
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
388
388
|
let c = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
389
|
-
i && (c =
|
|
390
|
-
let
|
|
389
|
+
i && (c = S(t, c, i, ["user_id", "ip"]));
|
|
390
|
+
let m = c;
|
|
391
391
|
if (s && s.sort_by) {
|
|
392
392
|
const { ref: f } = t.dynamic;
|
|
393
|
-
|
|
393
|
+
m = m.orderBy(f(s.sort_by), s.sort_order);
|
|
394
394
|
}
|
|
395
|
-
|
|
396
|
-
const
|
|
395
|
+
m = m.offset(r * n).limit(n);
|
|
396
|
+
const d = (await m.selectAll().execute()).map(we);
|
|
397
397
|
if (!o)
|
|
398
398
|
return {
|
|
399
|
-
logs:
|
|
399
|
+
logs: d,
|
|
400
400
|
start: 0,
|
|
401
401
|
limit: 0,
|
|
402
402
|
length: 0
|
|
403
403
|
};
|
|
404
404
|
const { count: h } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
405
405
|
return {
|
|
406
|
-
logs:
|
|
407
|
-
start:
|
|
406
|
+
logs: d,
|
|
407
|
+
start: r * n,
|
|
408
408
|
limit: n,
|
|
409
409
|
length: x(h)
|
|
410
410
|
};
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
413
|
function dt(t) {
|
|
414
|
-
return async (e,
|
|
415
|
-
const
|
|
416
|
-
return
|
|
414
|
+
return async (e, a) => {
|
|
415
|
+
const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
|
|
416
|
+
return r ? we(r) : null;
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
419
|
function ut(t) {
|
|
@@ -424,11 +424,11 @@ function ut(t) {
|
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
426
|
function mt(t) {
|
|
427
|
-
return async (e,
|
|
428
|
-
const
|
|
429
|
-
if (!
|
|
427
|
+
return async (e, a) => {
|
|
428
|
+
const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
429
|
+
if (!r)
|
|
430
430
|
return null;
|
|
431
|
-
const { tenant_id: n, device: o, clients: s, ...i } =
|
|
431
|
+
const { tenant_id: n, device: o, clients: s, ...i } = r;
|
|
432
432
|
return {
|
|
433
433
|
...i,
|
|
434
434
|
device: JSON.parse(o),
|
|
@@ -437,63 +437,63 @@ function mt(t) {
|
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
439
|
function _t(t) {
|
|
440
|
-
return async (e,
|
|
441
|
-
const
|
|
442
|
-
...
|
|
440
|
+
return async (e, a) => {
|
|
441
|
+
const r = {
|
|
442
|
+
...a,
|
|
443
443
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
444
444
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
445
445
|
authenticated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
446
446
|
last_interaction_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
447
447
|
};
|
|
448
448
|
return await t.insertInto("sessions").values({
|
|
449
|
-
...
|
|
449
|
+
...r,
|
|
450
450
|
tenant_id: e,
|
|
451
|
-
device: JSON.stringify(
|
|
452
|
-
clients: JSON.stringify(
|
|
453
|
-
}).execute(),
|
|
451
|
+
device: JSON.stringify(a.device),
|
|
452
|
+
clients: JSON.stringify(a.clients)
|
|
453
|
+
}).execute(), r;
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
function ht(t) {
|
|
457
|
-
return async (e,
|
|
457
|
+
return async (e, a) => !!(await t.deleteFrom("sessions").where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
458
458
|
}
|
|
459
459
|
function ft(t) {
|
|
460
|
-
return async (e,
|
|
460
|
+
return async (e, a, r) => {
|
|
461
461
|
const n = {
|
|
462
|
-
...
|
|
462
|
+
...r,
|
|
463
463
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
464
|
-
device:
|
|
465
|
-
clients:
|
|
464
|
+
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
465
|
+
clients: r.clients ? JSON.stringify(r.clients) : void 0
|
|
466
466
|
};
|
|
467
|
-
return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=",
|
|
467
|
+
return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
function pt(t) {
|
|
471
|
-
return async (e,
|
|
472
|
-
const { page:
|
|
471
|
+
return async (e, a = {}) => {
|
|
472
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
473
473
|
let c = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
474
|
-
i && (c =
|
|
475
|
-
let
|
|
474
|
+
i && (c = S(t, c, i, ["user_id", "session_id"]));
|
|
475
|
+
let m = c;
|
|
476
476
|
if (s && s.sort_by) {
|
|
477
477
|
const { ref: g } = t.dynamic;
|
|
478
|
-
|
|
478
|
+
m = m.orderBy(g(s.sort_by), s.sort_order);
|
|
479
479
|
}
|
|
480
|
-
|
|
481
|
-
const
|
|
480
|
+
m = m.offset(r * n).limit(n);
|
|
481
|
+
const d = (await m.selectAll().execute()).map((g) => ({
|
|
482
482
|
...g,
|
|
483
483
|
device: JSON.parse(g.device),
|
|
484
484
|
clients: JSON.parse(g.clients)
|
|
485
485
|
}));
|
|
486
486
|
if (!o)
|
|
487
487
|
return {
|
|
488
|
-
sessions:
|
|
488
|
+
sessions: d,
|
|
489
489
|
start: 0,
|
|
490
490
|
limit: 0,
|
|
491
491
|
length: 0
|
|
492
492
|
};
|
|
493
493
|
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
494
494
|
return {
|
|
495
|
-
sessions:
|
|
496
|
-
start:
|
|
495
|
+
sessions: d,
|
|
496
|
+
start: r * n,
|
|
497
497
|
limit: n,
|
|
498
498
|
length: f
|
|
499
499
|
};
|
|
@@ -509,32 +509,32 @@ function gt(t) {
|
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
function wt(t) {
|
|
512
|
-
return async (e,
|
|
513
|
-
const
|
|
514
|
-
if (!
|
|
512
|
+
return async (e, a) => {
|
|
513
|
+
const r = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", a).selectAll().executeTakeFirst();
|
|
514
|
+
if (!r)
|
|
515
515
|
return null;
|
|
516
|
-
const { tenant_id: n, ...o } =
|
|
516
|
+
const { tenant_id: n, ...o } = r;
|
|
517
517
|
return o;
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
520
|
function yt(t) {
|
|
521
|
-
return async (e,
|
|
522
|
-
const
|
|
523
|
-
...
|
|
521
|
+
return async (e, a) => {
|
|
522
|
+
const r = {
|
|
523
|
+
...a,
|
|
524
524
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
525
525
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
526
526
|
};
|
|
527
527
|
return await t.insertInto("passwords").values({
|
|
528
|
-
...
|
|
528
|
+
...r,
|
|
529
529
|
tenant_id: e
|
|
530
|
-
}).execute(),
|
|
530
|
+
}).execute(), r;
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
533
|
function vt(t) {
|
|
534
|
-
return async (e,
|
|
535
|
-
password:
|
|
534
|
+
return async (e, a) => (await t.updateTable("passwords").set({
|
|
535
|
+
password: a.password,
|
|
536
536
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
537
|
-
}).where("tenant_id", "=", e).where("user_id", "=",
|
|
537
|
+
}).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
|
|
538
538
|
}
|
|
539
539
|
function Nt(t) {
|
|
540
540
|
return {
|
|
@@ -544,55 +544,55 @@ function Nt(t) {
|
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
function Ct(t) {
|
|
547
|
-
return async (e,
|
|
548
|
-
const { page:
|
|
547
|
+
return async (e, a = {}) => {
|
|
548
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
549
549
|
let i = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
550
|
-
s && (i =
|
|
551
|
-
const
|
|
550
|
+
s && (i = S(t, i, s, ["code", "login_id"]));
|
|
551
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
552
552
|
const { tenant_id: f, ...g } = h;
|
|
553
553
|
return Ke.parse(y(g));
|
|
554
554
|
});
|
|
555
555
|
if (!o)
|
|
556
556
|
return {
|
|
557
|
-
codes:
|
|
557
|
+
codes: _,
|
|
558
558
|
start: 0,
|
|
559
559
|
limit: 0,
|
|
560
560
|
length: 0
|
|
561
561
|
};
|
|
562
|
-
const { count:
|
|
562
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
563
563
|
return {
|
|
564
|
-
codes:
|
|
565
|
-
start:
|
|
564
|
+
codes: _,
|
|
565
|
+
start: r * n,
|
|
566
566
|
limit: n,
|
|
567
|
-
length: x(
|
|
567
|
+
length: x(d)
|
|
568
568
|
};
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
571
|
function bt(t) {
|
|
572
|
-
return async (e,
|
|
573
|
-
const
|
|
574
|
-
...
|
|
572
|
+
return async (e, a) => {
|
|
573
|
+
const r = {
|
|
574
|
+
...a,
|
|
575
575
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
576
576
|
};
|
|
577
577
|
return await t.insertInto("codes").values({
|
|
578
|
-
...
|
|
578
|
+
...r,
|
|
579
579
|
tenant_id: e
|
|
580
|
-
}).execute(),
|
|
580
|
+
}).execute(), r;
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function xt(t) {
|
|
584
|
-
return async (e,
|
|
584
|
+
return async (e, a) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
585
585
|
}
|
|
586
586
|
function Tt(t) {
|
|
587
|
-
return async (e,
|
|
588
|
-
let n = t.selectFrom("codes").where("codes.code_id", "=",
|
|
587
|
+
return async (e, a, r) => {
|
|
588
|
+
let n = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
|
|
589
589
|
e.length && (n = n.where("codes.tenant_id", "=", e));
|
|
590
590
|
const o = await n.selectAll().executeTakeFirst();
|
|
591
591
|
return o ? y(o) : null;
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
594
|
function St(t) {
|
|
595
|
-
return async (e,
|
|
595
|
+
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;
|
|
596
596
|
}
|
|
597
597
|
function Ot(t) {
|
|
598
598
|
return {
|
|
@@ -604,24 +604,24 @@ function Ot(t) {
|
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
606
|
function kt(t) {
|
|
607
|
-
return async (e,
|
|
608
|
-
const
|
|
607
|
+
return async (e, a) => {
|
|
608
|
+
const r = {
|
|
609
609
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
610
610
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
611
|
-
...r,
|
|
612
|
-
disable_sign_ups: r.disable_sign_ups ?? !1
|
|
613
|
-
}, n = JSON.stringify(r.allowed_origins), o = JSON.stringify(r.callbacks), s = JSON.stringify(r.web_origins), i = JSON.stringify(r.allowed_logout_urls), c = JSON.stringify(r.allowed_clients);
|
|
614
|
-
return await t.insertInto("applications").values({
|
|
615
611
|
...a,
|
|
612
|
+
disable_sign_ups: a.disable_sign_ups ?? !1
|
|
613
|
+
}, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), i = JSON.stringify(a.allowed_logout_urls), c = JSON.stringify(a.allowed_clients);
|
|
614
|
+
return await t.insertInto("applications").values({
|
|
615
|
+
...r,
|
|
616
616
|
tenant_id: e,
|
|
617
|
-
disable_sign_ups:
|
|
618
|
-
addons:
|
|
617
|
+
disable_sign_ups: a.disable_sign_ups ? 1 : 0,
|
|
618
|
+
addons: a.addons ? JSON.stringify(a.addons) : "{}",
|
|
619
619
|
callbacks: o,
|
|
620
620
|
allowed_origins: n,
|
|
621
621
|
web_origins: s,
|
|
622
622
|
allowed_logout_urls: i,
|
|
623
623
|
allowed_clients: c
|
|
624
|
-
}).execute(),
|
|
624
|
+
}).execute(), r;
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
627
|
function $t(t) {
|
|
@@ -639,36 +639,36 @@ function $t(t) {
|
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
641
|
function It(t) {
|
|
642
|
-
return async (e,
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
...
|
|
646
|
-
disable_sign_ups: !!
|
|
647
|
-
addons: JSON.parse(
|
|
648
|
-
callbacks: JSON.parse(
|
|
649
|
-
allowed_origins: JSON.parse(
|
|
650
|
-
web_origins: JSON.parse(
|
|
651
|
-
allowed_logout_urls: JSON.parse(
|
|
642
|
+
return async (e, a) => {
|
|
643
|
+
const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
|
|
644
|
+
return r ? y({
|
|
645
|
+
...r,
|
|
646
|
+
disable_sign_ups: !!r.disable_sign_ups,
|
|
647
|
+
addons: JSON.parse(r.addons),
|
|
648
|
+
callbacks: JSON.parse(r.callbacks),
|
|
649
|
+
allowed_origins: JSON.parse(r.allowed_origins),
|
|
650
|
+
web_origins: JSON.parse(r.web_origins),
|
|
651
|
+
allowed_logout_urls: JSON.parse(r.allowed_logout_urls)
|
|
652
652
|
}) : null;
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
function Dt(t) {
|
|
656
|
-
return async (e,
|
|
656
|
+
return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
657
657
|
}
|
|
658
658
|
function Pt(t) {
|
|
659
|
-
return async (e,
|
|
659
|
+
return async (e, a, r) => {
|
|
660
660
|
const n = {
|
|
661
|
-
...
|
|
661
|
+
...r,
|
|
662
662
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
663
|
-
allowed_origins:
|
|
664
|
-
callbacks:
|
|
665
|
-
web_origins:
|
|
666
|
-
allowed_logout_urls:
|
|
667
|
-
allowed_clients:
|
|
668
|
-
addons:
|
|
669
|
-
disable_sign_ups:
|
|
663
|
+
allowed_origins: r.allowed_origins ? JSON.stringify(r.allowed_origins) : void 0,
|
|
664
|
+
callbacks: r.callbacks ? JSON.stringify(r.callbacks) : void 0,
|
|
665
|
+
web_origins: r.web_origins ? JSON.stringify(r.web_origins) : void 0,
|
|
666
|
+
allowed_logout_urls: r.allowed_logout_urls ? JSON.stringify(r.allowed_logout_urls) : void 0,
|
|
667
|
+
allowed_clients: r.allowed_clients ? JSON.stringify(r.allowed_clients) : void 0,
|
|
668
|
+
addons: r.addons ? JSON.stringify(r.addons) : "{}",
|
|
669
|
+
disable_sign_ups: r.disable_sign_ups ? 1 : 0
|
|
670
670
|
};
|
|
671
|
-
return await t.updateTable("applications").set(n).where("applications.id", "=",
|
|
671
|
+
return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
function jt(t) {
|
|
@@ -681,27 +681,27 @@ function jt(t) {
|
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
683
|
function Ft(t) {
|
|
684
|
-
return async (e,
|
|
685
|
-
const
|
|
686
|
-
id:
|
|
687
|
-
...
|
|
684
|
+
return async (e, a) => {
|
|
685
|
+
const r = {
|
|
686
|
+
id: T(),
|
|
687
|
+
...a,
|
|
688
688
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
689
689
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
690
690
|
};
|
|
691
691
|
return await t.insertInto("connections").values({
|
|
692
|
-
...
|
|
692
|
+
...r,
|
|
693
693
|
// The connection options will have many different properties depending on the strategy
|
|
694
|
-
options: JSON.stringify(
|
|
694
|
+
options: JSON.stringify(r.options || {}),
|
|
695
695
|
tenant_id: e
|
|
696
|
-
}).execute(),
|
|
696
|
+
}).execute(), r;
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
return async (e,
|
|
701
|
-
const { page:
|
|
699
|
+
function At(t) {
|
|
700
|
+
return async (e, a = {}) => {
|
|
701
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
702
702
|
let i = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
703
|
-
s && (i =
|
|
704
|
-
const
|
|
703
|
+
s && (i = S(t, i, s, ["user_id", "ip"]));
|
|
704
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map(
|
|
705
705
|
(h) => y({
|
|
706
706
|
...h,
|
|
707
707
|
options: JSON.parse(h.options)
|
|
@@ -709,65 +709,65 @@ function Mt(t) {
|
|
|
709
709
|
);
|
|
710
710
|
if (!o)
|
|
711
711
|
return {
|
|
712
|
-
connections:
|
|
712
|
+
connections: _,
|
|
713
713
|
start: 0,
|
|
714
714
|
limit: 0,
|
|
715
715
|
length: 0
|
|
716
716
|
};
|
|
717
|
-
const { count:
|
|
717
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
718
718
|
return {
|
|
719
|
-
connections:
|
|
720
|
-
start:
|
|
719
|
+
connections: _,
|
|
720
|
+
start: r * n,
|
|
721
721
|
limit: n,
|
|
722
|
-
length: x(
|
|
722
|
+
length: x(d)
|
|
723
723
|
};
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
return async (e,
|
|
726
|
+
function Mt(t) {
|
|
727
|
+
return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
728
728
|
}
|
|
729
729
|
function zt(t) {
|
|
730
|
-
return async (e,
|
|
731
|
-
const
|
|
732
|
-
return
|
|
733
|
-
...
|
|
734
|
-
options: JSON.parse(
|
|
730
|
+
return async (e, a) => {
|
|
731
|
+
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
732
|
+
return r ? y({
|
|
733
|
+
...r,
|
|
734
|
+
options: JSON.parse(r.options)
|
|
735
735
|
}) : null;
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return async (e,
|
|
738
|
+
function Jt(t) {
|
|
739
|
+
return async (e, a, r) => {
|
|
740
740
|
const n = {
|
|
741
|
-
...
|
|
741
|
+
...r,
|
|
742
742
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
743
743
|
};
|
|
744
744
|
return await t.updateTable("connections").set({
|
|
745
745
|
...n,
|
|
746
746
|
options: n.options ? JSON.stringify(n.options) : void 0
|
|
747
|
-
}).where("connections.id", "=",
|
|
747
|
+
}).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
750
|
function Et(t) {
|
|
751
751
|
return {
|
|
752
752
|
create: Ft(t),
|
|
753
753
|
get: zt(t),
|
|
754
|
-
list:
|
|
755
|
-
remove:
|
|
756
|
-
update:
|
|
754
|
+
list: At(t),
|
|
755
|
+
remove: Mt(t),
|
|
756
|
+
update: Jt(t)
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Lt(t) {
|
|
760
760
|
return {
|
|
761
761
|
get: async (e) => {
|
|
762
|
-
const
|
|
763
|
-
if (!r)
|
|
764
|
-
return null;
|
|
765
|
-
const a = await t.selectFrom("tenants").selectAll().where("id", "=", r.tenant_id).executeTakeFirst();
|
|
762
|
+
const a = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
766
763
|
if (!a)
|
|
767
|
-
|
|
768
|
-
const
|
|
764
|
+
return null;
|
|
765
|
+
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
766
|
+
if (!r)
|
|
767
|
+
throw new q(404, { message: "Tenant not found" });
|
|
768
|
+
const n = await t.selectFrom("connections").where("tenant_id", "=", a.tenant_id).selectAll().execute();
|
|
769
769
|
return {
|
|
770
|
-
...
|
|
770
|
+
...a,
|
|
771
771
|
connections: n.map(
|
|
772
772
|
(s) => Ue.parse(
|
|
773
773
|
y({
|
|
@@ -776,15 +776,15 @@ function Jt(t) {
|
|
|
776
776
|
})
|
|
777
777
|
)
|
|
778
778
|
),
|
|
779
|
-
addons:
|
|
780
|
-
callbacks:
|
|
781
|
-
allowed_origins:
|
|
782
|
-
web_origins:
|
|
783
|
-
allowed_logout_urls:
|
|
784
|
-
allowed_clients:
|
|
785
|
-
tenant: y(
|
|
779
|
+
addons: a.addons ? JSON.parse(a.addons) : {},
|
|
780
|
+
callbacks: a.callbacks ? JSON.parse(a.callbacks) : [],
|
|
781
|
+
allowed_origins: a.allowed_origins ? JSON.parse(a.allowed_origins) : [],
|
|
782
|
+
web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
|
|
783
|
+
allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : [],
|
|
784
|
+
allowed_clients: a.allowed_clients ? JSON.parse(a.allowed_clients) : [],
|
|
785
|
+
tenant: y(r),
|
|
786
786
|
// this is really an integer in the database
|
|
787
|
-
disable_sign_ups: !!
|
|
787
|
+
disable_sign_ups: !!a.disable_sign_ups
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
790
|
};
|
|
@@ -792,8 +792,8 @@ function Jt(t) {
|
|
|
792
792
|
function Rt(t) {
|
|
793
793
|
return async (e = {}) => {
|
|
794
794
|
const {
|
|
795
|
-
page:
|
|
796
|
-
per_page:
|
|
795
|
+
page: a = 0,
|
|
796
|
+
per_page: r = 100,
|
|
797
797
|
include_totals: n = !1,
|
|
798
798
|
sort: o,
|
|
799
799
|
q: s
|
|
@@ -804,7 +804,7 @@ function Rt(t) {
|
|
|
804
804
|
f("revoked_at", "is", null)
|
|
805
805
|
])
|
|
806
806
|
);
|
|
807
|
-
s && (i =
|
|
807
|
+
s && (i = S(t, i, s, [
|
|
808
808
|
"kid",
|
|
809
809
|
"connection",
|
|
810
810
|
"fingerprint",
|
|
@@ -812,21 +812,21 @@ function Rt(t) {
|
|
|
812
812
|
"type"
|
|
813
813
|
]));
|
|
814
814
|
let c = i.select((f) => f.fn.count("kid").as("count"));
|
|
815
|
-
const
|
|
816
|
-
i = i.limit(
|
|
817
|
-
const
|
|
815
|
+
const m = a * r;
|
|
816
|
+
i = i.limit(r).offset(m), o && (i = i.orderBy(o.sort_by, o.sort_order));
|
|
817
|
+
const _ = await i.selectAll().execute();
|
|
818
818
|
if (!n)
|
|
819
819
|
return {
|
|
820
|
-
signingKeys:
|
|
820
|
+
signingKeys: _,
|
|
821
821
|
start: 0,
|
|
822
822
|
limit: 0,
|
|
823
823
|
length: 0
|
|
824
824
|
};
|
|
825
|
-
const
|
|
825
|
+
const d = await c.executeTakeFirst(), h = x((d == null ? void 0 : d.count) ?? 0);
|
|
826
826
|
return {
|
|
827
|
-
signingKeys:
|
|
828
|
-
start:
|
|
829
|
-
limit:
|
|
827
|
+
signingKeys: _,
|
|
828
|
+
start: m,
|
|
829
|
+
limit: r,
|
|
830
830
|
length: h
|
|
831
831
|
};
|
|
832
832
|
};
|
|
@@ -837,7 +837,7 @@ function Kt(t) {
|
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
839
|
function Ut(t) {
|
|
840
|
-
return async (e,
|
|
840
|
+
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
841
841
|
}
|
|
842
842
|
function Bt(t) {
|
|
843
843
|
return {
|
|
@@ -846,87 +846,87 @@ function Bt(t) {
|
|
|
846
846
|
update: Ut(t)
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
return async (e,
|
|
851
|
-
const
|
|
852
|
-
custom_domain_id:
|
|
849
|
+
function qt(t) {
|
|
850
|
+
return async (e, a) => {
|
|
851
|
+
const r = {
|
|
852
|
+
custom_domain_id: T(),
|
|
853
853
|
status: "pending",
|
|
854
854
|
primary: !1,
|
|
855
|
-
...
|
|
855
|
+
...a
|
|
856
856
|
};
|
|
857
857
|
return await t.insertInto("custom_domains").values({
|
|
858
|
-
...
|
|
858
|
+
...r,
|
|
859
859
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
860
860
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
861
861
|
tenant_id: e,
|
|
862
|
-
primary:
|
|
863
|
-
}).execute(),
|
|
862
|
+
primary: r.primary ? 1 : 0
|
|
863
|
+
}).execute(), r;
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
867
|
-
return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((
|
|
868
|
-
...
|
|
869
|
-
primary:
|
|
866
|
+
function Qt(t) {
|
|
867
|
+
return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
|
|
868
|
+
...r,
|
|
869
|
+
primary: r.primary === 1
|
|
870
870
|
}));
|
|
871
871
|
}
|
|
872
|
-
function Vt(t) {
|
|
873
|
-
return async (e, r) => (await t.deleteFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", r).execute()).length > 0;
|
|
874
|
-
}
|
|
875
872
|
function Wt(t) {
|
|
876
|
-
return async (e,
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
873
|
+
return async (e, a) => (await t.deleteFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
874
|
+
}
|
|
875
|
+
function Vt(t) {
|
|
876
|
+
return async (e, a) => {
|
|
877
|
+
const r = await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).selectAll().executeTakeFirst();
|
|
878
|
+
return r ? {
|
|
879
|
+
...r,
|
|
880
|
+
primary: r.primary === 1
|
|
881
881
|
} : null;
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
function Gt(t) {
|
|
885
|
-
return async (e,
|
|
885
|
+
return async (e, a, r) => {
|
|
886
886
|
const n = {
|
|
887
|
-
...
|
|
887
|
+
...r,
|
|
888
888
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
889
|
-
primary:
|
|
889
|
+
primary: r.primary ? 1 : 0
|
|
890
890
|
};
|
|
891
|
-
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=",
|
|
891
|
+
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
894
|
function Ht(t) {
|
|
895
895
|
return async (e) => {
|
|
896
|
-
const
|
|
897
|
-
return
|
|
898
|
-
...
|
|
899
|
-
primary:
|
|
896
|
+
const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
|
|
897
|
+
return a ? {
|
|
898
|
+
...a,
|
|
899
|
+
primary: a.primary === 1
|
|
900
900
|
} : null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
903
|
function Yt(t) {
|
|
904
904
|
return {
|
|
905
|
-
create:
|
|
906
|
-
get:
|
|
905
|
+
create: qt(t),
|
|
906
|
+
get: Vt(t),
|
|
907
907
|
getByDomain: Ht(t),
|
|
908
|
-
list:
|
|
909
|
-
remove:
|
|
908
|
+
list: Qt(t),
|
|
909
|
+
remove: Wt(t),
|
|
910
910
|
update: Gt(t)
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
913
|
function Xt(t) {
|
|
914
914
|
return async (e) => {
|
|
915
|
-
const [
|
|
916
|
-
if (!
|
|
915
|
+
const [a] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
916
|
+
if (!a)
|
|
917
917
|
return null;
|
|
918
918
|
const {
|
|
919
|
-
tenant_id:
|
|
919
|
+
tenant_id: r,
|
|
920
920
|
colors_primary: n,
|
|
921
921
|
colors_page_background_type: o,
|
|
922
922
|
colors_page_background_start: s,
|
|
923
923
|
colors_page_background_end: i,
|
|
924
924
|
colors_page_background_angle_dev: c,
|
|
925
|
-
font_url:
|
|
926
|
-
...
|
|
927
|
-
} =
|
|
925
|
+
font_url: m,
|
|
926
|
+
..._
|
|
927
|
+
} = a;
|
|
928
928
|
return y({
|
|
929
|
-
...
|
|
929
|
+
..._,
|
|
930
930
|
colors: {
|
|
931
931
|
primary: n,
|
|
932
932
|
page_background: {
|
|
@@ -936,50 +936,50 @@ function Xt(t) {
|
|
|
936
936
|
angle_deg: c
|
|
937
937
|
}
|
|
938
938
|
},
|
|
939
|
-
font:
|
|
939
|
+
font: m ? { url: m } : void 0
|
|
940
940
|
});
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
function Zt(t) {
|
|
944
|
-
return async (e,
|
|
945
|
-
var s, i, c,
|
|
946
|
-
const { colors:
|
|
944
|
+
return async (e, a) => {
|
|
945
|
+
var s, i, c, m, _, d, h, f, g, w, b, D, A, P, V, le, ce, de;
|
|
946
|
+
const { colors: r, font: n, ...o } = a;
|
|
947
947
|
try {
|
|
948
948
|
await t.insertInto("branding").values({
|
|
949
949
|
...o,
|
|
950
|
-
colors_primary:
|
|
951
|
-
colors_page_background_type: (i = (s =
|
|
952
|
-
colors_page_background_start: (
|
|
953
|
-
colors_page_background_end: (
|
|
954
|
-
colors_page_background_angle_dev: (f = (h =
|
|
955
|
-
font_url: (g =
|
|
950
|
+
colors_primary: r == null ? void 0 : r.primary,
|
|
951
|
+
colors_page_background_type: (i = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : i.type,
|
|
952
|
+
colors_page_background_start: (m = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : m.start,
|
|
953
|
+
colors_page_background_end: (d = (_ = a.colors) == null ? void 0 : _.page_background) == null ? void 0 : d.end,
|
|
954
|
+
colors_page_background_angle_dev: (f = (h = a.colors) == null ? void 0 : h.page_background) == null ? void 0 : f.angle_deg,
|
|
955
|
+
font_url: (g = a.font) == null ? void 0 : g.url,
|
|
956
956
|
tenant_id: e
|
|
957
957
|
}).execute();
|
|
958
958
|
} catch {
|
|
959
959
|
await t.updateTable("branding").set({
|
|
960
960
|
...o,
|
|
961
|
-
colors_primary:
|
|
962
|
-
colors_page_background_type: (b = (w =
|
|
963
|
-
colors_page_background_start: (
|
|
964
|
-
colors_page_background_end: (V = (P =
|
|
965
|
-
colors_page_background_angle_dev: (ce = (le =
|
|
966
|
-
font_url: (de =
|
|
961
|
+
colors_primary: r == null ? void 0 : r.primary,
|
|
962
|
+
colors_page_background_type: (b = (w = a.colors) == null ? void 0 : w.page_background) == null ? void 0 : b.type,
|
|
963
|
+
colors_page_background_start: (A = (D = a.colors) == null ? void 0 : D.page_background) == null ? void 0 : A.start,
|
|
964
|
+
colors_page_background_end: (V = (P = a.colors) == null ? void 0 : P.page_background) == null ? void 0 : V.end,
|
|
965
|
+
colors_page_background_angle_dev: (ce = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : ce.angle_deg,
|
|
966
|
+
font_url: (de = a.font) == null ? void 0 : de.url
|
|
967
967
|
}).where("tenant_id", "=", e).execute();
|
|
968
968
|
}
|
|
969
969
|
};
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function ea(t) {
|
|
972
972
|
return {
|
|
973
973
|
get: Xt(t),
|
|
974
974
|
set: Zt(t)
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
function
|
|
978
|
-
return async (e,
|
|
979
|
-
const { page:
|
|
977
|
+
function ta(t) {
|
|
978
|
+
return async (e, a = {}) => {
|
|
979
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
980
980
|
let i = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
981
|
-
s && (i =
|
|
982
|
-
const
|
|
981
|
+
s && (i = S(t, i, s, ["url", "form_id"]));
|
|
982
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
983
983
|
const { tenant_id: f, enabled: g, synchronous: w, ...b } = h;
|
|
984
984
|
return y({
|
|
985
985
|
...b,
|
|
@@ -989,100 +989,100 @@ function tr(t) {
|
|
|
989
989
|
});
|
|
990
990
|
if (!o)
|
|
991
991
|
return {
|
|
992
|
-
hooks:
|
|
992
|
+
hooks: _,
|
|
993
993
|
start: 0,
|
|
994
994
|
limit: 0,
|
|
995
995
|
length: 0
|
|
996
996
|
};
|
|
997
|
-
const { count:
|
|
997
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
998
998
|
return {
|
|
999
|
-
hooks:
|
|
1000
|
-
start:
|
|
999
|
+
hooks: _,
|
|
1000
|
+
start: r * n,
|
|
1001
1001
|
limit: n,
|
|
1002
|
-
length: x(
|
|
1002
|
+
length: x(d)
|
|
1003
1003
|
};
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return async (e,
|
|
1008
|
-
const
|
|
1009
|
-
return
|
|
1010
|
-
...
|
|
1011
|
-
enabled: !!
|
|
1012
|
-
synchronous: !!
|
|
1006
|
+
function aa(t) {
|
|
1007
|
+
return async (e, a) => {
|
|
1008
|
+
const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
|
|
1009
|
+
return r ? y({
|
|
1010
|
+
...r,
|
|
1011
|
+
enabled: !!r.enabled,
|
|
1012
|
+
synchronous: !!r.synchronous
|
|
1013
1013
|
}) : null;
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return async (e,
|
|
1016
|
+
function ra(t) {
|
|
1017
|
+
return async (e, a) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return async (e,
|
|
1021
|
-
const
|
|
1022
|
-
hook_id:
|
|
1023
|
-
...
|
|
1019
|
+
function na(t) {
|
|
1020
|
+
return async (e, a) => {
|
|
1021
|
+
const r = {
|
|
1022
|
+
hook_id: T(),
|
|
1023
|
+
...a,
|
|
1024
1024
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1025
1025
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1026
1026
|
};
|
|
1027
1027
|
return await t.insertInto("hooks").values({
|
|
1028
|
-
...
|
|
1028
|
+
...r,
|
|
1029
1029
|
tenant_id: e,
|
|
1030
|
-
enabled:
|
|
1031
|
-
synchronous:
|
|
1032
|
-
}).execute(),
|
|
1030
|
+
enabled: a.enabled ? 1 : 0,
|
|
1031
|
+
synchronous: a.synchronous ? 1 : 0
|
|
1032
|
+
}).execute(), r;
|
|
1033
1033
|
};
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return async (e,
|
|
1035
|
+
function oa(t) {
|
|
1036
|
+
return async (e, a, r) => {
|
|
1037
1037
|
const n = {
|
|
1038
|
-
...
|
|
1038
|
+
...r,
|
|
1039
1039
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1040
|
-
enabled:
|
|
1041
|
-
synchronous:
|
|
1040
|
+
enabled: r.enabled !== void 0 ? r.enabled ? 1 : 0 : void 0,
|
|
1041
|
+
synchronous: r.enabled !== void 0 ? r.synchronous ? 1 : 0 : void 0
|
|
1042
1042
|
};
|
|
1043
|
-
return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=",
|
|
1043
|
+
return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=", a).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function sa(t) {
|
|
1047
1047
|
return {
|
|
1048
|
-
create:
|
|
1049
|
-
get:
|
|
1050
|
-
list:
|
|
1051
|
-
update:
|
|
1052
|
-
remove:
|
|
1048
|
+
create: na(t),
|
|
1049
|
+
get: aa(t),
|
|
1050
|
+
list: ta(t),
|
|
1051
|
+
update: oa(t),
|
|
1052
|
+
remove: ra(t)
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return async (e,
|
|
1057
|
-
const
|
|
1058
|
-
themeId:
|
|
1055
|
+
function ia(t) {
|
|
1056
|
+
return async (e, a) => {
|
|
1057
|
+
const r = {
|
|
1058
|
+
themeId: T(),
|
|
1059
1059
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1060
1060
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1061
|
-
...
|
|
1061
|
+
...a
|
|
1062
1062
|
}, n = {
|
|
1063
|
-
...
|
|
1063
|
+
...r,
|
|
1064
1064
|
tenant_id: e
|
|
1065
1065
|
};
|
|
1066
|
-
return await t.insertInto("themes").values(
|
|
1066
|
+
return await t.insertInto("themes").values(L(n)).execute(), r;
|
|
1067
1067
|
};
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return async (e,
|
|
1069
|
+
function la(t) {
|
|
1070
|
+
return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return async (e,
|
|
1074
|
-
const
|
|
1075
|
-
if (!
|
|
1072
|
+
function ca(t) {
|
|
1073
|
+
return async (e, a) => {
|
|
1074
|
+
const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).selectAll().executeTakeFirst();
|
|
1075
|
+
if (!r)
|
|
1076
1076
|
return null;
|
|
1077
1077
|
const n = {
|
|
1078
|
-
...
|
|
1079
|
-
borders_show_widget_shadow: !!
|
|
1080
|
-
fonts_body_text_bold: !!
|
|
1081
|
-
fonts_buttons_text_bold: !!
|
|
1082
|
-
fonts_input_labels_bold: !!
|
|
1083
|
-
fonts_links_bold: !!
|
|
1084
|
-
fonts_subtitle_bold: !!
|
|
1085
|
-
fonts_title_bold: !!
|
|
1078
|
+
...r,
|
|
1079
|
+
borders_show_widget_shadow: !!r.borders_show_widget_shadow,
|
|
1080
|
+
fonts_body_text_bold: !!r.fonts_body_text_bold,
|
|
1081
|
+
fonts_buttons_text_bold: !!r.fonts_buttons_text_bold,
|
|
1082
|
+
fonts_input_labels_bold: !!r.fonts_input_labels_bold,
|
|
1083
|
+
fonts_links_bold: !!r.fonts_links_bold,
|
|
1084
|
+
fonts_subtitle_bold: !!r.fonts_subtitle_bold,
|
|
1085
|
+
fonts_title_bold: !!r.fonts_title_bold
|
|
1086
1086
|
};
|
|
1087
1087
|
return y(
|
|
1088
1088
|
ge(n, [
|
|
@@ -1095,80 +1095,80 @@ function cr(t) {
|
|
|
1095
1095
|
);
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return async (e,
|
|
1100
|
-
const n =
|
|
1101
|
-
...
|
|
1098
|
+
function da(t) {
|
|
1099
|
+
return async (e, a, r) => {
|
|
1100
|
+
const n = L({
|
|
1101
|
+
...r,
|
|
1102
1102
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1103
1103
|
});
|
|
1104
|
-
return await t.updateTable("themes").set(n).where("themes.themeId", "=",
|
|
1104
|
+
return await t.updateTable("themes").set(n).where("themes.themeId", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function ua(t) {
|
|
1108
1108
|
return {
|
|
1109
|
-
create:
|
|
1110
|
-
get:
|
|
1111
|
-
remove:
|
|
1112
|
-
update:
|
|
1109
|
+
create: ia(t),
|
|
1110
|
+
get: ca(t),
|
|
1111
|
+
remove: la(t),
|
|
1112
|
+
update: da(t)
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1116
|
-
return async (e,
|
|
1117
|
-
const
|
|
1118
|
-
return
|
|
1115
|
+
function ma(t) {
|
|
1116
|
+
return async (e, a) => {
|
|
1117
|
+
const r = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1118
|
+
return r ? Be.parse(
|
|
1119
1119
|
ge(
|
|
1120
1120
|
y({
|
|
1121
|
-
...
|
|
1122
|
-
login_completed: !!
|
|
1121
|
+
...r,
|
|
1122
|
+
login_completed: !!r.login_completed
|
|
1123
1123
|
}),
|
|
1124
1124
|
["authParams"]
|
|
1125
1125
|
)
|
|
1126
1126
|
) : null;
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return async (e,
|
|
1129
|
+
function _a(t) {
|
|
1130
|
+
return async (e, a) => {
|
|
1131
1131
|
var n;
|
|
1132
|
-
const
|
|
1133
|
-
id:
|
|
1134
|
-
...
|
|
1135
|
-
authorization_url: (n =
|
|
1132
|
+
const r = {
|
|
1133
|
+
id: T(),
|
|
1134
|
+
...a,
|
|
1135
|
+
authorization_url: (n = a.authorization_url) == null ? void 0 : n.slice(0, 1024),
|
|
1136
1136
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1137
1137
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1138
|
-
login_completed: !!
|
|
1138
|
+
login_completed: !!a.login_completed
|
|
1139
1139
|
};
|
|
1140
1140
|
return await t.insertInto("login_sessions").values({
|
|
1141
|
-
...
|
|
1141
|
+
...L(r),
|
|
1142
1142
|
tenant_id: e
|
|
1143
|
-
}).execute(),
|
|
1143
|
+
}).execute(), r;
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return async (e,
|
|
1148
|
-
|
|
1149
|
-
...
|
|
1146
|
+
function ha(t) {
|
|
1147
|
+
return async (e, a, r) => (await t.updateTable("login_sessions").set(
|
|
1148
|
+
L({
|
|
1149
|
+
...r
|
|
1150
1150
|
})
|
|
1151
|
-
).where("login_sessions.id", "=",
|
|
1151
|
+
).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1154
|
-
return async (e,
|
|
1153
|
+
function fa(t) {
|
|
1154
|
+
return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function pa(t) {
|
|
1157
1157
|
return {
|
|
1158
|
-
create:
|
|
1159
|
-
get:
|
|
1160
|
-
update:
|
|
1161
|
-
remove:
|
|
1158
|
+
create: _a(t),
|
|
1159
|
+
get: ma(t),
|
|
1160
|
+
update: ha(t),
|
|
1161
|
+
remove: fa(t)
|
|
1162
1162
|
};
|
|
1163
1163
|
}
|
|
1164
|
-
function
|
|
1164
|
+
function ga(t) {
|
|
1165
1165
|
return async (e) => {
|
|
1166
|
-
const [
|
|
1166
|
+
const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
1167
1167
|
return y({
|
|
1168
|
-
identifier_first: !!(
|
|
1169
|
-
password_first: !!(
|
|
1170
|
-
webauthn_platform_first_factor: !!(
|
|
1171
|
-
universal_login_experience: (
|
|
1168
|
+
identifier_first: !!(a != null && a.identifier_first),
|
|
1169
|
+
password_first: !!(a != null && a.password_first),
|
|
1170
|
+
webauthn_platform_first_factor: !!(a != null && a.webauthn_platform_first_factor),
|
|
1171
|
+
universal_login_experience: (a == null ? void 0 : a.universal_login_experience) || "new"
|
|
1172
1172
|
});
|
|
1173
1173
|
};
|
|
1174
1174
|
}
|
|
@@ -1181,37 +1181,37 @@ function he(t) {
|
|
|
1181
1181
|
universal_login_experience: t.universal_login_experience
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1185
|
-
return async (e,
|
|
1184
|
+
function wa(t) {
|
|
1185
|
+
return async (e, a) => {
|
|
1186
1186
|
try {
|
|
1187
|
-
const
|
|
1187
|
+
const r = qe.parse(a);
|
|
1188
1188
|
await t.insertInto("prompt_settings").values({
|
|
1189
|
-
...he(
|
|
1189
|
+
...he(r),
|
|
1190
1190
|
tenant_id: e
|
|
1191
1191
|
}).execute();
|
|
1192
1192
|
} catch {
|
|
1193
|
-
await t.updateTable("prompt_settings").set(he(
|
|
1193
|
+
await t.updateTable("prompt_settings").set(he(a)).where("tenant_id", "=", e).execute();
|
|
1194
1194
|
}
|
|
1195
1195
|
};
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function ya(t) {
|
|
1198
1198
|
return {
|
|
1199
|
-
get:
|
|
1200
|
-
set:
|
|
1199
|
+
get: ga(t),
|
|
1200
|
+
set: wa(t)
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
|
-
function
|
|
1203
|
+
function va(t) {
|
|
1204
1204
|
return async (e) => {
|
|
1205
|
-
const [
|
|
1206
|
-
if (!
|
|
1205
|
+
const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
|
|
1206
|
+
if (!a)
|
|
1207
1207
|
return null;
|
|
1208
1208
|
const {
|
|
1209
|
-
tenant_id:
|
|
1209
|
+
tenant_id: r,
|
|
1210
1210
|
credentials: n,
|
|
1211
1211
|
settings: o,
|
|
1212
1212
|
enabled: s,
|
|
1213
1213
|
...i
|
|
1214
|
-
} =
|
|
1214
|
+
} = a;
|
|
1215
1215
|
return y({
|
|
1216
1216
|
...i,
|
|
1217
1217
|
credentials: JSON.parse(n),
|
|
@@ -1220,24 +1220,24 @@ function vr(t) {
|
|
|
1220
1220
|
});
|
|
1221
1221
|
};
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return async (e,
|
|
1225
|
-
const { credentials:
|
|
1223
|
+
function Na(t) {
|
|
1224
|
+
return async (e, a) => {
|
|
1225
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1226
1226
|
await t.updateTable("email_providers").set({
|
|
1227
1227
|
...s,
|
|
1228
|
-
credentials:
|
|
1228
|
+
credentials: r ? JSON.stringify(r) : void 0,
|
|
1229
1229
|
settings: n ? JSON.stringify(n) : void 0,
|
|
1230
1230
|
enabled: o !== void 0 ? o ? 1 : 0 : void 0
|
|
1231
1231
|
}).where("tenant_id", "=", e).execute();
|
|
1232
1232
|
};
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1235
|
-
return async (e,
|
|
1236
|
-
const { credentials:
|
|
1234
|
+
function Ca(t) {
|
|
1235
|
+
return async (e, a) => {
|
|
1236
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1237
1237
|
await t.insertInto("email_providers").values({
|
|
1238
1238
|
...s,
|
|
1239
1239
|
enabled: o ? 1 : 0,
|
|
1240
|
-
credentials: JSON.stringify(
|
|
1240
|
+
credentials: JSON.stringify(r),
|
|
1241
1241
|
settings: JSON.stringify(n),
|
|
1242
1242
|
tenant_id: e,
|
|
1243
1243
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1245,65 +1245,65 @@ function Cr(t) {
|
|
|
1245
1245
|
}).execute();
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function ba(t) {
|
|
1249
1249
|
return {
|
|
1250
|
-
get:
|
|
1251
|
-
create:
|
|
1252
|
-
update:
|
|
1250
|
+
get: va(t),
|
|
1251
|
+
create: Ca(t),
|
|
1252
|
+
update: Na(t)
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return async (e,
|
|
1257
|
-
const
|
|
1258
|
-
return
|
|
1259
|
-
...
|
|
1260
|
-
rotating: !!
|
|
1261
|
-
device:
|
|
1262
|
-
resource_servers:
|
|
1255
|
+
function xa(t) {
|
|
1256
|
+
return async (e, a) => {
|
|
1257
|
+
const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
|
|
1258
|
+
return r ? {
|
|
1259
|
+
...r,
|
|
1260
|
+
rotating: !!r.rotating,
|
|
1261
|
+
device: r.device ? JSON.parse(r.device) : {},
|
|
1262
|
+
resource_servers: r.resource_servers ? JSON.parse(r.resource_servers) : []
|
|
1263
1263
|
} : null;
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1267
|
-
return async (e,
|
|
1268
|
-
const
|
|
1269
|
-
...
|
|
1266
|
+
function Ta(t) {
|
|
1267
|
+
return async (e, a) => {
|
|
1268
|
+
const r = {
|
|
1269
|
+
...a,
|
|
1270
1270
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1271
1271
|
};
|
|
1272
1272
|
return await t.insertInto("refresh_tokens").values({
|
|
1273
|
-
...
|
|
1273
|
+
...r,
|
|
1274
1274
|
tenant_id: e,
|
|
1275
|
-
rotating:
|
|
1276
|
-
device: JSON.stringify(
|
|
1277
|
-
resource_servers: JSON.stringify(
|
|
1278
|
-
}).execute(), { ...
|
|
1275
|
+
rotating: a.rotating ? 1 : 0,
|
|
1276
|
+
device: JSON.stringify(a.device),
|
|
1277
|
+
resource_servers: JSON.stringify(a.resource_servers)
|
|
1278
|
+
}).execute(), { ...a, ...r };
|
|
1279
1279
|
};
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return async (e,
|
|
1281
|
+
function Sa(t) {
|
|
1282
|
+
return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return async (e,
|
|
1284
|
+
function Oa(t) {
|
|
1285
|
+
return async (e, a, r) => {
|
|
1286
1286
|
const n = {
|
|
1287
|
-
...
|
|
1288
|
-
device:
|
|
1289
|
-
resource_servers:
|
|
1290
|
-
rotating:
|
|
1287
|
+
...r,
|
|
1288
|
+
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
1289
|
+
resource_servers: r.resource_servers ? JSON.stringify(r.resource_servers) : void 0,
|
|
1290
|
+
rotating: r.rotating ? 1 : 0
|
|
1291
1291
|
};
|
|
1292
|
-
return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=",
|
|
1292
|
+
return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return async (e,
|
|
1297
|
-
const { page:
|
|
1295
|
+
function ka(t) {
|
|
1296
|
+
return async (e, a = {}) => {
|
|
1297
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
1298
1298
|
let c = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1299
|
-
i && (c =
|
|
1300
|
-
let
|
|
1299
|
+
i && (c = S(t, c, i, ["token", "session_id"]));
|
|
1300
|
+
let m = c;
|
|
1301
1301
|
if (s && s.sort_by) {
|
|
1302
1302
|
const { ref: g } = t.dynamic;
|
|
1303
|
-
|
|
1303
|
+
m = m.orderBy(g(s.sort_by), s.sort_order);
|
|
1304
1304
|
}
|
|
1305
|
-
|
|
1306
|
-
const
|
|
1305
|
+
m = m.offset(r * n).limit(n);
|
|
1306
|
+
const d = (await m.selectAll().execute()).map((g) => ({
|
|
1307
1307
|
...g,
|
|
1308
1308
|
rotating: !!g.rotating,
|
|
1309
1309
|
device: g.device ? JSON.parse(g.device) : {},
|
|
@@ -1311,46 +1311,46 @@ function kr(t) {
|
|
|
1311
1311
|
}));
|
|
1312
1312
|
if (!o)
|
|
1313
1313
|
return {
|
|
1314
|
-
refresh_tokens:
|
|
1314
|
+
refresh_tokens: d,
|
|
1315
1315
|
start: 0,
|
|
1316
1316
|
limit: 0,
|
|
1317
1317
|
length: 0
|
|
1318
1318
|
};
|
|
1319
1319
|
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
1320
1320
|
return {
|
|
1321
|
-
refresh_tokens:
|
|
1322
|
-
start:
|
|
1321
|
+
refresh_tokens: d,
|
|
1322
|
+
start: r * n,
|
|
1323
1323
|
limit: n,
|
|
1324
1324
|
length: f
|
|
1325
1325
|
};
|
|
1326
1326
|
};
|
|
1327
1327
|
}
|
|
1328
|
-
function $
|
|
1328
|
+
function $a(t) {
|
|
1329
1329
|
return {
|
|
1330
|
-
create:
|
|
1331
|
-
get:
|
|
1332
|
-
list:
|
|
1333
|
-
remove:
|
|
1334
|
-
update:
|
|
1330
|
+
create: Ta(t),
|
|
1331
|
+
get: xa(t),
|
|
1332
|
+
list: ka(t),
|
|
1333
|
+
remove: Sa(t),
|
|
1334
|
+
update: Oa(t)
|
|
1335
1335
|
};
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Ia(t) {
|
|
1338
1338
|
return async () => {
|
|
1339
|
-
const e = new Date(Date.now() - 864e5).toISOString(),
|
|
1339
|
+
const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
|
|
1340
1340
|
Date.now() - 1e3 * 60 * 60 * 24 * 7
|
|
1341
|
-
).toISOString(),
|
|
1341
|
+
).toISOString(), r = new Date(
|
|
1342
1342
|
Date.now() - 1e3 * 60 * 60 * 24 * 30 * 3
|
|
1343
1343
|
).toISOString();
|
|
1344
|
-
console.log("delete codes"), await t.deleteFrom("codes").where("created_at", "<", e).limit(1e5).execute(), console.log("delete sessions"), await t.deleteFrom("login_sessions").where("created_at", "<",
|
|
1344
|
+
console.log("delete codes"), await t.deleteFrom("codes").where("created_at", "<", e).limit(1e5).execute(), console.log("delete sessions"), await t.deleteFrom("login_sessions").where("created_at", "<", a).where("session_id", "is", null).limit(1e5).execute(), console.log("delete logs"), await t.deleteFrom("logs").where("date", "<", r).limit(1e5).execute(), console.log("delete refresh tokens"), await t.deleteFrom("refresh_tokens").where(
|
|
1345
1345
|
(o) => o.or([
|
|
1346
|
-
o("expires_at", "<",
|
|
1347
|
-
o("idle_expires_at", "<",
|
|
1346
|
+
o("expires_at", "<", a),
|
|
1347
|
+
o("idle_expires_at", "<", a)
|
|
1348
1348
|
])
|
|
1349
1349
|
).limit(1e4).execute(), console.log("delete sessions");
|
|
1350
1350
|
const n = await t.selectFrom("sessions").select("id").where(
|
|
1351
1351
|
(o) => o.or([
|
|
1352
|
-
o("expires_at", "<",
|
|
1353
|
-
o("idle_expires_at", "<",
|
|
1352
|
+
o("expires_at", "<", a),
|
|
1353
|
+
o("idle_expires_at", "<", a)
|
|
1354
1354
|
])
|
|
1355
1355
|
).where(
|
|
1356
1356
|
"id",
|
|
@@ -1364,30 +1364,30 @@ function Ir(t) {
|
|
|
1364
1364
|
).execute(), console.log("cleanup complete");
|
|
1365
1365
|
};
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1368
|
-
return async (e,
|
|
1369
|
-
const
|
|
1370
|
-
id:
|
|
1371
|
-
...
|
|
1367
|
+
function Da(t) {
|
|
1368
|
+
return async (e, a) => {
|
|
1369
|
+
const r = H.parse({
|
|
1370
|
+
id: T(),
|
|
1371
|
+
...a,
|
|
1372
1372
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1373
1373
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1374
1374
|
});
|
|
1375
1375
|
return await t.insertInto("forms").values({
|
|
1376
|
-
...
|
|
1376
|
+
...r,
|
|
1377
1377
|
// Store complex objects as JSON strings
|
|
1378
|
-
nodes: JSON.stringify(
|
|
1379
|
-
start: JSON.stringify(
|
|
1380
|
-
ending: JSON.stringify(
|
|
1378
|
+
nodes: JSON.stringify(r.nodes || []),
|
|
1379
|
+
start: JSON.stringify(r.start || {}),
|
|
1380
|
+
ending: JSON.stringify(r.ending || {}),
|
|
1381
1381
|
tenant_id: e
|
|
1382
|
-
}).execute(),
|
|
1382
|
+
}).execute(), H.parse(r);
|
|
1383
1383
|
};
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return async (e,
|
|
1387
|
-
const { page:
|
|
1385
|
+
function Pa(t) {
|
|
1386
|
+
return async (e, a = {}) => {
|
|
1387
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
1388
1388
|
let i = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1389
|
-
s && (i =
|
|
1390
|
-
const
|
|
1389
|
+
s && (i = S(t, i, s, []));
|
|
1390
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
1391
1391
|
const f = { ...h };
|
|
1392
1392
|
if (typeof f.nodes == "string")
|
|
1393
1393
|
try {
|
|
@@ -1404,35 +1404,35 @@ function Pr(t) {
|
|
|
1404
1404
|
f.ending = JSON.parse(f.ending);
|
|
1405
1405
|
} catch {
|
|
1406
1406
|
}
|
|
1407
|
-
return
|
|
1407
|
+
return H.parse(y(f));
|
|
1408
1408
|
});
|
|
1409
1409
|
if (!o)
|
|
1410
1410
|
return {
|
|
1411
|
-
forms:
|
|
1411
|
+
forms: _,
|
|
1412
1412
|
start: 0,
|
|
1413
1413
|
limit: 0,
|
|
1414
1414
|
length: 0
|
|
1415
1415
|
};
|
|
1416
|
-
const { count:
|
|
1416
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1417
1417
|
return {
|
|
1418
|
-
forms:
|
|
1419
|
-
start:
|
|
1418
|
+
forms: _,
|
|
1419
|
+
start: r * n,
|
|
1420
1420
|
limit: n,
|
|
1421
|
-
length: x(
|
|
1421
|
+
length: x(d)
|
|
1422
1422
|
};
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1426
|
-
return async (e,
|
|
1427
|
-
const { numDeletedRows:
|
|
1428
|
-
return
|
|
1425
|
+
function ja(t) {
|
|
1426
|
+
return async (e, a) => {
|
|
1427
|
+
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1428
|
+
return r > 0;
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1432
|
-
return async (e,
|
|
1433
|
-
const
|
|
1434
|
-
if (!
|
|
1435
|
-
const n = { ...
|
|
1431
|
+
function Fa(t) {
|
|
1432
|
+
return async (e, a) => {
|
|
1433
|
+
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1434
|
+
if (!r) return null;
|
|
1435
|
+
const n = { ...r };
|
|
1436
1436
|
if (typeof n.nodes == "string")
|
|
1437
1437
|
try {
|
|
1438
1438
|
n.nodes = JSON.parse(n.nodes);
|
|
@@ -1448,109 +1448,109 @@ function Fr(t) {
|
|
|
1448
1448
|
n.ending = JSON.parse(n.ending);
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return H.parse(y(n));
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1455
|
-
return async (e,
|
|
1454
|
+
function Aa(t) {
|
|
1455
|
+
return async (e, a, r) => {
|
|
1456
1456
|
const n = {
|
|
1457
|
-
...
|
|
1457
|
+
...r,
|
|
1458
1458
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1459
1459
|
};
|
|
1460
|
-
|
|
1461
|
-
const { numUpdatedRows: o } = await t.updateTable("forms").set(n).where("id", "=",
|
|
1460
|
+
r.nodes && (n.nodes = JSON.stringify(r.nodes)), r.start && (n.start = JSON.stringify(r.start)), r.ending && (n.ending = JSON.stringify(r.ending));
|
|
1461
|
+
const { numUpdatedRows: o } = await t.updateTable("forms").set(n).where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1462
1462
|
return o > 0;
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function Ma(t) {
|
|
1466
1466
|
return {
|
|
1467
|
-
create:
|
|
1468
|
-
get:
|
|
1469
|
-
list:
|
|
1470
|
-
remove:
|
|
1471
|
-
update:
|
|
1467
|
+
create: Da(t),
|
|
1468
|
+
get: Fa(t),
|
|
1469
|
+
list: Pa(t),
|
|
1470
|
+
remove: ja(t),
|
|
1471
|
+
update: Aa(t)
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1475
|
-
return async (e,
|
|
1476
|
-
const
|
|
1477
|
-
id:
|
|
1478
|
-
...
|
|
1479
|
-
created_at:
|
|
1480
|
-
updated_at:
|
|
1481
|
-
}, o =
|
|
1474
|
+
function za(t) {
|
|
1475
|
+
return async (e, a) => {
|
|
1476
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1477
|
+
id: T(),
|
|
1478
|
+
...a,
|
|
1479
|
+
created_at: r,
|
|
1480
|
+
updated_at: r
|
|
1481
|
+
}, o = Qe.parse(n), {
|
|
1482
1482
|
verificationKey: s,
|
|
1483
1483
|
scopes: i,
|
|
1484
1484
|
options: c,
|
|
1485
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1486
|
-
allow_offline_access:
|
|
1487
|
-
...
|
|
1485
|
+
skip_consent_for_verifiable_first_party_clients: m,
|
|
1486
|
+
allow_offline_access: _,
|
|
1487
|
+
...d
|
|
1488
1488
|
} = o, h = {
|
|
1489
|
-
...
|
|
1489
|
+
...d,
|
|
1490
1490
|
tenant_id: e,
|
|
1491
1491
|
scopes: i ? JSON.stringify(i) : "[]",
|
|
1492
1492
|
options: c ? JSON.stringify(c) : "{}",
|
|
1493
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1494
|
-
allow_offline_access:
|
|
1493
|
+
skip_consent_for_verifiable_first_party_clients: m ? 1 : 0,
|
|
1494
|
+
allow_offline_access: _ ? 1 : 0,
|
|
1495
1495
|
verification_key: s,
|
|
1496
|
-
created_at:
|
|
1497
|
-
updated_at:
|
|
1496
|
+
created_at: r,
|
|
1497
|
+
updated_at: r
|
|
1498
1498
|
};
|
|
1499
1499
|
return await t.insertInto("resource_servers").values(h).execute(), y(o);
|
|
1500
1500
|
};
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return async (e,
|
|
1504
|
-
const
|
|
1505
|
-
if (!
|
|
1506
|
-
const n =
|
|
1502
|
+
function Ja(t) {
|
|
1503
|
+
return async (e, a) => {
|
|
1504
|
+
const r = await t.selectFrom("resource_servers").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1505
|
+
if (!r) return null;
|
|
1506
|
+
const n = r, {
|
|
1507
1507
|
verification_key: o,
|
|
1508
1508
|
scopes: s,
|
|
1509
1509
|
options: i,
|
|
1510
1510
|
skip_consent_for_verifiable_first_party_clients: c,
|
|
1511
|
-
allow_offline_access:
|
|
1512
|
-
...
|
|
1513
|
-
} = n,
|
|
1514
|
-
...
|
|
1511
|
+
allow_offline_access: m,
|
|
1512
|
+
..._
|
|
1513
|
+
} = n, d = {
|
|
1514
|
+
..._,
|
|
1515
1515
|
scopes: s ? JSON.parse(s) : [],
|
|
1516
1516
|
options: i ? JSON.parse(i) : {},
|
|
1517
1517
|
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
1518
|
-
allow_offline_access: !!
|
|
1518
|
+
allow_offline_access: !!m,
|
|
1519
1519
|
// Convert verification_key back to verificationKey for API
|
|
1520
1520
|
verificationKey: o
|
|
1521
1521
|
};
|
|
1522
|
-
return y(
|
|
1522
|
+
return y(d);
|
|
1523
1523
|
};
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return async (e,
|
|
1527
|
-
const { page:
|
|
1525
|
+
function Ea(t) {
|
|
1526
|
+
return async (e, a = {}) => {
|
|
1527
|
+
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
1528
1528
|
let i = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1529
1529
|
if (s) {
|
|
1530
1530
|
const h = s.trim(), f = h.split(/\s+/), g = f.length === 1 ? f[0] : void 0, w = g ? g.match(/^(-)?(name|identifier):(.*)$/) : null, b = w ? w[3] : "", D = /^(>=|>|<=|<)/.test(b || "");
|
|
1531
1531
|
if (w && !D) {
|
|
1532
|
-
const
|
|
1533
|
-
i =
|
|
1532
|
+
const A = !!w[1], P = w[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1533
|
+
i = A ? i.where(P, "not like", `%${b}%`) : i.where(P, "like", `%${b}%`);
|
|
1534
1534
|
} else
|
|
1535
|
-
i =
|
|
1535
|
+
i = S(t, i, h, [
|
|
1536
1536
|
"resource_servers.name",
|
|
1537
1537
|
"resource_servers.identifier"
|
|
1538
1538
|
]);
|
|
1539
1539
|
}
|
|
1540
|
-
const
|
|
1540
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
1541
1541
|
const f = h, {
|
|
1542
1542
|
verification_key: g,
|
|
1543
1543
|
scopes: w,
|
|
1544
1544
|
options: b,
|
|
1545
1545
|
skip_consent_for_verifiable_first_party_clients: D,
|
|
1546
|
-
allow_offline_access:
|
|
1546
|
+
allow_offline_access: A,
|
|
1547
1547
|
...P
|
|
1548
1548
|
} = f, V = {
|
|
1549
1549
|
...P,
|
|
1550
1550
|
scopes: w ? JSON.parse(w) : [],
|
|
1551
1551
|
options: b ? JSON.parse(b) : {},
|
|
1552
1552
|
skip_consent_for_verifiable_first_party_clients: !!D,
|
|
1553
|
-
allow_offline_access: !!
|
|
1553
|
+
allow_offline_access: !!A,
|
|
1554
1554
|
// Convert verification_key back to verificationKey for API
|
|
1555
1555
|
verificationKey: g
|
|
1556
1556
|
};
|
|
@@ -1558,84 +1558,84 @@ function Er(t) {
|
|
|
1558
1558
|
});
|
|
1559
1559
|
if (!o)
|
|
1560
1560
|
return {
|
|
1561
|
-
resource_servers:
|
|
1561
|
+
resource_servers: _,
|
|
1562
1562
|
start: 0,
|
|
1563
1563
|
limit: 0,
|
|
1564
1564
|
length: 0
|
|
1565
1565
|
};
|
|
1566
|
-
const { count:
|
|
1566
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1567
1567
|
return {
|
|
1568
|
-
resource_servers:
|
|
1569
|
-
start:
|
|
1568
|
+
resource_servers: _,
|
|
1569
|
+
start: r * n,
|
|
1570
1570
|
limit: n,
|
|
1571
|
-
length: x(
|
|
1571
|
+
length: x(d)
|
|
1572
1572
|
};
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return async (e,
|
|
1577
|
-
const
|
|
1578
|
-
return Number(
|
|
1575
|
+
function La(t) {
|
|
1576
|
+
return async (e, a) => {
|
|
1577
|
+
const r = await t.deleteFrom("resource_servers").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1578
|
+
return Number(r.numDeletedRows) > 0;
|
|
1579
1579
|
};
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return async (e,
|
|
1581
|
+
function Ra(t) {
|
|
1582
|
+
return async (e, a, r) => {
|
|
1583
1583
|
const {
|
|
1584
1584
|
verificationKey: n,
|
|
1585
1585
|
scopes: o,
|
|
1586
1586
|
options: s,
|
|
1587
1587
|
skip_consent_for_verifiable_first_party_clients: i,
|
|
1588
1588
|
allow_offline_access: c,
|
|
1589
|
-
...
|
|
1590
|
-
} =
|
|
1591
|
-
...
|
|
1589
|
+
...m
|
|
1590
|
+
} = r, _ = {
|
|
1591
|
+
...m,
|
|
1592
1592
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1593
1593
|
};
|
|
1594
|
-
n !== void 0 && (
|
|
1595
|
-
const
|
|
1596
|
-
return Number(
|
|
1594
|
+
n !== void 0 && (_.verification_key = n), o !== void 0 && (_.scopes = JSON.stringify(o)), s !== void 0 && (_.options = JSON.stringify(s)), i !== void 0 && (_.skip_consent_for_verifiable_first_party_clients = i ? 1 : 0), c !== void 0 && (_.allow_offline_access = c ? 1 : 0);
|
|
1595
|
+
const d = await t.updateTable("resource_servers").set(_).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1596
|
+
return Number(d.numUpdatedRows) > 0;
|
|
1597
1597
|
};
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1599
|
+
function Ka(t) {
|
|
1600
1600
|
return {
|
|
1601
|
-
create:
|
|
1602
|
-
get:
|
|
1603
|
-
list:
|
|
1604
|
-
remove:
|
|
1605
|
-
update:
|
|
1601
|
+
create: za(t),
|
|
1602
|
+
get: Ja(t),
|
|
1603
|
+
list: Ea(t),
|
|
1604
|
+
remove: La(t),
|
|
1605
|
+
update: Ra(t)
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1609
|
-
return async (e,
|
|
1610
|
-
const
|
|
1608
|
+
function Ua(t) {
|
|
1609
|
+
return async (e, a) => {
|
|
1610
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), n = T(), o = {
|
|
1611
1611
|
id: n,
|
|
1612
|
-
...
|
|
1612
|
+
...a,
|
|
1613
1613
|
tenant_id: e,
|
|
1614
|
-
created_at:
|
|
1615
|
-
updated_at:
|
|
1614
|
+
created_at: r,
|
|
1615
|
+
updated_at: r
|
|
1616
1616
|
};
|
|
1617
1617
|
return await t.insertInto("roles").values(o).execute(), {
|
|
1618
1618
|
id: n,
|
|
1619
|
-
...
|
|
1620
|
-
created_at:
|
|
1621
|
-
updated_at:
|
|
1619
|
+
...a,
|
|
1620
|
+
created_at: r,
|
|
1621
|
+
updated_at: r
|
|
1622
1622
|
};
|
|
1623
1623
|
};
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return async (e,
|
|
1627
|
-
const
|
|
1628
|
-
return
|
|
1629
|
-
...
|
|
1625
|
+
function Ba(t) {
|
|
1626
|
+
return async (e, a) => {
|
|
1627
|
+
const r = await t.selectFrom("roles").selectAll().where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1628
|
+
return r ? {
|
|
1629
|
+
...r
|
|
1630
1630
|
} : null;
|
|
1631
1631
|
};
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1634
|
-
return async (e,
|
|
1635
|
-
let
|
|
1636
|
-
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } =
|
|
1637
|
-
|
|
1638
|
-
const c = await
|
|
1633
|
+
function qa(t) {
|
|
1634
|
+
return async (e, a) => {
|
|
1635
|
+
let r = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
1636
|
+
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = a;
|
|
1637
|
+
a.q && (r = S(t, r, a.q, ["name"]));
|
|
1638
|
+
const c = await r.offset(n * o).limit(o).selectAll().execute();
|
|
1639
1639
|
if (!s)
|
|
1640
1640
|
return {
|
|
1641
1641
|
roles: c,
|
|
@@ -1643,48 +1643,48 @@ function Qr(t) {
|
|
|
1643
1643
|
limit: o,
|
|
1644
1644
|
length: c.length
|
|
1645
1645
|
};
|
|
1646
|
-
const { count:
|
|
1646
|
+
const { count: m } = await r.select((_) => _.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1647
1647
|
return {
|
|
1648
1648
|
roles: c,
|
|
1649
1649
|
start: n * o,
|
|
1650
1650
|
limit: o,
|
|
1651
|
-
length: x(
|
|
1651
|
+
length: x(m)
|
|
1652
1652
|
};
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
return async (e,
|
|
1655
|
+
function Qa(t) {
|
|
1656
|
+
return async (e, a, r) => {
|
|
1657
1657
|
const n = {
|
|
1658
|
-
...
|
|
1658
|
+
...r,
|
|
1659
1659
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1660
|
-
}, o = await t.updateTable("roles").set(n).where("roles.tenant_id", "=", e).where("roles.id", "=",
|
|
1660
|
+
}, o = await t.updateTable("roles").set(n).where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1661
1661
|
return Number(o.numUpdatedRows) > 0;
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return async (e,
|
|
1666
|
-
const
|
|
1667
|
-
return Number(
|
|
1664
|
+
function Wa(t) {
|
|
1665
|
+
return async (e, a) => {
|
|
1666
|
+
const r = await t.deleteFrom("roles").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1667
|
+
return Number(r.numDeletedRows) > 0;
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function Va(t) {
|
|
1671
1671
|
return {
|
|
1672
|
-
create:
|
|
1673
|
-
get:
|
|
1674
|
-
list:
|
|
1675
|
-
update:
|
|
1676
|
-
remove:
|
|
1672
|
+
create: Ua(t),
|
|
1673
|
+
get: Ba(t),
|
|
1674
|
+
list: qa(t),
|
|
1675
|
+
update: Qa(t),
|
|
1676
|
+
remove: Wa(t)
|
|
1677
1677
|
};
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1680
|
-
return async (e,
|
|
1681
|
-
if (
|
|
1679
|
+
function Ga(t) {
|
|
1680
|
+
return async (e, a, r) => {
|
|
1681
|
+
if (r.length === 0) return !0;
|
|
1682
1682
|
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1683
1683
|
try {
|
|
1684
|
-
for (const o of
|
|
1685
|
-
if (o.role_id !==
|
|
1684
|
+
for (const o of r) {
|
|
1685
|
+
if (o.role_id !== a)
|
|
1686
1686
|
throw new Error(
|
|
1687
|
-
`Permission role_id ${o.role_id} does not match expected role_id ${
|
|
1687
|
+
`Permission role_id ${o.role_id} does not match expected role_id ${a}`
|
|
1688
1688
|
);
|
|
1689
1689
|
const s = {
|
|
1690
1690
|
tenant_id: e,
|
|
@@ -1707,13 +1707,13 @@ function Gr(t) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1711
|
-
return async (e,
|
|
1712
|
-
if (
|
|
1710
|
+
function Ha(t) {
|
|
1711
|
+
return async (e, a, r) => {
|
|
1712
|
+
if (r.length === 0) return !0;
|
|
1713
1713
|
try {
|
|
1714
1714
|
return (await Promise.all(
|
|
1715
|
-
|
|
1716
|
-
(o) => t.deleteFrom("role_permissions").where("tenant_id", "=", e).where("role_id", "=",
|
|
1715
|
+
r.map(
|
|
1716
|
+
(o) => t.deleteFrom("role_permissions").where("tenant_id", "=", e).where("role_id", "=", a).where(
|
|
1717
1717
|
"resource_server_identifier",
|
|
1718
1718
|
"=",
|
|
1719
1719
|
o.resource_server_identifier
|
|
@@ -1725,12 +1725,12 @@ function Hr(t) {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
};
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1729
|
-
return async (e,
|
|
1730
|
-
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } =
|
|
1728
|
+
function Ya(t) {
|
|
1729
|
+
return async (e, a, r = {}) => {
|
|
1730
|
+
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = r;
|
|
1731
1731
|
let i = t.selectFrom("role_permissions").leftJoin(
|
|
1732
1732
|
"resource_servers",
|
|
1733
|
-
(
|
|
1733
|
+
(d) => d.onRef(
|
|
1734
1734
|
"role_permissions.tenant_id",
|
|
1735
1735
|
"=",
|
|
1736
1736
|
"resource_servers.tenant_id"
|
|
@@ -1745,36 +1745,36 @@ function Yr(t) {
|
|
|
1745
1745
|
"role_permissions.permission_name",
|
|
1746
1746
|
"role_permissions.created_at",
|
|
1747
1747
|
"resource_servers.name as resource_server_name"
|
|
1748
|
-
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=",
|
|
1749
|
-
const
|
|
1750
|
-
role_id:
|
|
1751
|
-
resource_server_identifier:
|
|
1752
|
-
resource_server_name:
|
|
1748
|
+
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=", a);
|
|
1749
|
+
const _ = (await i.offset(n * o).limit(o).execute()).map((d) => ({
|
|
1750
|
+
role_id: d.role_id,
|
|
1751
|
+
resource_server_identifier: d.resource_server_identifier,
|
|
1752
|
+
resource_server_name: d.resource_server_name || d.resource_server_identifier,
|
|
1753
1753
|
// Fallback to identifier if name is null
|
|
1754
|
-
permission_name:
|
|
1754
|
+
permission_name: d.permission_name,
|
|
1755
1755
|
description: null,
|
|
1756
1756
|
// No description available from role_permissions directly
|
|
1757
|
-
created_at:
|
|
1757
|
+
created_at: d.created_at
|
|
1758
1758
|
}));
|
|
1759
|
-
return s && await i.select((
|
|
1759
|
+
return s && await i.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), _;
|
|
1760
1760
|
};
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function Xa(t) {
|
|
1763
1763
|
return {
|
|
1764
|
-
assign:
|
|
1765
|
-
remove:
|
|
1766
|
-
list:
|
|
1764
|
+
assign: Ga(t),
|
|
1765
|
+
remove: Ha(t),
|
|
1766
|
+
list: Ya(t)
|
|
1767
1767
|
};
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1770
|
-
return async (e,
|
|
1771
|
-
if (
|
|
1769
|
+
function Za(t) {
|
|
1770
|
+
return async (e, a, r) => {
|
|
1771
|
+
if (r.length === 0) return !0;
|
|
1772
1772
|
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1773
1773
|
try {
|
|
1774
|
-
for (const o of
|
|
1774
|
+
for (const o of r) {
|
|
1775
1775
|
const s = {
|
|
1776
1776
|
tenant_id: e,
|
|
1777
|
-
user_id:
|
|
1777
|
+
user_id: a,
|
|
1778
1778
|
resource_server_identifier: o.resource_server_identifier,
|
|
1779
1779
|
permission_name: o.permission_name,
|
|
1780
1780
|
created_at: n
|
|
@@ -1793,12 +1793,12 @@ function Zr(t) {
|
|
|
1793
1793
|
}
|
|
1794
1794
|
};
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1797
|
-
return async (e,
|
|
1798
|
-
if (
|
|
1796
|
+
function er(t) {
|
|
1797
|
+
return async (e, a, r) => {
|
|
1798
|
+
if (r.length === 0) return !0;
|
|
1799
1799
|
try {
|
|
1800
|
-
for (const n of
|
|
1801
|
-
await t.deleteFrom("user_permissions").where("tenant_id", "=", e).where("user_id", "=",
|
|
1800
|
+
for (const n of r)
|
|
1801
|
+
await t.deleteFrom("user_permissions").where("tenant_id", "=", e).where("user_id", "=", a).where(
|
|
1802
1802
|
"resource_server_identifier",
|
|
1803
1803
|
"=",
|
|
1804
1804
|
n.resource_server_identifier
|
|
@@ -1809,8 +1809,8 @@ function ea(t) {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
};
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return async (e,
|
|
1812
|
+
function tr(t) {
|
|
1813
|
+
return async (e, a, r) => (await t.selectFrom("user_permissions").leftJoin(
|
|
1814
1814
|
"resource_servers",
|
|
1815
1815
|
(o) => o.onRef(
|
|
1816
1816
|
"user_permissions.tenant_id",
|
|
@@ -1827,7 +1827,7 @@ function ta(t) {
|
|
|
1827
1827
|
"resource_servers.name as resource_server_name",
|
|
1828
1828
|
"user_permissions.user_id",
|
|
1829
1829
|
"user_permissions.created_at"
|
|
1830
|
-
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=",
|
|
1830
|
+
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=", a).execute()).map((o) => ({
|
|
1831
1831
|
resource_server_identifier: o.resource_server_identifier,
|
|
1832
1832
|
permission_name: o.permission_name,
|
|
1833
1833
|
description: null,
|
|
@@ -1838,15 +1838,15 @@ function ta(t) {
|
|
|
1838
1838
|
created_at: o.created_at
|
|
1839
1839
|
}));
|
|
1840
1840
|
}
|
|
1841
|
-
function
|
|
1841
|
+
function ar(t) {
|
|
1842
1842
|
return {
|
|
1843
|
-
assign:
|
|
1844
|
-
remove:
|
|
1845
|
-
list:
|
|
1843
|
+
assign: Za(t),
|
|
1844
|
+
remove: er(t),
|
|
1845
|
+
list: tr(t)
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
|
-
function
|
|
1849
|
-
return async (e,
|
|
1848
|
+
function rr(t) {
|
|
1849
|
+
return async (e, a) => await t.selectFrom("user_roles as ur").innerJoin(
|
|
1850
1850
|
"roles as r",
|
|
1851
1851
|
(n) => n.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
1852
1852
|
).select([
|
|
@@ -1855,16 +1855,16 @@ function aa(t) {
|
|
|
1855
1855
|
"r.description",
|
|
1856
1856
|
"r.created_at",
|
|
1857
1857
|
"r.updated_at"
|
|
1858
|
-
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=",
|
|
1858
|
+
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", a).execute();
|
|
1859
1859
|
}
|
|
1860
|
-
function
|
|
1861
|
-
return async (e,
|
|
1862
|
-
if (
|
|
1860
|
+
function nr(t) {
|
|
1861
|
+
return async (e, a, r) => {
|
|
1862
|
+
if (r.length === 0) return !0;
|
|
1863
1863
|
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1864
1864
|
try {
|
|
1865
|
-
for (const o of
|
|
1865
|
+
for (const o of r)
|
|
1866
1866
|
try {
|
|
1867
|
-
await t.insertInto("user_roles").values({ tenant_id: e, user_id:
|
|
1867
|
+
await t.insertInto("user_roles").values({ tenant_id: e, user_id: a, role_id: o, created_at: n }).execute();
|
|
1868
1868
|
} catch (s) {
|
|
1869
1869
|
if (s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1870
1870
|
continue;
|
|
@@ -1876,29 +1876,212 @@ function na(t) {
|
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
1878
|
}
|
|
1879
|
-
function
|
|
1880
|
-
return async (e,
|
|
1879
|
+
function or(t) {
|
|
1880
|
+
return async (e, a, r) => {
|
|
1881
1881
|
try {
|
|
1882
|
-
return
|
|
1882
|
+
return r.length && await t.deleteFrom("user_roles").where("tenant_id", "=", e).where("user_id", "=", a).where((n) => n("role_id", "in", r)).execute(), !0;
|
|
1883
1883
|
} catch (n) {
|
|
1884
1884
|
return console.error("Error removing user roles:", n), !1;
|
|
1885
1885
|
}
|
|
1886
1886
|
};
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function sr(t) {
|
|
1889
1889
|
return {
|
|
1890
|
-
list:
|
|
1891
|
-
assign:
|
|
1892
|
-
remove:
|
|
1890
|
+
list: rr(t),
|
|
1891
|
+
assign: nr(t),
|
|
1892
|
+
remove: or(t)
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
|
-
function
|
|
1896
|
-
return
|
|
1895
|
+
function ir(t) {
|
|
1896
|
+
return async (e, a) => {
|
|
1897
|
+
const r = {
|
|
1898
|
+
...a,
|
|
1899
|
+
id: a.id || T(),
|
|
1900
|
+
tenant_id: e,
|
|
1901
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1902
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1903
|
+
branding: JSON.stringify(a.branding || {}),
|
|
1904
|
+
metadata: JSON.stringify(a.metadata || {}),
|
|
1905
|
+
enabled_connections: JSON.stringify(
|
|
1906
|
+
a.enabled_connections || []
|
|
1907
|
+
),
|
|
1908
|
+
token_quota: JSON.stringify(a.token_quota || {})
|
|
1909
|
+
};
|
|
1910
|
+
try {
|
|
1911
|
+
await t.insertInto("organizations").values(r).execute();
|
|
1912
|
+
} catch (n) {
|
|
1913
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.message.includes("AlreadyExists") ? new q(409, {
|
|
1914
|
+
message: "Organization already exists"
|
|
1915
|
+
}) : n;
|
|
1916
|
+
}
|
|
1917
|
+
return {
|
|
1918
|
+
...a,
|
|
1919
|
+
id: r.id,
|
|
1920
|
+
created_at: r.created_at,
|
|
1921
|
+
updated_at: r.updated_at
|
|
1922
|
+
};
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
function lr(t) {
|
|
1926
|
+
return async (e, a) => {
|
|
1927
|
+
const r = await t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1928
|
+
return r ? y({
|
|
1929
|
+
...r,
|
|
1930
|
+
branding: r.branding ? JSON.parse(r.branding) : {},
|
|
1931
|
+
metadata: r.metadata ? JSON.parse(r.metadata) : {},
|
|
1932
|
+
enabled_connections: r.enabled_connections ? JSON.parse(r.enabled_connections) : [],
|
|
1933
|
+
token_quota: r.token_quota ? JSON.parse(r.token_quota) : {}
|
|
1934
|
+
}) : null;
|
|
1935
|
+
};
|
|
1936
|
+
}
|
|
1937
|
+
function cr(t) {
|
|
1938
|
+
return async (e, a) => {
|
|
1939
|
+
let r = t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).orderBy("created_at", "desc");
|
|
1940
|
+
if (a != null && a.per_page && (r = r.limit(a.per_page)), a != null && a.page) {
|
|
1941
|
+
const s = (a.page - 1) * (a.per_page || 10);
|
|
1942
|
+
r = r.offset(s);
|
|
1943
|
+
}
|
|
1944
|
+
const o = (await r.execute()).map(
|
|
1945
|
+
(s) => y({
|
|
1946
|
+
...s,
|
|
1947
|
+
branding: s.branding ? JSON.parse(s.branding) : {},
|
|
1948
|
+
metadata: s.metadata ? JSON.parse(s.metadata) : {},
|
|
1949
|
+
enabled_connections: s.enabled_connections ? JSON.parse(s.enabled_connections) : [],
|
|
1950
|
+
token_quota: s.token_quota ? JSON.parse(s.token_quota) : {}
|
|
1951
|
+
})
|
|
1952
|
+
);
|
|
1953
|
+
return {
|
|
1954
|
+
organizations: o,
|
|
1955
|
+
start: a != null && a.page ? (a.page - 1) * (a.per_page || 10) : 0,
|
|
1956
|
+
limit: (a == null ? void 0 : a.per_page) || o.length,
|
|
1957
|
+
length: o.length
|
|
1958
|
+
};
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
function dr(t) {
|
|
1962
|
+
return async (e, a) => (await t.deleteFrom("organizations").where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1963
|
+
}
|
|
1964
|
+
function ur(t) {
|
|
1965
|
+
return async (e, a, r) => {
|
|
1966
|
+
const { branding: n, metadata: o, enabled_connections: s, token_quota: i, ...c } = r, m = {
|
|
1967
|
+
...c,
|
|
1968
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1969
|
+
};
|
|
1970
|
+
return n !== void 0 && (m.branding = JSON.stringify(n)), o !== void 0 && (m.metadata = JSON.stringify(o)), s !== void 0 && (m.enabled_connections = JSON.stringify(s)), i !== void 0 && (m.token_quota = JSON.stringify(i)), (await t.updateTable("organizations").set(m).where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1971
|
+
};
|
|
1972
|
+
}
|
|
1973
|
+
function mr(t) {
|
|
1974
|
+
return {
|
|
1975
|
+
create: ir(t),
|
|
1976
|
+
get: lr(t),
|
|
1977
|
+
list: cr(t),
|
|
1978
|
+
remove: dr(t),
|
|
1979
|
+
update: ur(t)
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
function _r(t) {
|
|
1983
|
+
return async (e, a) => {
|
|
1984
|
+
const r = {
|
|
1985
|
+
id: T(),
|
|
1986
|
+
tenant_id: e,
|
|
1987
|
+
user_id: a.user_id,
|
|
1988
|
+
organization_id: a.organization_id,
|
|
1989
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1990
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1991
|
+
};
|
|
1992
|
+
try {
|
|
1993
|
+
await t.insertInto("user_organizations").values(r).execute();
|
|
1994
|
+
} catch (n) {
|
|
1995
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.code === "ER_DUP_ENTRY" ? new q(409, {
|
|
1996
|
+
message: "User is already a member of this organization"
|
|
1997
|
+
}) : n;
|
|
1998
|
+
}
|
|
1999
|
+
return {
|
|
2000
|
+
...r
|
|
2001
|
+
};
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
function hr(t) {
|
|
2005
|
+
return async (e, a) => {
|
|
2006
|
+
const r = await t.selectFrom("user_organizations").selectAll().where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
2007
|
+
return r ? {
|
|
2008
|
+
id: r.id,
|
|
2009
|
+
user_id: r.user_id,
|
|
2010
|
+
organization_id: r.organization_id,
|
|
2011
|
+
created_at: r.created_at,
|
|
2012
|
+
updated_at: r.updated_at
|
|
2013
|
+
} : null;
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
function fr(t) {
|
|
2017
|
+
return async (e, a) => {
|
|
2018
|
+
const r = (a == null ? void 0 : a.page) || 0, n = (a == null ? void 0 : a.per_page) || 50, o = r * n;
|
|
2019
|
+
let s = t.selectFrom("user_organizations").selectAll().where("tenant_id", "=", e);
|
|
2020
|
+
if (a != null && a.q) {
|
|
2021
|
+
if (a.q.startsWith("user_id:")) {
|
|
2022
|
+
const d = a.q.replace("user_id:", "");
|
|
2023
|
+
s = s.where("user_id", "=", d);
|
|
2024
|
+
} else if (a.q.startsWith("organization_id:")) {
|
|
2025
|
+
const d = a.q.replace("organization_id:", "");
|
|
2026
|
+
s = s.where("organization_id", "=", d);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
s = s.orderBy("created_at", "desc"), n > 0 && (s = s.limit(n).offset(o));
|
|
2030
|
+
const i = await s.execute();
|
|
2031
|
+
let c = t.selectFrom("user_organizations").select(t.fn.count("id").as("count")).where("tenant_id", "=", e);
|
|
2032
|
+
if (a != null && a.q) {
|
|
2033
|
+
if (a.q.startsWith("user_id:")) {
|
|
2034
|
+
const d = a.q.replace("user_id:", "");
|
|
2035
|
+
c = c.where("user_id", "=", d);
|
|
2036
|
+
} else if (a.q.startsWith("organization_id:")) {
|
|
2037
|
+
const d = a.q.replace("organization_id:", "");
|
|
2038
|
+
c = c.where("organization_id", "=", d);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
const m = await c.executeTakeFirst();
|
|
2042
|
+
return {
|
|
2043
|
+
userOrganizations: i.map((d) => ({
|
|
2044
|
+
id: d.id,
|
|
2045
|
+
user_id: d.user_id,
|
|
2046
|
+
organization_id: d.organization_id,
|
|
2047
|
+
created_at: d.created_at,
|
|
2048
|
+
updated_at: d.updated_at
|
|
2049
|
+
})),
|
|
2050
|
+
start: o,
|
|
2051
|
+
limit: n,
|
|
2052
|
+
length: Number((m == null ? void 0 : m.count) || 0)
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
2055
|
+
}
|
|
2056
|
+
function pr(t) {
|
|
2057
|
+
return async (e, a) => (await t.deleteFrom("user_organizations").where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2058
|
+
}
|
|
2059
|
+
function gr(t) {
|
|
2060
|
+
return async (e, a, r) => {
|
|
2061
|
+
const n = {
|
|
2062
|
+
...r,
|
|
2063
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2064
|
+
};
|
|
2065
|
+
return (await t.updateTable("user_organizations").set(n).where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
function wr(t) {
|
|
2069
|
+
return {
|
|
2070
|
+
// CRUD operations
|
|
2071
|
+
create: _r(t),
|
|
2072
|
+
get: hr(t),
|
|
2073
|
+
list: fr(t),
|
|
2074
|
+
remove: pr(t),
|
|
2075
|
+
update: gr(t)
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
function yr(t) {
|
|
2079
|
+
return t[t.length - 1];
|
|
1897
2080
|
}
|
|
1898
2081
|
function C(t) {
|
|
1899
2082
|
return Object.freeze(t);
|
|
1900
2083
|
}
|
|
1901
|
-
const
|
|
2084
|
+
const G = C({
|
|
1902
2085
|
is(t) {
|
|
1903
2086
|
return t.kind === "IdentifierNode";
|
|
1904
2087
|
},
|
|
@@ -1908,24 +2091,24 @@ const W = C({
|
|
|
1908
2091
|
name: t
|
|
1909
2092
|
});
|
|
1910
2093
|
}
|
|
1911
|
-
}),
|
|
2094
|
+
}), ae = C({
|
|
1912
2095
|
is(t) {
|
|
1913
2096
|
return t.kind === "SchemableIdentifierNode";
|
|
1914
2097
|
},
|
|
1915
2098
|
create(t) {
|
|
1916
2099
|
return C({
|
|
1917
2100
|
kind: "SchemableIdentifierNode",
|
|
1918
|
-
identifier:
|
|
2101
|
+
identifier: G.create(t)
|
|
1919
2102
|
});
|
|
1920
2103
|
},
|
|
1921
2104
|
createWithSchema(t, e) {
|
|
1922
2105
|
return C({
|
|
1923
2106
|
kind: "SchemableIdentifierNode",
|
|
1924
|
-
schema:
|
|
1925
|
-
identifier:
|
|
2107
|
+
schema: G.create(t),
|
|
2108
|
+
identifier: G.create(e)
|
|
1926
2109
|
});
|
|
1927
2110
|
}
|
|
1928
|
-
}),
|
|
2111
|
+
}), vr = C({
|
|
1929
2112
|
is(t) {
|
|
1930
2113
|
return t.kind === "AliasNode";
|
|
1931
2114
|
},
|
|
@@ -1936,28 +2119,28 @@ const W = C({
|
|
|
1936
2119
|
alias: e
|
|
1937
2120
|
});
|
|
1938
2121
|
}
|
|
1939
|
-
}),
|
|
2122
|
+
}), Z = C({
|
|
1940
2123
|
is(t) {
|
|
1941
2124
|
return t.kind === "TableNode";
|
|
1942
2125
|
},
|
|
1943
2126
|
create(t) {
|
|
1944
2127
|
return C({
|
|
1945
2128
|
kind: "TableNode",
|
|
1946
|
-
table:
|
|
2129
|
+
table: ae.create(t)
|
|
1947
2130
|
});
|
|
1948
2131
|
},
|
|
1949
2132
|
createWithSchema(t, e) {
|
|
1950
2133
|
return C({
|
|
1951
2134
|
kind: "TableNode",
|
|
1952
|
-
table:
|
|
2135
|
+
table: ae.createWithSchema(t, e)
|
|
1953
2136
|
});
|
|
1954
2137
|
}
|
|
1955
2138
|
});
|
|
1956
|
-
var
|
|
1957
|
-
class
|
|
2139
|
+
var Y;
|
|
2140
|
+
class Nr {
|
|
1958
2141
|
constructor() {
|
|
1959
2142
|
R(this, "nodeStack", []);
|
|
1960
|
-
|
|
2143
|
+
O(this, Y, C({
|
|
1961
2144
|
AliasNode: this.transformAlias.bind(this),
|
|
1962
2145
|
ColumnNode: this.transformColumn.bind(this),
|
|
1963
2146
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -2057,14 +2240,14 @@ class ca {
|
|
|
2057
2240
|
if (!e)
|
|
2058
2241
|
return e;
|
|
2059
2242
|
this.nodeStack.push(e);
|
|
2060
|
-
const
|
|
2061
|
-
return this.nodeStack.pop(), C(
|
|
2243
|
+
const a = this.transformNodeImpl(e);
|
|
2244
|
+
return this.nodeStack.pop(), C(a);
|
|
2062
2245
|
}
|
|
2063
2246
|
transformNodeImpl(e) {
|
|
2064
|
-
return
|
|
2247
|
+
return u(this, Y)[e.kind](e);
|
|
2065
2248
|
}
|
|
2066
2249
|
transformNodeList(e) {
|
|
2067
|
-
return e && C(e.map((
|
|
2250
|
+
return e && C(e.map((a) => this.transformNode(a)));
|
|
2068
2251
|
}
|
|
2069
2252
|
transformSelectQuery(e) {
|
|
2070
2253
|
return {
|
|
@@ -2787,8 +2970,8 @@ class ca {
|
|
|
2787
2970
|
return e;
|
|
2788
2971
|
}
|
|
2789
2972
|
}
|
|
2790
|
-
|
|
2791
|
-
const
|
|
2973
|
+
Y = new WeakMap();
|
|
2974
|
+
const Cr = C({
|
|
2792
2975
|
AlterTableNode: !0,
|
|
2793
2976
|
CreateIndexNode: !0,
|
|
2794
2977
|
CreateSchemaNode: !0,
|
|
@@ -2807,88 +2990,88 @@ const da = C({
|
|
|
2807
2990
|
UpdateQueryNode: !0,
|
|
2808
2991
|
MergeQueryNode: !0
|
|
2809
2992
|
});
|
|
2810
|
-
var E, j, F, N, ye, ve, Ne,
|
|
2811
|
-
class
|
|
2812
|
-
constructor(
|
|
2993
|
+
var E, j, F, N, ye, ve, Ne, M, re, Ce;
|
|
2994
|
+
class br extends Nr {
|
|
2995
|
+
constructor(a) {
|
|
2813
2996
|
super();
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
K(this, E,
|
|
2819
|
-
}
|
|
2820
|
-
transformNodeImpl(
|
|
2821
|
-
if (!p(this, N, ye).call(this,
|
|
2822
|
-
return super.transformNodeImpl(
|
|
2823
|
-
const
|
|
2824
|
-
for (const s of
|
|
2825
|
-
|
|
2826
|
-
const n = p(this, N, ve).call(this,
|
|
2997
|
+
O(this, N);
|
|
2998
|
+
O(this, E);
|
|
2999
|
+
O(this, j, /* @__PURE__ */ new Set());
|
|
3000
|
+
O(this, F, /* @__PURE__ */ new Set());
|
|
3001
|
+
K(this, E, a);
|
|
3002
|
+
}
|
|
3003
|
+
transformNodeImpl(a) {
|
|
3004
|
+
if (!p(this, N, ye).call(this, a))
|
|
3005
|
+
return super.transformNodeImpl(a);
|
|
3006
|
+
const r = p(this, N, Ne).call(this, a);
|
|
3007
|
+
for (const s of r)
|
|
3008
|
+
u(this, F).add(s);
|
|
3009
|
+
const n = p(this, N, ve).call(this, a);
|
|
2827
3010
|
for (const s of n)
|
|
2828
|
-
|
|
2829
|
-
const o = super.transformNodeImpl(
|
|
3011
|
+
u(this, j).add(s);
|
|
3012
|
+
const o = super.transformNodeImpl(a);
|
|
2830
3013
|
for (const s of n)
|
|
2831
|
-
|
|
2832
|
-
for (const s of
|
|
2833
|
-
|
|
3014
|
+
u(this, j).delete(s);
|
|
3015
|
+
for (const s of r)
|
|
3016
|
+
u(this, F).delete(s);
|
|
2834
3017
|
return o;
|
|
2835
3018
|
}
|
|
2836
|
-
transformSchemableIdentifier(
|
|
2837
|
-
const
|
|
2838
|
-
return
|
|
2839
|
-
...
|
|
2840
|
-
schema:
|
|
3019
|
+
transformSchemableIdentifier(a) {
|
|
3020
|
+
const r = super.transformSchemableIdentifier(a);
|
|
3021
|
+
return r.schema || !u(this, j).has(a.identifier.name) ? r : {
|
|
3022
|
+
...r,
|
|
3023
|
+
schema: G.create(u(this, E))
|
|
2841
3024
|
};
|
|
2842
3025
|
}
|
|
2843
|
-
transformReferences(
|
|
2844
|
-
const
|
|
2845
|
-
return
|
|
2846
|
-
...
|
|
2847
|
-
table:
|
|
2848
|
-
};
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
E = new WeakMap(), j = new WeakMap(), F = new WeakMap(), N = new WeakSet(), ye = function(
|
|
2852
|
-
return
|
|
2853
|
-
}, ve = function(
|
|
2854
|
-
const
|
|
2855
|
-
if ("name" in
|
|
2856
|
-
for (const n of
|
|
2857
|
-
p(this, N,
|
|
2858
|
-
if ("into" in
|
|
2859
|
-
for (const n of
|
|
2860
|
-
p(this, N,
|
|
2861
|
-
return "using" in
|
|
2862
|
-
}, Ne = function(
|
|
2863
|
-
const
|
|
2864
|
-
return "with" in
|
|
2865
|
-
},
|
|
2866
|
-
const n =
|
|
2867
|
-
n && p(this, N,
|
|
2868
|
-
},
|
|
2869
|
-
const n =
|
|
2870
|
-
!
|
|
2871
|
-
}, Ce = function(
|
|
2872
|
-
for (const n of
|
|
3026
|
+
transformReferences(a) {
|
|
3027
|
+
const r = super.transformReferences(a);
|
|
3028
|
+
return r.table.table.schema ? r : {
|
|
3029
|
+
...r,
|
|
3030
|
+
table: Z.createWithSchema(u(this, E), r.table.table.identifier.name)
|
|
3031
|
+
};
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
E = new WeakMap(), j = new WeakMap(), F = new WeakMap(), N = new WeakSet(), ye = function(a) {
|
|
3035
|
+
return a.kind in Cr;
|
|
3036
|
+
}, ve = function(a) {
|
|
3037
|
+
const r = /* @__PURE__ */ new Set();
|
|
3038
|
+
if ("name" in a && a.name && ae.is(a.name) && p(this, N, re).call(this, a.name, r), "from" in a && a.from)
|
|
3039
|
+
for (const n of a.from.froms)
|
|
3040
|
+
p(this, N, M).call(this, n, r);
|
|
3041
|
+
if ("into" in a && a.into && p(this, N, M).call(this, a.into, r), "table" in a && a.table && p(this, N, M).call(this, a.table, r), "joins" in a && a.joins)
|
|
3042
|
+
for (const n of a.joins)
|
|
3043
|
+
p(this, N, M).call(this, n.table, r);
|
|
3044
|
+
return "using" in a && a.using && p(this, N, M).call(this, a.using, r), r;
|
|
3045
|
+
}, Ne = function(a) {
|
|
3046
|
+
const r = /* @__PURE__ */ new Set();
|
|
3047
|
+
return "with" in a && a.with && p(this, N, Ce).call(this, a.with, r), r;
|
|
3048
|
+
}, M = function(a, r) {
|
|
3049
|
+
const n = Z.is(a) ? a : vr.is(a) && Z.is(a.node) ? a.node : null;
|
|
3050
|
+
n && p(this, N, re).call(this, n.table, r);
|
|
3051
|
+
}, re = function(a, r) {
|
|
3052
|
+
const n = a.identifier.name;
|
|
3053
|
+
!u(this, j).has(n) && !u(this, F).has(n) && r.add(n);
|
|
3054
|
+
}, Ce = function(a, r) {
|
|
3055
|
+
for (const n of a.expressions) {
|
|
2873
3056
|
const o = n.name.table.table.identifier.name;
|
|
2874
|
-
|
|
3057
|
+
u(this, F).has(o) || r.add(o);
|
|
2875
3058
|
}
|
|
2876
3059
|
};
|
|
2877
3060
|
var Q;
|
|
2878
|
-
class
|
|
3061
|
+
class xr {
|
|
2879
3062
|
constructor(e) {
|
|
2880
|
-
|
|
2881
|
-
K(this, Q, new
|
|
3063
|
+
O(this, Q);
|
|
3064
|
+
K(this, Q, new br(e));
|
|
2882
3065
|
}
|
|
2883
3066
|
transformQuery(e) {
|
|
2884
|
-
return
|
|
3067
|
+
return u(this, Q).transformNode(e.node);
|
|
2885
3068
|
}
|
|
2886
3069
|
async transformResult(e) {
|
|
2887
3070
|
return e.result;
|
|
2888
3071
|
}
|
|
2889
3072
|
}
|
|
2890
3073
|
Q = new WeakMap();
|
|
2891
|
-
class
|
|
3074
|
+
class Tr {
|
|
2892
3075
|
transformQuery(e) {
|
|
2893
3076
|
return e.node;
|
|
2894
3077
|
}
|
|
@@ -2896,12 +3079,12 @@ class _a {
|
|
|
2896
3079
|
return e.result;
|
|
2897
3080
|
}
|
|
2898
3081
|
}
|
|
2899
|
-
const
|
|
2900
|
-
var v, l, U, k, $, z, xe, I, Te, Se, Oe, ke, $e, ne,
|
|
3082
|
+
const Sr = "kysely_migration", fe = "kysely_migration_lock", Or = !1, ee = "migration_lock", kr = C({ __noMigrations__: !0 });
|
|
3083
|
+
var v, l, U, k, $, z, xe, I, Te, Se, Oe, ke, $e, ne, J, oe, Ie, De, Pe, se, je, Fe, Ae, Me, ze, B;
|
|
2901
3084
|
class be {
|
|
2902
3085
|
constructor(e) {
|
|
2903
|
-
|
|
2904
|
-
|
|
3086
|
+
O(this, l);
|
|
3087
|
+
O(this, v);
|
|
2905
3088
|
K(this, v, C(e));
|
|
2906
3089
|
}
|
|
2907
3090
|
/**
|
|
@@ -2910,11 +3093,11 @@ class be {
|
|
|
2910
3093
|
* The returned array is sorted by migration name.
|
|
2911
3094
|
*/
|
|
2912
3095
|
async getMigrations() {
|
|
2913
|
-
const e = await p(this, l,
|
|
2914
|
-
return (await p(this, l, se).call(this)).map(({ name:
|
|
2915
|
-
const o = e.find((s) => s.name ===
|
|
3096
|
+
const e = await p(this, l, J).call(this, u(this, l, $)) ? await u(this, v).db.withPlugin(u(this, l, I)).selectFrom(u(this, l, $)).select(["name", "timestamp"]).execute() : [];
|
|
3097
|
+
return (await p(this, l, se).call(this)).map(({ name: r, ...n }) => {
|
|
3098
|
+
const o = e.find((s) => s.name === r);
|
|
2916
3099
|
return {
|
|
2917
|
-
name:
|
|
3100
|
+
name: r,
|
|
2918
3101
|
migration: n,
|
|
2919
3102
|
executedAt: o ? new Date(o.timestamp) : void 0
|
|
2920
3103
|
};
|
|
@@ -2994,16 +3177,16 @@ class be {
|
|
|
2994
3177
|
* ```
|
|
2995
3178
|
*/
|
|
2996
3179
|
async migrateTo(e) {
|
|
2997
|
-
return p(this, l, U).call(this, ({ migrations:
|
|
2998
|
-
if (e ===
|
|
3180
|
+
return p(this, l, U).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
|
|
3181
|
+
if (e === kr)
|
|
2999
3182
|
return { direction: "Down", step: 1 / 0 };
|
|
3000
|
-
if (!
|
|
3183
|
+
if (!a.find((i) => i.name === e))
|
|
3001
3184
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
3002
|
-
const o =
|
|
3185
|
+
const o = r.indexOf(e), s = n.findIndex((i) => i.name === e);
|
|
3003
3186
|
if (o !== -1)
|
|
3004
3187
|
return {
|
|
3005
3188
|
direction: "Down",
|
|
3006
|
-
step:
|
|
3189
|
+
step: r.length - o - 1
|
|
3007
3190
|
};
|
|
3008
3191
|
if (s !== -1)
|
|
3009
3192
|
return { direction: "Up", step: s + 1 };
|
|
@@ -3048,110 +3231,110 @@ class be {
|
|
|
3048
3231
|
v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
3049
3232
|
try {
|
|
3050
3233
|
return await p(this, l, Te).call(this), await p(this, l, Ie).call(this, e);
|
|
3051
|
-
} catch (
|
|
3052
|
-
return
|
|
3234
|
+
} catch (a) {
|
|
3235
|
+
return a instanceof te ? a.resultSet : { error: a };
|
|
3053
3236
|
}
|
|
3054
3237
|
}, k = function() {
|
|
3055
|
-
return
|
|
3238
|
+
return u(this, v).migrationTableSchema;
|
|
3056
3239
|
}, $ = function() {
|
|
3057
|
-
return
|
|
3240
|
+
return u(this, v).migrationTableName ?? Sr;
|
|
3058
3241
|
}, z = function() {
|
|
3059
|
-
return
|
|
3242
|
+
return u(this, v).migrationLockTableName ?? fe;
|
|
3060
3243
|
}, xe = function() {
|
|
3061
|
-
return
|
|
3244
|
+
return u(this, v).allowUnorderedMigrations ?? Or;
|
|
3062
3245
|
}, I = function() {
|
|
3063
|
-
return
|
|
3246
|
+
return u(this, l, k) ? new xr(u(this, l, k)) : new Tr();
|
|
3064
3247
|
}, Te = async function() {
|
|
3065
3248
|
await p(this, l, Se).call(this), await p(this, l, Oe).call(this), await p(this, l, ke).call(this), await p(this, l, $e).call(this);
|
|
3066
3249
|
}, Se = async function() {
|
|
3067
|
-
if (
|
|
3250
|
+
if (u(this, l, k) && !await p(this, l, ne).call(this))
|
|
3068
3251
|
try {
|
|
3069
|
-
await p(this, l, B).call(this,
|
|
3252
|
+
await p(this, l, B).call(this, u(this, v).db.schema.createSchema(u(this, l, k)));
|
|
3070
3253
|
} catch (e) {
|
|
3071
3254
|
if (!await p(this, l, ne).call(this))
|
|
3072
3255
|
throw e;
|
|
3073
3256
|
}
|
|
3074
3257
|
}, Oe = async function() {
|
|
3075
|
-
if (!await p(this, l,
|
|
3258
|
+
if (!await p(this, l, J).call(this, u(this, l, $)))
|
|
3076
3259
|
try {
|
|
3077
|
-
|
|
3260
|
+
u(this, l, k) && await p(this, l, B).call(this, u(this, v).db.schema.createSchema(u(this, l, k))), await p(this, l, B).call(this, u(this, v).db.schema.withPlugin(u(this, l, I)).createTable(u(this, l, $)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
3078
3261
|
} catch (e) {
|
|
3079
|
-
if (!await p(this, l,
|
|
3262
|
+
if (!await p(this, l, J).call(this, u(this, l, $)))
|
|
3080
3263
|
throw e;
|
|
3081
3264
|
}
|
|
3082
3265
|
}, ke = async function() {
|
|
3083
|
-
if (!await p(this, l,
|
|
3266
|
+
if (!await p(this, l, J).call(this, u(this, l, z)))
|
|
3084
3267
|
try {
|
|
3085
|
-
await p(this, l, B).call(this,
|
|
3268
|
+
await p(this, l, B).call(this, u(this, v).db.schema.withPlugin(u(this, l, I)).createTable(u(this, l, z)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
3086
3269
|
} catch (e) {
|
|
3087
|
-
if (!await p(this, l,
|
|
3270
|
+
if (!await p(this, l, J).call(this, u(this, l, z)))
|
|
3088
3271
|
throw e;
|
|
3089
3272
|
}
|
|
3090
3273
|
}, $e = async function() {
|
|
3091
3274
|
if (!await p(this, l, oe).call(this))
|
|
3092
3275
|
try {
|
|
3093
|
-
await
|
|
3276
|
+
await u(this, v).db.withPlugin(u(this, l, I)).insertInto(u(this, l, z)).values({ id: ee, is_locked: 0 }).execute();
|
|
3094
3277
|
} catch (e) {
|
|
3095
3278
|
if (!await p(this, l, oe).call(this))
|
|
3096
3279
|
throw e;
|
|
3097
3280
|
}
|
|
3098
3281
|
}, ne = async function() {
|
|
3099
|
-
return (await
|
|
3100
|
-
},
|
|
3101
|
-
const
|
|
3102
|
-
return (await
|
|
3282
|
+
return (await u(this, v).db.introspection.getSchemas()).some((a) => a.name === u(this, l, k));
|
|
3283
|
+
}, J = async function(e) {
|
|
3284
|
+
const a = u(this, l, k);
|
|
3285
|
+
return (await u(this, v).db.introspection.getTables({
|
|
3103
3286
|
withInternalKyselyTables: !0
|
|
3104
|
-
})).some((n) => n.name === e && (!
|
|
3287
|
+
})).some((n) => n.name === e && (!a || n.schema === a));
|
|
3105
3288
|
}, oe = async function() {
|
|
3106
|
-
return !!await
|
|
3289
|
+
return !!await u(this, v).db.withPlugin(u(this, l, I)).selectFrom(u(this, l, z)).where("id", "=", ee).select("id").executeTakeFirst();
|
|
3107
3290
|
}, Ie = async function(e) {
|
|
3108
|
-
const
|
|
3109
|
-
lockTable:
|
|
3110
|
-
lockRowId:
|
|
3111
|
-
lockTableSchema:
|
|
3291
|
+
const a = u(this, v).db.getExecutor().adapter, r = C({
|
|
3292
|
+
lockTable: u(this, v).migrationLockTableName ?? fe,
|
|
3293
|
+
lockRowId: ee,
|
|
3294
|
+
lockTableSchema: u(this, v).migrationTableSchema
|
|
3112
3295
|
}), n = async (o) => {
|
|
3113
3296
|
try {
|
|
3114
|
-
await
|
|
3297
|
+
await a.acquireMigrationLock(o, r);
|
|
3115
3298
|
const s = await p(this, l, De).call(this, o);
|
|
3116
3299
|
if (s.migrations.length === 0)
|
|
3117
3300
|
return { results: [] };
|
|
3118
3301
|
const { direction: i, step: c } = e(s);
|
|
3119
|
-
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l,
|
|
3302
|
+
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l, Me).call(this, o, s, c) : i === "Up" ? await p(this, l, ze).call(this, o, s, c) : { results: [] };
|
|
3120
3303
|
} finally {
|
|
3121
|
-
await
|
|
3304
|
+
await a.releaseMigrationLock(o, r);
|
|
3122
3305
|
}
|
|
3123
3306
|
};
|
|
3124
|
-
return
|
|
3307
|
+
return a.supportsTransactionalDdl ? u(this, v).db.transaction().execute(n) : u(this, v).db.connection().execute(n);
|
|
3125
3308
|
}, De = async function(e) {
|
|
3126
|
-
const
|
|
3127
|
-
p(this, l, Fe).call(this,
|
|
3128
|
-
const n = p(this, l, Pe).call(this,
|
|
3309
|
+
const a = await p(this, l, se).call(this), r = await p(this, l, je).call(this, e);
|
|
3310
|
+
p(this, l, Fe).call(this, a, r), u(this, l, xe) || p(this, l, Ae).call(this, a, r);
|
|
3311
|
+
const n = p(this, l, Pe).call(this, a, r);
|
|
3129
3312
|
return C({
|
|
3130
|
-
migrations:
|
|
3131
|
-
executedMigrations:
|
|
3132
|
-
lastMigration:
|
|
3313
|
+
migrations: a,
|
|
3314
|
+
executedMigrations: r,
|
|
3315
|
+
lastMigration: yr(r),
|
|
3133
3316
|
pendingMigrations: n
|
|
3134
3317
|
});
|
|
3135
|
-
}, Pe = function(e,
|
|
3136
|
-
return e.filter((
|
|
3318
|
+
}, Pe = function(e, a) {
|
|
3319
|
+
return e.filter((r) => !a.includes(r.name));
|
|
3137
3320
|
}, se = async function() {
|
|
3138
|
-
const e = await
|
|
3139
|
-
return Object.keys(e).sort().map((
|
|
3140
|
-
...e[
|
|
3141
|
-
name:
|
|
3321
|
+
const e = await u(this, v).provider.getMigrations();
|
|
3322
|
+
return Object.keys(e).sort().map((a) => ({
|
|
3323
|
+
...e[a],
|
|
3324
|
+
name: a
|
|
3142
3325
|
}));
|
|
3143
3326
|
}, je = async function(e) {
|
|
3144
|
-
return (await e.withPlugin(
|
|
3145
|
-
}, Fe = function(e,
|
|
3146
|
-
for (const
|
|
3147
|
-
if (!e.some((n) => n.name ===
|
|
3148
|
-
throw new Error(`corrupted migrations: previously executed migration ${
|
|
3149
|
-
},
|
|
3150
|
-
for (let
|
|
3151
|
-
if (e[
|
|
3152
|
-
throw new Error(`corrupted migrations: expected previously executed migration ${r
|
|
3153
|
-
},
|
|
3154
|
-
const n =
|
|
3327
|
+
return (await e.withPlugin(u(this, l, I)).selectFrom(u(this, l, $)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
3328
|
+
}, Fe = function(e, a) {
|
|
3329
|
+
for (const r of a)
|
|
3330
|
+
if (!e.some((n) => n.name === r))
|
|
3331
|
+
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
3332
|
+
}, Ae = function(e, a) {
|
|
3333
|
+
for (let r = 0; r < a.length; ++r)
|
|
3334
|
+
if (e[r].name !== a[r])
|
|
3335
|
+
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.`);
|
|
3336
|
+
}, Me = async function(e, a, r) {
|
|
3337
|
+
const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((i) => i.name === s)), o = n.map((s) => ({
|
|
3155
3338
|
migrationName: s.name,
|
|
3156
3339
|
direction: "Down",
|
|
3157
3340
|
status: "NotExecuted"
|
|
@@ -3159,7 +3342,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3159
3342
|
for (let s = 0; s < o.length; ++s) {
|
|
3160
3343
|
const i = n[s];
|
|
3161
3344
|
try {
|
|
3162
|
-
i.down && (await i.down(e), await e.withPlugin(
|
|
3345
|
+
i.down && (await i.down(e), await e.withPlugin(u(this, l, I)).deleteFrom(u(this, l, $)).where("name", "=", i.name).execute(), o[s] = {
|
|
3163
3346
|
migrationName: i.name,
|
|
3164
3347
|
direction: "Down",
|
|
3165
3348
|
status: "Success"
|
|
@@ -3169,23 +3352,23 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3169
3352
|
migrationName: i.name,
|
|
3170
3353
|
direction: "Down",
|
|
3171
3354
|
status: "Error"
|
|
3172
|
-
}, new
|
|
3355
|
+
}, new te({
|
|
3173
3356
|
error: c,
|
|
3174
3357
|
results: o
|
|
3175
3358
|
});
|
|
3176
3359
|
}
|
|
3177
3360
|
}
|
|
3178
3361
|
return { results: o };
|
|
3179
|
-
}, ze = async function(e,
|
|
3180
|
-
const o =
|
|
3362
|
+
}, ze = async function(e, a, r) {
|
|
3363
|
+
const o = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
3181
3364
|
migrationName: s.name,
|
|
3182
3365
|
direction: "Up",
|
|
3183
3366
|
status: "NotExecuted"
|
|
3184
3367
|
}));
|
|
3185
3368
|
for (let s = 0; s < o.length; s++) {
|
|
3186
|
-
const i =
|
|
3369
|
+
const i = a.pendingMigrations[s];
|
|
3187
3370
|
try {
|
|
3188
|
-
await i.up(e), await e.withPlugin(
|
|
3371
|
+
await i.up(e), await e.withPlugin(u(this, l, I)).insertInto(u(this, l, $)).values({
|
|
3189
3372
|
name: i.name,
|
|
3190
3373
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3191
3374
|
}).execute(), o[s] = {
|
|
@@ -3198,7 +3381,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3198
3381
|
migrationName: i.name,
|
|
3199
3382
|
direction: "Up",
|
|
3200
3383
|
status: "Error"
|
|
3201
|
-
}, new
|
|
3384
|
+
}, new te({
|
|
3202
3385
|
error: c,
|
|
3203
3386
|
results: o
|
|
3204
3387
|
});
|
|
@@ -3206,21 +3389,21 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3206
3389
|
}
|
|
3207
3390
|
return { results: o };
|
|
3208
3391
|
}, B = async function(e) {
|
|
3209
|
-
|
|
3392
|
+
u(this, v).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
3210
3393
|
};
|
|
3211
|
-
var
|
|
3212
|
-
class
|
|
3213
|
-
constructor(
|
|
3394
|
+
var W;
|
|
3395
|
+
class te extends Error {
|
|
3396
|
+
constructor(a) {
|
|
3214
3397
|
super();
|
|
3215
|
-
|
|
3216
|
-
K(this,
|
|
3398
|
+
O(this, W);
|
|
3399
|
+
K(this, W, a);
|
|
3217
3400
|
}
|
|
3218
3401
|
get resultSet() {
|
|
3219
|
-
return
|
|
3402
|
+
return u(this, W);
|
|
3220
3403
|
}
|
|
3221
3404
|
}
|
|
3222
|
-
|
|
3223
|
-
class
|
|
3405
|
+
W = new WeakMap();
|
|
3406
|
+
class Je {
|
|
3224
3407
|
constructor(e) {
|
|
3225
3408
|
R(this, "migrations");
|
|
3226
3409
|
this.migrations = e;
|
|
@@ -3229,7 +3412,7 @@ class Le {
|
|
|
3229
3412
|
return this.migrations;
|
|
3230
3413
|
}
|
|
3231
3414
|
}
|
|
3232
|
-
async function
|
|
3415
|
+
async function $r(t) {
|
|
3233
3416
|
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(
|
|
3234
3417
|
"tenant_id",
|
|
3235
3418
|
"varchar(255)",
|
|
@@ -3301,35 +3484,35 @@ async function ga(t) {
|
|
|
3301
3484
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3302
3485
|
).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();
|
|
3303
3486
|
}
|
|
3304
|
-
async function
|
|
3487
|
+
async function Ir(t) {
|
|
3305
3488
|
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();
|
|
3306
3489
|
}
|
|
3307
|
-
const
|
|
3490
|
+
const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3308
3491
|
__proto__: null,
|
|
3309
|
-
down:
|
|
3310
|
-
up:
|
|
3492
|
+
down: Ir,
|
|
3493
|
+
up: $r
|
|
3311
3494
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3312
|
-
async function
|
|
3495
|
+
async function Pr(t) {
|
|
3313
3496
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
3314
3497
|
}
|
|
3315
|
-
async function
|
|
3498
|
+
async function jr(t) {
|
|
3316
3499
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
3317
3500
|
}
|
|
3318
|
-
const
|
|
3501
|
+
const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3319
3502
|
__proto__: null,
|
|
3320
|
-
down:
|
|
3321
|
-
up:
|
|
3503
|
+
down: jr,
|
|
3504
|
+
up: Pr
|
|
3322
3505
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3323
|
-
async function
|
|
3506
|
+
async function Ar(t) {
|
|
3324
3507
|
}
|
|
3325
|
-
async function
|
|
3508
|
+
async function Mr(t) {
|
|
3326
3509
|
}
|
|
3327
|
-
const
|
|
3510
|
+
const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3328
3511
|
__proto__: null,
|
|
3329
|
-
down:
|
|
3330
|
-
up:
|
|
3512
|
+
down: Mr,
|
|
3513
|
+
up: Ar
|
|
3331
3514
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3332
|
-
async function
|
|
3515
|
+
async function Jr(t) {
|
|
3333
3516
|
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(
|
|
3334
3517
|
"tenant_id_constraint",
|
|
3335
3518
|
["tenant_id"],
|
|
@@ -3338,24 +3521,24 @@ async function Sa(t) {
|
|
|
3338
3521
|
(e) => e.onDelete("cascade")
|
|
3339
3522
|
).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();
|
|
3340
3523
|
}
|
|
3341
|
-
async function
|
|
3524
|
+
async function Er(t) {
|
|
3342
3525
|
await t.schema.dropTable("logs").execute();
|
|
3343
3526
|
}
|
|
3344
|
-
const
|
|
3527
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3345
3528
|
__proto__: null,
|
|
3346
|
-
down:
|
|
3347
|
-
up:
|
|
3529
|
+
down: Er,
|
|
3530
|
+
up: Jr
|
|
3348
3531
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3349
|
-
async function
|
|
3532
|
+
async function Rr(t) {
|
|
3350
3533
|
}
|
|
3351
|
-
async function
|
|
3534
|
+
async function Kr(t) {
|
|
3352
3535
|
}
|
|
3353
|
-
const
|
|
3536
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3354
3537
|
__proto__: null,
|
|
3355
|
-
down:
|
|
3356
|
-
up:
|
|
3538
|
+
down: Kr,
|
|
3539
|
+
up: Rr
|
|
3357
3540
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3358
|
-
async function
|
|
3541
|
+
async function Br(t) {
|
|
3359
3542
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3360
3543
|
"user_id_constraint",
|
|
3361
3544
|
["user_id", "tenant_id"],
|
|
@@ -3380,15 +3563,15 @@ async function Pa(t) {
|
|
|
3380
3563
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3381
3564
|
).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();
|
|
3382
3565
|
}
|
|
3383
|
-
async function
|
|
3566
|
+
async function qr(t) {
|
|
3384
3567
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
3385
3568
|
}
|
|
3386
|
-
const
|
|
3569
|
+
const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3387
3570
|
__proto__: null,
|
|
3388
|
-
down:
|
|
3389
|
-
up:
|
|
3571
|
+
down: qr,
|
|
3572
|
+
up: Br
|
|
3390
3573
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3391
|
-
async function
|
|
3574
|
+
async function Wr(t) {
|
|
3392
3575
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
3393
3576
|
"user_id_constraint",
|
|
3394
3577
|
["user_id", "tenant_id"],
|
|
@@ -3403,24 +3586,24 @@ async function Ma(t) {
|
|
|
3403
3586
|
(e) => e.onDelete("cascade")
|
|
3404
3587
|
).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();
|
|
3405
3588
|
}
|
|
3406
|
-
async function
|
|
3589
|
+
async function Vr(t) {
|
|
3407
3590
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3408
3591
|
}
|
|
3409
|
-
const
|
|
3592
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3410
3593
|
__proto__: null,
|
|
3411
|
-
down:
|
|
3412
|
-
up:
|
|
3594
|
+
down: Vr,
|
|
3595
|
+
up: Wr
|
|
3413
3596
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3414
|
-
async function
|
|
3597
|
+
async function Hr(t) {
|
|
3415
3598
|
}
|
|
3416
|
-
async function
|
|
3599
|
+
async function Yr(t) {
|
|
3417
3600
|
}
|
|
3418
|
-
const
|
|
3601
|
+
const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3419
3602
|
__proto__: null,
|
|
3420
|
-
down:
|
|
3421
|
-
up:
|
|
3603
|
+
down: Yr,
|
|
3604
|
+
up: Hr
|
|
3422
3605
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3423
|
-
async function
|
|
3606
|
+
async function Zr(t) {
|
|
3424
3607
|
await t.schema.alterTable("passwords").addColumn(
|
|
3425
3608
|
"password",
|
|
3426
3609
|
"varchar(255)",
|
|
@@ -3428,68 +3611,26 @@ async function Ra(t) {
|
|
|
3428
3611
|
(e) => e.notNull()
|
|
3429
3612
|
).execute();
|
|
3430
3613
|
}
|
|
3431
|
-
async function Ka(t) {
|
|
3432
|
-
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3433
|
-
}
|
|
3434
|
-
const Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3435
|
-
__proto__: null,
|
|
3436
|
-
down: Ka,
|
|
3437
|
-
up: Ra
|
|
3438
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3439
|
-
async function Ba(t) {
|
|
3440
|
-
}
|
|
3441
|
-
async function Qa(t) {
|
|
3442
|
-
}
|
|
3443
|
-
const qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3444
|
-
__proto__: null,
|
|
3445
|
-
down: Qa,
|
|
3446
|
-
up: Ba
|
|
3447
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3448
|
-
async function Va(t) {
|
|
3449
|
-
}
|
|
3450
|
-
async function Wa(t) {
|
|
3451
|
-
}
|
|
3452
|
-
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3453
|
-
__proto__: null,
|
|
3454
|
-
down: Wa,
|
|
3455
|
-
up: Va
|
|
3456
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3457
|
-
async function Ha(t) {
|
|
3458
|
-
}
|
|
3459
|
-
async function Ya(t) {
|
|
3460
|
-
}
|
|
3461
|
-
const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3462
|
-
__proto__: null,
|
|
3463
|
-
down: Ya,
|
|
3464
|
-
up: Ha
|
|
3465
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3466
|
-
async function Za(t) {
|
|
3467
|
-
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3468
|
-
}
|
|
3469
3614
|
async function en(t) {
|
|
3470
|
-
await t.schema.
|
|
3615
|
+
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3471
3616
|
}
|
|
3472
3617
|
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3473
3618
|
__proto__: null,
|
|
3474
3619
|
down: en,
|
|
3475
|
-
up:
|
|
3620
|
+
up: Zr
|
|
3476
3621
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3477
|
-
async function rn(t) {
|
|
3478
|
-
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3479
|
-
}
|
|
3480
3622
|
async function an(t) {
|
|
3481
|
-
|
|
3623
|
+
}
|
|
3624
|
+
async function rn(t) {
|
|
3482
3625
|
}
|
|
3483
3626
|
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3484
3627
|
__proto__: null,
|
|
3485
|
-
down:
|
|
3486
|
-
up:
|
|
3628
|
+
down: rn,
|
|
3629
|
+
up: an
|
|
3487
3630
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3488
3631
|
async function on(t) {
|
|
3489
|
-
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3490
3632
|
}
|
|
3491
3633
|
async function sn(t) {
|
|
3492
|
-
await t.schema.dropIndex("users_linked_to_index");
|
|
3493
3634
|
}
|
|
3494
3635
|
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3495
3636
|
__proto__: null,
|
|
@@ -3497,10 +3638,8 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3497
3638
|
up: on
|
|
3498
3639
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3499
3640
|
async function cn(t) {
|
|
3500
|
-
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3501
3641
|
}
|
|
3502
3642
|
async function dn(t) {
|
|
3503
|
-
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3504
3643
|
}
|
|
3505
3644
|
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3506
3645
|
__proto__: null,
|
|
@@ -3508,22 +3647,10 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3508
3647
|
up: cn
|
|
3509
3648
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3510
3649
|
async function mn(t) {
|
|
3511
|
-
await t.schema.
|
|
3512
|
-
"tenant_id",
|
|
3513
|
-
"varchar(255)",
|
|
3514
|
-
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3515
|
-
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(4096)").addColumn("pkcs7", "varchar(4096)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").addColumn(
|
|
3516
|
-
"type",
|
|
3517
|
-
"varchar(50)",
|
|
3518
|
-
(e) => e.notNull().defaultTo("jwt_signing")
|
|
3519
|
-
).addColumn(
|
|
3520
|
-
"connection",
|
|
3521
|
-
"varchar(255)",
|
|
3522
|
-
(e) => e.references("connections.id").onDelete("cascade")
|
|
3523
|
-
).execute();
|
|
3650
|
+
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3524
3651
|
}
|
|
3525
3652
|
async function _n(t) {
|
|
3526
|
-
await t.schema.
|
|
3653
|
+
await t.schema.dropIndex("users_email_index").execute();
|
|
3527
3654
|
}
|
|
3528
3655
|
const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3529
3656
|
__proto__: null,
|
|
@@ -3531,8 +3658,10 @@ const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3531
3658
|
up: mn
|
|
3532
3659
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3533
3660
|
async function fn(t) {
|
|
3661
|
+
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3534
3662
|
}
|
|
3535
3663
|
async function pn(t) {
|
|
3664
|
+
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3536
3665
|
}
|
|
3537
3666
|
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3538
3667
|
__proto__: null,
|
|
@@ -3540,8 +3669,10 @@ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3540
3669
|
up: fn
|
|
3541
3670
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3542
3671
|
async function wn(t) {
|
|
3672
|
+
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3543
3673
|
}
|
|
3544
3674
|
async function yn(t) {
|
|
3675
|
+
await t.schema.dropIndex("users_linked_to_index");
|
|
3545
3676
|
}
|
|
3546
3677
|
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3547
3678
|
__proto__: null,
|
|
@@ -3549,10 +3680,10 @@ const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3549
3680
|
up: wn
|
|
3550
3681
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3551
3682
|
async function Nn(t) {
|
|
3552
|
-
await t.schema.alterTable("
|
|
3683
|
+
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3553
3684
|
}
|
|
3554
3685
|
async function Cn(t) {
|
|
3555
|
-
await t.schema.alterTable("
|
|
3686
|
+
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3556
3687
|
}
|
|
3557
3688
|
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3558
3689
|
__proto__: null,
|
|
@@ -3560,8 +3691,22 @@ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3560
3691
|
up: Nn
|
|
3561
3692
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3562
3693
|
async function xn(t) {
|
|
3694
|
+
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3695
|
+
"tenant_id",
|
|
3696
|
+
"varchar(255)",
|
|
3697
|
+
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3698
|
+
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(4096)").addColumn("pkcs7", "varchar(4096)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").addColumn(
|
|
3699
|
+
"type",
|
|
3700
|
+
"varchar(50)",
|
|
3701
|
+
(e) => e.notNull().defaultTo("jwt_signing")
|
|
3702
|
+
).addColumn(
|
|
3703
|
+
"connection",
|
|
3704
|
+
"varchar(255)",
|
|
3705
|
+
(e) => e.references("connections.id").onDelete("cascade")
|
|
3706
|
+
).execute();
|
|
3563
3707
|
}
|
|
3564
3708
|
async function Tn(t) {
|
|
3709
|
+
await t.schema.dropTable("keys").execute();
|
|
3565
3710
|
}
|
|
3566
3711
|
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3567
3712
|
__proto__: null,
|
|
@@ -3569,10 +3714,8 @@ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3569
3714
|
up: xn
|
|
3570
3715
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3571
3716
|
async function On(t) {
|
|
3572
|
-
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3573
3717
|
}
|
|
3574
3718
|
async function kn(t) {
|
|
3575
|
-
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3576
3719
|
}
|
|
3577
3720
|
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3578
3721
|
__proto__: null,
|
|
@@ -3580,10 +3723,8 @@ const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3580
3723
|
up: On
|
|
3581
3724
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3582
3725
|
async function In(t) {
|
|
3583
|
-
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3584
3726
|
}
|
|
3585
3727
|
async function Dn(t) {
|
|
3586
|
-
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3587
3728
|
}
|
|
3588
3729
|
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3589
3730
|
__proto__: null,
|
|
@@ -3591,75 +3732,74 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3591
3732
|
up: In
|
|
3592
3733
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3593
3734
|
async function jn(t) {
|
|
3594
|
-
await t.schema.
|
|
3735
|
+
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3595
3736
|
}
|
|
3596
3737
|
async function Fn(t) {
|
|
3597
|
-
await t.schema.
|
|
3738
|
+
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3598
3739
|
}
|
|
3599
|
-
const
|
|
3740
|
+
const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3600
3741
|
__proto__: null,
|
|
3601
3742
|
down: Fn,
|
|
3602
3743
|
up: jn
|
|
3603
3744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3604
|
-
async function
|
|
3605
|
-
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3745
|
+
async function Mn(t) {
|
|
3606
3746
|
}
|
|
3607
3747
|
async function zn(t) {
|
|
3608
|
-
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3609
3748
|
}
|
|
3610
|
-
const
|
|
3749
|
+
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3611
3750
|
__proto__: null,
|
|
3612
3751
|
down: zn,
|
|
3613
|
-
up:
|
|
3752
|
+
up: Mn
|
|
3614
3753
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3615
3754
|
async function En(t) {
|
|
3616
|
-
await t.schema.alterTable("logs").
|
|
3755
|
+
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3617
3756
|
}
|
|
3618
|
-
async function
|
|
3619
|
-
await t.schema.alterTable("logs").
|
|
3757
|
+
async function Ln(t) {
|
|
3758
|
+
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3620
3759
|
}
|
|
3621
3760
|
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3622
3761
|
__proto__: null,
|
|
3623
|
-
down:
|
|
3762
|
+
down: Ln,
|
|
3624
3763
|
up: En
|
|
3625
3764
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3626
3765
|
async function Kn(t) {
|
|
3627
|
-
await t.schema.
|
|
3766
|
+
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3628
3767
|
}
|
|
3629
3768
|
async function Un(t) {
|
|
3630
|
-
await t.schema.
|
|
3769
|
+
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3631
3770
|
}
|
|
3632
3771
|
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3633
3772
|
__proto__: null,
|
|
3634
3773
|
down: Un,
|
|
3635
3774
|
up: Kn
|
|
3636
3775
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3637
|
-
async function Qn(t) {
|
|
3638
|
-
}
|
|
3639
3776
|
async function qn(t) {
|
|
3640
|
-
await t.schema.
|
|
3777
|
+
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();
|
|
3778
|
+
}
|
|
3779
|
+
async function Qn(t) {
|
|
3780
|
+
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
3641
3781
|
}
|
|
3642
|
-
const
|
|
3782
|
+
const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3643
3783
|
__proto__: null,
|
|
3644
|
-
down:
|
|
3645
|
-
up:
|
|
3784
|
+
down: Qn,
|
|
3785
|
+
up: qn
|
|
3646
3786
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3647
|
-
async function
|
|
3648
|
-
await t.schema.alterTable("
|
|
3787
|
+
async function Vn(t) {
|
|
3788
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3649
3789
|
}
|
|
3650
3790
|
async function Gn(t) {
|
|
3651
|
-
await t.schema.alterTable("
|
|
3791
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3652
3792
|
}
|
|
3653
3793
|
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3654
3794
|
__proto__: null,
|
|
3655
3795
|
down: Gn,
|
|
3656
|
-
up:
|
|
3796
|
+
up: Vn
|
|
3657
3797
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3658
3798
|
async function Yn(t) {
|
|
3659
|
-
await t.schema.alterTable("
|
|
3799
|
+
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();
|
|
3660
3800
|
}
|
|
3661
3801
|
async function Xn(t) {
|
|
3662
|
-
await t.schema.alterTable("
|
|
3802
|
+
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();
|
|
3663
3803
|
}
|
|
3664
3804
|
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3665
3805
|
__proto__: null,
|
|
@@ -3667,32 +3807,31 @@ const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3667
3807
|
up: Yn
|
|
3668
3808
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3669
3809
|
async function eo(t) {
|
|
3670
|
-
await t.schema.
|
|
3671
|
-
"tenant_id",
|
|
3672
|
-
"varchar(255)",
|
|
3673
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3674
|
-
).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();
|
|
3810
|
+
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
3675
3811
|
}
|
|
3676
3812
|
async function to(t) {
|
|
3677
|
-
await t.schema.
|
|
3813
|
+
await t.schema.dropIndex("users_name_index").execute();
|
|
3678
3814
|
}
|
|
3679
|
-
const
|
|
3815
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3680
3816
|
__proto__: null,
|
|
3681
3817
|
down: to,
|
|
3682
3818
|
up: eo
|
|
3683
3819
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3684
|
-
async function
|
|
3820
|
+
async function ro(t) {
|
|
3685
3821
|
}
|
|
3686
3822
|
async function no(t) {
|
|
3823
|
+
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
3687
3824
|
}
|
|
3688
3825
|
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3689
3826
|
__proto__: null,
|
|
3690
3827
|
down: no,
|
|
3691
|
-
up:
|
|
3828
|
+
up: ro
|
|
3692
3829
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3693
3830
|
async function so(t) {
|
|
3831
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3694
3832
|
}
|
|
3695
3833
|
async function io(t) {
|
|
3834
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
3696
3835
|
}
|
|
3697
3836
|
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3698
3837
|
__proto__: null,
|
|
@@ -3700,8 +3839,10 @@ const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3700
3839
|
up: so
|
|
3701
3840
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3702
3841
|
async function co(t) {
|
|
3842
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3703
3843
|
}
|
|
3704
3844
|
async function uo(t) {
|
|
3845
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3705
3846
|
}
|
|
3706
3847
|
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3707
3848
|
__proto__: null,
|
|
@@ -3709,8 +3850,14 @@ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3709
3850
|
up: co
|
|
3710
3851
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3711
3852
|
async function _o(t) {
|
|
3853
|
+
await t.schema.createTable("branding").addColumn(
|
|
3854
|
+
"tenant_id",
|
|
3855
|
+
"varchar(255)",
|
|
3856
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3857
|
+
).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();
|
|
3712
3858
|
}
|
|
3713
3859
|
async function ho(t) {
|
|
3860
|
+
await t.schema.dropTable("branding").execute();
|
|
3714
3861
|
}
|
|
3715
3862
|
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3716
3863
|
__proto__: null,
|
|
@@ -3718,18 +3865,8 @@ const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3718
3865
|
up: _o
|
|
3719
3866
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3720
3867
|
async function po(t) {
|
|
3721
|
-
await t.schema.createTable("authentication_codes").addColumn(
|
|
3722
|
-
"tenant_id",
|
|
3723
|
-
"varchar(255)",
|
|
3724
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3725
|
-
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3726
|
-
"client_id",
|
|
3727
|
-
"varchar(255)",
|
|
3728
|
-
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3729
|
-
).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();
|
|
3730
3868
|
}
|
|
3731
3869
|
async function go(t) {
|
|
3732
|
-
await t.schema.dropTable("authentication_codes").execute();
|
|
3733
3870
|
}
|
|
3734
3871
|
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3735
3872
|
__proto__: null,
|
|
@@ -3746,10 +3883,8 @@ const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3746
3883
|
up: yo
|
|
3747
3884
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3748
3885
|
async function Co(t) {
|
|
3749
|
-
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3750
3886
|
}
|
|
3751
3887
|
async function bo(t) {
|
|
3752
|
-
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3753
3888
|
}
|
|
3754
3889
|
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3755
3890
|
__proto__: null,
|
|
@@ -3757,10 +3892,8 @@ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3757
3892
|
up: Co
|
|
3758
3893
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3759
3894
|
async function To(t) {
|
|
3760
|
-
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3761
3895
|
}
|
|
3762
3896
|
async function So(t) {
|
|
3763
|
-
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3764
3897
|
}
|
|
3765
3898
|
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3766
3899
|
__proto__: null,
|
|
@@ -3768,8 +3901,18 @@ const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3768
3901
|
up: To
|
|
3769
3902
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3770
3903
|
async function ko(t) {
|
|
3904
|
+
await t.schema.createTable("authentication_codes").addColumn(
|
|
3905
|
+
"tenant_id",
|
|
3906
|
+
"varchar(255)",
|
|
3907
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3908
|
+
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3909
|
+
"client_id",
|
|
3910
|
+
"varchar(255)",
|
|
3911
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3912
|
+
).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();
|
|
3771
3913
|
}
|
|
3772
3914
|
async function $o(t) {
|
|
3915
|
+
await t.schema.dropTable("authentication_codes").execute();
|
|
3773
3916
|
}
|
|
3774
3917
|
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3775
3918
|
__proto__: null,
|
|
@@ -3777,18 +3920,8 @@ const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3777
3920
|
up: ko
|
|
3778
3921
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3779
3922
|
async function Do(t) {
|
|
3780
|
-
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3781
|
-
"tenant_id",
|
|
3782
|
-
"varchar(255)",
|
|
3783
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3784
|
-
).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("trigger_id", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3785
|
-
"synchronous",
|
|
3786
|
-
"boolean",
|
|
3787
|
-
(e) => e.defaultTo(!1).notNull()
|
|
3788
|
-
).addColumn("priority", "integer").execute();
|
|
3789
3923
|
}
|
|
3790
3924
|
async function Po(t) {
|
|
3791
|
-
await t.schema.dropTable("hooks").execute();
|
|
3792
3925
|
}
|
|
3793
3926
|
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3794
3927
|
__proto__: null,
|
|
@@ -3796,79 +3929,67 @@ const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3796
3929
|
up: Do
|
|
3797
3930
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3798
3931
|
async function Fo(t) {
|
|
3932
|
+
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3799
3933
|
}
|
|
3800
|
-
async function
|
|
3934
|
+
async function Ao(t) {
|
|
3935
|
+
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3801
3936
|
}
|
|
3802
|
-
const
|
|
3937
|
+
const Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3803
3938
|
__proto__: null,
|
|
3804
|
-
down:
|
|
3939
|
+
down: Ao,
|
|
3805
3940
|
up: Fo
|
|
3806
3941
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3807
3942
|
async function zo(t) {
|
|
3943
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3808
3944
|
}
|
|
3809
|
-
async function
|
|
3945
|
+
async function Jo(t) {
|
|
3946
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3810
3947
|
}
|
|
3811
3948
|
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3812
3949
|
__proto__: null,
|
|
3813
|
-
down:
|
|
3950
|
+
down: Jo,
|
|
3814
3951
|
up: zo
|
|
3815
3952
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3816
|
-
async function
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3953
|
+
async function Lo(t) {
|
|
3954
|
+
}
|
|
3955
|
+
async function Ro(t) {
|
|
3956
|
+
}
|
|
3957
|
+
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3958
|
+
__proto__: null,
|
|
3959
|
+
down: Ro,
|
|
3960
|
+
up: Lo
|
|
3961
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3962
|
+
async function Uo(t) {
|
|
3963
|
+
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3822
3964
|
"tenant_id",
|
|
3823
3965
|
"varchar(255)",
|
|
3824
3966
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3825
|
-
).addColumn("
|
|
3826
|
-
"
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
(e) => e.onDelete("cascade")
|
|
3831
|
-
).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();
|
|
3832
|
-
}
|
|
3833
|
-
async function Ro(t) {
|
|
3834
|
-
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(
|
|
3835
|
-
"codes_user_id_tenant_id_constraint",
|
|
3836
|
-
["user_id", "tenant_id"],
|
|
3837
|
-
"users",
|
|
3838
|
-
["user_id", "tenant_id"],
|
|
3839
|
-
(e) => e.onDelete("cascade")
|
|
3840
|
-
).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();
|
|
3841
|
-
}
|
|
3842
|
-
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3843
|
-
__proto__: null,
|
|
3844
|
-
down: Ro,
|
|
3845
|
-
up: Jo
|
|
3846
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3847
|
-
async function Uo(t) {
|
|
3967
|
+
).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("trigger_id", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3968
|
+
"synchronous",
|
|
3969
|
+
"boolean",
|
|
3970
|
+
(e) => e.defaultTo(!1).notNull()
|
|
3971
|
+
).addColumn("priority", "integer").execute();
|
|
3848
3972
|
}
|
|
3849
3973
|
async function Bo(t) {
|
|
3974
|
+
await t.schema.dropTable("hooks").execute();
|
|
3850
3975
|
}
|
|
3851
|
-
const
|
|
3976
|
+
const qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3852
3977
|
__proto__: null,
|
|
3853
3978
|
down: Bo,
|
|
3854
3979
|
up: Uo
|
|
3855
3980
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3856
|
-
async function
|
|
3857
|
-
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3981
|
+
async function Qo(t) {
|
|
3858
3982
|
}
|
|
3859
|
-
async function
|
|
3860
|
-
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3983
|
+
async function Wo(t) {
|
|
3861
3984
|
}
|
|
3862
|
-
const
|
|
3985
|
+
const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3863
3986
|
__proto__: null,
|
|
3864
|
-
down:
|
|
3865
|
-
up:
|
|
3987
|
+
down: Wo,
|
|
3988
|
+
up: Qo
|
|
3866
3989
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3867
3990
|
async function Go(t) {
|
|
3868
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3869
3991
|
}
|
|
3870
3992
|
async function Ho(t) {
|
|
3871
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3872
3993
|
}
|
|
3873
3994
|
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3874
3995
|
__proto__: null,
|
|
@@ -3876,8 +3997,30 @@ const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3876
3997
|
up: Go
|
|
3877
3998
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3878
3999
|
async function Xo(t) {
|
|
4000
|
+
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
4001
|
+
"tenant_id",
|
|
4002
|
+
"varchar(255)",
|
|
4003
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4004
|
+
).addColumn("authParams_client_id", "varchar(255)", (e) => e.notNull()).addColumn("authParams_vendor_id", "varchar(255)").addColumn("authParams_username", "varchar(255)").addColumn("authParams_response_type", "varchar(255)").addColumn("authParams_response_mode", "varchar(255)").addColumn("authParams_audience", "varchar(255)").addColumn("authParams_scope", "varchar(511)").addColumn("authParams_state", "varchar(511)").addColumn("authParams_code_challenge_method", "varchar(256)").addColumn("authParams_code_challenge", "varchar(256)").addColumn("authParams_redirect_uri", "varchar(256)").addColumn("authParams_organization", "varchar(256)").addColumn("authorization_url", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("ip", "varchar(255)").addColumn("useragent", "varchar(512)").execute(), await t.schema.alterTable("passwords").addColumn("algorithm", "varchar(16)").execute(), await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
4005
|
+
"tenant_id",
|
|
4006
|
+
"varchar(255)",
|
|
4007
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4008
|
+
).addColumn("user_id", "varchar(255)").addColumn("login_id", "varchar(255)").addForeignKeyConstraint(
|
|
4009
|
+
"codes_user_id_tenant_id_constraint",
|
|
4010
|
+
["user_id", "tenant_id"],
|
|
4011
|
+
"users",
|
|
4012
|
+
["user_id", "tenant_id"],
|
|
4013
|
+
(e) => e.onDelete("cascade")
|
|
4014
|
+
).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();
|
|
3879
4015
|
}
|
|
3880
4016
|
async function Zo(t) {
|
|
4017
|
+
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(
|
|
4018
|
+
"codes_user_id_tenant_id_constraint",
|
|
4019
|
+
["user_id", "tenant_id"],
|
|
4020
|
+
"users",
|
|
4021
|
+
["user_id", "tenant_id"],
|
|
4022
|
+
(e) => e.onDelete("cascade")
|
|
4023
|
+
).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();
|
|
3881
4024
|
}
|
|
3882
4025
|
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3883
4026
|
__proto__: null,
|
|
@@ -3886,18 +4029,18 @@ const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3886
4029
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3887
4030
|
async function ts(t) {
|
|
3888
4031
|
}
|
|
3889
|
-
async function
|
|
4032
|
+
async function as(t) {
|
|
3890
4033
|
}
|
|
3891
|
-
const
|
|
4034
|
+
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3892
4035
|
__proto__: null,
|
|
3893
|
-
down:
|
|
4036
|
+
down: as,
|
|
3894
4037
|
up: ts
|
|
3895
4038
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3896
4039
|
async function ns(t) {
|
|
3897
|
-
await t.schema.alterTable("logins").addColumn("
|
|
4040
|
+
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3898
4041
|
}
|
|
3899
4042
|
async function os(t) {
|
|
3900
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
4043
|
+
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3901
4044
|
}
|
|
3902
4045
|
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3903
4046
|
__proto__: null,
|
|
@@ -3905,8 +4048,10 @@ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3905
4048
|
up: ns
|
|
3906
4049
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3907
4050
|
async function is(t) {
|
|
4051
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3908
4052
|
}
|
|
3909
4053
|
async function ls(t) {
|
|
4054
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3910
4055
|
}
|
|
3911
4056
|
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3912
4057
|
__proto__: null,
|
|
@@ -3923,6 +4068,44 @@ const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3923
4068
|
up: ds
|
|
3924
4069
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3925
4070
|
async function _s(t) {
|
|
4071
|
+
}
|
|
4072
|
+
async function hs(t) {
|
|
4073
|
+
}
|
|
4074
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4075
|
+
__proto__: null,
|
|
4076
|
+
down: hs,
|
|
4077
|
+
up: _s
|
|
4078
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4079
|
+
async function ps(t) {
|
|
4080
|
+
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
4081
|
+
}
|
|
4082
|
+
async function gs(t) {
|
|
4083
|
+
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
4084
|
+
}
|
|
4085
|
+
const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4086
|
+
__proto__: null,
|
|
4087
|
+
down: gs,
|
|
4088
|
+
up: ps
|
|
4089
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4090
|
+
async function ys(t) {
|
|
4091
|
+
}
|
|
4092
|
+
async function vs(t) {
|
|
4093
|
+
}
|
|
4094
|
+
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4095
|
+
__proto__: null,
|
|
4096
|
+
down: vs,
|
|
4097
|
+
up: ys
|
|
4098
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4099
|
+
async function Cs(t) {
|
|
4100
|
+
}
|
|
4101
|
+
async function bs(t) {
|
|
4102
|
+
}
|
|
4103
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4104
|
+
__proto__: null,
|
|
4105
|
+
down: bs,
|
|
4106
|
+
up: Cs
|
|
4107
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4108
|
+
async function Ts(t) {
|
|
3926
4109
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3927
4110
|
"tenant_id",
|
|
3928
4111
|
"varchar(255)",
|
|
@@ -3938,7 +4121,7 @@ async function _s(t) {
|
|
|
3938
4121
|
"code_type"
|
|
3939
4122
|
]).execute();
|
|
3940
4123
|
}
|
|
3941
|
-
async function
|
|
4124
|
+
async function Ss(t) {
|
|
3942
4125
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3943
4126
|
"tenant_id",
|
|
3944
4127
|
"varchar(255)",
|
|
@@ -3951,15 +4134,15 @@ async function hs(t) {
|
|
|
3951
4134
|
(e) => e.onDelete("cascade")
|
|
3952
4135
|
).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();
|
|
3953
4136
|
}
|
|
3954
|
-
const
|
|
4137
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3955
4138
|
__proto__: null,
|
|
3956
|
-
down:
|
|
3957
|
-
up:
|
|
4139
|
+
down: Ss,
|
|
4140
|
+
up: Ts
|
|
3958
4141
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3959
|
-
async function
|
|
4142
|
+
async function ks(t) {
|
|
3960
4143
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3961
4144
|
}
|
|
3962
|
-
async function
|
|
4145
|
+
async function $s(t) {
|
|
3963
4146
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3964
4147
|
"tenant_id",
|
|
3965
4148
|
"varchar(255)",
|
|
@@ -3978,32 +4161,32 @@ async function gs(t) {
|
|
|
3978
4161
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3979
4162
|
).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();
|
|
3980
4163
|
}
|
|
3981
|
-
const
|
|
4164
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3982
4165
|
__proto__: null,
|
|
3983
|
-
down:
|
|
3984
|
-
up:
|
|
4166
|
+
down: $s,
|
|
4167
|
+
up: ks
|
|
3985
4168
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3986
|
-
async function
|
|
4169
|
+
async function Ds(t) {
|
|
3987
4170
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3988
4171
|
}
|
|
3989
|
-
async function
|
|
4172
|
+
async function Ps(t) {
|
|
3990
4173
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3991
4174
|
}
|
|
3992
|
-
const
|
|
4175
|
+
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3993
4176
|
__proto__: null,
|
|
3994
|
-
down:
|
|
3995
|
-
up:
|
|
4177
|
+
down: Ps,
|
|
4178
|
+
up: Ds
|
|
3996
4179
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3997
|
-
async function
|
|
4180
|
+
async function Fs(t) {
|
|
3998
4181
|
}
|
|
3999
|
-
async function
|
|
4182
|
+
async function As(t) {
|
|
4000
4183
|
}
|
|
4001
|
-
const
|
|
4184
|
+
const Ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4002
4185
|
__proto__: null,
|
|
4003
|
-
down:
|
|
4004
|
-
up:
|
|
4186
|
+
down: As,
|
|
4187
|
+
up: Fs
|
|
4005
4188
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4006
|
-
async function
|
|
4189
|
+
async function zs(t) {
|
|
4007
4190
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
4008
4191
|
"universal_login_experience",
|
|
4009
4192
|
"varchar(16)",
|
|
@@ -4022,95 +4205,95 @@ async function Ts(t) {
|
|
|
4022
4205
|
(e) => e.defaultTo(!1).notNull()
|
|
4023
4206
|
).execute();
|
|
4024
4207
|
}
|
|
4025
|
-
async function
|
|
4208
|
+
async function Js(t) {
|
|
4026
4209
|
await t.schema.dropTable("prompt_settings").execute();
|
|
4027
4210
|
}
|
|
4028
|
-
const
|
|
4211
|
+
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4029
4212
|
__proto__: null,
|
|
4030
|
-
down:
|
|
4031
|
-
up:
|
|
4213
|
+
down: Js,
|
|
4214
|
+
up: zs
|
|
4032
4215
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4033
|
-
async function
|
|
4216
|
+
async function Ls(t) {
|
|
4034
4217
|
}
|
|
4035
|
-
async function
|
|
4218
|
+
async function Rs(t) {
|
|
4036
4219
|
}
|
|
4037
|
-
const
|
|
4220
|
+
const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4038
4221
|
__proto__: null,
|
|
4039
|
-
down:
|
|
4040
|
-
up:
|
|
4222
|
+
down: Rs,
|
|
4223
|
+
up: Ls
|
|
4041
4224
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4042
|
-
async function
|
|
4225
|
+
async function Us(t) {
|
|
4043
4226
|
}
|
|
4044
|
-
async function
|
|
4227
|
+
async function Bs(t) {
|
|
4045
4228
|
}
|
|
4046
|
-
const
|
|
4229
|
+
const qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4047
4230
|
__proto__: null,
|
|
4048
|
-
down:
|
|
4049
|
-
up:
|
|
4231
|
+
down: Bs,
|
|
4232
|
+
up: Us
|
|
4050
4233
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4051
|
-
async function
|
|
4234
|
+
async function Qs(t) {
|
|
4052
4235
|
}
|
|
4053
|
-
async function
|
|
4236
|
+
async function Ws(t) {
|
|
4054
4237
|
}
|
|
4055
|
-
const
|
|
4238
|
+
const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4056
4239
|
__proto__: null,
|
|
4057
|
-
down:
|
|
4058
|
-
up:
|
|
4240
|
+
down: Ws,
|
|
4241
|
+
up: Qs
|
|
4059
4242
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4060
|
-
async function
|
|
4243
|
+
async function Gs(t) {
|
|
4061
4244
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
4062
4245
|
}
|
|
4063
|
-
async function
|
|
4246
|
+
async function Hs(t) {
|
|
4064
4247
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
4065
4248
|
}
|
|
4066
|
-
const
|
|
4249
|
+
const Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4067
4250
|
__proto__: null,
|
|
4068
|
-
down:
|
|
4069
|
-
up:
|
|
4251
|
+
down: Hs,
|
|
4252
|
+
up: Gs
|
|
4070
4253
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4071
|
-
async function
|
|
4254
|
+
async function Xs(t) {
|
|
4072
4255
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
4073
4256
|
}
|
|
4074
|
-
async function
|
|
4257
|
+
async function Zs(t) {
|
|
4075
4258
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
4076
4259
|
}
|
|
4077
|
-
const
|
|
4260
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4078
4261
|
__proto__: null,
|
|
4079
|
-
down:
|
|
4080
|
-
up:
|
|
4262
|
+
down: Zs,
|
|
4263
|
+
up: Xs
|
|
4081
4264
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4082
|
-
async function
|
|
4265
|
+
async function ti(t) {
|
|
4083
4266
|
}
|
|
4084
|
-
async function
|
|
4267
|
+
async function ai(t) {
|
|
4085
4268
|
}
|
|
4086
|
-
const
|
|
4269
|
+
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4087
4270
|
__proto__: null,
|
|
4088
|
-
down:
|
|
4089
|
-
up:
|
|
4271
|
+
down: ai,
|
|
4272
|
+
up: ti
|
|
4090
4273
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4091
|
-
async function
|
|
4274
|
+
async function ni(t) {
|
|
4092
4275
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
4093
4276
|
}
|
|
4094
|
-
async function
|
|
4277
|
+
async function oi(t) {
|
|
4095
4278
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
4096
4279
|
}
|
|
4097
|
-
const
|
|
4280
|
+
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4098
4281
|
__proto__: null,
|
|
4099
|
-
down:
|
|
4100
|
-
up:
|
|
4282
|
+
down: oi,
|
|
4283
|
+
up: ni
|
|
4101
4284
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4102
|
-
async function
|
|
4285
|
+
async function ii(t) {
|
|
4103
4286
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
4104
4287
|
}
|
|
4105
|
-
async function
|
|
4288
|
+
async function li(t) {
|
|
4106
4289
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
4107
4290
|
}
|
|
4108
|
-
const
|
|
4291
|
+
const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4109
4292
|
__proto__: null,
|
|
4110
|
-
down:
|
|
4111
|
-
up:
|
|
4293
|
+
down: li,
|
|
4294
|
+
up: ii
|
|
4112
4295
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4113
|
-
async function
|
|
4296
|
+
async function di(t) {
|
|
4114
4297
|
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(
|
|
4115
4298
|
"credentials",
|
|
4116
4299
|
"varchar(2048)",
|
|
@@ -4121,18 +4304,18 @@ async function Xs(t) {
|
|
|
4121
4304
|
(e) => e.notNull().defaultTo("{}")
|
|
4122
4305
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
4123
4306
|
}
|
|
4124
|
-
async function
|
|
4307
|
+
async function ui(t) {
|
|
4125
4308
|
await t.schema.dropTable("email_providers").execute();
|
|
4126
4309
|
}
|
|
4127
|
-
const
|
|
4310
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4128
4311
|
__proto__: null,
|
|
4129
|
-
down:
|
|
4130
|
-
up:
|
|
4312
|
+
down: ui,
|
|
4313
|
+
up: di
|
|
4131
4314
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4132
|
-
async function
|
|
4315
|
+
async function _i(t) {
|
|
4133
4316
|
await t.schema.dropTable("tickets").execute();
|
|
4134
4317
|
}
|
|
4135
|
-
async function
|
|
4318
|
+
async function hi(t) {
|
|
4136
4319
|
await t.schema.createTable("tickets").addColumn(
|
|
4137
4320
|
"tenant_id",
|
|
4138
4321
|
"varchar(255)",
|
|
@@ -4143,22 +4326,22 @@ async function ri(t) {
|
|
|
4143
4326
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4144
4327
|
).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();
|
|
4145
4328
|
}
|
|
4146
|
-
const
|
|
4329
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4147
4330
|
__proto__: null,
|
|
4148
|
-
down:
|
|
4149
|
-
up:
|
|
4331
|
+
down: hi,
|
|
4332
|
+
up: _i
|
|
4150
4333
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4151
|
-
async function
|
|
4334
|
+
async function pi(t) {
|
|
4152
4335
|
}
|
|
4153
|
-
async function
|
|
4336
|
+
async function gi(t) {
|
|
4154
4337
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
4155
4338
|
}
|
|
4156
|
-
const
|
|
4339
|
+
const wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4157
4340
|
__proto__: null,
|
|
4158
|
-
down:
|
|
4159
|
-
up:
|
|
4341
|
+
down: gi,
|
|
4342
|
+
up: pi
|
|
4160
4343
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4161
|
-
async function
|
|
4344
|
+
async function yi(t) {
|
|
4162
4345
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
4163
4346
|
"client_id",
|
|
4164
4347
|
"varchar(21)",
|
|
@@ -4171,27 +4354,27 @@ async function ii(t) {
|
|
|
4171
4354
|
(e) => e.onDelete("cascade")
|
|
4172
4355
|
).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();
|
|
4173
4356
|
}
|
|
4174
|
-
async function
|
|
4357
|
+
async function vi(t) {
|
|
4175
4358
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
4176
4359
|
}
|
|
4177
|
-
const
|
|
4360
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4178
4361
|
__proto__: null,
|
|
4179
|
-
down:
|
|
4180
|
-
up:
|
|
4362
|
+
down: vi,
|
|
4363
|
+
up: yi
|
|
4181
4364
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4182
|
-
async function
|
|
4365
|
+
async function Ci(t) {
|
|
4183
4366
|
}
|
|
4184
|
-
async function
|
|
4367
|
+
async function bi(t) {
|
|
4185
4368
|
}
|
|
4186
|
-
const
|
|
4369
|
+
const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4187
4370
|
__proto__: null,
|
|
4188
|
-
down:
|
|
4189
|
-
up:
|
|
4371
|
+
down: bi,
|
|
4372
|
+
up: Ci
|
|
4190
4373
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4191
|
-
async function
|
|
4374
|
+
async function Ti(t) {
|
|
4192
4375
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4193
4376
|
}
|
|
4194
|
-
async function
|
|
4377
|
+
async function Si(t) {
|
|
4195
4378
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4196
4379
|
"sessions_user_id_constraint",
|
|
4197
4380
|
["user_id", "tenant_id"],
|
|
@@ -4210,12 +4393,12 @@ async function hi(t) {
|
|
|
4210
4393
|
(e) => e.onDelete("cascade")
|
|
4211
4394
|
).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();
|
|
4212
4395
|
}
|
|
4213
|
-
const
|
|
4396
|
+
const Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4214
4397
|
__proto__: null,
|
|
4215
|
-
down:
|
|
4216
|
-
up:
|
|
4398
|
+
down: Si,
|
|
4399
|
+
up: Ti
|
|
4217
4400
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4218
|
-
async function
|
|
4401
|
+
async function ki(t) {
|
|
4219
4402
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4220
4403
|
"sessions_2_user_id_constraint",
|
|
4221
4404
|
["user_id", "tenant_id"],
|
|
@@ -4234,15 +4417,15 @@ async function pi(t) {
|
|
|
4234
4417
|
(e) => e.onDelete("cascade")
|
|
4235
4418
|
).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();
|
|
4236
4419
|
}
|
|
4237
|
-
async function
|
|
4420
|
+
async function $i(t) {
|
|
4238
4421
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4239
4422
|
}
|
|
4240
|
-
const
|
|
4423
|
+
const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4241
4424
|
__proto__: null,
|
|
4242
|
-
down:
|
|
4243
|
-
up:
|
|
4425
|
+
down: $i,
|
|
4426
|
+
up: ki
|
|
4244
4427
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4245
|
-
async function
|
|
4428
|
+
async function Di(t) {
|
|
4246
4429
|
await t.schema.createTable("custom_domains").addColumn(
|
|
4247
4430
|
"custom_domain_id",
|
|
4248
4431
|
"varchar(21)",
|
|
@@ -4253,49 +4436,49 @@ async function yi(t) {
|
|
|
4253
4436
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4254
4437
|
).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();
|
|
4255
4438
|
}
|
|
4256
|
-
async function
|
|
4439
|
+
async function Pi(t) {
|
|
4257
4440
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
4258
4441
|
"tenant_id",
|
|
4259
4442
|
"varchar(255)",
|
|
4260
4443
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4261
4444
|
).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();
|
|
4262
4445
|
}
|
|
4263
|
-
const
|
|
4446
|
+
const ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4264
4447
|
__proto__: null,
|
|
4265
|
-
down:
|
|
4266
|
-
up:
|
|
4448
|
+
down: Pi,
|
|
4449
|
+
up: Di
|
|
4267
4450
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4268
|
-
async function
|
|
4451
|
+
async function Fi(t) {
|
|
4269
4452
|
}
|
|
4270
|
-
async function
|
|
4453
|
+
async function Ai(t) {
|
|
4271
4454
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4272
4455
|
}
|
|
4273
|
-
const
|
|
4456
|
+
const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4274
4457
|
__proto__: null,
|
|
4275
|
-
down:
|
|
4276
|
-
up:
|
|
4458
|
+
down: Ai,
|
|
4459
|
+
up: Fi
|
|
4277
4460
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4278
|
-
async function
|
|
4461
|
+
async function zi(t) {
|
|
4279
4462
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4280
4463
|
}
|
|
4281
|
-
async function
|
|
4464
|
+
async function Ji(t) {
|
|
4282
4465
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
4283
4466
|
}
|
|
4284
|
-
const
|
|
4467
|
+
const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4285
4468
|
__proto__: null,
|
|
4286
|
-
down:
|
|
4287
|
-
up:
|
|
4469
|
+
down: Ji,
|
|
4470
|
+
up: zi
|
|
4288
4471
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4289
|
-
async function
|
|
4472
|
+
async function Li(t) {
|
|
4290
4473
|
}
|
|
4291
|
-
async function
|
|
4474
|
+
async function Ri(t) {
|
|
4292
4475
|
}
|
|
4293
|
-
const
|
|
4476
|
+
const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4294
4477
|
__proto__: null,
|
|
4295
|
-
down:
|
|
4296
|
-
up:
|
|
4478
|
+
down: Ri,
|
|
4479
|
+
up: Li
|
|
4297
4480
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4298
|
-
async function
|
|
4481
|
+
async function Ui(t) {
|
|
4299
4482
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4300
4483
|
"sessions_user_id_constraint",
|
|
4301
4484
|
["user_id", "tenant_id"],
|
|
@@ -4322,25 +4505,25 @@ async function Di(t) {
|
|
|
4322
4505
|
(e) => e.onDelete("cascade")
|
|
4323
4506
|
).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();
|
|
4324
4507
|
}
|
|
4325
|
-
async function
|
|
4508
|
+
async function Bi(t) {
|
|
4326
4509
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4327
4510
|
}
|
|
4328
|
-
const
|
|
4511
|
+
const qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4329
4512
|
__proto__: null,
|
|
4330
|
-
down:
|
|
4331
|
-
up:
|
|
4513
|
+
down: Bi,
|
|
4514
|
+
up: Ui
|
|
4332
4515
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4333
|
-
async function
|
|
4516
|
+
async function Qi(t) {
|
|
4334
4517
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4335
4518
|
}
|
|
4336
|
-
async function
|
|
4519
|
+
async function Wi(t) {
|
|
4337
4520
|
}
|
|
4338
|
-
const
|
|
4521
|
+
const Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4339
4522
|
__proto__: null,
|
|
4340
|
-
down:
|
|
4341
|
-
up:
|
|
4523
|
+
down: Wi,
|
|
4524
|
+
up: Qi
|
|
4342
4525
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4343
|
-
async function
|
|
4526
|
+
async function Gi(t) {
|
|
4344
4527
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
4345
4528
|
"custom_domain_id",
|
|
4346
4529
|
"varchar(256)",
|
|
@@ -4351,120 +4534,120 @@ async function zi(t) {
|
|
|
4351
4534
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4352
4535
|
).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();
|
|
4353
4536
|
}
|
|
4354
|
-
async function
|
|
4537
|
+
async function Hi(t) {
|
|
4355
4538
|
}
|
|
4356
|
-
const
|
|
4539
|
+
const Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4357
4540
|
__proto__: null,
|
|
4358
|
-
down:
|
|
4359
|
-
up:
|
|
4541
|
+
down: Hi,
|
|
4542
|
+
up: Gi
|
|
4360
4543
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4361
|
-
async function
|
|
4544
|
+
async function Xi(t) {
|
|
4362
4545
|
}
|
|
4363
|
-
async function
|
|
4546
|
+
async function Zi(t) {
|
|
4364
4547
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4365
4548
|
}
|
|
4366
|
-
const
|
|
4549
|
+
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4367
4550
|
__proto__: null,
|
|
4368
|
-
down:
|
|
4369
|
-
up:
|
|
4551
|
+
down: Zi,
|
|
4552
|
+
up: Xi
|
|
4370
4553
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4371
|
-
async function
|
|
4554
|
+
async function tl(t) {
|
|
4372
4555
|
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
|
|
4373
4556
|
}
|
|
4374
|
-
async function
|
|
4557
|
+
async function al(t) {
|
|
4375
4558
|
await t.schema.dropTable("forms").execute();
|
|
4376
4559
|
}
|
|
4377
|
-
const
|
|
4560
|
+
const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4378
4561
|
__proto__: null,
|
|
4379
|
-
down:
|
|
4380
|
-
up:
|
|
4562
|
+
down: al,
|
|
4563
|
+
up: tl
|
|
4381
4564
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4382
|
-
async function
|
|
4565
|
+
async function nl(t) {
|
|
4383
4566
|
await t.schema.alterTable("hooks").addColumn("form_id", "text").execute(), await t.schema.alterTable("hooks").addColumn("url_tmp", "varchar(512)").execute(), await t.updateTable("hooks").set((e) => ({ url_tmp: e.ref("url") })).execute(), await t.schema.alterTable("hooks").dropColumn("url").execute(), await t.schema.alterTable("hooks").renameColumn("url_tmp", "url").execute();
|
|
4384
4567
|
}
|
|
4385
|
-
async function
|
|
4568
|
+
async function ol(t) {
|
|
4386
4569
|
await t.schema.dropTable("hooks").ifExists().execute(), await t.schema.createTable("hooks").addColumn("hook_id", "text", (e) => e.primaryKey()).addColumn("tenant_id", "text", (e) => e.notNull()).addColumn("trigger_id", "text", (e) => e.notNull()).addColumn("enabled", "integer", (e) => e.notNull().defaultTo(0)).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("synchronous", "integer", (e) => e.notNull().defaultTo(0)).addColumn("priority", "integer").addColumn("created_at", "text", (e) => e.notNull()).addColumn("updated_at", "text", (e) => e.notNull()).execute();
|
|
4387
4570
|
}
|
|
4388
|
-
const
|
|
4571
|
+
const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4389
4572
|
__proto__: null,
|
|
4390
|
-
down:
|
|
4391
|
-
up:
|
|
4573
|
+
down: ol,
|
|
4574
|
+
up: nl
|
|
4392
4575
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4393
|
-
async function
|
|
4576
|
+
async function il(t) {
|
|
4394
4577
|
await t.schema.alterTable("login_sessions").addColumn(
|
|
4395
4578
|
"login_completed",
|
|
4396
4579
|
"boolean",
|
|
4397
4580
|
(e) => e.notNull().defaultTo(0)
|
|
4398
4581
|
).execute();
|
|
4399
4582
|
}
|
|
4400
|
-
async function
|
|
4583
|
+
async function ll(t) {
|
|
4401
4584
|
await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
|
|
4402
4585
|
}
|
|
4403
|
-
const
|
|
4586
|
+
const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4404
4587
|
__proto__: null,
|
|
4405
|
-
down:
|
|
4406
|
-
up:
|
|
4588
|
+
down: ll,
|
|
4589
|
+
up: il
|
|
4407
4590
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4408
|
-
async function
|
|
4591
|
+
async function dl(t) {
|
|
4409
4592
|
await t.schema.alterTable("sessions").addColumn(
|
|
4410
4593
|
"login_session_id",
|
|
4411
4594
|
"varchar(21)",
|
|
4412
4595
|
(e) => e.references("login_sessions.id").onDelete("set null")
|
|
4413
4596
|
).execute();
|
|
4414
4597
|
}
|
|
4415
|
-
async function
|
|
4598
|
+
async function ul(t) {
|
|
4416
4599
|
await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
|
|
4417
4600
|
}
|
|
4418
|
-
const
|
|
4601
|
+
const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4419
4602
|
__proto__: null,
|
|
4420
|
-
down:
|
|
4421
|
-
up:
|
|
4603
|
+
down: ul,
|
|
4604
|
+
up: dl
|
|
4422
4605
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4423
|
-
async function
|
|
4606
|
+
async function _l(t) {
|
|
4424
4607
|
await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
|
|
4425
4608
|
}
|
|
4426
|
-
async function
|
|
4609
|
+
async function hl(t) {
|
|
4427
4610
|
await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
|
|
4428
4611
|
}
|
|
4429
|
-
const
|
|
4612
|
+
const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4430
4613
|
__proto__: null,
|
|
4431
|
-
down:
|
|
4432
|
-
up:
|
|
4614
|
+
down: hl,
|
|
4615
|
+
up: _l
|
|
4433
4616
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4434
|
-
async function
|
|
4617
|
+
async function pl(t) {
|
|
4435
4618
|
await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
|
|
4436
4619
|
}
|
|
4437
|
-
async function
|
|
4620
|
+
async function gl(t) {
|
|
4438
4621
|
await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
|
|
4439
4622
|
}
|
|
4440
|
-
const
|
|
4623
|
+
const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4441
4624
|
__proto__: null,
|
|
4442
|
-
down:
|
|
4443
|
-
up:
|
|
4625
|
+
down: gl,
|
|
4626
|
+
up: pl
|
|
4444
4627
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4445
|
-
async function
|
|
4628
|
+
async function yl(t) {
|
|
4446
4629
|
await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
|
|
4447
4630
|
}
|
|
4448
|
-
async function
|
|
4631
|
+
async function vl(t) {
|
|
4449
4632
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
4450
4633
|
}
|
|
4451
|
-
const
|
|
4634
|
+
const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4452
4635
|
__proto__: null,
|
|
4453
|
-
down:
|
|
4454
|
-
up:
|
|
4636
|
+
down: vl,
|
|
4637
|
+
up: yl
|
|
4455
4638
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4456
|
-
async function
|
|
4639
|
+
async function Cl(t) {
|
|
4457
4640
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
4458
4641
|
}
|
|
4459
|
-
async function
|
|
4642
|
+
async function bl(t) {
|
|
4460
4643
|
await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
|
|
4461
4644
|
}
|
|
4462
|
-
const
|
|
4645
|
+
const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4463
4646
|
__proto__: null,
|
|
4464
|
-
down:
|
|
4465
|
-
up:
|
|
4647
|
+
down: bl,
|
|
4648
|
+
up: Cl
|
|
4466
4649
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4467
|
-
async function
|
|
4650
|
+
async function Tl(t) {
|
|
4468
4651
|
await t.schema.createTable("themes").addColumn(
|
|
4469
4652
|
"tenant_id",
|
|
4470
4653
|
"varchar(255)",
|
|
@@ -4539,26 +4722,26 @@ async function _l(t) {
|
|
|
4539
4722
|
(e) => e.notNull()
|
|
4540
4723
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("themes_pkey", ["tenant_id", "themeId"]).execute(), await t.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute();
|
|
4541
4724
|
}
|
|
4542
|
-
async function
|
|
4725
|
+
async function Sl(t) {
|
|
4543
4726
|
await t.schema.dropTable("themes").execute();
|
|
4544
4727
|
}
|
|
4545
|
-
const
|
|
4728
|
+
const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4546
4729
|
__proto__: null,
|
|
4547
|
-
down:
|
|
4548
|
-
up:
|
|
4730
|
+
down: Sl,
|
|
4731
|
+
up: Tl
|
|
4549
4732
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4550
|
-
async function
|
|
4733
|
+
async function kl(t) {
|
|
4551
4734
|
await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("scopes", "varchar(4096)").addColumn("signing_alg", "varchar(64)").addColumn("signing_secret", "varchar(2048)").addColumn("token_lifetime", "integer").addColumn("token_lifetime_for_web", "integer").addColumn("skip_consent_for_verifiable_first_party_clients", "integer").addColumn("allow_offline_access", "integer").addColumn("verification_key", "varchar(4096)").addColumn("options", "varchar(4096)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("resource_servers_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("resource_servers_tenant_identifier_uq").on("resource_servers").columns(["tenant_id", "identifier"]).unique().execute(), await t.schema.createTable("roles").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(50)", (e) => e.notNull()).addColumn("description", "varchar(255)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("roles_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("roles_tenant_name_uq").on("roles").columns(["tenant_id", "name"]).unique().execute();
|
|
4552
4735
|
}
|
|
4553
|
-
async function
|
|
4736
|
+
async function $l(t) {
|
|
4554
4737
|
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
4555
4738
|
}
|
|
4556
|
-
const
|
|
4739
|
+
const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4557
4740
|
__proto__: null,
|
|
4558
|
-
down:
|
|
4559
|
-
up:
|
|
4741
|
+
down: $l,
|
|
4742
|
+
up: kl
|
|
4560
4743
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4561
|
-
async function
|
|
4744
|
+
async function Dl(t) {
|
|
4562
4745
|
await t.schema.createTable("role_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4563
4746
|
"resource_server_identifier",
|
|
4564
4747
|
"varchar(191)",
|
|
@@ -4579,139 +4762,151 @@ async function yl(t) {
|
|
|
4579
4762
|
"permission_name"
|
|
4580
4763
|
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute();
|
|
4581
4764
|
}
|
|
4582
|
-
async function
|
|
4765
|
+
async function Pl(t) {
|
|
4583
4766
|
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("role_permissions").execute();
|
|
4584
4767
|
}
|
|
4585
|
-
const
|
|
4768
|
+
const jl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4586
4769
|
__proto__: null,
|
|
4587
|
-
down:
|
|
4588
|
-
up:
|
|
4770
|
+
down: Pl,
|
|
4771
|
+
up: Dl
|
|
4589
4772
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4590
|
-
async function
|
|
4773
|
+
async function Fl(t) {
|
|
4591
4774
|
await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4592
4775
|
"tenant_id",
|
|
4593
4776
|
"user_id",
|
|
4594
4777
|
"role_id"
|
|
4595
4778
|
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute();
|
|
4596
4779
|
}
|
|
4597
|
-
async function
|
|
4780
|
+
async function Al(t) {
|
|
4598
4781
|
await t.schema.dropTable("user_roles").execute();
|
|
4599
4782
|
}
|
|
4600
|
-
const
|
|
4783
|
+
const Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4601
4784
|
__proto__: null,
|
|
4602
|
-
down:
|
|
4603
|
-
up:
|
|
4785
|
+
down: Al,
|
|
4786
|
+
up: Fl
|
|
4604
4787
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4605
|
-
async function
|
|
4788
|
+
async function zl(t) {
|
|
4606
4789
|
}
|
|
4607
|
-
async function
|
|
4790
|
+
async function Jl(t) {
|
|
4608
4791
|
await t.schema.alterTable("keys").dropColumn("connection").execute(), await t.schema.alterTable("keys").modifyColumn("cert", "varchar(2048)").execute(), await t.schema.alterTable("keys").modifyColumn("pkcs7", "varchar(2048)").execute(), await t.schema.alterTable("keys").dropColumn("type").execute();
|
|
4609
4792
|
}
|
|
4610
|
-
const
|
|
4793
|
+
const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4611
4794
|
__proto__: null,
|
|
4612
|
-
down:
|
|
4613
|
-
up:
|
|
4795
|
+
down: Jl,
|
|
4796
|
+
up: zl
|
|
4797
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4798
|
+
async function Ll(t) {
|
|
4799
|
+
await t.schema.createTable("organizations").addColumn("id", "varchar(256)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(256)", (e) => e.notNull()).addColumn("name", "varchar(256)", (e) => e.notNull()).addColumn("display_name", "varchar(256)").addColumn("branding", "text").addColumn("metadata", "text").addColumn("enabled_connections", "text").addColumn("token_quota", "text").addColumn("created_at", "varchar(256)", (e) => e.notNull()).addColumn("updated_at", "varchar(256)", (e) => e.notNull()).execute(), await t.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_organizations_tenant_name_unique").on("organizations").columns(["tenant_id", "name"]).unique().execute();
|
|
4800
|
+
}
|
|
4801
|
+
async function Rl(t) {
|
|
4802
|
+
await t.schema.dropTable("organizations").execute();
|
|
4803
|
+
}
|
|
4804
|
+
const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4805
|
+
__proto__: null,
|
|
4806
|
+
down: Rl,
|
|
4807
|
+
up: Ll
|
|
4614
4808
|
}, Symbol.toStringTag, { value: "Module" })), Ee = {
|
|
4615
|
-
m1_init:
|
|
4616
|
-
m2_magicLink:
|
|
4617
|
-
m3_updateAt:
|
|
4618
|
-
m4_logTable:
|
|
4619
|
-
m5_userProfile:
|
|
4620
|
-
m6_sessions:
|
|
4621
|
-
m7_passwords:
|
|
4622
|
-
m8_logsTableNewFields:
|
|
4623
|
-
m9_passwordTableNewField:
|
|
4624
|
-
n01_codesTable:
|
|
4625
|
-
n11_universalLoginSession:
|
|
4626
|
-
n12_userFields:
|
|
4627
|
-
n13_userEmailIndex:
|
|
4628
|
-
n14_profileDataField:
|
|
4629
|
-
n15_userEmailIndex:
|
|
4630
|
-
n16_userLocale:
|
|
4631
|
-
n17_signingKeys:
|
|
4632
|
-
n18_logsFields:
|
|
4633
|
-
n19_connectionsUserinfo:
|
|
4634
|
-
n20_missingFields:
|
|
4635
|
-
n21_sessionDeletedAt:
|
|
4636
|
-
n22_dropLogsFields:
|
|
4637
|
-
n23_dropUsersFields:
|
|
4638
|
-
n24_logsIndexes:
|
|
4639
|
-
n25_logDescMaxLength:
|
|
4640
|
-
n26_logsTableExtraFields:
|
|
4641
|
-
n27_usersTableNameIndex:
|
|
4642
|
-
n28_usersEmailConstrain:
|
|
4643
|
-
n29_increaseOtpStateLength:
|
|
4644
|
-
n30_increaseTicketStateLength:
|
|
4645
|
-
n31_branding:
|
|
4646
|
-
n32_indexesAndNotNull:
|
|
4647
|
-
n33_vendorIdInUniversalLoginSession:
|
|
4648
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
4649
|
-
n35_increaseUniversalSessionStateLength:
|
|
4650
|
-
n36_authenticationCodes:
|
|
4651
|
-
n37_disableSignUps:
|
|
4652
|
-
n38_otpIpAddress:
|
|
4653
|
-
n39_increaseUserAgentLength:
|
|
4654
|
-
n40_userId:
|
|
4655
|
-
n41_hooks:
|
|
4656
|
-
n42_userIdIndexes:
|
|
4657
|
-
n43_userIdIndexes:
|
|
4658
|
-
n44_codes:
|
|
4659
|
-
n45_hookProperties:
|
|
4660
|
-
n46_loginAuth0Client:
|
|
4661
|
-
n47_loginAuth0Client:
|
|
4662
|
-
n48_saml:
|
|
4663
|
-
n49_removeFields:
|
|
4664
|
-
n50_authParamsNonce:
|
|
4665
|
-
n51_connectionid:
|
|
4666
|
-
n52_cert:
|
|
4667
|
-
n53_codes_primary_key:
|
|
4668
|
-
n54_cleanup_tables:
|
|
4669
|
-
n55_logs_index:
|
|
4670
|
-
n56_application_fields:
|
|
4671
|
-
n57_prompt_settings:
|
|
4672
|
-
n58_connection_client_id:
|
|
4673
|
-
n59_connection_options:
|
|
4674
|
-
n60_users_metadata:
|
|
4675
|
-
n61_userLocales:
|
|
4676
|
-
n62_prompt:
|
|
4677
|
-
n63_connection_cleanup:
|
|
4678
|
-
n64_act_as:
|
|
4679
|
-
n65_code_verifier:
|
|
4680
|
-
n66_email_providers:
|
|
4681
|
-
n67_drop_tickets:
|
|
4682
|
-
n68_login_useragents:
|
|
4683
|
-
n70_refresh_tokens:
|
|
4684
|
-
n71_session_new_fields:
|
|
4685
|
-
n72_session_primary_key:
|
|
4686
|
-
n73_drop_sessions:
|
|
4687
|
-
n74_custom_domains:
|
|
4688
|
-
n75_organizations:
|
|
4689
|
-
n76_authorization_url_length:
|
|
4690
|
-
n77_drop_sessions:
|
|
4691
|
-
n78_login_sessions:
|
|
4692
|
-
n79_drop_sessions_2:
|
|
4693
|
-
n80_recreate_custom_domains:
|
|
4694
|
-
n81_phone:
|
|
4695
|
-
n82_forms:
|
|
4696
|
-
n83_addFormsIdToHooks:
|
|
4697
|
-
n84_login_completed:
|
|
4698
|
-
n85_add_login_session_id_to_sessions:
|
|
4699
|
-
n86_index_sessions_login_session_id:
|
|
4700
|
-
n87_code_challenge:
|
|
4701
|
-
n88_add_redirect_uri_to_codes:
|
|
4702
|
-
n89_add_nonce_and_state_to_codes:
|
|
4703
|
-
n90_themes:
|
|
4704
|
-
n91_resource_servers_rules_permissions:
|
|
4705
|
-
n92_role_permissions:
|
|
4706
|
-
n93_add_permissions_to_roles:
|
|
4707
|
-
n94_keys_connection_and_extend_columns:
|
|
4809
|
+
m1_init: Dr,
|
|
4810
|
+
m2_magicLink: Fr,
|
|
4811
|
+
m3_updateAt: zr,
|
|
4812
|
+
m4_logTable: Lr,
|
|
4813
|
+
m5_userProfile: Ur,
|
|
4814
|
+
m6_sessions: Qr,
|
|
4815
|
+
m7_passwords: Gr,
|
|
4816
|
+
m8_logsTableNewFields: Xr,
|
|
4817
|
+
m9_passwordTableNewField: tn,
|
|
4818
|
+
n01_codesTable: nn,
|
|
4819
|
+
n11_universalLoginSession: ln,
|
|
4820
|
+
n12_userFields: un,
|
|
4821
|
+
n13_userEmailIndex: hn,
|
|
4822
|
+
n14_profileDataField: gn,
|
|
4823
|
+
n15_userEmailIndex: vn,
|
|
4824
|
+
n16_userLocale: bn,
|
|
4825
|
+
n17_signingKeys: Sn,
|
|
4826
|
+
n18_logsFields: $n,
|
|
4827
|
+
n19_connectionsUserinfo: Pn,
|
|
4828
|
+
n20_missingFields: An,
|
|
4829
|
+
n21_sessionDeletedAt: Jn,
|
|
4830
|
+
n22_dropLogsFields: Rn,
|
|
4831
|
+
n23_dropUsersFields: Bn,
|
|
4832
|
+
n24_logsIndexes: Wn,
|
|
4833
|
+
n25_logDescMaxLength: Hn,
|
|
4834
|
+
n26_logsTableExtraFields: Zn,
|
|
4835
|
+
n27_usersTableNameIndex: ao,
|
|
4836
|
+
n28_usersEmailConstrain: oo,
|
|
4837
|
+
n29_increaseOtpStateLength: lo,
|
|
4838
|
+
n30_increaseTicketStateLength: mo,
|
|
4839
|
+
n31_branding: fo,
|
|
4840
|
+
n32_indexesAndNotNull: wo,
|
|
4841
|
+
n33_vendorIdInUniversalLoginSession: No,
|
|
4842
|
+
n34_auth0ClientInUniversalLoginSession: xo,
|
|
4843
|
+
n35_increaseUniversalSessionStateLength: Oo,
|
|
4844
|
+
n36_authenticationCodes: Io,
|
|
4845
|
+
n37_disableSignUps: jo,
|
|
4846
|
+
n38_otpIpAddress: Mo,
|
|
4847
|
+
n39_increaseUserAgentLength: Eo,
|
|
4848
|
+
n40_userId: Ko,
|
|
4849
|
+
n41_hooks: qo,
|
|
4850
|
+
n42_userIdIndexes: Vo,
|
|
4851
|
+
n43_userIdIndexes: Yo,
|
|
4852
|
+
n44_codes: es,
|
|
4853
|
+
n45_hookProperties: rs,
|
|
4854
|
+
n46_loginAuth0Client: ss,
|
|
4855
|
+
n47_loginAuth0Client: cs,
|
|
4856
|
+
n48_saml: ms,
|
|
4857
|
+
n49_removeFields: fs,
|
|
4858
|
+
n50_authParamsNonce: ws,
|
|
4859
|
+
n51_connectionid: Ns,
|
|
4860
|
+
n52_cert: xs,
|
|
4861
|
+
n53_codes_primary_key: Os,
|
|
4862
|
+
n54_cleanup_tables: Is,
|
|
4863
|
+
n55_logs_index: js,
|
|
4864
|
+
n56_application_fields: Ms,
|
|
4865
|
+
n57_prompt_settings: Es,
|
|
4866
|
+
n58_connection_client_id: Ks,
|
|
4867
|
+
n59_connection_options: qs,
|
|
4868
|
+
n60_users_metadata: Vs,
|
|
4869
|
+
n61_userLocales: Ys,
|
|
4870
|
+
n62_prompt: ei,
|
|
4871
|
+
n63_connection_cleanup: ri,
|
|
4872
|
+
n64_act_as: si,
|
|
4873
|
+
n65_code_verifier: ci,
|
|
4874
|
+
n66_email_providers: mi,
|
|
4875
|
+
n67_drop_tickets: fi,
|
|
4876
|
+
n68_login_useragents: wi,
|
|
4877
|
+
n70_refresh_tokens: Ni,
|
|
4878
|
+
n71_session_new_fields: xi,
|
|
4879
|
+
n72_session_primary_key: Oi,
|
|
4880
|
+
n73_drop_sessions: Ii,
|
|
4881
|
+
n74_custom_domains: ji,
|
|
4882
|
+
n75_organizations: Mi,
|
|
4883
|
+
n76_authorization_url_length: Ei,
|
|
4884
|
+
n77_drop_sessions: Ki,
|
|
4885
|
+
n78_login_sessions: qi,
|
|
4886
|
+
n79_drop_sessions_2: Vi,
|
|
4887
|
+
n80_recreate_custom_domains: Yi,
|
|
4888
|
+
n81_phone: el,
|
|
4889
|
+
n82_forms: rl,
|
|
4890
|
+
n83_addFormsIdToHooks: sl,
|
|
4891
|
+
n84_login_completed: cl,
|
|
4892
|
+
n85_add_login_session_id_to_sessions: ml,
|
|
4893
|
+
n86_index_sessions_login_session_id: fl,
|
|
4894
|
+
n87_code_challenge: wl,
|
|
4895
|
+
n88_add_redirect_uri_to_codes: Nl,
|
|
4896
|
+
n89_add_nonce_and_state_to_codes: xl,
|
|
4897
|
+
n90_themes: Ol,
|
|
4898
|
+
n91_resource_servers_rules_permissions: Il,
|
|
4899
|
+
n92_role_permissions: jl,
|
|
4900
|
+
n93_add_permissions_to_roles: Ml,
|
|
4901
|
+
n94_keys_connection_and_extend_columns: El,
|
|
4902
|
+
n95_create_organizations_table: Kl
|
|
4708
4903
|
};
|
|
4709
|
-
async function
|
|
4904
|
+
async function Wl(t, e = !1) {
|
|
4710
4905
|
e && console.log("migrating...");
|
|
4711
|
-
const
|
|
4906
|
+
const a = new Je(Ee), r = new be({
|
|
4712
4907
|
db: t,
|
|
4713
|
-
provider:
|
|
4714
|
-
}), { error: n, results: o } = await
|
|
4908
|
+
provider: a
|
|
4909
|
+
}), { error: n, results: o } = await r.migrateToLatest();
|
|
4715
4910
|
if (o == null || o.forEach((s) => {
|
|
4716
4911
|
s.status === "Success" ? e && console.log(
|
|
4717
4912
|
`migration "${s.migrationName}" was executed successfully`
|
|
@@ -4719,48 +4914,50 @@ async function Pl(t, e = !1) {
|
|
|
4719
4914
|
}), n)
|
|
4720
4915
|
throw console.error("failed to migrate"), console.error(n), n;
|
|
4721
4916
|
}
|
|
4722
|
-
async function
|
|
4917
|
+
async function Vl(t) {
|
|
4723
4918
|
console.log("migrating...");
|
|
4724
|
-
const e = new
|
|
4919
|
+
const e = new Je(Ee), a = new be({
|
|
4725
4920
|
db: t,
|
|
4726
4921
|
provider: e
|
|
4727
|
-
}), { error:
|
|
4922
|
+
}), { error: r, results: n } = await a.migrateDown();
|
|
4728
4923
|
if (n == null || n.forEach((o) => {
|
|
4729
4924
|
o.status === "Success" ? console.log(`migration "${o.migrationName}" was reverted successfully`) : o.status === "Error" && console.error(`failed to execute migration "${o.migrationName}"`);
|
|
4730
|
-
}),
|
|
4731
|
-
throw console.error("failed to migrate"), console.error(
|
|
4925
|
+
}), r)
|
|
4926
|
+
throw console.error("failed to migrate"), console.error(r), r;
|
|
4732
4927
|
}
|
|
4733
|
-
function
|
|
4928
|
+
function Gl(t) {
|
|
4734
4929
|
return {
|
|
4735
4930
|
applications: jt(t),
|
|
4736
|
-
branding:
|
|
4737
|
-
cleanup:
|
|
4738
|
-
clients:
|
|
4931
|
+
branding: ea(t),
|
|
4932
|
+
cleanup: Ia(t),
|
|
4933
|
+
clients: Lt(t),
|
|
4739
4934
|
codes: Ot(t),
|
|
4740
4935
|
connections: Et(t),
|
|
4741
|
-
emailProviders:
|
|
4936
|
+
emailProviders: ba(t),
|
|
4742
4937
|
customDomains: Yt(t),
|
|
4743
|
-
forms:
|
|
4744
|
-
hooks:
|
|
4938
|
+
forms: Ma(t),
|
|
4939
|
+
hooks: sa(t),
|
|
4745
4940
|
keys: Bt(t),
|
|
4746
|
-
loginSessions:
|
|
4941
|
+
loginSessions: pa(t),
|
|
4747
4942
|
logs: ut(t),
|
|
4748
4943
|
passwords: Nt(t),
|
|
4749
|
-
promptSettings:
|
|
4750
|
-
refreshTokens: $
|
|
4751
|
-
resourceServers:
|
|
4752
|
-
rolePermissions:
|
|
4753
|
-
userPermissions:
|
|
4754
|
-
userRoles:
|
|
4755
|
-
roles:
|
|
4944
|
+
promptSettings: ya(t),
|
|
4945
|
+
refreshTokens: $a(t),
|
|
4946
|
+
resourceServers: Ka(t),
|
|
4947
|
+
rolePermissions: Xa(t),
|
|
4948
|
+
userPermissions: ar(t),
|
|
4949
|
+
userRoles: sr(t),
|
|
4950
|
+
roles: Va(t),
|
|
4756
4951
|
sessions: gt(t),
|
|
4757
4952
|
tenants: st(t),
|
|
4758
|
-
themes:
|
|
4759
|
-
users: Ze(t)
|
|
4953
|
+
themes: ua(t),
|
|
4954
|
+
users: Ze(t),
|
|
4955
|
+
organizations: mr(t),
|
|
4956
|
+
userOrganizations: wr(t)
|
|
4760
4957
|
};
|
|
4761
4958
|
}
|
|
4762
4959
|
export {
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4960
|
+
Gl as default,
|
|
4961
|
+
Vl as migrateDown,
|
|
4962
|
+
Wl as migrateToLatest
|
|
4766
4963
|
};
|