@authhero/kysely-adapter 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +51 -51
- package/dist/kysely-adapter.mjs +74 -82
- package/package.json +4 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var de = (t) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Je = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
6
|
var j = (t, e, a) => Je(t, typeof e != "symbol" ? e + "" : e, a), K = (t, e, a) => e.has(t) || de("Cannot " + a);
|
|
7
|
-
var d = (t, e, a) => (K(t, e, "read from private field"), a ? a.call(t) : e.get(t)),
|
|
7
|
+
var d = (t, e, a) => (K(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (K(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (K(t, e, "access private method"), a);
|
|
8
8
|
import { parseUserId as Y, codeSchema as ze, connectionSchema as Re, loginSchema as Ke, promptSettingSchema as Ue } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var V = class extends Error {
|
|
@@ -133,8 +133,8 @@ function T(t, e, a, r) {
|
|
|
133
133
|
else {
|
|
134
134
|
const { ref: m } = t.dynamic;
|
|
135
135
|
e = e.where(
|
|
136
|
-
(
|
|
137
|
-
r.map((x) =>
|
|
136
|
+
(w) => w.or(
|
|
137
|
+
r.map((x) => w(m(x), "like", `%${s}%`))
|
|
138
138
|
)
|
|
139
139
|
);
|
|
140
140
|
}
|
|
@@ -155,7 +155,7 @@ function Ve(t) {
|
|
|
155
155
|
r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
|
|
156
156
|
}
|
|
157
157
|
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], l = n.map((m) => {
|
|
158
|
-
const
|
|
158
|
+
const w = c.filter(
|
|
159
159
|
(x) => x.linked_to === m.user_id
|
|
160
160
|
);
|
|
161
161
|
return _({
|
|
@@ -171,7 +171,7 @@ function Ve(t) {
|
|
|
171
171
|
user_id: Y(m.user_id).id,
|
|
172
172
|
isSocial: !!m.is_social
|
|
173
173
|
},
|
|
174
|
-
...
|
|
174
|
+
...w.map(fe)
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
177
|
}), { count: g } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -376,7 +376,7 @@ function lt(t) {
|
|
|
376
376
|
}
|
|
377
377
|
function dt(t) {
|
|
378
378
|
return async (e, a) => {
|
|
379
|
-
const r = await t.selectFrom("
|
|
379
|
+
const r = await t.selectFrom("sessions_2").where("sessions_2.tenant_id", "=", e).where("sessions_2.id", "=", a).where("sessions_2.revoked_at", "is", null).selectAll().executeTakeFirst();
|
|
380
380
|
if (!r)
|
|
381
381
|
return null;
|
|
382
382
|
const { tenant_id: o, device: n, clients: s, ...c } = r;
|
|
@@ -396,7 +396,7 @@ function ut(t) {
|
|
|
396
396
|
authenticated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
397
397
|
last_interaction_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
398
398
|
};
|
|
399
|
-
return await t.insertInto("
|
|
399
|
+
return await t.insertInto("sessions_2").values({
|
|
400
400
|
...r,
|
|
401
401
|
tenant_id: e,
|
|
402
402
|
device: JSON.stringify(a.device),
|
|
@@ -405,7 +405,7 @@ function ut(t) {
|
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
function mt(t) {
|
|
408
|
-
return async (e, a) => !!(await t.deleteFrom("
|
|
408
|
+
return async (e, a) => !!(await t.deleteFrom("sessions_2").where("tenant_id", "=", e).where("sessions_2.id", "=", a).execute()).length;
|
|
409
409
|
}
|
|
410
410
|
function ht(t) {
|
|
411
411
|
return async (e, a, r) => {
|
|
@@ -415,7 +415,7 @@ function ht(t) {
|
|
|
415
415
|
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
416
416
|
clients: r.clients ? JSON.stringify(r.clients) : void 0
|
|
417
417
|
};
|
|
418
|
-
return !!(await t.updateTable("
|
|
418
|
+
return !!(await t.updateTable("sessions_2").set(o).where("tenant_id", "=", e).where("sessions_2.id", "=", a).execute()).length;
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
421
|
function _t(t) {
|
|
@@ -424,7 +424,7 @@ function _t(t) {
|
|
|
424
424
|
per_page: 50,
|
|
425
425
|
include_totals: !1
|
|
426
426
|
}) => {
|
|
427
|
-
let r = t.selectFrom("
|
|
427
|
+
let r = t.selectFrom("sessions_2").where("sessions_2.tenant_id", "=", e);
|
|
428
428
|
a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
|
|
429
429
|
let o = r;
|
|
430
430
|
if (a.sort && a.sort.sort_by) {
|
|
@@ -476,16 +476,16 @@ function gt(t) {
|
|
|
476
476
|
}).execute(), r;
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function yt(t) {
|
|
480
480
|
return async (e, a) => (await t.updateTable("passwords").set({
|
|
481
481
|
password: a.password,
|
|
482
482
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
483
483
|
}).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function wt(t) {
|
|
486
486
|
return {
|
|
487
487
|
create: gt(t),
|
|
488
|
-
update:
|
|
488
|
+
update: yt(t),
|
|
489
489
|
get: pt(t)
|
|
490
490
|
};
|
|
491
491
|
}
|
|
@@ -811,7 +811,7 @@ function Vt(t) {
|
|
|
811
811
|
}
|
|
812
812
|
function qt(t) {
|
|
813
813
|
return async (e, a) => {
|
|
814
|
-
var s, c, l, g, m,
|
|
814
|
+
var s, c, l, g, m, w, x, Z, ee, te, ae, re, ne, oe, se, ie, ce, le;
|
|
815
815
|
const { colors: r, font: o, ...n } = a;
|
|
816
816
|
try {
|
|
817
817
|
await t.insertInto("branding").values({
|
|
@@ -819,7 +819,7 @@ function qt(t) {
|
|
|
819
819
|
colors_primary: r == null ? void 0 : r.primary,
|
|
820
820
|
colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
|
|
821
821
|
colors_page_background_start: (g = (l = a.colors) == null ? void 0 : l.page_background) == null ? void 0 : g.start,
|
|
822
|
-
colors_page_background_end: (
|
|
822
|
+
colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
|
|
823
823
|
colors_page_background_angle_dev: (Z = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : Z.angle_deg,
|
|
824
824
|
font_url: (ee = a.font) == null ? void 0 : ee.url,
|
|
825
825
|
tenant_id: e
|
|
@@ -854,11 +854,11 @@ function Gt(t) {
|
|
|
854
854
|
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
855
855
|
return {
|
|
856
856
|
hooks: n.map((l) => {
|
|
857
|
-
const { tenant_id: g, enabled: m, synchronous:
|
|
857
|
+
const { tenant_id: g, enabled: m, synchronous: w, ...x } = l;
|
|
858
858
|
return _({
|
|
859
859
|
...x,
|
|
860
860
|
enabled: !!m,
|
|
861
|
-
synchronous: !!
|
|
861
|
+
synchronous: !!w
|
|
862
862
|
});
|
|
863
863
|
}),
|
|
864
864
|
start: a.page * a.per_page,
|
|
@@ -1096,16 +1096,16 @@ function ga(t) {
|
|
|
1096
1096
|
}).execute();
|
|
1097
1097
|
};
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function ya(t) {
|
|
1100
1100
|
return {
|
|
1101
1101
|
get: fa(t),
|
|
1102
1102
|
create: ga(t),
|
|
1103
1103
|
update: pa(t)
|
|
1104
1104
|
};
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function wa(t) {
|
|
1107
1107
|
return async (e, a) => {
|
|
1108
|
-
const r = await t.selectFrom("
|
|
1108
|
+
const r = await t.selectFrom("refresh_tokens_2").where("refresh_tokens_2.tenant_id", "=", e).where("refresh_tokens_2.id", "=", a).selectAll().executeTakeFirst();
|
|
1109
1109
|
return r ? {
|
|
1110
1110
|
...r,
|
|
1111
1111
|
rotating: !!r.rotating,
|
|
@@ -1120,7 +1120,7 @@ function Na(t) {
|
|
|
1120
1120
|
...a,
|
|
1121
1121
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1122
1122
|
};
|
|
1123
|
-
return await t.insertInto("
|
|
1123
|
+
return await t.insertInto("refresh_tokens_2").values({
|
|
1124
1124
|
...r,
|
|
1125
1125
|
tenant_id: e,
|
|
1126
1126
|
rotating: a.rotating ? 1 : 0,
|
|
@@ -1130,7 +1130,7 @@ function Na(t) {
|
|
|
1130
1130
|
};
|
|
1131
1131
|
}
|
|
1132
1132
|
function va(t) {
|
|
1133
|
-
return async (e, a) => !!(await t.deleteFrom("
|
|
1133
|
+
return async (e, a) => !!(await t.deleteFrom("refresh_tokens_2").where("tenant_id", "=", e).where("refresh_tokens_2.id", "=", a).execute()).length;
|
|
1134
1134
|
}
|
|
1135
1135
|
function Ca(t) {
|
|
1136
1136
|
return async (e, a, r) => {
|
|
@@ -1140,7 +1140,7 @@ function Ca(t) {
|
|
|
1140
1140
|
resource_servers: r.resource_servers ? JSON.stringify(r.resource_servers) : void 0,
|
|
1141
1141
|
rotating: r.rotating ? 1 : 0
|
|
1142
1142
|
};
|
|
1143
|
-
return !!(await t.updateTable("
|
|
1143
|
+
return !!(await t.updateTable("refresh_tokens_2").set(o).where("tenant_id", "=", e).where("refresh_tokens_2.id", "=", a).execute()).length;
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
1146
|
function ba(t) {
|
|
@@ -1149,7 +1149,7 @@ function ba(t) {
|
|
|
1149
1149
|
per_page: 50,
|
|
1150
1150
|
include_totals: !1
|
|
1151
1151
|
}) => {
|
|
1152
|
-
let r = t.selectFrom("
|
|
1152
|
+
let r = t.selectFrom("refresh_tokens_2").where("refresh_tokens_2.tenant_id", "=", e);
|
|
1153
1153
|
a.q && (r = T(t, r, a.q, ["token", "session_id"]));
|
|
1154
1154
|
let o = r;
|
|
1155
1155
|
if (a.sort && a.sort.sort_by) {
|
|
@@ -1177,7 +1177,7 @@ function ba(t) {
|
|
|
1177
1177
|
function xa(t) {
|
|
1178
1178
|
return {
|
|
1179
1179
|
create: Na(t),
|
|
1180
|
-
get:
|
|
1180
|
+
get: wa(t),
|
|
1181
1181
|
list: ba(t),
|
|
1182
1182
|
remove: va(t),
|
|
1183
1183
|
update: Ca(t)
|
|
@@ -1248,7 +1248,7 @@ var R;
|
|
|
1248
1248
|
class Oa {
|
|
1249
1249
|
constructor() {
|
|
1250
1250
|
j(this, "nodeStack", []);
|
|
1251
|
-
|
|
1251
|
+
y(this, R, p({
|
|
1252
1252
|
AliasNode: this.transformAlias.bind(this),
|
|
1253
1253
|
ColumnNode: this.transformColumn.bind(this),
|
|
1254
1254
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -2098,23 +2098,23 @@ const ka = p({
|
|
|
2098
2098
|
UpdateQueryNode: !0,
|
|
2099
2099
|
MergeQueryNode: !0
|
|
2100
2100
|
});
|
|
2101
|
-
var P, S, O, f, ge,
|
|
2101
|
+
var P, S, O, f, ge, ye, we, $, W, Ne;
|
|
2102
2102
|
class $a extends Oa {
|
|
2103
2103
|
constructor(a) {
|
|
2104
2104
|
super();
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2105
|
+
y(this, f);
|
|
2106
|
+
y(this, P);
|
|
2107
|
+
y(this, S, /* @__PURE__ */ new Set());
|
|
2108
|
+
y(this, O, /* @__PURE__ */ new Set());
|
|
2109
2109
|
M(this, P, a);
|
|
2110
2110
|
}
|
|
2111
2111
|
transformNodeImpl(a) {
|
|
2112
2112
|
if (!u(this, f, ge).call(this, a))
|
|
2113
2113
|
return super.transformNodeImpl(a);
|
|
2114
|
-
const r = u(this, f,
|
|
2114
|
+
const r = u(this, f, we).call(this, a);
|
|
2115
2115
|
for (const s of r)
|
|
2116
2116
|
d(this, O).add(s);
|
|
2117
|
-
const o = u(this, f,
|
|
2117
|
+
const o = u(this, f, ye).call(this, a);
|
|
2118
2118
|
for (const s of o)
|
|
2119
2119
|
d(this, S).add(s);
|
|
2120
2120
|
const n = super.transformNodeImpl(a);
|
|
@@ -2141,7 +2141,7 @@ class $a extends Oa {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
P = new WeakMap(), S = new WeakMap(), O = new WeakMap(), f = new WeakSet(), ge = function(a) {
|
|
2143
2143
|
return a.kind in ka;
|
|
2144
|
-
},
|
|
2144
|
+
}, ye = function(a) {
|
|
2145
2145
|
const r = /* @__PURE__ */ new Set();
|
|
2146
2146
|
if ("name" in a && a.name && q.is(a.name) && u(this, f, W).call(this, a.name, r), "from" in a && a.from)
|
|
2147
2147
|
for (const o of a.from.froms)
|
|
@@ -2150,7 +2150,7 @@ P = new WeakMap(), S = new WeakMap(), O = new WeakMap(), f = new WeakSet(), ge =
|
|
|
2150
2150
|
for (const o of a.joins)
|
|
2151
2151
|
u(this, f, $).call(this, o.table, r);
|
|
2152
2152
|
return "using" in a && a.using && u(this, f, $).call(this, a.using, r), r;
|
|
2153
|
-
},
|
|
2153
|
+
}, we = function(a) {
|
|
2154
2154
|
const r = /* @__PURE__ */ new Set();
|
|
2155
2155
|
return "with" in a && a.with && u(this, f, Ne).call(this, a.with, r), r;
|
|
2156
2156
|
}, $ = function(a, r) {
|
|
@@ -2168,7 +2168,7 @@ P = new WeakMap(), S = new WeakMap(), O = new WeakMap(), f = new WeakSet(), ge =
|
|
|
2168
2168
|
var L;
|
|
2169
2169
|
class Da {
|
|
2170
2170
|
constructor(e) {
|
|
2171
|
-
|
|
2171
|
+
y(this, L);
|
|
2172
2172
|
M(this, L, new $a(e));
|
|
2173
2173
|
}
|
|
2174
2174
|
transformQuery(e) {
|
|
@@ -2191,8 +2191,8 @@ const Pa = "kysely_migration", _e = "kysely_migration_lock", ja = !1, B = "migra
|
|
|
2191
2191
|
var h, i, A, N, v, D, Ce, C, be, xe, Te, Se, Oe, G, I, H, ke, $e, De, X, Ie, Pe, je, Me, Ae, F;
|
|
2192
2192
|
class ve {
|
|
2193
2193
|
constructor(e) {
|
|
2194
|
-
|
|
2195
|
-
|
|
2194
|
+
y(this, i);
|
|
2195
|
+
y(this, h);
|
|
2196
2196
|
M(this, h, p(e));
|
|
2197
2197
|
}
|
|
2198
2198
|
/**
|
|
@@ -2503,7 +2503,7 @@ var E;
|
|
|
2503
2503
|
class Q extends Error {
|
|
2504
2504
|
constructor(a) {
|
|
2505
2505
|
super();
|
|
2506
|
-
|
|
2506
|
+
y(this, E);
|
|
2507
2507
|
M(this, E, a);
|
|
2508
2508
|
}
|
|
2509
2509
|
get resultSet() {
|
|
@@ -2643,17 +2643,13 @@ const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2643
2643
|
up: qa
|
|
2644
2644
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2645
2645
|
async function Ha(t) {
|
|
2646
|
-
await t.schema.createTable("sessions").addColumn("
|
|
2647
|
-
"client_id",
|
|
2648
|
-
"varchar(255)",
|
|
2649
|
-
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2650
|
-
).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
2646
|
+
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
2651
2647
|
"user_id_constraint",
|
|
2652
2648
|
["user_id", "tenant_id"],
|
|
2653
2649
|
"users",
|
|
2654
2650
|
["user_id", "tenant_id"],
|
|
2655
2651
|
(e) => e.onDelete("cascade")
|
|
2656
|
-
).addColumn("created_at", "varchar(
|
|
2652
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("authenticated_at", "varchar(35)").addColumn("last_interaction_at", "varchar(35)").addColumn("used_at", "varchar(35)").addColumn("revoked_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("clients", "varchar(1024)", (e) => e.notNull()).execute(), await t.schema.createTable("tickets").addColumn(
|
|
2657
2653
|
"tenant_id",
|
|
2658
2654
|
"varchar(255)",
|
|
2659
2655
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
@@ -2757,12 +2753,12 @@ const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2757
2753
|
async function gr(t) {
|
|
2758
2754
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
2759
2755
|
}
|
|
2760
|
-
async function
|
|
2756
|
+
async function yr(t) {
|
|
2761
2757
|
await t.schema.dropIndex("users_email_index").execute();
|
|
2762
2758
|
}
|
|
2763
|
-
const
|
|
2759
|
+
const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2764
2760
|
__proto__: null,
|
|
2765
|
-
down:
|
|
2761
|
+
down: yr,
|
|
2766
2762
|
up: gr
|
|
2767
2763
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2768
2764
|
async function Nr(t) {
|
|
@@ -2949,20 +2945,20 @@ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2949
2945
|
down: pn,
|
|
2950
2946
|
up: fn
|
|
2951
2947
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2952
|
-
async function
|
|
2948
|
+
async function yn(t) {
|
|
2953
2949
|
await t.schema.createTable("branding").addColumn(
|
|
2954
2950
|
"tenant_id",
|
|
2955
2951
|
"varchar(255)",
|
|
2956
2952
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
2957
2953
|
).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();
|
|
2958
2954
|
}
|
|
2959
|
-
async function
|
|
2955
|
+
async function wn(t) {
|
|
2960
2956
|
await t.schema.dropTable("branding").execute();
|
|
2961
2957
|
}
|
|
2962
2958
|
const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2963
2959
|
__proto__: null,
|
|
2964
|
-
down:
|
|
2965
|
-
up:
|
|
2960
|
+
down: wn,
|
|
2961
|
+
up: yn
|
|
2966
2962
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2967
2963
|
async function vn(t) {
|
|
2968
2964
|
}
|
|
@@ -3162,19 +3158,19 @@ async function po(t) {
|
|
|
3162
3158
|
}
|
|
3163
3159
|
async function go(t) {
|
|
3164
3160
|
}
|
|
3165
|
-
const
|
|
3161
|
+
const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3166
3162
|
__proto__: null,
|
|
3167
3163
|
down: go,
|
|
3168
3164
|
up: po
|
|
3169
3165
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3170
|
-
async function
|
|
3166
|
+
async function wo(t) {
|
|
3171
3167
|
}
|
|
3172
3168
|
async function No(t) {
|
|
3173
3169
|
}
|
|
3174
3170
|
const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3175
3171
|
__proto__: null,
|
|
3176
3172
|
down: No,
|
|
3177
|
-
up:
|
|
3173
|
+
up: wo
|
|
3178
3174
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3179
3175
|
async function Co(t) {
|
|
3180
3176
|
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
@@ -3407,12 +3403,12 @@ async function ps(t) {
|
|
|
3407
3403
|
async function gs(t) {
|
|
3408
3404
|
await t.schema.dropTable("email_providers").execute();
|
|
3409
3405
|
}
|
|
3410
|
-
const
|
|
3406
|
+
const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3411
3407
|
__proto__: null,
|
|
3412
3408
|
down: gs,
|
|
3413
3409
|
up: ps
|
|
3414
3410
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3415
|
-
async function
|
|
3411
|
+
async function ws(t) {
|
|
3416
3412
|
await t.schema.dropTable("tickets").execute();
|
|
3417
3413
|
}
|
|
3418
3414
|
async function Ns(t) {
|
|
@@ -3429,7 +3425,7 @@ async function Ns(t) {
|
|
|
3429
3425
|
const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3430
3426
|
__proto__: null,
|
|
3431
3427
|
down: Ns,
|
|
3432
|
-
up:
|
|
3428
|
+
up: ws
|
|
3433
3429
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3434
3430
|
async function Cs(t) {
|
|
3435
3431
|
}
|
|
@@ -3442,19 +3438,17 @@ const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3442
3438
|
up: Cs
|
|
3443
3439
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3444
3440
|
async function Ts(t) {
|
|
3445
|
-
await t.schema.createTable("refresh_tokens").addColumn(
|
|
3446
|
-
"
|
|
3447
|
-
"varchar(
|
|
3448
|
-
(e) => e.references("
|
|
3449
|
-
).addColumn("
|
|
3450
|
-
"
|
|
3451
|
-
"
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
"
|
|
3455
|
-
|
|
3456
|
-
(e) => e.notNull().defaultTo((/* @__PURE__ */ new Date()).toISOString())
|
|
3457
|
-
).addPrimaryKeyConstraint("refresh_tokens_pkey", ["tenant_id", "token"]).execute();
|
|
3441
|
+
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3442
|
+
"client_id",
|
|
3443
|
+
"varchar(21)",
|
|
3444
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3445
|
+
).addColumn("tenant_id", "varchar(255)").addColumn("session_id", "varchar(21)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3446
|
+
"user_id_constraint",
|
|
3447
|
+
["user_id", "tenant_id"],
|
|
3448
|
+
"users",
|
|
3449
|
+
["user_id", "tenant_id"],
|
|
3450
|
+
(e) => e.onDelete("cascade")
|
|
3451
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3458
3452
|
}
|
|
3459
3453
|
async function Ss(t) {
|
|
3460
3454
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
@@ -3465,10 +3459,8 @@ const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3465
3459
|
up: Ts
|
|
3466
3460
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3467
3461
|
async function ks(t) {
|
|
3468
|
-
await t.schema.alterTable("sessions").addColumn("id", "varchar(21)").execute(), await t.schema.alterTable("sessions").addColumn("idle_expires_at", "varchar(35)").execute(), await t.schema.alterTable("sessions").addColumn("updated_at", "varchar(35)").execute(), await t.schema.alterTable("sessions").addColumn("authenticated_at", "varchar(35)").execute(), await t.schema.alterTable("sessions").addColumn("revoked_at", "varchar(35)").execute(), await t.schema.alterTable("sessions").addColumn("last_interaction_at", "varchar(35)").execute(), await t.schema.alterTable("sessions").addColumn("device", "varchar(2048)").execute(), await t.schema.alterTable("sessions").addColumn("clients", "varchar(1024)").execute(), await t.schema.alterTable("sessions").dropColumn("expires_at").execute(), await t.schema.alterTable("sessions").addColumn("expires_at", "varchar(35)").execute();
|
|
3469
3462
|
}
|
|
3470
3463
|
async function $s(t) {
|
|
3471
|
-
await t.schema.alterTable("sessions").dropColumn("id").dropColumn("idle_expires_at").dropColumn("updated_at").dropColumn("revoked_at").dropColumn("authenticated_at").dropColumn("last_interaction_at").dropColumn("device").dropColumn("clients").execute();
|
|
3472
3464
|
}
|
|
3473
3465
|
const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3474
3466
|
__proto__: null,
|
|
@@ -3476,13 +3468,13 @@ const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3476
3468
|
up: ks
|
|
3477
3469
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3478
3470
|
async function Is(t) {
|
|
3479
|
-
await t.schema.
|
|
3471
|
+
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3480
3472
|
"user_id_constraint",
|
|
3481
3473
|
["user_id", "tenant_id"],
|
|
3482
3474
|
"users",
|
|
3483
3475
|
["user_id", "tenant_id"],
|
|
3484
3476
|
(e) => e.onDelete("cascade")
|
|
3485
|
-
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("authenticated_at", "varchar(35)").addColumn("last_interaction_at", "varchar(35)").addColumn("used_at", "varchar(35)").addColumn("revoked_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("clients", "varchar(1024)", (e) => e.notNull()).execute(), await t.schema.createTable("
|
|
3477
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("authenticated_at", "varchar(35)").addColumn("last_interaction_at", "varchar(35)").addColumn("used_at", "varchar(35)").addColumn("revoked_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("clients", "varchar(1024)", (e) => e.notNull()).execute(), await t.schema.createTable("refresh_tokens_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3486
3478
|
"client_id",
|
|
3487
3479
|
"varchar(21)",
|
|
3488
3480
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
@@ -3492,10 +3484,10 @@ async function Is(t) {
|
|
|
3492
3484
|
"users",
|
|
3493
3485
|
["user_id", "tenant_id"],
|
|
3494
3486
|
(e) => e.onDelete("cascade")
|
|
3495
|
-
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("
|
|
3487
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3496
3488
|
}
|
|
3497
3489
|
async function Ps(t) {
|
|
3498
|
-
await t.schema.dropTable("
|
|
3490
|
+
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3499
3491
|
}
|
|
3500
3492
|
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3501
3493
|
__proto__: null,
|
|
@@ -3514,7 +3506,7 @@ const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3514
3506
|
n01_codesTable: dr,
|
|
3515
3507
|
n11_universalLoginSession: hr,
|
|
3516
3508
|
n12_userFields: pr,
|
|
3517
|
-
n13_userEmailIndex:
|
|
3509
|
+
n13_userEmailIndex: wr,
|
|
3518
3510
|
n14_profileDataField: Cr,
|
|
3519
3511
|
n15_userEmailIndex: Tr,
|
|
3520
3512
|
n16_userLocale: kr,
|
|
@@ -3549,7 +3541,7 @@ const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3549
3541
|
n45_hookProperties: co,
|
|
3550
3542
|
n46_loginAuth0Client: mo,
|
|
3551
3543
|
n47_loginAuth0Client: fo,
|
|
3552
|
-
n48_saml:
|
|
3544
|
+
n48_saml: yo,
|
|
3553
3545
|
n49_removeFields: vo,
|
|
3554
3546
|
n50_authParamsNonce: xo,
|
|
3555
3547
|
n51_connectionid: Oo,
|
|
@@ -3567,7 +3559,7 @@ const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3567
3559
|
n63_connection_cleanup: ls,
|
|
3568
3560
|
n64_act_as: ms,
|
|
3569
3561
|
n65_code_verifier: fs,
|
|
3570
|
-
n66_email_providers:
|
|
3562
|
+
n66_email_providers: ys,
|
|
3571
3563
|
n67_drop_tickets: vs,
|
|
3572
3564
|
n68_login_useragents: xs,
|
|
3573
3565
|
n70_refresh_tokens: Os,
|
|
@@ -3605,13 +3597,13 @@ function zs(t) {
|
|
|
3605
3597
|
clients: Et(t),
|
|
3606
3598
|
codes: Tt(t),
|
|
3607
3599
|
connections: Lt(t),
|
|
3608
|
-
emailProviders:
|
|
3600
|
+
emailProviders: ya(t),
|
|
3609
3601
|
domains: Qt(t),
|
|
3610
3602
|
hooks: ea(t),
|
|
3611
3603
|
keys: Kt(t),
|
|
3612
3604
|
logins: ua(t),
|
|
3613
3605
|
logs: lt(t),
|
|
3614
|
-
passwords:
|
|
3606
|
+
passwords: wt(t),
|
|
3615
3607
|
promptSettings: _a(t),
|
|
3616
3608
|
refreshTokens: xa(t),
|
|
3617
3609
|
sessions: ft(t),
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/markusahlstrand/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "8.
|
|
14
|
+
"version": "8.2.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"kysely-planetscale": "^1.5.0",
|
|
38
38
|
"typescript": "^5.6.3",
|
|
39
39
|
"vite": "^5.4.11",
|
|
40
|
-
"vitest": "^2.1.5"
|
|
40
|
+
"vitest": "^2.1.5",
|
|
41
|
+
"@authhero/adapter-interfaces": "0.45.0"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"kysely": "^0.27.4",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"hono": "^4.6.8",
|
|
49
50
|
"kysely-bun-sqlite": "^0.3.2",
|
|
50
51
|
"kysely-planetscale": "^1.5.0",
|
|
51
|
-
"@authhero/adapter-interfaces": "0.
|
|
52
|
+
"@authhero/adapter-interfaces": "0.45.0"
|
|
52
53
|
},
|
|
53
54
|
"scripts": {
|
|
54
55
|
"build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
|