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