@boopkit/cap-users 0.3.1 → 0.4.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/capability.json
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
"name": "users-and-accounts",
|
|
3
3
|
"description": "Users, identities, properties, and authentication via Prisma",
|
|
4
4
|
"type": "application",
|
|
5
|
-
"requires": [
|
|
5
|
+
"requires": [
|
|
6
|
+
"database",
|
|
7
|
+
"services",
|
|
8
|
+
"web"
|
|
9
|
+
],
|
|
6
10
|
"package": "@boopkit/cap-users",
|
|
7
|
-
"dependencies": [
|
|
11
|
+
"dependencies": [
|
|
12
|
+
"bcryptjs",
|
|
13
|
+
"cookie-parser"
|
|
14
|
+
],
|
|
8
15
|
"devDependencies": [],
|
|
9
16
|
"files": [
|
|
10
17
|
"prisma/schema/users.prisma",
|
|
@@ -20,19 +27,63 @@
|
|
|
20
27
|
"styles/auth.css",
|
|
21
28
|
"reference/user-auth.ref.md"
|
|
22
29
|
],
|
|
23
|
-
"skills": [
|
|
30
|
+
"skills": [
|
|
31
|
+
"boop-users-user-data-modeling"
|
|
32
|
+
],
|
|
24
33
|
"hooks": [
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
|
|
34
|
+
{
|
|
35
|
+
"phase": "imports",
|
|
36
|
+
"code": "import cookieParser from 'cookie-parser';",
|
|
37
|
+
"description": "cookie parsing for session tokens"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"phase": "imports",
|
|
41
|
+
"code": "import { ensureVisitor, addAuthContext, authRoutes } from './middleware/auth';",
|
|
42
|
+
"description": "auth middleware and routes — session resolution, trust context, signup/login/logout"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"phase": "imports",
|
|
46
|
+
"code": "import AccountService from './services/accounts.service';",
|
|
47
|
+
"description": "account service wiring"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"phase": "preRoutes",
|
|
51
|
+
"order": 14,
|
|
52
|
+
"code": "app.use(cookieParser());",
|
|
53
|
+
"description": "parse cookies (required for auth session resolution)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"phase": "preRoutes",
|
|
57
|
+
"order": 15,
|
|
58
|
+
"code": "app.use(ensureVisitor);",
|
|
59
|
+
"description": "resolve visitor identity from auth_id cookie"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"phase": "preRoutes",
|
|
63
|
+
"order": 16,
|
|
64
|
+
"code": "app.use(addAuthContext);",
|
|
65
|
+
"description": "populate res.locals.auth for view templates"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"phase": "preRoutes",
|
|
69
|
+
"order": 52,
|
|
70
|
+
"code": "app.use(authRoutes);",
|
|
71
|
+
"description": "mount auth routes (signup, login, logout)"
|
|
72
|
+
}
|
|
32
73
|
],
|
|
33
74
|
"env": [
|
|
34
|
-
{
|
|
35
|
-
|
|
75
|
+
{
|
|
76
|
+
"name": "SESSION_DURATION",
|
|
77
|
+
"description": "Session token lifetime in seconds (default: 7 days)",
|
|
78
|
+
"default": "604800",
|
|
79
|
+
"required": "runtime"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "INVITATION_TTL",
|
|
83
|
+
"description": "Team invitation expiry in milliseconds (default: 7 days)",
|
|
84
|
+
"default": "604800000",
|
|
85
|
+
"required": "runtime"
|
|
86
|
+
}
|
|
36
87
|
],
|
|
37
88
|
"postInstall": {
|
|
38
89
|
"steps": [
|
|
@@ -41,8 +92,19 @@
|
|
|
41
92
|
"Add {{> auth-nav}} to your main.hbs layout — inside <body> before your main content."
|
|
42
93
|
],
|
|
43
94
|
"setupChecks": [
|
|
44
|
-
{
|
|
45
|
-
|
|
95
|
+
{
|
|
96
|
+
"type": "prisma-migrate",
|
|
97
|
+
"label": "Run database migrations",
|
|
98
|
+
"hint": "npm run db:migrate -- --name add-${capabilityName}"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "prisma-generate",
|
|
102
|
+
"label": "Generate Prisma client",
|
|
103
|
+
"hint": "npm run db:generate"
|
|
104
|
+
}
|
|
46
105
|
]
|
|
106
|
+
},
|
|
107
|
+
"skill_migrations": {
|
|
108
|
+
"boop-users-user-data-modeling": "design.user-data-modeling.skill.md"
|
|
47
109
|
}
|
|
48
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boopkit/cap-users",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "User accounts, authentication, and session management via Prisma",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"build": "tsc -p tsconfig.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@boopkit/cap-services": "^0.
|
|
24
|
-
"@boopkit/logger": "^0.
|
|
23
|
+
"@boopkit/cap-services": "^0.4.0",
|
|
24
|
+
"@boopkit/logger": "^0.4.0",
|
|
25
25
|
"bcryptjs": "^2.4.3",
|
|
26
26
|
"winston": "^3.17.0"
|
|
27
27
|
},
|
package/skills/{design.user-data-modeling.skill.md → boop-users-user-data-modeling/SKILL.md}
RENAMED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boop-users-user-data-modeling
|
|
3
|
+
description: "When you need to add, store, or query a field related to users, identities, or accounts in a boop project, decide *where* the field belongs before writing the schema or service."
|
|
4
|
+
metadata:
|
|
5
|
+
category: design
|
|
6
|
+
---
|
|
1
7
|
# User Data Modeling
|
|
2
|
-
When you need to add, store, or query a field related to users, identities, or accounts in a boop project, decide *where* the field belongs before writing the schema or service.
|
|
3
8
|
|
|
4
9
|
## Goal
|
|
5
10
|
**`User.info` and `UserProperty` aren't "common vs. sparse" — they're "denormalized quick-access" vs. "named independent concerns."**
|