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