very-express 0.8.1 → 0.8.4
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/AGENTS.md +3 -1
- package/dist/index.js +638 -463
- package/dist/templates/_middlewares/Authentication.ts +49 -31
- package/dist/templates/_middlewares/UserContext.ts +54 -0
- package/dist/templates/_routes/LoginUI.ts +49 -0
- package/dist/templates/_services/MongooseRepositoryAdapter.ts +87 -8
- package/dist/templates/_services/TypeOrmRepositoryAdapter.ts +96 -13
- package/dist/templates/_services/oauth/OAuthProfileMap.ts +25 -6
- package/dist/templates/_types/auth.ts +15 -0
- package/dist/templates/_types/vex/VexRepository.ts +21 -0
- package/dist/templates/jsonSchema/User.json +8 -1
- package/dist/templates/root/public/js/deleteaccount.js +80 -0
- package/docs/architecture/authAndRouting.md +8 -1
- package/docs/architecture/databaseTargets.md +3 -2
- package/docs/features/accountDeletion.md +150 -0
- package/docs/features/auditFields.md +34 -17
- package/docs/features/dataIsolation.md +3 -2
- package/docs/releaseNote/v0-8-2.md +12 -0
- package/docs/superpowers/specs/2026-06-10-tsoa-to-tsed-migration-design.md +2 -2
- package/docs/superpowers/specs/2026-09-22-usercontext-audit-enforcement-design.md +561 -0
- package/docs/vexJsonSchema.md +11 -1
- package/package.json +1 -1
- package/vex.config.json +3 -1
- package/dist/templates/_middlewares/DataIsolationContext.ts +0 -37
package/AGENTS.md
CHANGED
|
@@ -64,6 +64,8 @@ Read from `vex.config.json → jsonSchemaDir` (this repo: `./output/jsonSchema`)
|
|
|
64
64
|
- **`src/` is ESM-style TypeScript with `~/*` → `src/*` aliasing.** Use `~/generators/...`, `~/utils/...`, `~/types/...` for intra-repo imports.
|
|
65
65
|
- **Only `one-to-one` and `many-to-one` are declared in `x-foreignKey`.** `one-to-many` is derived from the other side and must not be hand-written.
|
|
66
66
|
- **RBAC is opt-in.** `utils.generator.isRbacEnabled()` is the single gate for every RBAC code path. Absent `useRBAC`, or `roles: []`, means RBAC off — never "RBAC with zero roles". Never branch on `compilerOptions.useRBAC` directly.
|
|
67
|
+
- **Auth is the only identity gate.** `UserContext` is established by `Authentication.middleware` from the verified token — there is no separate context middleware, and no generated decorator decides it. Never gate identity on `dataIsolation`: audit fields and ownership filtering are independent features. Use `utils.generator.isAuthEnabled()` when a code path depends on auth being on.
|
|
68
|
+
- **A create that declares `onCreateUserId` with no identity in `UserContext` throws.** Both repository adapters enforce it; `onUpdateUserId` is deliberately not enforced. `dataIsolation` no longer has anything to do with whether the context exists.
|
|
67
69
|
- **Boolean config defaults use `??`, not `||`.** `x || true` swallows an explicit `false`.
|
|
68
70
|
|
|
69
71
|
## Conventions
|
|
@@ -108,7 +110,7 @@ This file covers only what every session needs. Deeper material lives in `docs/`
|
|
|
108
110
|
| [`docs/ForeignKey.md`](docs/ForeignKey.md) | FK joins via the API `join` parameter |
|
|
109
111
|
| [`docs/developmentNote.md`](docs/developmentNote.md) | Why no ts-node, esbuild/dist working dir, `FUNC{{ }}` intent |
|
|
110
112
|
| [`docs/CONTRIBUTING.md`](docs/CONTRIBUTING.md) | Setup, branch/PR workflow, PR checklist |
|
|
111
|
-
| [`docs/features/`](docs/features/) | rbac, dataIsolation, filterOperators, joinWhitelist, auditFields |
|
|
113
|
+
| [`docs/features/`](docs/features/) | rbac, dataIsolation, filterOperators, joinWhitelist, auditFields, accountDeletion |
|
|
112
114
|
| [`docs/appGenerated/auth.md`](docs/appGenerated/auth.md) | JWT rolling keys, OAuth2 providers |
|
|
113
115
|
| [`docs/roadMap/`](docs/roadMap/) | Released features and version milestones |
|
|
114
116
|
| [`docs/releaseNote/`](docs/releaseNote/) | Per-version release notes |
|