very-express 0.8.1 → 0.8.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.
- package/AGENTS.md +2 -0
- package/dist/index.js +361 -361
- package/dist/templates/_middlewares/Authentication.ts +2 -1
- package/dist/templates/_middlewares/UserContext.ts +54 -0
- package/dist/templates/_services/MongooseRepositoryAdapter.ts +20 -3
- package/dist/templates/_services/TypeOrmRepositoryAdapter.ts +26 -9
- package/docs/architecture/databaseTargets.md +3 -2
- package/docs/features/auditFields.md +52 -5
- 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/package.json +1 -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
|