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