@checkstack/auth-backend 0.0.2
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/CHANGELOG.md +142 -0
- package/drizzle/0000_minor_virginia_dare.sql +90 -0
- package/drizzle/0001_certain_madame_hydra.sql +20 -0
- package/drizzle/meta/0000_snapshot.json +580 -0
- package/drizzle/meta/0001_snapshot.json +717 -0
- package/drizzle/meta/_journal.json +20 -0
- package/drizzle.config.ts +7 -0
- package/package.json +34 -0
- package/src/hooks.ts +14 -0
- package/src/index.ts +878 -0
- package/src/meta-config.ts +13 -0
- package/src/platform-registration-config.ts +25 -0
- package/src/router.test.ts +440 -0
- package/src/router.ts +1051 -0
- package/src/schema.ts +173 -0
- package/src/utils/auth-error-redirect.ts +42 -0
- package/src/utils/user.test.ts +99 -0
- package/src/utils/user.ts +62 -0
- package/src/utils/validate-schema.test.ts +85 -0
- package/src/utils/validate-schema.ts +45 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "postgresql",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "7",
|
|
8
|
+
"when": 1767319088925,
|
|
9
|
+
"tag": "0000_minor_virginia_dare",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "7",
|
|
15
|
+
"when": 1767621359670,
|
|
16
|
+
"tag": "0001_certain_madame_hydra",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@checkstack/auth-backend",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"typecheck": "tsc --noEmit",
|
|
8
|
+
"generate": "drizzle-kit generate",
|
|
9
|
+
"lint": "bun run lint:code",
|
|
10
|
+
"lint:code": "eslint . --max-warnings 0",
|
|
11
|
+
"test": "bun test"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@checkstack/auth-common": "workspace:*",
|
|
15
|
+
"@checkstack/backend-api": "workspace:*",
|
|
16
|
+
"@checkstack/notification-common": "workspace:*",
|
|
17
|
+
"@checkstack/command-backend": "workspace:*",
|
|
18
|
+
"better-auth": "^1.4.7",
|
|
19
|
+
"drizzle-orm": "^0.45.1",
|
|
20
|
+
"hono": "^4.0.0",
|
|
21
|
+
"jose": "^6.1.3",
|
|
22
|
+
"zod": "^4.2.1",
|
|
23
|
+
"@checkstack/common": "workspace:*"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@checkstack/drizzle-helper": "workspace:*",
|
|
27
|
+
"@checkstack/scripts": "workspace:*",
|
|
28
|
+
"@checkstack/tsconfig": "workspace:*",
|
|
29
|
+
"@orpc/server": "^1.13.2",
|
|
30
|
+
"@types/node": "^20.0.0",
|
|
31
|
+
"drizzle-kit": "^0.31.8",
|
|
32
|
+
"typescript": "^5.0.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/hooks.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createHook } from "@checkstack/backend-api";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Auth hooks for cross-plugin communication
|
|
5
|
+
*/
|
|
6
|
+
export const authHooks = {
|
|
7
|
+
/**
|
|
8
|
+
* Emitted when a user is deleted.
|
|
9
|
+
* Plugins can subscribe (work-queue mode) to clean up related data.
|
|
10
|
+
*/
|
|
11
|
+
userDeleted: createHook<{
|
|
12
|
+
userId: string;
|
|
13
|
+
}>("auth.user.deleted"),
|
|
14
|
+
} as const;
|