@authhero/drizzle 1.16.0 → 1.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/drizzle-adapter.cjs +2 -2
- package/dist/drizzle-adapter.mjs +1366 -1191
- package/drizzle/0015_device_codes.sql +28 -0
- package/drizzle/0016_tenant_member_requests.sql +18 -0
- package/drizzle/meta/0015_snapshot.json +7409 -0
- package/drizzle/meta/0016_snapshot.json +7528 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +3 -3
- package/src/schema/sqlite/deviceCodes.ts +46 -0
- package/src/schema/sqlite/index.ts +3 -0
- package/src/schema/sqlite/tenantMemberRequests.ts +28 -0
|
@@ -106,6 +106,20 @@
|
|
|
106
106
|
"when": 1792998118057,
|
|
107
107
|
"tag": "0014_config_sync_mode",
|
|
108
108
|
"breakpoints": true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"idx": 15,
|
|
112
|
+
"version": "6",
|
|
113
|
+
"when": 1793097798972,
|
|
114
|
+
"tag": "0015_device_codes",
|
|
115
|
+
"breakpoints": true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"idx": 16,
|
|
119
|
+
"version": "6",
|
|
120
|
+
"when": 1793196589959,
|
|
121
|
+
"tag": "0016_tenant_member_requests",
|
|
122
|
+
"breakpoints": true
|
|
109
123
|
}
|
|
110
124
|
]
|
|
111
125
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/sesamyab/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.17.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"src/schema",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"drizzle-orm": "^0.45.2",
|
|
37
37
|
"nanoid": "^5.1.11",
|
|
38
|
-
"@authhero/adapter-interfaces": "4.
|
|
39
|
-
"@authhero/proxy": "0.11.
|
|
38
|
+
"@authhero/adapter-interfaces": "4.24.0",
|
|
39
|
+
"@authhero/proxy": "0.11.10"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@hono/zod-openapi": "^1.4.0",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sqliteTable,
|
|
3
|
+
text,
|
|
4
|
+
integer,
|
|
5
|
+
primaryKey,
|
|
6
|
+
uniqueIndex,
|
|
7
|
+
index,
|
|
8
|
+
} from "drizzle-orm/sqlite-core";
|
|
9
|
+
|
|
10
|
+
export const deviceCodes = sqliteTable(
|
|
11
|
+
"device_codes",
|
|
12
|
+
{
|
|
13
|
+
tenant_id: text("tenant_id").notNull(),
|
|
14
|
+
device_code_hash: text("device_code_hash").notNull(),
|
|
15
|
+
user_code_hash: text("user_code_hash").notNull(),
|
|
16
|
+
client_id: text("client_id").notNull(),
|
|
17
|
+
scope: text("scope"),
|
|
18
|
+
audience: text("audience"),
|
|
19
|
+
status: text("status").notNull(),
|
|
20
|
+
login_id: text("login_id"),
|
|
21
|
+
expires_at: text("expires_at").notNull(),
|
|
22
|
+
created_at: text("created_at").notNull(),
|
|
23
|
+
last_polled_at: text("last_polled_at"),
|
|
24
|
+
interval: integer("interval").notNull(),
|
|
25
|
+
version: integer("version").notNull(),
|
|
26
|
+
},
|
|
27
|
+
(t) => [
|
|
28
|
+
primaryKey({ columns: [t.tenant_id, t.device_code_hash] }),
|
|
29
|
+
uniqueIndex("device_codes_user_code_idx").on(t.tenant_id, t.user_code_hash),
|
|
30
|
+
index("device_codes_expiry_idx").on(t.expires_at),
|
|
31
|
+
],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const deviceFlowLimits = sqliteTable(
|
|
35
|
+
"device_flow_limits",
|
|
36
|
+
{
|
|
37
|
+
tenant_id: text("tenant_id").notNull(),
|
|
38
|
+
key: text("key").notNull(),
|
|
39
|
+
attempts: integer("attempts").notNull(),
|
|
40
|
+
expires_at: text("expires_at").notNull(),
|
|
41
|
+
},
|
|
42
|
+
(t) => [
|
|
43
|
+
primaryKey({ columns: [t.tenant_id, t.key] }),
|
|
44
|
+
index("device_flow_limits_expiry_idx").on(t.expires_at),
|
|
45
|
+
],
|
|
46
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sqliteTable, text, primaryKey, index } from "drizzle-orm/sqlite-core";
|
|
2
|
+
|
|
3
|
+
export const tenantMemberRequests = sqliteTable(
|
|
4
|
+
"tenant_member_requests",
|
|
5
|
+
{
|
|
6
|
+
tenant_id: text("tenant_id").notNull(),
|
|
7
|
+
id: text("id").notNull(),
|
|
8
|
+
kind: text("kind").notNull(),
|
|
9
|
+
status: text("status").notNull(),
|
|
10
|
+
requested_by: text("requested_by").notNull(),
|
|
11
|
+
payload: text("payload").notNull(),
|
|
12
|
+
result: text("result"),
|
|
13
|
+
error: text("error"),
|
|
14
|
+
notified_at: text("notified_at"),
|
|
15
|
+
created_at: text("created_at").notNull(),
|
|
16
|
+
updated_at: text("updated_at").notNull(),
|
|
17
|
+
finished_at: text("finished_at"),
|
|
18
|
+
},
|
|
19
|
+
(t) => [
|
|
20
|
+
primaryKey({ columns: [t.tenant_id, t.id] }),
|
|
21
|
+
index("tenant_member_requests_status_idx").on(
|
|
22
|
+
t.tenant_id,
|
|
23
|
+
t.status,
|
|
24
|
+
t.created_at,
|
|
25
|
+
),
|
|
26
|
+
index("tenant_member_requests_finished_idx").on(t.finished_at),
|
|
27
|
+
],
|
|
28
|
+
);
|