@authhero/kysely-adapter 10.59.0 → 10.61.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 +3 -3
- package/dist/kysely-adapter.d.ts +22 -59
- package/dist/kysely-adapter.mjs +685 -689
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var Tn = (t) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ba = (t, e, n) => e in t ? qa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
6
6
|
var ie = (t, e, n) => Ba(t, typeof e != "symbol" ? e + "" : e, n), Qt = (t, e, n) => e.has(t) || Tn("Cannot " + n);
|
|
7
|
-
var i = (t, e, n) => (Qt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? Tn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), b = (t, e, n, a) => (Qt(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n),
|
|
7
|
+
var i = (t, e, n) => (Qt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? Tn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), b = (t, e, n, a) => (Qt(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), y = (t, e, n) => (Qt(t, e, "access private method"), n);
|
|
8
8
|
import { parseUserId as pn, codeSchema as Wa, connectionSchema as Ka, loginSessionSchema as Ua, promptSettingSchema as Qa, formSchema as Tt, resourceServerSchema as Va } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var et = class extends Error {
|
|
@@ -96,7 +96,7 @@ function Ya(t) {
|
|
|
96
96
|
]);
|
|
97
97
|
if (!a)
|
|
98
98
|
return null;
|
|
99
|
-
const { tenant_id: o, ...u } = a,
|
|
99
|
+
const { tenant_id: o, ...u } = a, d = {
|
|
100
100
|
...u,
|
|
101
101
|
email: a.email || "",
|
|
102
102
|
email_verified: a.email_verified === 1,
|
|
@@ -113,56 +113,56 @@ function Ya(t) {
|
|
|
113
113
|
...r.map(Vn)
|
|
114
114
|
]
|
|
115
115
|
};
|
|
116
|
-
return T(
|
|
116
|
+
return T(d);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
function J(t, e, n, a) {
|
|
120
120
|
const r = [];
|
|
121
121
|
let o = "", u = !1;
|
|
122
|
-
for (let
|
|
123
|
-
const h = n[
|
|
122
|
+
for (let c = 0; c < n.length; c++) {
|
|
123
|
+
const h = n[c];
|
|
124
124
|
h === '"' ? (u = !u, o += h) : h === " " && !u ? o.trim() && (r.push(o.trim()), o = "") : o += h;
|
|
125
125
|
}
|
|
126
|
-
return o.trim() && r.push(o.trim()), r.map((
|
|
127
|
-
let h =
|
|
128
|
-
if (
|
|
129
|
-
p =
|
|
130
|
-
else if (
|
|
131
|
-
p =
|
|
132
|
-
else if (
|
|
133
|
-
const
|
|
134
|
-
p =
|
|
126
|
+
return o.trim() && r.push(o.trim()), r.map((c) => c.replace(/^([^:]+)=/g, "$1:")).map((c) => {
|
|
127
|
+
let h = c.startsWith("-"), p = null, l = "", w = !1, f;
|
|
128
|
+
if (c.startsWith("-_exists_:"))
|
|
129
|
+
p = c.substring(10), w = !0, h = !0;
|
|
130
|
+
else if (c.startsWith("_exists_:"))
|
|
131
|
+
p = c.substring(9), w = !0, h = !1;
|
|
132
|
+
else if (c.includes(":")) {
|
|
133
|
+
const v = h ? c.substring(1) : c, x = v.indexOf(":");
|
|
134
|
+
p = v.substring(0, x), l = v.substring(x + 1), w = !1, l.startsWith(">=") ? (f = ">=", l = l.substring(2)) : l.startsWith(">") ? (f = ">", l = l.substring(1)) : l.startsWith("<=") ? (f = "<=", l = l.substring(2)) : l.startsWith("<") ? (f = "<", l = l.substring(1)) : f = "=", l.startsWith('"') && l.endsWith('"') && l.length > 1 && (l = l.slice(1, -1));
|
|
135
135
|
} else
|
|
136
|
-
p = null, l =
|
|
137
|
-
return { key: p, value: l, isNegation: h, isExistsQuery:
|
|
138
|
-
}).forEach(({ key:
|
|
139
|
-
if (
|
|
136
|
+
p = null, l = c, w = !1;
|
|
137
|
+
return { key: p, value: l, isNegation: h, isExistsQuery: w, operator: f };
|
|
138
|
+
}).forEach(({ key: c, value: h, isNegation: p, isExistsQuery: l, operator: w }) => {
|
|
139
|
+
if (c)
|
|
140
140
|
if (l)
|
|
141
|
-
p ? e = e.where(
|
|
141
|
+
p ? e = e.where(c, "is", null) : e = e.where(c, "is not", null);
|
|
142
142
|
else if (p)
|
|
143
|
-
switch (
|
|
143
|
+
switch (w) {
|
|
144
144
|
case ">":
|
|
145
|
-
e = e.where(
|
|
145
|
+
e = e.where(c, "<=", h);
|
|
146
146
|
break;
|
|
147
147
|
case ">=":
|
|
148
|
-
e = e.where(
|
|
148
|
+
e = e.where(c, "<", h);
|
|
149
149
|
break;
|
|
150
150
|
case "<":
|
|
151
|
-
e = e.where(
|
|
151
|
+
e = e.where(c, ">=", h);
|
|
152
152
|
break;
|
|
153
153
|
case "<=":
|
|
154
|
-
e = e.where(
|
|
154
|
+
e = e.where(c, ">", h);
|
|
155
155
|
break;
|
|
156
156
|
default:
|
|
157
|
-
e = e.where(
|
|
157
|
+
e = e.where(c, "!=", h);
|
|
158
158
|
}
|
|
159
159
|
else
|
|
160
|
-
e = e.where(
|
|
160
|
+
e = e.where(c, w, h);
|
|
161
161
|
else if (h) {
|
|
162
162
|
const { ref: f } = t.dynamic;
|
|
163
163
|
e = e.where(
|
|
164
|
-
(
|
|
165
|
-
a.map((x) =>
|
|
164
|
+
(v) => v.or(
|
|
165
|
+
a.map((x) => v(f(x), "like", `%${h}%`))
|
|
166
166
|
)
|
|
167
167
|
);
|
|
168
168
|
}
|
|
@@ -173,14 +173,14 @@ function j(t) {
|
|
|
173
173
|
}
|
|
174
174
|
function Ha(t) {
|
|
175
175
|
return async (e, n = {}) => {
|
|
176
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
176
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: d } = n;
|
|
177
|
+
let c = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
178
|
+
if (d && (c = J(t, c, d, ["email", "name", "phone_number"])), u && u.sort_by) {
|
|
179
179
|
const { ref: x } = t.dynamic;
|
|
180
|
-
|
|
180
|
+
c = c.orderBy(x(u.sort_by), u.sort_order);
|
|
181
181
|
}
|
|
182
|
-
const p = await
|
|
183
|
-
const E =
|
|
182
|
+
const p = await c.offset(a * r).limit(r).selectAll().execute(), l = p.map((x) => x.user_id), w = l.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", l).execute() : [], f = p.map((x) => {
|
|
183
|
+
const E = w.filter(
|
|
184
184
|
(z) => z.linked_to === x.user_id
|
|
185
185
|
);
|
|
186
186
|
return T({
|
|
@@ -207,12 +207,12 @@ function Ha(t) {
|
|
|
207
207
|
limit: 0,
|
|
208
208
|
length: 0
|
|
209
209
|
};
|
|
210
|
-
const { count:
|
|
210
|
+
const { count: v } = await c.select((x) => x.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
211
211
|
return {
|
|
212
212
|
users: f,
|
|
213
213
|
start: a * r,
|
|
214
214
|
limit: r,
|
|
215
|
-
length: j(
|
|
215
|
+
length: j(v)
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
218
|
}
|
|
@@ -279,9 +279,9 @@ let ar = (t) => crypto.getRandomValues(new Uint8Array(t)), rr = (t, e, n) => {
|
|
|
279
279
|
return (o = e) => {
|
|
280
280
|
let u = "";
|
|
281
281
|
for (; ; ) {
|
|
282
|
-
let
|
|
283
|
-
for (;
|
|
284
|
-
if (u += t[c
|
|
282
|
+
let d = n(r), c = r | 0;
|
|
283
|
+
for (; c--; )
|
|
284
|
+
if (u += t[d[c] & a] || "", u.length >= o) return u;
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
}, or = (t, e = 21) => rr(t, e | 0, ar), U = (t = 21) => {
|
|
@@ -353,32 +353,32 @@ function ur(t) {
|
|
|
353
353
|
return n ? Hn(n) : null;
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function dr(t) {
|
|
357
357
|
return async (e) => {
|
|
358
358
|
let n = t.selectFrom("tenants");
|
|
359
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
359
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: d } = e;
|
|
360
360
|
if (u && u.sort_by) {
|
|
361
361
|
const { ref: f } = t.dynamic;
|
|
362
362
|
n = n.orderBy(f(u.sort_by), u.sort_order);
|
|
363
363
|
}
|
|
364
|
-
|
|
365
|
-
(f) => f.or([f("friendly_name", "like", `%${
|
|
364
|
+
d && (n = n.where(
|
|
365
|
+
(f) => f.or([f("friendly_name", "like", `%${d}%`)])
|
|
366
366
|
));
|
|
367
367
|
const p = (await n.offset(a * r).limit(r).selectAll().execute()).map(Hn);
|
|
368
368
|
if (!o)
|
|
369
369
|
return {
|
|
370
370
|
tenants: p
|
|
371
371
|
};
|
|
372
|
-
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(),
|
|
372
|
+
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), w = j(l);
|
|
373
373
|
return {
|
|
374
374
|
tenants: p,
|
|
375
375
|
start: a * r,
|
|
376
376
|
limit: r,
|
|
377
|
-
length:
|
|
377
|
+
length: w
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function cr(t) {
|
|
382
382
|
return async (e, n) => {
|
|
383
383
|
const r = {
|
|
384
384
|
...Xn(n),
|
|
@@ -395,8 +395,8 @@ function _r(t) {
|
|
|
395
395
|
return {
|
|
396
396
|
create: sr(t),
|
|
397
397
|
get: ur(t),
|
|
398
|
-
list:
|
|
399
|
-
update:
|
|
398
|
+
list: dr(t),
|
|
399
|
+
update: cr(t),
|
|
400
400
|
remove: lr(t)
|
|
401
401
|
};
|
|
402
402
|
}
|
|
@@ -406,7 +406,7 @@ function On(t) {
|
|
|
406
406
|
const mr = 1024;
|
|
407
407
|
function hr(t) {
|
|
408
408
|
return async (e, n) => {
|
|
409
|
-
var o, u,
|
|
409
|
+
var o, u, d, c, h, p, l, w, f;
|
|
410
410
|
const a = (o = n.user_agent) == null ? void 0 : o.slice(0, mr), r = n.log_id || U();
|
|
411
411
|
return await t.insertInto("logs").values({
|
|
412
412
|
...n,
|
|
@@ -417,16 +417,14 @@ function hr(t) {
|
|
|
417
417
|
isMobile: n.isMobile ? 1 : 0,
|
|
418
418
|
scope: n.scope,
|
|
419
419
|
auth0_client: On(n.auth0_client),
|
|
420
|
-
details: (
|
|
420
|
+
details: (d = On(n.details)) == null ? void 0 : d.substring(0, 8192),
|
|
421
421
|
// Extract location_info fields for separate columns
|
|
422
|
-
country_code: (
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
time_zone: (N = n.location_info) == null ? void 0 : N.time_zone,
|
|
429
|
-
continent_code: (x = n.location_info) == null ? void 0 : x.continent_code
|
|
422
|
+
country_code: (c = n.location_info) == null ? void 0 : c.country_code,
|
|
423
|
+
city_name: (h = n.location_info) == null ? void 0 : h.city_name,
|
|
424
|
+
latitude: (p = n.location_info) == null ? void 0 : p.latitude,
|
|
425
|
+
longitude: (l = n.location_info) == null ? void 0 : l.longitude,
|
|
426
|
+
time_zone: (w = n.location_info) == null ? void 0 : w.time_zone,
|
|
427
|
+
continent_code: (f = n.location_info) == null ? void 0 : f.continent_code
|
|
430
428
|
}).execute(), {
|
|
431
429
|
...n,
|
|
432
430
|
log_id: r,
|
|
@@ -456,8 +454,6 @@ function Zn(t) {
|
|
|
456
454
|
// Reconstruct location_info from separate columns
|
|
457
455
|
location_info: t.country_code ? {
|
|
458
456
|
country_code: t.country_code,
|
|
459
|
-
country_code3: t.country_code3 || "",
|
|
460
|
-
country_name: t.country_name || "",
|
|
461
457
|
city_name: t.city_name || "",
|
|
462
458
|
latitude: t.latitude || "",
|
|
463
459
|
longitude: t.longitude || "",
|
|
@@ -468,10 +464,10 @@ function Zn(t) {
|
|
|
468
464
|
}
|
|
469
465
|
function fr(t) {
|
|
470
466
|
return async (e, n = {}) => {
|
|
471
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
472
|
-
let
|
|
473
|
-
|
|
474
|
-
let h =
|
|
467
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: d } = n;
|
|
468
|
+
let c = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
469
|
+
d && (c = J(t, c, d, ["user_id", "ip"]));
|
|
470
|
+
let h = c;
|
|
475
471
|
if (u && u.sort_by) {
|
|
476
472
|
const { ref: f } = t.dynamic;
|
|
477
473
|
h = h.orderBy(f(u.sort_by), u.sort_order);
|
|
@@ -485,12 +481,12 @@ function fr(t) {
|
|
|
485
481
|
limit: 0,
|
|
486
482
|
length: 0
|
|
487
483
|
};
|
|
488
|
-
const { count:
|
|
484
|
+
const { count: w } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
489
485
|
return {
|
|
490
486
|
logs: l,
|
|
491
487
|
start: a * r,
|
|
492
488
|
limit: r,
|
|
493
|
-
length: j(
|
|
489
|
+
length: j(w)
|
|
494
490
|
};
|
|
495
491
|
};
|
|
496
492
|
}
|
|
@@ -507,20 +503,20 @@ function gr(t) {
|
|
|
507
503
|
get: pr(t)
|
|
508
504
|
};
|
|
509
505
|
}
|
|
510
|
-
function
|
|
506
|
+
function wr(t) {
|
|
511
507
|
return async (e, n) => {
|
|
512
508
|
const a = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", n).selectAll().executeTakeFirst();
|
|
513
509
|
if (!a)
|
|
514
510
|
return null;
|
|
515
|
-
const { tenant_id: r, device: o, clients: u, ...
|
|
511
|
+
const { tenant_id: r, device: o, clients: u, ...d } = a;
|
|
516
512
|
return {
|
|
517
|
-
...
|
|
513
|
+
...d,
|
|
518
514
|
device: JSON.parse(o),
|
|
519
515
|
clients: JSON.parse(u)
|
|
520
516
|
};
|
|
521
517
|
};
|
|
522
518
|
}
|
|
523
|
-
function
|
|
519
|
+
function yr(t) {
|
|
524
520
|
return async (e, n) => {
|
|
525
521
|
const a = {
|
|
526
522
|
...n,
|
|
@@ -553,19 +549,19 @@ function vr(t) {
|
|
|
553
549
|
}
|
|
554
550
|
function Cr(t) {
|
|
555
551
|
return async (e, n = {}) => {
|
|
556
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
557
|
-
let
|
|
558
|
-
|
|
559
|
-
let h =
|
|
552
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: d } = n;
|
|
553
|
+
let c = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
554
|
+
d && (c = J(t, c, d, ["user_id", "session_id"]));
|
|
555
|
+
let h = c;
|
|
560
556
|
if (u && u.sort_by) {
|
|
561
|
-
const { ref:
|
|
562
|
-
h = h.orderBy(
|
|
557
|
+
const { ref: v } = t.dynamic;
|
|
558
|
+
h = h.orderBy(v(u.sort_by), u.sort_order);
|
|
563
559
|
}
|
|
564
560
|
h = h.offset(a * r).limit(r);
|
|
565
|
-
const l = (await h.selectAll().execute()).map((
|
|
566
|
-
...
|
|
567
|
-
device: JSON.parse(
|
|
568
|
-
clients: JSON.parse(
|
|
561
|
+
const l = (await h.selectAll().execute()).map((v) => ({
|
|
562
|
+
...v,
|
|
563
|
+
device: JSON.parse(v.device),
|
|
564
|
+
clients: JSON.parse(v.clients)
|
|
569
565
|
}));
|
|
570
566
|
if (!o)
|
|
571
567
|
return {
|
|
@@ -574,7 +570,7 @@ function Cr(t) {
|
|
|
574
570
|
limit: 0,
|
|
575
571
|
length: 0
|
|
576
572
|
};
|
|
577
|
-
const { count:
|
|
573
|
+
const { count: w } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(w);
|
|
578
574
|
return {
|
|
579
575
|
sessions: l,
|
|
580
576
|
start: a * r,
|
|
@@ -585,8 +581,8 @@ function Cr(t) {
|
|
|
585
581
|
}
|
|
586
582
|
function xr(t) {
|
|
587
583
|
return {
|
|
588
|
-
create:
|
|
589
|
-
get:
|
|
584
|
+
create: yr(t),
|
|
585
|
+
get: wr(t),
|
|
590
586
|
list: Cr(t),
|
|
591
587
|
remove: Nr(t),
|
|
592
588
|
update: vr(t)
|
|
@@ -634,9 +630,9 @@ function Or(t) {
|
|
|
634
630
|
function Sr(t) {
|
|
635
631
|
return async (e, n, a) => {
|
|
636
632
|
let r = t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", n).orderBy("created_at", "desc");
|
|
637
|
-
return a && (r = r.limit(a)), (await r.selectAll().execute()).map(({ tenant_id: u, ...
|
|
638
|
-
...
|
|
639
|
-
is_current: !!
|
|
633
|
+
return a && (r = r.limit(a)), (await r.selectAll().execute()).map(({ tenant_id: u, ...d }) => ({
|
|
634
|
+
...d,
|
|
635
|
+
is_current: !!d.is_current
|
|
640
636
|
}));
|
|
641
637
|
};
|
|
642
638
|
}
|
|
@@ -651,11 +647,11 @@ function kr(t) {
|
|
|
651
647
|
function Ir(t) {
|
|
652
648
|
return async (e, n = {}) => {
|
|
653
649
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
654
|
-
let
|
|
655
|
-
u && (
|
|
656
|
-
const p = (await
|
|
657
|
-
const { tenant_id: f, ...
|
|
658
|
-
return Wa.parse(T(
|
|
650
|
+
let d = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
651
|
+
u && (d = J(t, d, u, ["code", "login_id"]));
|
|
652
|
+
const p = (await d.offset(a * r).limit(r).selectAll().execute()).map((w) => {
|
|
653
|
+
const { tenant_id: f, ...v } = w;
|
|
654
|
+
return Wa.parse(T(v));
|
|
659
655
|
});
|
|
660
656
|
if (!o)
|
|
661
657
|
return {
|
|
@@ -664,7 +660,7 @@ function Ir(t) {
|
|
|
664
660
|
limit: 0,
|
|
665
661
|
length: 0
|
|
666
662
|
};
|
|
667
|
-
const { count: l } = await
|
|
663
|
+
const { count: l } = await d.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
668
664
|
return {
|
|
669
665
|
codes: p,
|
|
670
666
|
start: a * r,
|
|
@@ -756,12 +752,12 @@ function qr(t) {
|
|
|
756
752
|
function Br(t) {
|
|
757
753
|
return async (e, n = {}) => {
|
|
758
754
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
759
|
-
let
|
|
760
|
-
u && (
|
|
761
|
-
const p = (await
|
|
762
|
-
(
|
|
763
|
-
...
|
|
764
|
-
options: JSON.parse(
|
|
755
|
+
let d = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
756
|
+
u && (d = J(t, d, u, ["user_id", "ip"]));
|
|
757
|
+
const p = (await d.offset(a * r).limit(r).selectAll().execute()).map(
|
|
758
|
+
(w) => T({
|
|
759
|
+
...w,
|
|
760
|
+
options: JSON.parse(w.options)
|
|
765
761
|
})
|
|
766
762
|
);
|
|
767
763
|
if (!o)
|
|
@@ -771,7 +767,7 @@ function Br(t) {
|
|
|
771
767
|
limit: 0,
|
|
772
768
|
length: 0
|
|
773
769
|
};
|
|
774
|
-
const { count: l } = await
|
|
770
|
+
const { count: l } = await d.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
775
771
|
return {
|
|
776
772
|
connections: p,
|
|
777
773
|
start: a * r,
|
|
@@ -1028,27 +1024,27 @@ function Zr(t) {
|
|
|
1028
1024
|
}
|
|
1029
1025
|
function eo(t) {
|
|
1030
1026
|
return async (e, n) => {
|
|
1031
|
-
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), { scope: o, authorization_details_types: u, ...
|
|
1027
|
+
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), { scope: o, authorization_details_types: u, ...d } = n, c = {
|
|
1032
1028
|
id: r,
|
|
1033
1029
|
tenant_id: e,
|
|
1034
|
-
...
|
|
1030
|
+
...d,
|
|
1035
1031
|
scope: o ? JSON.stringify(o) : "[]",
|
|
1036
1032
|
authorization_details_types: u ? JSON.stringify(u) : "[]",
|
|
1037
1033
|
// Convert booleans to integers for database storage
|
|
1038
|
-
allow_any_organization:
|
|
1039
|
-
is_system:
|
|
1034
|
+
allow_any_organization: d.allow_any_organization !== void 0 ? d.allow_any_organization ? 1 : 0 : void 0,
|
|
1035
|
+
is_system: d.is_system !== void 0 ? d.is_system ? 1 : 0 : void 0,
|
|
1040
1036
|
created_at: a,
|
|
1041
1037
|
updated_at: a
|
|
1042
1038
|
};
|
|
1043
|
-
return await t.insertInto("client_grants").values(
|
|
1039
|
+
return await t.insertInto("client_grants").values(c).execute(), T({
|
|
1044
1040
|
id: r,
|
|
1045
1041
|
tenant_id: e,
|
|
1046
|
-
...
|
|
1042
|
+
...d,
|
|
1047
1043
|
scope: o || [],
|
|
1048
1044
|
authorization_details_types: u || [],
|
|
1049
1045
|
// Ensure boolean fields have proper defaults
|
|
1050
|
-
allow_any_organization:
|
|
1051
|
-
is_system:
|
|
1046
|
+
allow_any_organization: d.allow_any_organization ?? !1,
|
|
1047
|
+
is_system: d.is_system ?? !1,
|
|
1052
1048
|
created_at: a,
|
|
1053
1049
|
updated_at: a
|
|
1054
1050
|
});
|
|
@@ -1078,29 +1074,29 @@ function to(t) {
|
|
|
1078
1074
|
}
|
|
1079
1075
|
function no(t) {
|
|
1080
1076
|
return async (e, n = {}) => {
|
|
1081
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u, sort:
|
|
1082
|
-
let
|
|
1077
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u, sort: d } = n;
|
|
1078
|
+
let c = t.selectFrom("client_grants").where("client_grants.tenant_id", "=", e);
|
|
1083
1079
|
if (u) {
|
|
1084
|
-
const f = u.trim(),
|
|
1080
|
+
const f = u.trim(), v = f.split(/\s+/), x = v.length === 1 ? v[0] : void 0, E = x ? x.match(/^(-)?([a-zA-Z_][a-zA-Z0-9_]*):"?([^"]*)"?$/) : null, z = E ? E[3] : "", oe = /^(>=|>|<=|<)/.test(z || "");
|
|
1085
1081
|
if (E && !oe && z) {
|
|
1086
|
-
const Q = !!E[1],
|
|
1087
|
-
if (
|
|
1082
|
+
const Q = !!E[1], ye = E[2], { ref: Ct } = t.dynamic, Ne = Ct(`client_grants.${ye}`);
|
|
1083
|
+
if (ye === "allow_any_organization") {
|
|
1088
1084
|
const rt = z === "true" ? 1 : 0;
|
|
1089
|
-
Q ?
|
|
1085
|
+
Q ? c = c.where(Ne, "!=", rt) : c = c.where(Ne, "=", rt);
|
|
1090
1086
|
} else
|
|
1091
|
-
Q ?
|
|
1087
|
+
Q ? c = c.where(Ne, "!=", z) : c = c.where(Ne, "=", z);
|
|
1092
1088
|
} else
|
|
1093
|
-
|
|
1089
|
+
c = J(t, c, f, []);
|
|
1094
1090
|
}
|
|
1095
|
-
let h =
|
|
1096
|
-
if (
|
|
1091
|
+
let h = c;
|
|
1092
|
+
if (d) {
|
|
1097
1093
|
const { ref: f } = t.dynamic;
|
|
1098
|
-
h = h.orderBy(f(
|
|
1094
|
+
h = h.orderBy(f(d.sort_by), d.sort_order);
|
|
1099
1095
|
} else
|
|
1100
1096
|
h = h.orderBy("client_grants.created_at", "desc");
|
|
1101
1097
|
h = h.limit(r).offset(a * r);
|
|
1102
1098
|
const l = (await h.selectAll().execute()).map((f) => {
|
|
1103
|
-
const
|
|
1099
|
+
const v = {
|
|
1104
1100
|
id: f.id,
|
|
1105
1101
|
client_id: f.client_id,
|
|
1106
1102
|
audience: f.audience,
|
|
@@ -1114,7 +1110,7 @@ function no(t) {
|
|
|
1114
1110
|
created_at: f.created_at,
|
|
1115
1111
|
updated_at: f.updated_at
|
|
1116
1112
|
};
|
|
1117
|
-
return T(
|
|
1113
|
+
return T(v);
|
|
1118
1114
|
});
|
|
1119
1115
|
if (!o)
|
|
1120
1116
|
return {
|
|
@@ -1123,12 +1119,12 @@ function no(t) {
|
|
|
1123
1119
|
limit: 0,
|
|
1124
1120
|
length: 0
|
|
1125
1121
|
};
|
|
1126
|
-
const { count:
|
|
1122
|
+
const { count: w } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1127
1123
|
return {
|
|
1128
1124
|
client_grants: l,
|
|
1129
1125
|
start: a * r,
|
|
1130
1126
|
limit: r,
|
|
1131
|
-
length: j(
|
|
1127
|
+
length: j(w)
|
|
1132
1128
|
};
|
|
1133
1129
|
};
|
|
1134
1130
|
}
|
|
@@ -1137,13 +1133,13 @@ function ao(t) {
|
|
|
1137
1133
|
}
|
|
1138
1134
|
function ro(t) {
|
|
1139
1135
|
return async (e, n, a) => {
|
|
1140
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), { scope: o, authorization_details_types: u, ...
|
|
1141
|
-
...
|
|
1136
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), { scope: o, authorization_details_types: u, ...d } = a, c = {
|
|
1137
|
+
...d,
|
|
1142
1138
|
updated_at: r
|
|
1143
1139
|
};
|
|
1144
|
-
return o !== void 0 && (
|
|
1140
|
+
return o !== void 0 && (c.scope = JSON.stringify(o)), u !== void 0 && (c.authorization_details_types = JSON.stringify(
|
|
1145
1141
|
u
|
|
1146
|
-
)),
|
|
1142
|
+
)), d.allow_any_organization !== void 0 && (c.allow_any_organization = d.allow_any_organization ? 1 : 0), d.is_system !== void 0 && (c.is_system = d.is_system ? 1 : 0), ((await t.updateTable("client_grants").set(c).where("client_grants.tenant_id", "=", e).where("client_grants.id", "=", n).executeTakeFirst()).numUpdatedRows ?? 0n) > 0n;
|
|
1147
1143
|
};
|
|
1148
1144
|
}
|
|
1149
1145
|
function oo(t) {
|
|
@@ -1179,10 +1175,10 @@ function io(t) {
|
|
|
1179
1175
|
require_proof_of_possession: !!n.require_proof_of_possession,
|
|
1180
1176
|
// Parse JSON string fields back to objects/arrays
|
|
1181
1177
|
connections: r.map(
|
|
1182
|
-
(
|
|
1178
|
+
(d) => Ka.parse(
|
|
1183
1179
|
T({
|
|
1184
|
-
...
|
|
1185
|
-
options:
|
|
1180
|
+
...d,
|
|
1181
|
+
options: d.options ? JSON.parse(d.options) : {}
|
|
1186
1182
|
})
|
|
1187
1183
|
)
|
|
1188
1184
|
),
|
|
@@ -1221,23 +1217,23 @@ function so(t) {
|
|
|
1221
1217
|
sort: o,
|
|
1222
1218
|
q: u
|
|
1223
1219
|
} = e;
|
|
1224
|
-
let
|
|
1220
|
+
let d = t.selectFrom("keys").where(
|
|
1225
1221
|
(f) => f.or([
|
|
1226
1222
|
f("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
|
|
1227
1223
|
f("revoked_at", "is", null)
|
|
1228
1224
|
])
|
|
1229
1225
|
);
|
|
1230
|
-
u && (
|
|
1226
|
+
u && (d = J(t, d, u, [
|
|
1231
1227
|
"kid",
|
|
1232
1228
|
"connection",
|
|
1233
1229
|
"fingerprint",
|
|
1234
1230
|
"thumbprint",
|
|
1235
1231
|
"type"
|
|
1236
1232
|
]));
|
|
1237
|
-
let
|
|
1233
|
+
let c = d.select((f) => f.fn.count("kid").as("count"));
|
|
1238
1234
|
const h = n * a;
|
|
1239
|
-
|
|
1240
|
-
const p = await
|
|
1235
|
+
d = d.limit(a).offset(h), o && (d = d.orderBy(o.sort_by, o.sort_order));
|
|
1236
|
+
const p = await d.selectAll().execute();
|
|
1241
1237
|
if (!r)
|
|
1242
1238
|
return {
|
|
1243
1239
|
signingKeys: p,
|
|
@@ -1245,12 +1241,12 @@ function so(t) {
|
|
|
1245
1241
|
limit: 0,
|
|
1246
1242
|
length: 0
|
|
1247
1243
|
};
|
|
1248
|
-
const l = await
|
|
1244
|
+
const l = await c.executeTakeFirst(), w = j((l == null ? void 0 : l.count) ?? 0);
|
|
1249
1245
|
return {
|
|
1250
1246
|
signingKeys: p,
|
|
1251
1247
|
start: h,
|
|
1252
1248
|
limit: a,
|
|
1253
|
-
length:
|
|
1249
|
+
length: w
|
|
1254
1250
|
};
|
|
1255
1251
|
};
|
|
1256
1252
|
}
|
|
@@ -1272,7 +1268,7 @@ function lo(t) {
|
|
|
1272
1268
|
function _o(t) {
|
|
1273
1269
|
return async (e, n) => {
|
|
1274
1270
|
const a = {
|
|
1275
|
-
custom_domain_id: U(),
|
|
1271
|
+
custom_domain_id: n.custom_domain_id || U(),
|
|
1276
1272
|
status: "pending",
|
|
1277
1273
|
primary: !1,
|
|
1278
1274
|
...n
|
|
@@ -1323,7 +1319,7 @@ function go(t) {
|
|
|
1323
1319
|
} : null;
|
|
1324
1320
|
};
|
|
1325
1321
|
}
|
|
1326
|
-
function
|
|
1322
|
+
function wo(t) {
|
|
1327
1323
|
return {
|
|
1328
1324
|
create: _o(t),
|
|
1329
1325
|
get: fo(t),
|
|
@@ -1333,7 +1329,7 @@ function yo(t) {
|
|
|
1333
1329
|
update: po(t)
|
|
1334
1330
|
};
|
|
1335
1331
|
}
|
|
1336
|
-
function
|
|
1332
|
+
function yo(t) {
|
|
1337
1333
|
return async (e) => {
|
|
1338
1334
|
const [n] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
1339
1335
|
if (!n)
|
|
@@ -1343,8 +1339,8 @@ function wo(t) {
|
|
|
1343
1339
|
colors_primary: r,
|
|
1344
1340
|
colors_page_background_type: o,
|
|
1345
1341
|
colors_page_background_start: u,
|
|
1346
|
-
colors_page_background_end:
|
|
1347
|
-
colors_page_background_angle_dev:
|
|
1342
|
+
colors_page_background_end: d,
|
|
1343
|
+
colors_page_background_angle_dev: c,
|
|
1348
1344
|
font_url: h,
|
|
1349
1345
|
...p
|
|
1350
1346
|
} = n;
|
|
@@ -1355,8 +1351,8 @@ function wo(t) {
|
|
|
1355
1351
|
page_background: {
|
|
1356
1352
|
type: o,
|
|
1357
1353
|
start: u,
|
|
1358
|
-
end:
|
|
1359
|
-
angle_deg:
|
|
1354
|
+
end: d,
|
|
1355
|
+
angle_deg: c
|
|
1360
1356
|
}
|
|
1361
1357
|
},
|
|
1362
1358
|
font: h ? { url: h } : void 0
|
|
@@ -1365,17 +1361,17 @@ function wo(t) {
|
|
|
1365
1361
|
}
|
|
1366
1362
|
function No(t) {
|
|
1367
1363
|
return async (e, n) => {
|
|
1368
|
-
var u,
|
|
1364
|
+
var u, d, c, h, p, l, w, f, v, x, E, z, oe, Q, ye, Ct, Ne, rt;
|
|
1369
1365
|
const { colors: a, font: r, ...o } = n;
|
|
1370
1366
|
try {
|
|
1371
1367
|
await t.insertInto("branding").values({
|
|
1372
1368
|
...o,
|
|
1373
1369
|
colors_primary: a == null ? void 0 : a.primary,
|
|
1374
|
-
colors_page_background_type: (
|
|
1375
|
-
colors_page_background_start: (h = (
|
|
1370
|
+
colors_page_background_type: (d = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : d.type,
|
|
1371
|
+
colors_page_background_start: (h = (c = n.colors) == null ? void 0 : c.page_background) == null ? void 0 : h.start,
|
|
1376
1372
|
colors_page_background_end: (l = (p = n.colors) == null ? void 0 : p.page_background) == null ? void 0 : l.end,
|
|
1377
|
-
colors_page_background_angle_dev: (f = (
|
|
1378
|
-
font_url: (
|
|
1373
|
+
colors_page_background_angle_dev: (f = (w = n.colors) == null ? void 0 : w.page_background) == null ? void 0 : f.angle_deg,
|
|
1374
|
+
font_url: (v = n.font) == null ? void 0 : v.url,
|
|
1379
1375
|
tenant_id: e
|
|
1380
1376
|
}).execute();
|
|
1381
1377
|
} catch {
|
|
@@ -1384,7 +1380,7 @@ function No(t) {
|
|
|
1384
1380
|
colors_primary: a == null ? void 0 : a.primary,
|
|
1385
1381
|
colors_page_background_type: (E = (x = n.colors) == null ? void 0 : x.page_background) == null ? void 0 : E.type,
|
|
1386
1382
|
colors_page_background_start: (oe = (z = n.colors) == null ? void 0 : z.page_background) == null ? void 0 : oe.start,
|
|
1387
|
-
colors_page_background_end: (
|
|
1383
|
+
colors_page_background_end: (ye = (Q = n.colors) == null ? void 0 : Q.page_background) == null ? void 0 : ye.end,
|
|
1388
1384
|
colors_page_background_angle_dev: (Ne = (Ct = n.colors) == null ? void 0 : Ct.page_background) == null ? void 0 : Ne.angle_deg,
|
|
1389
1385
|
font_url: (rt = n.font) == null ? void 0 : rt.url
|
|
1390
1386
|
}).where("tenant_id", "=", e).execute();
|
|
@@ -1393,20 +1389,20 @@ function No(t) {
|
|
|
1393
1389
|
}
|
|
1394
1390
|
function vo(t) {
|
|
1395
1391
|
return {
|
|
1396
|
-
get:
|
|
1392
|
+
get: yo(t),
|
|
1397
1393
|
set: No(t)
|
|
1398
1394
|
};
|
|
1399
1395
|
}
|
|
1400
1396
|
function Co(t) {
|
|
1401
1397
|
return async (e, n = {}) => {
|
|
1402
1398
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1403
|
-
let
|
|
1404
|
-
u && (
|
|
1405
|
-
const p = (await
|
|
1406
|
-
const { tenant_id: f, enabled:
|
|
1399
|
+
let d = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
1400
|
+
u && (d = J(t, d, u, ["url", "form_id"]));
|
|
1401
|
+
const p = (await d.offset(a * r).limit(r).selectAll().execute()).map((w) => {
|
|
1402
|
+
const { tenant_id: f, enabled: v, synchronous: x, ...E } = w;
|
|
1407
1403
|
return T({
|
|
1408
1404
|
...E,
|
|
1409
|
-
enabled: !!
|
|
1405
|
+
enabled: !!v,
|
|
1410
1406
|
synchronous: !!x
|
|
1411
1407
|
});
|
|
1412
1408
|
});
|
|
@@ -1417,7 +1413,7 @@ function Co(t) {
|
|
|
1417
1413
|
limit: 0,
|
|
1418
1414
|
length: 0
|
|
1419
1415
|
};
|
|
1420
|
-
const { count: l } = await
|
|
1416
|
+
const { count: l } = await d.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1421
1417
|
return {
|
|
1422
1418
|
hooks: p,
|
|
1423
1419
|
start: a * r,
|
|
@@ -1633,10 +1629,10 @@ function Jo(t) {
|
|
|
1633
1629
|
credentials: r,
|
|
1634
1630
|
settings: o,
|
|
1635
1631
|
enabled: u,
|
|
1636
|
-
...
|
|
1632
|
+
...d
|
|
1637
1633
|
} = n;
|
|
1638
1634
|
return T({
|
|
1639
|
-
...
|
|
1635
|
+
...d,
|
|
1640
1636
|
credentials: JSON.parse(r),
|
|
1641
1637
|
settings: JSON.parse(o),
|
|
1642
1638
|
enabled: !!u
|
|
@@ -1717,20 +1713,20 @@ function Vo(t) {
|
|
|
1717
1713
|
}
|
|
1718
1714
|
function Go(t) {
|
|
1719
1715
|
return async (e, n = {}) => {
|
|
1720
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
1721
|
-
let
|
|
1722
|
-
|
|
1723
|
-
let h =
|
|
1716
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: d } = n;
|
|
1717
|
+
let c = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1718
|
+
d && (c = J(t, c, d, ["token", "session_id"]));
|
|
1719
|
+
let h = c;
|
|
1724
1720
|
if (u && u.sort_by) {
|
|
1725
|
-
const { ref:
|
|
1726
|
-
h = h.orderBy(
|
|
1721
|
+
const { ref: v } = t.dynamic;
|
|
1722
|
+
h = h.orderBy(v(u.sort_by), u.sort_order);
|
|
1727
1723
|
}
|
|
1728
1724
|
h = h.offset(a * r).limit(r);
|
|
1729
|
-
const l = (await h.selectAll().execute()).map((
|
|
1730
|
-
...
|
|
1731
|
-
rotating: !!
|
|
1732
|
-
device:
|
|
1733
|
-
resource_servers:
|
|
1725
|
+
const l = (await h.selectAll().execute()).map((v) => ({
|
|
1726
|
+
...v,
|
|
1727
|
+
rotating: !!v.rotating,
|
|
1728
|
+
device: v.device ? JSON.parse(v.device) : {},
|
|
1729
|
+
resource_servers: v.resource_servers ? JSON.parse(v.resource_servers) : []
|
|
1734
1730
|
}));
|
|
1735
1731
|
if (!o)
|
|
1736
1732
|
return {
|
|
@@ -1739,7 +1735,7 @@ function Go(t) {
|
|
|
1739
1735
|
limit: 0,
|
|
1740
1736
|
length: 0
|
|
1741
1737
|
};
|
|
1742
|
-
const { count:
|
|
1738
|
+
const { count: w } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(w);
|
|
1743
1739
|
return {
|
|
1744
1740
|
refresh_tokens: l,
|
|
1745
1741
|
start: a * r,
|
|
@@ -1808,10 +1804,10 @@ function Xo(t) {
|
|
|
1808
1804
|
function Zo(t) {
|
|
1809
1805
|
return async (e, n = {}) => {
|
|
1810
1806
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1811
|
-
let
|
|
1812
|
-
u && (
|
|
1813
|
-
const p = (await
|
|
1814
|
-
const f = { ...
|
|
1807
|
+
let d = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1808
|
+
u && (d = J(t, d, u, []));
|
|
1809
|
+
const p = (await d.offset(a * r).limit(r).selectAll().execute()).map((w) => {
|
|
1810
|
+
const f = { ...w };
|
|
1815
1811
|
if (typeof f.nodes == "string")
|
|
1816
1812
|
try {
|
|
1817
1813
|
f.nodes = JSON.parse(f.nodes);
|
|
@@ -1836,7 +1832,7 @@ function Zo(t) {
|
|
|
1836
1832
|
limit: 0,
|
|
1837
1833
|
length: 0
|
|
1838
1834
|
};
|
|
1839
|
-
const { count: l } = await
|
|
1835
|
+
const { count: l } = await d.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1840
1836
|
return {
|
|
1841
1837
|
forms: p,
|
|
1842
1838
|
start: a * r,
|
|
@@ -1903,23 +1899,23 @@ function ri(t) {
|
|
|
1903
1899
|
updated_at: a
|
|
1904
1900
|
}, o = Va.parse(r), {
|
|
1905
1901
|
verificationKey: u,
|
|
1906
|
-
scopes:
|
|
1907
|
-
options:
|
|
1902
|
+
scopes: d,
|
|
1903
|
+
options: c,
|
|
1908
1904
|
skip_consent_for_verifiable_first_party_clients: h,
|
|
1909
1905
|
allow_offline_access: p,
|
|
1910
1906
|
...l
|
|
1911
|
-
} = o,
|
|
1907
|
+
} = o, w = {
|
|
1912
1908
|
...l,
|
|
1913
1909
|
tenant_id: e,
|
|
1914
|
-
scopes:
|
|
1915
|
-
options:
|
|
1910
|
+
scopes: d ? JSON.stringify(d) : "[]",
|
|
1911
|
+
options: c ? JSON.stringify(c) : "{}",
|
|
1916
1912
|
skip_consent_for_verifiable_first_party_clients: h ? 1 : 0,
|
|
1917
1913
|
allow_offline_access: p ? 1 : 0,
|
|
1918
1914
|
verification_key: u,
|
|
1919
1915
|
created_at: a,
|
|
1920
1916
|
updated_at: a
|
|
1921
1917
|
};
|
|
1922
|
-
return await t.insertInto("resource_servers").values(
|
|
1918
|
+
return await t.insertInto("resource_servers").values(w).execute(), T(o);
|
|
1923
1919
|
};
|
|
1924
1920
|
}
|
|
1925
1921
|
function oi(t) {
|
|
@@ -1929,15 +1925,15 @@ function oi(t) {
|
|
|
1929
1925
|
const r = a, {
|
|
1930
1926
|
verification_key: o,
|
|
1931
1927
|
scopes: u,
|
|
1932
|
-
options:
|
|
1933
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1928
|
+
options: d,
|
|
1929
|
+
skip_consent_for_verifiable_first_party_clients: c,
|
|
1934
1930
|
allow_offline_access: h,
|
|
1935
1931
|
...p
|
|
1936
1932
|
} = r, l = {
|
|
1937
1933
|
...p,
|
|
1938
1934
|
scopes: u ? JSON.parse(u) : [],
|
|
1939
|
-
options:
|
|
1940
|
-
skip_consent_for_verifiable_first_party_clients: !!
|
|
1935
|
+
options: d ? JSON.parse(d) : {},
|
|
1936
|
+
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
1941
1937
|
allow_offline_access: !!h,
|
|
1942
1938
|
// Convert verification_key back to verificationKey for API
|
|
1943
1939
|
verificationKey: o
|
|
@@ -1948,36 +1944,36 @@ function oi(t) {
|
|
|
1948
1944
|
function ii(t) {
|
|
1949
1945
|
return async (e, n = {}) => {
|
|
1950
1946
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1951
|
-
let
|
|
1947
|
+
let d = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1952
1948
|
if (u) {
|
|
1953
|
-
const
|
|
1949
|
+
const w = u.trim(), f = w.split(/\s+/), v = f.length === 1 ? f[0] : void 0, x = v ? v.match(/^(-)?(name|identifier):(.*)$/) : null, E = x ? x[3] : "", z = /^(>=|>|<=|<)/.test(E || "");
|
|
1954
1950
|
if (x && !z) {
|
|
1955
1951
|
const oe = !!x[1], Q = x[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1956
|
-
|
|
1952
|
+
d = oe ? d.where(Q, "not like", `%${E}%`) : d.where(Q, "like", `%${E}%`);
|
|
1957
1953
|
} else
|
|
1958
|
-
|
|
1954
|
+
d = J(t, d, w, [
|
|
1959
1955
|
"resource_servers.name",
|
|
1960
1956
|
"resource_servers.identifier"
|
|
1961
1957
|
]);
|
|
1962
1958
|
}
|
|
1963
|
-
const p = (await
|
|
1964
|
-
const f =
|
|
1965
|
-
verification_key:
|
|
1959
|
+
const p = (await d.offset(a * r).limit(r).selectAll().execute()).map((w) => {
|
|
1960
|
+
const f = w, {
|
|
1961
|
+
verification_key: v,
|
|
1966
1962
|
scopes: x,
|
|
1967
1963
|
options: E,
|
|
1968
1964
|
skip_consent_for_verifiable_first_party_clients: z,
|
|
1969
1965
|
allow_offline_access: oe,
|
|
1970
1966
|
...Q
|
|
1971
|
-
} = f,
|
|
1967
|
+
} = f, ye = {
|
|
1972
1968
|
...Q,
|
|
1973
1969
|
scopes: x ? JSON.parse(x) : [],
|
|
1974
1970
|
options: E ? JSON.parse(E) : {},
|
|
1975
1971
|
skip_consent_for_verifiable_first_party_clients: !!z,
|
|
1976
1972
|
allow_offline_access: !!oe,
|
|
1977
1973
|
// Convert verification_key back to verificationKey for API
|
|
1978
|
-
verificationKey:
|
|
1974
|
+
verificationKey: v
|
|
1979
1975
|
};
|
|
1980
|
-
return T(
|
|
1976
|
+
return T(ye);
|
|
1981
1977
|
});
|
|
1982
1978
|
if (!o)
|
|
1983
1979
|
return {
|
|
@@ -1986,7 +1982,7 @@ function ii(t) {
|
|
|
1986
1982
|
limit: 0,
|
|
1987
1983
|
length: 0
|
|
1988
1984
|
};
|
|
1989
|
-
const { count: l } = await
|
|
1985
|
+
const { count: l } = await d.select((w) => w.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1990
1986
|
return {
|
|
1991
1987
|
resource_servers: p,
|
|
1992
1988
|
start: a * r,
|
|
@@ -2007,23 +2003,23 @@ function ui(t) {
|
|
|
2007
2003
|
verificationKey: r,
|
|
2008
2004
|
scopes: o,
|
|
2009
2005
|
options: u,
|
|
2010
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
2011
|
-
allow_offline_access:
|
|
2006
|
+
skip_consent_for_verifiable_first_party_clients: d,
|
|
2007
|
+
allow_offline_access: c,
|
|
2012
2008
|
...h
|
|
2013
2009
|
} = a, p = {
|
|
2014
2010
|
...h,
|
|
2015
2011
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2016
2012
|
};
|
|
2017
2013
|
if (r !== void 0 && (p.verification_key = r), o !== void 0 && (p.scopes = JSON.stringify(o)), u !== void 0) {
|
|
2018
|
-
const
|
|
2019
|
-
p.options = JSON.stringify(
|
|
2014
|
+
const w = await t.selectFrom("resource_servers").select("options").where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst(), v = { ...w != null && w.options ? JSON.parse(w.options) : {}, ...u };
|
|
2015
|
+
p.options = JSON.stringify(v);
|
|
2020
2016
|
}
|
|
2021
|
-
|
|
2017
|
+
d !== void 0 && (p.skip_consent_for_verifiable_first_party_clients = d ? 1 : 0), c !== void 0 && (p.allow_offline_access = c ? 1 : 0);
|
|
2022
2018
|
const l = await t.updateTable("resource_servers").set(p).where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst();
|
|
2023
2019
|
return Number(l.numUpdatedRows) > 0;
|
|
2024
2020
|
};
|
|
2025
2021
|
}
|
|
2026
|
-
function
|
|
2022
|
+
function di(t) {
|
|
2027
2023
|
return {
|
|
2028
2024
|
create: ri(t),
|
|
2029
2025
|
get: oi(t),
|
|
@@ -2032,7 +2028,7 @@ function ci(t) {
|
|
|
2032
2028
|
update: ui(t)
|
|
2033
2029
|
};
|
|
2034
2030
|
}
|
|
2035
|
-
function
|
|
2031
|
+
function ci(t) {
|
|
2036
2032
|
return async (e, n) => {
|
|
2037
2033
|
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), o = {
|
|
2038
2034
|
id: r,
|
|
@@ -2062,17 +2058,17 @@ function _i(t) {
|
|
|
2062
2058
|
let a = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
2063
2059
|
const { page: r = 0, per_page: o = 50, include_totals: u = !1 } = n;
|
|
2064
2060
|
n.q && (a = J(t, a, n.q, ["name"]));
|
|
2065
|
-
const
|
|
2061
|
+
const c = await a.offset(r * o).limit(o).selectAll().execute();
|
|
2066
2062
|
if (!u)
|
|
2067
2063
|
return {
|
|
2068
|
-
roles:
|
|
2064
|
+
roles: c,
|
|
2069
2065
|
start: r * o,
|
|
2070
2066
|
limit: o,
|
|
2071
|
-
length:
|
|
2067
|
+
length: c.length
|
|
2072
2068
|
};
|
|
2073
2069
|
const { count: h } = await a.select((p) => p.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
2074
2070
|
return {
|
|
2075
|
-
roles:
|
|
2071
|
+
roles: c,
|
|
2076
2072
|
start: r * o,
|
|
2077
2073
|
limit: o,
|
|
2078
2074
|
length: j(h)
|
|
@@ -2096,7 +2092,7 @@ function hi(t) {
|
|
|
2096
2092
|
}
|
|
2097
2093
|
function fi(t) {
|
|
2098
2094
|
return {
|
|
2099
|
-
create:
|
|
2095
|
+
create: ci(t),
|
|
2100
2096
|
get: li(t),
|
|
2101
2097
|
list: _i(t),
|
|
2102
2098
|
update: mi(t),
|
|
@@ -2122,10 +2118,10 @@ function pi(t) {
|
|
|
2122
2118
|
};
|
|
2123
2119
|
try {
|
|
2124
2120
|
await t.insertInto("role_permissions").values(u).execute();
|
|
2125
|
-
} catch (
|
|
2126
|
-
if (
|
|
2121
|
+
} catch (d) {
|
|
2122
|
+
if (d.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || d.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
2127
2123
|
continue;
|
|
2128
|
-
throw
|
|
2124
|
+
throw d;
|
|
2129
2125
|
}
|
|
2130
2126
|
}
|
|
2131
2127
|
return !0;
|
|
@@ -2152,10 +2148,10 @@ function gi(t) {
|
|
|
2152
2148
|
}
|
|
2153
2149
|
};
|
|
2154
2150
|
}
|
|
2155
|
-
function
|
|
2151
|
+
function wi(t) {
|
|
2156
2152
|
return async (e, n, a = {}) => {
|
|
2157
2153
|
const { page: r = 0, per_page: o = 50, include_totals: u = !1 } = a;
|
|
2158
|
-
let
|
|
2154
|
+
let d = t.selectFrom("role_permissions").leftJoin(
|
|
2159
2155
|
"resource_servers",
|
|
2160
2156
|
(l) => l.onRef(
|
|
2161
2157
|
"role_permissions.tenant_id",
|
|
@@ -2173,7 +2169,7 @@ function yi(t) {
|
|
|
2173
2169
|
"role_permissions.created_at",
|
|
2174
2170
|
"resource_servers.name as resource_server_name"
|
|
2175
2171
|
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=", n);
|
|
2176
|
-
const p = (await
|
|
2172
|
+
const p = (await d.offset(r * o).limit(o).execute()).map((l) => ({
|
|
2177
2173
|
role_id: l.role_id,
|
|
2178
2174
|
resource_server_identifier: l.resource_server_identifier,
|
|
2179
2175
|
resource_server_name: l.resource_server_name || l.resource_server_identifier,
|
|
@@ -2183,14 +2179,14 @@ function yi(t) {
|
|
|
2183
2179
|
// No description available from role_permissions directly
|
|
2184
2180
|
created_at: l.created_at
|
|
2185
2181
|
}));
|
|
2186
|
-
return u && await
|
|
2182
|
+
return u && await d.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), p;
|
|
2187
2183
|
};
|
|
2188
2184
|
}
|
|
2189
|
-
function
|
|
2185
|
+
function yi(t) {
|
|
2190
2186
|
return {
|
|
2191
2187
|
assign: pi(t),
|
|
2192
2188
|
remove: gi(t),
|
|
2193
|
-
list:
|
|
2189
|
+
list: wi(t)
|
|
2194
2190
|
};
|
|
2195
2191
|
}
|
|
2196
2192
|
function Ni(t) {
|
|
@@ -2229,7 +2225,7 @@ function Ci(t) {
|
|
|
2229
2225
|
return async (e, n, a, r) => {
|
|
2230
2226
|
let o = t.selectFrom("user_permissions").leftJoin(
|
|
2231
2227
|
"resource_servers",
|
|
2232
|
-
(
|
|
2228
|
+
(d) => d.onRef(
|
|
2233
2229
|
"user_permissions.tenant_id",
|
|
2234
2230
|
"=",
|
|
2235
2231
|
"resource_servers.tenant_id"
|
|
@@ -2250,16 +2246,16 @@ function Ci(t) {
|
|
|
2250
2246
|
"user_permissions.organization_id",
|
|
2251
2247
|
"=",
|
|
2252
2248
|
r
|
|
2253
|
-
)), (await o.execute()).map((
|
|
2254
|
-
resource_server_identifier:
|
|
2255
|
-
permission_name:
|
|
2249
|
+
)), (await o.execute()).map((d) => ({
|
|
2250
|
+
resource_server_identifier: d.resource_server_identifier,
|
|
2251
|
+
permission_name: d.permission_name,
|
|
2256
2252
|
description: null,
|
|
2257
2253
|
// No description available from user_permissions directly
|
|
2258
|
-
resource_server_name:
|
|
2254
|
+
resource_server_name: d.resource_server_name || d.resource_server_identifier,
|
|
2259
2255
|
// Fallback to identifier if name is null
|
|
2260
|
-
user_id:
|
|
2261
|
-
created_at:
|
|
2262
|
-
organization_id:
|
|
2256
|
+
user_id: d.user_id,
|
|
2257
|
+
created_at: d.created_at,
|
|
2258
|
+
organization_id: d.organization_id === "" ? void 0 : d.organization_id
|
|
2263
2259
|
}));
|
|
2264
2260
|
};
|
|
2265
2261
|
}
|
|
@@ -2282,7 +2278,7 @@ function Ti(t) {
|
|
|
2282
2278
|
return async (e, n, a, r) => {
|
|
2283
2279
|
let o = t.selectFrom("user_roles as ur").innerJoin(
|
|
2284
2280
|
"roles as r",
|
|
2285
|
-
(
|
|
2281
|
+
(d) => d.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
2286
2282
|
).select([
|
|
2287
2283
|
"r.id",
|
|
2288
2284
|
"r.name",
|
|
@@ -2405,8 +2401,8 @@ function Pi(t) {
|
|
|
2405
2401
|
}
|
|
2406
2402
|
function Di(t) {
|
|
2407
2403
|
return async (e, n, a) => {
|
|
2408
|
-
const { branding: r, metadata: o, enabled_connections: u, token_quota:
|
|
2409
|
-
...
|
|
2404
|
+
const { branding: r, metadata: o, enabled_connections: u, token_quota: d, ...c } = a, h = {
|
|
2405
|
+
...c,
|
|
2410
2406
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2411
2407
|
};
|
|
2412
2408
|
return Nt(
|
|
@@ -2473,20 +2469,20 @@ function ji(t) {
|
|
|
2473
2469
|
}
|
|
2474
2470
|
}
|
|
2475
2471
|
u = u.orderBy("created_at", "desc"), r > 0 && (u = u.limit(r).offset(o));
|
|
2476
|
-
const
|
|
2477
|
-
let
|
|
2472
|
+
const d = await u.execute();
|
|
2473
|
+
let c = t.selectFrom("user_organizations").select(t.fn.count("id").as("count")).where("tenant_id", "=", e);
|
|
2478
2474
|
if (n != null && n.q) {
|
|
2479
2475
|
if (n.q.startsWith("user_id:")) {
|
|
2480
2476
|
const l = n.q.replace("user_id:", "");
|
|
2481
|
-
|
|
2477
|
+
c = c.where("user_id", "=", l);
|
|
2482
2478
|
} else if (n.q.startsWith("organization_id:")) {
|
|
2483
2479
|
const l = n.q.replace("organization_id:", "");
|
|
2484
|
-
|
|
2480
|
+
c = c.where("organization_id", "=", l);
|
|
2485
2481
|
}
|
|
2486
2482
|
}
|
|
2487
|
-
const h = await
|
|
2483
|
+
const h = await c.executeTakeFirst();
|
|
2488
2484
|
return {
|
|
2489
|
-
userOrganizations:
|
|
2485
|
+
userOrganizations: d.map((l) => ({
|
|
2490
2486
|
id: l.id,
|
|
2491
2487
|
user_id: l.user_id,
|
|
2492
2488
|
organization_id: l.organization_id,
|
|
@@ -2502,7 +2498,7 @@ function ji(t) {
|
|
|
2502
2498
|
function Li(t) {
|
|
2503
2499
|
return async (e, n, a) => {
|
|
2504
2500
|
const r = (a == null ? void 0 : a.page) || 0, o = (a == null ? void 0 : a.per_page) || 50, u = r * o;
|
|
2505
|
-
let
|
|
2501
|
+
let d = t.selectFrom("user_organizations").innerJoin(
|
|
2506
2502
|
"organizations",
|
|
2507
2503
|
"organizations.id",
|
|
2508
2504
|
"user_organizations.organization_id"
|
|
@@ -2518,14 +2514,14 @@ function Li(t) {
|
|
|
2518
2514
|
"organizations.updated_at",
|
|
2519
2515
|
"user_organizations.created_at as joined_at"
|
|
2520
2516
|
]).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", n);
|
|
2521
|
-
|
|
2522
|
-
const
|
|
2517
|
+
d = d.orderBy("user_organizations.created_at", "desc"), o > 0 && (d = d.limit(o).offset(u));
|
|
2518
|
+
const c = await d.execute(), h = await t.selectFrom("user_organizations").innerJoin(
|
|
2523
2519
|
"organizations",
|
|
2524
2520
|
"organizations.id",
|
|
2525
2521
|
"user_organizations.organization_id"
|
|
2526
2522
|
).select(t.fn.count("user_organizations.id").as("count")).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", n).executeTakeFirst();
|
|
2527
2523
|
return {
|
|
2528
|
-
organizations:
|
|
2524
|
+
organizations: c.map((l) => ({
|
|
2529
2525
|
id: l.id,
|
|
2530
2526
|
name: l.name,
|
|
2531
2527
|
display_name: l.display_name,
|
|
@@ -2569,7 +2565,7 @@ function qi(t) {
|
|
|
2569
2565
|
}
|
|
2570
2566
|
function Bi(t) {
|
|
2571
2567
|
return async (e, n) => {
|
|
2572
|
-
const a = Jr(), r = (/* @__PURE__ */ new Date()).toISOString(), o = n.ttl_sec || 604800, u = new Date(Date.now() + o * 1e3).toISOString(),
|
|
2568
|
+
const a = Jr(), r = (/* @__PURE__ */ new Date()).toISOString(), o = n.ttl_sec || 604800, u = new Date(Date.now() + o * 1e3).toISOString(), d = Nt(
|
|
2573
2569
|
{
|
|
2574
2570
|
id: a,
|
|
2575
2571
|
tenant_id: e,
|
|
@@ -2591,15 +2587,15 @@ function Bi(t) {
|
|
|
2591
2587
|
["inviter", "invitee", "app_metadata", "user_metadata", "roles"]
|
|
2592
2588
|
);
|
|
2593
2589
|
try {
|
|
2594
|
-
await t.insertInto("invites").values(
|
|
2595
|
-
} catch (
|
|
2596
|
-
throw
|
|
2590
|
+
await t.insertInto("invites").values(d).execute();
|
|
2591
|
+
} catch (c) {
|
|
2592
|
+
throw c.code === "SQLITE_CONSTRAINT_UNIQUE" || c.message.includes("AlreadyExists") ? new et(409, {
|
|
2597
2593
|
message: "Invite already exists"
|
|
2598
|
-
}) :
|
|
2594
|
+
}) : c;
|
|
2599
2595
|
}
|
|
2600
2596
|
return {
|
|
2601
2597
|
id: a,
|
|
2602
|
-
organization_id:
|
|
2598
|
+
organization_id: d.organization_id,
|
|
2603
2599
|
inviter: n.inviter,
|
|
2604
2600
|
invitee: n.invitee,
|
|
2605
2601
|
client_id: n.client_id,
|
|
@@ -2610,7 +2606,7 @@ function Bi(t) {
|
|
|
2610
2606
|
app_metadata: n.app_metadata || {},
|
|
2611
2607
|
user_metadata: n.user_metadata || {},
|
|
2612
2608
|
roles: n.roles || [],
|
|
2613
|
-
ticket_id:
|
|
2609
|
+
ticket_id: d.ticket_id || void 0,
|
|
2614
2610
|
ttl_sec: o,
|
|
2615
2611
|
send_invitation_email: n.send_invitation_email ?? !0
|
|
2616
2612
|
};
|
|
@@ -2659,7 +2655,7 @@ function Ui(t) {
|
|
|
2659
2655
|
a = a.offset(u);
|
|
2660
2656
|
}
|
|
2661
2657
|
const o = (await a.execute()).map((u) => {
|
|
2662
|
-
const
|
|
2658
|
+
const d = ea(u, {
|
|
2663
2659
|
inviter: {},
|
|
2664
2660
|
invitee: {},
|
|
2665
2661
|
app_metadata: {},
|
|
@@ -2667,7 +2663,7 @@ function Ui(t) {
|
|
|
2667
2663
|
roles: []
|
|
2668
2664
|
});
|
|
2669
2665
|
return T({
|
|
2670
|
-
...
|
|
2666
|
+
...d,
|
|
2671
2667
|
send_invitation_email: u.send_invitation_email === 1
|
|
2672
2668
|
});
|
|
2673
2669
|
});
|
|
@@ -2762,7 +2758,7 @@ const F = s({
|
|
|
2762
2758
|
identifier: F.create(e)
|
|
2763
2759
|
});
|
|
2764
2760
|
}
|
|
2765
|
-
}),
|
|
2761
|
+
}), we = s({
|
|
2766
2762
|
is(t) {
|
|
2767
2763
|
return t.kind === "AliasNode";
|
|
2768
2764
|
},
|
|
@@ -2968,7 +2964,7 @@ const H = s({
|
|
|
2968
2964
|
function In(t) {
|
|
2969
2965
|
return Y(t) && ra.includes(t);
|
|
2970
2966
|
}
|
|
2971
|
-
const
|
|
2967
|
+
const wn = s({
|
|
2972
2968
|
is(t) {
|
|
2973
2969
|
return t.kind === "ColumnNode";
|
|
2974
2970
|
},
|
|
@@ -3044,7 +3040,7 @@ const Zt = s({
|
|
|
3044
3040
|
function os(t) {
|
|
3045
3041
|
return t === "asc" || t === "desc";
|
|
3046
3042
|
}
|
|
3047
|
-
function
|
|
3043
|
+
function yn(t) {
|
|
3048
3044
|
if (t.length === 2)
|
|
3049
3045
|
return [Gt(t[0], t[1])];
|
|
3050
3046
|
if (t.length === 1) {
|
|
@@ -3152,31 +3148,31 @@ function us(t, e) {
|
|
|
3152
3148
|
function fe(t) {
|
|
3153
3149
|
const e = ".";
|
|
3154
3150
|
if (!t.includes(e))
|
|
3155
|
-
return qt.create(
|
|
3156
|
-
const n = t.split(e).map(
|
|
3151
|
+
return qt.create(wn.create(t));
|
|
3152
|
+
const n = t.split(e).map(da);
|
|
3157
3153
|
if (n.length === 3)
|
|
3158
|
-
return
|
|
3154
|
+
return cs(n);
|
|
3159
3155
|
if (n.length === 2)
|
|
3160
3156
|
return ls(n);
|
|
3161
3157
|
throw new Error(`invalid column reference ${t}`);
|
|
3162
3158
|
}
|
|
3163
|
-
function
|
|
3159
|
+
function ds(t) {
|
|
3164
3160
|
const e = " as ";
|
|
3165
3161
|
if (t.includes(e)) {
|
|
3166
|
-
const [n, a] = t.split(e).map(
|
|
3167
|
-
return
|
|
3162
|
+
const [n, a] = t.split(e).map(da);
|
|
3163
|
+
return we.create(fe(n), F.create(a));
|
|
3168
3164
|
} else
|
|
3169
3165
|
return fe(t);
|
|
3170
3166
|
}
|
|
3171
|
-
function
|
|
3167
|
+
function cs(t) {
|
|
3172
3168
|
const [e, n, a] = t;
|
|
3173
|
-
return qt.create(
|
|
3169
|
+
return qt.create(wn.create(a), _e.createWithSchema(e, n));
|
|
3174
3170
|
}
|
|
3175
3171
|
function ls(t) {
|
|
3176
3172
|
const [e, n] = t;
|
|
3177
|
-
return qt.create(
|
|
3173
|
+
return qt.create(wn.create(n), _e.create(e));
|
|
3178
3174
|
}
|
|
3179
|
-
function
|
|
3175
|
+
function da(t) {
|
|
3180
3176
|
return t.trim();
|
|
3181
3177
|
}
|
|
3182
3178
|
const _s = s({
|
|
@@ -3253,13 +3249,13 @@ function K(t) {
|
|
|
3253
3249
|
throw new Error(`invalid arguments: ${JSON.stringify(t)}`);
|
|
3254
3250
|
}
|
|
3255
3251
|
function Cn(t, e, n) {
|
|
3256
|
-
return ps(e) &&
|
|
3252
|
+
return ps(e) && ca(n) ? tt.create(L(t), tn(e), pe.createImmediate(n)) : tt.create(L(t), tn(e), hs(n));
|
|
3257
3253
|
}
|
|
3258
3254
|
function ht(t, e, n) {
|
|
3259
3255
|
return tt.create(L(t), tn(e), L(n));
|
|
3260
3256
|
}
|
|
3261
3257
|
function En(t, e) {
|
|
3262
|
-
return en(Object.entries(t).filter(([, n]) => !Ot(n)).map(([n, a]) => Cn(n,
|
|
3258
|
+
return en(Object.entries(t).filter(([, n]) => !Ot(n)).map(([n, a]) => Cn(n, ca(a) ? "is" : "=", a)), e);
|
|
3263
3259
|
}
|
|
3264
3260
|
function en(t, e, n = !0) {
|
|
3265
3261
|
const a = e === "and" ? he.create : at.create;
|
|
@@ -3273,7 +3269,7 @@ function en(t, e, n = !0) {
|
|
|
3273
3269
|
function ps(t) {
|
|
3274
3270
|
return t === "is" || t === "is not";
|
|
3275
3271
|
}
|
|
3276
|
-
function
|
|
3272
|
+
function ca(t) {
|
|
3277
3273
|
return na(t) || ta(t);
|
|
3278
3274
|
}
|
|
3279
3275
|
function tn(t) {
|
|
@@ -3506,13 +3502,13 @@ function Ae(t, e) {
|
|
|
3506
3502
|
});
|
|
3507
3503
|
}
|
|
3508
3504
|
var B;
|
|
3509
|
-
const
|
|
3505
|
+
const ct = class ct {
|
|
3510
3506
|
constructor(e) {
|
|
3511
3507
|
C(this, B);
|
|
3512
3508
|
b(this, B, s(e));
|
|
3513
3509
|
}
|
|
3514
3510
|
on(...e) {
|
|
3515
|
-
return new
|
|
3511
|
+
return new ct({
|
|
3516
3512
|
...i(this, B),
|
|
3517
3513
|
joinNode: st.cloneWithOn(i(this, B).joinNode, K(e))
|
|
3518
3514
|
});
|
|
@@ -3524,7 +3520,7 @@ const dt = class dt {
|
|
|
3524
3520
|
* See {@link WhereInterface.whereRef} for documentation and examples.
|
|
3525
3521
|
*/
|
|
3526
3522
|
onRef(e, n, a) {
|
|
3527
|
-
return new
|
|
3523
|
+
return new ct({
|
|
3528
3524
|
...i(this, B),
|
|
3529
3525
|
joinNode: st.cloneWithOn(i(this, B).joinNode, ht(e, n, a))
|
|
3530
3526
|
});
|
|
@@ -3533,7 +3529,7 @@ const dt = class dt {
|
|
|
3533
3529
|
* Adds `on true`.
|
|
3534
3530
|
*/
|
|
3535
3531
|
onTrue() {
|
|
3536
|
-
return new
|
|
3532
|
+
return new ct({
|
|
3537
3533
|
...i(this, B),
|
|
3538
3534
|
joinNode: st.cloneWithOn(i(this, B).joinNode, R.createWithSql("true"))
|
|
3539
3535
|
});
|
|
@@ -3550,7 +3546,7 @@ const dt = class dt {
|
|
|
3550
3546
|
}
|
|
3551
3547
|
};
|
|
3552
3548
|
B = new WeakMap();
|
|
3553
|
-
let It =
|
|
3549
|
+
let It = ct;
|
|
3554
3550
|
Ae(It, "don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");
|
|
3555
3551
|
const gs = s({
|
|
3556
3552
|
is(t) {
|
|
@@ -3563,7 +3559,7 @@ const gs = s({
|
|
|
3563
3559
|
});
|
|
3564
3560
|
}
|
|
3565
3561
|
});
|
|
3566
|
-
function
|
|
3562
|
+
function ws(t) {
|
|
3567
3563
|
return _t(t).map(gs.create);
|
|
3568
3564
|
}
|
|
3569
3565
|
var ve;
|
|
@@ -3595,12 +3591,12 @@ const zt = class zt {
|
|
|
3595
3591
|
*/
|
|
3596
3592
|
orderBy(e, n) {
|
|
3597
3593
|
return new zt({
|
|
3598
|
-
overNode: nn.cloneWithOrderByItems(i(this, ve).overNode,
|
|
3594
|
+
overNode: nn.cloneWithOrderByItems(i(this, ve).overNode, yn([e, n]))
|
|
3599
3595
|
});
|
|
3600
3596
|
}
|
|
3601
3597
|
partitionBy(e) {
|
|
3602
3598
|
return new zt({
|
|
3603
|
-
overNode: nn.cloneWithPartitionByItems(i(this, ve).overNode,
|
|
3599
|
+
overNode: nn.cloneWithPartitionByItems(i(this, ve).overNode, ws(e))
|
|
3604
3600
|
});
|
|
3605
3601
|
}
|
|
3606
3602
|
/**
|
|
@@ -3617,7 +3613,7 @@ const zt = class zt {
|
|
|
3617
3613
|
ve = new WeakMap();
|
|
3618
3614
|
let Et = zt;
|
|
3619
3615
|
Ae(Et, "don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");
|
|
3620
|
-
const
|
|
3616
|
+
const dt = s({
|
|
3621
3617
|
is(t) {
|
|
3622
3618
|
return t.kind === "SelectionNode";
|
|
3623
3619
|
},
|
|
@@ -3644,17 +3640,17 @@ function la(t) {
|
|
|
3644
3640
|
return Ee(t) ? la(t(Wt())) : me(t) ? t.map((e) => zn(e)) : [zn(t)];
|
|
3645
3641
|
}
|
|
3646
3642
|
function zn(t) {
|
|
3647
|
-
return Y(t) ?
|
|
3643
|
+
return Y(t) ? dt.create(ds(t)) : ia(t) ? dt.create(t.toOperationNode()) : dt.create(va(t));
|
|
3648
3644
|
}
|
|
3649
3645
|
function _a(t) {
|
|
3650
|
-
return t ? Array.isArray(t) ? t.map(Rn) : [Rn(t)] : [
|
|
3646
|
+
return t ? Array.isArray(t) ? t.map(Rn) : [Rn(t)] : [dt.createSelectAll()];
|
|
3651
3647
|
}
|
|
3652
3648
|
function Rn(t) {
|
|
3653
3649
|
if (Y(t))
|
|
3654
|
-
return
|
|
3650
|
+
return dt.createSelectAllFromTable(W(t));
|
|
3655
3651
|
throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`);
|
|
3656
3652
|
}
|
|
3657
|
-
const
|
|
3653
|
+
const ys = s({
|
|
3658
3654
|
is(t) {
|
|
3659
3655
|
return t.kind === "InsertQueryNode";
|
|
3660
3656
|
},
|
|
@@ -3877,7 +3873,7 @@ const ws = s({
|
|
|
3877
3873
|
}
|
|
3878
3874
|
}), A = s({
|
|
3879
3875
|
is(t) {
|
|
3880
|
-
return S.is(t) ||
|
|
3876
|
+
return S.is(t) || ys.is(t) || Ns.is(t) || vs.is(t) || xs.is(t);
|
|
3881
3877
|
},
|
|
3882
3878
|
cloneWithEndModifier(t, e) {
|
|
3883
3879
|
return s({
|
|
@@ -4938,12 +4934,12 @@ class Rs extends Ps {
|
|
|
4938
4934
|
b(this, qe, n);
|
|
4939
4935
|
}
|
|
4940
4936
|
transformNodeImpl(n) {
|
|
4941
|
-
if (!
|
|
4937
|
+
if (!y(this, I, ma).call(this, n))
|
|
4942
4938
|
return super.transformNodeImpl(n);
|
|
4943
|
-
const a =
|
|
4939
|
+
const a = y(this, I, fa).call(this, n);
|
|
4944
4940
|
for (const u of a)
|
|
4945
4941
|
i(this, xe).add(u);
|
|
4946
|
-
const r =
|
|
4942
|
+
const r = y(this, I, ha).call(this, n);
|
|
4947
4943
|
for (const u of r)
|
|
4948
4944
|
i(this, Ce).add(u);
|
|
4949
4945
|
const o = super.transformNodeImpl(n);
|
|
@@ -4970,13 +4966,13 @@ class Rs extends Ps {
|
|
|
4970
4966
|
transformAggregateFunction(n) {
|
|
4971
4967
|
return {
|
|
4972
4968
|
...super.transformAggregateFunction({ ...n, aggregated: [] }),
|
|
4973
|
-
aggregated:
|
|
4969
|
+
aggregated: y(this, I, an).call(this, n, "aggregated")
|
|
4974
4970
|
};
|
|
4975
4971
|
}
|
|
4976
4972
|
transformFunction(n) {
|
|
4977
4973
|
return {
|
|
4978
4974
|
...super.transformFunction({ ...n, arguments: [] }),
|
|
4979
|
-
arguments:
|
|
4975
|
+
arguments: y(this, I, an).call(this, n, "arguments")
|
|
4980
4976
|
};
|
|
4981
4977
|
}
|
|
4982
4978
|
}
|
|
@@ -4989,19 +4985,19 @@ qe = new WeakMap(), Ce = new WeakMap(), xe = new WeakMap(), I = new WeakSet(), a
|
|
|
4989
4985
|
return n.kind in Ds;
|
|
4990
4986
|
}, ha = function(n) {
|
|
4991
4987
|
const a = /* @__PURE__ */ new Set();
|
|
4992
|
-
if ("name" in n && n.name && Xt.is(n.name) &&
|
|
4988
|
+
if ("name" in n && n.name && Xt.is(n.name) && y(this, I, rn).call(this, n.name, a), "from" in n && n.from)
|
|
4993
4989
|
for (const r of n.from.froms)
|
|
4994
|
-
|
|
4995
|
-
if ("into" in n && n.into &&
|
|
4990
|
+
y(this, I, De).call(this, r, a);
|
|
4991
|
+
if ("into" in n && n.into && y(this, I, De).call(this, n.into, a), "table" in n && n.table && y(this, I, De).call(this, n.table, a), "joins" in n && n.joins)
|
|
4996
4992
|
for (const r of n.joins)
|
|
4997
|
-
|
|
4998
|
-
return "using" in n && n.using &&
|
|
4993
|
+
y(this, I, De).call(this, r.table, a);
|
|
4994
|
+
return "using" in n && n.using && y(this, I, De).call(this, n.using, a), a;
|
|
4999
4995
|
}, fa = function(n) {
|
|
5000
4996
|
const a = /* @__PURE__ */ new Set();
|
|
5001
|
-
return "with" in n && n.with &&
|
|
4997
|
+
return "with" in n && n.with && y(this, I, pa).call(this, n.with, a), a;
|
|
5002
4998
|
}, De = function(n, a) {
|
|
5003
|
-
const r = _e.is(n) ? n :
|
|
5004
|
-
r &&
|
|
4999
|
+
const r = _e.is(n) ? n : we.is(n) && _e.is(n.node) ? n.node : null;
|
|
5000
|
+
r && y(this, I, rn).call(this, r.table, a);
|
|
5005
5001
|
}, rn = function(n, a) {
|
|
5006
5002
|
const r = n.identifier.name;
|
|
5007
5003
|
!i(this, Ce).has(r) && !i(this, xe).has(r) && a.add(r);
|
|
@@ -5078,17 +5074,17 @@ class Ls {
|
|
|
5078
5074
|
}
|
|
5079
5075
|
async executeQuery(e, n) {
|
|
5080
5076
|
return await this.provideConnection(async (a) => {
|
|
5081
|
-
const r = await a.executeQuery(e), o = await
|
|
5077
|
+
const r = await a.executeQuery(e), o = await y(this, gt, on).call(this, r, n);
|
|
5082
5078
|
return Ms(r, o), o;
|
|
5083
5079
|
});
|
|
5084
5080
|
}
|
|
5085
5081
|
async *stream(e, n, a) {
|
|
5086
5082
|
const r = new Jn(), o = new Jn();
|
|
5087
|
-
this.provideConnection(async (
|
|
5083
|
+
this.provideConnection(async (d) => (r.resolve(d), await o.promise)).catch((d) => r.reject(d));
|
|
5088
5084
|
const u = await r.promise;
|
|
5089
5085
|
try {
|
|
5090
|
-
for await (const
|
|
5091
|
-
yield await
|
|
5086
|
+
for await (const d of u.streamQuery(e, n))
|
|
5087
|
+
yield await y(this, gt, on).call(this, d, a);
|
|
5092
5088
|
} finally {
|
|
5093
5089
|
o.resolve();
|
|
5094
5090
|
}
|
|
@@ -5129,7 +5125,7 @@ class je extends Ls {
|
|
|
5129
5125
|
return new je([]);
|
|
5130
5126
|
}
|
|
5131
5127
|
}
|
|
5132
|
-
const
|
|
5128
|
+
const wa = new je();
|
|
5133
5129
|
function Js(t, e) {
|
|
5134
5130
|
return new It({
|
|
5135
5131
|
joinNode: st.create(t, Pt(e))
|
|
@@ -5238,12 +5234,12 @@ const Ft = class Ft {
|
|
|
5238
5234
|
};
|
|
5239
5235
|
ae = new WeakMap();
|
|
5240
5236
|
let O = Ft;
|
|
5241
|
-
var Ke,
|
|
5237
|
+
var Ke, de;
|
|
5242
5238
|
class xn {
|
|
5243
5239
|
constructor(e, n) {
|
|
5244
5240
|
C(this, Ke);
|
|
5245
|
-
C(this,
|
|
5246
|
-
b(this, Ke, e), b(this,
|
|
5241
|
+
C(this, de);
|
|
5242
|
+
b(this, Ke, e), b(this, de, n);
|
|
5247
5243
|
}
|
|
5248
5244
|
/** @private */
|
|
5249
5245
|
get expression() {
|
|
@@ -5251,13 +5247,13 @@ class xn {
|
|
|
5251
5247
|
}
|
|
5252
5248
|
/** @private */
|
|
5253
5249
|
get alias() {
|
|
5254
|
-
return i(this,
|
|
5250
|
+
return i(this, de);
|
|
5255
5251
|
}
|
|
5256
5252
|
toOperationNode() {
|
|
5257
|
-
return
|
|
5253
|
+
return we.create(i(this, Ke).toOperationNode(), q(i(this, de)) ? i(this, de).toOperationNode() : F.create(i(this, de)));
|
|
5258
5254
|
}
|
|
5259
5255
|
}
|
|
5260
|
-
Ke = new WeakMap(),
|
|
5256
|
+
Ke = new WeakMap(), de = new WeakMap();
|
|
5261
5257
|
var Te;
|
|
5262
5258
|
const jt = class jt {
|
|
5263
5259
|
constructor(e) {
|
|
@@ -5341,7 +5337,7 @@ function Hs(t) {
|
|
|
5341
5337
|
return t === "only" || t === "with ties";
|
|
5342
5338
|
}
|
|
5343
5339
|
var _;
|
|
5344
|
-
const
|
|
5340
|
+
const N = class N {
|
|
5345
5341
|
constructor(e) {
|
|
5346
5342
|
C(this, _);
|
|
5347
5343
|
b(this, _, s(e));
|
|
@@ -5352,244 +5348,244 @@ const v = class v {
|
|
|
5352
5348
|
return !0;
|
|
5353
5349
|
}
|
|
5354
5350
|
where(...e) {
|
|
5355
|
-
return new
|
|
5351
|
+
return new N({
|
|
5356
5352
|
...i(this, _),
|
|
5357
5353
|
queryNode: A.cloneWithWhere(i(this, _).queryNode, K(e))
|
|
5358
5354
|
});
|
|
5359
5355
|
}
|
|
5360
5356
|
whereRef(e, n, a) {
|
|
5361
|
-
return new
|
|
5357
|
+
return new N({
|
|
5362
5358
|
...i(this, _),
|
|
5363
5359
|
queryNode: A.cloneWithWhere(i(this, _).queryNode, ht(e, n, a))
|
|
5364
5360
|
});
|
|
5365
5361
|
}
|
|
5366
5362
|
having(...e) {
|
|
5367
|
-
return new
|
|
5363
|
+
return new N({
|
|
5368
5364
|
...i(this, _),
|
|
5369
5365
|
queryNode: S.cloneWithHaving(i(this, _).queryNode, K(e))
|
|
5370
5366
|
});
|
|
5371
5367
|
}
|
|
5372
5368
|
havingRef(e, n, a) {
|
|
5373
|
-
return new
|
|
5369
|
+
return new N({
|
|
5374
5370
|
...i(this, _),
|
|
5375
5371
|
queryNode: S.cloneWithHaving(i(this, _).queryNode, ht(e, n, a))
|
|
5376
5372
|
});
|
|
5377
5373
|
}
|
|
5378
5374
|
select(e) {
|
|
5379
|
-
return new
|
|
5375
|
+
return new N({
|
|
5380
5376
|
...i(this, _),
|
|
5381
5377
|
queryNode: S.cloneWithSelections(i(this, _).queryNode, la(e))
|
|
5382
5378
|
});
|
|
5383
5379
|
}
|
|
5384
5380
|
distinctOn(e) {
|
|
5385
|
-
return new
|
|
5381
|
+
return new N({
|
|
5386
5382
|
...i(this, _),
|
|
5387
5383
|
queryNode: S.cloneWithDistinctOn(i(this, _).queryNode, _t(e))
|
|
5388
5384
|
});
|
|
5389
5385
|
}
|
|
5390
5386
|
modifyFront(e) {
|
|
5391
|
-
return new
|
|
5387
|
+
return new N({
|
|
5392
5388
|
...i(this, _),
|
|
5393
5389
|
queryNode: S.cloneWithFrontModifier(i(this, _).queryNode, H.createWithExpression(e.toOperationNode()))
|
|
5394
5390
|
});
|
|
5395
5391
|
}
|
|
5396
5392
|
modifyEnd(e) {
|
|
5397
|
-
return new
|
|
5393
|
+
return new N({
|
|
5398
5394
|
...i(this, _),
|
|
5399
5395
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.createWithExpression(e.toOperationNode()))
|
|
5400
5396
|
});
|
|
5401
5397
|
}
|
|
5402
5398
|
distinct() {
|
|
5403
|
-
return new
|
|
5399
|
+
return new N({
|
|
5404
5400
|
...i(this, _),
|
|
5405
5401
|
queryNode: S.cloneWithFrontModifier(i(this, _).queryNode, H.create("Distinct"))
|
|
5406
5402
|
});
|
|
5407
5403
|
}
|
|
5408
5404
|
forUpdate(e) {
|
|
5409
|
-
return new
|
|
5405
|
+
return new N({
|
|
5410
5406
|
...i(this, _),
|
|
5411
5407
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("ForUpdate", e ? xt(e).map(W) : void 0))
|
|
5412
5408
|
});
|
|
5413
5409
|
}
|
|
5414
5410
|
forShare(e) {
|
|
5415
|
-
return new
|
|
5411
|
+
return new N({
|
|
5416
5412
|
...i(this, _),
|
|
5417
5413
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("ForShare", e ? xt(e).map(W) : void 0))
|
|
5418
5414
|
});
|
|
5419
5415
|
}
|
|
5420
5416
|
forKeyShare(e) {
|
|
5421
|
-
return new
|
|
5417
|
+
return new N({
|
|
5422
5418
|
...i(this, _),
|
|
5423
5419
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("ForKeyShare", e ? xt(e).map(W) : void 0))
|
|
5424
5420
|
});
|
|
5425
5421
|
}
|
|
5426
5422
|
forNoKeyUpdate(e) {
|
|
5427
|
-
return new
|
|
5423
|
+
return new N({
|
|
5428
5424
|
...i(this, _),
|
|
5429
5425
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("ForNoKeyUpdate", e ? xt(e).map(W) : void 0))
|
|
5430
5426
|
});
|
|
5431
5427
|
}
|
|
5432
5428
|
skipLocked() {
|
|
5433
|
-
return new
|
|
5429
|
+
return new N({
|
|
5434
5430
|
...i(this, _),
|
|
5435
5431
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("SkipLocked"))
|
|
5436
5432
|
});
|
|
5437
5433
|
}
|
|
5438
5434
|
noWait() {
|
|
5439
|
-
return new
|
|
5435
|
+
return new N({
|
|
5440
5436
|
...i(this, _),
|
|
5441
5437
|
queryNode: A.cloneWithEndModifier(i(this, _).queryNode, H.create("NoWait"))
|
|
5442
5438
|
});
|
|
5443
5439
|
}
|
|
5444
5440
|
selectAll(e) {
|
|
5445
|
-
return new
|
|
5441
|
+
return new N({
|
|
5446
5442
|
...i(this, _),
|
|
5447
5443
|
queryNode: S.cloneWithSelections(i(this, _).queryNode, _a(e))
|
|
5448
5444
|
});
|
|
5449
5445
|
}
|
|
5450
5446
|
innerJoin(...e) {
|
|
5451
|
-
return new
|
|
5447
|
+
return new N({
|
|
5452
5448
|
...i(this, _),
|
|
5453
5449
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("InnerJoin", e))
|
|
5454
5450
|
});
|
|
5455
5451
|
}
|
|
5456
5452
|
leftJoin(...e) {
|
|
5457
|
-
return new
|
|
5453
|
+
return new N({
|
|
5458
5454
|
...i(this, _),
|
|
5459
5455
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("LeftJoin", e))
|
|
5460
5456
|
});
|
|
5461
5457
|
}
|
|
5462
5458
|
rightJoin(...e) {
|
|
5463
|
-
return new
|
|
5459
|
+
return new N({
|
|
5464
5460
|
...i(this, _),
|
|
5465
5461
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("RightJoin", e))
|
|
5466
5462
|
});
|
|
5467
5463
|
}
|
|
5468
5464
|
fullJoin(...e) {
|
|
5469
|
-
return new
|
|
5465
|
+
return new N({
|
|
5470
5466
|
...i(this, _),
|
|
5471
5467
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("FullJoin", e))
|
|
5472
5468
|
});
|
|
5473
5469
|
}
|
|
5474
5470
|
innerJoinLateral(...e) {
|
|
5475
|
-
return new
|
|
5471
|
+
return new N({
|
|
5476
5472
|
...i(this, _),
|
|
5477
5473
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("LateralInnerJoin", e))
|
|
5478
5474
|
});
|
|
5479
5475
|
}
|
|
5480
5476
|
leftJoinLateral(...e) {
|
|
5481
|
-
return new
|
|
5477
|
+
return new N({
|
|
5482
5478
|
...i(this, _),
|
|
5483
5479
|
queryNode: A.cloneWithJoin(i(this, _).queryNode, $e("LateralLeftJoin", e))
|
|
5484
5480
|
});
|
|
5485
5481
|
}
|
|
5486
5482
|
orderBy(...e) {
|
|
5487
|
-
return new
|
|
5483
|
+
return new N({
|
|
5488
5484
|
...i(this, _),
|
|
5489
|
-
queryNode: S.cloneWithOrderByItems(i(this, _).queryNode,
|
|
5485
|
+
queryNode: S.cloneWithOrderByItems(i(this, _).queryNode, yn(e))
|
|
5490
5486
|
});
|
|
5491
5487
|
}
|
|
5492
5488
|
groupBy(e) {
|
|
5493
|
-
return new
|
|
5489
|
+
return new N({
|
|
5494
5490
|
...i(this, _),
|
|
5495
5491
|
queryNode: S.cloneWithGroupByItems(i(this, _).queryNode, Qs(e))
|
|
5496
5492
|
});
|
|
5497
5493
|
}
|
|
5498
5494
|
limit(e) {
|
|
5499
|
-
return new
|
|
5495
|
+
return new N({
|
|
5500
5496
|
...i(this, _),
|
|
5501
5497
|
queryNode: S.cloneWithLimit(i(this, _).queryNode, Is.create(D(e)))
|
|
5502
5498
|
});
|
|
5503
5499
|
}
|
|
5504
5500
|
offset(e) {
|
|
5505
|
-
return new
|
|
5501
|
+
return new N({
|
|
5506
5502
|
...i(this, _),
|
|
5507
5503
|
queryNode: S.cloneWithOffset(i(this, _).queryNode, Ks.create(D(e)))
|
|
5508
5504
|
});
|
|
5509
5505
|
}
|
|
5510
5506
|
fetch(e, n = "only") {
|
|
5511
|
-
return new
|
|
5507
|
+
return new N({
|
|
5512
5508
|
...i(this, _),
|
|
5513
5509
|
queryNode: S.cloneWithFetch(i(this, _).queryNode, Ys(e, n))
|
|
5514
5510
|
});
|
|
5515
5511
|
}
|
|
5516
5512
|
top(e, n) {
|
|
5517
|
-
return new
|
|
5513
|
+
return new N({
|
|
5518
5514
|
...i(this, _),
|
|
5519
5515
|
queryNode: A.cloneWithTop(i(this, _).queryNode, Ss(e, n))
|
|
5520
5516
|
});
|
|
5521
5517
|
}
|
|
5522
5518
|
union(e) {
|
|
5523
|
-
return new
|
|
5519
|
+
return new N({
|
|
5524
5520
|
...i(this, _),
|
|
5525
5521
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("union", e, !1))
|
|
5526
5522
|
});
|
|
5527
5523
|
}
|
|
5528
5524
|
unionAll(e) {
|
|
5529
|
-
return new
|
|
5525
|
+
return new N({
|
|
5530
5526
|
...i(this, _),
|
|
5531
5527
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("union", e, !0))
|
|
5532
5528
|
});
|
|
5533
5529
|
}
|
|
5534
5530
|
intersect(e) {
|
|
5535
|
-
return new
|
|
5531
|
+
return new N({
|
|
5536
5532
|
...i(this, _),
|
|
5537
5533
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("intersect", e, !1))
|
|
5538
5534
|
});
|
|
5539
5535
|
}
|
|
5540
5536
|
intersectAll(e) {
|
|
5541
|
-
return new
|
|
5537
|
+
return new N({
|
|
5542
5538
|
...i(this, _),
|
|
5543
5539
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("intersect", e, !0))
|
|
5544
5540
|
});
|
|
5545
5541
|
}
|
|
5546
5542
|
except(e) {
|
|
5547
|
-
return new
|
|
5543
|
+
return new N({
|
|
5548
5544
|
...i(this, _),
|
|
5549
5545
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("except", e, !1))
|
|
5550
5546
|
});
|
|
5551
5547
|
}
|
|
5552
5548
|
exceptAll(e) {
|
|
5553
|
-
return new
|
|
5549
|
+
return new N({
|
|
5554
5550
|
...i(this, _),
|
|
5555
5551
|
queryNode: S.cloneWithSetOperations(i(this, _).queryNode, Pe("except", e, !0))
|
|
5556
5552
|
});
|
|
5557
5553
|
}
|
|
5558
5554
|
as(e) {
|
|
5559
|
-
return new
|
|
5555
|
+
return new ya(this, e);
|
|
5560
5556
|
}
|
|
5561
5557
|
clearSelect() {
|
|
5562
|
-
return new
|
|
5558
|
+
return new N({
|
|
5563
5559
|
...i(this, _),
|
|
5564
5560
|
queryNode: S.cloneWithoutSelections(i(this, _).queryNode)
|
|
5565
5561
|
});
|
|
5566
5562
|
}
|
|
5567
5563
|
clearWhere() {
|
|
5568
|
-
return new
|
|
5564
|
+
return new N({
|
|
5569
5565
|
...i(this, _),
|
|
5570
5566
|
queryNode: A.cloneWithoutWhere(i(this, _).queryNode)
|
|
5571
5567
|
});
|
|
5572
5568
|
}
|
|
5573
5569
|
clearLimit() {
|
|
5574
|
-
return new
|
|
5570
|
+
return new N({
|
|
5575
5571
|
...i(this, _),
|
|
5576
5572
|
queryNode: S.cloneWithoutLimit(i(this, _).queryNode)
|
|
5577
5573
|
});
|
|
5578
5574
|
}
|
|
5579
5575
|
clearOffset() {
|
|
5580
|
-
return new
|
|
5576
|
+
return new N({
|
|
5581
5577
|
...i(this, _),
|
|
5582
5578
|
queryNode: S.cloneWithoutOffset(i(this, _).queryNode)
|
|
5583
5579
|
});
|
|
5584
5580
|
}
|
|
5585
5581
|
clearOrderBy() {
|
|
5586
|
-
return new
|
|
5582
|
+
return new N({
|
|
5587
5583
|
...i(this, _),
|
|
5588
5584
|
queryNode: S.cloneWithoutOrderBy(i(this, _).queryNode)
|
|
5589
5585
|
});
|
|
5590
5586
|
}
|
|
5591
5587
|
clearGroupBy() {
|
|
5592
|
-
return new
|
|
5588
|
+
return new N({
|
|
5593
5589
|
...i(this, _),
|
|
5594
5590
|
queryNode: S.cloneWithoutGroupBy(i(this, _).queryNode)
|
|
5595
5591
|
});
|
|
@@ -5598,24 +5594,24 @@ const v = class v {
|
|
|
5598
5594
|
return e(this);
|
|
5599
5595
|
}
|
|
5600
5596
|
$if(e, n) {
|
|
5601
|
-
return e ? n(this) : new
|
|
5597
|
+
return e ? n(this) : new N({
|
|
5602
5598
|
...i(this, _)
|
|
5603
5599
|
});
|
|
5604
5600
|
}
|
|
5605
5601
|
$castTo() {
|
|
5606
|
-
return new
|
|
5602
|
+
return new N(i(this, _));
|
|
5607
5603
|
}
|
|
5608
5604
|
$narrowType() {
|
|
5609
|
-
return new
|
|
5605
|
+
return new N(i(this, _));
|
|
5610
5606
|
}
|
|
5611
5607
|
$assertType() {
|
|
5612
|
-
return new
|
|
5608
|
+
return new N(i(this, _));
|
|
5613
5609
|
}
|
|
5614
5610
|
$asTuple() {
|
|
5615
5611
|
return new O(this.toOperationNode());
|
|
5616
5612
|
}
|
|
5617
5613
|
withPlugin(e) {
|
|
5618
|
-
return new
|
|
5614
|
+
return new N({
|
|
5619
5615
|
...i(this, _),
|
|
5620
5616
|
executor: i(this, _).executor.withPlugin(e)
|
|
5621
5617
|
});
|
|
@@ -5646,20 +5642,20 @@ const v = class v {
|
|
|
5646
5642
|
yield* r.rows;
|
|
5647
5643
|
}
|
|
5648
5644
|
async explain(e, n) {
|
|
5649
|
-
return await new
|
|
5645
|
+
return await new N({
|
|
5650
5646
|
...i(this, _),
|
|
5651
5647
|
queryNode: A.cloneWithExplain(i(this, _).queryNode, e, n)
|
|
5652
5648
|
}).execute();
|
|
5653
5649
|
}
|
|
5654
5650
|
};
|
|
5655
5651
|
_ = new WeakMap();
|
|
5656
|
-
let At =
|
|
5652
|
+
let At = N;
|
|
5657
5653
|
Ae(At, "don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");
|
|
5658
5654
|
function Xs(t) {
|
|
5659
5655
|
return new At(t);
|
|
5660
5656
|
}
|
|
5661
5657
|
var Ue, Qe;
|
|
5662
|
-
class
|
|
5658
|
+
class ya {
|
|
5663
5659
|
constructor(e, n) {
|
|
5664
5660
|
C(this, Ue);
|
|
5665
5661
|
C(this, Qe);
|
|
@@ -5675,11 +5671,11 @@ class wa {
|
|
|
5675
5671
|
return !0;
|
|
5676
5672
|
}
|
|
5677
5673
|
toOperationNode() {
|
|
5678
|
-
return
|
|
5674
|
+
return we.create(i(this, Ue).toOperationNode(), F.create(i(this, Qe)));
|
|
5679
5675
|
}
|
|
5680
5676
|
}
|
|
5681
5677
|
Ue = new WeakMap(), Qe = new WeakMap();
|
|
5682
|
-
Ae(
|
|
5678
|
+
Ae(ya, "don't await AliasedSelectQueryBuilder instances directly. AliasedSelectQueryBuilder should never be executed directly since it's always a part of another query.");
|
|
5683
5679
|
const ue = s({
|
|
5684
5680
|
is(t) {
|
|
5685
5681
|
return t.kind === "AggregateFunctionNode";
|
|
@@ -5823,7 +5819,7 @@ const ne = class ne {
|
|
|
5823
5819
|
orderBy(e, n) {
|
|
5824
5820
|
return new ne({
|
|
5825
5821
|
...i(this, $),
|
|
5826
|
-
aggregateFunctionNode: ue.cloneWithOrderBy(i(this, $).aggregateFunctionNode,
|
|
5822
|
+
aggregateFunctionNode: ue.cloneWithOrderBy(i(this, $).aggregateFunctionNode, yn([e, n]))
|
|
5827
5823
|
});
|
|
5828
5824
|
}
|
|
5829
5825
|
filterWhere(...e) {
|
|
@@ -5970,7 +5966,7 @@ class Zs {
|
|
|
5970
5966
|
return i(this, Ge);
|
|
5971
5967
|
}
|
|
5972
5968
|
toOperationNode() {
|
|
5973
|
-
return
|
|
5969
|
+
return we.create(i(this, Ve).toOperationNode(), F.create(i(this, Ge)));
|
|
5974
5970
|
}
|
|
5975
5971
|
}
|
|
5976
5972
|
Ve = new WeakMap(), Ge = new WeakMap();
|
|
@@ -6149,10 +6145,10 @@ const Wn = s({
|
|
|
6149
6145
|
});
|
|
6150
6146
|
}
|
|
6151
6147
|
});
|
|
6152
|
-
var G,
|
|
6153
|
-
class
|
|
6148
|
+
var G, wt, cn;
|
|
6149
|
+
class dn {
|
|
6154
6150
|
constructor(e) {
|
|
6155
|
-
C(this,
|
|
6151
|
+
C(this, wt);
|
|
6156
6152
|
C(this, G);
|
|
6157
6153
|
b(this, G, e);
|
|
6158
6154
|
}
|
|
@@ -6224,7 +6220,7 @@ class cn {
|
|
|
6224
6220
|
* ```
|
|
6225
6221
|
*/
|
|
6226
6222
|
at(e) {
|
|
6227
|
-
return
|
|
6223
|
+
return y(this, wt, cn).call(this, "ArrayLocation", e);
|
|
6228
6224
|
}
|
|
6229
6225
|
/**
|
|
6230
6226
|
* Access a property of a JSON object.
|
|
@@ -6276,14 +6272,14 @@ class cn {
|
|
|
6276
6272
|
* ```
|
|
6277
6273
|
*/
|
|
6278
6274
|
key(e) {
|
|
6279
|
-
return
|
|
6275
|
+
return y(this, wt, cn).call(this, "Member", e);
|
|
6280
6276
|
}
|
|
6281
6277
|
}
|
|
6282
|
-
G = new WeakMap(),
|
|
6278
|
+
G = new WeakMap(), wt = new WeakSet(), cn = function(e, n) {
|
|
6283
6279
|
return St.is(i(this, G)) ? new $t(St.cloneWithTraversal(i(this, G), ut.is(i(this, G).traversal) ? ut.cloneWithLeg(i(this, G).traversal, Wn.create(e, n)) : ua.cloneWithValue(i(this, G).traversal, pe.createImmediate(n)))) : new $t(ut.cloneWithLeg(i(this, G), Wn.create(e, n)));
|
|
6284
6280
|
};
|
|
6285
6281
|
var Se;
|
|
6286
|
-
const Mt = class Mt extends
|
|
6282
|
+
const Mt = class Mt extends dn {
|
|
6287
6283
|
constructor(n) {
|
|
6288
6284
|
super(n);
|
|
6289
6285
|
C(this, Se);
|
|
@@ -6313,12 +6309,12 @@ const Mt = class Mt extends cn {
|
|
|
6313
6309
|
};
|
|
6314
6310
|
Se = new WeakMap();
|
|
6315
6311
|
let $t = Mt;
|
|
6316
|
-
var Ze,
|
|
6312
|
+
var Ze, ce;
|
|
6317
6313
|
class iu {
|
|
6318
6314
|
constructor(e, n) {
|
|
6319
6315
|
C(this, Ze);
|
|
6320
|
-
C(this,
|
|
6321
|
-
b(this, Ze, e), b(this,
|
|
6316
|
+
C(this, ce);
|
|
6317
|
+
b(this, Ze, e), b(this, ce, n);
|
|
6322
6318
|
}
|
|
6323
6319
|
/** @private */
|
|
6324
6320
|
get expression() {
|
|
@@ -6326,13 +6322,13 @@ class iu {
|
|
|
6326
6322
|
}
|
|
6327
6323
|
/** @private */
|
|
6328
6324
|
get alias() {
|
|
6329
|
-
return i(this,
|
|
6325
|
+
return i(this, ce);
|
|
6330
6326
|
}
|
|
6331
6327
|
toOperationNode() {
|
|
6332
|
-
return
|
|
6328
|
+
return we.create(i(this, Ze).toOperationNode(), q(i(this, ce)) ? i(this, ce).toOperationNode() : F.create(i(this, ce)));
|
|
6333
6329
|
}
|
|
6334
6330
|
}
|
|
6335
|
-
Ze = new WeakMap(),
|
|
6331
|
+
Ze = new WeakMap(), ce = new WeakMap();
|
|
6336
6332
|
const Kn = s({
|
|
6337
6333
|
is(t) {
|
|
6338
6334
|
return t.kind === "TupleNode";
|
|
@@ -6399,7 +6395,7 @@ const Kn = s({
|
|
|
6399
6395
|
/^timestamp\(\d+\)$/,
|
|
6400
6396
|
/^timestamptz\(\d+\)$/,
|
|
6401
6397
|
/^varbinary\(\d+\)$/
|
|
6402
|
-
],
|
|
6398
|
+
], du = s({
|
|
6403
6399
|
is(t) {
|
|
6404
6400
|
return t.kind === "DataTypeNode";
|
|
6405
6401
|
},
|
|
@@ -6410,14 +6406,14 @@ const Kn = s({
|
|
|
6410
6406
|
});
|
|
6411
6407
|
}
|
|
6412
6408
|
});
|
|
6413
|
-
function
|
|
6409
|
+
function cu(t) {
|
|
6414
6410
|
return !!(su.includes(t) || uu.some((e) => e.test(t)));
|
|
6415
6411
|
}
|
|
6416
6412
|
function lu(t) {
|
|
6417
6413
|
if (q(t))
|
|
6418
6414
|
return t.toOperationNode();
|
|
6419
|
-
if (
|
|
6420
|
-
return
|
|
6415
|
+
if (cu(t))
|
|
6416
|
+
return du.create(t);
|
|
6421
6417
|
throw new Error(`invalid column data type ${JSON.stringify(t)}`);
|
|
6422
6418
|
}
|
|
6423
6419
|
const _u = s({
|
|
@@ -6432,7 +6428,7 @@ const _u = s({
|
|
|
6432
6428
|
});
|
|
6433
6429
|
}
|
|
6434
6430
|
});
|
|
6435
|
-
function bn(t =
|
|
6431
|
+
function bn(t = wa) {
|
|
6436
6432
|
function e(r, o, u) {
|
|
6437
6433
|
return new O(Cn(r, o, u));
|
|
6438
6434
|
}
|
|
@@ -6455,10 +6451,10 @@ function bn(t = ya) {
|
|
|
6455
6451
|
});
|
|
6456
6452
|
},
|
|
6457
6453
|
ref(r, o) {
|
|
6458
|
-
return Ot(o) ? new O(fe(r)) : new
|
|
6454
|
+
return Ot(o) ? new O(fe(r)) : new dn(us(r, o));
|
|
6459
6455
|
},
|
|
6460
6456
|
jsonPath() {
|
|
6461
|
-
return new
|
|
6457
|
+
return new dn(ut.create());
|
|
6462
6458
|
},
|
|
6463
6459
|
table(r) {
|
|
6464
6460
|
return new O(W(r));
|
|
@@ -6540,7 +6536,7 @@ function hu(t) {
|
|
|
6540
6536
|
const e = " as ";
|
|
6541
6537
|
if (t.includes(e)) {
|
|
6542
6538
|
const [n, a] = t.split(e).map(Ca);
|
|
6543
|
-
return
|
|
6539
|
+
return we.create(W(n), F.create(a));
|
|
6544
6540
|
} else
|
|
6545
6541
|
return W(t);
|
|
6546
6542
|
}
|
|
@@ -6583,23 +6579,23 @@ const lt = class lt {
|
|
|
6583
6579
|
});
|
|
6584
6580
|
}
|
|
6585
6581
|
toOperationNode() {
|
|
6586
|
-
return
|
|
6582
|
+
return y(this, M, ln).call(this, y(this, M, bt).call(this));
|
|
6587
6583
|
}
|
|
6588
6584
|
compile(e) {
|
|
6589
|
-
return
|
|
6585
|
+
return y(this, M, _n).call(this, y(this, M, bt).call(this, e));
|
|
6590
6586
|
}
|
|
6591
6587
|
async execute(e) {
|
|
6592
|
-
const n =
|
|
6593
|
-
return n.executeQuery(
|
|
6588
|
+
const n = y(this, M, bt).call(this, e);
|
|
6589
|
+
return n.executeQuery(y(this, M, _n).call(this, n), i(this, P).queryId);
|
|
6594
6590
|
}
|
|
6595
6591
|
};
|
|
6596
6592
|
P = new WeakMap(), M = new WeakSet(), bt = function(e) {
|
|
6597
|
-
const n = e !== void 0 ? e.getExecutor() :
|
|
6593
|
+
const n = e !== void 0 ? e.getExecutor() : wa;
|
|
6598
6594
|
return i(this, P).plugins !== void 0 ? n.withPlugins(i(this, P).plugins) : n;
|
|
6599
6595
|
}, ln = function(e) {
|
|
6600
6596
|
return e.transformQuery(i(this, P).rawNode, i(this, P).queryId);
|
|
6601
6597
|
}, _n = function(e) {
|
|
6602
|
-
return e.compileQuery(
|
|
6598
|
+
return e.compileQuery(y(this, M, ln).call(this, e), i(this, P).queryId);
|
|
6603
6599
|
};
|
|
6604
6600
|
let Dt = lt;
|
|
6605
6601
|
function se(t) {
|
|
@@ -6623,7 +6619,7 @@ class xa {
|
|
|
6623
6619
|
return i(this, ke);
|
|
6624
6620
|
}
|
|
6625
6621
|
toOperationNode() {
|
|
6626
|
-
return
|
|
6622
|
+
return we.create(i(this, ke).toOperationNode(), q(i(this, le)) ? i(this, le).toOperationNode() : F.create(i(this, le)));
|
|
6627
6623
|
}
|
|
6628
6624
|
}
|
|
6629
6625
|
ke = new WeakMap(), le = new WeakMap();
|
|
@@ -6696,7 +6692,7 @@ class fu {
|
|
|
6696
6692
|
return e.result;
|
|
6697
6693
|
}
|
|
6698
6694
|
}
|
|
6699
|
-
const pu = "kysely_migration", Qn = "kysely_migration_lock", gu = !1, Yt = "migration_lock",
|
|
6695
|
+
const pu = "kysely_migration", Qn = "kysely_migration_lock", gu = !1, Yt = "migration_lock", wu = s({ __noMigrations__: !0 });
|
|
6700
6696
|
var k, m, ot, Z, ee, ze, Ta, te, Oa, Sa, ka, Ia, Ea, mn, Re, hn, Aa, $a, Pa, fn, Da, za, Ra, Fa, ja, it;
|
|
6701
6697
|
class ba {
|
|
6702
6698
|
constructor(e) {
|
|
@@ -6710,8 +6706,8 @@ class ba {
|
|
|
6710
6706
|
* The returned array is sorted by migration name.
|
|
6711
6707
|
*/
|
|
6712
6708
|
async getMigrations() {
|
|
6713
|
-
const e = await
|
|
6714
|
-
return (await
|
|
6709
|
+
const e = await y(this, m, Re).call(this, i(this, m, ee)) ? await i(this, k).db.withPlugin(i(this, m, te)).selectFrom(i(this, m, ee)).select(["name", "timestamp"]).$narrowType().execute() : [];
|
|
6710
|
+
return (await y(this, m, fn).call(this)).map(({ name: a, ...r }) => {
|
|
6715
6711
|
const o = e.find((u) => u.name === a);
|
|
6716
6712
|
return {
|
|
6717
6713
|
name: a,
|
|
@@ -6767,7 +6763,7 @@ class ba {
|
|
|
6767
6763
|
* ```
|
|
6768
6764
|
*/
|
|
6769
6765
|
async migrateToLatest() {
|
|
6770
|
-
return
|
|
6766
|
+
return y(this, m, ot).call(this, () => ({ direction: "Up", step: 1 / 0 }));
|
|
6771
6767
|
}
|
|
6772
6768
|
/**
|
|
6773
6769
|
* Migrate up/down to a specific migration.
|
|
@@ -6821,12 +6817,12 @@ class ba {
|
|
|
6821
6817
|
* ```
|
|
6822
6818
|
*/
|
|
6823
6819
|
async migrateTo(e) {
|
|
6824
|
-
return
|
|
6825
|
-
if (e ===
|
|
6820
|
+
return y(this, m, ot).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
|
|
6821
|
+
if (e === wu)
|
|
6826
6822
|
return { direction: "Down", step: 1 / 0 };
|
|
6827
|
-
if (!n.find((
|
|
6823
|
+
if (!n.find((d) => d.name === e))
|
|
6828
6824
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
6829
|
-
const o = a.indexOf(e), u = r.findIndex((
|
|
6825
|
+
const o = a.indexOf(e), u = r.findIndex((d) => d.name === e);
|
|
6830
6826
|
if (o !== -1)
|
|
6831
6827
|
return {
|
|
6832
6828
|
direction: "Down",
|
|
@@ -6866,7 +6862,7 @@ class ba {
|
|
|
6866
6862
|
* ```
|
|
6867
6863
|
*/
|
|
6868
6864
|
async migrateUp() {
|
|
6869
|
-
return
|
|
6865
|
+
return y(this, m, ot).call(this, () => ({ direction: "Up", step: 1 }));
|
|
6870
6866
|
}
|
|
6871
6867
|
/**
|
|
6872
6868
|
* Migrate one step down.
|
|
@@ -6897,12 +6893,12 @@ class ba {
|
|
|
6897
6893
|
* ```
|
|
6898
6894
|
*/
|
|
6899
6895
|
async migrateDown() {
|
|
6900
|
-
return
|
|
6896
|
+
return y(this, m, ot).call(this, () => ({ direction: "Down", step: 1 }));
|
|
6901
6897
|
}
|
|
6902
6898
|
}
|
|
6903
6899
|
k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
6904
6900
|
try {
|
|
6905
|
-
return await
|
|
6901
|
+
return await y(this, m, Oa).call(this), await y(this, m, Aa).call(this, e);
|
|
6906
6902
|
} catch (n) {
|
|
6907
6903
|
return n instanceof Ht ? n.resultSet : { error: n };
|
|
6908
6904
|
}
|
|
@@ -6917,37 +6913,37 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
6917
6913
|
}, te = function() {
|
|
6918
6914
|
return i(this, m, Z) ? new ga(i(this, m, Z)) : new fu();
|
|
6919
6915
|
}, Oa = async function() {
|
|
6920
|
-
await
|
|
6916
|
+
await y(this, m, Sa).call(this), await y(this, m, ka).call(this), await y(this, m, Ia).call(this), await y(this, m, Ea).call(this);
|
|
6921
6917
|
}, Sa = async function() {
|
|
6922
|
-
if (i(this, m, Z) && !await
|
|
6918
|
+
if (i(this, m, Z) && !await y(this, m, mn).call(this))
|
|
6923
6919
|
try {
|
|
6924
|
-
await
|
|
6920
|
+
await y(this, m, it).call(this, i(this, k).db.schema.createSchema(i(this, m, Z)));
|
|
6925
6921
|
} catch (e) {
|
|
6926
|
-
if (!await
|
|
6922
|
+
if (!await y(this, m, mn).call(this))
|
|
6927
6923
|
throw e;
|
|
6928
6924
|
}
|
|
6929
6925
|
}, ka = async function() {
|
|
6930
|
-
if (!await
|
|
6926
|
+
if (!await y(this, m, Re).call(this, i(this, m, ee)))
|
|
6931
6927
|
try {
|
|
6932
|
-
i(this, m, Z) && await
|
|
6928
|
+
i(this, m, Z) && await y(this, m, it).call(this, i(this, k).db.schema.createSchema(i(this, m, Z))), await y(this, m, it).call(this, i(this, k).db.schema.withPlugin(i(this, m, te)).createTable(i(this, m, ee)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
6933
6929
|
} catch (e) {
|
|
6934
|
-
if (!await
|
|
6930
|
+
if (!await y(this, m, Re).call(this, i(this, m, ee)))
|
|
6935
6931
|
throw e;
|
|
6936
6932
|
}
|
|
6937
6933
|
}, Ia = async function() {
|
|
6938
|
-
if (!await
|
|
6934
|
+
if (!await y(this, m, Re).call(this, i(this, m, ze)))
|
|
6939
6935
|
try {
|
|
6940
|
-
await
|
|
6936
|
+
await y(this, m, it).call(this, i(this, k).db.schema.withPlugin(i(this, m, te)).createTable(i(this, m, ze)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
6941
6937
|
} catch (e) {
|
|
6942
|
-
if (!await
|
|
6938
|
+
if (!await y(this, m, Re).call(this, i(this, m, ze)))
|
|
6943
6939
|
throw e;
|
|
6944
6940
|
}
|
|
6945
6941
|
}, Ea = async function() {
|
|
6946
|
-
if (!await
|
|
6942
|
+
if (!await y(this, m, hn).call(this))
|
|
6947
6943
|
try {
|
|
6948
6944
|
await i(this, k).db.withPlugin(i(this, m, te)).insertInto(i(this, m, ze)).values({ id: Yt, is_locked: 0 }).execute();
|
|
6949
6945
|
} catch (e) {
|
|
6950
|
-
if (!await
|
|
6946
|
+
if (!await y(this, m, hn).call(this))
|
|
6951
6947
|
throw e;
|
|
6952
6948
|
}
|
|
6953
6949
|
}, mn = async function() {
|
|
@@ -6967,20 +6963,20 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
6967
6963
|
}), r = async (o) => {
|
|
6968
6964
|
try {
|
|
6969
6965
|
await n.acquireMigrationLock(o, a);
|
|
6970
|
-
const u = await
|
|
6966
|
+
const u = await y(this, m, $a).call(this, o);
|
|
6971
6967
|
if (u.migrations.length === 0)
|
|
6972
6968
|
return { results: [] };
|
|
6973
|
-
const { direction:
|
|
6974
|
-
return
|
|
6969
|
+
const { direction: d, step: c } = e(u);
|
|
6970
|
+
return c <= 0 ? { results: [] } : d === "Down" ? await y(this, m, Fa).call(this, o, u, c) : d === "Up" ? await y(this, m, ja).call(this, o, u, c) : { results: [] };
|
|
6975
6971
|
} finally {
|
|
6976
6972
|
await n.releaseMigrationLock(o, a);
|
|
6977
6973
|
}
|
|
6978
6974
|
};
|
|
6979
6975
|
return n.supportsTransactionalDdl ? i(this, k).db.transaction().execute(r) : i(this, k).db.connection().execute(r);
|
|
6980
6976
|
}, $a = async function(e) {
|
|
6981
|
-
const n = await
|
|
6982
|
-
|
|
6983
|
-
const r =
|
|
6977
|
+
const n = await y(this, m, fn).call(this), a = await y(this, m, Da).call(this, e);
|
|
6978
|
+
y(this, m, za).call(this, n, a), i(this, m, Ta) || y(this, m, Ra).call(this, n, a);
|
|
6979
|
+
const r = y(this, m, Pa).call(this, n, a);
|
|
6984
6980
|
return s({
|
|
6985
6981
|
migrations: n,
|
|
6986
6982
|
executedMigrations: a,
|
|
@@ -7007,26 +7003,26 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
7007
7003
|
if (e[a].name !== n[a])
|
|
7008
7004
|
throw new Error(`corrupted migrations: expected previously executed migration ${n[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
7009
7005
|
}, Fa = async function(e, n, a) {
|
|
7010
|
-
const r = n.executedMigrations.slice().reverse().slice(0, a).map((u) => n.migrations.find((
|
|
7006
|
+
const r = n.executedMigrations.slice().reverse().slice(0, a).map((u) => n.migrations.find((d) => d.name === u)), o = r.map((u) => ({
|
|
7011
7007
|
migrationName: u.name,
|
|
7012
7008
|
direction: "Down",
|
|
7013
7009
|
status: "NotExecuted"
|
|
7014
7010
|
}));
|
|
7015
7011
|
for (let u = 0; u < o.length; ++u) {
|
|
7016
|
-
const
|
|
7012
|
+
const d = r[u];
|
|
7017
7013
|
try {
|
|
7018
|
-
|
|
7019
|
-
migrationName:
|
|
7014
|
+
d.down && (await d.down(e), await e.withPlugin(i(this, m, te)).deleteFrom(i(this, m, ee)).where("name", "=", d.name).execute(), o[u] = {
|
|
7015
|
+
migrationName: d.name,
|
|
7020
7016
|
direction: "Down",
|
|
7021
7017
|
status: "Success"
|
|
7022
7018
|
});
|
|
7023
|
-
} catch (
|
|
7019
|
+
} catch (c) {
|
|
7024
7020
|
throw o[u] = {
|
|
7025
|
-
migrationName:
|
|
7021
|
+
migrationName: d.name,
|
|
7026
7022
|
direction: "Down",
|
|
7027
7023
|
status: "Error"
|
|
7028
7024
|
}, new Ht({
|
|
7029
|
-
error:
|
|
7025
|
+
error: c,
|
|
7030
7026
|
results: o
|
|
7031
7027
|
});
|
|
7032
7028
|
}
|
|
@@ -7039,23 +7035,23 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
7039
7035
|
status: "NotExecuted"
|
|
7040
7036
|
}));
|
|
7041
7037
|
for (let u = 0; u < o.length; u++) {
|
|
7042
|
-
const
|
|
7038
|
+
const d = n.pendingMigrations[u];
|
|
7043
7039
|
try {
|
|
7044
|
-
await
|
|
7045
|
-
name:
|
|
7040
|
+
await d.up(e), await e.withPlugin(i(this, m, te)).insertInto(i(this, m, ee)).values({
|
|
7041
|
+
name: d.name,
|
|
7046
7042
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7047
7043
|
}).execute(), o[u] = {
|
|
7048
|
-
migrationName:
|
|
7044
|
+
migrationName: d.name,
|
|
7049
7045
|
direction: "Up",
|
|
7050
7046
|
status: "Success"
|
|
7051
7047
|
};
|
|
7052
|
-
} catch (
|
|
7048
|
+
} catch (c) {
|
|
7053
7049
|
throw o[u] = {
|
|
7054
|
-
migrationName:
|
|
7050
|
+
migrationName: d.name,
|
|
7055
7051
|
direction: "Up",
|
|
7056
7052
|
status: "Error"
|
|
7057
7053
|
}, new Ht({
|
|
7058
|
-
error:
|
|
7054
|
+
error: c,
|
|
7059
7055
|
results: o
|
|
7060
7056
|
});
|
|
7061
7057
|
}
|
|
@@ -7064,18 +7060,18 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
7064
7060
|
}, it = async function(e) {
|
|
7065
7061
|
i(this, k).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
7066
7062
|
};
|
|
7067
|
-
var
|
|
7063
|
+
var yt;
|
|
7068
7064
|
class Ht extends Error {
|
|
7069
7065
|
constructor(n) {
|
|
7070
7066
|
super();
|
|
7071
|
-
C(this,
|
|
7072
|
-
b(this,
|
|
7067
|
+
C(this, yt);
|
|
7068
|
+
b(this, yt, n);
|
|
7073
7069
|
}
|
|
7074
7070
|
get resultSet() {
|
|
7075
|
-
return i(this,
|
|
7071
|
+
return i(this, yt);
|
|
7076
7072
|
}
|
|
7077
7073
|
}
|
|
7078
|
-
|
|
7074
|
+
yt = new WeakMap();
|
|
7079
7075
|
class La {
|
|
7080
7076
|
constructor(e) {
|
|
7081
7077
|
ie(this, "migrations");
|
|
@@ -7085,7 +7081,7 @@ class La {
|
|
|
7085
7081
|
return this.migrations;
|
|
7086
7082
|
}
|
|
7087
7083
|
}
|
|
7088
|
-
async function
|
|
7084
|
+
async function yu(t) {
|
|
7089
7085
|
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(
|
|
7090
7086
|
"tenant_id",
|
|
7091
7087
|
"varchar(255)",
|
|
@@ -7163,7 +7159,7 @@ async function Nu(t) {
|
|
|
7163
7159
|
const vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7164
7160
|
__proto__: null,
|
|
7165
7161
|
down: Nu,
|
|
7166
|
-
up:
|
|
7162
|
+
up: yu
|
|
7167
7163
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7168
7164
|
async function Cu(t) {
|
|
7169
7165
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
@@ -7314,56 +7310,56 @@ async function Xu(t) {
|
|
|
7314
7310
|
}
|
|
7315
7311
|
async function Zu(t) {
|
|
7316
7312
|
}
|
|
7317
|
-
const
|
|
7313
|
+
const ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7318
7314
|
__proto__: null,
|
|
7319
7315
|
down: Zu,
|
|
7320
7316
|
up: Xu
|
|
7321
7317
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7322
|
-
async function
|
|
7318
|
+
async function td(t) {
|
|
7323
7319
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
7324
7320
|
}
|
|
7325
|
-
async function
|
|
7321
|
+
async function nd(t) {
|
|
7326
7322
|
await t.schema.dropIndex("users_email_index").execute();
|
|
7327
7323
|
}
|
|
7328
|
-
const
|
|
7324
|
+
const ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7329
7325
|
__proto__: null,
|
|
7330
|
-
down:
|
|
7331
|
-
up:
|
|
7326
|
+
down: nd,
|
|
7327
|
+
up: td
|
|
7332
7328
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7333
|
-
async function
|
|
7329
|
+
async function rd(t) {
|
|
7334
7330
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
7335
7331
|
}
|
|
7336
|
-
async function
|
|
7332
|
+
async function od(t) {
|
|
7337
7333
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
7338
7334
|
}
|
|
7339
|
-
const
|
|
7335
|
+
const id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7340
7336
|
__proto__: null,
|
|
7341
|
-
down:
|
|
7342
|
-
up:
|
|
7337
|
+
down: od,
|
|
7338
|
+
up: rd
|
|
7343
7339
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7344
|
-
async function
|
|
7340
|
+
async function sd(t) {
|
|
7345
7341
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
7346
7342
|
}
|
|
7347
|
-
async function
|
|
7343
|
+
async function ud(t) {
|
|
7348
7344
|
await t.schema.dropIndex("users_linked_to_index");
|
|
7349
7345
|
}
|
|
7350
|
-
const
|
|
7346
|
+
const dd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7351
7347
|
__proto__: null,
|
|
7352
|
-
down:
|
|
7353
|
-
up:
|
|
7348
|
+
down: ud,
|
|
7349
|
+
up: sd
|
|
7354
7350
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7355
|
-
async function
|
|
7351
|
+
async function cd(t) {
|
|
7356
7352
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
7357
7353
|
}
|
|
7358
|
-
async function
|
|
7354
|
+
async function ld(t) {
|
|
7359
7355
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
7360
7356
|
}
|
|
7361
|
-
const
|
|
7357
|
+
const _d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7362
7358
|
__proto__: null,
|
|
7363
|
-
down:
|
|
7364
|
-
up:
|
|
7359
|
+
down: ld,
|
|
7360
|
+
up: cd
|
|
7365
7361
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7366
|
-
async function
|
|
7362
|
+
async function md(t) {
|
|
7367
7363
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
7368
7364
|
"tenant_id",
|
|
7369
7365
|
"varchar(255)",
|
|
@@ -7378,202 +7374,202 @@ async function mc(t) {
|
|
|
7378
7374
|
(e) => e.references("connections.id").onDelete("cascade")
|
|
7379
7375
|
).execute();
|
|
7380
7376
|
}
|
|
7381
|
-
async function
|
|
7377
|
+
async function hd(t) {
|
|
7382
7378
|
await t.schema.dropTable("keys").execute();
|
|
7383
7379
|
}
|
|
7384
|
-
const
|
|
7380
|
+
const fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7385
7381
|
__proto__: null,
|
|
7386
|
-
down:
|
|
7387
|
-
up:
|
|
7382
|
+
down: hd,
|
|
7383
|
+
up: md
|
|
7388
7384
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7389
|
-
async function
|
|
7385
|
+
async function pd(t) {
|
|
7390
7386
|
}
|
|
7391
|
-
async function
|
|
7387
|
+
async function gd(t) {
|
|
7392
7388
|
}
|
|
7393
|
-
const
|
|
7389
|
+
const wd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7394
7390
|
__proto__: null,
|
|
7395
|
-
down:
|
|
7396
|
-
up:
|
|
7391
|
+
down: gd,
|
|
7392
|
+
up: pd
|
|
7397
7393
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7398
|
-
async function
|
|
7394
|
+
async function yd(t) {
|
|
7399
7395
|
}
|
|
7400
|
-
async function
|
|
7396
|
+
async function Nd(t) {
|
|
7401
7397
|
}
|
|
7402
|
-
const
|
|
7398
|
+
const vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7403
7399
|
__proto__: null,
|
|
7404
|
-
down:
|
|
7405
|
-
up:
|
|
7400
|
+
down: Nd,
|
|
7401
|
+
up: yd
|
|
7406
7402
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7407
|
-
async function
|
|
7403
|
+
async function Cd(t) {
|
|
7408
7404
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
7409
7405
|
}
|
|
7410
|
-
async function
|
|
7406
|
+
async function xd(t) {
|
|
7411
7407
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
7412
7408
|
}
|
|
7413
|
-
const
|
|
7409
|
+
const bd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7414
7410
|
__proto__: null,
|
|
7415
|
-
down:
|
|
7416
|
-
up:
|
|
7411
|
+
down: xd,
|
|
7412
|
+
up: Cd
|
|
7417
7413
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7418
|
-
async function
|
|
7414
|
+
async function Td(t) {
|
|
7419
7415
|
}
|
|
7420
|
-
async function
|
|
7416
|
+
async function Od(t) {
|
|
7421
7417
|
}
|
|
7422
|
-
const
|
|
7418
|
+
const Sd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7423
7419
|
__proto__: null,
|
|
7424
|
-
down:
|
|
7425
|
-
up:
|
|
7420
|
+
down: Od,
|
|
7421
|
+
up: Td
|
|
7426
7422
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7427
|
-
async function
|
|
7423
|
+
async function kd(t) {
|
|
7428
7424
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
7429
7425
|
}
|
|
7430
|
-
async function
|
|
7426
|
+
async function Id(t) {
|
|
7431
7427
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
7432
7428
|
}
|
|
7433
|
-
const
|
|
7429
|
+
const Ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7434
7430
|
__proto__: null,
|
|
7435
|
-
down:
|
|
7436
|
-
up:
|
|
7431
|
+
down: Id,
|
|
7432
|
+
up: kd
|
|
7437
7433
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7438
|
-
async function
|
|
7434
|
+
async function Ad(t) {
|
|
7439
7435
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
7440
7436
|
}
|
|
7441
|
-
async function $
|
|
7437
|
+
async function $d(t) {
|
|
7442
7438
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
7443
7439
|
}
|
|
7444
|
-
const
|
|
7440
|
+
const Pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7445
7441
|
__proto__: null,
|
|
7446
|
-
down: $
|
|
7447
|
-
up:
|
|
7442
|
+
down: $d,
|
|
7443
|
+
up: Ad
|
|
7448
7444
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7449
|
-
async function
|
|
7445
|
+
async function Dd(t) {
|
|
7450
7446
|
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();
|
|
7451
7447
|
}
|
|
7452
|
-
async function
|
|
7448
|
+
async function zd(t) {
|
|
7453
7449
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
7454
7450
|
}
|
|
7455
|
-
const
|
|
7451
|
+
const Rd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7456
7452
|
__proto__: null,
|
|
7457
|
-
down:
|
|
7458
|
-
up:
|
|
7453
|
+
down: zd,
|
|
7454
|
+
up: Dd
|
|
7459
7455
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7460
|
-
async function
|
|
7456
|
+
async function Fd(t) {
|
|
7461
7457
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
7462
7458
|
}
|
|
7463
|
-
async function
|
|
7459
|
+
async function jd(t) {
|
|
7464
7460
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
7465
7461
|
}
|
|
7466
|
-
const
|
|
7462
|
+
const Ld = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7467
7463
|
__proto__: null,
|
|
7468
|
-
down:
|
|
7469
|
-
up:
|
|
7464
|
+
down: jd,
|
|
7465
|
+
up: Fd
|
|
7470
7466
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7471
|
-
async function
|
|
7467
|
+
async function Md(t) {
|
|
7472
7468
|
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();
|
|
7473
7469
|
}
|
|
7474
|
-
async function
|
|
7470
|
+
async function Jd(t) {
|
|
7475
7471
|
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();
|
|
7476
7472
|
}
|
|
7477
|
-
const
|
|
7473
|
+
const qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7478
7474
|
__proto__: null,
|
|
7479
|
-
down:
|
|
7480
|
-
up:
|
|
7475
|
+
down: Jd,
|
|
7476
|
+
up: Md
|
|
7481
7477
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7482
|
-
async function
|
|
7478
|
+
async function Bd(t) {
|
|
7483
7479
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
7484
7480
|
}
|
|
7485
|
-
async function
|
|
7481
|
+
async function Wd(t) {
|
|
7486
7482
|
await t.schema.dropIndex("users_name_index").execute();
|
|
7487
7483
|
}
|
|
7488
|
-
const
|
|
7484
|
+
const Kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7489
7485
|
__proto__: null,
|
|
7490
|
-
down:
|
|
7491
|
-
up:
|
|
7486
|
+
down: Wd,
|
|
7487
|
+
up: Bd
|
|
7492
7488
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7493
|
-
async function
|
|
7489
|
+
async function Ud(t) {
|
|
7494
7490
|
}
|
|
7495
|
-
async function
|
|
7491
|
+
async function Qd(t) {
|
|
7496
7492
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
7497
7493
|
}
|
|
7498
|
-
const
|
|
7494
|
+
const Vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7499
7495
|
__proto__: null,
|
|
7500
|
-
down:
|
|
7501
|
-
up:
|
|
7496
|
+
down: Qd,
|
|
7497
|
+
up: Ud
|
|
7502
7498
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7503
|
-
async function
|
|
7499
|
+
async function Gd(t) {
|
|
7504
7500
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
7505
7501
|
}
|
|
7506
|
-
async function
|
|
7502
|
+
async function Yd(t) {
|
|
7507
7503
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
7508
7504
|
}
|
|
7509
|
-
const
|
|
7505
|
+
const Hd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7510
7506
|
__proto__: null,
|
|
7511
|
-
down:
|
|
7512
|
-
up:
|
|
7507
|
+
down: Yd,
|
|
7508
|
+
up: Gd
|
|
7513
7509
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7514
|
-
async function
|
|
7510
|
+
async function Xd(t) {
|
|
7515
7511
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
7516
7512
|
}
|
|
7517
|
-
async function
|
|
7513
|
+
async function Zd(t) {
|
|
7518
7514
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
7519
7515
|
}
|
|
7520
|
-
const
|
|
7516
|
+
const ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7521
7517
|
__proto__: null,
|
|
7522
|
-
down:
|
|
7523
|
-
up:
|
|
7518
|
+
down: Zd,
|
|
7519
|
+
up: Xd
|
|
7524
7520
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7525
|
-
async function
|
|
7521
|
+
async function tc(t) {
|
|
7526
7522
|
await t.schema.createTable("branding").addColumn(
|
|
7527
7523
|
"tenant_id",
|
|
7528
7524
|
"varchar(255)",
|
|
7529
7525
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
7530
7526
|
).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();
|
|
7531
7527
|
}
|
|
7532
|
-
async function
|
|
7528
|
+
async function nc(t) {
|
|
7533
7529
|
await t.schema.dropTable("branding").execute();
|
|
7534
7530
|
}
|
|
7535
|
-
const
|
|
7531
|
+
const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7536
7532
|
__proto__: null,
|
|
7537
|
-
down:
|
|
7538
|
-
up:
|
|
7533
|
+
down: nc,
|
|
7534
|
+
up: tc
|
|
7539
7535
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7540
|
-
async function
|
|
7536
|
+
async function rc(t) {
|
|
7541
7537
|
}
|
|
7542
|
-
async function
|
|
7538
|
+
async function oc(t) {
|
|
7543
7539
|
}
|
|
7544
|
-
const
|
|
7540
|
+
const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7545
7541
|
__proto__: null,
|
|
7546
|
-
down:
|
|
7547
|
-
up:
|
|
7542
|
+
down: oc,
|
|
7543
|
+
up: rc
|
|
7548
7544
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7549
|
-
async function
|
|
7545
|
+
async function sc(t) {
|
|
7550
7546
|
}
|
|
7551
|
-
async function
|
|
7547
|
+
async function uc(t) {
|
|
7552
7548
|
}
|
|
7553
|
-
const
|
|
7549
|
+
const dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7554
7550
|
__proto__: null,
|
|
7555
|
-
down:
|
|
7556
|
-
up:
|
|
7551
|
+
down: uc,
|
|
7552
|
+
up: sc
|
|
7557
7553
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7558
|
-
async function
|
|
7554
|
+
async function cc(t) {
|
|
7559
7555
|
}
|
|
7560
|
-
async function
|
|
7556
|
+
async function lc(t) {
|
|
7561
7557
|
}
|
|
7562
|
-
const
|
|
7558
|
+
const _c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7563
7559
|
__proto__: null,
|
|
7564
|
-
down:
|
|
7565
|
-
up:
|
|
7560
|
+
down: lc,
|
|
7561
|
+
up: cc
|
|
7566
7562
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7567
|
-
async function
|
|
7563
|
+
async function mc(t) {
|
|
7568
7564
|
}
|
|
7569
|
-
async function
|
|
7565
|
+
async function hc(t) {
|
|
7570
7566
|
}
|
|
7571
|
-
const
|
|
7567
|
+
const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7572
7568
|
__proto__: null,
|
|
7573
|
-
down:
|
|
7574
|
-
up:
|
|
7569
|
+
down: hc,
|
|
7570
|
+
up: mc
|
|
7575
7571
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7576
|
-
async function
|
|
7572
|
+
async function pc(t) {
|
|
7577
7573
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
7578
7574
|
"tenant_id",
|
|
7579
7575
|
"varchar(255)",
|
|
@@ -7584,55 +7580,55 @@ async function pd(t) {
|
|
|
7584
7580
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
7585
7581
|
).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();
|
|
7586
7582
|
}
|
|
7587
|
-
async function
|
|
7583
|
+
async function gc(t) {
|
|
7588
7584
|
await t.schema.dropTable("authentication_codes").execute();
|
|
7589
7585
|
}
|
|
7590
|
-
const
|
|
7586
|
+
const wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7591
7587
|
__proto__: null,
|
|
7592
|
-
down:
|
|
7593
|
-
up:
|
|
7588
|
+
down: gc,
|
|
7589
|
+
up: pc
|
|
7594
7590
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7595
|
-
async function
|
|
7591
|
+
async function yc(t) {
|
|
7596
7592
|
}
|
|
7597
|
-
async function
|
|
7593
|
+
async function Nc(t) {
|
|
7598
7594
|
}
|
|
7599
|
-
const
|
|
7595
|
+
const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7600
7596
|
__proto__: null,
|
|
7601
|
-
down:
|
|
7602
|
-
up:
|
|
7597
|
+
down: Nc,
|
|
7598
|
+
up: yc
|
|
7603
7599
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7604
|
-
async function
|
|
7600
|
+
async function Cc(t) {
|
|
7605
7601
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
7606
7602
|
}
|
|
7607
|
-
async function
|
|
7603
|
+
async function xc(t) {
|
|
7608
7604
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
7609
7605
|
}
|
|
7610
|
-
const
|
|
7606
|
+
const bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7611
7607
|
__proto__: null,
|
|
7612
|
-
down:
|
|
7613
|
-
up:
|
|
7608
|
+
down: xc,
|
|
7609
|
+
up: Cc
|
|
7614
7610
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7615
|
-
async function
|
|
7611
|
+
async function Tc(t) {
|
|
7616
7612
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
7617
7613
|
}
|
|
7618
|
-
async function
|
|
7614
|
+
async function Oc(t) {
|
|
7619
7615
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
7620
7616
|
}
|
|
7621
|
-
const
|
|
7617
|
+
const Sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7622
7618
|
__proto__: null,
|
|
7623
|
-
down:
|
|
7624
|
-
up:
|
|
7619
|
+
down: Oc,
|
|
7620
|
+
up: Tc
|
|
7625
7621
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7626
|
-
async function
|
|
7622
|
+
async function kc(t) {
|
|
7627
7623
|
}
|
|
7628
|
-
async function
|
|
7624
|
+
async function Ic(t) {
|
|
7629
7625
|
}
|
|
7630
|
-
const
|
|
7626
|
+
const Ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7631
7627
|
__proto__: null,
|
|
7632
|
-
down:
|
|
7633
|
-
up:
|
|
7628
|
+
down: Ic,
|
|
7629
|
+
up: kc
|
|
7634
7630
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7635
|
-
async function
|
|
7631
|
+
async function Ac(t) {
|
|
7636
7632
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
7637
7633
|
"tenant_id",
|
|
7638
7634
|
"varchar(255)",
|
|
@@ -7643,33 +7639,33 @@ async function Ad(t) {
|
|
|
7643
7639
|
(e) => e.defaultTo(!1).notNull()
|
|
7644
7640
|
).addColumn("priority", "integer").execute();
|
|
7645
7641
|
}
|
|
7646
|
-
async function $
|
|
7642
|
+
async function $c(t) {
|
|
7647
7643
|
await t.schema.dropTable("hooks").execute();
|
|
7648
7644
|
}
|
|
7649
|
-
const
|
|
7645
|
+
const Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7650
7646
|
__proto__: null,
|
|
7651
|
-
down: $
|
|
7652
|
-
up:
|
|
7647
|
+
down: $c,
|
|
7648
|
+
up: Ac
|
|
7653
7649
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7654
|
-
async function
|
|
7650
|
+
async function Dc(t) {
|
|
7655
7651
|
}
|
|
7656
|
-
async function
|
|
7652
|
+
async function zc(t) {
|
|
7657
7653
|
}
|
|
7658
|
-
const
|
|
7654
|
+
const Rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7659
7655
|
__proto__: null,
|
|
7660
|
-
down:
|
|
7661
|
-
up:
|
|
7656
|
+
down: zc,
|
|
7657
|
+
up: Dc
|
|
7662
7658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7663
|
-
async function
|
|
7659
|
+
async function Fc(t) {
|
|
7664
7660
|
}
|
|
7665
|
-
async function
|
|
7661
|
+
async function jc(t) {
|
|
7666
7662
|
}
|
|
7667
|
-
const
|
|
7663
|
+
const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7668
7664
|
__proto__: null,
|
|
7669
|
-
down:
|
|
7670
|
-
up:
|
|
7665
|
+
down: jc,
|
|
7666
|
+
up: Fc
|
|
7671
7667
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7672
|
-
async function
|
|
7668
|
+
async function Mc(t) {
|
|
7673
7669
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
7674
7670
|
"tenant_id",
|
|
7675
7671
|
"varchar(255)",
|
|
@@ -7686,7 +7682,7 @@ async function Md(t) {
|
|
|
7686
7682
|
(e) => e.onDelete("cascade")
|
|
7687
7683
|
).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();
|
|
7688
7684
|
}
|
|
7689
|
-
async function
|
|
7685
|
+
async function Jc(t) {
|
|
7690
7686
|
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(
|
|
7691
7687
|
"codes_user_id_tenant_id_constraint",
|
|
7692
7688
|
["user_id", "tenant_id"],
|
|
@@ -7695,50 +7691,50 @@ async function Jd(t) {
|
|
|
7695
7691
|
(e) => e.onDelete("cascade")
|
|
7696
7692
|
).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();
|
|
7697
7693
|
}
|
|
7698
|
-
const
|
|
7694
|
+
const qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7699
7695
|
__proto__: null,
|
|
7700
|
-
down:
|
|
7701
|
-
up:
|
|
7696
|
+
down: Jc,
|
|
7697
|
+
up: Mc
|
|
7702
7698
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7703
|
-
async function
|
|
7699
|
+
async function Bc(t) {
|
|
7704
7700
|
}
|
|
7705
|
-
async function
|
|
7701
|
+
async function Wc(t) {
|
|
7706
7702
|
}
|
|
7707
|
-
const
|
|
7703
|
+
const Kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7708
7704
|
__proto__: null,
|
|
7709
|
-
down:
|
|
7710
|
-
up:
|
|
7705
|
+
down: Wc,
|
|
7706
|
+
up: Bc
|
|
7711
7707
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7712
|
-
async function
|
|
7708
|
+
async function Uc(t) {
|
|
7713
7709
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
7714
7710
|
}
|
|
7715
|
-
async function
|
|
7711
|
+
async function Qc(t) {
|
|
7716
7712
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
7717
7713
|
}
|
|
7718
|
-
const
|
|
7714
|
+
const Vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7719
7715
|
__proto__: null,
|
|
7720
|
-
down:
|
|
7721
|
-
up:
|
|
7716
|
+
down: Qc,
|
|
7717
|
+
up: Uc
|
|
7722
7718
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7723
|
-
async function
|
|
7719
|
+
async function Gc(t) {
|
|
7724
7720
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
7725
7721
|
}
|
|
7726
|
-
async function
|
|
7722
|
+
async function Yc(t) {
|
|
7727
7723
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
7728
7724
|
}
|
|
7729
|
-
const
|
|
7725
|
+
const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7730
7726
|
__proto__: null,
|
|
7731
|
-
down:
|
|
7732
|
-
up:
|
|
7727
|
+
down: Yc,
|
|
7728
|
+
up: Gc
|
|
7733
7729
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7734
|
-
async function
|
|
7730
|
+
async function Xc(t) {
|
|
7735
7731
|
}
|
|
7736
|
-
async function
|
|
7732
|
+
async function Zc(t) {
|
|
7737
7733
|
}
|
|
7738
7734
|
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7739
7735
|
__proto__: null,
|
|
7740
|
-
down:
|
|
7741
|
-
up:
|
|
7736
|
+
down: Zc,
|
|
7737
|
+
up: Xc
|
|
7742
7738
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7743
7739
|
async function tl(t) {
|
|
7744
7740
|
}
|
|
@@ -7764,19 +7760,19 @@ async function sl(t) {
|
|
|
7764
7760
|
}
|
|
7765
7761
|
async function ul(t) {
|
|
7766
7762
|
}
|
|
7767
|
-
const
|
|
7763
|
+
const dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7768
7764
|
__proto__: null,
|
|
7769
7765
|
down: ul,
|
|
7770
7766
|
up: sl
|
|
7771
7767
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7772
|
-
async function
|
|
7768
|
+
async function cl(t) {
|
|
7773
7769
|
}
|
|
7774
7770
|
async function ll(t) {
|
|
7775
7771
|
}
|
|
7776
7772
|
const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7777
7773
|
__proto__: null,
|
|
7778
7774
|
down: ll,
|
|
7779
|
-
up:
|
|
7775
|
+
up: cl
|
|
7780
7776
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7781
7777
|
async function ml(t) {
|
|
7782
7778
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
@@ -7834,12 +7830,12 @@ async function gl(t) {
|
|
|
7834
7830
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
7835
7831
|
).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();
|
|
7836
7832
|
}
|
|
7837
|
-
const
|
|
7833
|
+
const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7838
7834
|
__proto__: null,
|
|
7839
7835
|
down: gl,
|
|
7840
7836
|
up: pl
|
|
7841
7837
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7842
|
-
async function
|
|
7838
|
+
async function yl(t) {
|
|
7843
7839
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
7844
7840
|
}
|
|
7845
7841
|
async function Nl(t) {
|
|
@@ -7848,7 +7844,7 @@ async function Nl(t) {
|
|
|
7848
7844
|
const vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7849
7845
|
__proto__: null,
|
|
7850
7846
|
down: Nl,
|
|
7851
|
-
up:
|
|
7847
|
+
up: yl
|
|
7852
7848
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7853
7849
|
async function Cl(t) {
|
|
7854
7850
|
}
|
|
@@ -8030,19 +8026,19 @@ async function s_(t) {
|
|
|
8030
8026
|
async function u_(t) {
|
|
8031
8027
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
8032
8028
|
}
|
|
8033
|
-
const
|
|
8029
|
+
const d_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8034
8030
|
__proto__: null,
|
|
8035
8031
|
down: u_,
|
|
8036
8032
|
up: s_
|
|
8037
8033
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8038
|
-
async function
|
|
8034
|
+
async function c_(t) {
|
|
8039
8035
|
}
|
|
8040
8036
|
async function l_(t) {
|
|
8041
8037
|
}
|
|
8042
8038
|
const __ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8043
8039
|
__proto__: null,
|
|
8044
8040
|
down: l_,
|
|
8045
|
-
up:
|
|
8041
|
+
up: c_
|
|
8046
8042
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8047
8043
|
async function m_(t) {
|
|
8048
8044
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
@@ -8093,12 +8089,12 @@ async function p_(t) {
|
|
|
8093
8089
|
async function g_(t) {
|
|
8094
8090
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
8095
8091
|
}
|
|
8096
|
-
const
|
|
8092
|
+
const w_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8097
8093
|
__proto__: null,
|
|
8098
8094
|
down: g_,
|
|
8099
8095
|
up: p_
|
|
8100
8096
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8101
|
-
async function
|
|
8097
|
+
async function y_(t) {
|
|
8102
8098
|
await t.schema.createTable("custom_domains").addColumn(
|
|
8103
8099
|
"custom_domain_id",
|
|
8104
8100
|
"varchar(21)",
|
|
@@ -8119,7 +8115,7 @@ async function N_(t) {
|
|
|
8119
8115
|
const v_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8120
8116
|
__proto__: null,
|
|
8121
8117
|
down: N_,
|
|
8122
|
-
up:
|
|
8118
|
+
up: y_
|
|
8123
8119
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8124
8120
|
async function C_(t) {
|
|
8125
8121
|
}
|
|
@@ -8304,12 +8300,12 @@ async function sm(t) {
|
|
|
8304
8300
|
async function um(t) {
|
|
8305
8301
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
8306
8302
|
}
|
|
8307
|
-
const
|
|
8303
|
+
const dm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8308
8304
|
__proto__: null,
|
|
8309
8305
|
down: um,
|
|
8310
8306
|
up: sm
|
|
8311
8307
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8312
|
-
async function
|
|
8308
|
+
async function cm(t) {
|
|
8313
8309
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
8314
8310
|
}
|
|
8315
8311
|
async function lm(t) {
|
|
@@ -8318,7 +8314,7 @@ async function lm(t) {
|
|
|
8318
8314
|
const _m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8319
8315
|
__proto__: null,
|
|
8320
8316
|
down: lm,
|
|
8321
|
-
up:
|
|
8317
|
+
up: cm
|
|
8322
8318
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8323
8319
|
async function mm(t) {
|
|
8324
8320
|
await t.schema.createTable("themes").addColumn(
|
|
@@ -8409,12 +8405,12 @@ async function pm(t) {
|
|
|
8409
8405
|
async function gm(t) {
|
|
8410
8406
|
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
8411
8407
|
}
|
|
8412
|
-
const
|
|
8408
|
+
const wm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8413
8409
|
__proto__: null,
|
|
8414
8410
|
down: gm,
|
|
8415
8411
|
up: pm
|
|
8416
8412
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8417
|
-
async function
|
|
8413
|
+
async function ym(t) {
|
|
8418
8414
|
await t.schema.createTable("role_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
8419
8415
|
"resource_server_identifier",
|
|
8420
8416
|
"varchar(191)",
|
|
@@ -8441,7 +8437,7 @@ async function Nm(t) {
|
|
|
8441
8437
|
const vm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8442
8438
|
__proto__: null,
|
|
8443
8439
|
down: Nm,
|
|
8444
|
-
up:
|
|
8440
|
+
up: ym
|
|
8445
8441
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8446
8442
|
async function Cm(t) {
|
|
8447
8443
|
await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
@@ -8619,10 +8615,10 @@ async function Jm(t) {
|
|
|
8619
8615
|
), console.log(
|
|
8620
8616
|
`Dropped foreign key constraint ${o} from ${u}`
|
|
8621
8617
|
);
|
|
8622
|
-
} catch (
|
|
8618
|
+
} catch (d) {
|
|
8623
8619
|
console.warn(
|
|
8624
8620
|
`Failed to drop constraint ${o} from ${u}:`,
|
|
8625
|
-
|
|
8621
|
+
d
|
|
8626
8622
|
);
|
|
8627
8623
|
}
|
|
8628
8624
|
}
|
|
@@ -8879,12 +8875,12 @@ const sh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8879
8875
|
async function uh(t) {
|
|
8880
8876
|
await t.schema.dropIndex("idx_user_organizations_tenant_id").execute();
|
|
8881
8877
|
}
|
|
8882
|
-
async function
|
|
8878
|
+
async function dh(t) {
|
|
8883
8879
|
await t.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute();
|
|
8884
8880
|
}
|
|
8885
|
-
const
|
|
8881
|
+
const ch = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8886
8882
|
__proto__: null,
|
|
8887
|
-
down:
|
|
8883
|
+
down: dh,
|
|
8888
8884
|
up: uh
|
|
8889
8885
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8890
8886
|
async function lh(t) {
|
|
@@ -8998,12 +8994,12 @@ const ph = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8998
8994
|
async function gh(t) {
|
|
8999
8995
|
await t.schema.createTable("invites").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("organization_id", "varchar(21)", (e) => e.notNull()).addColumn("inviter", "text", (e) => e.notNull()).addColumn("invitee", "text", (e) => e.notNull()).addColumn("client_id", "varchar(191)", (e) => e.notNull()).addColumn("connection_id", "varchar(21)").addColumn("invitation_url", "text", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)", (e) => e.notNull()).addColumn("app_metadata", "text").addColumn("user_metadata", "text").addColumn("roles", "text").addColumn("ticket_id", "varchar(191)").addColumn("ttl_sec", "integer").addColumn("send_invitation_email", "integer").execute(), await t.schema.createIndex("idx_invites_tenant_id").on("invites").column("tenant_id").execute(), await t.schema.createIndex("idx_invites_organization_id").on("invites").column("organization_id").execute(), await t.schema.createIndex("idx_invites_expires_at").on("invites").column("expires_at").execute(), await t.schema.createIndex("idx_invites_tenant_created").on("invites").columns(["tenant_id", "created_at"]).execute();
|
|
9000
8996
|
}
|
|
9001
|
-
async function
|
|
8997
|
+
async function wh(t) {
|
|
9002
8998
|
await t.schema.dropTable("invites").execute();
|
|
9003
8999
|
}
|
|
9004
|
-
const
|
|
9000
|
+
const yh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9005
9001
|
__proto__: null,
|
|
9006
|
-
down:
|
|
9002
|
+
down: wh,
|
|
9007
9003
|
up: gh
|
|
9008
9004
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9009
9005
|
async function Nh(t) {
|
|
@@ -9018,10 +9014,10 @@ const Ch = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9018
9014
|
up: Nh
|
|
9019
9015
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9020
9016
|
async function xh(t) {
|
|
9021
|
-
await t.schema.alterTable("logs").addColumn("country_code", "varchar(2)").execute(), await t.schema.alterTable("logs").addColumn("
|
|
9017
|
+
await t.schema.alterTable("logs").addColumn("country_code", "varchar(2)").execute(), await t.schema.alterTable("logs").addColumn("city_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("latitude", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("longitude", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("time_zone", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("continent_code", "varchar(2)").execute();
|
|
9022
9018
|
}
|
|
9023
9019
|
async function bh(t) {
|
|
9024
|
-
await t.schema.alterTable("logs").dropColumn("country_code").execute(), await t.schema.alterTable("logs").dropColumn("
|
|
9020
|
+
await t.schema.alterTable("logs").dropColumn("country_code").execute(), await t.schema.alterTable("logs").dropColumn("city_name").execute(), await t.schema.alterTable("logs").dropColumn("latitude").execute(), await t.schema.alterTable("logs").dropColumn("longitude").execute(), await t.schema.alterTable("logs").dropColumn("time_zone").execute(), await t.schema.alterTable("logs").dropColumn("continent_code").execute();
|
|
9025
9021
|
}
|
|
9026
9022
|
const Th = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9027
9023
|
__proto__: null,
|
|
@@ -9137,49 +9133,49 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9137
9133
|
m9_passwordTableNewField: Ku,
|
|
9138
9134
|
n01_codesTable: Vu,
|
|
9139
9135
|
n11_universalLoginSession: Hu,
|
|
9140
|
-
n12_userFields:
|
|
9141
|
-
n13_userEmailIndex:
|
|
9142
|
-
n14_profileDataField:
|
|
9143
|
-
n15_userEmailIndex:
|
|
9144
|
-
n16_userLocale:
|
|
9145
|
-
n17_signingKeys:
|
|
9146
|
-
n18_logsFields:
|
|
9147
|
-
n19_connectionsUserinfo:
|
|
9148
|
-
n20_missingFields:
|
|
9149
|
-
n21_sessionDeletedAt:
|
|
9150
|
-
n22_dropLogsFields:
|
|
9151
|
-
n23_dropUsersFields:
|
|
9152
|
-
n24_logsIndexes:
|
|
9153
|
-
n25_logDescMaxLength:
|
|
9154
|
-
n26_logsTableExtraFields:
|
|
9155
|
-
n27_usersTableNameIndex:
|
|
9156
|
-
n28_usersEmailConstrain:
|
|
9157
|
-
n29_increaseOtpStateLength:
|
|
9158
|
-
n30_increaseTicketStateLength:
|
|
9159
|
-
n31_branding:
|
|
9160
|
-
n32_indexesAndNotNull:
|
|
9161
|
-
n33_vendorIdInUniversalLoginSession:
|
|
9162
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
9163
|
-
n35_increaseUniversalSessionStateLength:
|
|
9164
|
-
n36_authenticationCodes:
|
|
9165
|
-
n37_disableSignUps:
|
|
9166
|
-
n38_otpIpAddress:
|
|
9167
|
-
n39_increaseUserAgentLength:
|
|
9168
|
-
n40_userId:
|
|
9169
|
-
n41_hooks:
|
|
9170
|
-
n42_userIdIndexes:
|
|
9171
|
-
n43_userIdIndexes:
|
|
9172
|
-
n44_codes:
|
|
9173
|
-
n45_hookProperties:
|
|
9174
|
-
n46_loginAuth0Client:
|
|
9175
|
-
n47_loginAuth0Client:
|
|
9136
|
+
n12_userFields: ed,
|
|
9137
|
+
n13_userEmailIndex: ad,
|
|
9138
|
+
n14_profileDataField: id,
|
|
9139
|
+
n15_userEmailIndex: dd,
|
|
9140
|
+
n16_userLocale: _d,
|
|
9141
|
+
n17_signingKeys: fd,
|
|
9142
|
+
n18_logsFields: wd,
|
|
9143
|
+
n19_connectionsUserinfo: vd,
|
|
9144
|
+
n20_missingFields: bd,
|
|
9145
|
+
n21_sessionDeletedAt: Sd,
|
|
9146
|
+
n22_dropLogsFields: Ed,
|
|
9147
|
+
n23_dropUsersFields: Pd,
|
|
9148
|
+
n24_logsIndexes: Rd,
|
|
9149
|
+
n25_logDescMaxLength: Ld,
|
|
9150
|
+
n26_logsTableExtraFields: qd,
|
|
9151
|
+
n27_usersTableNameIndex: Kd,
|
|
9152
|
+
n28_usersEmailConstrain: Vd,
|
|
9153
|
+
n29_increaseOtpStateLength: Hd,
|
|
9154
|
+
n30_increaseTicketStateLength: ec,
|
|
9155
|
+
n31_branding: ac,
|
|
9156
|
+
n32_indexesAndNotNull: ic,
|
|
9157
|
+
n33_vendorIdInUniversalLoginSession: dc,
|
|
9158
|
+
n34_auth0ClientInUniversalLoginSession: _c,
|
|
9159
|
+
n35_increaseUniversalSessionStateLength: fc,
|
|
9160
|
+
n36_authenticationCodes: wc,
|
|
9161
|
+
n37_disableSignUps: vc,
|
|
9162
|
+
n38_otpIpAddress: bc,
|
|
9163
|
+
n39_increaseUserAgentLength: Sc,
|
|
9164
|
+
n40_userId: Ec,
|
|
9165
|
+
n41_hooks: Pc,
|
|
9166
|
+
n42_userIdIndexes: Rc,
|
|
9167
|
+
n43_userIdIndexes: Lc,
|
|
9168
|
+
n44_codes: qc,
|
|
9169
|
+
n45_hookProperties: Kc,
|
|
9170
|
+
n46_loginAuth0Client: Vc,
|
|
9171
|
+
n47_loginAuth0Client: Hc,
|
|
9176
9172
|
n48_saml: el,
|
|
9177
9173
|
n49_removeFields: al,
|
|
9178
9174
|
n50_authParamsNonce: il,
|
|
9179
|
-
n51_connectionid:
|
|
9175
|
+
n51_connectionid: dl,
|
|
9180
9176
|
n52_cert: _l,
|
|
9181
9177
|
n53_codes_primary_key: fl,
|
|
9182
|
-
n54_cleanup_tables:
|
|
9178
|
+
n54_cleanup_tables: wl,
|
|
9183
9179
|
n55_logs_index: vl,
|
|
9184
9180
|
n56_application_fields: bl,
|
|
9185
9181
|
n57_prompt_settings: Sl,
|
|
@@ -9194,10 +9190,10 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9194
9190
|
n66_email_providers: e_,
|
|
9195
9191
|
n67_drop_tickets: a_,
|
|
9196
9192
|
n68_login_useragents: i_,
|
|
9197
|
-
n70_refresh_tokens:
|
|
9193
|
+
n70_refresh_tokens: d_,
|
|
9198
9194
|
n71_session_new_fields: __,
|
|
9199
9195
|
n72_session_primary_key: f_,
|
|
9200
|
-
n73_drop_sessions:
|
|
9196
|
+
n73_drop_sessions: w_,
|
|
9201
9197
|
n74_custom_domains: v_,
|
|
9202
9198
|
n75_organizations: b_,
|
|
9203
9199
|
n76_authorization_url_length: S_,
|
|
@@ -9212,10 +9208,10 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9212
9208
|
n85_add_login_session_id_to_sessions: em,
|
|
9213
9209
|
n86_index_sessions_login_session_id: am,
|
|
9214
9210
|
n87_code_challenge: im,
|
|
9215
|
-
n88_add_redirect_uri_to_codes:
|
|
9211
|
+
n88_add_redirect_uri_to_codes: dm,
|
|
9216
9212
|
n89_add_nonce_and_state_to_codes: _m,
|
|
9217
9213
|
n90_themes: fm,
|
|
9218
|
-
n91_resource_servers_rules_permissions:
|
|
9214
|
+
n91_resource_servers_rules_permissions: wm,
|
|
9219
9215
|
n92_role_permissions: vm,
|
|
9220
9216
|
n93_add_permissions_to_roles: bm,
|
|
9221
9217
|
n94_keys_connection_and_extend_columns: Sm,
|
|
@@ -9229,10 +9225,10 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9229
9225
|
o003_phone_number_index: th,
|
|
9230
9226
|
o004_login_sessions_id_index: rh,
|
|
9231
9227
|
o005_connections_tenant_index: sh,
|
|
9232
|
-
o006_remove_redundant_user_organizations_tenant_index:
|
|
9228
|
+
o006_remove_redundant_user_organizations_tenant_index: ch,
|
|
9233
9229
|
o007_tenant_settings: mh,
|
|
9234
9230
|
o008_merge_tenant_settings_into_tenants: ph,
|
|
9235
|
-
o009_create_invites_table:
|
|
9231
|
+
o009_create_invites_table: yh,
|
|
9236
9232
|
o010_add_log_id_to_logs: Ch,
|
|
9237
9233
|
o011_add_location_info_to_logs: Th,
|
|
9238
9234
|
o012_add_password_history: kh
|
|
@@ -9271,7 +9267,7 @@ function zh(t) {
|
|
|
9271
9267
|
codes: Dr(t),
|
|
9272
9268
|
connections: Qr(t),
|
|
9273
9269
|
emailProviders: Wo(t),
|
|
9274
|
-
customDomains:
|
|
9270
|
+
customDomains: wo(t),
|
|
9275
9271
|
forms: ai(t),
|
|
9276
9272
|
hooks: So(t),
|
|
9277
9273
|
invites: Gi(t),
|
|
@@ -9281,8 +9277,8 @@ function zh(t) {
|
|
|
9281
9277
|
passwords: kr(t),
|
|
9282
9278
|
promptSettings: Mo(t),
|
|
9283
9279
|
refreshTokens: Yo(t),
|
|
9284
|
-
resourceServers:
|
|
9285
|
-
rolePermissions:
|
|
9280
|
+
resourceServers: di(t),
|
|
9281
|
+
rolePermissions: yi(t),
|
|
9286
9282
|
userPermissions: bi(t),
|
|
9287
9283
|
userRoles: Ii(t),
|
|
9288
9284
|
roles: fi(t),
|