@authhero/kysely-adapter 12.16.0 → 12.17.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 +2 -2
- package/dist/kysely-adapter.d.ts +9 -1
- package/dist/kysely-adapter.mjs +425 -329
- package/dist/types/migrate/migrations/2026-10-26T12:00:00_config_sync_hash.d.ts +4 -0
- package/dist/types/migrate/migrations/2026-10-27T12:00:00_config_sync_mode.d.ts +4 -0
- package/dist/types/migrate/migrations/2026-10-28T12:00:00_rollout_config.d.ts +4 -0
- package/dist/types/migrate/migrations/index.d.ts +6 -0
- package/dist/types/src/db.d.ts +9 -1
- package/dist/types/src/logs/list.d.ts +2 -2
- package/dist/types/src/tenants/list.d.ts +6 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -248,14 +248,14 @@ function k(e, t, n, r, i = [], a = {}) {
|
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/actions/list.ts
|
|
251
|
-
function
|
|
251
|
+
function qe(e) {
|
|
252
252
|
if (e) try {
|
|
253
253
|
return JSON.parse(e);
|
|
254
254
|
} catch {
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Je(e) {
|
|
259
259
|
let { created_at_ts: t, updated_at_ts: n, deployed_at_ts: i, secrets: a, dependencies: o, supported_triggers: s, is_system: c, inherit: l, scope: u, override: d, enforce: f, tenant_id: p, ...m } = e, h = r({
|
|
260
260
|
created_at_ts: t,
|
|
261
261
|
updated_at_ts: n
|
|
@@ -267,9 +267,9 @@ function qe(e) {
|
|
|
267
267
|
runtime: m.runtime ?? void 0,
|
|
268
268
|
status: m.status || "built",
|
|
269
269
|
deployed_at: i ? new Date(Number(i)).toISOString() : void 0,
|
|
270
|
-
secrets:
|
|
271
|
-
dependencies:
|
|
272
|
-
supported_triggers:
|
|
270
|
+
secrets: qe(a),
|
|
271
|
+
dependencies: qe(o),
|
|
272
|
+
supported_triggers: qe(s),
|
|
273
273
|
is_system: !!c,
|
|
274
274
|
inherit: !!l,
|
|
275
275
|
scope: u ?? void 0,
|
|
@@ -277,7 +277,7 @@ function qe(e) {
|
|
|
277
277
|
enforce: E(f)
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Ye(e) {
|
|
281
281
|
return async (t, n = {}) => {
|
|
282
282
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, q: s } = n, c = e.selectFrom("actions").where("actions.tenant_id", "=", t);
|
|
283
283
|
if (s && (c = k(e, c, s, ["name"])), D(n)) {
|
|
@@ -285,7 +285,7 @@ function Je(e) {
|
|
|
285
285
|
sortColumn: "created_at_ts",
|
|
286
286
|
sortOrder: "desc",
|
|
287
287
|
idColumn: "id"
|
|
288
|
-
}), i = e.map(
|
|
288
|
+
}), i = e.map(Je);
|
|
289
289
|
return {
|
|
290
290
|
actions: i,
|
|
291
291
|
start: 0,
|
|
@@ -294,7 +294,7 @@ function Je(e) {
|
|
|
294
294
|
next: r
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
let l = (await c.offset(r * i).limit(i).selectAll().execute()).map(
|
|
297
|
+
let l = (await c.offset(r * i).limit(i).selectAll().execute()).map(Je);
|
|
298
298
|
if (!a) return {
|
|
299
299
|
actions: l,
|
|
300
300
|
start: r * i,
|
|
@@ -312,7 +312,7 @@ function Je(e) {
|
|
|
312
312
|
}
|
|
313
313
|
//#endregion
|
|
314
314
|
//#region src/actions/update.ts
|
|
315
|
-
function
|
|
315
|
+
function Xe(e) {
|
|
316
316
|
if (!e) return [];
|
|
317
317
|
try {
|
|
318
318
|
let t = JSON.parse(e);
|
|
@@ -321,11 +321,11 @@ function Ye(e) {
|
|
|
321
321
|
return [];
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ze(e) {
|
|
325
325
|
return async (t, n, r) => {
|
|
326
326
|
let i = { updated_at_ts: Date.now() };
|
|
327
327
|
if (r.name !== void 0 && (i.name = r.name), r.code !== void 0 && (i.code = r.code), r.runtime !== void 0 && (i.runtime = r.runtime), r.secrets !== void 0) {
|
|
328
|
-
let a = await e.selectFrom("actions").where("actions.id", "=", n).where("actions.tenant_id", "=", t).select("secrets").executeTakeFirst(), o = new Map(
|
|
328
|
+
let a = await e.selectFrom("actions").where("actions.id", "=", n).where("actions.tenant_id", "=", t).select("secrets").executeTakeFirst(), o = new Map(Xe(a?.secrets).map((e) => [e.name, e])), s = r.secrets.map((e) => e.value === void 0 ? {
|
|
329
329
|
name: e.name,
|
|
330
330
|
value: o.get(e.name)?.value
|
|
331
331
|
} : e);
|
|
@@ -340,23 +340,23 @@ function Xe(e) {
|
|
|
340
340
|
}
|
|
341
341
|
//#endregion
|
|
342
342
|
//#region src/actions/remove.ts
|
|
343
|
-
function
|
|
343
|
+
function Qe(e) {
|
|
344
344
|
return async (t, n) => (await e.deleteFrom("actions").where("actions.id", "=", n).where("actions.tenant_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
345
345
|
}
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region src/actions/index.ts
|
|
348
|
-
function
|
|
348
|
+
function $e(e) {
|
|
349
349
|
return {
|
|
350
350
|
create: He(e),
|
|
351
351
|
get: We(e),
|
|
352
|
-
list:
|
|
353
|
-
update:
|
|
354
|
-
remove:
|
|
352
|
+
list: Ye(e),
|
|
353
|
+
update: Ze(e),
|
|
354
|
+
remove: Qe(e)
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
//#endregion
|
|
358
358
|
//#region src/actionExecutions/create.ts
|
|
359
|
-
function
|
|
359
|
+
function et(e) {
|
|
360
360
|
return async (t, n) => {
|
|
361
361
|
let r = Date.now();
|
|
362
362
|
return await e.insertInto("action_executions").values({
|
|
@@ -382,14 +382,14 @@ function $e(e) {
|
|
|
382
382
|
}
|
|
383
383
|
//#endregion
|
|
384
384
|
//#region src/actionExecutions/get.ts
|
|
385
|
-
function
|
|
385
|
+
function tt(e) {
|
|
386
386
|
if (e) try {
|
|
387
387
|
return JSON.parse(e);
|
|
388
388
|
} catch {
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function nt(e) {
|
|
393
393
|
return async (t, n) => {
|
|
394
394
|
let r = await e.selectFrom("action_executions").where("action_executions.tenant_id", "=", t).where("action_executions.id", "=", n).selectAll().executeTakeFirst();
|
|
395
395
|
return r ? {
|
|
@@ -397,8 +397,8 @@ function tt(e) {
|
|
|
397
397
|
tenant_id: r.tenant_id,
|
|
398
398
|
trigger_id: r.trigger_id,
|
|
399
399
|
status: r.status,
|
|
400
|
-
results:
|
|
401
|
-
logs:
|
|
400
|
+
results: tt(r.results) ?? [],
|
|
401
|
+
logs: tt(r.logs),
|
|
402
402
|
created_at: new Date(Number(r.created_at_ts)).toISOString(),
|
|
403
403
|
updated_at: new Date(Number(r.updated_at_ts)).toISOString()
|
|
404
404
|
} : null;
|
|
@@ -406,7 +406,7 @@ function tt(e) {
|
|
|
406
406
|
}
|
|
407
407
|
//#endregion
|
|
408
408
|
//#region src/helpers/database-type.ts
|
|
409
|
-
async function
|
|
409
|
+
async function rt(e) {
|
|
410
410
|
try {
|
|
411
411
|
return await p`SELECT VERSION()`.execute(e), "mysql";
|
|
412
412
|
} catch {
|
|
@@ -415,19 +415,19 @@ async function nt(e) {
|
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region src/actionExecutions/cleanup.ts
|
|
418
|
-
var
|
|
419
|
-
function
|
|
418
|
+
var it = 5e4;
|
|
419
|
+
function at(e) {
|
|
420
420
|
let t;
|
|
421
421
|
return async (n) => {
|
|
422
422
|
let r = Date.parse(n);
|
|
423
423
|
if (Number.isNaN(r)) throw Error(`Invalid olderThan date: ${n}`);
|
|
424
|
-
if (t ??= await
|
|
424
|
+
if (t ??= await rt(e), t === "sqlite") {
|
|
425
425
|
let t = await e.deleteFrom("action_executions").where("created_at_ts", "<", r).executeTakeFirst();
|
|
426
426
|
return Number(t.numDeletedRows);
|
|
427
427
|
}
|
|
428
|
-
let i = 0, a =
|
|
429
|
-
for (; a >=
|
|
430
|
-
let t = await e.deleteFrom("action_executions").where("created_at_ts", "<", r).limit(
|
|
428
|
+
let i = 0, a = it;
|
|
429
|
+
for (; a >= it;) {
|
|
430
|
+
let t = await e.deleteFrom("action_executions").where("created_at_ts", "<", r).limit(it).executeTakeFirst();
|
|
431
431
|
a = Number(t.numDeletedRows), i += a;
|
|
432
432
|
}
|
|
433
433
|
return i;
|
|
@@ -435,36 +435,36 @@ function rt(e) {
|
|
|
435
435
|
}
|
|
436
436
|
//#endregion
|
|
437
437
|
//#region src/actionExecutions/index.ts
|
|
438
|
-
function
|
|
438
|
+
function ot(e) {
|
|
439
439
|
return {
|
|
440
|
-
create:
|
|
441
|
-
get:
|
|
442
|
-
cleanup:
|
|
440
|
+
create: et(e),
|
|
441
|
+
get: nt(e),
|
|
442
|
+
cleanup: at(e)
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
//#endregion
|
|
446
446
|
//#region src/actionVersions/index.ts
|
|
447
|
-
function
|
|
447
|
+
function A(e) {
|
|
448
448
|
if (e) try {
|
|
449
449
|
return JSON.parse(e);
|
|
450
450
|
} catch {
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function st(e) {
|
|
455
455
|
let { created_at_ts: t, updated_at_ts: n, secrets: r, dependencies: i, supported_triggers: a, deployed: o, runtime: s, ...c } = e;
|
|
456
456
|
return {
|
|
457
457
|
...c,
|
|
458
458
|
runtime: s ?? void 0,
|
|
459
459
|
deployed: !!o,
|
|
460
|
-
secrets:
|
|
461
|
-
dependencies:
|
|
462
|
-
supported_triggers:
|
|
460
|
+
secrets: A(r),
|
|
461
|
+
dependencies: A(i),
|
|
462
|
+
supported_triggers: A(a),
|
|
463
463
|
created_at: new Date(Number(t)).toISOString(),
|
|
464
464
|
updated_at: new Date(Number(n)).toISOString()
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function ct(e) {
|
|
468
468
|
return {
|
|
469
469
|
async create(t, n, r) {
|
|
470
470
|
let i = r?.importMetadata, a = Date.now(), o = i?.created_at ? new Date(i.created_at).getTime() : a, s = i?.updated_at ? new Date(i.updated_at).getTime() : i ? o : a, c = i?.id ?? Le(), l = n.deployed !== !1, u = await e.transaction().execute(async (e) => {
|
|
@@ -504,10 +504,10 @@ function st(e) {
|
|
|
504
504
|
},
|
|
505
505
|
async get(t, n, r) {
|
|
506
506
|
let i = await e.selectFrom("action_versions").where("tenant_id", "=", t).where("action_id", "=", n).where("id", "=", r).selectAll().executeTakeFirst();
|
|
507
|
-
return i ?
|
|
507
|
+
return i ? st(i) : null;
|
|
508
508
|
},
|
|
509
509
|
async list(t, n, r = {}) {
|
|
510
|
-
let { page: i = 0, per_page: a = 50, include_totals: s = !1 } = r, c = e.selectFrom("action_versions").where("tenant_id", "=", t).where("action_id", "=", n), l = (await c.orderBy("number", "desc").offset(i * a).limit(a).selectAll().execute()).map(
|
|
510
|
+
let { page: i = 0, per_page: a = 50, include_totals: s = !1 } = r, c = e.selectFrom("action_versions").where("tenant_id", "=", t).where("action_id", "=", n), l = (await c.orderBy("number", "desc").offset(i * a).limit(a).selectAll().execute()).map(st);
|
|
511
511
|
if (!s) return {
|
|
512
512
|
versions: l,
|
|
513
513
|
start: 0,
|
|
@@ -530,7 +530,7 @@ function st(e) {
|
|
|
530
530
|
}
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region src/outbox/create.ts
|
|
533
|
-
async function
|
|
533
|
+
async function j(e, t, n, r) {
|
|
534
534
|
await e.insertInto("outbox_events").values({
|
|
535
535
|
id: n,
|
|
536
536
|
tenant_id: t,
|
|
@@ -549,15 +549,15 @@ async function M(e, t, n, r) {
|
|
|
549
549
|
error: null
|
|
550
550
|
}).execute();
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function lt(e) {
|
|
553
553
|
return async (n, r) => {
|
|
554
554
|
let i = t();
|
|
555
|
-
return await
|
|
555
|
+
return await j(e, n, i, r), i;
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
558
|
//#endregion
|
|
559
559
|
//#region src/users/create.ts
|
|
560
|
-
function
|
|
560
|
+
function ut(e) {
|
|
561
561
|
return async (n, r, i) => {
|
|
562
562
|
let a = i?.importMetadata, { identities: o, phone_verified: s, password: c, last_login: l, last_ip: u, login_count: d, ...f } = r, p = (/* @__PURE__ */ new Date()).toISOString(), h = {
|
|
563
563
|
...f,
|
|
@@ -592,7 +592,7 @@ function lt(e) {
|
|
|
592
592
|
};
|
|
593
593
|
await e.insertInto("passwords").values(r).execute();
|
|
594
594
|
}
|
|
595
|
-
for (let t of i?.outboxEvents ?? []) await
|
|
595
|
+
for (let t of i?.outboxEvents ?? []) await j(e, n, t.id, t);
|
|
596
596
|
};
|
|
597
597
|
try {
|
|
598
598
|
e.isTransaction ? await g(e) : await e.transaction().execute(g);
|
|
@@ -617,16 +617,16 @@ function lt(e) {
|
|
|
617
617
|
}
|
|
618
618
|
//#endregion
|
|
619
619
|
//#region src/users/createMany.ts
|
|
620
|
-
var
|
|
621
|
-
function
|
|
620
|
+
var M = 500;
|
|
621
|
+
function dt(e) {
|
|
622
622
|
let t = e;
|
|
623
623
|
return t.identities !== void 0 || t.last_login !== void 0 || t.last_ip !== void 0 || t.login_count !== void 0;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function ft(e) {
|
|
626
626
|
return async (n, r, i) => {
|
|
627
627
|
if (r.length === 0) return [];
|
|
628
628
|
if (i?.outboxEvents?.length) throw new m(400, { message: "createMany does not persist outbox events; use create for those users" });
|
|
629
|
-
if (r.find(
|
|
629
|
+
if (r.find(dt)) throw new m(400, { message: "createMany does not write identities or activity counters; use create for those users" });
|
|
630
630
|
let a = (/* @__PURE__ */ new Date()).toISOString(), o = r.map((e) => {
|
|
631
631
|
let { identities: r, phone_verified: i, password: o, last_login: s, last_ip: c, login_count: l, ...u } = e, d = {
|
|
632
632
|
...u,
|
|
@@ -657,8 +657,8 @@ function dt(e) {
|
|
|
657
657
|
original: e
|
|
658
658
|
};
|
|
659
659
|
}), s = o.map((e) => e.sqlUser), c = o.map((e) => e.passwordRecord).filter((e) => e !== void 0), l = async (e) => {
|
|
660
|
-
for (let t = 0; t < s.length; t +=
|
|
661
|
-
for (let t = 0; t < c.length; t +=
|
|
660
|
+
for (let t = 0; t < s.length; t += M) await e.insertInto("users").values(s.slice(t, t + M)).execute();
|
|
661
|
+
for (let t = 0; t < c.length; t += M) await e.insertInto("passwords").values(c.slice(t, t + M)).execute();
|
|
662
662
|
};
|
|
663
663
|
try {
|
|
664
664
|
e.isTransaction ? await l(e) : await e.transaction().execute(l);
|
|
@@ -681,21 +681,21 @@ function dt(e) {
|
|
|
681
681
|
}
|
|
682
682
|
//#endregion
|
|
683
683
|
//#region src/users/user-to-identity.ts
|
|
684
|
-
var
|
|
684
|
+
var pt = [
|
|
685
685
|
"email",
|
|
686
686
|
"email_verified",
|
|
687
687
|
"phone_number",
|
|
688
688
|
"phone_verified",
|
|
689
689
|
"username"
|
|
690
690
|
];
|
|
691
|
-
function
|
|
691
|
+
function N(e, t = !1) {
|
|
692
692
|
let n = {
|
|
693
693
|
connection: e.connection,
|
|
694
694
|
provider: e.provider,
|
|
695
695
|
user_id: pe(e.user_id).id,
|
|
696
696
|
isSocial: !!e.is_social
|
|
697
697
|
};
|
|
698
|
-
for (let t of
|
|
698
|
+
for (let t of pt) e[t] !== void 0 && e[t] !== null && (n[t] = t.endsWith("_verified") ? !!e[t] : e[t]);
|
|
699
699
|
if (!t) {
|
|
700
700
|
let t = {};
|
|
701
701
|
try {
|
|
@@ -713,7 +713,7 @@ function P(e, t = !1) {
|
|
|
713
713
|
}
|
|
714
714
|
//#endregion
|
|
715
715
|
//#region src/users/get.ts
|
|
716
|
-
function
|
|
716
|
+
function mt(e) {
|
|
717
717
|
return async (t, n) => {
|
|
718
718
|
let [r, i] = await Promise.all([e.selectFrom("users").leftJoin("user_activity", (e) => e.onRef("user_activity.tenant_id", "=", "users.tenant_id").onRef("user_activity.user_id", "=", "users.user_id")).where("users.tenant_id", "=", t).where("users.user_id", "=", n).selectAll("users").select([
|
|
719
719
|
"user_activity.last_login",
|
|
@@ -735,13 +735,13 @@ function pt(e) {
|
|
|
735
735
|
app_metadata: JSON.parse(r.app_metadata),
|
|
736
736
|
user_metadata: JSON.parse(r.user_metadata),
|
|
737
737
|
address: r.address ? JSON.parse(r.address) : void 0,
|
|
738
|
-
identities: [
|
|
738
|
+
identities: [N(r, !0), ...i.map((e) => N(e))]
|
|
739
739
|
});
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
742
|
//#endregion
|
|
743
743
|
//#region src/users/list.ts
|
|
744
|
-
var
|
|
744
|
+
var ht = [
|
|
745
745
|
"user_id",
|
|
746
746
|
"email",
|
|
747
747
|
"email_verified",
|
|
@@ -764,20 +764,20 @@ var mt = [
|
|
|
764
764
|
"login_count",
|
|
765
765
|
"created_at",
|
|
766
766
|
"updated_at"
|
|
767
|
-
],
|
|
767
|
+
], gt = new Set([
|
|
768
768
|
"last_login",
|
|
769
769
|
"last_ip",
|
|
770
770
|
"login_count"
|
|
771
|
-
]),
|
|
771
|
+
]), _t = Object.fromEntries(ht.map((e) => [e, e === "login_count" ? {
|
|
772
772
|
column: "user_activity.login_count",
|
|
773
773
|
defaultValue: 0
|
|
774
|
-
} :
|
|
774
|
+
} : gt.has(e) ? `user_activity.${e}` : `users.${e}`])), vt = [
|
|
775
775
|
"email",
|
|
776
776
|
"name",
|
|
777
777
|
"phone_number",
|
|
778
778
|
"user_id"
|
|
779
779
|
];
|
|
780
|
-
async function
|
|
780
|
+
async function yt(e, t, n) {
|
|
781
781
|
let r = n.map((e) => e.user_id), i = r.length ? await e.selectFrom("users").selectAll().where("users.tenant_id", "=", t).where("users.linked_to", "in", r).orderBy("created_at", "asc").execute() : [];
|
|
782
782
|
return n.map((e) => {
|
|
783
783
|
let t = i.filter((t) => t.linked_to === e.user_id);
|
|
@@ -791,16 +791,16 @@ async function vt(e, t, n) {
|
|
|
791
791
|
app_metadata: JSON.parse(e.app_metadata),
|
|
792
792
|
user_metadata: JSON.parse(e.user_metadata),
|
|
793
793
|
address: e.address ? JSON.parse(e.address) : void 0,
|
|
794
|
-
identities: [
|
|
794
|
+
identities: [N(e, !0), ...t.map((e) => N(e))]
|
|
795
795
|
});
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function bt(e) {
|
|
799
799
|
return async (t, n = {}) => {
|
|
800
800
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: s, q: c } = n, l = e.selectFrom("users").leftJoin("user_activity", (e) => e.onRef("user_activity.tenant_id", "=", "users.tenant_id").onRef("user_activity.user_id", "=", "users.user_id")).where("users.tenant_id", "=", t);
|
|
801
801
|
if (c) {
|
|
802
|
-
let t = S(c,
|
|
803
|
-
t && (l = k(e, l, t,
|
|
802
|
+
let t = S(c, ht);
|
|
803
|
+
t && (l = k(e, l, t, vt, [], _t));
|
|
804
804
|
}
|
|
805
805
|
if (D(n)) {
|
|
806
806
|
if (s?.sort_by && s.sort_by !== "created_at") throw new m(400, { message: `Sorting by ${s.sort_by} is not supported with checkpoint pagination (from/take); only created_at is` });
|
|
@@ -813,7 +813,7 @@ function yt(e) {
|
|
|
813
813
|
sortOrder: r,
|
|
814
814
|
idColumn: "users.user_id",
|
|
815
815
|
sortKey: `created_at:${r}`
|
|
816
|
-
}), c = await
|
|
816
|
+
}), c = await yt(e, t, i);
|
|
817
817
|
return {
|
|
818
818
|
users: c,
|
|
819
819
|
start: 0,
|
|
@@ -823,7 +823,7 @@ function yt(e) {
|
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
if (s && s.sort_by) {
|
|
826
|
-
let t =
|
|
826
|
+
let t = _t[s.sort_by];
|
|
827
827
|
if (t) {
|
|
828
828
|
let { ref: n } = e.dynamic;
|
|
829
829
|
l = l.orderBy(typeof t == "string" ? n(t) : Ke(t), s.sort_order);
|
|
@@ -833,7 +833,7 @@ function yt(e) {
|
|
|
833
833
|
"user_activity.last_login",
|
|
834
834
|
"user_activity.last_ip",
|
|
835
835
|
"user_activity.login_count"
|
|
836
|
-
]).execute(), a ? l.select((e) => e.fn.countAll().as("count")).executeTakeFirstOrThrow() : void 0]), p = await
|
|
836
|
+
]).execute(), a ? l.select((e) => e.fn.countAll().as("count")).executeTakeFirstOrThrow() : void 0]), p = await yt(e, t, d);
|
|
837
837
|
if (!f) return {
|
|
838
838
|
users: p,
|
|
839
839
|
start: 0,
|
|
@@ -851,12 +851,12 @@ function yt(e) {
|
|
|
851
851
|
}
|
|
852
852
|
//#endregion
|
|
853
853
|
//#region src/users/remove.ts
|
|
854
|
-
function
|
|
854
|
+
function xt(e) {
|
|
855
855
|
return async (t, n, r) => {
|
|
856
856
|
let i = async (e) => {
|
|
857
857
|
await e.deleteFrom("authentication_methods").where("authentication_methods.tenant_id", "=", t).where("authentication_methods.user_id", "in", (e) => e.selectFrom("users").select("users.user_id").where("users.tenant_id", "=", t).where((e) => e.or([e("users.user_id", "=", n), e("users.linked_to", "=", n)]))).execute(), await e.deleteFrom("users").where("users.tenant_id", "=", t).where("users.linked_to", "=", n).execute();
|
|
858
858
|
let i = await e.deleteFrom("users").where("users.tenant_id", "=", t).where("users.user_id", "=", n).execute();
|
|
859
|
-
for (let n of r?.outboxEvents ?? []) await
|
|
859
|
+
for (let n of r?.outboxEvents ?? []) await j(e, t, n.id, n);
|
|
860
860
|
return i.length === 1;
|
|
861
861
|
};
|
|
862
862
|
return r?.outboxEvents?.length && !e.isTransaction ? e.transaction().execute(i) : i(e);
|
|
@@ -864,14 +864,14 @@ function bt(e) {
|
|
|
864
864
|
}
|
|
865
865
|
//#endregion
|
|
866
866
|
//#region src/utils/flatten.ts
|
|
867
|
-
function
|
|
867
|
+
function P(e, t = "", n = {}) {
|
|
868
868
|
for (let r in e) if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
869
869
|
let i = t ? `${t}_${r}` : r, a = e[r];
|
|
870
|
-
typeof a == "object" && a && !Array.isArray(a) ?
|
|
870
|
+
typeof a == "object" && a && !Array.isArray(a) ? P(a, i, n) : typeof a == "boolean" ? n[i] = +!!a : n[i] = a;
|
|
871
871
|
}
|
|
872
872
|
return n;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function St(e, t) {
|
|
875
875
|
let n = {};
|
|
876
876
|
for (let [r, i] of Object.entries(e)) {
|
|
877
877
|
let e = t.find((e) => r.startsWith(`${e}_`));
|
|
@@ -888,7 +888,7 @@ function xt(e, t) {
|
|
|
888
888
|
}
|
|
889
889
|
//#endregion
|
|
890
890
|
//#region src/userActivity/index.ts
|
|
891
|
-
function
|
|
891
|
+
function Ct(e) {
|
|
892
892
|
return {
|
|
893
893
|
user_id: e.user_id,
|
|
894
894
|
last_login: e.last_login ?? void 0,
|
|
@@ -898,18 +898,18 @@ function St(e) {
|
|
|
898
898
|
last_password_reset: e.last_password_reset ?? void 0
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function wt(e) {
|
|
902
902
|
let t = {};
|
|
903
903
|
return e.last_login !== void 0 && (t.last_login = e.last_login), e.last_ip !== void 0 && (t.last_ip = e.last_ip), e.login_count !== void 0 && (t.login_count = e.login_count), e.failed_logins !== void 0 && (t.failed_logins = JSON.stringify(e.failed_logins)), e.last_password_reset !== void 0 && (t.last_password_reset = e.last_password_reset), t;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function Tt(e) {
|
|
906
906
|
return {
|
|
907
907
|
async get(t, n) {
|
|
908
908
|
let r = await e.selectFrom("user_activity").where("tenant_id", "=", t).where("user_id", "=", n).selectAll().executeTakeFirst();
|
|
909
|
-
return r ?
|
|
909
|
+
return r ? Ct(r) : null;
|
|
910
910
|
},
|
|
911
911
|
async upsert(t, n, r) {
|
|
912
|
-
let i =
|
|
912
|
+
let i = wt(r);
|
|
913
913
|
if (await e.selectFrom("user_activity").where("tenant_id", "=", t).where("user_id", "=", n).select("user_id").executeTakeFirst()) {
|
|
914
914
|
if (Object.keys(i).length === 0) return;
|
|
915
915
|
await e.updateTable("user_activity").set(i).where("tenant_id", "=", t).where("user_id", "=", n).execute();
|
|
@@ -931,9 +931,9 @@ function wt(e) {
|
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/users/update.ts
|
|
934
|
-
function
|
|
934
|
+
function Et(e) {
|
|
935
935
|
return async (t, n, r, i) => {
|
|
936
|
-
let { last_login: a, last_ip: o, login_count: s, ...c } = r, l =
|
|
936
|
+
let { last_login: a, last_ip: o, login_count: s, ...c } = r, l = P({
|
|
937
937
|
...c,
|
|
938
938
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
939
939
|
app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
|
|
@@ -944,12 +944,12 @@ function Tt(e) {
|
|
|
944
944
|
}), u = async (e) => {
|
|
945
945
|
let [r] = await e.updateTable("users").set(l).where("users.tenant_id", "=", t).where("users.user_id", "=", n).execute();
|
|
946
946
|
if (!r || r.numUpdatedRows === 0n) return !1;
|
|
947
|
-
(a !== void 0 || o !== void 0 || s !== void 0) && await
|
|
947
|
+
(a !== void 0 || o !== void 0 || s !== void 0) && await Tt(e).upsert(t, n, {
|
|
948
948
|
last_login: a,
|
|
949
949
|
last_ip: o,
|
|
950
950
|
login_count: s
|
|
951
951
|
});
|
|
952
|
-
for (let n of i?.outboxEvents ?? []) await
|
|
952
|
+
for (let n of i?.outboxEvents ?? []) await j(e, t, n.id, n);
|
|
953
953
|
return !0;
|
|
954
954
|
};
|
|
955
955
|
return e.isTransaction ? u(e) : e.transaction().execute(u);
|
|
@@ -957,27 +957,27 @@ function Tt(e) {
|
|
|
957
957
|
}
|
|
958
958
|
//#endregion
|
|
959
959
|
//#region src/users/unlink.ts
|
|
960
|
-
function
|
|
960
|
+
function Dt(e) {
|
|
961
961
|
return async (t, n, r, i) => (await e.updateTable("users").set({ linked_to: null }).where("users.tenant_id", "=", t).where("users.user_id", "=", `${r}|${i}`).where("users.linked_to", "=", `${n}`).execute()).length === 1;
|
|
962
962
|
}
|
|
963
963
|
//#endregion
|
|
964
964
|
//#region src/users/index.ts
|
|
965
|
-
function
|
|
966
|
-
let t =
|
|
965
|
+
function Ot(e) {
|
|
966
|
+
let t = ut(e);
|
|
967
967
|
return {
|
|
968
968
|
create: t,
|
|
969
969
|
rawCreate: t,
|
|
970
|
-
createMany:
|
|
971
|
-
remove:
|
|
972
|
-
get:
|
|
973
|
-
list:
|
|
974
|
-
update:
|
|
975
|
-
unlink:
|
|
970
|
+
createMany: ft(e),
|
|
971
|
+
remove: xt(e),
|
|
972
|
+
get: mt(e),
|
|
973
|
+
list: bt(e),
|
|
974
|
+
update: Et(e),
|
|
975
|
+
unlink: Dt(e)
|
|
976
976
|
};
|
|
977
977
|
}
|
|
978
978
|
//#endregion
|
|
979
979
|
//#region src/flows/create.ts
|
|
980
|
-
function
|
|
980
|
+
function kt(e) {
|
|
981
981
|
return async (n, r, i) => {
|
|
982
982
|
let a = i?.importMetadata, o = (/* @__PURE__ */ new Date()).toISOString(), s = b.parse({
|
|
983
983
|
id: a?.id ?? `af_${t()}`,
|
|
@@ -995,7 +995,7 @@ function Ot(e) {
|
|
|
995
995
|
}
|
|
996
996
|
//#endregion
|
|
997
997
|
//#region src/helpers/parse.ts
|
|
998
|
-
function
|
|
998
|
+
function F(e, t) {
|
|
999
999
|
if (!e) return t;
|
|
1000
1000
|
try {
|
|
1001
1001
|
return JSON.parse(e);
|
|
@@ -1003,7 +1003,7 @@ function I(e, t) {
|
|
|
1003
1003
|
return t;
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function At(e) {
|
|
1007
1007
|
if (e) try {
|
|
1008
1008
|
let t = JSON.parse(e);
|
|
1009
1009
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
@@ -1011,33 +1011,33 @@ function kt(e) {
|
|
|
1011
1011
|
return;
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
for (let r in t) r in e && (n[r] =
|
|
1014
|
+
function jt(e, t, n = { ...e }) {
|
|
1015
|
+
for (let r in t) r in e && (n[r] = F(e[r], t[r]));
|
|
1016
1016
|
return n;
|
|
1017
1017
|
}
|
|
1018
1018
|
//#endregion
|
|
1019
1019
|
//#region src/flows/get.ts
|
|
1020
|
-
function
|
|
1020
|
+
function Mt(e) {
|
|
1021
1021
|
return async (t, n) => {
|
|
1022
1022
|
let r = await e.selectFrom("flows").selectAll().where("flows.id", "=", n).where("tenant_id", "=", t).executeTakeFirst();
|
|
1023
1023
|
if (!r) return null;
|
|
1024
1024
|
let i = {
|
|
1025
1025
|
...r,
|
|
1026
|
-
actions:
|
|
1026
|
+
actions: F(r.actions, [])
|
|
1027
1027
|
};
|
|
1028
1028
|
return b.parse(l(i));
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
1031
|
//#endregion
|
|
1032
1032
|
//#region src/flows/list.ts
|
|
1033
|
-
function
|
|
1033
|
+
function Nt(e) {
|
|
1034
1034
|
let t = {
|
|
1035
1035
|
...e,
|
|
1036
|
-
actions:
|
|
1036
|
+
actions: F(e.actions, [])
|
|
1037
1037
|
};
|
|
1038
1038
|
return b.parse(l(t));
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function Pt(e) {
|
|
1041
1041
|
return async (t, n = {}) => {
|
|
1042
1042
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, q: s } = n, c = e.selectFrom("flows").where("tenant_id", "=", t);
|
|
1043
1043
|
if (s && (c = k(e, c, s, [])), D(n)) {
|
|
@@ -1045,7 +1045,7 @@ function Nt(e) {
|
|
|
1045
1045
|
sortColumn: "created_at",
|
|
1046
1046
|
sortOrder: "desc",
|
|
1047
1047
|
idColumn: "id"
|
|
1048
|
-
}), i = e.map(
|
|
1048
|
+
}), i = e.map(Nt);
|
|
1049
1049
|
return {
|
|
1050
1050
|
flows: i,
|
|
1051
1051
|
start: 0,
|
|
@@ -1054,7 +1054,7 @@ function Nt(e) {
|
|
|
1054
1054
|
next: r
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
|
-
let l = (await c.offset(r * i).limit(i).selectAll().execute()).map(
|
|
1057
|
+
let l = (await c.offset(r * i).limit(i).selectAll().execute()).map(Nt);
|
|
1058
1058
|
if (!a) return {
|
|
1059
1059
|
flows: l,
|
|
1060
1060
|
start: 0,
|
|
@@ -1072,7 +1072,7 @@ function Nt(e) {
|
|
|
1072
1072
|
}
|
|
1073
1073
|
//#endregion
|
|
1074
1074
|
//#region src/flows/update.ts
|
|
1075
|
-
function
|
|
1075
|
+
function Ft(e) {
|
|
1076
1076
|
return async (t, n, r) => {
|
|
1077
1077
|
let i = {
|
|
1078
1078
|
...r,
|
|
@@ -1090,27 +1090,27 @@ function Pt(e) {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
//#endregion
|
|
1092
1092
|
//#region src/flows/remove.ts
|
|
1093
|
-
function
|
|
1093
|
+
function It(e) {
|
|
1094
1094
|
return async (t, n) => ((await e.deleteFrom("flows").where("id", "=", n).where("tenant_id", "=", t).execute())[0]?.numDeletedRows ?? 0n) > 0n;
|
|
1095
1095
|
}
|
|
1096
1096
|
//#endregion
|
|
1097
1097
|
//#region src/flows/index.ts
|
|
1098
|
-
function
|
|
1098
|
+
function Lt(e) {
|
|
1099
1099
|
return {
|
|
1100
|
-
create:
|
|
1101
|
-
get:
|
|
1102
|
-
list:
|
|
1103
|
-
update:
|
|
1104
|
-
remove:
|
|
1100
|
+
create: kt(e),
|
|
1101
|
+
get: Mt(e),
|
|
1102
|
+
list: Pt(e),
|
|
1103
|
+
update: Ft(e),
|
|
1104
|
+
remove: It(e)
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
1107
|
//#endregion
|
|
1108
1108
|
//#region src/tenants/utils.ts
|
|
1109
|
-
function
|
|
1109
|
+
function Rt(e) {
|
|
1110
1110
|
let t = { ...e };
|
|
1111
1111
|
return e.session_cookie && typeof e.session_cookie == "string" && (t.session_cookie = JSON.parse(e.session_cookie)), e.enabled_locales && typeof e.enabled_locales == "string" && (t.enabled_locales = JSON.parse(e.enabled_locales)), e.error_page && typeof e.error_page == "string" && (t.error_page = JSON.parse(e.error_page)), e.flags && typeof e.flags == "string" && (t.flags = JSON.parse(e.flags)), e.sandbox_versions_available && typeof e.sandbox_versions_available == "string" && (t.sandbox_versions_available = JSON.parse(e.sandbox_versions_available)), e.change_password && typeof e.change_password == "string" && (t.change_password = JSON.parse(e.change_password)), e.guardian_mfa_page && typeof e.guardian_mfa_page == "string" && (t.guardian_mfa_page = JSON.parse(e.guardian_mfa_page)), e.sessions && typeof e.sessions == "string" && (t.sessions = JSON.parse(e.sessions)), e.oidc_logout && typeof e.oidc_logout == "string" && (t.oidc_logout = JSON.parse(e.oidc_logout)), e.device_flow && typeof e.device_flow == "string" && (t.device_flow = JSON.parse(e.device_flow)), e.default_token_quota && typeof e.default_token_quota == "string" && (t.default_token_quota = JSON.parse(e.default_token_quota)), e.allowed_logout_urls && typeof e.allowed_logout_urls == "string" && (t.allowed_logout_urls = JSON.parse(e.allowed_logout_urls)), e.acr_values_supported && typeof e.acr_values_supported == "string" && (t.acr_values_supported = JSON.parse(e.acr_values_supported)), e.mtls && typeof e.mtls == "string" && (t.mtls = JSON.parse(e.mtls)), e.mfa && typeof e.mfa == "string" && (t.mfa = JSON.parse(e.mfa)), e.attack_protection && typeof e.attack_protection == "string" && (t.attack_protection = JSON.parse(e.attack_protection)), e.allow_organization_name_in_authentication_api !== void 0 && (t.allow_organization_name_in_authentication_api = e.allow_organization_name_in_authentication_api === 1), e.customize_mfa_in_postlogin_action !== void 0 && (t.customize_mfa_in_postlogin_action = e.customize_mfa_in_postlogin_action === 1), e.pushed_authorization_requests_supported !== void 0 && (t.pushed_authorization_requests_supported = e.pushed_authorization_requests_supported === 1), e.authorization_response_iss_parameter_supported !== void 0 && (t.authorization_response_iss_parameter_supported = e.authorization_response_iss_parameter_supported === 1), l(t);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function zt(e) {
|
|
1114
1114
|
let t = { ...e };
|
|
1115
1115
|
return d(e, [
|
|
1116
1116
|
"session_cookie",
|
|
@@ -1133,14 +1133,14 @@ function Rt(e) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
//#endregion
|
|
1135
1135
|
//#region src/tenants/create.ts
|
|
1136
|
-
function
|
|
1136
|
+
function Bt(e) {
|
|
1137
1137
|
return async (n, r) => {
|
|
1138
1138
|
let i = r?.importMetadata, a = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
1139
1139
|
...n,
|
|
1140
1140
|
id: i?.id ?? n.id ?? t(),
|
|
1141
1141
|
created_at: i?.created_at ?? a,
|
|
1142
1142
|
updated_at: i?.updated_at ?? a
|
|
1143
|
-
}, s =
|
|
1143
|
+
}, s = zt(o);
|
|
1144
1144
|
try {
|
|
1145
1145
|
await e.insertInto("tenants").values(s).execute();
|
|
1146
1146
|
} catch (e) {
|
|
@@ -1152,15 +1152,15 @@ function zt(e) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
//#endregion
|
|
1154
1154
|
//#region src/tenants/get.ts
|
|
1155
|
-
function
|
|
1155
|
+
function Vt(e) {
|
|
1156
1156
|
return async (t) => {
|
|
1157
1157
|
let n = await e.selectFrom("tenants").where("tenants.id", "=", t).selectAll().executeTakeFirst();
|
|
1158
|
-
return n ?
|
|
1158
|
+
return n ? Rt(n) : null;
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
1161
|
//#endregion
|
|
1162
1162
|
//#region src/tenants/list.ts
|
|
1163
|
-
function
|
|
1163
|
+
function Ht(e) {
|
|
1164
1164
|
return async (t) => {
|
|
1165
1165
|
let n = e.selectFrom("tenants"), { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: s, q: c } = t || {};
|
|
1166
1166
|
if (s && s.sort_by) {
|
|
@@ -1168,7 +1168,7 @@ function Vt(e) {
|
|
|
1168
1168
|
n = n.orderBy(t(s.sort_by), s.sort_order);
|
|
1169
1169
|
}
|
|
1170
1170
|
c && (n = k(e, n, c, ["id", "friendly_name"]));
|
|
1171
|
-
let l = (await n.offset(r * i).limit(i).selectAll().execute()).map(
|
|
1171
|
+
let l = (await n.offset(r * i).limit(i).selectAll().execute()).map(Rt);
|
|
1172
1172
|
if (!a) return { tenants: l };
|
|
1173
1173
|
let { count: u } = await n.select((e) => e.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = o(u);
|
|
1174
1174
|
return {
|
|
@@ -1183,10 +1183,10 @@ function Vt(e) {
|
|
|
1183
1183
|
}
|
|
1184
1184
|
//#endregion
|
|
1185
1185
|
//#region src/tenants/update.ts
|
|
1186
|
-
function
|
|
1186
|
+
function Ut(e) {
|
|
1187
1187
|
return async (t, n) => {
|
|
1188
1188
|
let r = {
|
|
1189
|
-
...
|
|
1189
|
+
...zt(n),
|
|
1190
1190
|
id: t,
|
|
1191
1191
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1192
1192
|
};
|
|
@@ -1195,29 +1195,29 @@ function Ht(e) {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
//#endregion
|
|
1197
1197
|
//#region src/tenants/remove.ts
|
|
1198
|
-
function
|
|
1198
|
+
function Wt(e) {
|
|
1199
1199
|
return async (t) => (await e.deleteFrom("tenants").where("tenants.id", "=", t).execute()).length === 1;
|
|
1200
1200
|
}
|
|
1201
1201
|
//#endregion
|
|
1202
1202
|
//#region src/tenants/index.ts
|
|
1203
|
-
function
|
|
1203
|
+
function Gt(e) {
|
|
1204
1204
|
return {
|
|
1205
|
-
create:
|
|
1206
|
-
get:
|
|
1207
|
-
list:
|
|
1208
|
-
update:
|
|
1209
|
-
remove:
|
|
1205
|
+
create: Bt(e),
|
|
1206
|
+
get: Vt(e),
|
|
1207
|
+
list: Ht(e),
|
|
1208
|
+
update: Ut(e),
|
|
1209
|
+
remove: Wt(e)
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
1212
1212
|
//#endregion
|
|
1213
1213
|
//#region src/logs/create.ts
|
|
1214
|
-
function
|
|
1214
|
+
function Kt(e) {
|
|
1215
1215
|
return e ? JSON.stringify(e) : void 0;
|
|
1216
1216
|
}
|
|
1217
|
-
var
|
|
1218
|
-
function
|
|
1217
|
+
var qt = 256;
|
|
1218
|
+
function Jt(e) {
|
|
1219
1219
|
return async (n, r) => {
|
|
1220
|
-
let i = r.user_agent?.slice(0,
|
|
1220
|
+
let i = r.user_agent?.slice(0, qt), a = r.log_id || t(), { location_info: o, ...s } = r;
|
|
1221
1221
|
return await e.insertInto("logs").values({
|
|
1222
1222
|
...s,
|
|
1223
1223
|
log_id: a,
|
|
@@ -1226,8 +1226,8 @@ function qt(e) {
|
|
|
1226
1226
|
description: r.description?.substring(0, 256),
|
|
1227
1227
|
isMobile: +!!r.isMobile,
|
|
1228
1228
|
scope: r.scope,
|
|
1229
|
-
auth0_client:
|
|
1230
|
-
details:
|
|
1229
|
+
auth0_client: Kt(r.auth0_client),
|
|
1230
|
+
details: Kt(r.details)?.substring(0, 8192),
|
|
1231
1231
|
country_code: o?.country_code,
|
|
1232
1232
|
city_name: o?.city_name,
|
|
1233
1233
|
latitude: o?.latitude,
|
|
@@ -1243,7 +1243,7 @@ function qt(e) {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
//#endregion
|
|
1245
1245
|
//#region src/logs/logs.ts
|
|
1246
|
-
function
|
|
1246
|
+
function Yt(e) {
|
|
1247
1247
|
if (!e) return "";
|
|
1248
1248
|
try {
|
|
1249
1249
|
return JSON.parse(e);
|
|
@@ -1251,13 +1251,13 @@ function Jt(e) {
|
|
|
1251
1251
|
return e;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Xt(e) {
|
|
1255
1255
|
return {
|
|
1256
1256
|
...e,
|
|
1257
1257
|
client_id: e.client_id,
|
|
1258
1258
|
client_name: e.client_name || "",
|
|
1259
|
-
auth0_client:
|
|
1260
|
-
details:
|
|
1259
|
+
auth0_client: Yt(e.auth0_client),
|
|
1260
|
+
details: Yt(e.details),
|
|
1261
1261
|
isMobile: !!e.isMobile,
|
|
1262
1262
|
scope: e.scope || void 0,
|
|
1263
1263
|
log_id: e.log_id,
|
|
@@ -1273,7 +1273,7 @@ function Yt(e) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
//#endregion
|
|
1275
1275
|
//#region src/logs/list.ts
|
|
1276
|
-
var
|
|
1276
|
+
var Zt = [
|
|
1277
1277
|
"user_id",
|
|
1278
1278
|
"ip",
|
|
1279
1279
|
"type",
|
|
@@ -1299,11 +1299,11 @@ var Xt = [
|
|
|
1299
1299
|
"time_zone",
|
|
1300
1300
|
"continent_code"
|
|
1301
1301
|
];
|
|
1302
|
-
function
|
|
1302
|
+
function Qt(e) {
|
|
1303
1303
|
return async (t, n = {}) => {
|
|
1304
1304
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: s, q: c, from_date: l, to_date: u } = n, d = e.selectFrom("logs").where("logs.tenant_id", "=", t);
|
|
1305
1305
|
if (c) {
|
|
1306
|
-
let t = S(c,
|
|
1306
|
+
let t = S(c, Zt);
|
|
1307
1307
|
t && (d = k(e, d, t, [
|
|
1308
1308
|
"user_id",
|
|
1309
1309
|
"ip",
|
|
@@ -1317,7 +1317,7 @@ function Zt(e) {
|
|
|
1317
1317
|
sortOrder: e,
|
|
1318
1318
|
idColumn: "log_id",
|
|
1319
1319
|
sortKey: `date:${e}`
|
|
1320
|
-
}), a = t.map(
|
|
1320
|
+
}), a = t.map(Xt);
|
|
1321
1321
|
return {
|
|
1322
1322
|
logs: a,
|
|
1323
1323
|
start: 0,
|
|
@@ -1332,7 +1332,7 @@ function Zt(e) {
|
|
|
1332
1332
|
f = f.orderBy(t(s.sort_by), s.sort_order);
|
|
1333
1333
|
}
|
|
1334
1334
|
f = f.offset(r * i).limit(i);
|
|
1335
|
-
let p = (await f.selectAll().execute()).map(
|
|
1335
|
+
let p = (await f.selectAll().execute()).map(Xt);
|
|
1336
1336
|
if (!a) return {
|
|
1337
1337
|
logs: p,
|
|
1338
1338
|
start: 0,
|
|
@@ -1350,24 +1350,24 @@ function Zt(e) {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
//#endregion
|
|
1352
1352
|
//#region src/logs/get.ts
|
|
1353
|
-
function
|
|
1353
|
+
function $t(e) {
|
|
1354
1354
|
return async (t, n) => {
|
|
1355
1355
|
let r = await e.selectFrom("logs").where("logs.tenant_id", "=", t).where("logs.log_id", "=", n).selectAll().executeTakeFirst();
|
|
1356
|
-
return r ?
|
|
1356
|
+
return r ? Xt(r) : null;
|
|
1357
1357
|
};
|
|
1358
1358
|
}
|
|
1359
1359
|
//#endregion
|
|
1360
1360
|
//#region src/logs/index.ts
|
|
1361
|
-
function
|
|
1361
|
+
function en(e) {
|
|
1362
1362
|
return {
|
|
1363
|
-
create:
|
|
1364
|
-
list:
|
|
1365
|
-
get:
|
|
1363
|
+
create: Jt(e),
|
|
1364
|
+
list: Qt(e),
|
|
1365
|
+
get: $t(e)
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
1368
|
//#endregion
|
|
1369
1369
|
//#region src/sessions/get.ts
|
|
1370
|
-
function
|
|
1370
|
+
function tn(e) {
|
|
1371
1371
|
return async (t, n) => {
|
|
1372
1372
|
let i = await e.selectFrom("sessions").where("sessions.tenant_id", "=", t).where("sessions.id", "=", n).selectAll().executeTakeFirst();
|
|
1373
1373
|
if (!i) return null;
|
|
@@ -1401,7 +1401,7 @@ function en(e) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
//#endregion
|
|
1403
1403
|
//#region src/sessions/create.ts
|
|
1404
|
-
function
|
|
1404
|
+
function nn(e) {
|
|
1405
1405
|
return async (t, n) => {
|
|
1406
1406
|
let r = Date.now(), i = c(), a = {
|
|
1407
1407
|
...n,
|
|
@@ -1433,12 +1433,12 @@ function tn(e) {
|
|
|
1433
1433
|
}
|
|
1434
1434
|
//#endregion
|
|
1435
1435
|
//#region src/sessions/remove.ts
|
|
1436
|
-
function
|
|
1436
|
+
function rn(e) {
|
|
1437
1437
|
return async (t, n) => ((await e.deleteFrom("sessions").where("tenant_id", "=", t).where("sessions.id", "=", n).executeTakeFirst()).numDeletedRows ?? 0n) > 0n;
|
|
1438
1438
|
}
|
|
1439
1439
|
//#endregion
|
|
1440
1440
|
//#region src/sessions/update.ts
|
|
1441
|
-
function
|
|
1441
|
+
function an(e) {
|
|
1442
1442
|
return async (t, n, r) => {
|
|
1443
1443
|
let i = Date.now(), a = {
|
|
1444
1444
|
updated_at_ts: i,
|
|
@@ -1459,7 +1459,7 @@ function rn(e) {
|
|
|
1459
1459
|
}
|
|
1460
1460
|
//#endregion
|
|
1461
1461
|
//#region src/sessions/list.ts
|
|
1462
|
-
function
|
|
1462
|
+
function on(e) {
|
|
1463
1463
|
let { tenant_id: t, device: n, clients: i, created_at_ts: a, updated_at_ts: o, expires_at_ts: s, idle_expires_at_ts: c, authenticated_at_ts: l, last_interaction_at_ts: u, used_at_ts: d, revoked_at_ts: f, ...p } = e, m = r({
|
|
1464
1464
|
created_at_ts: a,
|
|
1465
1465
|
updated_at_ts: o,
|
|
@@ -1487,14 +1487,14 @@ function an(e) {
|
|
|
1487
1487
|
clients: JSON.parse(i)
|
|
1488
1488
|
};
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function sn(e) {
|
|
1491
1491
|
return async (t, n = {}) => {
|
|
1492
1492
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: s, q: c } = n, l = e.selectFrom("sessions").where("sessions.tenant_id", "=", t);
|
|
1493
1493
|
if (c && (l = k(e, l, c, ["user_id", "session_id"])), D(n)) {
|
|
1494
1494
|
let { rows: e, limit: t, next: r } = await O(l.selectAll(), n, {
|
|
1495
1495
|
sortColumn: "created_at_ts",
|
|
1496
1496
|
sortOrder: "desc"
|
|
1497
|
-
}), i = e.map(
|
|
1497
|
+
}), i = e.map(on);
|
|
1498
1498
|
return {
|
|
1499
1499
|
sessions: i,
|
|
1500
1500
|
start: 0,
|
|
@@ -1509,7 +1509,7 @@ function on(e) {
|
|
|
1509
1509
|
u = u.orderBy(t(s.sort_by), s.sort_order);
|
|
1510
1510
|
}
|
|
1511
1511
|
u = u.offset(r * i).limit(i);
|
|
1512
|
-
let d = (await u.selectAll().execute()).map(
|
|
1512
|
+
let d = (await u.selectAll().execute()).map(on);
|
|
1513
1513
|
if (!a) return {
|
|
1514
1514
|
sessions: d,
|
|
1515
1515
|
start: 0,
|
|
@@ -1527,18 +1527,18 @@ function on(e) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
//#endregion
|
|
1529
1529
|
//#region src/sessions/index.ts
|
|
1530
|
-
function
|
|
1530
|
+
function cn(e) {
|
|
1531
1531
|
return {
|
|
1532
|
-
create:
|
|
1533
|
-
get:
|
|
1534
|
-
list:
|
|
1535
|
-
remove:
|
|
1536
|
-
update:
|
|
1532
|
+
create: nn(e),
|
|
1533
|
+
get: tn(e),
|
|
1534
|
+
list: sn(e),
|
|
1535
|
+
remove: rn(e),
|
|
1536
|
+
update: an(e)
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
1539
|
//#endregion
|
|
1540
1540
|
//#region src/passwords/get.ts
|
|
1541
|
-
function
|
|
1541
|
+
function ln(e) {
|
|
1542
1542
|
return async (t, n) => {
|
|
1543
1543
|
let r = await e.selectFrom("passwords").where("passwords.tenant_id", "=", t).where("passwords.user_id", "=", n).where("passwords.is_current", "=", 1).selectAll().executeTakeFirst();
|
|
1544
1544
|
if (!r) return null;
|
|
@@ -1551,7 +1551,7 @@ function cn(e) {
|
|
|
1551
1551
|
}
|
|
1552
1552
|
//#endregion
|
|
1553
1553
|
//#region src/passwords/create.ts
|
|
1554
|
-
function
|
|
1554
|
+
function un(e) {
|
|
1555
1555
|
return async (n, r, i) => {
|
|
1556
1556
|
let a = i?.importMetadata, o = a?.id || r.id || t(), s = r.is_current ?? !0, c = (/* @__PURE__ */ new Date()).toISOString(), l = {
|
|
1557
1557
|
...r,
|
|
@@ -1569,7 +1569,7 @@ function ln(e) {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
//#endregion
|
|
1571
1571
|
//#region src/passwords/update.ts
|
|
1572
|
-
function
|
|
1572
|
+
function dn(e) {
|
|
1573
1573
|
return async (t, n) => {
|
|
1574
1574
|
let r = e.updateTable("passwords").set({
|
|
1575
1575
|
password: n.password,
|
|
@@ -1582,7 +1582,7 @@ function un(e) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
//#endregion
|
|
1584
1584
|
//#region src/passwords/list.ts
|
|
1585
|
-
function
|
|
1585
|
+
function fn(e) {
|
|
1586
1586
|
return async (t, n, r) => {
|
|
1587
1587
|
let i = e.selectFrom("passwords").where("passwords.tenant_id", "=", t).where("passwords.user_id", "=", n).orderBy("created_at", "desc");
|
|
1588
1588
|
return r && (i = i.limit(r)), (await i.selectAll().execute()).map(({ tenant_id: e, ...t }) => ({
|
|
@@ -1593,17 +1593,17 @@ function dn(e) {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
//#endregion
|
|
1595
1595
|
//#region src/passwords/index.ts
|
|
1596
|
-
function
|
|
1596
|
+
function pn(e) {
|
|
1597
1597
|
return {
|
|
1598
|
-
create:
|
|
1599
|
-
update:
|
|
1600
|
-
get:
|
|
1601
|
-
list:
|
|
1598
|
+
create: un(e),
|
|
1599
|
+
update: dn(e),
|
|
1600
|
+
get: ln(e),
|
|
1601
|
+
list: fn(e)
|
|
1602
1602
|
};
|
|
1603
1603
|
}
|
|
1604
1604
|
//#endregion
|
|
1605
1605
|
//#region src/codes/list.ts
|
|
1606
|
-
function
|
|
1606
|
+
function mn(e) {
|
|
1607
1607
|
return async (t, n = {}) => {
|
|
1608
1608
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, q: s } = n, c = e.selectFrom("codes").where("codes.tenant_id", "=", t);
|
|
1609
1609
|
s && (c = k(e, c, s, ["code", "login_id"]));
|
|
@@ -1628,13 +1628,13 @@ function pn(e) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
//#endregion
|
|
1630
1630
|
//#region src/codes/expires-at-ts.ts
|
|
1631
|
-
function
|
|
1631
|
+
function hn(e) {
|
|
1632
1632
|
let t = new Date(e).getTime();
|
|
1633
1633
|
return Number.isNaN(t) ? 0 : t;
|
|
1634
1634
|
}
|
|
1635
1635
|
//#endregion
|
|
1636
1636
|
//#region src/codes/create.ts
|
|
1637
|
-
function
|
|
1637
|
+
function gn(e) {
|
|
1638
1638
|
return async (t, n) => {
|
|
1639
1639
|
let r = {
|
|
1640
1640
|
...n,
|
|
@@ -1643,18 +1643,18 @@ function hn(e) {
|
|
|
1643
1643
|
return await e.insertInto("codes").values({
|
|
1644
1644
|
...r,
|
|
1645
1645
|
tenant_id: t,
|
|
1646
|
-
expires_at_ts:
|
|
1646
|
+
expires_at_ts: hn(r.expires_at)
|
|
1647
1647
|
}).execute(), r;
|
|
1648
1648
|
};
|
|
1649
1649
|
}
|
|
1650
1650
|
//#endregion
|
|
1651
1651
|
//#region src/codes/remove.ts
|
|
1652
|
-
function
|
|
1652
|
+
function _n(e) {
|
|
1653
1653
|
return async (t, n) => (await e.deleteFrom("codes").where("codes.tenant_id", "=", t).where("codes.code_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
|
|
1654
1654
|
}
|
|
1655
1655
|
//#endregion
|
|
1656
1656
|
//#region src/codes/get.ts
|
|
1657
|
-
function
|
|
1657
|
+
function vn(e) {
|
|
1658
1658
|
return async (t, n, r) => {
|
|
1659
1659
|
let i = e.selectFrom("codes").where("codes.code_id", "=", n).where("codes.code_type", "=", r);
|
|
1660
1660
|
t.length && (i = i.where("codes.tenant_id", "=", t));
|
|
@@ -1664,34 +1664,34 @@ function _n(e) {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
//#endregion
|
|
1666
1666
|
//#region src/codes/used.ts
|
|
1667
|
-
function
|
|
1667
|
+
function yn(e) {
|
|
1668
1668
|
return async (t, n) => (await e.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", t).where("codes.code_id", "=", n).executeTakeFirst()).numUpdatedRows > 0;
|
|
1669
1669
|
}
|
|
1670
1670
|
//#endregion
|
|
1671
1671
|
//#region src/codes/consume.ts
|
|
1672
|
-
function
|
|
1672
|
+
function bn(e) {
|
|
1673
1673
|
return async (t, n) => (await e.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", t).where("codes.code_id", "=", n).where("codes.used_at", "is", null).executeTakeFirst()).numUpdatedRows > 0;
|
|
1674
1674
|
}
|
|
1675
1675
|
//#endregion
|
|
1676
1676
|
//#region src/codes/cleanup.ts
|
|
1677
|
-
var
|
|
1678
|
-
async function
|
|
1677
|
+
var xn = 5e4;
|
|
1678
|
+
async function Sn(e, t) {
|
|
1679
1679
|
if (!t) return e();
|
|
1680
|
-
let n = 0, r =
|
|
1681
|
-
for (; r >=
|
|
1680
|
+
let n = 0, r = xn;
|
|
1681
|
+
for (; r >= xn;) r = await e(xn), n += r;
|
|
1682
1682
|
return n;
|
|
1683
1683
|
}
|
|
1684
|
-
function
|
|
1684
|
+
function Cn(e) {
|
|
1685
1685
|
let t;
|
|
1686
1686
|
return async (n) => {
|
|
1687
|
-
t ??= await
|
|
1687
|
+
t ??= await rt(e);
|
|
1688
1688
|
let r = t === "mysql";
|
|
1689
|
-
return await
|
|
1690
|
-
let r = e.deleteFrom("codes").where("expires_at_ts", "<",
|
|
1689
|
+
return await Sn(async (t) => {
|
|
1690
|
+
let r = e.deleteFrom("codes").where("expires_at_ts", "<", hn(n));
|
|
1691
1691
|
t !== void 0 && (r = r.limit(t));
|
|
1692
1692
|
let i = await r.executeTakeFirst();
|
|
1693
1693
|
return Number(i.numDeletedRows);
|
|
1694
|
-
}, r) + await
|
|
1694
|
+
}, r) + await Sn(async (t) => {
|
|
1695
1695
|
let r = e.deleteFrom("codes").where("expires_at_ts", "is", null).where("expires_at", "<", n);
|
|
1696
1696
|
t !== void 0 && (r = r.limit(t));
|
|
1697
1697
|
let i = await r.executeTakeFirst();
|
|
@@ -1701,20 +1701,20 @@ function Sn(e) {
|
|
|
1701
1701
|
}
|
|
1702
1702
|
//#endregion
|
|
1703
1703
|
//#region src/codes/index.ts
|
|
1704
|
-
function
|
|
1704
|
+
function wn(e) {
|
|
1705
1705
|
return {
|
|
1706
|
-
create:
|
|
1707
|
-
list:
|
|
1708
|
-
remove:
|
|
1709
|
-
used:
|
|
1710
|
-
consume:
|
|
1711
|
-
get:
|
|
1712
|
-
cleanup:
|
|
1706
|
+
create: gn(e),
|
|
1707
|
+
list: mn(e),
|
|
1708
|
+
remove: _n(e),
|
|
1709
|
+
used: yn(e),
|
|
1710
|
+
consume: bn(e),
|
|
1711
|
+
get: vn(e),
|
|
1712
|
+
cleanup: Cn(e)
|
|
1713
1713
|
};
|
|
1714
1714
|
}
|
|
1715
1715
|
//#endregion
|
|
1716
1716
|
//#region src/connections/create.ts
|
|
1717
|
-
function
|
|
1717
|
+
function Tn(e) {
|
|
1718
1718
|
return async (t, n, r) => {
|
|
1719
1719
|
let i = r?.importMetadata, { is_system: a, enforce: o, ...s } = n;
|
|
1720
1720
|
delete s.enabled_clients;
|
|
@@ -1737,7 +1737,7 @@ function wn(e) {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
//#endregion
|
|
1739
1739
|
//#region src/connections/transform.ts
|
|
1740
|
-
function
|
|
1740
|
+
function En(e) {
|
|
1741
1741
|
let { is_system: t, enforce: n, ...r } = e;
|
|
1742
1742
|
return l({
|
|
1743
1743
|
...r,
|
|
@@ -1746,12 +1746,12 @@ function Tn(e) {
|
|
|
1746
1746
|
options: typeof e.options == "string" ? JSON.parse(e.options) : {}
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
1749
|
-
function
|
|
1750
|
-
return e.map(
|
|
1749
|
+
function Dn(e) {
|
|
1750
|
+
return e.map(En);
|
|
1751
1751
|
}
|
|
1752
1752
|
//#endregion
|
|
1753
1753
|
//#region src/connections/list.ts
|
|
1754
|
-
function
|
|
1754
|
+
function On(e) {
|
|
1755
1755
|
return async (t, n = {}) => {
|
|
1756
1756
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, q: s } = n, c = e.selectFrom("connections").where("connections.tenant_id", "=", t);
|
|
1757
1757
|
if (s && (c = k(e, c, s, ["user_id", "ip"])), D(n)) {
|
|
@@ -1759,7 +1759,7 @@ function Dn(e) {
|
|
|
1759
1759
|
sortColumn: "created_at",
|
|
1760
1760
|
sortOrder: "desc",
|
|
1761
1761
|
idColumn: "id"
|
|
1762
|
-
}), i =
|
|
1762
|
+
}), i = Dn(e);
|
|
1763
1763
|
return {
|
|
1764
1764
|
connections: i,
|
|
1765
1765
|
start: 0,
|
|
@@ -1768,7 +1768,7 @@ function Dn(e) {
|
|
|
1768
1768
|
next: r
|
|
1769
1769
|
};
|
|
1770
1770
|
}
|
|
1771
|
-
let l =
|
|
1771
|
+
let l = Dn(await c.offset(r * i).limit(i).selectAll().execute());
|
|
1772
1772
|
if (!a) return {
|
|
1773
1773
|
connections: l,
|
|
1774
1774
|
start: 0,
|
|
@@ -1786,20 +1786,20 @@ function Dn(e) {
|
|
|
1786
1786
|
}
|
|
1787
1787
|
//#endregion
|
|
1788
1788
|
//#region src/connections/remove.ts
|
|
1789
|
-
function
|
|
1789
|
+
function kn(e) {
|
|
1790
1790
|
return async (t, n) => (await e.deleteFrom("connections").where("connections.tenant_id", "=", t).where("connections.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
|
|
1791
1791
|
}
|
|
1792
1792
|
//#endregion
|
|
1793
1793
|
//#region src/connections/get.ts
|
|
1794
|
-
function
|
|
1794
|
+
function An(e) {
|
|
1795
1795
|
return async (t, n) => {
|
|
1796
1796
|
let r = await e.selectFrom("connections").where("connections.tenant_id", "=", t).where("connections.id", "=", n).selectAll().executeTakeFirst();
|
|
1797
|
-
return r ?
|
|
1797
|
+
return r ? En(r) : null;
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
1800
1800
|
//#endregion
|
|
1801
1801
|
//#region src/connections/update.ts
|
|
1802
|
-
function
|
|
1802
|
+
function jn(e) {
|
|
1803
1803
|
return async (t, n, r) => {
|
|
1804
1804
|
let { is_system: i, enforce: a, ...o } = r;
|
|
1805
1805
|
delete o.enabled_clients;
|
|
@@ -1817,18 +1817,18 @@ function An(e) {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
//#endregion
|
|
1819
1819
|
//#region src/connections/index.ts
|
|
1820
|
-
function
|
|
1820
|
+
function Mn(e) {
|
|
1821
1821
|
return {
|
|
1822
|
-
create:
|
|
1823
|
-
get:
|
|
1824
|
-
list:
|
|
1825
|
-
remove:
|
|
1826
|
-
update:
|
|
1822
|
+
create: Tn(e),
|
|
1823
|
+
get: An(e),
|
|
1824
|
+
list: On(e),
|
|
1825
|
+
remove: kn(e),
|
|
1826
|
+
update: jn(e)
|
|
1827
1827
|
};
|
|
1828
1828
|
}
|
|
1829
1829
|
//#endregion
|
|
1830
1830
|
//#region src/clients/create.ts
|
|
1831
|
-
function
|
|
1831
|
+
function Nn(e) {
|
|
1832
1832
|
return async (r, i, a) => {
|
|
1833
1833
|
let o = a?.importMetadata, s = o?.id ?? i.client_id ?? t(), c = (/* @__PURE__ */ new Date()).toISOString(), l = {
|
|
1834
1834
|
...i,
|
|
@@ -1894,7 +1894,7 @@ function Mn(e) {
|
|
|
1894
1894
|
}
|
|
1895
1895
|
//#endregion
|
|
1896
1896
|
//#region src/clients/get.ts
|
|
1897
|
-
function
|
|
1897
|
+
function Pn(e) {
|
|
1898
1898
|
return async (t, n) => {
|
|
1899
1899
|
let r = await e.selectFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", n).selectAll().executeTakeFirst();
|
|
1900
1900
|
if (!r) return null;
|
|
@@ -1941,7 +1941,7 @@ function Nn(e) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
//#endregion
|
|
1943
1943
|
//#region src/clients/getByClientId.ts
|
|
1944
|
-
function
|
|
1944
|
+
function Fn(e) {
|
|
1945
1945
|
return async (t) => {
|
|
1946
1946
|
let n = await e.selectFrom("clients").where("clients.client_id", "=", t).selectAll().executeTakeFirst();
|
|
1947
1947
|
return n ? l({
|
|
@@ -1986,7 +1986,7 @@ function Pn(e) {
|
|
|
1986
1986
|
}
|
|
1987
1987
|
//#endregion
|
|
1988
1988
|
//#region src/clients/list.ts
|
|
1989
|
-
function
|
|
1989
|
+
function In(e) {
|
|
1990
1990
|
return l({
|
|
1991
1991
|
...e,
|
|
1992
1992
|
global: !!e.global,
|
|
@@ -2026,7 +2026,7 @@ function Fn(e) {
|
|
|
2026
2026
|
token_exchange: e.token_exchange ? JSON.parse(e.token_exchange) : void 0
|
|
2027
2027
|
});
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2029
|
+
function Ln(e) {
|
|
2030
2030
|
let t = De(e);
|
|
2031
2031
|
if (t.length !== 1) return null;
|
|
2032
2032
|
let n = t[0].match(/^([a-zA-Z_][a-zA-Z0-9_]*):(.+)$/);
|
|
@@ -2037,11 +2037,11 @@ function In(e) {
|
|
|
2037
2037
|
value: r
|
|
2038
2038
|
} : null;
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function Rn(e) {
|
|
2041
2041
|
return async (t, n) => {
|
|
2042
2042
|
let r = e.selectFrom("clients").where("clients.tenant_id", "=", t), i = new Set(["owner_user_id", "registration_type"]);
|
|
2043
2043
|
if (n?.q) {
|
|
2044
|
-
let e =
|
|
2044
|
+
let e = Ln(n.q);
|
|
2045
2045
|
if (e && i.has(e.field)) {
|
|
2046
2046
|
let t = e.field;
|
|
2047
2047
|
r = r.where(t, "=", e.value);
|
|
@@ -2052,7 +2052,7 @@ function Ln(e) {
|
|
|
2052
2052
|
sortColumn: "created_at",
|
|
2053
2053
|
sortOrder: "desc",
|
|
2054
2054
|
idColumn: "client_id"
|
|
2055
|
-
}), a = e.map(
|
|
2055
|
+
}), a = e.map(In);
|
|
2056
2056
|
return {
|
|
2057
2057
|
clients: a,
|
|
2058
2058
|
totals: {
|
|
@@ -2076,7 +2076,7 @@ function Ln(e) {
|
|
|
2076
2076
|
if (n?.include_totals) {
|
|
2077
2077
|
let r = e.selectFrom("clients").select(p`count(*)`.as("count")).where("clients.tenant_id", "=", t);
|
|
2078
2078
|
if (n?.q) {
|
|
2079
|
-
let e =
|
|
2079
|
+
let e = Ln(n.q);
|
|
2080
2080
|
if (e && i.has(e.field)) {
|
|
2081
2081
|
let t = e.field;
|
|
2082
2082
|
r = r.where(t, "=", e.value);
|
|
@@ -2085,7 +2085,7 @@ function Ln(e) {
|
|
|
2085
2085
|
let a = await r.executeTakeFirst();
|
|
2086
2086
|
c = Number(a?.count || 0);
|
|
2087
2087
|
}
|
|
2088
|
-
let l = s.map(
|
|
2088
|
+
let l = s.map(In);
|
|
2089
2089
|
return {
|
|
2090
2090
|
clients: l,
|
|
2091
2091
|
totals: {
|
|
@@ -2099,12 +2099,12 @@ function Ln(e) {
|
|
|
2099
2099
|
}
|
|
2100
2100
|
//#endregion
|
|
2101
2101
|
//#region src/clients/remove.ts
|
|
2102
|
-
function
|
|
2102
|
+
function zn(e) {
|
|
2103
2103
|
return async (t, n) => (await e.deleteFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
|
|
2104
2104
|
}
|
|
2105
2105
|
//#endregion
|
|
2106
2106
|
//#region src/clients/update.ts
|
|
2107
|
-
function
|
|
2107
|
+
function Bn(e) {
|
|
2108
2108
|
return async (t, r, i) => {
|
|
2109
2109
|
let a = {
|
|
2110
2110
|
...i,
|
|
@@ -2152,31 +2152,31 @@ function zn(e) {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
//#endregion
|
|
2154
2154
|
//#region src/clients/index.ts
|
|
2155
|
-
function
|
|
2155
|
+
function Vn(e) {
|
|
2156
2156
|
return {
|
|
2157
|
-
create:
|
|
2158
|
-
get:
|
|
2159
|
-
getByClientId:
|
|
2160
|
-
list:
|
|
2161
|
-
remove:
|
|
2162
|
-
update:
|
|
2157
|
+
create: Nn(e),
|
|
2158
|
+
get: Pn(e),
|
|
2159
|
+
getByClientId: Fn(e),
|
|
2160
|
+
list: Rn(e),
|
|
2161
|
+
remove: zn(e),
|
|
2162
|
+
update: Bn(e)
|
|
2163
2163
|
};
|
|
2164
2164
|
}
|
|
2165
2165
|
//#endregion
|
|
2166
2166
|
//#region src/clientConnections/listByClient.ts
|
|
2167
|
-
function
|
|
2167
|
+
function Hn(e) {
|
|
2168
2168
|
return async (t, n) => {
|
|
2169
2169
|
let r = await e.selectFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", n).select("connections").executeTakeFirst();
|
|
2170
2170
|
if (!r) return [];
|
|
2171
2171
|
let i = JSON.parse(r.connections || "[]");
|
|
2172
2172
|
if (i.length === 0) return [];
|
|
2173
|
-
let a = await e.selectFrom("connections").where("connections.tenant_id", "=", t).where("connections.id", "in", i).selectAll().execute(), o = new Map(a.map((e) => [e.id,
|
|
2173
|
+
let a = await e.selectFrom("connections").where("connections.tenant_id", "=", t).where("connections.id", "in", i).selectAll().execute(), o = new Map(a.map((e) => [e.id, En(e)]));
|
|
2174
2174
|
return i.map((e) => o.get(e)).filter((e) => e !== void 0);
|
|
2175
2175
|
};
|
|
2176
2176
|
}
|
|
2177
2177
|
//#endregion
|
|
2178
2178
|
//#region src/clientConnections/updateByClient.ts
|
|
2179
|
-
function
|
|
2179
|
+
function Un(e) {
|
|
2180
2180
|
return async (t, n, r) => (await e.updateTable("clients").set({
|
|
2181
2181
|
connections: JSON.stringify(r),
|
|
2182
2182
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -2184,7 +2184,7 @@ function Hn(e) {
|
|
|
2184
2184
|
}
|
|
2185
2185
|
//#endregion
|
|
2186
2186
|
//#region src/clientConnections/listByConnection.ts
|
|
2187
|
-
function
|
|
2187
|
+
function Wn(e) {
|
|
2188
2188
|
return async (t, n) => {
|
|
2189
2189
|
let r = await e.selectFrom("clients").where("clients.tenant_id", "=", t).select(["client_id", "connections"]).execute(), i = [];
|
|
2190
2190
|
for (let e of r) JSON.parse(e.connections || "[]").includes(n) && i.push(e.client_id);
|
|
@@ -2193,7 +2193,7 @@ function Un(e) {
|
|
|
2193
2193
|
}
|
|
2194
2194
|
//#endregion
|
|
2195
2195
|
//#region src/clientConnections/addClientToConnection.ts
|
|
2196
|
-
function
|
|
2196
|
+
function Gn(e) {
|
|
2197
2197
|
return async (t, n, r) => {
|
|
2198
2198
|
let i = await e.selectFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", r).select("connections").executeTakeFirst();
|
|
2199
2199
|
if (!i) return !1;
|
|
@@ -2206,7 +2206,7 @@ function Wn(e) {
|
|
|
2206
2206
|
}
|
|
2207
2207
|
//#endregion
|
|
2208
2208
|
//#region src/clientConnections/removeClientFromConnection.ts
|
|
2209
|
-
function
|
|
2209
|
+
function Kn(e) {
|
|
2210
2210
|
return async (t, n, r) => {
|
|
2211
2211
|
let i = await e.selectFrom("clients").where("clients.tenant_id", "=", t).where("clients.client_id", "=", r).select("connections").executeTakeFirst();
|
|
2212
2212
|
if (!i) return !1;
|
|
@@ -2219,18 +2219,18 @@ function Gn(e) {
|
|
|
2219
2219
|
}
|
|
2220
2220
|
//#endregion
|
|
2221
2221
|
//#region src/clientConnections/index.ts
|
|
2222
|
-
function
|
|
2222
|
+
function qn(e) {
|
|
2223
2223
|
return {
|
|
2224
|
-
listByClient:
|
|
2225
|
-
updateByClient:
|
|
2226
|
-
listByConnection:
|
|
2227
|
-
addClientToConnection:
|
|
2228
|
-
removeClientFromConnection:
|
|
2224
|
+
listByClient: Hn(e),
|
|
2225
|
+
updateByClient: Un(e),
|
|
2226
|
+
listByConnection: Wn(e),
|
|
2227
|
+
addClientToConnection: Gn(e),
|
|
2228
|
+
removeClientFromConnection: Kn(e)
|
|
2229
2229
|
};
|
|
2230
2230
|
}
|
|
2231
2231
|
//#endregion
|
|
2232
2232
|
//#region src/clientGrants/create.ts
|
|
2233
|
-
function
|
|
2233
|
+
function Jn(e) {
|
|
2234
2234
|
return async (n, r, i) => {
|
|
2235
2235
|
let a = i?.importMetadata, o = (/* @__PURE__ */ new Date()).toISOString(), s = a?.id ?? t(), c = a?.created_at ?? o, u = a?.updated_at ?? a?.created_at ?? o, { scope: d, authorization_details_types: f, ...p } = r, m = {
|
|
2236
2236
|
id: s,
|
|
@@ -2258,7 +2258,7 @@ function qn(e) {
|
|
|
2258
2258
|
}
|
|
2259
2259
|
//#endregion
|
|
2260
2260
|
//#region src/clientGrants/get.ts
|
|
2261
|
-
function
|
|
2261
|
+
function Yn(e) {
|
|
2262
2262
|
return async (t, n) => {
|
|
2263
2263
|
let r = await e.selectFrom("client_grants").selectAll().where("client_grants.tenant_id", "=", t).where("client_grants.id", "=", n).executeTakeFirst();
|
|
2264
2264
|
return r ? l({
|
|
@@ -2278,7 +2278,7 @@ function Jn(e) {
|
|
|
2278
2278
|
}
|
|
2279
2279
|
//#endregion
|
|
2280
2280
|
//#region src/clientGrants/list.ts
|
|
2281
|
-
function
|
|
2281
|
+
function Xn(e) {
|
|
2282
2282
|
return te.parse(l({
|
|
2283
2283
|
...e,
|
|
2284
2284
|
scope: e.scope ? JSON.parse(e.scope) : [],
|
|
@@ -2287,7 +2287,7 @@ function Yn(e) {
|
|
|
2287
2287
|
authorization_details_types: e.authorization_details_types ? JSON.parse(e.authorization_details_types) : []
|
|
2288
2288
|
}));
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function Zn(e) {
|
|
2291
2291
|
return async (t, n = {}) => {
|
|
2292
2292
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, q: s, sort: c } = n, l = e.selectFrom("client_grants").where("client_grants.tenant_id", "=", t);
|
|
2293
2293
|
if (s) {
|
|
@@ -2304,7 +2304,7 @@ function Xn(e) {
|
|
|
2304
2304
|
let { rows: e, limit: t, next: r } = await O(l.selectAll(), n, {
|
|
2305
2305
|
sortColumn: "created_at",
|
|
2306
2306
|
sortOrder: "desc"
|
|
2307
|
-
}), i = e.map(
|
|
2307
|
+
}), i = e.map(Xn);
|
|
2308
2308
|
return {
|
|
2309
2309
|
client_grants: i,
|
|
2310
2310
|
start: 0,
|
|
@@ -2318,7 +2318,7 @@ function Xn(e) {
|
|
|
2318
2318
|
let { ref: t } = e.dynamic;
|
|
2319
2319
|
u = u.orderBy(t(c.sort_by), c.sort_order);
|
|
2320
2320
|
} else u = u.orderBy("client_grants.created_at", "desc").orderBy("client_grants.id", "desc");
|
|
2321
|
-
let d = (await u.selectAll().limit(i).offset(r * i).execute()).map(
|
|
2321
|
+
let d = (await u.selectAll().limit(i).offset(r * i).execute()).map(Xn);
|
|
2322
2322
|
if (!a) return {
|
|
2323
2323
|
client_grants: d,
|
|
2324
2324
|
start: 0,
|
|
@@ -2336,12 +2336,12 @@ function Xn(e) {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
//#endregion
|
|
2338
2338
|
//#region src/clientGrants/remove.ts
|
|
2339
|
-
function
|
|
2339
|
+
function Qn(e) {
|
|
2340
2340
|
return async (t, n) => ((await e.deleteFrom("client_grants").where("client_grants.tenant_id", "=", t).where("client_grants.id", "=", n).executeTakeFirst()).numDeletedRows ?? 0n) > 0n;
|
|
2341
2341
|
}
|
|
2342
2342
|
//#endregion
|
|
2343
2343
|
//#region src/clientGrants/update.ts
|
|
2344
|
-
function
|
|
2344
|
+
function $n(e) {
|
|
2345
2345
|
return async (t, n, r) => {
|
|
2346
2346
|
let i = (/* @__PURE__ */ new Date()).toISOString(), { scope: a, authorization_details_types: o, ...s } = r, c = {
|
|
2347
2347
|
...s,
|
|
@@ -2352,18 +2352,18 @@ function Qn(e) {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
//#endregion
|
|
2354
2354
|
//#region src/clientGrants/index.ts
|
|
2355
|
-
function
|
|
2355
|
+
function er(e) {
|
|
2356
2356
|
return {
|
|
2357
|
-
create:
|
|
2358
|
-
get:
|
|
2359
|
-
list:
|
|
2360
|
-
remove:
|
|
2361
|
-
update:
|
|
2357
|
+
create: Jn(e),
|
|
2358
|
+
get: Yn(e),
|
|
2359
|
+
list: Zn(e),
|
|
2360
|
+
remove: Qn(e),
|
|
2361
|
+
update: $n(e)
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
2364
|
//#endregion
|
|
2365
2365
|
//#region src/clientRegistrationTokens/create.ts
|
|
2366
|
-
function
|
|
2366
|
+
function tr(e) {
|
|
2367
2367
|
return async (t, n) => {
|
|
2368
2368
|
let r = Date.now();
|
|
2369
2369
|
return await e.insertInto("client_registration_tokens").values({
|
|
@@ -2394,12 +2394,12 @@ function er(e) {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
//#endregion
|
|
2396
2396
|
//#region src/clientRegistrationTokens/row-mapper.ts
|
|
2397
|
-
function
|
|
2397
|
+
function nr(e) {
|
|
2398
2398
|
let t = ne.safeParse(e);
|
|
2399
2399
|
if (!t.success) throw Error(`Unknown client_registration_tokens.type: ${e}`);
|
|
2400
2400
|
return t.data;
|
|
2401
2401
|
}
|
|
2402
|
-
function
|
|
2402
|
+
function rr(e) {
|
|
2403
2403
|
if (!e) return;
|
|
2404
2404
|
let t;
|
|
2405
2405
|
try {
|
|
@@ -2409,14 +2409,14 @@ function nr(e) {
|
|
|
2409
2409
|
}
|
|
2410
2410
|
return le(t) ? t : void 0;
|
|
2411
2411
|
}
|
|
2412
|
-
function
|
|
2412
|
+
function I(e) {
|
|
2413
2413
|
return {
|
|
2414
2414
|
id: e.id,
|
|
2415
2415
|
token_hash: e.token_hash,
|
|
2416
|
-
type:
|
|
2416
|
+
type: nr(e.type),
|
|
2417
2417
|
client_id: e.client_id ?? void 0,
|
|
2418
2418
|
sub: e.sub ?? void 0,
|
|
2419
|
-
constraints:
|
|
2419
|
+
constraints: rr(e.constraints),
|
|
2420
2420
|
single_use: !!e.single_use,
|
|
2421
2421
|
expires_at: i(e.expires_at_ts),
|
|
2422
2422
|
used_at: i(e.used_at_ts),
|
|
@@ -2429,7 +2429,7 @@ function rr(e) {
|
|
|
2429
2429
|
function ir(e) {
|
|
2430
2430
|
return async (t, n) => {
|
|
2431
2431
|
let r = await e.selectFrom("client_registration_tokens").where("tenant_id", "=", t).where("id", "=", n).selectAll().executeTakeFirst();
|
|
2432
|
-
return r ?
|
|
2432
|
+
return r ? I(r) : null;
|
|
2433
2433
|
};
|
|
2434
2434
|
}
|
|
2435
2435
|
//#endregion
|
|
@@ -2437,13 +2437,13 @@ function ir(e) {
|
|
|
2437
2437
|
function ar(e) {
|
|
2438
2438
|
return async (t, n) => {
|
|
2439
2439
|
let r = await e.selectFrom("client_registration_tokens").where("tenant_id", "=", t).where("token_hash", "=", n).selectAll().executeTakeFirst();
|
|
2440
|
-
return r ?
|
|
2440
|
+
return r ? I(r) : null;
|
|
2441
2441
|
};
|
|
2442
2442
|
}
|
|
2443
2443
|
//#endregion
|
|
2444
2444
|
//#region src/clientRegistrationTokens/listByClient.ts
|
|
2445
2445
|
function or(e) {
|
|
2446
|
-
return async (t, n) => (await e.selectFrom("client_registration_tokens").where("tenant_id", "=", t).where("client_id", "=", n).orderBy("created_at_ts", "desc").selectAll().execute()).map(
|
|
2446
|
+
return async (t, n) => (await e.selectFrom("client_registration_tokens").where("tenant_id", "=", t).where("client_id", "=", n).orderBy("created_at_ts", "desc").selectAll().execute()).map(I);
|
|
2447
2447
|
}
|
|
2448
2448
|
//#endregion
|
|
2449
2449
|
//#region src/clientRegistrationTokens/markUsed.ts
|
|
@@ -2472,7 +2472,7 @@ function ur(e) {
|
|
|
2472
2472
|
//#region src/clientRegistrationTokens/index.ts
|
|
2473
2473
|
function dr(e) {
|
|
2474
2474
|
return {
|
|
2475
|
-
create:
|
|
2475
|
+
create: tr(e),
|
|
2476
2476
|
get: ir(e),
|
|
2477
2477
|
getByHash: ar(e),
|
|
2478
2478
|
listByClient: or(e),
|
|
@@ -2564,8 +2564,8 @@ function _r(e) {
|
|
|
2564
2564
|
return async (t) => (await e.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", t).selectAll().execute()).map((e) => ({
|
|
2565
2565
|
...e,
|
|
2566
2566
|
primary: e.primary === 1,
|
|
2567
|
-
domain_metadata:
|
|
2568
|
-
verification:
|
|
2567
|
+
domain_metadata: F(e.domain_metadata, void 0),
|
|
2568
|
+
verification: F(e.verification, void 0)
|
|
2569
2569
|
}));
|
|
2570
2570
|
}
|
|
2571
2571
|
//#endregion
|
|
@@ -2581,8 +2581,8 @@ function yr(e) {
|
|
|
2581
2581
|
return r ? {
|
|
2582
2582
|
...r,
|
|
2583
2583
|
primary: r.primary === 1,
|
|
2584
|
-
domain_metadata:
|
|
2585
|
-
verification:
|
|
2584
|
+
domain_metadata: F(r.domain_metadata, void 0),
|
|
2585
|
+
verification: F(r.verification, void 0)
|
|
2586
2586
|
} : null;
|
|
2587
2587
|
};
|
|
2588
2588
|
}
|
|
@@ -2608,8 +2608,8 @@ function xr(e) {
|
|
|
2608
2608
|
return n ? {
|
|
2609
2609
|
...n,
|
|
2610
2610
|
primary: n.primary === 1,
|
|
2611
|
-
domain_metadata:
|
|
2612
|
-
verification:
|
|
2611
|
+
domain_metadata: F(n.domain_metadata, void 0),
|
|
2612
|
+
verification: F(n.verification, void 0)
|
|
2613
2613
|
} : null;
|
|
2614
2614
|
};
|
|
2615
2615
|
}
|
|
@@ -2745,7 +2745,7 @@ function Ar(e) {
|
|
|
2745
2745
|
enabled: !!n,
|
|
2746
2746
|
synchronous: !!i,
|
|
2747
2747
|
enforce: E(c),
|
|
2748
|
-
metadata:
|
|
2748
|
+
metadata: At(s)
|
|
2749
2749
|
});
|
|
2750
2750
|
}
|
|
2751
2751
|
function jr(e) {
|
|
@@ -2806,7 +2806,7 @@ function Mr(e) {
|
|
|
2806
2806
|
enabled: !!d.enabled,
|
|
2807
2807
|
synchronous: !!d.synchronous,
|
|
2808
2808
|
enforce: E(u),
|
|
2809
|
-
metadata:
|
|
2809
|
+
metadata: At(c)
|
|
2810
2810
|
});
|
|
2811
2811
|
};
|
|
2812
2812
|
}
|
|
@@ -2950,7 +2950,7 @@ function Hr(e) {
|
|
|
2950
2950
|
...c,
|
|
2951
2951
|
tenant_id: n
|
|
2952
2952
|
};
|
|
2953
|
-
return await e.insertInto("themes").values(
|
|
2953
|
+
return await e.insertInto("themes").values(P(l)).execute(), c;
|
|
2954
2954
|
};
|
|
2955
2955
|
}
|
|
2956
2956
|
//#endregion
|
|
@@ -2963,7 +2963,7 @@ function Ur(e) {
|
|
|
2963
2963
|
function Wr(e) {
|
|
2964
2964
|
return async (t, n) => {
|
|
2965
2965
|
let r = await e.selectFrom("themes").where("themes.tenant_id", "=", t).where("themes.themeId", "=", n).selectAll().executeTakeFirst();
|
|
2966
|
-
return r ? l(
|
|
2966
|
+
return r ? l(St({
|
|
2967
2967
|
...r,
|
|
2968
2968
|
borders_show_widget_shadow: !!r.borders_show_widget_shadow,
|
|
2969
2969
|
fonts_body_text_bold: !!r.fonts_body_text_bold,
|
|
@@ -2985,7 +2985,7 @@ function Wr(e) {
|
|
|
2985
2985
|
//#region src/themes/update.ts
|
|
2986
2986
|
function Gr(e) {
|
|
2987
2987
|
return async (t, n, r) => {
|
|
2988
|
-
let { themeId: i, ...a } = r, o =
|
|
2988
|
+
let { themeId: i, ...a } = r, o = P({
|
|
2989
2989
|
...a,
|
|
2990
2990
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2991
2991
|
});
|
|
@@ -3016,7 +3016,7 @@ function qr(e) {
|
|
|
3016
3016
|
"created_at_ts",
|
|
3017
3017
|
"updated_at_ts",
|
|
3018
3018
|
"expires_at_ts"
|
|
3019
|
-
]), f =
|
|
3019
|
+
]), f = St(l({
|
|
3020
3020
|
...u,
|
|
3021
3021
|
...d,
|
|
3022
3022
|
state: i.state || h.PENDING,
|
|
@@ -3056,7 +3056,7 @@ function ti(e) {
|
|
|
3056
3056
|
state: n.state || h.PENDING,
|
|
3057
3057
|
state_data: n.state_data,
|
|
3058
3058
|
failure_reason: n.failure_reason
|
|
3059
|
-
}, { authParams: a, ...o } = i, s = Date.now(), l =
|
|
3059
|
+
}, { authParams: a, ...o } = i, s = Date.now(), l = P(o);
|
|
3060
3060
|
return delete l.created_at, delete l.updated_at, delete l.expires_at, await e.insertInto("login_sessions").values({
|
|
3061
3061
|
...l,
|
|
3062
3062
|
tenant_id: t,
|
|
@@ -3079,7 +3079,7 @@ function ni(e) {
|
|
|
3079
3079
|
...c
|
|
3080
3080
|
}) };
|
|
3081
3081
|
}
|
|
3082
|
-
let d =
|
|
3082
|
+
let d = P(l);
|
|
3083
3083
|
return delete d.created_at_ts, delete d.updated_at_ts, delete d.expires_at_ts, delete d.id, delete d.tenant_id, (await e.updateTable("login_sessions").set({
|
|
3084
3084
|
...d,
|
|
3085
3085
|
...u,
|
|
@@ -4832,7 +4832,7 @@ function Ya(e) {
|
|
|
4832
4832
|
return async (t, n) => {
|
|
4833
4833
|
let r = await e.selectFrom("invites").selectAll().where("tenant_id", "=", t).where("id", "=", n).executeTakeFirst();
|
|
4834
4834
|
return r ? l({
|
|
4835
|
-
...
|
|
4835
|
+
...jt(r, {
|
|
4836
4836
|
inviter: {},
|
|
4837
4837
|
invitee: {},
|
|
4838
4838
|
app_metadata: {},
|
|
@@ -4847,7 +4847,7 @@ function Ya(e) {
|
|
|
4847
4847
|
//#region src/invites/list.ts
|
|
4848
4848
|
function Xa(e) {
|
|
4849
4849
|
return l({
|
|
4850
|
-
...
|
|
4850
|
+
...jt(e, {
|
|
4851
4851
|
inviter: {},
|
|
4852
4852
|
invitee: {},
|
|
4853
4853
|
app_metadata: {},
|
|
@@ -5560,7 +5560,7 @@ function Io(e) {
|
|
|
5560
5560
|
//#region src/outbox/index.ts
|
|
5561
5561
|
function Lo(e) {
|
|
5562
5562
|
return {
|
|
5563
|
-
create:
|
|
5563
|
+
create: lt(e),
|
|
5564
5564
|
getByIds: Eo(e),
|
|
5565
5565
|
getUnprocessed: Do(e),
|
|
5566
5566
|
claimEvents: Oo(e),
|
|
@@ -6312,6 +6312,8 @@ function Ts(e) {
|
|
|
6312
6312
|
canary_tenant_ids: ws(e.canary_tenant_ids),
|
|
6313
6313
|
filter: ws(e.filter),
|
|
6314
6314
|
initiated_by: e.initiated_by,
|
|
6315
|
+
config: ws(e.config),
|
|
6316
|
+
paused_reason: e.paused_reason,
|
|
6315
6317
|
created_at: e.created_at,
|
|
6316
6318
|
updated_at: e.updated_at,
|
|
6317
6319
|
finished_at: e.finished_at
|
|
@@ -6330,6 +6332,8 @@ function Es(e) {
|
|
|
6330
6332
|
canary_tenant_ids: r.canary_tenant_ids ? JSON.stringify(r.canary_tenant_ids) : null,
|
|
6331
6333
|
filter: r.filter ? JSON.stringify(r.filter) : null,
|
|
6332
6334
|
initiated_by: r.initiated_by ?? null,
|
|
6335
|
+
config: r.config ? JSON.stringify(r.config) : null,
|
|
6336
|
+
paused_reason: null,
|
|
6333
6337
|
created_at: i,
|
|
6334
6338
|
updated_at: i,
|
|
6335
6339
|
finished_at: null
|
|
@@ -6341,17 +6345,22 @@ function Es(e) {
|
|
|
6341
6345
|
return n ? Ts(n) : null;
|
|
6342
6346
|
},
|
|
6343
6347
|
async list(t = {}) {
|
|
6344
|
-
let n = t.page ?? 0, r = t.per_page ?? 50, i =
|
|
6348
|
+
let n = t.page ?? 0, r = t.per_page ?? 50, i = e.selectFrom("rollouts");
|
|
6349
|
+
if (t.kind !== void 0 && (i = i.where("kind", "=", t.kind)), t.status !== void 0) {
|
|
6350
|
+
let e = Array.isArray(t.status) ? t.status : [t.status];
|
|
6351
|
+
i = i.where("status", "in", e);
|
|
6352
|
+
}
|
|
6353
|
+
let a = await i.selectAll().orderBy("created_at", "desc").orderBy("id", "desc").offset(n * r).limit(r).execute();
|
|
6345
6354
|
return {
|
|
6346
|
-
rollouts:
|
|
6355
|
+
rollouts: a.map(Ts),
|
|
6347
6356
|
start: n * r,
|
|
6348
6357
|
limit: r,
|
|
6349
|
-
length:
|
|
6358
|
+
length: a.length
|
|
6350
6359
|
};
|
|
6351
6360
|
},
|
|
6352
6361
|
async update(t, n) {
|
|
6353
6362
|
let r = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
6354
|
-
n.status !== void 0 && (r.status = n.status), n.wave_size !== void 0 && (r.wave_size = n.wave_size), n.canary_tenant_ids !== void 0 && (r.canary_tenant_ids = n.canary_tenant_ids ? JSON.stringify(n.canary_tenant_ids) : null), n.filter !== void 0 && (r.filter = n.filter ? JSON.stringify(n.filter) : null), n.finished_at !== void 0 && (r.finished_at = n.finished_at);
|
|
6363
|
+
n.status !== void 0 && (r.status = n.status), n.wave_size !== void 0 && (r.wave_size = n.wave_size), n.canary_tenant_ids !== void 0 && (r.canary_tenant_ids = n.canary_tenant_ids ? JSON.stringify(n.canary_tenant_ids) : null), n.filter !== void 0 && (r.filter = n.filter ? JSON.stringify(n.filter) : null), n.config !== void 0 && (r.config = n.config ? JSON.stringify(n.config) : null), n.paused_reason !== void 0 && (r.paused_reason = n.paused_reason), n.finished_at !== void 0 && (r.finished_at = n.finished_at);
|
|
6355
6364
|
let i = await e.updateTable("rollouts").where("id", "=", t).set(r).executeTakeFirst();
|
|
6356
6365
|
return Number(i.numUpdatedRows) > 0;
|
|
6357
6366
|
},
|
|
@@ -7336,8 +7345,92 @@ async function Wc(e) {
|
|
|
7336
7345
|
await Q(e, "tenants", "parent_tenant_id");
|
|
7337
7346
|
}
|
|
7338
7347
|
//#endregion
|
|
7348
|
+
//#region migrate/migrations/2026-10-26T12:00:00_config_sync_hash.ts
|
|
7349
|
+
var Gc = /* @__PURE__ */ C({
|
|
7350
|
+
down: () => Yc,
|
|
7351
|
+
up: () => Jc
|
|
7352
|
+
});
|
|
7353
|
+
async function Kc(e, t, n) {
|
|
7354
|
+
try {
|
|
7355
|
+
await e.schema.alterTable("tenants").addColumn(t, n).execute();
|
|
7356
|
+
} catch (e) {
|
|
7357
|
+
if (e instanceof Error && (e.message.includes("1060") || e.message.toLowerCase().includes("duplicate column"))) return;
|
|
7358
|
+
throw e;
|
|
7359
|
+
}
|
|
7360
|
+
}
|
|
7361
|
+
async function qc(e, t) {
|
|
7362
|
+
try {
|
|
7363
|
+
await e.schema.alterTable("tenants").dropColumn(t).execute();
|
|
7364
|
+
} catch (e) {
|
|
7365
|
+
if (e instanceof Error && e.message.includes("1091")) return;
|
|
7366
|
+
throw e;
|
|
7367
|
+
}
|
|
7368
|
+
}
|
|
7369
|
+
async function Jc(e) {
|
|
7370
|
+
await Kc(e, "config_sync_hash", p`varchar(64)`), await Kc(e, "config_synced_at", p`varchar(35)`);
|
|
7371
|
+
}
|
|
7372
|
+
async function Yc(e) {
|
|
7373
|
+
await qc(e, "config_synced_at"), await qc(e, "config_sync_hash");
|
|
7374
|
+
}
|
|
7375
|
+
//#endregion
|
|
7376
|
+
//#region migrate/migrations/2026-10-27T12:00:00_config_sync_mode.ts
|
|
7377
|
+
var Xc = /* @__PURE__ */ C({
|
|
7378
|
+
down: () => el,
|
|
7379
|
+
up: () => $c
|
|
7380
|
+
});
|
|
7381
|
+
async function Zc(e) {
|
|
7382
|
+
try {
|
|
7383
|
+
await e.schema.alterTable("tenants").addColumn("config_sync", p`varchar(16)`).execute();
|
|
7384
|
+
} catch (e) {
|
|
7385
|
+
if (e instanceof Error && (e.message.includes("1060") || e.message.toLowerCase().includes("duplicate column"))) return;
|
|
7386
|
+
throw e;
|
|
7387
|
+
}
|
|
7388
|
+
}
|
|
7389
|
+
async function Qc(e) {
|
|
7390
|
+
try {
|
|
7391
|
+
await e.schema.alterTable("tenants").dropColumn("config_sync").execute();
|
|
7392
|
+
} catch (e) {
|
|
7393
|
+
if (e instanceof Error && e.message.includes("1091")) return;
|
|
7394
|
+
throw e;
|
|
7395
|
+
}
|
|
7396
|
+
}
|
|
7397
|
+
async function $c(e) {
|
|
7398
|
+
await Zc(e);
|
|
7399
|
+
}
|
|
7400
|
+
async function el(e) {
|
|
7401
|
+
await Qc(e);
|
|
7402
|
+
}
|
|
7403
|
+
//#endregion
|
|
7404
|
+
//#region migrate/migrations/2026-10-28T12:00:00_rollout_config.ts
|
|
7405
|
+
var tl = /* @__PURE__ */ C({
|
|
7406
|
+
down: () => al,
|
|
7407
|
+
up: () => il
|
|
7408
|
+
});
|
|
7409
|
+
async function nl(e, t, n) {
|
|
7410
|
+
try {
|
|
7411
|
+
await e.schema.alterTable("rollouts").addColumn(t, n).execute();
|
|
7412
|
+
} catch (e) {
|
|
7413
|
+
if (e instanceof Error && (e.message.includes("1060") || e.message.toLowerCase().includes("duplicate column"))) return;
|
|
7414
|
+
throw e;
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
async function rl(e, t) {
|
|
7418
|
+
try {
|
|
7419
|
+
await e.schema.alterTable("rollouts").dropColumn(t).execute();
|
|
7420
|
+
} catch (e) {
|
|
7421
|
+
if (e instanceof Error && e.message.includes("1091")) return;
|
|
7422
|
+
throw e;
|
|
7423
|
+
}
|
|
7424
|
+
}
|
|
7425
|
+
async function il(e) {
|
|
7426
|
+
await nl(e, "config", p`text`), await nl(e, "paused_reason", p`text`);
|
|
7427
|
+
}
|
|
7428
|
+
async function al(e) {
|
|
7429
|
+
await rl(e, "paused_reason"), await rl(e, "config");
|
|
7430
|
+
}
|
|
7431
|
+
//#endregion
|
|
7339
7432
|
//#region migrate/migrations/index.ts
|
|
7340
|
-
var
|
|
7433
|
+
var ol = {
|
|
7341
7434
|
"2026-07-16T14:00:00_baseline": Os,
|
|
7342
7435
|
"2026-07-16T15:00:00_codes_expires_at_ts": Fs,
|
|
7343
7436
|
"2026-08-04T12:00:00_scim_inbound_provisioning": qs,
|
|
@@ -7350,25 +7443,28 @@ var Gc = {
|
|
|
7350
7443
|
"2026-09-01T12:00:00_tenant_operation_rows": kc,
|
|
7351
7444
|
"2026-09-25T12:00:00_token_exchange_profiles": Nc,
|
|
7352
7445
|
"2026-10-13T12:00:00_prompt_partials": Rc,
|
|
7353
|
-
"2026-10-21T12:00:00_config_inheritance": Vc
|
|
7446
|
+
"2026-10-21T12:00:00_config_inheritance": Vc,
|
|
7447
|
+
"2026-10-26T12:00:00_config_sync_hash": Gc,
|
|
7448
|
+
"2026-10-27T12:00:00_config_sync_mode": Xc,
|
|
7449
|
+
"2026-10-28T12:00:00_rollout_config": tl
|
|
7354
7450
|
};
|
|
7355
7451
|
//#endregion
|
|
7356
7452
|
//#region migrate/migrate.ts
|
|
7357
|
-
async function
|
|
7453
|
+
async function sl(e, t = !1) {
|
|
7358
7454
|
Ps(t), t && console.log("migrating...");
|
|
7359
7455
|
let { error: n, results: r } = await new Ae({
|
|
7360
7456
|
db: e,
|
|
7361
|
-
provider: new Ds(
|
|
7457
|
+
provider: new Ds(ol)
|
|
7362
7458
|
}).migrateToLatest();
|
|
7363
7459
|
if (r?.forEach((e) => {
|
|
7364
7460
|
e.status === "Success" ? t && console.log(`migration "${e.migrationName}" was executed successfully`) : e.status === "Error" && console.error(`failed to execute migration "${e.migrationName}"`);
|
|
7365
7461
|
}), n) throw console.error("failed to migrate"), console.error(n), n;
|
|
7366
7462
|
}
|
|
7367
|
-
async function
|
|
7463
|
+
async function cl(e, t = !1) {
|
|
7368
7464
|
Ps(t), t && console.log("migrating...");
|
|
7369
7465
|
let { error: n, results: r } = await new Ae({
|
|
7370
7466
|
db: e,
|
|
7371
|
-
provider: new Ds(
|
|
7467
|
+
provider: new Ds(ol)
|
|
7372
7468
|
}).migrateDown();
|
|
7373
7469
|
if (r?.forEach((e) => {
|
|
7374
7470
|
e.status === "Success" ? t && console.log(`migration "${e.migrationName}" was reverted successfully`) : e.status === "Error" && console.error(`failed to execute migration "${e.migrationName}"`);
|
|
@@ -7376,22 +7472,22 @@ async function qc(e, t = !1) {
|
|
|
7376
7472
|
}
|
|
7377
7473
|
//#endregion
|
|
7378
7474
|
//#region migrate/plan.ts
|
|
7379
|
-
var
|
|
7380
|
-
function
|
|
7475
|
+
var ll = 5e3, ul = class extends Error {};
|
|
7476
|
+
function dl(e) {
|
|
7381
7477
|
if (e.query.kind === "SelectQueryNode") return !0;
|
|
7382
7478
|
if (e.query.kind !== "RawNode") return !1;
|
|
7383
7479
|
let t = e.sql.trimStart();
|
|
7384
7480
|
return /^(select|show|explain|describe|desc)\b/i.test(t) ? !0 : /^pragma\b/i.test(t) && !t.includes("=");
|
|
7385
7481
|
}
|
|
7386
|
-
var
|
|
7482
|
+
var fl = class {
|
|
7387
7483
|
inner;
|
|
7388
7484
|
captured;
|
|
7389
7485
|
constructor(e, t) {
|
|
7390
7486
|
this.inner = e, this.captured = t;
|
|
7391
7487
|
}
|
|
7392
7488
|
async executeQuery(e) {
|
|
7393
|
-
if (
|
|
7394
|
-
if (this.captured.length >=
|
|
7489
|
+
if (dl(e)) return this.inner.executeQuery(e);
|
|
7490
|
+
if (this.captured.length >= ll) throw new ul(`stopped after ${ll} statements`);
|
|
7395
7491
|
return this.captured.push({
|
|
7396
7492
|
sql: e.sql,
|
|
7397
7493
|
parameters: e.parameters
|
|
@@ -7407,7 +7503,7 @@ var Zc = class {
|
|
|
7407
7503
|
function $() {
|
|
7408
7504
|
throw Error("not available in a migration dry run");
|
|
7409
7505
|
}
|
|
7410
|
-
var
|
|
7506
|
+
var pl = {
|
|
7411
7507
|
init: async () => {},
|
|
7412
7508
|
acquireConnection: $,
|
|
7413
7509
|
beginTransaction: $,
|
|
@@ -7416,25 +7512,25 @@ var Qc = {
|
|
|
7416
7512
|
releaseConnection: $,
|
|
7417
7513
|
destroy: async () => {}
|
|
7418
7514
|
};
|
|
7419
|
-
function
|
|
7420
|
-
let n = e.getExecutor(), r = n.withConnectionProvider({ provideConnection: (e) => n.provideConnection((n) => e(new
|
|
7515
|
+
function ml(e, t) {
|
|
7516
|
+
let n = e.getExecutor(), r = n.withConnectionProvider({ provideConnection: (e) => n.provideConnection((n) => e(new fl(n, t))) }), i = {
|
|
7421
7517
|
createAdapter: () => n.adapter,
|
|
7422
|
-
createDriver: () =>
|
|
7518
|
+
createDriver: () => pl,
|
|
7423
7519
|
createQueryCompiler: () => $(),
|
|
7424
7520
|
createIntrospector: () => $()
|
|
7425
7521
|
};
|
|
7426
7522
|
return new f({
|
|
7427
7523
|
config: { dialect: i },
|
|
7428
7524
|
dialect: i,
|
|
7429
|
-
driver:
|
|
7525
|
+
driver: pl,
|
|
7430
7526
|
executor: r
|
|
7431
7527
|
});
|
|
7432
7528
|
}
|
|
7433
|
-
async function
|
|
7529
|
+
async function hl(e) {
|
|
7434
7530
|
Ps(!1);
|
|
7435
7531
|
let t = await new Ae({
|
|
7436
7532
|
db: e,
|
|
7437
|
-
provider: new Ds(
|
|
7533
|
+
provider: new Ds(ol)
|
|
7438
7534
|
}).getMigrations(), n = t.filter((e) => e.executedAt).map((e) => e.name), r = t.filter((e) => !e.executedAt), i = n[n.length - 1], a = i ? r.find((e) => e.name < i) : void 0;
|
|
7439
7535
|
if (a) throw Error(`pending migration "${a.name}" sorts before already-executed "${i}"; migrateToLatest would refuse to run`);
|
|
7440
7536
|
let o = [];
|
|
@@ -7444,9 +7540,9 @@ async function el(e) {
|
|
|
7444
7540
|
statements: n
|
|
7445
7541
|
};
|
|
7446
7542
|
try {
|
|
7447
|
-
await t.migration.up(
|
|
7543
|
+
await t.migration.up(ml(e, n));
|
|
7448
7544
|
} catch (e) {
|
|
7449
|
-
r.error = e instanceof Error ? e.message : String(e), e instanceof
|
|
7545
|
+
r.error = e instanceof Error ? e.message : String(e), e instanceof ul && (r.truncated = !0);
|
|
7450
7546
|
}
|
|
7451
7547
|
o.push(r);
|
|
7452
7548
|
}
|
|
@@ -7455,7 +7551,7 @@ async function el(e) {
|
|
|
7455
7551
|
pending: o
|
|
7456
7552
|
};
|
|
7457
7553
|
}
|
|
7458
|
-
function
|
|
7554
|
+
function gl(e) {
|
|
7459
7555
|
if (e.pending.length === 0) return `-- Database is up to date (${e.executed.length} migrations executed).`;
|
|
7460
7556
|
let t = [`-- ${e.pending.length} pending migration(s); ${e.executed.length} already executed.`];
|
|
7461
7557
|
for (let n of e.pending) {
|
|
@@ -7470,33 +7566,33 @@ function tl(e) {
|
|
|
7470
7566
|
}
|
|
7471
7567
|
//#endregion
|
|
7472
7568
|
//#region src/index.ts
|
|
7473
|
-
function
|
|
7569
|
+
function _l(e, t = { useTransactions: !0 }) {
|
|
7474
7570
|
let n = {
|
|
7475
|
-
actions:
|
|
7476
|
-
actionExecutions:
|
|
7477
|
-
actionVersions:
|
|
7571
|
+
actions: $e(e),
|
|
7572
|
+
actionExecutions: ot(e),
|
|
7573
|
+
actionVersions: ct(e),
|
|
7478
7574
|
branding: Tr(e),
|
|
7479
|
-
clients:
|
|
7480
|
-
clientConnections:
|
|
7481
|
-
clientGrants:
|
|
7575
|
+
clients: Vn(e),
|
|
7576
|
+
clientConnections: qn(e),
|
|
7577
|
+
clientGrants: er(e),
|
|
7482
7578
|
clientRegistrationTokens: dr(e),
|
|
7483
|
-
codes:
|
|
7484
|
-
connections:
|
|
7579
|
+
codes: wn(e),
|
|
7580
|
+
connections: Mn(e),
|
|
7485
7581
|
emailProviders: mi(e),
|
|
7486
7582
|
emailTemplates: xi(e),
|
|
7487
7583
|
customDomains: Sr(e),
|
|
7488
|
-
flows:
|
|
7584
|
+
flows: Lt(e),
|
|
7489
7585
|
forms: Vi(e),
|
|
7490
7586
|
hookCode: Vr(e),
|
|
7491
7587
|
hooks: Ir(e),
|
|
7492
7588
|
invites: eo(e),
|
|
7493
7589
|
keys: hr(e),
|
|
7494
7590
|
loginSessions: ii(e),
|
|
7495
|
-
logs:
|
|
7591
|
+
logs: en(e),
|
|
7496
7592
|
logStreams: Ro(e),
|
|
7497
7593
|
migrationSources: Bo(e),
|
|
7498
7594
|
authenticationMethods: To(e),
|
|
7499
|
-
passwords:
|
|
7595
|
+
passwords: pn(e),
|
|
7500
7596
|
promptSettings: ci(e),
|
|
7501
7597
|
promptPartials: li(e),
|
|
7502
7598
|
proxyRoutes: Wo(e),
|
|
@@ -7510,9 +7606,9 @@ function nl(e, t = { useTransactions: !0 }) {
|
|
|
7510
7606
|
userPermissions: Ta(e),
|
|
7511
7607
|
userRoles: Ma(e),
|
|
7512
7608
|
roles: ta(e),
|
|
7513
|
-
sessions:
|
|
7609
|
+
sessions: cn(e),
|
|
7514
7610
|
sessionCleanup: Pi(e),
|
|
7515
|
-
tenants:
|
|
7611
|
+
tenants: Gt(e),
|
|
7516
7612
|
tenantOperations: os(e),
|
|
7517
7613
|
tenantOperationEvents: ys(e),
|
|
7518
7614
|
tenantOperationRows: Cs(e),
|
|
@@ -7521,8 +7617,8 @@ function nl(e, t = { useTransactions: !0 }) {
|
|
|
7521
7617
|
themes: Kr(e),
|
|
7522
7618
|
universalLoginTemplates: kr(e),
|
|
7523
7619
|
customText: vo(e),
|
|
7524
|
-
users:
|
|
7525
|
-
userActivity:
|
|
7620
|
+
users: Ot(e),
|
|
7621
|
+
userActivity: Tt(e),
|
|
7526
7622
|
organizations: Ra(e),
|
|
7527
7623
|
organizationConnections: za(e),
|
|
7528
7624
|
userOrganizations: qa(e),
|
|
@@ -7530,7 +7626,7 @@ function nl(e, t = { useTransactions: !0 }) {
|
|
|
7530
7626
|
analytics: _o(e),
|
|
7531
7627
|
outbox: Lo(e),
|
|
7532
7628
|
async transaction(r) {
|
|
7533
|
-
return t.useTransactions === !1 ? r(n) : e.transaction().execute(async (e) => r(
|
|
7629
|
+
return t.useTransactions === !1 ? r(n) : e.transaction().execute(async (e) => r(_l(e, {
|
|
7534
7630
|
...t,
|
|
7535
7631
|
useTransactions: !1
|
|
7536
7632
|
})));
|
|
@@ -7539,4 +7635,4 @@ function nl(e, t = { useTransactions: !0 }) {
|
|
|
7539
7635
|
return n;
|
|
7540
7636
|
}
|
|
7541
7637
|
//#endregion
|
|
7542
|
-
export { Ko as createProxyDataAdapter, Wo as createProxyRoutesAdapter,
|
|
7638
|
+
export { Ko as createProxyDataAdapter, Wo as createProxyRoutesAdapter, _l as default, gl as formatMigrationPlan, cl as migrateDown, sl as migrateToLatest, hl as planMigrations };
|