@authhero/kysely-adapter 10.35.0 → 10.37.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 +40 -9
- package/dist/kysely-adapter.mjs +1433 -1265
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -3,15 +3,15 @@ var ue = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var Re = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
6
|
-
var
|
|
7
|
-
var d = (t, e, r) => (
|
|
8
|
-
import { parseUserId as
|
|
6
|
+
var R = (t, e, r) => Re(t, typeof e != "symbol" ? e + "" : e, r), Y = (t, e, r) => e.has(t) || ue("Cannot " + r);
|
|
7
|
+
var d = (t, e, r) => (Y(t, e, "read from private field"), r ? r.call(t) : e.get(t)), S = (t, e, r) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), K = (t, e, r, a) => (Y(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r), p = (t, e, r) => (Y(t, e, "access private method"), r);
|
|
8
|
+
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as Be, promptSettingSchema as Qe, formSchema as G, resourceServerSchema as qe } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
|
-
var
|
|
10
|
+
var te = class extends Error {
|
|
11
11
|
constructor(e = 500, r) {
|
|
12
12
|
super(r == null ? void 0 : r.message, { cause: r == null ? void 0 : r.cause });
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
R(this, "res");
|
|
14
|
+
R(this, "status");
|
|
15
15
|
this.res = r == null ? void 0 : r.res, this.status = e;
|
|
16
16
|
}
|
|
17
17
|
getResponse() {
|
|
@@ -25,8 +25,8 @@ var X = class extends Error {
|
|
|
25
25
|
};
|
|
26
26
|
function Ve(t) {
|
|
27
27
|
return async (e, r) => {
|
|
28
|
-
const { identities: a, ...
|
|
29
|
-
...
|
|
28
|
+
const { identities: a, ...n } = r, o = {
|
|
29
|
+
...n,
|
|
30
30
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
31
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
login_count: 0,
|
|
@@ -37,35 +37,35 @@ function Ve(t) {
|
|
|
37
37
|
user_metadata: JSON.stringify(r.user_metadata)
|
|
38
38
|
};
|
|
39
39
|
try {
|
|
40
|
-
await t.insertInto("users").values(
|
|
40
|
+
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
|
-
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new
|
|
42
|
+
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new te(409, { message: "User already exists" }) : new te(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
|
-
...
|
|
45
|
+
...o,
|
|
46
46
|
// TODO: check if this is correct. Should it be optional?
|
|
47
|
-
email:
|
|
48
|
-
email_verified:
|
|
49
|
-
is_social:
|
|
47
|
+
email: o.email || "",
|
|
48
|
+
email_verified: o.email_verified === 1,
|
|
49
|
+
is_social: o.is_social === 1
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function y(t) {
|
|
54
54
|
if (t == null || typeof t != "object")
|
|
55
55
|
return t;
|
|
56
56
|
if (Array.isArray(t))
|
|
57
57
|
return t.map(
|
|
58
58
|
(r) => (
|
|
59
59
|
// Only recurse into objects; leave primitives untouched
|
|
60
|
-
r !== null && typeof r == "object" ?
|
|
60
|
+
r !== null && typeof r == "object" ? y(r) : r
|
|
61
61
|
)
|
|
62
62
|
);
|
|
63
63
|
const e = { ...t };
|
|
64
64
|
for (const r in e) {
|
|
65
65
|
const a = e[r];
|
|
66
66
|
a === null ? delete e[r] : a !== null && typeof a == "object" && (Array.isArray(a) ? e[r] = a.map(
|
|
67
|
-
(
|
|
68
|
-
) : e[r] =
|
|
67
|
+
(n) => n !== null && typeof n == "object" ? y(n) : n
|
|
68
|
+
) : e[r] = y(a));
|
|
69
69
|
}
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
@@ -79,7 +79,7 @@ function pe(t) {
|
|
|
79
79
|
return {
|
|
80
80
|
connection: t.connection,
|
|
81
81
|
provider: t.provider,
|
|
82
|
-
user_id:
|
|
82
|
+
user_id: ie(t.user_id).id,
|
|
83
83
|
isSocial: !!t.is_social,
|
|
84
84
|
profileData: {
|
|
85
85
|
email: t.email,
|
|
@@ -90,13 +90,13 @@ function pe(t) {
|
|
|
90
90
|
}
|
|
91
91
|
function We(t) {
|
|
92
92
|
return async (e, r) => {
|
|
93
|
-
const [a,
|
|
93
|
+
const [a, n] = await Promise.all([
|
|
94
94
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", r).selectAll().executeTakeFirst(),
|
|
95
95
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", r).selectAll().execute()
|
|
96
96
|
]);
|
|
97
97
|
if (!a)
|
|
98
98
|
return null;
|
|
99
|
-
const { tenant_id:
|
|
99
|
+
const { tenant_id: o, ...s } = a, i = {
|
|
100
100
|
...s,
|
|
101
101
|
email: a.email || "",
|
|
102
102
|
email_verified: a.email_verified === 1,
|
|
@@ -107,148 +107,153 @@ function We(t) {
|
|
|
107
107
|
{
|
|
108
108
|
connection: a.connection,
|
|
109
109
|
provider: a.provider,
|
|
110
|
-
user_id:
|
|
110
|
+
user_id: ie(a.user_id).id,
|
|
111
111
|
isSocial: !!a.is_social
|
|
112
112
|
},
|
|
113
|
-
...
|
|
113
|
+
...n.map(pe)
|
|
114
114
|
]
|
|
115
115
|
};
|
|
116
|
-
return
|
|
116
|
+
return y(i);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return r.split(/\s+/).map((
|
|
121
|
-
let s =
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
else if (
|
|
125
|
-
|
|
126
|
-
else if (
|
|
127
|
-
const
|
|
128
|
-
|
|
119
|
+
function T(t, e, r, a) {
|
|
120
|
+
return r.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
121
|
+
let s = o.startsWith("-"), i = null, c = "", _ = !1, u;
|
|
122
|
+
if (o.startsWith("-_exists_:"))
|
|
123
|
+
i = o.substring(10), _ = !0, s = !0;
|
|
124
|
+
else if (o.startsWith("_exists_:"))
|
|
125
|
+
i = o.substring(9), _ = !0, s = !1;
|
|
126
|
+
else if (o.includes(":")) {
|
|
127
|
+
const m = s ? o.substring(1) : o, h = m.indexOf(":");
|
|
128
|
+
i = m.substring(0, h), c = m.substring(h + 1), _ = !1, c.startsWith(">=") ? (u = ">=", c = c.substring(2)) : c.startsWith(">") ? (u = ">", c = c.substring(1)) : c.startsWith("<=") ? (u = "<=", c = c.substring(2)) : c.startsWith("<") ? (u = "<", c = c.substring(1)) : u = "=";
|
|
129
129
|
} else
|
|
130
|
-
|
|
131
|
-
return { key:
|
|
132
|
-
}).forEach(({ key:
|
|
133
|
-
if (
|
|
130
|
+
i = null, c = o, _ = !1;
|
|
131
|
+
return { key: i, value: c, isNegation: s, isExistsQuery: _, operator: u };
|
|
132
|
+
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator: _ }) => {
|
|
133
|
+
if (o)
|
|
134
134
|
if (c)
|
|
135
|
-
|
|
136
|
-
else if (
|
|
135
|
+
i ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
|
|
136
|
+
else if (i)
|
|
137
137
|
switch (_) {
|
|
138
138
|
case ">":
|
|
139
|
-
e = e.where(
|
|
139
|
+
e = e.where(o, "<=", s);
|
|
140
140
|
break;
|
|
141
141
|
case ">=":
|
|
142
|
-
e = e.where(
|
|
142
|
+
e = e.where(o, "<", s);
|
|
143
143
|
break;
|
|
144
144
|
case "<":
|
|
145
|
-
e = e.where(
|
|
145
|
+
e = e.where(o, ">=", s);
|
|
146
146
|
break;
|
|
147
147
|
case "<=":
|
|
148
|
-
e = e.where(
|
|
148
|
+
e = e.where(o, ">", s);
|
|
149
149
|
break;
|
|
150
150
|
default:
|
|
151
|
-
e = e.where(
|
|
151
|
+
e = e.where(o, "!=", s);
|
|
152
152
|
}
|
|
153
153
|
else
|
|
154
|
-
e = e.where(
|
|
154
|
+
e = e.where(o, _, s);
|
|
155
155
|
else if (s) {
|
|
156
156
|
const { ref: u } = t.dynamic;
|
|
157
157
|
e = e.where(
|
|
158
|
-
(
|
|
159
|
-
a.map((
|
|
158
|
+
(m) => m.or(
|
|
159
|
+
a.map((h) => m(u(h), "like", `%${s}%`))
|
|
160
160
|
)
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
}), e;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
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, r = {
|
|
170
|
-
page: 0,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (r.q && (a = C(t, a, r.q, ["email", "name"])), r.sort && r.sort.sort_by) {
|
|
176
|
-
const { ref: u } = t.dynamic;
|
|
177
|
-
a = a.orderBy(u(r.sort.sort_by), r.sort.sort_order);
|
|
169
|
+
return async (e, r = {}) => {
|
|
170
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = r;
|
|
171
|
+
let c = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
172
|
+
if (i && (c = T(t, c, i, ["email", "name"])), s && s.sort_by) {
|
|
173
|
+
const { ref: w } = t.dynamic;
|
|
174
|
+
c = c.orderBy(w(s.sort_by), s.sort_order);
|
|
178
175
|
}
|
|
179
|
-
const
|
|
180
|
-
const
|
|
181
|
-
(
|
|
176
|
+
const u = await c.offset(a * n).limit(n).selectAll().execute(), m = u.map((w) => w.user_id), h = m.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", m).execute() : [], f = u.map((w) => {
|
|
177
|
+
const b = h.filter(
|
|
178
|
+
(D) => D.linked_to === w.user_id
|
|
182
179
|
);
|
|
183
|
-
return
|
|
184
|
-
...
|
|
185
|
-
email_verified:
|
|
186
|
-
is_social:
|
|
187
|
-
app_metadata: JSON.parse(
|
|
188
|
-
user_metadata: JSON.parse(
|
|
180
|
+
return y({
|
|
181
|
+
...w,
|
|
182
|
+
email_verified: w.email_verified === 1,
|
|
183
|
+
is_social: w.is_social === 1,
|
|
184
|
+
app_metadata: JSON.parse(w.app_metadata),
|
|
185
|
+
user_metadata: JSON.parse(w.user_metadata),
|
|
189
186
|
identities: [
|
|
190
187
|
{
|
|
191
|
-
connection:
|
|
192
|
-
provider:
|
|
193
|
-
user_id:
|
|
194
|
-
isSocial: !!
|
|
188
|
+
connection: w.connection,
|
|
189
|
+
provider: w.provider,
|
|
190
|
+
user_id: ie(w.user_id).id,
|
|
191
|
+
isSocial: !!w.is_social
|
|
195
192
|
},
|
|
196
|
-
...
|
|
193
|
+
...b.map(pe)
|
|
197
194
|
]
|
|
198
195
|
});
|
|
199
|
-
})
|
|
196
|
+
});
|
|
197
|
+
if (!o)
|
|
198
|
+
return {
|
|
199
|
+
users: f,
|
|
200
|
+
start: 0,
|
|
201
|
+
limit: 0,
|
|
202
|
+
length: 0
|
|
203
|
+
};
|
|
204
|
+
const { count: g } = await c.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
200
205
|
return {
|
|
201
|
-
users:
|
|
202
|
-
start:
|
|
203
|
-
limit:
|
|
204
|
-
length:
|
|
206
|
+
users: f,
|
|
207
|
+
start: a * n,
|
|
208
|
+
limit: n,
|
|
209
|
+
length: x(g)
|
|
205
210
|
};
|
|
206
211
|
};
|
|
207
212
|
}
|
|
208
213
|
function He(t) {
|
|
209
214
|
return async (e, r) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", r).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", r).execute()).length === 1);
|
|
210
215
|
}
|
|
211
|
-
function
|
|
216
|
+
function J(t, e = "", r = {}) {
|
|
212
217
|
for (let a in t)
|
|
213
218
|
if (Object.prototype.hasOwnProperty.call(t, a)) {
|
|
214
|
-
const
|
|
215
|
-
typeof
|
|
219
|
+
const n = e ? `${e}_${a}` : a, o = t[a];
|
|
220
|
+
typeof o == "object" && o !== null && !Array.isArray(o) ? J(o, n, r) : typeof o == "boolean" ? r[n] = o ? 1 : 0 : r[n] = o;
|
|
216
221
|
}
|
|
217
222
|
return r;
|
|
218
223
|
}
|
|
219
224
|
function ge(t, e) {
|
|
220
225
|
const r = {};
|
|
221
|
-
for (const [a,
|
|
222
|
-
const
|
|
226
|
+
for (const [a, n] of Object.entries(t)) {
|
|
227
|
+
const o = e.find(
|
|
223
228
|
(s) => a.startsWith(`${s}_`)
|
|
224
229
|
);
|
|
225
|
-
if (!
|
|
226
|
-
r[a] =
|
|
230
|
+
if (!o)
|
|
231
|
+
r[a] = n;
|
|
227
232
|
else {
|
|
228
|
-
const s = a.slice(
|
|
229
|
-
r[
|
|
230
|
-
...r[
|
|
231
|
-
[s]:
|
|
233
|
+
const s = a.slice(o.length + 1);
|
|
234
|
+
r[o] = {
|
|
235
|
+
...r[o],
|
|
236
|
+
[s]: n
|
|
232
237
|
};
|
|
233
238
|
}
|
|
234
239
|
}
|
|
235
240
|
return r;
|
|
236
241
|
}
|
|
237
|
-
function
|
|
242
|
+
function Ye(t) {
|
|
238
243
|
return async (e, r, a) => {
|
|
239
|
-
const
|
|
244
|
+
const n = J({
|
|
240
245
|
...a,
|
|
241
246
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
242
247
|
app_metadata: a.app_metadata ? JSON.stringify(a.app_metadata) : void 0,
|
|
243
248
|
user_metadata: a.user_metadata ? JSON.stringify(a.user_metadata) : void 0
|
|
244
249
|
});
|
|
245
|
-
return (await t.updateTable("users").set(
|
|
250
|
+
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", r).execute()).length === 1;
|
|
246
251
|
};
|
|
247
252
|
}
|
|
248
|
-
function
|
|
249
|
-
return async (e, r, a,
|
|
250
|
-
const
|
|
251
|
-
return (await t.updateTable("users").set(
|
|
253
|
+
function Xe(t) {
|
|
254
|
+
return async (e, r, a, n) => {
|
|
255
|
+
const o = { linked_to: null };
|
|
256
|
+
return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${a}|${n}`).where("users.linked_to", "=", `${r}`).execute()).length === 1;
|
|
252
257
|
};
|
|
253
258
|
}
|
|
254
259
|
function Ze(t) {
|
|
@@ -257,13 +262,13 @@ function Ze(t) {
|
|
|
257
262
|
remove: He(t),
|
|
258
263
|
get: We(t),
|
|
259
264
|
list: Ge(t),
|
|
260
|
-
update:
|
|
265
|
+
update: Ye(t),
|
|
261
266
|
// TODO - think about this more when other issues fixed
|
|
262
|
-
unlink:
|
|
267
|
+
unlink: Xe(t)
|
|
263
268
|
};
|
|
264
269
|
}
|
|
265
270
|
const et = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
266
|
-
let
|
|
271
|
+
let O = (t = 21) => {
|
|
267
272
|
let e = "", r = crypto.getRandomValues(new Uint8Array(t));
|
|
268
273
|
for (; t--; )
|
|
269
274
|
e += et[r[t] & 63];
|
|
@@ -272,7 +277,7 @@ let b = (t = 21) => {
|
|
|
272
277
|
function tt(t) {
|
|
273
278
|
return async (e) => {
|
|
274
279
|
const r = {
|
|
275
|
-
id: e.id ||
|
|
280
|
+
id: e.id || O(),
|
|
276
281
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
277
282
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
278
283
|
...e
|
|
@@ -283,32 +288,29 @@ function tt(t) {
|
|
|
283
288
|
function rt(t) {
|
|
284
289
|
return async (e) => {
|
|
285
290
|
const r = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
286
|
-
return r ?
|
|
291
|
+
return r ? y(r) : null;
|
|
287
292
|
};
|
|
288
293
|
}
|
|
289
294
|
function at(t) {
|
|
290
|
-
return async (e
|
|
291
|
-
page: 0,
|
|
292
|
-
per_page: 50,
|
|
293
|
-
include_totals: !1
|
|
294
|
-
}) => {
|
|
295
|
+
return async (e) => {
|
|
295
296
|
let r = t.selectFrom("tenants");
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = e;
|
|
298
|
+
if (s && s.sort_by) {
|
|
299
|
+
const { ref: f } = t.dynamic;
|
|
300
|
+
r = r.orderBy(f(s.sort_by), s.sort_order);
|
|
299
301
|
}
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
302
|
+
i && (r = r.where((f) => f.or([f("name", "like", `%${i}%`)])));
|
|
303
|
+
const u = (await r.offset(a * n).limit(n).selectAll().execute()).map(y);
|
|
304
|
+
if (!o)
|
|
303
305
|
return {
|
|
304
|
-
tenants:
|
|
306
|
+
tenants: u
|
|
305
307
|
};
|
|
306
|
-
const { count:
|
|
308
|
+
const { count: m } = await r.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), h = x(m);
|
|
307
309
|
return {
|
|
308
|
-
tenants:
|
|
309
|
-
start:
|
|
310
|
-
limit:
|
|
311
|
-
length:
|
|
310
|
+
tenants: u,
|
|
311
|
+
start: a * n,
|
|
312
|
+
limit: n,
|
|
313
|
+
length: h
|
|
312
314
|
};
|
|
313
315
|
};
|
|
314
316
|
}
|
|
@@ -340,19 +342,19 @@ function me(t) {
|
|
|
340
342
|
const it = 1024;
|
|
341
343
|
function lt(t) {
|
|
342
344
|
return async (e, r) => {
|
|
343
|
-
var
|
|
345
|
+
var n, o, s;
|
|
344
346
|
const a = {
|
|
345
|
-
id:
|
|
347
|
+
id: O(),
|
|
346
348
|
...r,
|
|
347
349
|
user_agent: r.user_agent.slice(0, it)
|
|
348
350
|
};
|
|
349
351
|
return await t.insertInto("logs").values({
|
|
350
352
|
...a,
|
|
351
353
|
// Truncate long strings to avoid database errors
|
|
352
|
-
description: (
|
|
354
|
+
description: (n = a.description) == null ? void 0 : n.substring(0, 256),
|
|
353
355
|
isMobile: r.isMobile ? 1 : 0,
|
|
354
356
|
tenant_id: e,
|
|
355
|
-
scope: (
|
|
357
|
+
scope: (o = r.scope) == null ? void 0 : o.join(","),
|
|
356
358
|
auth0_client: me(r.auth0_client),
|
|
357
359
|
details: (s = me(r.details)) == null ? void 0 : s.substring(0, 8192)
|
|
358
360
|
}).execute(), a;
|
|
@@ -381,28 +383,30 @@ function we(t) {
|
|
|
381
383
|
};
|
|
382
384
|
}
|
|
383
385
|
function ct(t) {
|
|
384
|
-
return async (e, r = {
|
|
385
|
-
page: 0,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (r.sort && r.sort.sort_by) {
|
|
393
|
-
const { ref: l } = t.dynamic;
|
|
394
|
-
o = o.orderBy(
|
|
395
|
-
l(r.sort.sort_by),
|
|
396
|
-
r.sort.sort_order
|
|
397
|
-
);
|
|
386
|
+
return async (e, r = {}) => {
|
|
387
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = r;
|
|
388
|
+
let c = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
389
|
+
i && (c = T(t, c, i, ["user_id", "ip"]));
|
|
390
|
+
let _ = c;
|
|
391
|
+
if (s && s.sort_by) {
|
|
392
|
+
const { ref: f } = t.dynamic;
|
|
393
|
+
_ = _.orderBy(f(s.sort_by), s.sort_order);
|
|
398
394
|
}
|
|
399
|
-
|
|
400
|
-
const
|
|
395
|
+
_ = _.offset(a * n).limit(n);
|
|
396
|
+
const m = (await _.selectAll().execute()).map(we);
|
|
397
|
+
if (!o)
|
|
398
|
+
return {
|
|
399
|
+
logs: m,
|
|
400
|
+
start: 0,
|
|
401
|
+
limit: 0,
|
|
402
|
+
length: 0
|
|
403
|
+
};
|
|
404
|
+
const { count: h } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
401
405
|
return {
|
|
402
|
-
logs:
|
|
403
|
-
start:
|
|
404
|
-
limit:
|
|
405
|
-
length:
|
|
406
|
+
logs: m,
|
|
407
|
+
start: a * n,
|
|
408
|
+
limit: n,
|
|
409
|
+
length: x(h)
|
|
406
410
|
};
|
|
407
411
|
};
|
|
408
412
|
}
|
|
@@ -424,10 +428,10 @@ function mt(t) {
|
|
|
424
428
|
const a = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", r).selectAll().executeTakeFirst();
|
|
425
429
|
if (!a)
|
|
426
430
|
return null;
|
|
427
|
-
const { tenant_id:
|
|
431
|
+
const { tenant_id: n, device: o, clients: s, ...i } = a;
|
|
428
432
|
return {
|
|
429
|
-
...
|
|
430
|
-
device: JSON.parse(
|
|
433
|
+
...i,
|
|
434
|
+
device: JSON.parse(o),
|
|
431
435
|
clients: JSON.parse(s)
|
|
432
436
|
};
|
|
433
437
|
};
|
|
@@ -454,42 +458,44 @@ function ht(t) {
|
|
|
454
458
|
}
|
|
455
459
|
function ft(t) {
|
|
456
460
|
return async (e, r, a) => {
|
|
457
|
-
const
|
|
461
|
+
const n = {
|
|
458
462
|
...a,
|
|
459
463
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
460
464
|
device: a.device ? JSON.stringify(a.device) : void 0,
|
|
461
465
|
clients: a.clients ? JSON.stringify(a.clients) : void 0
|
|
462
466
|
};
|
|
463
|
-
return !!(await t.updateTable("sessions").set(
|
|
467
|
+
return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=", r).execute()).length;
|
|
464
468
|
};
|
|
465
469
|
}
|
|
466
470
|
function pt(t) {
|
|
467
|
-
return async (e, r = {
|
|
468
|
-
page: 0,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
if (r.sort && r.sort.sort_by) {
|
|
476
|
-
const { ref: c } = t.dynamic;
|
|
477
|
-
o = o.orderBy(
|
|
478
|
-
c(r.sort.sort_by),
|
|
479
|
-
r.sort.sort_order
|
|
480
|
-
);
|
|
471
|
+
return async (e, r = {}) => {
|
|
472
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = r;
|
|
473
|
+
let c = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
474
|
+
i && (c = T(t, c, i, ["user_id", "session_id"]));
|
|
475
|
+
let _ = c;
|
|
476
|
+
if (s && s.sort_by) {
|
|
477
|
+
const { ref: g } = t.dynamic;
|
|
478
|
+
_ = _.orderBy(g(s.sort_by), s.sort_order);
|
|
481
479
|
}
|
|
482
|
-
|
|
483
|
-
const
|
|
480
|
+
_ = _.offset(a * n).limit(n);
|
|
481
|
+
const m = (await _.selectAll().execute()).map((g) => ({
|
|
482
|
+
...g,
|
|
483
|
+
device: JSON.parse(g.device),
|
|
484
|
+
clients: JSON.parse(g.clients)
|
|
485
|
+
}));
|
|
486
|
+
if (!o)
|
|
487
|
+
return {
|
|
488
|
+
sessions: m,
|
|
489
|
+
start: 0,
|
|
490
|
+
limit: 0,
|
|
491
|
+
length: 0
|
|
492
|
+
};
|
|
493
|
+
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
484
494
|
return {
|
|
485
|
-
sessions:
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
})),
|
|
490
|
-
start: r.page * r.per_page,
|
|
491
|
-
limit: r.per_page,
|
|
492
|
-
length: l
|
|
495
|
+
sessions: m,
|
|
496
|
+
start: a * n,
|
|
497
|
+
limit: n,
|
|
498
|
+
length: f
|
|
493
499
|
};
|
|
494
500
|
};
|
|
495
501
|
}
|
|
@@ -507,8 +513,8 @@ function wt(t) {
|
|
|
507
513
|
const a = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", r).selectAll().executeTakeFirst();
|
|
508
514
|
if (!a)
|
|
509
515
|
return null;
|
|
510
|
-
const { tenant_id:
|
|
511
|
-
return
|
|
516
|
+
const { tenant_id: n, ...o } = a;
|
|
517
|
+
return o;
|
|
512
518
|
};
|
|
513
519
|
}
|
|
514
520
|
function yt(t) {
|
|
@@ -538,22 +544,27 @@ function Nt(t) {
|
|
|
538
544
|
};
|
|
539
545
|
}
|
|
540
546
|
function Ct(t) {
|
|
541
|
-
return async (e, r = {
|
|
542
|
-
page: 0,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
return async (e, r = {}) => {
|
|
548
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, q: s } = r;
|
|
549
|
+
let i = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
550
|
+
s && (i = T(t, i, s, ["code", "login_id"]));
|
|
551
|
+
const u = (await i.offset(a * n).limit(n).selectAll().execute()).map((h) => {
|
|
552
|
+
const { tenant_id: f, ...g } = h;
|
|
553
|
+
return Ke.parse(y(g));
|
|
554
|
+
});
|
|
555
|
+
if (!o)
|
|
556
|
+
return {
|
|
557
|
+
codes: u,
|
|
558
|
+
start: 0,
|
|
559
|
+
limit: 0,
|
|
560
|
+
length: 0
|
|
561
|
+
};
|
|
562
|
+
const { count: m } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
549
563
|
return {
|
|
550
|
-
codes:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
start: r.page * r.per_page,
|
|
555
|
-
limit: r.per_page,
|
|
556
|
-
length: v(s)
|
|
564
|
+
codes: u,
|
|
565
|
+
start: a * n,
|
|
566
|
+
limit: n,
|
|
567
|
+
length: x(m)
|
|
557
568
|
};
|
|
558
569
|
};
|
|
559
570
|
}
|
|
@@ -574,10 +585,10 @@ function xt(t) {
|
|
|
574
585
|
}
|
|
575
586
|
function Tt(t) {
|
|
576
587
|
return async (e, r, a) => {
|
|
577
|
-
let
|
|
578
|
-
e.length && (
|
|
579
|
-
const
|
|
580
|
-
return
|
|
588
|
+
let n = t.selectFrom("codes").where("codes.code_id", "=", r).where("codes.code_type", "=", a);
|
|
589
|
+
e.length && (n = n.where("codes.tenant_id", "=", e));
|
|
590
|
+
const o = await n.selectAll().executeTakeFirst();
|
|
591
|
+
return o ? y(o) : null;
|
|
581
592
|
};
|
|
582
593
|
}
|
|
583
594
|
function St(t) {
|
|
@@ -599,38 +610,38 @@ function kt(t) {
|
|
|
599
610
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
600
611
|
...r,
|
|
601
612
|
disable_sign_ups: r.disable_sign_ups ?? !1
|
|
602
|
-
},
|
|
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);
|
|
603
614
|
return await t.insertInto("applications").values({
|
|
604
615
|
...a,
|
|
605
616
|
tenant_id: e,
|
|
606
617
|
disable_sign_ups: r.disable_sign_ups ? 1 : 0,
|
|
607
618
|
addons: r.addons ? JSON.stringify(r.addons) : "{}",
|
|
608
|
-
callbacks:
|
|
609
|
-
allowed_origins:
|
|
619
|
+
callbacks: o,
|
|
620
|
+
allowed_origins: n,
|
|
610
621
|
web_origins: s,
|
|
611
|
-
allowed_logout_urls:
|
|
622
|
+
allowed_logout_urls: i,
|
|
612
623
|
allowed_clients: c
|
|
613
624
|
}).execute(), a;
|
|
614
625
|
};
|
|
615
626
|
}
|
|
616
627
|
function $t(t) {
|
|
617
628
|
return async (e) => ({
|
|
618
|
-
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((
|
|
619
|
-
...
|
|
620
|
-
disable_sign_ups: !!
|
|
621
|
-
addons:
|
|
622
|
-
callbacks:
|
|
623
|
-
allowed_origins:
|
|
624
|
-
web_origins:
|
|
625
|
-
allowed_logout_urls:
|
|
626
|
-
allowed_clients:
|
|
629
|
+
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((o) => ({
|
|
630
|
+
...o,
|
|
631
|
+
disable_sign_ups: !!o.disable_sign_ups,
|
|
632
|
+
addons: o.addons ? JSON.parse(o.addons) : {},
|
|
633
|
+
callbacks: o.callbacks ? JSON.parse(o.callbacks) : [],
|
|
634
|
+
allowed_origins: o.allowed_origins ? JSON.parse(o.allowed_origins) : [],
|
|
635
|
+
web_origins: o.web_origins ? JSON.parse(o.web_origins) : [],
|
|
636
|
+
allowed_logout_urls: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : [],
|
|
637
|
+
allowed_clients: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : []
|
|
627
638
|
}))
|
|
628
639
|
});
|
|
629
640
|
}
|
|
630
641
|
function It(t) {
|
|
631
642
|
return async (e, r) => {
|
|
632
643
|
const a = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", r).selectAll().executeTakeFirst();
|
|
633
|
-
return a ?
|
|
644
|
+
return a ? y({
|
|
634
645
|
...a,
|
|
635
646
|
disable_sign_ups: !!a.disable_sign_ups,
|
|
636
647
|
addons: JSON.parse(a.addons),
|
|
@@ -646,7 +657,7 @@ function Dt(t) {
|
|
|
646
657
|
}
|
|
647
658
|
function Pt(t) {
|
|
648
659
|
return async (e, r, a) => {
|
|
649
|
-
const
|
|
660
|
+
const n = {
|
|
650
661
|
...a,
|
|
651
662
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
652
663
|
allowed_origins: a.allowed_origins ? JSON.stringify(a.allowed_origins) : void 0,
|
|
@@ -657,7 +668,7 @@ function Pt(t) {
|
|
|
657
668
|
addons: a.addons ? JSON.stringify(a.addons) : "{}",
|
|
658
669
|
disable_sign_ups: a.disable_sign_ups ? 1 : 0
|
|
659
670
|
};
|
|
660
|
-
return await t.updateTable("applications").set(
|
|
671
|
+
return await t.updateTable("applications").set(n).where("applications.id", "=", r).where("applications.tenant_id", "=", e).execute(), !0;
|
|
661
672
|
};
|
|
662
673
|
}
|
|
663
674
|
function jt(t) {
|
|
@@ -672,7 +683,7 @@ function jt(t) {
|
|
|
672
683
|
function Ft(t) {
|
|
673
684
|
return async (e, r) => {
|
|
674
685
|
const a = {
|
|
675
|
-
id:
|
|
686
|
+
id: O(),
|
|
676
687
|
...r,
|
|
677
688
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
678
689
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -686,24 +697,29 @@ function Ft(t) {
|
|
|
686
697
|
};
|
|
687
698
|
}
|
|
688
699
|
function Mt(t) {
|
|
689
|
-
return async (e, r = {
|
|
690
|
-
page: 0,
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
(c) => f({
|
|
698
|
-
...c,
|
|
699
|
-
options: JSON.parse(c.options)
|
|
700
|
+
return async (e, r = {}) => {
|
|
701
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, q: s } = r;
|
|
702
|
+
let i = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
703
|
+
s && (i = T(t, i, s, ["user_id", "ip"]));
|
|
704
|
+
const u = (await i.offset(a * n).limit(n).selectAll().execute()).map(
|
|
705
|
+
(h) => y({
|
|
706
|
+
...h,
|
|
707
|
+
options: JSON.parse(h.options)
|
|
700
708
|
})
|
|
701
|
-
)
|
|
709
|
+
);
|
|
710
|
+
if (!o)
|
|
711
|
+
return {
|
|
712
|
+
connections: u,
|
|
713
|
+
start: 0,
|
|
714
|
+
limit: 0,
|
|
715
|
+
length: 0
|
|
716
|
+
};
|
|
717
|
+
const { count: m } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
702
718
|
return {
|
|
703
|
-
connections:
|
|
704
|
-
start:
|
|
705
|
-
limit:
|
|
706
|
-
length:
|
|
719
|
+
connections: u,
|
|
720
|
+
start: a * n,
|
|
721
|
+
limit: n,
|
|
722
|
+
length: x(m)
|
|
707
723
|
};
|
|
708
724
|
};
|
|
709
725
|
}
|
|
@@ -713,7 +729,7 @@ function At(t) {
|
|
|
713
729
|
function zt(t) {
|
|
714
730
|
return async (e, r) => {
|
|
715
731
|
const a = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", r).selectAll().executeTakeFirst();
|
|
716
|
-
return a ?
|
|
732
|
+
return a ? y({
|
|
717
733
|
...a,
|
|
718
734
|
options: JSON.parse(a.options)
|
|
719
735
|
}) : null;
|
|
@@ -721,13 +737,13 @@ function zt(t) {
|
|
|
721
737
|
}
|
|
722
738
|
function Lt(t) {
|
|
723
739
|
return async (e, r, a) => {
|
|
724
|
-
const
|
|
740
|
+
const n = {
|
|
725
741
|
...a,
|
|
726
742
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
727
743
|
};
|
|
728
744
|
return await t.updateTable("connections").set({
|
|
729
|
-
...
|
|
730
|
-
options:
|
|
745
|
+
...n,
|
|
746
|
+
options: n.options ? JSON.stringify(n.options) : void 0
|
|
731
747
|
}).where("connections.id", "=", r).where("connections.tenant_id", "=", e).execute(), !0;
|
|
732
748
|
};
|
|
733
749
|
}
|
|
@@ -748,13 +764,13 @@ function Jt(t) {
|
|
|
748
764
|
return null;
|
|
749
765
|
const a = await t.selectFrom("tenants").selectAll().where("id", "=", r.tenant_id).executeTakeFirst();
|
|
750
766
|
if (!a)
|
|
751
|
-
throw new
|
|
752
|
-
const
|
|
767
|
+
throw new te(404, { message: "Tenant not found" });
|
|
768
|
+
const n = await t.selectFrom("connections").where("tenant_id", "=", r.tenant_id).selectAll().execute();
|
|
753
769
|
return {
|
|
754
770
|
...r,
|
|
755
|
-
connections:
|
|
771
|
+
connections: n.map(
|
|
756
772
|
(s) => Ue.parse(
|
|
757
|
-
|
|
773
|
+
y({
|
|
758
774
|
...s,
|
|
759
775
|
options: s.options ? JSON.parse(s.options) : {}
|
|
760
776
|
})
|
|
@@ -766,7 +782,7 @@ function Jt(t) {
|
|
|
766
782
|
web_origins: r.web_origins ? JSON.parse(r.web_origins) : [],
|
|
767
783
|
allowed_logout_urls: r.allowed_logout_urls ? JSON.parse(r.allowed_logout_urls) : [],
|
|
768
784
|
allowed_clients: r.allowed_clients ? JSON.parse(r.allowed_clients) : [],
|
|
769
|
-
tenant:
|
|
785
|
+
tenant: y(a),
|
|
770
786
|
// this is really an integer in the database
|
|
771
787
|
disable_sign_ups: !!r.disable_sign_ups
|
|
772
788
|
};
|
|
@@ -774,12 +790,46 @@ function Jt(t) {
|
|
|
774
790
|
};
|
|
775
791
|
}
|
|
776
792
|
function Rt(t) {
|
|
777
|
-
return async () =>
|
|
778
|
-
|
|
779
|
-
r
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
793
|
+
return async (e = {}) => {
|
|
794
|
+
const {
|
|
795
|
+
page: r = 0,
|
|
796
|
+
per_page: a = 100,
|
|
797
|
+
include_totals: n = !1,
|
|
798
|
+
sort: o,
|
|
799
|
+
q: s
|
|
800
|
+
} = e;
|
|
801
|
+
let i = t.selectFrom("keys").where(
|
|
802
|
+
(f) => f.or([
|
|
803
|
+
f("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
|
|
804
|
+
f("revoked_at", "is", null)
|
|
805
|
+
])
|
|
806
|
+
);
|
|
807
|
+
s && (i = T(t, i, s, [
|
|
808
|
+
"kid",
|
|
809
|
+
"connection",
|
|
810
|
+
"fingerprint",
|
|
811
|
+
"thumbprint",
|
|
812
|
+
"type"
|
|
813
|
+
]));
|
|
814
|
+
let c = i.select((f) => f.fn.count("kid").as("count"));
|
|
815
|
+
const _ = r * a;
|
|
816
|
+
i = i.limit(a).offset(_), o && (i = i.orderBy(o.sort_by, o.sort_order));
|
|
817
|
+
const u = await i.selectAll().execute();
|
|
818
|
+
if (!n)
|
|
819
|
+
return {
|
|
820
|
+
signingKeys: u,
|
|
821
|
+
start: 0,
|
|
822
|
+
limit: 0,
|
|
823
|
+
length: 0
|
|
824
|
+
};
|
|
825
|
+
const m = await c.executeTakeFirst(), h = x((m == null ? void 0 : m.count) ?? 0);
|
|
826
|
+
return {
|
|
827
|
+
signingKeys: u,
|
|
828
|
+
start: _,
|
|
829
|
+
limit: a,
|
|
830
|
+
length: h
|
|
831
|
+
};
|
|
832
|
+
};
|
|
783
833
|
}
|
|
784
834
|
function Kt(t) {
|
|
785
835
|
return async (e) => {
|
|
@@ -799,7 +849,7 @@ function Bt(t) {
|
|
|
799
849
|
function Qt(t) {
|
|
800
850
|
return async (e, r) => {
|
|
801
851
|
const a = {
|
|
802
|
-
custom_domain_id:
|
|
852
|
+
custom_domain_id: O(),
|
|
803
853
|
status: "pending",
|
|
804
854
|
primary: !1,
|
|
805
855
|
...r
|
|
@@ -833,12 +883,12 @@ function Wt(t) {
|
|
|
833
883
|
}
|
|
834
884
|
function Gt(t) {
|
|
835
885
|
return async (e, r, a) => {
|
|
836
|
-
const
|
|
886
|
+
const n = {
|
|
837
887
|
...a,
|
|
838
888
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
839
889
|
primary: a.primary ? 1 : 0
|
|
840
890
|
};
|
|
841
|
-
return (await t.updateTable("custom_domains").set(
|
|
891
|
+
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", r).execute()).length > 0;
|
|
842
892
|
};
|
|
843
893
|
}
|
|
844
894
|
function Ht(t) {
|
|
@@ -850,7 +900,7 @@ function Ht(t) {
|
|
|
850
900
|
} : null;
|
|
851
901
|
};
|
|
852
902
|
}
|
|
853
|
-
function
|
|
903
|
+
function Yt(t) {
|
|
854
904
|
return {
|
|
855
905
|
create: Qt(t),
|
|
856
906
|
get: Wt(t),
|
|
@@ -860,29 +910,29 @@ function Xt(t) {
|
|
|
860
910
|
update: Gt(t)
|
|
861
911
|
};
|
|
862
912
|
}
|
|
863
|
-
function
|
|
913
|
+
function Xt(t) {
|
|
864
914
|
return async (e) => {
|
|
865
915
|
const [r] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
866
916
|
if (!r)
|
|
867
917
|
return null;
|
|
868
918
|
const {
|
|
869
919
|
tenant_id: a,
|
|
870
|
-
colors_primary:
|
|
871
|
-
colors_page_background_type:
|
|
920
|
+
colors_primary: n,
|
|
921
|
+
colors_page_background_type: o,
|
|
872
922
|
colors_page_background_start: s,
|
|
873
|
-
colors_page_background_end:
|
|
923
|
+
colors_page_background_end: i,
|
|
874
924
|
colors_page_background_angle_dev: c,
|
|
875
925
|
font_url: _,
|
|
876
926
|
...u
|
|
877
927
|
} = r;
|
|
878
|
-
return
|
|
928
|
+
return y({
|
|
879
929
|
...u,
|
|
880
930
|
colors: {
|
|
881
|
-
primary:
|
|
931
|
+
primary: n,
|
|
882
932
|
page_background: {
|
|
883
|
-
type:
|
|
933
|
+
type: o,
|
|
884
934
|
start: s,
|
|
885
|
-
end:
|
|
935
|
+
end: i,
|
|
886
936
|
angle_deg: c
|
|
887
937
|
}
|
|
888
938
|
},
|
|
@@ -892,26 +942,26 @@ function Yt(t) {
|
|
|
892
942
|
}
|
|
893
943
|
function Zt(t) {
|
|
894
944
|
return async (e, r) => {
|
|
895
|
-
var s,
|
|
896
|
-
const { colors: a, font:
|
|
945
|
+
var s, i, c, _, u, m, h, f, g, w, b, D, M, P, V, le, ce, de;
|
|
946
|
+
const { colors: a, font: n, ...o } = r;
|
|
897
947
|
try {
|
|
898
948
|
await t.insertInto("branding").values({
|
|
899
|
-
...
|
|
949
|
+
...o,
|
|
900
950
|
colors_primary: a == null ? void 0 : a.primary,
|
|
901
|
-
colors_page_background_type: (
|
|
951
|
+
colors_page_background_type: (i = (s = r.colors) == null ? void 0 : s.page_background) == null ? void 0 : i.type,
|
|
902
952
|
colors_page_background_start: (_ = (c = r.colors) == null ? void 0 : c.page_background) == null ? void 0 : _.start,
|
|
903
|
-
colors_page_background_end: (
|
|
904
|
-
colors_page_background_angle_dev: (
|
|
905
|
-
font_url: (
|
|
953
|
+
colors_page_background_end: (m = (u = r.colors) == null ? void 0 : u.page_background) == null ? void 0 : m.end,
|
|
954
|
+
colors_page_background_angle_dev: (f = (h = r.colors) == null ? void 0 : h.page_background) == null ? void 0 : f.angle_deg,
|
|
955
|
+
font_url: (g = r.font) == null ? void 0 : g.url,
|
|
906
956
|
tenant_id: e
|
|
907
957
|
}).execute();
|
|
908
958
|
} catch {
|
|
909
959
|
await t.updateTable("branding").set({
|
|
910
|
-
...
|
|
960
|
+
...o,
|
|
911
961
|
colors_primary: a == null ? void 0 : a.primary,
|
|
912
|
-
colors_page_background_type: (
|
|
913
|
-
colors_page_background_start: (
|
|
914
|
-
colors_page_background_end: (
|
|
962
|
+
colors_page_background_type: (b = (w = r.colors) == null ? void 0 : w.page_background) == null ? void 0 : b.type,
|
|
963
|
+
colors_page_background_start: (M = (D = r.colors) == null ? void 0 : D.page_background) == null ? void 0 : M.start,
|
|
964
|
+
colors_page_background_end: (V = (P = r.colors) == null ? void 0 : P.page_background) == null ? void 0 : V.end,
|
|
915
965
|
colors_page_background_angle_dev: (ce = (le = r.colors) == null ? void 0 : le.page_background) == null ? void 0 : ce.angle_deg,
|
|
916
966
|
font_url: (de = r.font) == null ? void 0 : de.url
|
|
917
967
|
}).where("tenant_id", "=", e).execute();
|
|
@@ -920,38 +970,43 @@ function Zt(t) {
|
|
|
920
970
|
}
|
|
921
971
|
function er(t) {
|
|
922
972
|
return {
|
|
923
|
-
get:
|
|
973
|
+
get: Xt(t),
|
|
924
974
|
set: Zt(t)
|
|
925
975
|
};
|
|
926
976
|
}
|
|
927
977
|
function tr(t) {
|
|
928
|
-
return async (e, r = {
|
|
929
|
-
page: 0,
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
978
|
+
return async (e, r = {}) => {
|
|
979
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, q: s } = r;
|
|
980
|
+
let i = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
981
|
+
s && (i = T(t, i, s, ["url", "form_id"]));
|
|
982
|
+
const u = (await i.offset(a * n).limit(n).selectAll().execute()).map((h) => {
|
|
983
|
+
const { tenant_id: f, enabled: g, synchronous: w, ...b } = h;
|
|
984
|
+
return y({
|
|
985
|
+
...b,
|
|
986
|
+
enabled: !!g,
|
|
987
|
+
synchronous: !!w
|
|
988
|
+
});
|
|
989
|
+
});
|
|
990
|
+
if (!o)
|
|
991
|
+
return {
|
|
992
|
+
hooks: u,
|
|
993
|
+
start: 0,
|
|
994
|
+
limit: 0,
|
|
995
|
+
length: 0
|
|
996
|
+
};
|
|
997
|
+
const { count: m } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
936
998
|
return {
|
|
937
|
-
hooks:
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
enabled: !!u,
|
|
942
|
-
synchronous: !!h
|
|
943
|
-
});
|
|
944
|
-
}),
|
|
945
|
-
start: r.page * r.per_page,
|
|
946
|
-
limit: r.per_page,
|
|
947
|
-
length: v(s)
|
|
999
|
+
hooks: u,
|
|
1000
|
+
start: a * n,
|
|
1001
|
+
limit: n,
|
|
1002
|
+
length: x(m)
|
|
948
1003
|
};
|
|
949
1004
|
};
|
|
950
1005
|
}
|
|
951
1006
|
function rr(t) {
|
|
952
1007
|
return async (e, r) => {
|
|
953
1008
|
const a = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", r).selectAll().executeTakeFirst();
|
|
954
|
-
return a ?
|
|
1009
|
+
return a ? y({
|
|
955
1010
|
...a,
|
|
956
1011
|
enabled: !!a.enabled,
|
|
957
1012
|
synchronous: !!a.synchronous
|
|
@@ -964,7 +1019,7 @@ function ar(t) {
|
|
|
964
1019
|
function nr(t) {
|
|
965
1020
|
return async (e, r) => {
|
|
966
1021
|
const a = {
|
|
967
|
-
hook_id:
|
|
1022
|
+
hook_id: O(),
|
|
968
1023
|
...r,
|
|
969
1024
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
970
1025
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -979,13 +1034,13 @@ function nr(t) {
|
|
|
979
1034
|
}
|
|
980
1035
|
function or(t) {
|
|
981
1036
|
return async (e, r, a) => {
|
|
982
|
-
const
|
|
1037
|
+
const n = {
|
|
983
1038
|
...a,
|
|
984
1039
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
985
1040
|
enabled: a.enabled !== void 0 ? a.enabled ? 1 : 0 : void 0,
|
|
986
1041
|
synchronous: a.enabled !== void 0 ? a.synchronous ? 1 : 0 : void 0
|
|
987
1042
|
};
|
|
988
|
-
return await t.updateTable("hooks").set(
|
|
1043
|
+
return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=", r).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
989
1044
|
};
|
|
990
1045
|
}
|
|
991
1046
|
function sr(t) {
|
|
@@ -1000,15 +1055,15 @@ function sr(t) {
|
|
|
1000
1055
|
function ir(t) {
|
|
1001
1056
|
return async (e, r) => {
|
|
1002
1057
|
const a = {
|
|
1003
|
-
themeId:
|
|
1058
|
+
themeId: O(),
|
|
1004
1059
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1005
1060
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1006
1061
|
...r
|
|
1007
|
-
},
|
|
1062
|
+
}, n = {
|
|
1008
1063
|
...a,
|
|
1009
1064
|
tenant_id: e
|
|
1010
1065
|
};
|
|
1011
|
-
return await t.insertInto("themes").values(
|
|
1066
|
+
return await t.insertInto("themes").values(J(n)).execute(), a;
|
|
1012
1067
|
};
|
|
1013
1068
|
}
|
|
1014
1069
|
function lr(t) {
|
|
@@ -1019,7 +1074,7 @@ function cr(t) {
|
|
|
1019
1074
|
const a = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", r).selectAll().executeTakeFirst();
|
|
1020
1075
|
if (!a)
|
|
1021
1076
|
return null;
|
|
1022
|
-
const
|
|
1077
|
+
const n = {
|
|
1023
1078
|
...a,
|
|
1024
1079
|
borders_show_widget_shadow: !!a.borders_show_widget_shadow,
|
|
1025
1080
|
fonts_body_text_bold: !!a.fonts_body_text_bold,
|
|
@@ -1029,8 +1084,8 @@ function cr(t) {
|
|
|
1029
1084
|
fonts_subtitle_bold: !!a.fonts_subtitle_bold,
|
|
1030
1085
|
fonts_title_bold: !!a.fonts_title_bold
|
|
1031
1086
|
};
|
|
1032
|
-
return
|
|
1033
|
-
ge(
|
|
1087
|
+
return y(
|
|
1088
|
+
ge(n, [
|
|
1034
1089
|
"widget",
|
|
1035
1090
|
"colors",
|
|
1036
1091
|
"borders",
|
|
@@ -1042,11 +1097,11 @@ function cr(t) {
|
|
|
1042
1097
|
}
|
|
1043
1098
|
function dr(t) {
|
|
1044
1099
|
return async (e, r, a) => {
|
|
1045
|
-
const
|
|
1100
|
+
const n = J({
|
|
1046
1101
|
...a,
|
|
1047
1102
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1048
1103
|
});
|
|
1049
|
-
return await t.updateTable("themes").set(
|
|
1104
|
+
return await t.updateTable("themes").set(n).where("themes.themeId", "=", r).where("themes.tenant_id", "=", e).execute(), !0;
|
|
1050
1105
|
};
|
|
1051
1106
|
}
|
|
1052
1107
|
function ur(t) {
|
|
@@ -1062,7 +1117,7 @@ function mr(t) {
|
|
|
1062
1117
|
const a = await t.selectFrom("login_sessions").where("login_sessions.id", "=", r).selectAll().executeTakeFirst();
|
|
1063
1118
|
return a ? Be.parse(
|
|
1064
1119
|
ge(
|
|
1065
|
-
|
|
1120
|
+
y({
|
|
1066
1121
|
...a,
|
|
1067
1122
|
login_completed: !!a.login_completed
|
|
1068
1123
|
}),
|
|
@@ -1073,24 +1128,24 @@ function mr(t) {
|
|
|
1073
1128
|
}
|
|
1074
1129
|
function _r(t) {
|
|
1075
1130
|
return async (e, r) => {
|
|
1076
|
-
var
|
|
1131
|
+
var n;
|
|
1077
1132
|
const a = {
|
|
1078
|
-
id:
|
|
1133
|
+
id: O(),
|
|
1079
1134
|
...r,
|
|
1080
|
-
authorization_url: (
|
|
1135
|
+
authorization_url: (n = r.authorization_url) == null ? void 0 : n.slice(0, 1024),
|
|
1081
1136
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1082
1137
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1083
1138
|
login_completed: !!r.login_completed
|
|
1084
1139
|
};
|
|
1085
1140
|
return await t.insertInto("login_sessions").values({
|
|
1086
|
-
...
|
|
1141
|
+
...J(a),
|
|
1087
1142
|
tenant_id: e
|
|
1088
1143
|
}).execute(), a;
|
|
1089
1144
|
};
|
|
1090
1145
|
}
|
|
1091
1146
|
function hr(t) {
|
|
1092
1147
|
return async (e, r, a) => (await t.updateTable("login_sessions").set(
|
|
1093
|
-
|
|
1148
|
+
J({
|
|
1094
1149
|
...a
|
|
1095
1150
|
})
|
|
1096
1151
|
).where("login_sessions.id", "=", r).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
@@ -1109,7 +1164,7 @@ function pr(t) {
|
|
|
1109
1164
|
function gr(t) {
|
|
1110
1165
|
return async (e) => {
|
|
1111
1166
|
const [r] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
1112
|
-
return
|
|
1167
|
+
return y({
|
|
1113
1168
|
identifier_first: !!(r != null && r.identifier_first),
|
|
1114
1169
|
password_first: !!(r != null && r.password_first),
|
|
1115
1170
|
webauthn_platform_first_factor: !!(r != null && r.webauthn_platform_first_factor),
|
|
@@ -1118,7 +1173,7 @@ function gr(t) {
|
|
|
1118
1173
|
};
|
|
1119
1174
|
}
|
|
1120
1175
|
function he(t) {
|
|
1121
|
-
return
|
|
1176
|
+
return y({
|
|
1122
1177
|
...t,
|
|
1123
1178
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
|
|
1124
1179
|
identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
|
|
@@ -1152,38 +1207,38 @@ function vr(t) {
|
|
|
1152
1207
|
return null;
|
|
1153
1208
|
const {
|
|
1154
1209
|
tenant_id: a,
|
|
1155
|
-
credentials:
|
|
1156
|
-
settings:
|
|
1210
|
+
credentials: n,
|
|
1211
|
+
settings: o,
|
|
1157
1212
|
enabled: s,
|
|
1158
|
-
...
|
|
1213
|
+
...i
|
|
1159
1214
|
} = r;
|
|
1160
|
-
return
|
|
1161
|
-
...
|
|
1162
|
-
credentials: JSON.parse(
|
|
1163
|
-
settings: JSON.parse(
|
|
1215
|
+
return y({
|
|
1216
|
+
...i,
|
|
1217
|
+
credentials: JSON.parse(n),
|
|
1218
|
+
settings: JSON.parse(o),
|
|
1164
1219
|
enabled: !!s
|
|
1165
1220
|
});
|
|
1166
1221
|
};
|
|
1167
1222
|
}
|
|
1168
1223
|
function Nr(t) {
|
|
1169
1224
|
return async (e, r) => {
|
|
1170
|
-
const { credentials: a, settings:
|
|
1225
|
+
const { credentials: a, settings: n, enabled: o, ...s } = r;
|
|
1171
1226
|
await t.updateTable("email_providers").set({
|
|
1172
1227
|
...s,
|
|
1173
1228
|
credentials: a ? JSON.stringify(a) : void 0,
|
|
1174
|
-
settings:
|
|
1175
|
-
enabled:
|
|
1229
|
+
settings: n ? JSON.stringify(n) : void 0,
|
|
1230
|
+
enabled: o !== void 0 ? o ? 1 : 0 : void 0
|
|
1176
1231
|
}).where("tenant_id", "=", e).execute();
|
|
1177
1232
|
};
|
|
1178
1233
|
}
|
|
1179
1234
|
function Cr(t) {
|
|
1180
1235
|
return async (e, r) => {
|
|
1181
|
-
const { credentials: a, settings:
|
|
1236
|
+
const { credentials: a, settings: n, enabled: o, ...s } = r;
|
|
1182
1237
|
await t.insertInto("email_providers").values({
|
|
1183
1238
|
...s,
|
|
1184
|
-
enabled:
|
|
1239
|
+
enabled: o ? 1 : 0,
|
|
1185
1240
|
credentials: JSON.stringify(a),
|
|
1186
|
-
settings: JSON.stringify(
|
|
1241
|
+
settings: JSON.stringify(n),
|
|
1187
1242
|
tenant_id: e,
|
|
1188
1243
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1189
1244
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1228,43 +1283,45 @@ function Sr(t) {
|
|
|
1228
1283
|
}
|
|
1229
1284
|
function Or(t) {
|
|
1230
1285
|
return async (e, r, a) => {
|
|
1231
|
-
const
|
|
1286
|
+
const n = {
|
|
1232
1287
|
...a,
|
|
1233
1288
|
device: a.device ? JSON.stringify(a.device) : void 0,
|
|
1234
1289
|
resource_servers: a.resource_servers ? JSON.stringify(a.resource_servers) : void 0,
|
|
1235
1290
|
rotating: a.rotating ? 1 : 0
|
|
1236
1291
|
};
|
|
1237
|
-
return !!(await t.updateTable("refresh_tokens").set(
|
|
1292
|
+
return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", r).execute()).length;
|
|
1238
1293
|
};
|
|
1239
1294
|
}
|
|
1240
1295
|
function kr(t) {
|
|
1241
|
-
return async (e, r = {
|
|
1242
|
-
page: 0,
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
if (r.sort && r.sort.sort_by) {
|
|
1250
|
-
const { ref: c } = t.dynamic;
|
|
1251
|
-
o = o.orderBy(
|
|
1252
|
-
c(r.sort.sort_by),
|
|
1253
|
-
r.sort.sort_order
|
|
1254
|
-
);
|
|
1296
|
+
return async (e, r = {}) => {
|
|
1297
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = r;
|
|
1298
|
+
let c = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1299
|
+
i && (c = T(t, c, i, ["token", "session_id"]));
|
|
1300
|
+
let _ = c;
|
|
1301
|
+
if (s && s.sort_by) {
|
|
1302
|
+
const { ref: g } = t.dynamic;
|
|
1303
|
+
_ = _.orderBy(g(s.sort_by), s.sort_order);
|
|
1255
1304
|
}
|
|
1256
|
-
|
|
1257
|
-
const
|
|
1305
|
+
_ = _.offset(a * n).limit(n);
|
|
1306
|
+
const m = (await _.selectAll().execute()).map((g) => ({
|
|
1307
|
+
...g,
|
|
1308
|
+
rotating: !!g.rotating,
|
|
1309
|
+
device: g.device ? JSON.parse(g.device) : {},
|
|
1310
|
+
resource_servers: g.resource_servers ? JSON.parse(g.resource_servers) : []
|
|
1311
|
+
}));
|
|
1312
|
+
if (!o)
|
|
1313
|
+
return {
|
|
1314
|
+
refresh_tokens: m,
|
|
1315
|
+
start: 0,
|
|
1316
|
+
limit: 0,
|
|
1317
|
+
length: 0
|
|
1318
|
+
};
|
|
1319
|
+
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
1258
1320
|
return {
|
|
1259
|
-
refresh_tokens:
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
resource_servers: c.resource_servers ? JSON.parse(c.resource_servers) : []
|
|
1264
|
-
})),
|
|
1265
|
-
start: r.page * r.per_page,
|
|
1266
|
-
limit: r.per_page,
|
|
1267
|
-
length: l
|
|
1321
|
+
refresh_tokens: m,
|
|
1322
|
+
start: a * n,
|
|
1323
|
+
limit: n,
|
|
1324
|
+
length: f
|
|
1268
1325
|
};
|
|
1269
1326
|
};
|
|
1270
1327
|
}
|
|
@@ -1285,32 +1342,32 @@ function Ir(t) {
|
|
|
1285
1342
|
Date.now() - 1e3 * 60 * 60 * 24 * 30 * 3
|
|
1286
1343
|
).toISOString();
|
|
1287
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", "<", r).where("session_id", "is", null).limit(1e5).execute(), console.log("delete logs"), await t.deleteFrom("logs").where("date", "<", a).limit(1e5).execute(), console.log("delete refresh tokens"), await t.deleteFrom("refresh_tokens").where(
|
|
1288
|
-
(
|
|
1289
|
-
|
|
1290
|
-
|
|
1345
|
+
(o) => o.or([
|
|
1346
|
+
o("expires_at", "<", r),
|
|
1347
|
+
o("idle_expires_at", "<", r)
|
|
1291
1348
|
])
|
|
1292
1349
|
).limit(1e4).execute(), console.log("delete sessions");
|
|
1293
|
-
const
|
|
1294
|
-
(
|
|
1295
|
-
|
|
1296
|
-
|
|
1350
|
+
const n = await t.selectFrom("sessions").select("id").where(
|
|
1351
|
+
(o) => o.or([
|
|
1352
|
+
o("expires_at", "<", r),
|
|
1353
|
+
o("idle_expires_at", "<", r)
|
|
1297
1354
|
])
|
|
1298
1355
|
).where(
|
|
1299
1356
|
"id",
|
|
1300
1357
|
"not in",
|
|
1301
1358
|
t.selectFrom("refresh_tokens").select("session_id")
|
|
1302
1359
|
).limit(1e5).execute();
|
|
1303
|
-
|
|
1360
|
+
n.length > 0 && await t.deleteFrom("sessions").where(
|
|
1304
1361
|
"id",
|
|
1305
1362
|
"in",
|
|
1306
|
-
|
|
1363
|
+
n.map((o) => o.id)
|
|
1307
1364
|
).execute(), console.log("cleanup complete");
|
|
1308
1365
|
};
|
|
1309
1366
|
}
|
|
1310
1367
|
function Dr(t) {
|
|
1311
1368
|
return async (e, r) => {
|
|
1312
|
-
const a =
|
|
1313
|
-
id:
|
|
1369
|
+
const a = G.parse({
|
|
1370
|
+
id: O(),
|
|
1314
1371
|
...r,
|
|
1315
1372
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1316
1373
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1322,41 +1379,46 @@ function Dr(t) {
|
|
|
1322
1379
|
start: JSON.stringify(a.start || {}),
|
|
1323
1380
|
ending: JSON.stringify(a.ending || {}),
|
|
1324
1381
|
tenant_id: e
|
|
1325
|
-
}).execute(),
|
|
1382
|
+
}).execute(), G.parse(a);
|
|
1326
1383
|
};
|
|
1327
1384
|
}
|
|
1328
1385
|
function Pr(t) {
|
|
1329
|
-
return async (e, r = {
|
|
1330
|
-
page: 0,
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
const s = (await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute()).map((c) => {
|
|
1337
|
-
const _ = { ...c };
|
|
1338
|
-
if (typeof _.nodes == "string")
|
|
1386
|
+
return async (e, r = {}) => {
|
|
1387
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, q: s } = r;
|
|
1388
|
+
let i = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1389
|
+
s && (i = T(t, i, s, []));
|
|
1390
|
+
const u = (await i.offset(a * n).limit(n).selectAll().execute()).map((h) => {
|
|
1391
|
+
const f = { ...h };
|
|
1392
|
+
if (typeof f.nodes == "string")
|
|
1339
1393
|
try {
|
|
1340
|
-
|
|
1394
|
+
f.nodes = JSON.parse(f.nodes);
|
|
1341
1395
|
} catch {
|
|
1342
1396
|
}
|
|
1343
|
-
if (typeof
|
|
1397
|
+
if (typeof f.start == "string")
|
|
1344
1398
|
try {
|
|
1345
|
-
|
|
1399
|
+
f.start = JSON.parse(f.start);
|
|
1346
1400
|
} catch {
|
|
1347
1401
|
}
|
|
1348
|
-
if (typeof
|
|
1402
|
+
if (typeof f.ending == "string")
|
|
1349
1403
|
try {
|
|
1350
|
-
|
|
1404
|
+
f.ending = JSON.parse(f.ending);
|
|
1351
1405
|
} catch {
|
|
1352
1406
|
}
|
|
1353
|
-
return
|
|
1354
|
-
})
|
|
1407
|
+
return G.parse(y(f));
|
|
1408
|
+
});
|
|
1409
|
+
if (!o)
|
|
1410
|
+
return {
|
|
1411
|
+
forms: u,
|
|
1412
|
+
start: 0,
|
|
1413
|
+
limit: 0,
|
|
1414
|
+
length: 0
|
|
1415
|
+
};
|
|
1416
|
+
const { count: m } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1355
1417
|
return {
|
|
1356
|
-
forms:
|
|
1357
|
-
start:
|
|
1358
|
-
limit:
|
|
1359
|
-
length:
|
|
1418
|
+
forms: u,
|
|
1419
|
+
start: a * n,
|
|
1420
|
+
limit: n,
|
|
1421
|
+
length: x(m)
|
|
1360
1422
|
};
|
|
1361
1423
|
};
|
|
1362
1424
|
}
|
|
@@ -1370,34 +1432,34 @@ function Fr(t) {
|
|
|
1370
1432
|
return async (e, r) => {
|
|
1371
1433
|
const a = await t.selectFrom("forms").selectAll().where("forms.id", "=", r).where("tenant_id", "=", e).executeTakeFirst();
|
|
1372
1434
|
if (!a) return null;
|
|
1373
|
-
const
|
|
1374
|
-
if (typeof
|
|
1435
|
+
const n = { ...a };
|
|
1436
|
+
if (typeof n.nodes == "string")
|
|
1375
1437
|
try {
|
|
1376
|
-
|
|
1438
|
+
n.nodes = JSON.parse(n.nodes);
|
|
1377
1439
|
} catch {
|
|
1378
1440
|
}
|
|
1379
|
-
if (typeof
|
|
1441
|
+
if (typeof n.start == "string")
|
|
1380
1442
|
try {
|
|
1381
|
-
|
|
1443
|
+
n.start = JSON.parse(n.start);
|
|
1382
1444
|
} catch {
|
|
1383
1445
|
}
|
|
1384
|
-
if (typeof
|
|
1446
|
+
if (typeof n.ending == "string")
|
|
1385
1447
|
try {
|
|
1386
|
-
|
|
1448
|
+
n.ending = JSON.parse(n.ending);
|
|
1387
1449
|
} catch {
|
|
1388
1450
|
}
|
|
1389
|
-
return
|
|
1451
|
+
return G.parse(y(n));
|
|
1390
1452
|
};
|
|
1391
1453
|
}
|
|
1392
1454
|
function Mr(t) {
|
|
1393
1455
|
return async (e, r, a) => {
|
|
1394
|
-
const
|
|
1456
|
+
const n = {
|
|
1395
1457
|
...a,
|
|
1396
1458
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1397
1459
|
};
|
|
1398
|
-
a.nodes && (
|
|
1399
|
-
const { numUpdatedRows:
|
|
1400
|
-
return
|
|
1460
|
+
a.nodes && (n.nodes = JSON.stringify(a.nodes)), a.start && (n.start = JSON.stringify(a.start)), a.ending && (n.ending = JSON.stringify(a.ending));
|
|
1461
|
+
const { numUpdatedRows: o } = await t.updateTable("forms").set(n).where("id", "=", r).where("tenant_id", "=", e).executeTakeFirst();
|
|
1462
|
+
return o > 0;
|
|
1401
1463
|
};
|
|
1402
1464
|
}
|
|
1403
1465
|
function Ar(t) {
|
|
@@ -1411,22 +1473,22 @@ function Ar(t) {
|
|
|
1411
1473
|
}
|
|
1412
1474
|
function zr(t) {
|
|
1413
1475
|
return async (e, r) => {
|
|
1414
|
-
const a = (/* @__PURE__ */ new Date()).toISOString(),
|
|
1415
|
-
id:
|
|
1476
|
+
const a = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1477
|
+
id: O(),
|
|
1416
1478
|
...r,
|
|
1417
1479
|
created_at: a,
|
|
1418
1480
|
updated_at: a
|
|
1419
|
-
},
|
|
1481
|
+
}, o = qe.parse(n), {
|
|
1420
1482
|
verificationKey: s,
|
|
1421
|
-
scopes:
|
|
1483
|
+
scopes: i,
|
|
1422
1484
|
options: c,
|
|
1423
1485
|
skip_consent_for_verifiable_first_party_clients: _,
|
|
1424
1486
|
allow_offline_access: u,
|
|
1425
|
-
...
|
|
1426
|
-
} =
|
|
1427
|
-
...
|
|
1487
|
+
...m
|
|
1488
|
+
} = o, h = {
|
|
1489
|
+
...m,
|
|
1428
1490
|
tenant_id: e,
|
|
1429
|
-
scopes:
|
|
1491
|
+
scopes: i ? JSON.stringify(i) : "[]",
|
|
1430
1492
|
options: c ? JSON.stringify(c) : "{}",
|
|
1431
1493
|
skip_consent_for_verifiable_first_party_clients: _ ? 1 : 0,
|
|
1432
1494
|
allow_offline_access: u ? 1 : 0,
|
|
@@ -1434,70 +1496,79 @@ function zr(t) {
|
|
|
1434
1496
|
created_at: a,
|
|
1435
1497
|
updated_at: a
|
|
1436
1498
|
};
|
|
1437
|
-
return await t.insertInto("resource_servers").values(
|
|
1499
|
+
return await t.insertInto("resource_servers").values(h).execute(), y(o);
|
|
1438
1500
|
};
|
|
1439
1501
|
}
|
|
1440
1502
|
function Lr(t) {
|
|
1441
1503
|
return async (e, r) => {
|
|
1442
1504
|
const a = await t.selectFrom("resource_servers").selectAll().where("tenant_id", "=", e).where("id", "=", r).executeTakeFirst();
|
|
1443
1505
|
if (!a) return null;
|
|
1444
|
-
const
|
|
1445
|
-
verification_key:
|
|
1506
|
+
const n = a, {
|
|
1507
|
+
verification_key: o,
|
|
1446
1508
|
scopes: s,
|
|
1447
|
-
options:
|
|
1509
|
+
options: i,
|
|
1448
1510
|
skip_consent_for_verifiable_first_party_clients: c,
|
|
1449
1511
|
allow_offline_access: _,
|
|
1450
1512
|
...u
|
|
1451
|
-
} =
|
|
1513
|
+
} = n, m = {
|
|
1452
1514
|
...u,
|
|
1453
1515
|
scopes: s ? JSON.parse(s) : [],
|
|
1454
|
-
options:
|
|
1516
|
+
options: i ? JSON.parse(i) : {},
|
|
1455
1517
|
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
1456
1518
|
allow_offline_access: !!_,
|
|
1457
1519
|
// Convert verification_key back to verificationKey for API
|
|
1458
|
-
verificationKey:
|
|
1520
|
+
verificationKey: o
|
|
1459
1521
|
};
|
|
1460
|
-
return
|
|
1522
|
+
return y(m);
|
|
1461
1523
|
};
|
|
1462
1524
|
}
|
|
1463
1525
|
function Er(t) {
|
|
1464
|
-
return async (e, r = {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1526
|
+
return async (e, r = {}) => {
|
|
1527
|
+
const { page: a = 0, per_page: n = 50, include_totals: o = !1, q: s } = r;
|
|
1528
|
+
let i = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1529
|
+
if (s) {
|
|
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
|
+
if (w && !D) {
|
|
1532
|
+
const M = !!w[1], P = w[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1533
|
+
i = M ? i.where(P, "not like", `%${b}%`) : i.where(P, "like", `%${b}%`);
|
|
1471
1534
|
} else
|
|
1472
|
-
|
|
1535
|
+
i = T(t, i, h, [
|
|
1473
1536
|
"resource_servers.name",
|
|
1474
1537
|
"resource_servers.identifier"
|
|
1475
1538
|
]);
|
|
1476
1539
|
}
|
|
1477
|
-
const
|
|
1478
|
-
const
|
|
1479
|
-
verification_key:
|
|
1480
|
-
scopes:
|
|
1481
|
-
options:
|
|
1482
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1483
|
-
allow_offline_access:
|
|
1484
|
-
...
|
|
1485
|
-
} =
|
|
1486
|
-
...
|
|
1487
|
-
scopes:
|
|
1488
|
-
options:
|
|
1489
|
-
skip_consent_for_verifiable_first_party_clients: !!
|
|
1490
|
-
allow_offline_access: !!
|
|
1540
|
+
const u = (await i.offset(a * n).limit(n).selectAll().execute()).map((h) => {
|
|
1541
|
+
const f = h, {
|
|
1542
|
+
verification_key: g,
|
|
1543
|
+
scopes: w,
|
|
1544
|
+
options: b,
|
|
1545
|
+
skip_consent_for_verifiable_first_party_clients: D,
|
|
1546
|
+
allow_offline_access: M,
|
|
1547
|
+
...P
|
|
1548
|
+
} = f, V = {
|
|
1549
|
+
...P,
|
|
1550
|
+
scopes: w ? JSON.parse(w) : [],
|
|
1551
|
+
options: b ? JSON.parse(b) : {},
|
|
1552
|
+
skip_consent_for_verifiable_first_party_clients: !!D,
|
|
1553
|
+
allow_offline_access: !!M,
|
|
1491
1554
|
// Convert verification_key back to verificationKey for API
|
|
1492
|
-
verificationKey:
|
|
1555
|
+
verificationKey: g
|
|
1556
|
+
};
|
|
1557
|
+
return y(V);
|
|
1558
|
+
});
|
|
1559
|
+
if (!o)
|
|
1560
|
+
return {
|
|
1561
|
+
resource_servers: u,
|
|
1562
|
+
start: 0,
|
|
1563
|
+
limit: 0,
|
|
1564
|
+
length: 0
|
|
1493
1565
|
};
|
|
1494
|
-
|
|
1495
|
-
}), { count: l } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1566
|
+
const { count: m } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1496
1567
|
return {
|
|
1497
|
-
resource_servers:
|
|
1498
|
-
start:
|
|
1499
|
-
limit:
|
|
1500
|
-
length:
|
|
1568
|
+
resource_servers: u,
|
|
1569
|
+
start: a * n,
|
|
1570
|
+
limit: n,
|
|
1571
|
+
length: x(m)
|
|
1501
1572
|
};
|
|
1502
1573
|
};
|
|
1503
1574
|
}
|
|
@@ -1510,19 +1581,19 @@ function Jr(t) {
|
|
|
1510
1581
|
function Rr(t) {
|
|
1511
1582
|
return async (e, r, a) => {
|
|
1512
1583
|
const {
|
|
1513
|
-
verificationKey:
|
|
1514
|
-
scopes:
|
|
1584
|
+
verificationKey: n,
|
|
1585
|
+
scopes: o,
|
|
1515
1586
|
options: s,
|
|
1516
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1587
|
+
skip_consent_for_verifiable_first_party_clients: i,
|
|
1517
1588
|
allow_offline_access: c,
|
|
1518
1589
|
..._
|
|
1519
1590
|
} = a, u = {
|
|
1520
1591
|
..._,
|
|
1521
1592
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1522
1593
|
};
|
|
1523
|
-
|
|
1524
|
-
const
|
|
1525
|
-
return Number(
|
|
1594
|
+
n !== void 0 && (u.verification_key = n), o !== void 0 && (u.scopes = JSON.stringify(o)), s !== void 0 && (u.options = JSON.stringify(s)), i !== void 0 && (u.skip_consent_for_verifiable_first_party_clients = i ? 1 : 0), c !== void 0 && (u.allow_offline_access = c ? 1 : 0);
|
|
1595
|
+
const m = await t.updateTable("resource_servers").set(u).where("tenant_id", "=", e).where("id", "=", r).executeTakeFirst();
|
|
1596
|
+
return Number(m.numUpdatedRows) > 0;
|
|
1526
1597
|
};
|
|
1527
1598
|
}
|
|
1528
1599
|
function Kr(t) {
|
|
@@ -1536,15 +1607,15 @@ function Kr(t) {
|
|
|
1536
1607
|
}
|
|
1537
1608
|
function Ur(t) {
|
|
1538
1609
|
return async (e, r) => {
|
|
1539
|
-
const a = (/* @__PURE__ */ new Date()).toISOString(),
|
|
1540
|
-
id:
|
|
1610
|
+
const a = (/* @__PURE__ */ new Date()).toISOString(), n = O(), o = {
|
|
1611
|
+
id: n,
|
|
1541
1612
|
...r,
|
|
1542
1613
|
tenant_id: e,
|
|
1543
1614
|
created_at: a,
|
|
1544
1615
|
updated_at: a
|
|
1545
1616
|
};
|
|
1546
|
-
return await t.insertInto("roles").values(
|
|
1547
|
-
id:
|
|
1617
|
+
return await t.insertInto("roles").values(o).execute(), {
|
|
1618
|
+
id: n,
|
|
1548
1619
|
...r,
|
|
1549
1620
|
created_at: a,
|
|
1550
1621
|
updated_at: a
|
|
@@ -1560,25 +1631,34 @@ function Br(t) {
|
|
|
1560
1631
|
};
|
|
1561
1632
|
}
|
|
1562
1633
|
function Qr(t) {
|
|
1563
|
-
return async (e, r
|
|
1634
|
+
return async (e, r) => {
|
|
1564
1635
|
let a = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
1565
|
-
|
|
1566
|
-
|
|
1636
|
+
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = r;
|
|
1637
|
+
r.q && (a = T(t, a, r.q, ["name"]));
|
|
1638
|
+
const c = await a.offset(n * o).limit(o).selectAll().execute();
|
|
1639
|
+
if (!s)
|
|
1640
|
+
return {
|
|
1641
|
+
roles: c,
|
|
1642
|
+
start: n * o,
|
|
1643
|
+
limit: o,
|
|
1644
|
+
length: c.length
|
|
1645
|
+
};
|
|
1646
|
+
const { count: _ } = await a.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1567
1647
|
return {
|
|
1568
|
-
roles:
|
|
1569
|
-
start:
|
|
1570
|
-
limit:
|
|
1571
|
-
length:
|
|
1648
|
+
roles: c,
|
|
1649
|
+
start: n * o,
|
|
1650
|
+
limit: o,
|
|
1651
|
+
length: x(_)
|
|
1572
1652
|
};
|
|
1573
1653
|
};
|
|
1574
1654
|
}
|
|
1575
1655
|
function qr(t) {
|
|
1576
1656
|
return async (e, r, a) => {
|
|
1577
|
-
const
|
|
1657
|
+
const n = {
|
|
1578
1658
|
...a,
|
|
1579
1659
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1580
|
-
},
|
|
1581
|
-
return Number(
|
|
1660
|
+
}, o = await t.updateTable("roles").set(n).where("roles.tenant_id", "=", e).where("roles.id", "=", r).executeTakeFirst();
|
|
1661
|
+
return Number(o.numUpdatedRows) > 0;
|
|
1582
1662
|
};
|
|
1583
1663
|
}
|
|
1584
1664
|
function Vr(t) {
|
|
@@ -1599,31 +1679,31 @@ function Wr(t) {
|
|
|
1599
1679
|
function Gr(t) {
|
|
1600
1680
|
return async (e, r, a) => {
|
|
1601
1681
|
if (a.length === 0) return !0;
|
|
1602
|
-
const
|
|
1682
|
+
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1603
1683
|
try {
|
|
1604
|
-
for (const
|
|
1605
|
-
if (
|
|
1684
|
+
for (const o of a) {
|
|
1685
|
+
if (o.role_id !== r)
|
|
1606
1686
|
throw new Error(
|
|
1607
|
-
`Permission role_id ${
|
|
1687
|
+
`Permission role_id ${o.role_id} does not match expected role_id ${r}`
|
|
1608
1688
|
);
|
|
1609
1689
|
const s = {
|
|
1610
1690
|
tenant_id: e,
|
|
1611
|
-
role_id:
|
|
1612
|
-
resource_server_identifier:
|
|
1613
|
-
permission_name:
|
|
1614
|
-
created_at:
|
|
1691
|
+
role_id: o.role_id,
|
|
1692
|
+
resource_server_identifier: o.resource_server_identifier,
|
|
1693
|
+
permission_name: o.permission_name,
|
|
1694
|
+
created_at: n
|
|
1615
1695
|
};
|
|
1616
1696
|
try {
|
|
1617
1697
|
await t.insertInto("role_permissions").values(s).execute();
|
|
1618
|
-
} catch (
|
|
1619
|
-
if (
|
|
1698
|
+
} catch (i) {
|
|
1699
|
+
if (i.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || i.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1620
1700
|
continue;
|
|
1621
|
-
throw
|
|
1701
|
+
throw i;
|
|
1622
1702
|
}
|
|
1623
1703
|
}
|
|
1624
1704
|
return !0;
|
|
1625
|
-
} catch (
|
|
1626
|
-
return console.error("Error assigning role permissions:",
|
|
1705
|
+
} catch (o) {
|
|
1706
|
+
return console.error("Error assigning role permissions:", o), !1;
|
|
1627
1707
|
}
|
|
1628
1708
|
};
|
|
1629
1709
|
}
|
|
@@ -1633,78 +1713,83 @@ function Hr(t) {
|
|
|
1633
1713
|
try {
|
|
1634
1714
|
return (await Promise.all(
|
|
1635
1715
|
a.map(
|
|
1636
|
-
(
|
|
1716
|
+
(o) => t.deleteFrom("role_permissions").where("tenant_id", "=", e).where("role_id", "=", r).where(
|
|
1637
1717
|
"resource_server_identifier",
|
|
1638
1718
|
"=",
|
|
1639
|
-
|
|
1640
|
-
).where("permission_name", "=",
|
|
1719
|
+
o.resource_server_identifier
|
|
1720
|
+
).where("permission_name", "=", o.permission_name).executeTakeFirst()
|
|
1641
1721
|
)
|
|
1642
|
-
)).some((
|
|
1643
|
-
} catch (
|
|
1644
|
-
return console.error("Error removing role permissions:",
|
|
1722
|
+
)).some((o) => Number(o.numDeletedRows) > 0);
|
|
1723
|
+
} catch (n) {
|
|
1724
|
+
return console.error("Error removing role permissions:", n), !1;
|
|
1645
1725
|
}
|
|
1646
1726
|
};
|
|
1647
1727
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return async (e, r, a = {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
"
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1728
|
+
function Yr(t) {
|
|
1729
|
+
return async (e, r, a = {}) => {
|
|
1730
|
+
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = a;
|
|
1731
|
+
let i = t.selectFrom("role_permissions").leftJoin(
|
|
1732
|
+
"resource_servers",
|
|
1733
|
+
(m) => m.onRef(
|
|
1734
|
+
"role_permissions.tenant_id",
|
|
1735
|
+
"=",
|
|
1736
|
+
"resource_servers.tenant_id"
|
|
1737
|
+
).onRef(
|
|
1738
|
+
"role_permissions.resource_server_identifier",
|
|
1739
|
+
"=",
|
|
1740
|
+
"resource_servers.id"
|
|
1741
|
+
)
|
|
1742
|
+
).select([
|
|
1743
|
+
"role_permissions.role_id",
|
|
1656
1744
|
"role_permissions.resource_server_identifier",
|
|
1657
|
-
"
|
|
1658
|
-
"
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
// No description available from role_permissions directly
|
|
1674
|
-
created_at: s.created_at
|
|
1675
|
-
}));
|
|
1745
|
+
"role_permissions.permission_name",
|
|
1746
|
+
"role_permissions.created_at",
|
|
1747
|
+
"resource_servers.name as resource_server_name"
|
|
1748
|
+
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=", r);
|
|
1749
|
+
const u = (await i.offset(n * o).limit(o).execute()).map((m) => ({
|
|
1750
|
+
role_id: m.role_id,
|
|
1751
|
+
resource_server_identifier: m.resource_server_identifier,
|
|
1752
|
+
resource_server_name: m.resource_server_name || m.resource_server_identifier,
|
|
1753
|
+
// Fallback to identifier if name is null
|
|
1754
|
+
permission_name: m.permission_name,
|
|
1755
|
+
description: null,
|
|
1756
|
+
// No description available from role_permissions directly
|
|
1757
|
+
created_at: m.created_at
|
|
1758
|
+
}));
|
|
1759
|
+
return s && await i.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow(), u;
|
|
1760
|
+
};
|
|
1676
1761
|
}
|
|
1677
|
-
function
|
|
1762
|
+
function Xr(t) {
|
|
1678
1763
|
return {
|
|
1679
1764
|
assign: Gr(t),
|
|
1680
1765
|
remove: Hr(t),
|
|
1681
|
-
list:
|
|
1766
|
+
list: Yr(t)
|
|
1682
1767
|
};
|
|
1683
1768
|
}
|
|
1684
1769
|
function Zr(t) {
|
|
1685
1770
|
return async (e, r, a) => {
|
|
1686
1771
|
if (a.length === 0) return !0;
|
|
1687
|
-
const
|
|
1772
|
+
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1688
1773
|
try {
|
|
1689
|
-
for (const
|
|
1774
|
+
for (const o of a) {
|
|
1690
1775
|
const s = {
|
|
1691
1776
|
tenant_id: e,
|
|
1692
1777
|
user_id: r,
|
|
1693
|
-
resource_server_identifier:
|
|
1694
|
-
permission_name:
|
|
1695
|
-
created_at:
|
|
1778
|
+
resource_server_identifier: o.resource_server_identifier,
|
|
1779
|
+
permission_name: o.permission_name,
|
|
1780
|
+
created_at: n
|
|
1696
1781
|
};
|
|
1697
1782
|
try {
|
|
1698
1783
|
await t.insertInto("user_permissions").values(s).execute();
|
|
1699
|
-
} catch (
|
|
1700
|
-
if (
|
|
1784
|
+
} catch (i) {
|
|
1785
|
+
if (i.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || i.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1701
1786
|
continue;
|
|
1702
|
-
throw
|
|
1787
|
+
throw i;
|
|
1703
1788
|
}
|
|
1704
1789
|
}
|
|
1705
1790
|
return !0;
|
|
1706
|
-
} catch (
|
|
1707
|
-
return console.error("Error assigning user permissions:",
|
|
1791
|
+
} catch (o) {
|
|
1792
|
+
return console.error("Error assigning user permissions:", o), !1;
|
|
1708
1793
|
}
|
|
1709
1794
|
};
|
|
1710
1795
|
}
|
|
@@ -1712,22 +1797,22 @@ function ea(t) {
|
|
|
1712
1797
|
return async (e, r, a) => {
|
|
1713
1798
|
if (a.length === 0) return !0;
|
|
1714
1799
|
try {
|
|
1715
|
-
for (const
|
|
1800
|
+
for (const n of a)
|
|
1716
1801
|
await t.deleteFrom("user_permissions").where("tenant_id", "=", e).where("user_id", "=", r).where(
|
|
1717
1802
|
"resource_server_identifier",
|
|
1718
1803
|
"=",
|
|
1719
|
-
|
|
1720
|
-
).where("permission_name", "=",
|
|
1804
|
+
n.resource_server_identifier
|
|
1805
|
+
).where("permission_name", "=", n.permission_name).execute();
|
|
1721
1806
|
return !0;
|
|
1722
|
-
} catch (
|
|
1723
|
-
return console.error("Error removing user permissions:",
|
|
1807
|
+
} catch (n) {
|
|
1808
|
+
return console.error("Error removing user permissions:", n), !1;
|
|
1724
1809
|
}
|
|
1725
1810
|
};
|
|
1726
1811
|
}
|
|
1727
1812
|
function ta(t) {
|
|
1728
1813
|
return async (e, r, a) => (await t.selectFrom("user_permissions").leftJoin(
|
|
1729
1814
|
"resource_servers",
|
|
1730
|
-
(
|
|
1815
|
+
(o) => o.onRef(
|
|
1731
1816
|
"user_permissions.tenant_id",
|
|
1732
1817
|
"=",
|
|
1733
1818
|
"resource_servers.tenant_id"
|
|
@@ -1742,15 +1827,15 @@ function ta(t) {
|
|
|
1742
1827
|
"resource_servers.name as resource_server_name",
|
|
1743
1828
|
"user_permissions.user_id",
|
|
1744
1829
|
"user_permissions.created_at"
|
|
1745
|
-
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=", r).execute()).map((
|
|
1746
|
-
resource_server_identifier:
|
|
1747
|
-
permission_name:
|
|
1830
|
+
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=", r).execute()).map((o) => ({
|
|
1831
|
+
resource_server_identifier: o.resource_server_identifier,
|
|
1832
|
+
permission_name: o.permission_name,
|
|
1748
1833
|
description: null,
|
|
1749
1834
|
// No description available from user_permissions directly
|
|
1750
|
-
resource_server_name:
|
|
1835
|
+
resource_server_name: o.resource_server_name || o.resource_server_identifier,
|
|
1751
1836
|
// Fallback to identifier if name is null
|
|
1752
|
-
user_id:
|
|
1753
|
-
created_at:
|
|
1837
|
+
user_id: o.user_id,
|
|
1838
|
+
created_at: o.created_at
|
|
1754
1839
|
}));
|
|
1755
1840
|
}
|
|
1756
1841
|
function ra(t) {
|
|
@@ -1761,71 +1846,118 @@ function ra(t) {
|
|
|
1761
1846
|
};
|
|
1762
1847
|
}
|
|
1763
1848
|
function aa(t) {
|
|
1849
|
+
return async (e, r) => await t.selectFrom("user_roles as ur").innerJoin(
|
|
1850
|
+
"roles as r",
|
|
1851
|
+
(n) => n.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
1852
|
+
).select([
|
|
1853
|
+
"r.id",
|
|
1854
|
+
"r.name",
|
|
1855
|
+
"r.description",
|
|
1856
|
+
"r.created_at",
|
|
1857
|
+
"r.updated_at"
|
|
1858
|
+
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", r).execute();
|
|
1859
|
+
}
|
|
1860
|
+
function na(t) {
|
|
1861
|
+
return async (e, r, a) => {
|
|
1862
|
+
if (a.length === 0) return !0;
|
|
1863
|
+
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1864
|
+
try {
|
|
1865
|
+
for (const o of a)
|
|
1866
|
+
try {
|
|
1867
|
+
await t.insertInto("user_roles").values({ tenant_id: e, user_id: r, role_id: o, created_at: n }).execute();
|
|
1868
|
+
} catch (s) {
|
|
1869
|
+
if (s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1870
|
+
continue;
|
|
1871
|
+
throw s;
|
|
1872
|
+
}
|
|
1873
|
+
return !0;
|
|
1874
|
+
} catch (o) {
|
|
1875
|
+
return console.error("Error assigning user roles:", o), !1;
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
}
|
|
1879
|
+
function oa(t) {
|
|
1880
|
+
return async (e, r, a) => {
|
|
1881
|
+
try {
|
|
1882
|
+
return a.length && await t.deleteFrom("user_roles").where("tenant_id", "=", e).where("user_id", "=", r).where((n) => n("role_id", "in", a)).execute(), !0;
|
|
1883
|
+
} catch (n) {
|
|
1884
|
+
return console.error("Error removing user roles:", n), !1;
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
function sa(t) {
|
|
1889
|
+
return {
|
|
1890
|
+
list: aa(t),
|
|
1891
|
+
assign: na(t),
|
|
1892
|
+
remove: oa(t)
|
|
1893
|
+
};
|
|
1894
|
+
}
|
|
1895
|
+
function ia(t) {
|
|
1764
1896
|
return t[t.length - 1];
|
|
1765
1897
|
}
|
|
1766
|
-
function
|
|
1898
|
+
function C(t) {
|
|
1767
1899
|
return Object.freeze(t);
|
|
1768
1900
|
}
|
|
1769
|
-
const
|
|
1901
|
+
const W = C({
|
|
1770
1902
|
is(t) {
|
|
1771
1903
|
return t.kind === "IdentifierNode";
|
|
1772
1904
|
},
|
|
1773
1905
|
create(t) {
|
|
1774
|
-
return
|
|
1906
|
+
return C({
|
|
1775
1907
|
kind: "IdentifierNode",
|
|
1776
1908
|
name: t
|
|
1777
1909
|
});
|
|
1778
1910
|
}
|
|
1779
|
-
}),
|
|
1911
|
+
}), re = C({
|
|
1780
1912
|
is(t) {
|
|
1781
1913
|
return t.kind === "SchemableIdentifierNode";
|
|
1782
1914
|
},
|
|
1783
1915
|
create(t) {
|
|
1784
|
-
return
|
|
1916
|
+
return C({
|
|
1785
1917
|
kind: "SchemableIdentifierNode",
|
|
1786
|
-
identifier:
|
|
1918
|
+
identifier: W.create(t)
|
|
1787
1919
|
});
|
|
1788
1920
|
},
|
|
1789
1921
|
createWithSchema(t, e) {
|
|
1790
|
-
return
|
|
1922
|
+
return C({
|
|
1791
1923
|
kind: "SchemableIdentifierNode",
|
|
1792
|
-
schema:
|
|
1793
|
-
identifier:
|
|
1924
|
+
schema: W.create(t),
|
|
1925
|
+
identifier: W.create(e)
|
|
1794
1926
|
});
|
|
1795
1927
|
}
|
|
1796
|
-
}),
|
|
1928
|
+
}), la = C({
|
|
1797
1929
|
is(t) {
|
|
1798
1930
|
return t.kind === "AliasNode";
|
|
1799
1931
|
},
|
|
1800
1932
|
create(t, e) {
|
|
1801
|
-
return
|
|
1933
|
+
return C({
|
|
1802
1934
|
kind: "AliasNode",
|
|
1803
1935
|
node: t,
|
|
1804
1936
|
alias: e
|
|
1805
1937
|
});
|
|
1806
1938
|
}
|
|
1807
|
-
}),
|
|
1939
|
+
}), X = C({
|
|
1808
1940
|
is(t) {
|
|
1809
1941
|
return t.kind === "TableNode";
|
|
1810
1942
|
},
|
|
1811
1943
|
create(t) {
|
|
1812
|
-
return
|
|
1944
|
+
return C({
|
|
1813
1945
|
kind: "TableNode",
|
|
1814
|
-
table:
|
|
1946
|
+
table: re.create(t)
|
|
1815
1947
|
});
|
|
1816
1948
|
},
|
|
1817
1949
|
createWithSchema(t, e) {
|
|
1818
|
-
return
|
|
1950
|
+
return C({
|
|
1819
1951
|
kind: "TableNode",
|
|
1820
|
-
table:
|
|
1952
|
+
table: re.createWithSchema(t, e)
|
|
1821
1953
|
});
|
|
1822
1954
|
}
|
|
1823
1955
|
});
|
|
1824
|
-
var
|
|
1825
|
-
class
|
|
1956
|
+
var H;
|
|
1957
|
+
class ca {
|
|
1826
1958
|
constructor() {
|
|
1827
|
-
|
|
1828
|
-
|
|
1959
|
+
R(this, "nodeStack", []);
|
|
1960
|
+
S(this, H, C({
|
|
1829
1961
|
AliasNode: this.transformAlias.bind(this),
|
|
1830
1962
|
ColumnNode: this.transformColumn.bind(this),
|
|
1831
1963
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -1926,13 +2058,13 @@ class oa {
|
|
|
1926
2058
|
return e;
|
|
1927
2059
|
this.nodeStack.push(e);
|
|
1928
2060
|
const r = this.transformNodeImpl(e);
|
|
1929
|
-
return this.nodeStack.pop(),
|
|
2061
|
+
return this.nodeStack.pop(), C(r);
|
|
1930
2062
|
}
|
|
1931
2063
|
transformNodeImpl(e) {
|
|
1932
|
-
return d(this,
|
|
2064
|
+
return d(this, H)[e.kind](e);
|
|
1933
2065
|
}
|
|
1934
2066
|
transformNodeList(e) {
|
|
1935
|
-
return e &&
|
|
2067
|
+
return e && C(e.map((r) => this.transformNode(r)));
|
|
1936
2068
|
}
|
|
1937
2069
|
transformSelectQuery(e) {
|
|
1938
2070
|
return {
|
|
@@ -2031,7 +2163,7 @@ class oa {
|
|
|
2031
2163
|
transformRaw(e) {
|
|
2032
2164
|
return {
|
|
2033
2165
|
kind: "RawNode",
|
|
2034
|
-
sqlFragments:
|
|
2166
|
+
sqlFragments: C([...e.sqlFragments]),
|
|
2035
2167
|
parameters: this.transformNodeList(e.parameters)
|
|
2036
2168
|
};
|
|
2037
2169
|
}
|
|
@@ -2655,8 +2787,8 @@ class oa {
|
|
|
2655
2787
|
return e;
|
|
2656
2788
|
}
|
|
2657
2789
|
}
|
|
2658
|
-
|
|
2659
|
-
const
|
|
2790
|
+
H = new WeakMap();
|
|
2791
|
+
const da = C({
|
|
2660
2792
|
AlterTableNode: !0,
|
|
2661
2793
|
CreateIndexNode: !0,
|
|
2662
2794
|
CreateSchemaNode: !0,
|
|
@@ -2675,88 +2807,88 @@ const sa = y({
|
|
|
2675
2807
|
UpdateQueryNode: !0,
|
|
2676
2808
|
MergeQueryNode: !0
|
|
2677
2809
|
});
|
|
2678
|
-
var
|
|
2679
|
-
class
|
|
2810
|
+
var E, j, F, N, ye, ve, Ne, A, ae, Ce;
|
|
2811
|
+
class ua extends ca {
|
|
2680
2812
|
constructor(r) {
|
|
2681
2813
|
super();
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2814
|
+
S(this, N);
|
|
2815
|
+
S(this, E);
|
|
2816
|
+
S(this, j, /* @__PURE__ */ new Set());
|
|
2817
|
+
S(this, F, /* @__PURE__ */ new Set());
|
|
2818
|
+
K(this, E, r);
|
|
2687
2819
|
}
|
|
2688
2820
|
transformNodeImpl(r) {
|
|
2689
|
-
if (!
|
|
2821
|
+
if (!p(this, N, ye).call(this, r))
|
|
2690
2822
|
return super.transformNodeImpl(r);
|
|
2691
|
-
const a =
|
|
2823
|
+
const a = p(this, N, Ne).call(this, r);
|
|
2692
2824
|
for (const s of a)
|
|
2693
|
-
d(this,
|
|
2694
|
-
const
|
|
2695
|
-
for (const s of
|
|
2696
|
-
d(this,
|
|
2697
|
-
const
|
|
2698
|
-
for (const s of
|
|
2699
|
-
d(this,
|
|
2825
|
+
d(this, F).add(s);
|
|
2826
|
+
const n = p(this, N, ve).call(this, r);
|
|
2827
|
+
for (const s of n)
|
|
2828
|
+
d(this, j).add(s);
|
|
2829
|
+
const o = super.transformNodeImpl(r);
|
|
2830
|
+
for (const s of n)
|
|
2831
|
+
d(this, j).delete(s);
|
|
2700
2832
|
for (const s of a)
|
|
2701
|
-
d(this,
|
|
2702
|
-
return
|
|
2833
|
+
d(this, F).delete(s);
|
|
2834
|
+
return o;
|
|
2703
2835
|
}
|
|
2704
2836
|
transformSchemableIdentifier(r) {
|
|
2705
2837
|
const a = super.transformSchemableIdentifier(r);
|
|
2706
|
-
return a.schema || !d(this,
|
|
2838
|
+
return a.schema || !d(this, j).has(r.identifier.name) ? a : {
|
|
2707
2839
|
...a,
|
|
2708
|
-
schema:
|
|
2840
|
+
schema: W.create(d(this, E))
|
|
2709
2841
|
};
|
|
2710
2842
|
}
|
|
2711
2843
|
transformReferences(r) {
|
|
2712
2844
|
const a = super.transformReferences(r);
|
|
2713
2845
|
return a.table.table.schema ? a : {
|
|
2714
2846
|
...a,
|
|
2715
|
-
table:
|
|
2847
|
+
table: X.createWithSchema(d(this, E), a.table.table.identifier.name)
|
|
2716
2848
|
};
|
|
2717
2849
|
}
|
|
2718
2850
|
}
|
|
2719
|
-
|
|
2720
|
-
return r.kind in
|
|
2851
|
+
E = new WeakMap(), j = new WeakMap(), F = new WeakMap(), N = new WeakSet(), ye = function(r) {
|
|
2852
|
+
return r.kind in da;
|
|
2721
2853
|
}, ve = function(r) {
|
|
2722
2854
|
const a = /* @__PURE__ */ new Set();
|
|
2723
|
-
if ("name" in r && r.name &&
|
|
2724
|
-
for (const
|
|
2725
|
-
|
|
2726
|
-
if ("into" in r && r.into &&
|
|
2727
|
-
for (const
|
|
2728
|
-
|
|
2729
|
-
return "using" in r && r.using &&
|
|
2855
|
+
if ("name" in r && r.name && re.is(r.name) && p(this, N, ae).call(this, r.name, a), "from" in r && r.from)
|
|
2856
|
+
for (const n of r.from.froms)
|
|
2857
|
+
p(this, N, A).call(this, n, a);
|
|
2858
|
+
if ("into" in r && r.into && p(this, N, A).call(this, r.into, a), "table" in r && r.table && p(this, N, A).call(this, r.table, a), "joins" in r && r.joins)
|
|
2859
|
+
for (const n of r.joins)
|
|
2860
|
+
p(this, N, A).call(this, n.table, a);
|
|
2861
|
+
return "using" in r && r.using && p(this, N, A).call(this, r.using, a), a;
|
|
2730
2862
|
}, Ne = function(r) {
|
|
2731
2863
|
const a = /* @__PURE__ */ new Set();
|
|
2732
|
-
return "with" in r && r.with &&
|
|
2733
|
-
},
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
},
|
|
2737
|
-
const
|
|
2738
|
-
!d(this,
|
|
2864
|
+
return "with" in r && r.with && p(this, N, Ce).call(this, r.with, a), a;
|
|
2865
|
+
}, A = function(r, a) {
|
|
2866
|
+
const n = X.is(r) ? r : la.is(r) && X.is(r.node) ? r.node : null;
|
|
2867
|
+
n && p(this, N, ae).call(this, n.table, a);
|
|
2868
|
+
}, ae = function(r, a) {
|
|
2869
|
+
const n = r.identifier.name;
|
|
2870
|
+
!d(this, j).has(n) && !d(this, F).has(n) && a.add(n);
|
|
2739
2871
|
}, Ce = function(r, a) {
|
|
2740
|
-
for (const
|
|
2741
|
-
const
|
|
2742
|
-
d(this,
|
|
2872
|
+
for (const n of r.expressions) {
|
|
2873
|
+
const o = n.name.table.table.identifier.name;
|
|
2874
|
+
d(this, F).has(o) || a.add(o);
|
|
2743
2875
|
}
|
|
2744
2876
|
};
|
|
2745
|
-
var
|
|
2746
|
-
class
|
|
2877
|
+
var Q;
|
|
2878
|
+
class ma {
|
|
2747
2879
|
constructor(e) {
|
|
2748
|
-
|
|
2749
|
-
|
|
2880
|
+
S(this, Q);
|
|
2881
|
+
K(this, Q, new ua(e));
|
|
2750
2882
|
}
|
|
2751
2883
|
transformQuery(e) {
|
|
2752
|
-
return d(this,
|
|
2884
|
+
return d(this, Q).transformNode(e.node);
|
|
2753
2885
|
}
|
|
2754
2886
|
async transformResult(e) {
|
|
2755
2887
|
return e.result;
|
|
2756
2888
|
}
|
|
2757
2889
|
}
|
|
2758
|
-
|
|
2759
|
-
class
|
|
2890
|
+
Q = new WeakMap();
|
|
2891
|
+
class _a {
|
|
2760
2892
|
transformQuery(e) {
|
|
2761
2893
|
return e.node;
|
|
2762
2894
|
}
|
|
@@ -2764,13 +2896,13 @@ class ca {
|
|
|
2764
2896
|
return e.result;
|
|
2765
2897
|
}
|
|
2766
2898
|
}
|
|
2767
|
-
const
|
|
2768
|
-
var
|
|
2899
|
+
const ha = "kysely_migration", fe = "kysely_migration_lock", fa = !1, Z = "migration_lock", pa = C({ __noMigrations__: !0 });
|
|
2900
|
+
var v, l, U, k, $, z, xe, I, Te, Se, Oe, ke, $e, ne, L, oe, Ie, De, Pe, se, je, Fe, Me, Ae, ze, B;
|
|
2769
2901
|
class be {
|
|
2770
2902
|
constructor(e) {
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2903
|
+
S(this, l);
|
|
2904
|
+
S(this, v);
|
|
2905
|
+
K(this, v, C(e));
|
|
2774
2906
|
}
|
|
2775
2907
|
/**
|
|
2776
2908
|
* Returns a {@link MigrationInfo} object for each migration.
|
|
@@ -2778,13 +2910,13 @@ class be {
|
|
|
2778
2910
|
* The returned array is sorted by migration name.
|
|
2779
2911
|
*/
|
|
2780
2912
|
async getMigrations() {
|
|
2781
|
-
const e = await
|
|
2782
|
-
return (await
|
|
2783
|
-
const
|
|
2913
|
+
const e = await p(this, l, L).call(this, d(this, l, $)) ? await d(this, v).db.withPlugin(d(this, l, I)).selectFrom(d(this, l, $)).select(["name", "timestamp"]).execute() : [];
|
|
2914
|
+
return (await p(this, l, se).call(this)).map(({ name: a, ...n }) => {
|
|
2915
|
+
const o = e.find((s) => s.name === a);
|
|
2784
2916
|
return {
|
|
2785
2917
|
name: a,
|
|
2786
|
-
migration:
|
|
2787
|
-
executedAt:
|
|
2918
|
+
migration: n,
|
|
2919
|
+
executedAt: o ? new Date(o.timestamp) : void 0
|
|
2788
2920
|
};
|
|
2789
2921
|
});
|
|
2790
2922
|
}
|
|
@@ -2836,7 +2968,7 @@ class be {
|
|
|
2836
2968
|
* ```
|
|
2837
2969
|
*/
|
|
2838
2970
|
async migrateToLatest() {
|
|
2839
|
-
return
|
|
2971
|
+
return p(this, l, U).call(this, () => ({ direction: "Up", step: 1 / 0 }));
|
|
2840
2972
|
}
|
|
2841
2973
|
/**
|
|
2842
2974
|
* Migrate up/down to a specific migration.
|
|
@@ -2862,16 +2994,16 @@ class be {
|
|
|
2862
2994
|
* ```
|
|
2863
2995
|
*/
|
|
2864
2996
|
async migrateTo(e) {
|
|
2865
|
-
return
|
|
2866
|
-
if (e ===
|
|
2997
|
+
return p(this, l, U).call(this, ({ migrations: r, executedMigrations: a, pendingMigrations: n }) => {
|
|
2998
|
+
if (e === pa)
|
|
2867
2999
|
return { direction: "Down", step: 1 / 0 };
|
|
2868
|
-
if (!r.find((
|
|
3000
|
+
if (!r.find((i) => i.name === e))
|
|
2869
3001
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
2870
|
-
const
|
|
2871
|
-
if (
|
|
3002
|
+
const o = a.indexOf(e), s = n.findIndex((i) => i.name === e);
|
|
3003
|
+
if (o !== -1)
|
|
2872
3004
|
return {
|
|
2873
3005
|
direction: "Down",
|
|
2874
|
-
step: a.length -
|
|
3006
|
+
step: a.length - o - 1
|
|
2875
3007
|
};
|
|
2876
3008
|
if (s !== -1)
|
|
2877
3009
|
return { direction: "Up", step: s + 1 };
|
|
@@ -2893,7 +3025,7 @@ class be {
|
|
|
2893
3025
|
* ```
|
|
2894
3026
|
*/
|
|
2895
3027
|
async migrateUp() {
|
|
2896
|
-
return
|
|
3028
|
+
return p(this, l, U).call(this, () => ({ direction: "Up", step: 1 }));
|
|
2897
3029
|
}
|
|
2898
3030
|
/**
|
|
2899
3031
|
* Migrate one step down.
|
|
@@ -2910,194 +3042,194 @@ class be {
|
|
|
2910
3042
|
* ```
|
|
2911
3043
|
*/
|
|
2912
3044
|
async migrateDown() {
|
|
2913
|
-
return
|
|
3045
|
+
return p(this, l, U).call(this, () => ({ direction: "Down", step: 1 }));
|
|
2914
3046
|
}
|
|
2915
3047
|
}
|
|
2916
|
-
|
|
3048
|
+
v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
2917
3049
|
try {
|
|
2918
|
-
return await
|
|
3050
|
+
return await p(this, l, Te).call(this), await p(this, l, Ie).call(this, e);
|
|
2919
3051
|
} catch (r) {
|
|
2920
|
-
return r instanceof
|
|
2921
|
-
}
|
|
2922
|
-
},
|
|
2923
|
-
return d(this,
|
|
2924
|
-
},
|
|
2925
|
-
return d(this,
|
|
2926
|
-
},
|
|
2927
|
-
return d(this,
|
|
3052
|
+
return r instanceof ee ? r.resultSet : { error: r };
|
|
3053
|
+
}
|
|
3054
|
+
}, k = function() {
|
|
3055
|
+
return d(this, v).migrationTableSchema;
|
|
3056
|
+
}, $ = function() {
|
|
3057
|
+
return d(this, v).migrationTableName ?? ha;
|
|
3058
|
+
}, z = function() {
|
|
3059
|
+
return d(this, v).migrationLockTableName ?? fe;
|
|
2928
3060
|
}, xe = function() {
|
|
2929
|
-
return d(this,
|
|
2930
|
-
},
|
|
2931
|
-
return d(this,
|
|
3061
|
+
return d(this, v).allowUnorderedMigrations ?? fa;
|
|
3062
|
+
}, I = function() {
|
|
3063
|
+
return d(this, l, k) ? new ma(d(this, l, k)) : new _a();
|
|
2932
3064
|
}, Te = async function() {
|
|
2933
|
-
await
|
|
3065
|
+
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);
|
|
2934
3066
|
}, Se = async function() {
|
|
2935
|
-
if (d(this,
|
|
3067
|
+
if (d(this, l, k) && !await p(this, l, ne).call(this))
|
|
2936
3068
|
try {
|
|
2937
|
-
await
|
|
3069
|
+
await p(this, l, B).call(this, d(this, v).db.schema.createSchema(d(this, l, k)));
|
|
2938
3070
|
} catch (e) {
|
|
2939
|
-
if (!await
|
|
3071
|
+
if (!await p(this, l, ne).call(this))
|
|
2940
3072
|
throw e;
|
|
2941
3073
|
}
|
|
2942
3074
|
}, Oe = async function() {
|
|
2943
|
-
if (!await
|
|
3075
|
+
if (!await p(this, l, L).call(this, d(this, l, $)))
|
|
2944
3076
|
try {
|
|
2945
|
-
d(this,
|
|
3077
|
+
d(this, l, k) && await p(this, l, B).call(this, d(this, v).db.schema.createSchema(d(this, l, k))), await p(this, l, B).call(this, d(this, v).db.schema.withPlugin(d(this, l, I)).createTable(d(this, l, $)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2946
3078
|
} catch (e) {
|
|
2947
|
-
if (!await
|
|
3079
|
+
if (!await p(this, l, L).call(this, d(this, l, $)))
|
|
2948
3080
|
throw e;
|
|
2949
3081
|
}
|
|
2950
3082
|
}, ke = async function() {
|
|
2951
|
-
if (!await
|
|
3083
|
+
if (!await p(this, l, L).call(this, d(this, l, z)))
|
|
2952
3084
|
try {
|
|
2953
|
-
await
|
|
3085
|
+
await p(this, l, B).call(this, d(this, v).db.schema.withPlugin(d(this, l, I)).createTable(d(this, l, z)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2954
3086
|
} catch (e) {
|
|
2955
|
-
if (!await
|
|
3087
|
+
if (!await p(this, l, L).call(this, d(this, l, z)))
|
|
2956
3088
|
throw e;
|
|
2957
3089
|
}
|
|
2958
3090
|
}, $e = async function() {
|
|
2959
|
-
if (!await
|
|
3091
|
+
if (!await p(this, l, oe).call(this))
|
|
2960
3092
|
try {
|
|
2961
|
-
await d(this,
|
|
3093
|
+
await d(this, v).db.withPlugin(d(this, l, I)).insertInto(d(this, l, z)).values({ id: Z, is_locked: 0 }).execute();
|
|
2962
3094
|
} catch (e) {
|
|
2963
|
-
if (!await
|
|
3095
|
+
if (!await p(this, l, oe).call(this))
|
|
2964
3096
|
throw e;
|
|
2965
3097
|
}
|
|
2966
|
-
},
|
|
2967
|
-
return (await d(this,
|
|
2968
|
-
},
|
|
2969
|
-
const r = d(this,
|
|
2970
|
-
return (await d(this,
|
|
3098
|
+
}, ne = async function() {
|
|
3099
|
+
return (await d(this, v).db.introspection.getSchemas()).some((r) => r.name === d(this, l, k));
|
|
3100
|
+
}, L = async function(e) {
|
|
3101
|
+
const r = d(this, l, k);
|
|
3102
|
+
return (await d(this, v).db.introspection.getTables({
|
|
2971
3103
|
withInternalKyselyTables: !0
|
|
2972
|
-
})).some((
|
|
2973
|
-
},
|
|
2974
|
-
return !!await d(this,
|
|
3104
|
+
})).some((n) => n.name === e && (!r || n.schema === r));
|
|
3105
|
+
}, oe = async function() {
|
|
3106
|
+
return !!await d(this, v).db.withPlugin(d(this, l, I)).selectFrom(d(this, l, z)).where("id", "=", Z).select("id").executeTakeFirst();
|
|
2975
3107
|
}, Ie = async function(e) {
|
|
2976
|
-
const r = d(this,
|
|
2977
|
-
lockTable: d(this,
|
|
2978
|
-
lockRowId:
|
|
2979
|
-
lockTableSchema: d(this,
|
|
2980
|
-
}),
|
|
3108
|
+
const r = d(this, v).db.getExecutor().adapter, a = C({
|
|
3109
|
+
lockTable: d(this, v).migrationLockTableName ?? fe,
|
|
3110
|
+
lockRowId: Z,
|
|
3111
|
+
lockTableSchema: d(this, v).migrationTableSchema
|
|
3112
|
+
}), n = async (o) => {
|
|
2981
3113
|
try {
|
|
2982
|
-
await r.acquireMigrationLock(
|
|
2983
|
-
const s = await
|
|
3114
|
+
await r.acquireMigrationLock(o, a);
|
|
3115
|
+
const s = await p(this, l, De).call(this, o);
|
|
2984
3116
|
if (s.migrations.length === 0)
|
|
2985
3117
|
return { results: [] };
|
|
2986
|
-
const { direction:
|
|
2987
|
-
return c <= 0 ? { results: [] } :
|
|
3118
|
+
const { direction: i, step: c } = e(s);
|
|
3119
|
+
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l, Ae).call(this, o, s, c) : i === "Up" ? await p(this, l, ze).call(this, o, s, c) : { results: [] };
|
|
2988
3120
|
} finally {
|
|
2989
|
-
await r.releaseMigrationLock(
|
|
3121
|
+
await r.releaseMigrationLock(o, a);
|
|
2990
3122
|
}
|
|
2991
3123
|
};
|
|
2992
|
-
return r.supportsTransactionalDdl ? d(this,
|
|
3124
|
+
return r.supportsTransactionalDdl ? d(this, v).db.transaction().execute(n) : d(this, v).db.connection().execute(n);
|
|
2993
3125
|
}, De = async function(e) {
|
|
2994
|
-
const r = await
|
|
2995
|
-
|
|
2996
|
-
const
|
|
2997
|
-
return
|
|
3126
|
+
const r = await p(this, l, se).call(this), a = await p(this, l, je).call(this, e);
|
|
3127
|
+
p(this, l, Fe).call(this, r, a), d(this, l, xe) || p(this, l, Me).call(this, r, a);
|
|
3128
|
+
const n = p(this, l, Pe).call(this, r, a);
|
|
3129
|
+
return C({
|
|
2998
3130
|
migrations: r,
|
|
2999
3131
|
executedMigrations: a,
|
|
3000
|
-
lastMigration:
|
|
3001
|
-
pendingMigrations:
|
|
3132
|
+
lastMigration: ia(a),
|
|
3133
|
+
pendingMigrations: n
|
|
3002
3134
|
});
|
|
3003
3135
|
}, Pe = function(e, r) {
|
|
3004
3136
|
return e.filter((a) => !r.includes(a.name));
|
|
3005
|
-
},
|
|
3006
|
-
const e = await d(this,
|
|
3137
|
+
}, se = async function() {
|
|
3138
|
+
const e = await d(this, v).provider.getMigrations();
|
|
3007
3139
|
return Object.keys(e).sort().map((r) => ({
|
|
3008
3140
|
...e[r],
|
|
3009
3141
|
name: r
|
|
3010
3142
|
}));
|
|
3011
3143
|
}, je = async function(e) {
|
|
3012
|
-
return (await e.withPlugin(d(this,
|
|
3144
|
+
return (await e.withPlugin(d(this, l, I)).selectFrom(d(this, l, $)).select("name").orderBy(["timestamp", "name"]).execute()).map((a) => a.name);
|
|
3013
3145
|
}, Fe = function(e, r) {
|
|
3014
3146
|
for (const a of r)
|
|
3015
|
-
if (!e.some((
|
|
3147
|
+
if (!e.some((n) => n.name === a))
|
|
3016
3148
|
throw new Error(`corrupted migrations: previously executed migration ${a} is missing`);
|
|
3017
3149
|
}, Me = function(e, r) {
|
|
3018
3150
|
for (let a = 0; a < r.length; ++a)
|
|
3019
3151
|
if (e[a].name !== r[a])
|
|
3020
3152
|
throw new Error(`corrupted migrations: expected previously executed migration ${r[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
3021
3153
|
}, Ae = async function(e, r, a) {
|
|
3022
|
-
const
|
|
3154
|
+
const n = r.executedMigrations.slice().reverse().slice(0, a).map((s) => r.migrations.find((i) => i.name === s)), o = n.map((s) => ({
|
|
3023
3155
|
migrationName: s.name,
|
|
3024
3156
|
direction: "Down",
|
|
3025
3157
|
status: "NotExecuted"
|
|
3026
3158
|
}));
|
|
3027
|
-
for (let s = 0; s <
|
|
3028
|
-
const
|
|
3159
|
+
for (let s = 0; s < o.length; ++s) {
|
|
3160
|
+
const i = n[s];
|
|
3029
3161
|
try {
|
|
3030
|
-
|
|
3031
|
-
migrationName:
|
|
3162
|
+
i.down && (await i.down(e), await e.withPlugin(d(this, l, I)).deleteFrom(d(this, l, $)).where("name", "=", i.name).execute(), o[s] = {
|
|
3163
|
+
migrationName: i.name,
|
|
3032
3164
|
direction: "Down",
|
|
3033
3165
|
status: "Success"
|
|
3034
3166
|
});
|
|
3035
3167
|
} catch (c) {
|
|
3036
|
-
throw
|
|
3037
|
-
migrationName:
|
|
3168
|
+
throw o[s] = {
|
|
3169
|
+
migrationName: i.name,
|
|
3038
3170
|
direction: "Down",
|
|
3039
3171
|
status: "Error"
|
|
3040
|
-
}, new
|
|
3172
|
+
}, new ee({
|
|
3041
3173
|
error: c,
|
|
3042
|
-
results:
|
|
3174
|
+
results: o
|
|
3043
3175
|
});
|
|
3044
3176
|
}
|
|
3045
3177
|
}
|
|
3046
|
-
return { results:
|
|
3178
|
+
return { results: o };
|
|
3047
3179
|
}, ze = async function(e, r, a) {
|
|
3048
|
-
const
|
|
3180
|
+
const o = r.pendingMigrations.slice(0, a).map((s) => ({
|
|
3049
3181
|
migrationName: s.name,
|
|
3050
3182
|
direction: "Up",
|
|
3051
3183
|
status: "NotExecuted"
|
|
3052
3184
|
}));
|
|
3053
|
-
for (let s = 0; s <
|
|
3054
|
-
const
|
|
3185
|
+
for (let s = 0; s < o.length; s++) {
|
|
3186
|
+
const i = r.pendingMigrations[s];
|
|
3055
3187
|
try {
|
|
3056
|
-
await
|
|
3057
|
-
name:
|
|
3188
|
+
await i.up(e), await e.withPlugin(d(this, l, I)).insertInto(d(this, l, $)).values({
|
|
3189
|
+
name: i.name,
|
|
3058
3190
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3059
|
-
}).execute(),
|
|
3060
|
-
migrationName:
|
|
3191
|
+
}).execute(), o[s] = {
|
|
3192
|
+
migrationName: i.name,
|
|
3061
3193
|
direction: "Up",
|
|
3062
3194
|
status: "Success"
|
|
3063
3195
|
};
|
|
3064
3196
|
} catch (c) {
|
|
3065
|
-
throw
|
|
3066
|
-
migrationName:
|
|
3197
|
+
throw o[s] = {
|
|
3198
|
+
migrationName: i.name,
|
|
3067
3199
|
direction: "Up",
|
|
3068
3200
|
status: "Error"
|
|
3069
|
-
}, new
|
|
3201
|
+
}, new ee({
|
|
3070
3202
|
error: c,
|
|
3071
|
-
results:
|
|
3203
|
+
results: o
|
|
3072
3204
|
});
|
|
3073
3205
|
}
|
|
3074
3206
|
}
|
|
3075
|
-
return { results:
|
|
3076
|
-
},
|
|
3077
|
-
d(this,
|
|
3207
|
+
return { results: o };
|
|
3208
|
+
}, B = async function(e) {
|
|
3209
|
+
d(this, v).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
3078
3210
|
};
|
|
3079
|
-
var
|
|
3080
|
-
class
|
|
3211
|
+
var q;
|
|
3212
|
+
class ee extends Error {
|
|
3081
3213
|
constructor(r) {
|
|
3082
3214
|
super();
|
|
3083
|
-
|
|
3084
|
-
|
|
3215
|
+
S(this, q);
|
|
3216
|
+
K(this, q, r);
|
|
3085
3217
|
}
|
|
3086
3218
|
get resultSet() {
|
|
3087
|
-
return d(this,
|
|
3219
|
+
return d(this, q);
|
|
3088
3220
|
}
|
|
3089
3221
|
}
|
|
3090
|
-
|
|
3222
|
+
q = new WeakMap();
|
|
3091
3223
|
class Le {
|
|
3092
3224
|
constructor(e) {
|
|
3093
|
-
|
|
3225
|
+
R(this, "migrations");
|
|
3094
3226
|
this.migrations = e;
|
|
3095
3227
|
}
|
|
3096
3228
|
async getMigrations() {
|
|
3097
3229
|
return this.migrations;
|
|
3098
3230
|
}
|
|
3099
3231
|
}
|
|
3100
|
-
async function
|
|
3232
|
+
async function ga(t) {
|
|
3101
3233
|
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(
|
|
3102
3234
|
"tenant_id",
|
|
3103
3235
|
"varchar(255)",
|
|
@@ -3169,35 +3301,35 @@ async function _a(t) {
|
|
|
3169
3301
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3170
3302
|
).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();
|
|
3171
3303
|
}
|
|
3172
|
-
async function
|
|
3304
|
+
async function wa(t) {
|
|
3173
3305
|
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();
|
|
3174
3306
|
}
|
|
3175
|
-
const
|
|
3307
|
+
const ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3176
3308
|
__proto__: null,
|
|
3177
|
-
down:
|
|
3178
|
-
up:
|
|
3309
|
+
down: wa,
|
|
3310
|
+
up: ga
|
|
3179
3311
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3180
|
-
async function
|
|
3312
|
+
async function va(t) {
|
|
3181
3313
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
3182
3314
|
}
|
|
3183
|
-
async function
|
|
3315
|
+
async function Na(t) {
|
|
3184
3316
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
3185
3317
|
}
|
|
3186
|
-
const
|
|
3318
|
+
const Ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3187
3319
|
__proto__: null,
|
|
3188
|
-
down:
|
|
3189
|
-
up:
|
|
3320
|
+
down: Na,
|
|
3321
|
+
up: va
|
|
3190
3322
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3191
|
-
async function
|
|
3323
|
+
async function ba(t) {
|
|
3192
3324
|
}
|
|
3193
|
-
async function
|
|
3325
|
+
async function xa(t) {
|
|
3194
3326
|
}
|
|
3195
|
-
const
|
|
3327
|
+
const Ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3196
3328
|
__proto__: null,
|
|
3197
|
-
down:
|
|
3198
|
-
up:
|
|
3329
|
+
down: xa,
|
|
3330
|
+
up: ba
|
|
3199
3331
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3200
|
-
async function
|
|
3332
|
+
async function Sa(t) {
|
|
3201
3333
|
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(
|
|
3202
3334
|
"tenant_id_constraint",
|
|
3203
3335
|
["tenant_id"],
|
|
@@ -3206,24 +3338,24 @@ async function Ca(t) {
|
|
|
3206
3338
|
(e) => e.onDelete("cascade")
|
|
3207
3339
|
).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();
|
|
3208
3340
|
}
|
|
3209
|
-
async function
|
|
3341
|
+
async function Oa(t) {
|
|
3210
3342
|
await t.schema.dropTable("logs").execute();
|
|
3211
3343
|
}
|
|
3212
|
-
const
|
|
3344
|
+
const ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3213
3345
|
__proto__: null,
|
|
3214
|
-
down:
|
|
3215
|
-
up:
|
|
3346
|
+
down: Oa,
|
|
3347
|
+
up: Sa
|
|
3216
3348
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3217
|
-
async function
|
|
3349
|
+
async function $a(t) {
|
|
3218
3350
|
}
|
|
3219
|
-
async function
|
|
3351
|
+
async function Ia(t) {
|
|
3220
3352
|
}
|
|
3221
|
-
const
|
|
3353
|
+
const Da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3222
3354
|
__proto__: null,
|
|
3223
|
-
down:
|
|
3224
|
-
up:
|
|
3355
|
+
down: Ia,
|
|
3356
|
+
up: $a
|
|
3225
3357
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3226
|
-
async function
|
|
3358
|
+
async function Pa(t) {
|
|
3227
3359
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3228
3360
|
"user_id_constraint",
|
|
3229
3361
|
["user_id", "tenant_id"],
|
|
@@ -3248,15 +3380,15 @@ async function ka(t) {
|
|
|
3248
3380
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3249
3381
|
).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();
|
|
3250
3382
|
}
|
|
3251
|
-
async function
|
|
3383
|
+
async function ja(t) {
|
|
3252
3384
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
3253
3385
|
}
|
|
3254
|
-
const
|
|
3386
|
+
const Fa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3255
3387
|
__proto__: null,
|
|
3256
|
-
down:
|
|
3257
|
-
up:
|
|
3388
|
+
down: ja,
|
|
3389
|
+
up: Pa
|
|
3258
3390
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3259
|
-
async function
|
|
3391
|
+
async function Ma(t) {
|
|
3260
3392
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
3261
3393
|
"user_id_constraint",
|
|
3262
3394
|
["user_id", "tenant_id"],
|
|
@@ -3271,24 +3403,24 @@ async function Da(t) {
|
|
|
3271
3403
|
(e) => e.onDelete("cascade")
|
|
3272
3404
|
).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();
|
|
3273
3405
|
}
|
|
3274
|
-
async function
|
|
3406
|
+
async function Aa(t) {
|
|
3275
3407
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3276
3408
|
}
|
|
3277
|
-
const
|
|
3409
|
+
const za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3278
3410
|
__proto__: null,
|
|
3279
|
-
down:
|
|
3280
|
-
up:
|
|
3411
|
+
down: Aa,
|
|
3412
|
+
up: Ma
|
|
3281
3413
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3282
|
-
async function
|
|
3414
|
+
async function La(t) {
|
|
3283
3415
|
}
|
|
3284
|
-
async function
|
|
3416
|
+
async function Ea(t) {
|
|
3285
3417
|
}
|
|
3286
|
-
const
|
|
3418
|
+
const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3287
3419
|
__proto__: null,
|
|
3288
|
-
down:
|
|
3289
|
-
up:
|
|
3420
|
+
down: Ea,
|
|
3421
|
+
up: La
|
|
3290
3422
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3291
|
-
async function
|
|
3423
|
+
async function Ra(t) {
|
|
3292
3424
|
await t.schema.alterTable("passwords").addColumn(
|
|
3293
3425
|
"password",
|
|
3294
3426
|
"varchar(255)",
|
|
@@ -3296,288 +3428,296 @@ async function za(t) {
|
|
|
3296
3428
|
(e) => e.notNull()
|
|
3297
3429
|
).execute();
|
|
3298
3430
|
}
|
|
3299
|
-
async function
|
|
3431
|
+
async function Ka(t) {
|
|
3300
3432
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3301
3433
|
}
|
|
3302
|
-
const
|
|
3434
|
+
const Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3303
3435
|
__proto__: null,
|
|
3304
|
-
down:
|
|
3305
|
-
up:
|
|
3436
|
+
down: Ka,
|
|
3437
|
+
up: Ra
|
|
3306
3438
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3307
|
-
async function
|
|
3439
|
+
async function Ba(t) {
|
|
3308
3440
|
}
|
|
3309
|
-
async function
|
|
3441
|
+
async function Qa(t) {
|
|
3310
3442
|
}
|
|
3311
|
-
const
|
|
3443
|
+
const qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3312
3444
|
__proto__: null,
|
|
3313
|
-
down:
|
|
3314
|
-
up:
|
|
3445
|
+
down: Qa,
|
|
3446
|
+
up: Ba
|
|
3315
3447
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3316
|
-
async function
|
|
3448
|
+
async function Va(t) {
|
|
3317
3449
|
}
|
|
3318
|
-
async function
|
|
3450
|
+
async function Wa(t) {
|
|
3319
3451
|
}
|
|
3320
|
-
const
|
|
3452
|
+
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3321
3453
|
__proto__: null,
|
|
3322
|
-
down:
|
|
3323
|
-
up:
|
|
3454
|
+
down: Wa,
|
|
3455
|
+
up: Va
|
|
3324
3456
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3325
|
-
async function
|
|
3457
|
+
async function Ha(t) {
|
|
3326
3458
|
}
|
|
3327
|
-
async function
|
|
3459
|
+
async function Ya(t) {
|
|
3328
3460
|
}
|
|
3329
|
-
const
|
|
3461
|
+
const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3330
3462
|
__proto__: null,
|
|
3331
|
-
down:
|
|
3332
|
-
up:
|
|
3463
|
+
down: Ya,
|
|
3464
|
+
up: Ha
|
|
3333
3465
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3334
|
-
async function
|
|
3466
|
+
async function Za(t) {
|
|
3335
3467
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3336
3468
|
}
|
|
3337
|
-
async function
|
|
3469
|
+
async function en(t) {
|
|
3338
3470
|
await t.schema.dropIndex("users_email_index").execute();
|
|
3339
3471
|
}
|
|
3340
|
-
const
|
|
3472
|
+
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3341
3473
|
__proto__: null,
|
|
3342
|
-
down:
|
|
3343
|
-
up:
|
|
3474
|
+
down: en,
|
|
3475
|
+
up: Za
|
|
3344
3476
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3345
|
-
async function
|
|
3477
|
+
async function rn(t) {
|
|
3346
3478
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3347
3479
|
}
|
|
3348
|
-
async function
|
|
3480
|
+
async function an(t) {
|
|
3349
3481
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3350
3482
|
}
|
|
3351
|
-
const
|
|
3483
|
+
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3352
3484
|
__proto__: null,
|
|
3353
|
-
down:
|
|
3354
|
-
up:
|
|
3485
|
+
down: an,
|
|
3486
|
+
up: rn
|
|
3355
3487
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3356
|
-
async function
|
|
3488
|
+
async function on(t) {
|
|
3357
3489
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3358
3490
|
}
|
|
3359
|
-
async function
|
|
3491
|
+
async function sn(t) {
|
|
3360
3492
|
await t.schema.dropIndex("users_linked_to_index");
|
|
3361
3493
|
}
|
|
3362
|
-
const
|
|
3494
|
+
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3363
3495
|
__proto__: null,
|
|
3364
|
-
down:
|
|
3365
|
-
up:
|
|
3496
|
+
down: sn,
|
|
3497
|
+
up: on
|
|
3366
3498
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3367
|
-
async function
|
|
3499
|
+
async function cn(t) {
|
|
3368
3500
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3369
3501
|
}
|
|
3370
|
-
async function
|
|
3502
|
+
async function dn(t) {
|
|
3371
3503
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3372
3504
|
}
|
|
3373
|
-
const
|
|
3505
|
+
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3374
3506
|
__proto__: null,
|
|
3375
|
-
down:
|
|
3376
|
-
up:
|
|
3507
|
+
down: dn,
|
|
3508
|
+
up: cn
|
|
3377
3509
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3378
|
-
async function
|
|
3510
|
+
async function mn(t) {
|
|
3379
3511
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3380
3512
|
"tenant_id",
|
|
3381
3513
|
"varchar(255)",
|
|
3382
3514
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3383
|
-
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(
|
|
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();
|
|
3384
3524
|
}
|
|
3385
|
-
async function
|
|
3525
|
+
async function _n(t) {
|
|
3386
3526
|
await t.schema.dropTable("keys").execute();
|
|
3387
3527
|
}
|
|
3388
|
-
const
|
|
3528
|
+
const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3389
3529
|
__proto__: null,
|
|
3390
|
-
down:
|
|
3391
|
-
up:
|
|
3530
|
+
down: _n,
|
|
3531
|
+
up: mn
|
|
3392
3532
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3393
|
-
async function
|
|
3533
|
+
async function fn(t) {
|
|
3394
3534
|
}
|
|
3395
|
-
async function
|
|
3535
|
+
async function pn(t) {
|
|
3396
3536
|
}
|
|
3397
|
-
const
|
|
3537
|
+
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3398
3538
|
__proto__: null,
|
|
3399
|
-
down:
|
|
3400
|
-
up:
|
|
3539
|
+
down: pn,
|
|
3540
|
+
up: fn
|
|
3401
3541
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3402
|
-
async function
|
|
3542
|
+
async function wn(t) {
|
|
3403
3543
|
}
|
|
3404
|
-
async function
|
|
3544
|
+
async function yn(t) {
|
|
3405
3545
|
}
|
|
3406
|
-
const
|
|
3546
|
+
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3407
3547
|
__proto__: null,
|
|
3408
|
-
down:
|
|
3409
|
-
up:
|
|
3548
|
+
down: yn,
|
|
3549
|
+
up: wn
|
|
3410
3550
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3411
|
-
async function
|
|
3551
|
+
async function Nn(t) {
|
|
3412
3552
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3413
3553
|
}
|
|
3414
|
-
async function
|
|
3554
|
+
async function Cn(t) {
|
|
3415
3555
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3416
3556
|
}
|
|
3417
|
-
const
|
|
3557
|
+
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3418
3558
|
__proto__: null,
|
|
3419
|
-
down:
|
|
3420
|
-
up:
|
|
3559
|
+
down: Cn,
|
|
3560
|
+
up: Nn
|
|
3421
3561
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3422
|
-
async function
|
|
3562
|
+
async function xn(t) {
|
|
3423
3563
|
}
|
|
3424
|
-
async function
|
|
3564
|
+
async function Tn(t) {
|
|
3425
3565
|
}
|
|
3426
|
-
const
|
|
3566
|
+
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3427
3567
|
__proto__: null,
|
|
3428
|
-
down:
|
|
3429
|
-
up:
|
|
3568
|
+
down: Tn,
|
|
3569
|
+
up: xn
|
|
3430
3570
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3431
|
-
async function
|
|
3571
|
+
async function On(t) {
|
|
3432
3572
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3433
3573
|
}
|
|
3434
|
-
async function
|
|
3574
|
+
async function kn(t) {
|
|
3435
3575
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3436
3576
|
}
|
|
3437
|
-
const
|
|
3577
|
+
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3438
3578
|
__proto__: null,
|
|
3439
|
-
down:
|
|
3440
|
-
up:
|
|
3579
|
+
down: kn,
|
|
3580
|
+
up: On
|
|
3441
3581
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3442
|
-
async function
|
|
3582
|
+
async function In(t) {
|
|
3443
3583
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3444
3584
|
}
|
|
3445
|
-
async function
|
|
3585
|
+
async function Dn(t) {
|
|
3446
3586
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3447
3587
|
}
|
|
3448
|
-
const
|
|
3588
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3449
3589
|
__proto__: null,
|
|
3450
|
-
down:
|
|
3451
|
-
up:
|
|
3590
|
+
down: Dn,
|
|
3591
|
+
up: In
|
|
3452
3592
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3453
|
-
async function
|
|
3593
|
+
async function jn(t) {
|
|
3454
3594
|
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();
|
|
3455
3595
|
}
|
|
3456
|
-
async function
|
|
3596
|
+
async function Fn(t) {
|
|
3457
3597
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
3458
3598
|
}
|
|
3459
|
-
const
|
|
3599
|
+
const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3460
3600
|
__proto__: null,
|
|
3461
|
-
down:
|
|
3462
|
-
up:
|
|
3601
|
+
down: Fn,
|
|
3602
|
+
up: jn
|
|
3463
3603
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3464
|
-
async function
|
|
3604
|
+
async function An(t) {
|
|
3465
3605
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3466
3606
|
}
|
|
3467
|
-
async function
|
|
3607
|
+
async function zn(t) {
|
|
3468
3608
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3469
3609
|
}
|
|
3470
|
-
const
|
|
3610
|
+
const Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3471
3611
|
__proto__: null,
|
|
3472
|
-
down:
|
|
3473
|
-
up:
|
|
3612
|
+
down: zn,
|
|
3613
|
+
up: An
|
|
3474
3614
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3475
|
-
async function
|
|
3615
|
+
async function En(t) {
|
|
3476
3616
|
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();
|
|
3477
3617
|
}
|
|
3478
|
-
async function
|
|
3618
|
+
async function Jn(t) {
|
|
3479
3619
|
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();
|
|
3480
3620
|
}
|
|
3481
|
-
const
|
|
3621
|
+
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3482
3622
|
__proto__: null,
|
|
3483
|
-
down:
|
|
3484
|
-
up:
|
|
3623
|
+
down: Jn,
|
|
3624
|
+
up: En
|
|
3485
3625
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3486
|
-
async function
|
|
3626
|
+
async function Kn(t) {
|
|
3487
3627
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
3488
3628
|
}
|
|
3489
|
-
async function
|
|
3629
|
+
async function Un(t) {
|
|
3490
3630
|
await t.schema.dropIndex("users_name_index").execute();
|
|
3491
3631
|
}
|
|
3492
|
-
const
|
|
3632
|
+
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3493
3633
|
__proto__: null,
|
|
3494
|
-
down:
|
|
3495
|
-
up:
|
|
3634
|
+
down: Un,
|
|
3635
|
+
up: Kn
|
|
3496
3636
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3497
|
-
async function
|
|
3637
|
+
async function Qn(t) {
|
|
3498
3638
|
}
|
|
3499
|
-
async function
|
|
3639
|
+
async function qn(t) {
|
|
3500
3640
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
3501
3641
|
}
|
|
3502
|
-
const
|
|
3642
|
+
const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3503
3643
|
__proto__: null,
|
|
3504
|
-
down:
|
|
3505
|
-
up:
|
|
3644
|
+
down: qn,
|
|
3645
|
+
up: Qn
|
|
3506
3646
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3507
|
-
async function
|
|
3647
|
+
async function Wn(t) {
|
|
3508
3648
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3509
3649
|
}
|
|
3510
|
-
async function
|
|
3650
|
+
async function Gn(t) {
|
|
3511
3651
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
3512
3652
|
}
|
|
3513
|
-
const
|
|
3653
|
+
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3514
3654
|
__proto__: null,
|
|
3515
|
-
down:
|
|
3516
|
-
up:
|
|
3655
|
+
down: Gn,
|
|
3656
|
+
up: Wn
|
|
3517
3657
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3518
|
-
async function
|
|
3658
|
+
async function Yn(t) {
|
|
3519
3659
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3520
3660
|
}
|
|
3521
|
-
async function
|
|
3661
|
+
async function Xn(t) {
|
|
3522
3662
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3523
3663
|
}
|
|
3524
|
-
const
|
|
3664
|
+
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3525
3665
|
__proto__: null,
|
|
3526
|
-
down:
|
|
3527
|
-
up:
|
|
3666
|
+
down: Xn,
|
|
3667
|
+
up: Yn
|
|
3528
3668
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3529
|
-
async function
|
|
3669
|
+
async function eo(t) {
|
|
3530
3670
|
await t.schema.createTable("branding").addColumn(
|
|
3531
3671
|
"tenant_id",
|
|
3532
3672
|
"varchar(255)",
|
|
3533
3673
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3534
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();
|
|
3535
3675
|
}
|
|
3536
|
-
async function
|
|
3676
|
+
async function to(t) {
|
|
3537
3677
|
await t.schema.dropTable("branding").execute();
|
|
3538
3678
|
}
|
|
3539
|
-
const
|
|
3679
|
+
const ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3540
3680
|
__proto__: null,
|
|
3541
|
-
down:
|
|
3542
|
-
up:
|
|
3681
|
+
down: to,
|
|
3682
|
+
up: eo
|
|
3543
3683
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3544
|
-
async function
|
|
3684
|
+
async function ao(t) {
|
|
3545
3685
|
}
|
|
3546
|
-
async function
|
|
3686
|
+
async function no(t) {
|
|
3547
3687
|
}
|
|
3548
|
-
const
|
|
3688
|
+
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3549
3689
|
__proto__: null,
|
|
3550
|
-
down:
|
|
3551
|
-
up:
|
|
3690
|
+
down: no,
|
|
3691
|
+
up: ao
|
|
3552
3692
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3553
|
-
async function
|
|
3693
|
+
async function so(t) {
|
|
3554
3694
|
}
|
|
3555
|
-
async function
|
|
3695
|
+
async function io(t) {
|
|
3556
3696
|
}
|
|
3557
|
-
const
|
|
3697
|
+
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3558
3698
|
__proto__: null,
|
|
3559
|
-
down:
|
|
3560
|
-
up:
|
|
3699
|
+
down: io,
|
|
3700
|
+
up: so
|
|
3561
3701
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3562
|
-
async function
|
|
3702
|
+
async function co(t) {
|
|
3563
3703
|
}
|
|
3564
|
-
async function
|
|
3704
|
+
async function uo(t) {
|
|
3565
3705
|
}
|
|
3566
|
-
const
|
|
3706
|
+
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3567
3707
|
__proto__: null,
|
|
3568
|
-
down:
|
|
3569
|
-
up:
|
|
3708
|
+
down: uo,
|
|
3709
|
+
up: co
|
|
3570
3710
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3571
|
-
async function
|
|
3711
|
+
async function _o(t) {
|
|
3572
3712
|
}
|
|
3573
|
-
async function
|
|
3713
|
+
async function ho(t) {
|
|
3574
3714
|
}
|
|
3575
|
-
const
|
|
3715
|
+
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3576
3716
|
__proto__: null,
|
|
3577
|
-
down:
|
|
3578
|
-
up:
|
|
3717
|
+
down: ho,
|
|
3718
|
+
up: _o
|
|
3579
3719
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3580
|
-
async function
|
|
3720
|
+
async function po(t) {
|
|
3581
3721
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
3582
3722
|
"tenant_id",
|
|
3583
3723
|
"varchar(255)",
|
|
@@ -3588,55 +3728,55 @@ async function mo(t) {
|
|
|
3588
3728
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3589
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();
|
|
3590
3730
|
}
|
|
3591
|
-
async function
|
|
3731
|
+
async function go(t) {
|
|
3592
3732
|
await t.schema.dropTable("authentication_codes").execute();
|
|
3593
3733
|
}
|
|
3594
|
-
const
|
|
3734
|
+
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3595
3735
|
__proto__: null,
|
|
3596
|
-
down:
|
|
3597
|
-
up:
|
|
3736
|
+
down: go,
|
|
3737
|
+
up: po
|
|
3598
3738
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3599
|
-
async function
|
|
3739
|
+
async function yo(t) {
|
|
3600
3740
|
}
|
|
3601
|
-
async function
|
|
3741
|
+
async function vo(t) {
|
|
3602
3742
|
}
|
|
3603
|
-
const
|
|
3743
|
+
const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3604
3744
|
__proto__: null,
|
|
3605
|
-
down:
|
|
3606
|
-
up:
|
|
3745
|
+
down: vo,
|
|
3746
|
+
up: yo
|
|
3607
3747
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3608
|
-
async function
|
|
3748
|
+
async function Co(t) {
|
|
3609
3749
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3610
3750
|
}
|
|
3611
|
-
async function
|
|
3751
|
+
async function bo(t) {
|
|
3612
3752
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3613
3753
|
}
|
|
3614
|
-
const
|
|
3754
|
+
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3615
3755
|
__proto__: null,
|
|
3616
|
-
down:
|
|
3617
|
-
up:
|
|
3756
|
+
down: bo,
|
|
3757
|
+
up: Co
|
|
3618
3758
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3619
|
-
async function
|
|
3759
|
+
async function To(t) {
|
|
3620
3760
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3621
3761
|
}
|
|
3622
|
-
async function
|
|
3762
|
+
async function So(t) {
|
|
3623
3763
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3624
3764
|
}
|
|
3625
|
-
const
|
|
3765
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3626
3766
|
__proto__: null,
|
|
3627
|
-
down:
|
|
3628
|
-
up:
|
|
3767
|
+
down: So,
|
|
3768
|
+
up: To
|
|
3629
3769
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3630
|
-
async function
|
|
3770
|
+
async function ko(t) {
|
|
3631
3771
|
}
|
|
3632
|
-
async function
|
|
3772
|
+
async function $o(t) {
|
|
3633
3773
|
}
|
|
3634
|
-
const
|
|
3774
|
+
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3635
3775
|
__proto__: null,
|
|
3636
|
-
down:
|
|
3637
|
-
up:
|
|
3776
|
+
down: $o,
|
|
3777
|
+
up: ko
|
|
3638
3778
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3639
|
-
async function
|
|
3779
|
+
async function Do(t) {
|
|
3640
3780
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3641
3781
|
"tenant_id",
|
|
3642
3782
|
"varchar(255)",
|
|
@@ -3647,33 +3787,33 @@ async function Oo(t) {
|
|
|
3647
3787
|
(e) => e.defaultTo(!1).notNull()
|
|
3648
3788
|
).addColumn("priority", "integer").execute();
|
|
3649
3789
|
}
|
|
3650
|
-
async function
|
|
3790
|
+
async function Po(t) {
|
|
3651
3791
|
await t.schema.dropTable("hooks").execute();
|
|
3652
3792
|
}
|
|
3653
|
-
const
|
|
3793
|
+
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3654
3794
|
__proto__: null,
|
|
3655
|
-
down:
|
|
3656
|
-
up:
|
|
3795
|
+
down: Po,
|
|
3796
|
+
up: Do
|
|
3657
3797
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3658
|
-
async function
|
|
3798
|
+
async function Fo(t) {
|
|
3659
3799
|
}
|
|
3660
|
-
async function
|
|
3800
|
+
async function Mo(t) {
|
|
3661
3801
|
}
|
|
3662
|
-
const
|
|
3802
|
+
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3663
3803
|
__proto__: null,
|
|
3664
|
-
down:
|
|
3665
|
-
up:
|
|
3804
|
+
down: Mo,
|
|
3805
|
+
up: Fo
|
|
3666
3806
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3667
|
-
async function
|
|
3807
|
+
async function zo(t) {
|
|
3668
3808
|
}
|
|
3669
|
-
async function
|
|
3809
|
+
async function Lo(t) {
|
|
3670
3810
|
}
|
|
3671
|
-
const
|
|
3811
|
+
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3672
3812
|
__proto__: null,
|
|
3673
|
-
down:
|
|
3674
|
-
up:
|
|
3813
|
+
down: Lo,
|
|
3814
|
+
up: zo
|
|
3675
3815
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3676
|
-
async function
|
|
3816
|
+
async function Jo(t) {
|
|
3677
3817
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3678
3818
|
"tenant_id",
|
|
3679
3819
|
"varchar(255)",
|
|
@@ -3690,7 +3830,7 @@ async function Ao(t) {
|
|
|
3690
3830
|
(e) => e.onDelete("cascade")
|
|
3691
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();
|
|
3692
3832
|
}
|
|
3693
|
-
async function
|
|
3833
|
+
async function Ro(t) {
|
|
3694
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(
|
|
3695
3835
|
"codes_user_id_tenant_id_constraint",
|
|
3696
3836
|
["user_id", "tenant_id"],
|
|
@@ -3699,90 +3839,90 @@ async function zo(t) {
|
|
|
3699
3839
|
(e) => e.onDelete("cascade")
|
|
3700
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();
|
|
3701
3841
|
}
|
|
3702
|
-
const
|
|
3842
|
+
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3703
3843
|
__proto__: null,
|
|
3704
|
-
down:
|
|
3705
|
-
up:
|
|
3844
|
+
down: Ro,
|
|
3845
|
+
up: Jo
|
|
3706
3846
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3707
|
-
async function
|
|
3847
|
+
async function Uo(t) {
|
|
3708
3848
|
}
|
|
3709
|
-
async function
|
|
3849
|
+
async function Bo(t) {
|
|
3710
3850
|
}
|
|
3711
|
-
const
|
|
3851
|
+
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3712
3852
|
__proto__: null,
|
|
3713
|
-
down:
|
|
3714
|
-
up:
|
|
3853
|
+
down: Bo,
|
|
3854
|
+
up: Uo
|
|
3715
3855
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3716
|
-
async function
|
|
3856
|
+
async function qo(t) {
|
|
3717
3857
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3718
3858
|
}
|
|
3719
|
-
async function
|
|
3859
|
+
async function Vo(t) {
|
|
3720
3860
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3721
3861
|
}
|
|
3722
|
-
const
|
|
3862
|
+
const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3723
3863
|
__proto__: null,
|
|
3724
|
-
down:
|
|
3725
|
-
up:
|
|
3864
|
+
down: Vo,
|
|
3865
|
+
up: qo
|
|
3726
3866
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3727
|
-
async function
|
|
3867
|
+
async function Go(t) {
|
|
3728
3868
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3729
3869
|
}
|
|
3730
|
-
async function
|
|
3870
|
+
async function Ho(t) {
|
|
3731
3871
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3732
3872
|
}
|
|
3733
|
-
const
|
|
3873
|
+
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3734
3874
|
__proto__: null,
|
|
3735
|
-
down:
|
|
3736
|
-
up:
|
|
3875
|
+
down: Ho,
|
|
3876
|
+
up: Go
|
|
3737
3877
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3738
|
-
async function
|
|
3878
|
+
async function Xo(t) {
|
|
3739
3879
|
}
|
|
3740
|
-
async function
|
|
3880
|
+
async function Zo(t) {
|
|
3741
3881
|
}
|
|
3742
|
-
const
|
|
3882
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3743
3883
|
__proto__: null,
|
|
3744
|
-
down:
|
|
3745
|
-
up:
|
|
3884
|
+
down: Zo,
|
|
3885
|
+
up: Xo
|
|
3746
3886
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3747
|
-
async function
|
|
3887
|
+
async function ts(t) {
|
|
3748
3888
|
}
|
|
3749
|
-
async function
|
|
3889
|
+
async function rs(t) {
|
|
3750
3890
|
}
|
|
3751
|
-
const
|
|
3891
|
+
const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3752
3892
|
__proto__: null,
|
|
3753
|
-
down:
|
|
3754
|
-
up:
|
|
3893
|
+
down: rs,
|
|
3894
|
+
up: ts
|
|
3755
3895
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3756
|
-
async function
|
|
3896
|
+
async function ns(t) {
|
|
3757
3897
|
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3758
3898
|
}
|
|
3759
|
-
async function
|
|
3899
|
+
async function os(t) {
|
|
3760
3900
|
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3761
3901
|
}
|
|
3762
|
-
const
|
|
3902
|
+
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3763
3903
|
__proto__: null,
|
|
3764
|
-
down:
|
|
3765
|
-
up:
|
|
3904
|
+
down: os,
|
|
3905
|
+
up: ns
|
|
3766
3906
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3767
|
-
async function
|
|
3907
|
+
async function is(t) {
|
|
3768
3908
|
}
|
|
3769
|
-
async function
|
|
3909
|
+
async function ls(t) {
|
|
3770
3910
|
}
|
|
3771
|
-
const
|
|
3911
|
+
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3772
3912
|
__proto__: null,
|
|
3773
|
-
down:
|
|
3774
|
-
up:
|
|
3913
|
+
down: ls,
|
|
3914
|
+
up: is
|
|
3775
3915
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3776
|
-
async function
|
|
3916
|
+
async function ds(t) {
|
|
3777
3917
|
}
|
|
3778
|
-
async function
|
|
3918
|
+
async function us(t) {
|
|
3779
3919
|
}
|
|
3780
|
-
const
|
|
3920
|
+
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3781
3921
|
__proto__: null,
|
|
3782
|
-
down:
|
|
3783
|
-
up:
|
|
3922
|
+
down: us,
|
|
3923
|
+
up: ds
|
|
3784
3924
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3785
|
-
async function
|
|
3925
|
+
async function _s(t) {
|
|
3786
3926
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3787
3927
|
"tenant_id",
|
|
3788
3928
|
"varchar(255)",
|
|
@@ -3798,7 +3938,7 @@ async function cs(t) {
|
|
|
3798
3938
|
"code_type"
|
|
3799
3939
|
]).execute();
|
|
3800
3940
|
}
|
|
3801
|
-
async function
|
|
3941
|
+
async function hs(t) {
|
|
3802
3942
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3803
3943
|
"tenant_id",
|
|
3804
3944
|
"varchar(255)",
|
|
@@ -3811,15 +3951,15 @@ async function ds(t) {
|
|
|
3811
3951
|
(e) => e.onDelete("cascade")
|
|
3812
3952
|
).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();
|
|
3813
3953
|
}
|
|
3814
|
-
const
|
|
3954
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3815
3955
|
__proto__: null,
|
|
3816
|
-
down:
|
|
3817
|
-
up:
|
|
3956
|
+
down: hs,
|
|
3957
|
+
up: _s
|
|
3818
3958
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3819
|
-
async function
|
|
3959
|
+
async function ps(t) {
|
|
3820
3960
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3821
3961
|
}
|
|
3822
|
-
async function
|
|
3962
|
+
async function gs(t) {
|
|
3823
3963
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3824
3964
|
"tenant_id",
|
|
3825
3965
|
"varchar(255)",
|
|
@@ -3838,32 +3978,32 @@ async function _s(t) {
|
|
|
3838
3978
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3839
3979
|
).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();
|
|
3840
3980
|
}
|
|
3841
|
-
const
|
|
3981
|
+
const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3842
3982
|
__proto__: null,
|
|
3843
|
-
down:
|
|
3844
|
-
up:
|
|
3983
|
+
down: gs,
|
|
3984
|
+
up: ps
|
|
3845
3985
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3846
|
-
async function
|
|
3986
|
+
async function ys(t) {
|
|
3847
3987
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3848
3988
|
}
|
|
3849
|
-
async function
|
|
3989
|
+
async function vs(t) {
|
|
3850
3990
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3851
3991
|
}
|
|
3852
|
-
const
|
|
3992
|
+
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3853
3993
|
__proto__: null,
|
|
3854
|
-
down:
|
|
3855
|
-
up:
|
|
3994
|
+
down: vs,
|
|
3995
|
+
up: ys
|
|
3856
3996
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3857
|
-
async function
|
|
3997
|
+
async function Cs(t) {
|
|
3858
3998
|
}
|
|
3859
|
-
async function
|
|
3999
|
+
async function bs(t) {
|
|
3860
4000
|
}
|
|
3861
|
-
const
|
|
4001
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3862
4002
|
__proto__: null,
|
|
3863
|
-
down:
|
|
3864
|
-
up:
|
|
4003
|
+
down: bs,
|
|
4004
|
+
up: Cs
|
|
3865
4005
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3866
|
-
async function
|
|
4006
|
+
async function Ts(t) {
|
|
3867
4007
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3868
4008
|
"universal_login_experience",
|
|
3869
4009
|
"varchar(16)",
|
|
@@ -3882,95 +4022,95 @@ async function Ns(t) {
|
|
|
3882
4022
|
(e) => e.defaultTo(!1).notNull()
|
|
3883
4023
|
).execute();
|
|
3884
4024
|
}
|
|
3885
|
-
async function
|
|
4025
|
+
async function Ss(t) {
|
|
3886
4026
|
await t.schema.dropTable("prompt_settings").execute();
|
|
3887
4027
|
}
|
|
3888
|
-
const
|
|
4028
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3889
4029
|
__proto__: null,
|
|
3890
|
-
down:
|
|
3891
|
-
up:
|
|
4030
|
+
down: Ss,
|
|
4031
|
+
up: Ts
|
|
3892
4032
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3893
|
-
async function
|
|
4033
|
+
async function ks(t) {
|
|
3894
4034
|
}
|
|
3895
|
-
async function
|
|
4035
|
+
async function $s(t) {
|
|
3896
4036
|
}
|
|
3897
|
-
const
|
|
4037
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3898
4038
|
__proto__: null,
|
|
3899
|
-
down:
|
|
3900
|
-
up:
|
|
4039
|
+
down: $s,
|
|
4040
|
+
up: ks
|
|
3901
4041
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3902
|
-
async function
|
|
4042
|
+
async function Ds(t) {
|
|
3903
4043
|
}
|
|
3904
|
-
async function
|
|
4044
|
+
async function Ps(t) {
|
|
3905
4045
|
}
|
|
3906
|
-
const
|
|
4046
|
+
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3907
4047
|
__proto__: null,
|
|
3908
|
-
down:
|
|
3909
|
-
up:
|
|
4048
|
+
down: Ps,
|
|
4049
|
+
up: Ds
|
|
3910
4050
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3911
|
-
async function
|
|
4051
|
+
async function Fs(t) {
|
|
3912
4052
|
}
|
|
3913
|
-
async function
|
|
4053
|
+
async function Ms(t) {
|
|
3914
4054
|
}
|
|
3915
|
-
const
|
|
4055
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3916
4056
|
__proto__: null,
|
|
3917
|
-
down:
|
|
3918
|
-
up:
|
|
4057
|
+
down: Ms,
|
|
4058
|
+
up: Fs
|
|
3919
4059
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3920
|
-
async function
|
|
4060
|
+
async function zs(t) {
|
|
3921
4061
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3922
4062
|
}
|
|
3923
|
-
async function
|
|
4063
|
+
async function Ls(t) {
|
|
3924
4064
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3925
4065
|
}
|
|
3926
|
-
const
|
|
4066
|
+
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3927
4067
|
__proto__: null,
|
|
3928
|
-
down:
|
|
3929
|
-
up:
|
|
4068
|
+
down: Ls,
|
|
4069
|
+
up: zs
|
|
3930
4070
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3931
|
-
async function
|
|
4071
|
+
async function Js(t) {
|
|
3932
4072
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3933
4073
|
}
|
|
3934
|
-
async function
|
|
4074
|
+
async function Rs(t) {
|
|
3935
4075
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3936
4076
|
}
|
|
3937
|
-
const
|
|
4077
|
+
const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3938
4078
|
__proto__: null,
|
|
3939
|
-
down:
|
|
3940
|
-
up:
|
|
4079
|
+
down: Rs,
|
|
4080
|
+
up: Js
|
|
3941
4081
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3942
|
-
async function
|
|
4082
|
+
async function Us(t) {
|
|
3943
4083
|
}
|
|
3944
|
-
async function
|
|
4084
|
+
async function Bs(t) {
|
|
3945
4085
|
}
|
|
3946
|
-
const
|
|
4086
|
+
const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3947
4087
|
__proto__: null,
|
|
3948
|
-
down:
|
|
3949
|
-
up:
|
|
4088
|
+
down: Bs,
|
|
4089
|
+
up: Us
|
|
3950
4090
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3951
|
-
async function
|
|
4091
|
+
async function qs(t) {
|
|
3952
4092
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
3953
4093
|
}
|
|
3954
|
-
async function
|
|
4094
|
+
async function Vs(t) {
|
|
3955
4095
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
3956
4096
|
}
|
|
3957
|
-
const
|
|
4097
|
+
const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3958
4098
|
__proto__: null,
|
|
3959
|
-
down:
|
|
3960
|
-
up:
|
|
4099
|
+
down: Vs,
|
|
4100
|
+
up: qs
|
|
3961
4101
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3962
|
-
async function
|
|
4102
|
+
async function Gs(t) {
|
|
3963
4103
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3964
4104
|
}
|
|
3965
|
-
async function
|
|
4105
|
+
async function Hs(t) {
|
|
3966
4106
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3967
4107
|
}
|
|
3968
|
-
const
|
|
4108
|
+
const Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3969
4109
|
__proto__: null,
|
|
3970
|
-
down:
|
|
3971
|
-
up:
|
|
4110
|
+
down: Hs,
|
|
4111
|
+
up: Gs
|
|
3972
4112
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3973
|
-
async function
|
|
4113
|
+
async function Xs(t) {
|
|
3974
4114
|
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(
|
|
3975
4115
|
"credentials",
|
|
3976
4116
|
"varchar(2048)",
|
|
@@ -3981,18 +4121,18 @@ async function Ws(t) {
|
|
|
3981
4121
|
(e) => e.notNull().defaultTo("{}")
|
|
3982
4122
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
3983
4123
|
}
|
|
3984
|
-
async function
|
|
4124
|
+
async function Zs(t) {
|
|
3985
4125
|
await t.schema.dropTable("email_providers").execute();
|
|
3986
4126
|
}
|
|
3987
|
-
const
|
|
4127
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3988
4128
|
__proto__: null,
|
|
3989
|
-
down:
|
|
3990
|
-
up:
|
|
4129
|
+
down: Zs,
|
|
4130
|
+
up: Xs
|
|
3991
4131
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3992
|
-
async function
|
|
4132
|
+
async function ti(t) {
|
|
3993
4133
|
await t.schema.dropTable("tickets").execute();
|
|
3994
4134
|
}
|
|
3995
|
-
async function
|
|
4135
|
+
async function ri(t) {
|
|
3996
4136
|
await t.schema.createTable("tickets").addColumn(
|
|
3997
4137
|
"tenant_id",
|
|
3998
4138
|
"varchar(255)",
|
|
@@ -4003,22 +4143,22 @@ async function Ys(t) {
|
|
|
4003
4143
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4004
4144
|
).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();
|
|
4005
4145
|
}
|
|
4006
|
-
const
|
|
4146
|
+
const ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4007
4147
|
__proto__: null,
|
|
4008
|
-
down:
|
|
4009
|
-
up:
|
|
4148
|
+
down: ri,
|
|
4149
|
+
up: ti
|
|
4010
4150
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4011
|
-
async function
|
|
4151
|
+
async function ni(t) {
|
|
4012
4152
|
}
|
|
4013
|
-
async function
|
|
4153
|
+
async function oi(t) {
|
|
4014
4154
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
4015
4155
|
}
|
|
4016
|
-
const
|
|
4156
|
+
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4017
4157
|
__proto__: null,
|
|
4018
|
-
down:
|
|
4019
|
-
up:
|
|
4158
|
+
down: oi,
|
|
4159
|
+
up: ni
|
|
4020
4160
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4021
|
-
async function
|
|
4161
|
+
async function ii(t) {
|
|
4022
4162
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
4023
4163
|
"client_id",
|
|
4024
4164
|
"varchar(21)",
|
|
@@ -4031,27 +4171,27 @@ async function ai(t) {
|
|
|
4031
4171
|
(e) => e.onDelete("cascade")
|
|
4032
4172
|
).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();
|
|
4033
4173
|
}
|
|
4034
|
-
async function
|
|
4174
|
+
async function li(t) {
|
|
4035
4175
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
4036
4176
|
}
|
|
4037
|
-
const
|
|
4177
|
+
const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4038
4178
|
__proto__: null,
|
|
4039
|
-
down:
|
|
4040
|
-
up:
|
|
4179
|
+
down: li,
|
|
4180
|
+
up: ii
|
|
4041
4181
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4042
|
-
async function
|
|
4182
|
+
async function di(t) {
|
|
4043
4183
|
}
|
|
4044
|
-
async function
|
|
4184
|
+
async function ui(t) {
|
|
4045
4185
|
}
|
|
4046
|
-
const
|
|
4186
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4047
4187
|
__proto__: null,
|
|
4048
|
-
down:
|
|
4049
|
-
up:
|
|
4188
|
+
down: ui,
|
|
4189
|
+
up: di
|
|
4050
4190
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4051
|
-
async function
|
|
4191
|
+
async function _i(t) {
|
|
4052
4192
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4053
4193
|
}
|
|
4054
|
-
async function
|
|
4194
|
+
async function hi(t) {
|
|
4055
4195
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4056
4196
|
"sessions_user_id_constraint",
|
|
4057
4197
|
["user_id", "tenant_id"],
|
|
@@ -4070,12 +4210,12 @@ async function di(t) {
|
|
|
4070
4210
|
(e) => e.onDelete("cascade")
|
|
4071
4211
|
).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();
|
|
4072
4212
|
}
|
|
4073
|
-
const
|
|
4213
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4074
4214
|
__proto__: null,
|
|
4075
|
-
down:
|
|
4076
|
-
up:
|
|
4215
|
+
down: hi,
|
|
4216
|
+
up: _i
|
|
4077
4217
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4078
|
-
async function
|
|
4218
|
+
async function pi(t) {
|
|
4079
4219
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4080
4220
|
"sessions_2_user_id_constraint",
|
|
4081
4221
|
["user_id", "tenant_id"],
|
|
@@ -4094,15 +4234,15 @@ async function mi(t) {
|
|
|
4094
4234
|
(e) => e.onDelete("cascade")
|
|
4095
4235
|
).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();
|
|
4096
4236
|
}
|
|
4097
|
-
async function
|
|
4237
|
+
async function gi(t) {
|
|
4098
4238
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4099
4239
|
}
|
|
4100
|
-
const
|
|
4240
|
+
const wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4101
4241
|
__proto__: null,
|
|
4102
|
-
down:
|
|
4103
|
-
up:
|
|
4242
|
+
down: gi,
|
|
4243
|
+
up: pi
|
|
4104
4244
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4105
|
-
async function
|
|
4245
|
+
async function yi(t) {
|
|
4106
4246
|
await t.schema.createTable("custom_domains").addColumn(
|
|
4107
4247
|
"custom_domain_id",
|
|
4108
4248
|
"varchar(21)",
|
|
@@ -4113,49 +4253,49 @@ async function fi(t) {
|
|
|
4113
4253
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4114
4254
|
).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();
|
|
4115
4255
|
}
|
|
4116
|
-
async function
|
|
4256
|
+
async function vi(t) {
|
|
4117
4257
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
4118
4258
|
"tenant_id",
|
|
4119
4259
|
"varchar(255)",
|
|
4120
4260
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4121
4261
|
).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();
|
|
4122
4262
|
}
|
|
4123
|
-
const
|
|
4263
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4124
4264
|
__proto__: null,
|
|
4125
|
-
down:
|
|
4126
|
-
up:
|
|
4265
|
+
down: vi,
|
|
4266
|
+
up: yi
|
|
4127
4267
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4128
|
-
async function
|
|
4268
|
+
async function Ci(t) {
|
|
4129
4269
|
}
|
|
4130
|
-
async function
|
|
4270
|
+
async function bi(t) {
|
|
4131
4271
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4132
4272
|
}
|
|
4133
|
-
const
|
|
4273
|
+
const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4134
4274
|
__proto__: null,
|
|
4135
|
-
down:
|
|
4136
|
-
up:
|
|
4275
|
+
down: bi,
|
|
4276
|
+
up: Ci
|
|
4137
4277
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4138
|
-
async function
|
|
4278
|
+
async function Ti(t) {
|
|
4139
4279
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4140
4280
|
}
|
|
4141
|
-
async function
|
|
4281
|
+
async function Si(t) {
|
|
4142
4282
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
4143
4283
|
}
|
|
4144
|
-
const
|
|
4284
|
+
const Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4145
4285
|
__proto__: null,
|
|
4146
|
-
down:
|
|
4147
|
-
up:
|
|
4286
|
+
down: Si,
|
|
4287
|
+
up: Ti
|
|
4148
4288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4149
|
-
async function
|
|
4289
|
+
async function ki(t) {
|
|
4150
4290
|
}
|
|
4151
|
-
async function
|
|
4291
|
+
async function $i(t) {
|
|
4152
4292
|
}
|
|
4153
|
-
const
|
|
4293
|
+
const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4154
4294
|
__proto__: null,
|
|
4155
|
-
down:
|
|
4156
|
-
up:
|
|
4295
|
+
down: $i,
|
|
4296
|
+
up: ki
|
|
4157
4297
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4158
|
-
async function
|
|
4298
|
+
async function Di(t) {
|
|
4159
4299
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4160
4300
|
"sessions_user_id_constraint",
|
|
4161
4301
|
["user_id", "tenant_id"],
|
|
@@ -4182,25 +4322,25 @@ async function Oi(t) {
|
|
|
4182
4322
|
(e) => e.onDelete("cascade")
|
|
4183
4323
|
).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();
|
|
4184
4324
|
}
|
|
4185
|
-
async function
|
|
4325
|
+
async function Pi(t) {
|
|
4186
4326
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4187
4327
|
}
|
|
4188
|
-
const
|
|
4328
|
+
const ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4189
4329
|
__proto__: null,
|
|
4190
|
-
down:
|
|
4191
|
-
up:
|
|
4330
|
+
down: Pi,
|
|
4331
|
+
up: Di
|
|
4192
4332
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4193
|
-
async function
|
|
4333
|
+
async function Fi(t) {
|
|
4194
4334
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4195
4335
|
}
|
|
4196
|
-
async function
|
|
4336
|
+
async function Mi(t) {
|
|
4197
4337
|
}
|
|
4198
|
-
const
|
|
4338
|
+
const Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4199
4339
|
__proto__: null,
|
|
4200
|
-
down:
|
|
4201
|
-
up:
|
|
4340
|
+
down: Mi,
|
|
4341
|
+
up: Fi
|
|
4202
4342
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4203
|
-
async function
|
|
4343
|
+
async function zi(t) {
|
|
4204
4344
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
4205
4345
|
"custom_domain_id",
|
|
4206
4346
|
"varchar(256)",
|
|
@@ -4211,120 +4351,120 @@ async function ji(t) {
|
|
|
4211
4351
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4212
4352
|
).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();
|
|
4213
4353
|
}
|
|
4214
|
-
async function
|
|
4354
|
+
async function Li(t) {
|
|
4215
4355
|
}
|
|
4216
|
-
const
|
|
4356
|
+
const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4217
4357
|
__proto__: null,
|
|
4218
|
-
down:
|
|
4219
|
-
up:
|
|
4358
|
+
down: Li,
|
|
4359
|
+
up: zi
|
|
4220
4360
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4221
|
-
async function
|
|
4361
|
+
async function Ji(t) {
|
|
4222
4362
|
}
|
|
4223
|
-
async function
|
|
4363
|
+
async function Ri(t) {
|
|
4224
4364
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4225
4365
|
}
|
|
4226
|
-
const
|
|
4366
|
+
const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4227
4367
|
__proto__: null,
|
|
4228
|
-
down:
|
|
4229
|
-
up:
|
|
4368
|
+
down: Ri,
|
|
4369
|
+
up: Ji
|
|
4230
4370
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4231
|
-
async function
|
|
4371
|
+
async function Ui(t) {
|
|
4232
4372
|
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();
|
|
4233
4373
|
}
|
|
4234
|
-
async function
|
|
4374
|
+
async function Bi(t) {
|
|
4235
4375
|
await t.schema.dropTable("forms").execute();
|
|
4236
4376
|
}
|
|
4237
|
-
const
|
|
4377
|
+
const Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4238
4378
|
__proto__: null,
|
|
4239
|
-
down:
|
|
4240
|
-
up:
|
|
4379
|
+
down: Bi,
|
|
4380
|
+
up: Ui
|
|
4241
4381
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4242
|
-
async function
|
|
4382
|
+
async function qi(t) {
|
|
4243
4383
|
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();
|
|
4244
4384
|
}
|
|
4245
|
-
async function
|
|
4385
|
+
async function Vi(t) {
|
|
4246
4386
|
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();
|
|
4247
4387
|
}
|
|
4248
|
-
const
|
|
4388
|
+
const Wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4249
4389
|
__proto__: null,
|
|
4250
|
-
down:
|
|
4251
|
-
up:
|
|
4390
|
+
down: Vi,
|
|
4391
|
+
up: qi
|
|
4252
4392
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4253
|
-
async function
|
|
4393
|
+
async function Gi(t) {
|
|
4254
4394
|
await t.schema.alterTable("login_sessions").addColumn(
|
|
4255
4395
|
"login_completed",
|
|
4256
4396
|
"boolean",
|
|
4257
4397
|
(e) => e.notNull().defaultTo(0)
|
|
4258
4398
|
).execute();
|
|
4259
4399
|
}
|
|
4260
|
-
async function
|
|
4400
|
+
async function Hi(t) {
|
|
4261
4401
|
await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
|
|
4262
4402
|
}
|
|
4263
|
-
const
|
|
4403
|
+
const Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4264
4404
|
__proto__: null,
|
|
4265
|
-
down:
|
|
4266
|
-
up:
|
|
4405
|
+
down: Hi,
|
|
4406
|
+
up: Gi
|
|
4267
4407
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4268
|
-
async function
|
|
4408
|
+
async function Xi(t) {
|
|
4269
4409
|
await t.schema.alterTable("sessions").addColumn(
|
|
4270
4410
|
"login_session_id",
|
|
4271
4411
|
"varchar(21)",
|
|
4272
4412
|
(e) => e.references("login_sessions.id").onDelete("set null")
|
|
4273
4413
|
).execute();
|
|
4274
4414
|
}
|
|
4275
|
-
async function
|
|
4415
|
+
async function Zi(t) {
|
|
4276
4416
|
await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
|
|
4277
4417
|
}
|
|
4278
|
-
const
|
|
4418
|
+
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4279
4419
|
__proto__: null,
|
|
4280
|
-
down:
|
|
4281
|
-
up:
|
|
4420
|
+
down: Zi,
|
|
4421
|
+
up: Xi
|
|
4282
4422
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4283
|
-
async function
|
|
4423
|
+
async function tl(t) {
|
|
4284
4424
|
await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
|
|
4285
4425
|
}
|
|
4286
|
-
async function
|
|
4426
|
+
async function rl(t) {
|
|
4287
4427
|
await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
|
|
4288
4428
|
}
|
|
4289
|
-
const
|
|
4429
|
+
const al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4290
4430
|
__proto__: null,
|
|
4291
|
-
down:
|
|
4292
|
-
up:
|
|
4431
|
+
down: rl,
|
|
4432
|
+
up: tl
|
|
4293
4433
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4294
|
-
async function
|
|
4434
|
+
async function nl(t) {
|
|
4295
4435
|
await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
|
|
4296
4436
|
}
|
|
4297
|
-
async function
|
|
4437
|
+
async function ol(t) {
|
|
4298
4438
|
await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
|
|
4299
4439
|
}
|
|
4300
|
-
const
|
|
4440
|
+
const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4301
4441
|
__proto__: null,
|
|
4302
|
-
down:
|
|
4303
|
-
up:
|
|
4442
|
+
down: ol,
|
|
4443
|
+
up: nl
|
|
4304
4444
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4305
|
-
async function
|
|
4445
|
+
async function il(t) {
|
|
4306
4446
|
await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
|
|
4307
4447
|
}
|
|
4308
|
-
async function
|
|
4448
|
+
async function ll(t) {
|
|
4309
4449
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
4310
4450
|
}
|
|
4311
|
-
const
|
|
4451
|
+
const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4312
4452
|
__proto__: null,
|
|
4313
|
-
down:
|
|
4314
|
-
up:
|
|
4453
|
+
down: ll,
|
|
4454
|
+
up: il
|
|
4315
4455
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4316
|
-
async function
|
|
4456
|
+
async function dl(t) {
|
|
4317
4457
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
4318
4458
|
}
|
|
4319
|
-
async function
|
|
4459
|
+
async function ul(t) {
|
|
4320
4460
|
await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
|
|
4321
4461
|
}
|
|
4322
|
-
const
|
|
4462
|
+
const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4323
4463
|
__proto__: null,
|
|
4324
|
-
down:
|
|
4325
|
-
up:
|
|
4464
|
+
down: ul,
|
|
4465
|
+
up: dl
|
|
4326
4466
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4327
|
-
async function
|
|
4467
|
+
async function _l(t) {
|
|
4328
4468
|
await t.schema.createTable("themes").addColumn(
|
|
4329
4469
|
"tenant_id",
|
|
4330
4470
|
"varchar(255)",
|
|
@@ -4399,31 +4539,31 @@ async function cl(t) {
|
|
|
4399
4539
|
(e) => e.notNull()
|
|
4400
4540
|
).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();
|
|
4401
4541
|
}
|
|
4402
|
-
async function
|
|
4542
|
+
async function hl(t) {
|
|
4403
4543
|
await t.schema.dropTable("themes").execute();
|
|
4404
4544
|
}
|
|
4405
|
-
const
|
|
4545
|
+
const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4406
4546
|
__proto__: null,
|
|
4407
|
-
down:
|
|
4408
|
-
up:
|
|
4547
|
+
down: hl,
|
|
4548
|
+
up: _l
|
|
4409
4549
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4410
|
-
async function
|
|
4411
|
-
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(
|
|
4550
|
+
async function pl(t) {
|
|
4551
|
+
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();
|
|
4412
4552
|
}
|
|
4413
|
-
async function
|
|
4553
|
+
async function gl(t) {
|
|
4414
4554
|
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
4415
4555
|
}
|
|
4416
|
-
const
|
|
4556
|
+
const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4417
4557
|
__proto__: null,
|
|
4418
|
-
down:
|
|
4419
|
-
up:
|
|
4558
|
+
down: gl,
|
|
4559
|
+
up: pl
|
|
4420
4560
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4421
|
-
async function
|
|
4561
|
+
async function yl(t) {
|
|
4422
4562
|
await t.schema.createTable("role_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4423
4563
|
"resource_server_identifier",
|
|
4424
4564
|
"varchar(191)",
|
|
4425
4565
|
(e) => e.notNull()
|
|
4426
|
-
).addColumn("permission_name", "varchar(
|
|
4566
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("role_permissions_pk", [
|
|
4427
4567
|
"tenant_id",
|
|
4428
4568
|
"role_id",
|
|
4429
4569
|
"resource_server_identifier",
|
|
@@ -4432,138 +4572,165 @@ async function fl(t) {
|
|
|
4432
4572
|
"resource_server_identifier",
|
|
4433
4573
|
"varchar(191)",
|
|
4434
4574
|
(e) => e.notNull()
|
|
4435
|
-
).addColumn("permission_name", "varchar(
|
|
4575
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_permissions_pk", [
|
|
4436
4576
|
"tenant_id",
|
|
4437
4577
|
"user_id",
|
|
4438
4578
|
"resource_server_identifier",
|
|
4439
4579
|
"permission_name"
|
|
4440
4580
|
]).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();
|
|
4441
4581
|
}
|
|
4442
|
-
async function
|
|
4582
|
+
async function vl(t) {
|
|
4443
4583
|
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("role_permissions").execute();
|
|
4444
4584
|
}
|
|
4445
|
-
const
|
|
4585
|
+
const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4446
4586
|
__proto__: null,
|
|
4447
|
-
down:
|
|
4448
|
-
up:
|
|
4587
|
+
down: vl,
|
|
4588
|
+
up: yl
|
|
4589
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4590
|
+
async function Cl(t) {
|
|
4591
|
+
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
|
+
"tenant_id",
|
|
4593
|
+
"user_id",
|
|
4594
|
+
"role_id"
|
|
4595
|
+
]).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
|
+
}
|
|
4597
|
+
async function bl(t) {
|
|
4598
|
+
await t.schema.dropTable("user_roles").execute();
|
|
4599
|
+
}
|
|
4600
|
+
const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4601
|
+
__proto__: null,
|
|
4602
|
+
down: bl,
|
|
4603
|
+
up: Cl
|
|
4604
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4605
|
+
async function Tl(t) {
|
|
4606
|
+
}
|
|
4607
|
+
async function Sl(t) {
|
|
4608
|
+
await t.schema.alterTable("keys").dropColumn("connection").execute(), await t.schema.alterTable("keys").alterColumn("cert", (e) => e.setDataType("varchar(2048)")).execute(), await t.schema.alterTable("keys").alterColumn("pkcs7", (e) => e.setDataType("varchar(2048)")).execute(), await t.schema.alterTable("keys").dropColumn("type").execute();
|
|
4609
|
+
}
|
|
4610
|
+
const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4611
|
+
__proto__: null,
|
|
4612
|
+
down: Sl,
|
|
4613
|
+
up: Tl
|
|
4449
4614
|
}, Symbol.toStringTag, { value: "Module" })), Ee = {
|
|
4450
|
-
m1_init:
|
|
4451
|
-
m2_magicLink:
|
|
4452
|
-
m3_updateAt:
|
|
4453
|
-
m4_logTable:
|
|
4454
|
-
m5_userProfile:
|
|
4455
|
-
m6_sessions:
|
|
4456
|
-
m7_passwords:
|
|
4457
|
-
m8_logsTableNewFields:
|
|
4458
|
-
m9_passwordTableNewField:
|
|
4459
|
-
n01_codesTable:
|
|
4460
|
-
n11_universalLoginSession:
|
|
4461
|
-
n12_userFields:
|
|
4462
|
-
n13_userEmailIndex:
|
|
4463
|
-
n14_profileDataField:
|
|
4464
|
-
n15_userEmailIndex:
|
|
4465
|
-
n16_userLocale:
|
|
4466
|
-
n17_signingKeys:
|
|
4467
|
-
n18_logsFields:
|
|
4468
|
-
n19_connectionsUserinfo:
|
|
4469
|
-
n20_missingFields:
|
|
4470
|
-
n21_sessionDeletedAt:
|
|
4471
|
-
n22_dropLogsFields:
|
|
4472
|
-
n23_dropUsersFields:
|
|
4473
|
-
n24_logsIndexes:
|
|
4474
|
-
n25_logDescMaxLength:
|
|
4475
|
-
n26_logsTableExtraFields:
|
|
4476
|
-
n27_usersTableNameIndex:
|
|
4477
|
-
n28_usersEmailConstrain:
|
|
4478
|
-
n29_increaseOtpStateLength:
|
|
4479
|
-
n30_increaseTicketStateLength:
|
|
4480
|
-
n31_branding:
|
|
4481
|
-
n32_indexesAndNotNull:
|
|
4482
|
-
n33_vendorIdInUniversalLoginSession:
|
|
4483
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
4484
|
-
n35_increaseUniversalSessionStateLength:
|
|
4485
|
-
n36_authenticationCodes:
|
|
4486
|
-
n37_disableSignUps:
|
|
4487
|
-
n38_otpIpAddress:
|
|
4488
|
-
n39_increaseUserAgentLength:
|
|
4489
|
-
n40_userId:
|
|
4490
|
-
n41_hooks:
|
|
4491
|
-
n42_userIdIndexes:
|
|
4492
|
-
n43_userIdIndexes:
|
|
4493
|
-
n44_codes:
|
|
4494
|
-
n45_hookProperties:
|
|
4495
|
-
n46_loginAuth0Client:
|
|
4496
|
-
n47_loginAuth0Client:
|
|
4497
|
-
n48_saml:
|
|
4498
|
-
n49_removeFields:
|
|
4499
|
-
n50_authParamsNonce:
|
|
4500
|
-
n51_connectionid:
|
|
4501
|
-
n52_cert:
|
|
4502
|
-
n53_codes_primary_key:
|
|
4503
|
-
n54_cleanup_tables:
|
|
4504
|
-
n55_logs_index:
|
|
4505
|
-
n56_application_fields:
|
|
4506
|
-
n57_prompt_settings:
|
|
4507
|
-
n58_connection_client_id:
|
|
4508
|
-
n59_connection_options:
|
|
4509
|
-
n60_users_metadata:
|
|
4510
|
-
n61_userLocales:
|
|
4511
|
-
n62_prompt:
|
|
4512
|
-
n63_connection_cleanup:
|
|
4513
|
-
n64_act_as:
|
|
4514
|
-
n65_code_verifier:
|
|
4515
|
-
n66_email_providers:
|
|
4516
|
-
n67_drop_tickets:
|
|
4517
|
-
n68_login_useragents:
|
|
4518
|
-
n70_refresh_tokens:
|
|
4519
|
-
n71_session_new_fields:
|
|
4520
|
-
n72_session_primary_key:
|
|
4521
|
-
n73_drop_sessions:
|
|
4522
|
-
n74_custom_domains:
|
|
4523
|
-
n75_organizations:
|
|
4524
|
-
n76_authorization_url_length:
|
|
4525
|
-
n77_drop_sessions:
|
|
4526
|
-
n78_login_sessions:
|
|
4527
|
-
n79_drop_sessions_2:
|
|
4528
|
-
n80_recreate_custom_domains:
|
|
4529
|
-
n81_phone:
|
|
4530
|
-
n82_forms:
|
|
4531
|
-
n83_addFormsIdToHooks:
|
|
4532
|
-
n84_login_completed:
|
|
4533
|
-
n85_add_login_session_id_to_sessions:
|
|
4534
|
-
n86_index_sessions_login_session_id:
|
|
4535
|
-
n87_code_challenge:
|
|
4536
|
-
n88_add_redirect_uri_to_codes:
|
|
4537
|
-
n89_add_nonce_and_state_to_codes:
|
|
4538
|
-
n90_themes:
|
|
4539
|
-
n91_resource_servers_rules_permissions:
|
|
4540
|
-
n92_role_permissions:
|
|
4615
|
+
m1_init: ya,
|
|
4616
|
+
m2_magicLink: Ca,
|
|
4617
|
+
m3_updateAt: Ta,
|
|
4618
|
+
m4_logTable: ka,
|
|
4619
|
+
m5_userProfile: Da,
|
|
4620
|
+
m6_sessions: Fa,
|
|
4621
|
+
m7_passwords: za,
|
|
4622
|
+
m8_logsTableNewFields: Ja,
|
|
4623
|
+
m9_passwordTableNewField: Ua,
|
|
4624
|
+
n01_codesTable: qa,
|
|
4625
|
+
n11_universalLoginSession: Ga,
|
|
4626
|
+
n12_userFields: Xa,
|
|
4627
|
+
n13_userEmailIndex: tn,
|
|
4628
|
+
n14_profileDataField: nn,
|
|
4629
|
+
n15_userEmailIndex: ln,
|
|
4630
|
+
n16_userLocale: un,
|
|
4631
|
+
n17_signingKeys: hn,
|
|
4632
|
+
n18_logsFields: gn,
|
|
4633
|
+
n19_connectionsUserinfo: vn,
|
|
4634
|
+
n20_missingFields: bn,
|
|
4635
|
+
n21_sessionDeletedAt: Sn,
|
|
4636
|
+
n22_dropLogsFields: $n,
|
|
4637
|
+
n23_dropUsersFields: Pn,
|
|
4638
|
+
n24_logsIndexes: Mn,
|
|
4639
|
+
n25_logDescMaxLength: Ln,
|
|
4640
|
+
n26_logsTableExtraFields: Rn,
|
|
4641
|
+
n27_usersTableNameIndex: Bn,
|
|
4642
|
+
n28_usersEmailConstrain: Vn,
|
|
4643
|
+
n29_increaseOtpStateLength: Hn,
|
|
4644
|
+
n30_increaseTicketStateLength: Zn,
|
|
4645
|
+
n31_branding: ro,
|
|
4646
|
+
n32_indexesAndNotNull: oo,
|
|
4647
|
+
n33_vendorIdInUniversalLoginSession: lo,
|
|
4648
|
+
n34_auth0ClientInUniversalLoginSession: mo,
|
|
4649
|
+
n35_increaseUniversalSessionStateLength: fo,
|
|
4650
|
+
n36_authenticationCodes: wo,
|
|
4651
|
+
n37_disableSignUps: No,
|
|
4652
|
+
n38_otpIpAddress: xo,
|
|
4653
|
+
n39_increaseUserAgentLength: Oo,
|
|
4654
|
+
n40_userId: Io,
|
|
4655
|
+
n41_hooks: jo,
|
|
4656
|
+
n42_userIdIndexes: Ao,
|
|
4657
|
+
n43_userIdIndexes: Eo,
|
|
4658
|
+
n44_codes: Ko,
|
|
4659
|
+
n45_hookProperties: Qo,
|
|
4660
|
+
n46_loginAuth0Client: Wo,
|
|
4661
|
+
n47_loginAuth0Client: Yo,
|
|
4662
|
+
n48_saml: es,
|
|
4663
|
+
n49_removeFields: as,
|
|
4664
|
+
n50_authParamsNonce: ss,
|
|
4665
|
+
n51_connectionid: cs,
|
|
4666
|
+
n52_cert: ms,
|
|
4667
|
+
n53_codes_primary_key: fs,
|
|
4668
|
+
n54_cleanup_tables: ws,
|
|
4669
|
+
n55_logs_index: Ns,
|
|
4670
|
+
n56_application_fields: xs,
|
|
4671
|
+
n57_prompt_settings: Os,
|
|
4672
|
+
n58_connection_client_id: Is,
|
|
4673
|
+
n59_connection_options: js,
|
|
4674
|
+
n60_users_metadata: As,
|
|
4675
|
+
n61_userLocales: Es,
|
|
4676
|
+
n62_prompt: Ks,
|
|
4677
|
+
n63_connection_cleanup: Qs,
|
|
4678
|
+
n64_act_as: Ws,
|
|
4679
|
+
n65_code_verifier: Ys,
|
|
4680
|
+
n66_email_providers: ei,
|
|
4681
|
+
n67_drop_tickets: ai,
|
|
4682
|
+
n68_login_useragents: si,
|
|
4683
|
+
n70_refresh_tokens: ci,
|
|
4684
|
+
n71_session_new_fields: mi,
|
|
4685
|
+
n72_session_primary_key: fi,
|
|
4686
|
+
n73_drop_sessions: wi,
|
|
4687
|
+
n74_custom_domains: Ni,
|
|
4688
|
+
n75_organizations: xi,
|
|
4689
|
+
n76_authorization_url_length: Oi,
|
|
4690
|
+
n77_drop_sessions: Ii,
|
|
4691
|
+
n78_login_sessions: ji,
|
|
4692
|
+
n79_drop_sessions_2: Ai,
|
|
4693
|
+
n80_recreate_custom_domains: Ei,
|
|
4694
|
+
n81_phone: Ki,
|
|
4695
|
+
n82_forms: Qi,
|
|
4696
|
+
n83_addFormsIdToHooks: Wi,
|
|
4697
|
+
n84_login_completed: Yi,
|
|
4698
|
+
n85_add_login_session_id_to_sessions: el,
|
|
4699
|
+
n86_index_sessions_login_session_id: al,
|
|
4700
|
+
n87_code_challenge: sl,
|
|
4701
|
+
n88_add_redirect_uri_to_codes: cl,
|
|
4702
|
+
n89_add_nonce_and_state_to_codes: ml,
|
|
4703
|
+
n90_themes: fl,
|
|
4704
|
+
n91_resource_servers_rules_permissions: wl,
|
|
4705
|
+
n92_role_permissions: Nl,
|
|
4706
|
+
n93_add_permissions_to_roles: xl,
|
|
4707
|
+
n94_keys_connection_and_extend_columns: Ol
|
|
4541
4708
|
};
|
|
4542
|
-
async function
|
|
4709
|
+
async function Pl(t, e = !1) {
|
|
4543
4710
|
e && console.log("migrating...");
|
|
4544
4711
|
const r = new Le(Ee), a = new be({
|
|
4545
4712
|
db: t,
|
|
4546
4713
|
provider: r
|
|
4547
|
-
}), { error:
|
|
4548
|
-
if (
|
|
4714
|
+
}), { error: n, results: o } = await a.migrateToLatest();
|
|
4715
|
+
if (o == null || o.forEach((s) => {
|
|
4549
4716
|
s.status === "Success" ? e && console.log(
|
|
4550
4717
|
`migration "${s.migrationName}" was executed successfully`
|
|
4551
4718
|
) : s.status === "Error" && console.error(`failed to execute migration "${s.migrationName}"`);
|
|
4552
|
-
}),
|
|
4553
|
-
throw console.error("failed to migrate"), console.error(
|
|
4719
|
+
}), n)
|
|
4720
|
+
throw console.error("failed to migrate"), console.error(n), n;
|
|
4554
4721
|
}
|
|
4555
|
-
async function
|
|
4722
|
+
async function jl(t) {
|
|
4556
4723
|
console.log("migrating...");
|
|
4557
4724
|
const e = new Le(Ee), r = new be({
|
|
4558
4725
|
db: t,
|
|
4559
4726
|
provider: e
|
|
4560
|
-
}), { error: a, results:
|
|
4561
|
-
if (
|
|
4562
|
-
|
|
4727
|
+
}), { error: a, results: n } = await r.migrateDown();
|
|
4728
|
+
if (n == null || n.forEach((o) => {
|
|
4729
|
+
o.status === "Success" ? console.log(`migration "${o.migrationName}" was reverted successfully`) : o.status === "Error" && console.error(`failed to execute migration "${o.migrationName}"`);
|
|
4563
4730
|
}), a)
|
|
4564
4731
|
throw console.error("failed to migrate"), console.error(a), a;
|
|
4565
4732
|
}
|
|
4566
|
-
function
|
|
4733
|
+
function Fl(t) {
|
|
4567
4734
|
return {
|
|
4568
4735
|
applications: jt(t),
|
|
4569
4736
|
branding: er(t),
|
|
@@ -4572,7 +4739,7 @@ function xl(t) {
|
|
|
4572
4739
|
codes: Ot(t),
|
|
4573
4740
|
connections: Et(t),
|
|
4574
4741
|
emailProviders: br(t),
|
|
4575
|
-
customDomains:
|
|
4742
|
+
customDomains: Yt(t),
|
|
4576
4743
|
forms: Ar(t),
|
|
4577
4744
|
hooks: sr(t),
|
|
4578
4745
|
keys: Bt(t),
|
|
@@ -4582,8 +4749,9 @@ function xl(t) {
|
|
|
4582
4749
|
promptSettings: yr(t),
|
|
4583
4750
|
refreshTokens: $r(t),
|
|
4584
4751
|
resourceServers: Kr(t),
|
|
4585
|
-
rolePermissions:
|
|
4752
|
+
rolePermissions: Xr(t),
|
|
4586
4753
|
userPermissions: ra(t),
|
|
4754
|
+
userRoles: sa(t),
|
|
4587
4755
|
roles: Wr(t),
|
|
4588
4756
|
sessions: gt(t),
|
|
4589
4757
|
tenants: st(t),
|
|
@@ -4592,7 +4760,7 @@ function xl(t) {
|
|
|
4592
4760
|
};
|
|
4593
4761
|
}
|
|
4594
4762
|
export {
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4763
|
+
Fl as default,
|
|
4764
|
+
jl as migrateDown,
|
|
4765
|
+
Pl as migrateToLatest
|
|
4598
4766
|
};
|