@invect/user-auth 0.0.1 → 0.0.3

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.
Files changed (38) hide show
  1. package/README.md +81 -72
  2. package/dist/backend/index.cjs +410 -54
  3. package/dist/backend/index.cjs.map +1 -1
  4. package/dist/backend/index.d.cts +456 -0
  5. package/dist/backend/index.d.cts.map +1 -0
  6. package/dist/backend/index.d.mts +456 -0
  7. package/dist/backend/index.d.mts.map +1 -0
  8. package/dist/backend/index.d.ts +28 -18
  9. package/dist/backend/index.d.ts.map +1 -1
  10. package/dist/backend/index.mjs +408 -53
  11. package/dist/backend/index.mjs.map +1 -1
  12. package/dist/backend/plugin.d.ts +15 -15
  13. package/dist/backend/plugin.d.ts.map +1 -1
  14. package/dist/backend/types.d.ts +85 -9
  15. package/dist/backend/types.d.ts.map +1 -1
  16. package/dist/frontend/components/ApiKeysDialog.d.ts +17 -0
  17. package/dist/frontend/components/ApiKeysDialog.d.ts.map +1 -0
  18. package/dist/frontend/components/AuthenticatedInvect.d.ts +10 -10
  19. package/dist/frontend/components/SignInForm.d.ts.map +1 -1
  20. package/dist/frontend/components/SignInPage.d.ts.map +1 -1
  21. package/dist/frontend/components/UserManagement.d.ts.map +1 -1
  22. package/dist/frontend/index.cjs +434 -58
  23. package/dist/frontend/index.cjs.map +1 -1
  24. package/dist/frontend/index.d.cts +317 -0
  25. package/dist/frontend/index.d.cts.map +1 -0
  26. package/dist/frontend/index.d.mts +317 -0
  27. package/dist/frontend/index.d.mts.map +1 -0
  28. package/dist/frontend/index.d.ts +3 -1
  29. package/dist/frontend/index.d.ts.map +1 -1
  30. package/dist/frontend/index.mjs +418 -43
  31. package/dist/frontend/index.mjs.map +1 -1
  32. package/dist/frontend/plugins/authFrontendPlugin.d.ts +2 -2
  33. package/dist/frontend/plugins/authFrontendPlugin.d.ts.map +1 -1
  34. package/dist/shared/types.d.cts +49 -0
  35. package/dist/shared/types.d.cts.map +1 -0
  36. package/dist/shared/types.d.mts +49 -0
  37. package/dist/shared/types.d.mts.map +1 -0
  38. package/package.json +68 -66
@@ -0,0 +1,49 @@
1
+ //#region src/shared/types.d.ts
2
+ /**
3
+ * @invect/user-auth — Shared Types
4
+ *
5
+ * Serializable types shared between backend and frontend.
6
+ * No runtime code, no React, no Node.js dependencies.
7
+ */
8
+ interface AuthSession {
9
+ user: AuthUser;
10
+ isAuthenticated: boolean;
11
+ }
12
+ interface AuthUser {
13
+ id: string;
14
+ name?: string;
15
+ email?: string;
16
+ image?: string;
17
+ role?: string;
18
+ }
19
+ interface SignInCredentials {
20
+ email: string;
21
+ password: string;
22
+ }
23
+ interface SignUpCredentials {
24
+ email: string;
25
+ password: string;
26
+ name?: string;
27
+ }
28
+ /**
29
+ * Input for creating a new user (admin-only action).
30
+ */
31
+ interface CreateUserInput {
32
+ email: string;
33
+ password: string;
34
+ name?: string;
35
+ role?: string;
36
+ }
37
+ /**
38
+ * Input for updating a user's role (admin-only action).
39
+ */
40
+ interface UpdateUserRoleInput {
41
+ role: string;
42
+ }
43
+ interface AuthError {
44
+ code: string;
45
+ message: string;
46
+ }
47
+ //#endregion
48
+ export { AuthError, AuthSession, AuthUser, CreateUserInput, SignInCredentials, SignUpCredentials, UpdateUserRoleInput };
49
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/shared/types.ts"],"mappings":";;AAWA;;;;;UAAiB,WAAA;EACf,IAAA,EAAM,QAAA;EACN,eAAA;AAAA;AAAA,UAGe,QAAA;EACf,EAAA;EACA,IAAA;EACA,KAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,UAOe,iBAAA;EACf,KAAA;EACA,QAAA;AAAA;AAAA,UAGe,iBAAA;EACf,KAAA;EACA,QAAA;EACA,IAAA;AAAA;AAHF;;;AAAA,UASiB,eAAA;EACf,KAAA;EACA,QAAA;EACA,IAAA;EACA,IAAA;AAAA;AAJF;;;AAAA,UAUiB,mBAAA;EACf,IAAA;AAAA;AAAA,UAGe,SAAA;EACf,IAAA;EACA,OAAA;AAAA"}
package/package.json CHANGED
@@ -1,38 +1,86 @@
1
1
  {
2
2
  "name": "@invect/user-auth",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Better Auth plugin for Invect — adds user authentication, session management, identity resolution, and auth UI components",
5
- "main": "dist/backend/index.cjs",
6
- "module": "dist/backend/index.mjs",
7
- "types": "dist/backend/index.d.ts",
8
- "type": "module",
9
- "files": [
10
- "dist/**/*"
11
- ],
12
5
  "keywords": [
13
- "invect",
14
- "better-auth",
6
+ "auth",
15
7
  "authentication",
8
+ "better-auth",
9
+ "invect",
16
10
  "plugin",
17
- "workflow",
18
- "auth"
11
+ "workflow"
19
12
  ],
20
- "author": "robase",
13
+ "homepage": "https://invect.dev",
14
+ "bugs": {
15
+ "url": "https://github.com/robase/invect/issues"
16
+ },
21
17
  "license": "MIT",
18
+ "author": "robase <team@invect.dev>",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/robase/invect.git",
22
+ "directory": "pkg/plugins/auth"
23
+ },
24
+ "files": [
25
+ "dist/**/*"
26
+ ],
27
+ "type": "module",
28
+ "main": "dist/backend/index.cjs",
29
+ "module": "dist/backend/index.mjs",
30
+ "types": "dist/backend/index.d.mts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/backend/index.d.mts",
34
+ "import": "./dist/backend/index.mjs",
35
+ "require": "./dist/backend/index.cjs"
36
+ },
37
+ "./ui": {
38
+ "types": "./dist/frontend/index.d.mts",
39
+ "import": "./dist/frontend/index.mjs",
40
+ "require": "./dist/frontend/index.cjs"
41
+ },
42
+ "./types": {
43
+ "types": "./dist/shared/types.d.mts",
44
+ "import": "./dist/shared/types.mjs",
45
+ "require": "./dist/shared/types.cjs"
46
+ }
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
22
51
  "dependencies": {
23
52
  "kysely": "^0.28.0",
24
- "@invect/core": "0.0.1"
53
+ "@invect/core": "0.0.3"
54
+ },
55
+ "devDependencies": {
56
+ "@tanstack/react-query": "^5.0.0",
57
+ "@types/better-sqlite3": "^7.6.13",
58
+ "@types/node": "^20.11.20",
59
+ "@types/react": "18.3.7",
60
+ "@types/react-dom": "18.3.7",
61
+ "better-auth": "^1.5.4",
62
+ "lucide-react": "^0.475.0",
63
+ "react": "^18.3.1",
64
+ "react-dom": "^18.3.1",
65
+ "tsdown": "^0.21.1",
66
+ "typescript": "^5.3.3",
67
+ "vitest": "^3.2.4",
68
+ "@invect/ui": "0.0.3"
25
69
  },
26
70
  "peerDependencies": {
71
+ "@better-auth/api-key": ">=1.0.0",
72
+ "@invect/ui": ">=0.0.3",
73
+ "@tanstack/react-query": ">=5.0.0",
27
74
  "better-auth": ">=1.0.0",
28
75
  "better-sqlite3": ">=9.0.0",
29
- "@invect/frontend": ">=2.0.0",
30
76
  "react": ">=18.0.0",
31
77
  "react-dom": ">=18.0.0",
32
- "react-router": ">=7.0.0",
33
- "@tanstack/react-query": ">=5.0.0"
78
+ "react-router": ">=7.0.0"
34
79
  },
35
80
  "peerDependenciesMeta": {
81
+ "@better-auth/api-key": {
82
+ "optional": true
83
+ },
36
84
  "better-auth": {
37
85
  "optional": false
38
86
  },
@@ -51,64 +99,18 @@
51
99
  "@tanstack/react-query": {
52
100
  "optional": true
53
101
  },
54
- "@invect/frontend": {
102
+ "@invect/ui": {
55
103
  "optional": true
56
104
  }
57
105
  },
58
- "devDependencies": {
59
- "@tanstack/react-query": "^5.0.0",
60
- "@types/better-sqlite3": "^7.6.13",
61
- "@types/node": "^20.11.20",
62
- "@types/react": "18.3.7",
63
- "@types/react-dom": "18.3.7",
64
- "better-auth": "^1.5.4",
65
- "lucide-react": "^0.475.0",
66
- "prettier": "^3.6.2",
67
- "react": "^18.3.1",
68
- "react-dom": "^18.3.1",
69
- "tsdown": "^0.21.1",
70
- "typescript": "^5.3.3",
71
- "vitest": "^1.2.2",
72
- "@invect/frontend": "0.0.1"
73
- },
74
- "exports": {
75
- ".": {
76
- "types": "./dist/backend/index.d.ts",
77
- "import": "./dist/backend/index.mjs",
78
- "require": "./dist/backend/index.cjs"
79
- },
80
- "./ui": {
81
- "types": "./dist/frontend/index.d.ts",
82
- "import": "./dist/frontend/index.mjs",
83
- "require": "./dist/frontend/index.cjs"
84
- },
85
- "./types": {
86
- "types": "./dist/shared/types.d.ts",
87
- "import": "./dist/shared/types.mjs",
88
- "require": "./dist/shared/types.cjs"
89
- }
90
- },
91
- "repository": {
92
- "type": "git",
93
- "url": "https://github.com/robase/invect.git",
94
- "directory": "pkg/plugins/auth"
95
- },
96
- "bugs": {
97
- "url": "https://github.com/robase/invect/issues"
98
- },
99
- "homepage": "https://invect.dev",
100
- "publishConfig": {
101
- "access": "public"
102
- },
103
106
  "scripts": {
104
107
  "build": "tsdown && tsc --emitDeclarationOnly --outDir dist",
105
108
  "build:w": "tsdown --watch",
106
109
  "dev": "tsdown --watch",
107
110
  "clean": "rm -rf dist",
108
- "format": "prettier --write \"src/**/*.{ts,tsx}\"",
111
+ "format": "oxfmt",
109
112
  "typecheck": "tsc --noEmit",
110
- "lint": "eslint src tests",
111
- "lint:fix": "eslint src --fix",
113
+ "lint": "oxlint --fix",
112
114
  "test": "vitest run",
113
115
  "test:unit": "vitest run tests/unit",
114
116
  "test:watch": "vitest --watch"