@authhero/drizzle 0.15.0 → 0.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/package.json
CHANGED
|
@@ -15,14 +15,14 @@ export const sessions = sqliteTable(
|
|
|
15
15
|
.notNull()
|
|
16
16
|
.references(() => tenants.id, { onDelete: "cascade" }),
|
|
17
17
|
user_id: text("user_id", { length: 255 }),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
created_at_ts: integer("created_at_ts").notNull(),
|
|
19
|
+
updated_at_ts: integer("updated_at_ts").notNull(),
|
|
20
|
+
expires_at_ts: integer("expires_at_ts"),
|
|
21
|
+
idle_expires_at_ts: integer("idle_expires_at_ts"),
|
|
22
|
+
authenticated_at_ts: integer("authenticated_at_ts"),
|
|
23
|
+
last_interaction_at_ts: integer("last_interaction_at_ts"),
|
|
24
|
+
used_at_ts: integer("used_at_ts"),
|
|
25
|
+
revoked_at_ts: integer("revoked_at_ts"),
|
|
26
26
|
device: text("device").notNull(),
|
|
27
27
|
clients: text("clients").notNull(),
|
|
28
28
|
login_session_id: text("login_session_id", { length: 21 }),
|
|
@@ -31,7 +31,7 @@ export const sessions = sqliteTable(
|
|
|
31
31
|
primaryKey({ columns: [table.tenant_id, table.id], name: "sessions_pk" }),
|
|
32
32
|
index("IDX_sessions_login_session_id").on(table.login_session_id),
|
|
33
33
|
index("idx_sessions_user_id").on(table.tenant_id, table.user_id),
|
|
34
|
-
index("
|
|
34
|
+
index("idx_sessions_expires_at_ts").on(table.expires_at_ts),
|
|
35
35
|
],
|
|
36
36
|
);
|
|
37
37
|
|
|
@@ -48,10 +48,10 @@ export const refreshTokens = sqliteTable(
|
|
|
48
48
|
resource_servers: text("resource_servers").notNull(),
|
|
49
49
|
device: text("device").notNull(),
|
|
50
50
|
rotating: integer("rotating", { mode: "boolean" }).notNull(),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
created_at_ts: integer("created_at_ts").notNull(),
|
|
52
|
+
expires_at_ts: integer("expires_at_ts"),
|
|
53
|
+
idle_expires_at_ts: integer("idle_expires_at_ts"),
|
|
54
|
+
last_exchanged_at_ts: integer("last_exchanged_at_ts"),
|
|
55
55
|
},
|
|
56
56
|
(table) => [
|
|
57
57
|
primaryKey({
|
|
@@ -60,7 +60,7 @@ export const refreshTokens = sqliteTable(
|
|
|
60
60
|
}),
|
|
61
61
|
index("idx_refresh_tokens_user_id").on(table.tenant_id, table.user_id),
|
|
62
62
|
index("idx_refresh_tokens_session_id").on(table.session_id),
|
|
63
|
-
index("
|
|
63
|
+
index("idx_refresh_tokens_expires_at_ts").on(table.expires_at_ts),
|
|
64
64
|
],
|
|
65
65
|
);
|
|
66
66
|
|
|
@@ -96,9 +96,9 @@ export const loginSessions = sqliteTable(
|
|
|
96
96
|
authParams_act_as: text("authParams_act_as", { length: 256 }),
|
|
97
97
|
authParams_ui_locales: text("authParams_ui_locales", { length: 32 }),
|
|
98
98
|
authorization_url: text("authorization_url"),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
created_at_ts: integer("created_at_ts").notNull(),
|
|
100
|
+
updated_at_ts: integer("updated_at_ts").notNull(),
|
|
101
|
+
expires_at_ts: integer("expires_at_ts").notNull(),
|
|
102
102
|
ip: text("ip", { length: 39 }),
|
|
103
103
|
useragent: text("useragent"),
|
|
104
104
|
auth0Client: text("auth0Client", { length: 255 }),
|
|
@@ -114,9 +114,9 @@ export const loginSessions = sqliteTable(
|
|
|
114
114
|
}),
|
|
115
115
|
index("login_sessions_id_index").on(table.id),
|
|
116
116
|
index("login_sessions_state_idx").on(table.state),
|
|
117
|
-
index("login_sessions_state_updated_idx").on(table.state, table.
|
|
117
|
+
index("login_sessions_state_updated_idx").on(table.state, table.updated_at_ts),
|
|
118
118
|
index("login_sessions_tenant_user_idx").on(table.tenant_id, table.user_id),
|
|
119
|
-
index("
|
|
119
|
+
index("idx_login_sessions_expires_at_ts").on(table.expires_at_ts),
|
|
120
120
|
],
|
|
121
121
|
);
|
|
122
122
|
|
|
@@ -38,11 +38,17 @@ export const users = sqliteTable(
|
|
|
38
38
|
app_metadata: text("app_metadata", { length: 4096 })
|
|
39
39
|
.notNull()
|
|
40
40
|
.default("{}"),
|
|
41
|
-
user_metadata: text("user_metadata"
|
|
42
|
-
.notNull()
|
|
43
|
-
.default("{}"),
|
|
41
|
+
user_metadata: text("user_metadata").notNull().default("{}"),
|
|
44
42
|
profileData: text("profileData", { length: 2048 }),
|
|
45
43
|
locale: text("locale", { length: 255 }),
|
|
44
|
+
// Additional OIDC profile claims (OIDC Core 5.1)
|
|
45
|
+
middle_name: text("middle_name", { length: 100 }),
|
|
46
|
+
preferred_username: text("preferred_username", { length: 255 }), // Shorthand name user wishes to be referred to
|
|
47
|
+
profile: text("profile"), // URL of profile page
|
|
48
|
+
website: text("website"),
|
|
49
|
+
gender: text("gender", { length: 50 }),
|
|
50
|
+
birthdate: text("birthdate", { length: 10 }), // ISO 8601:2004 YYYY-MM-DD
|
|
51
|
+
zoneinfo: text("zoneinfo", { length: 100 }), // e.g., "Europe/Paris"
|
|
46
52
|
},
|
|
47
53
|
(table) => [
|
|
48
54
|
primaryKey({
|