You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js >= 22.12 is now required (engines); CI workflows and Dockerfile moved from Node 20/18 to Node 22
Kept on hold: TypeScript 7 (ts-jest supports <7, @nestjs/swagger 12 peers ^5.5 || ^6), mongodb pinned to 7.5.0 (see 2.0.4)
Fixed (migration)
Replace deep imports removed by the NestJS 12 exports maps: HttpArgumentsHost and TypeOrmModuleOptions from package roots; EntityClassOrSchema now defined in @shared/common/types
TypeORM 1: find({ select }) uses the object form ({ id: true })
Jest: NestJS 12 / AutoMapper 9 / uuid / nodemailer are ESM-only — transpiled to CommonJS via jest.esm-packages.js + jest.esm-transformer.js (rewrites import.meta.url); not needed once Jest runs on Node >= 24.9
Middleware wildcard routes use the path-to-regexp 8 syntax (users/{*path}), removing LegacyRouteConverter warnings
@AutoMap(() => [String]) on roles so AutoMapper maps the array instead of skipping it
Security
PUT /users/user/:id and PATCH /users/archive/:id: users can only modify their own account (403 USER_NOT_ACCOUNT_OWNER otherwise)
PATCH /users/archive/:id and PATCH /users/unarchive/:id now require authentication (were reachable without a token)
Changed (typing)
noImplicitAny and strictNullChecks enabled (strictPropertyInitialization stays off: DTOs/entities are filled by class-transformer, TypeORM and AutoMapper)
No explicit any left (ESLint 109 warnings → 0); @types/jsonwebtoken, @types/compression, @types/serve-favicon added
JWT payloads typed and checked at runtime (isAuthTokenPayload / isResetPasswordTokenPayload); req.user._id is now a real ObjectId (was the JWT string), req.user is optional
Durations (TOKEN_EXPIRATION, RESET_PASSWORD_EXPIRATION) and MAILJET_VERSION typed and format-validated at startup
Config loaders use requiredEnv() (clear error naming the missing variable); services use configService.getOrThrow()
Repository lookups return D | null; array mappers return [] instead of undefined; base mapper placeholders throw instead of returning null
TestAppModule registers the production ValidationPipe so E2E tests exercise the same validation as the running app
Fixed (pre-existing)
Global ValidationPipe turned { id } route params into ObjectId → PUT /users/user/:id, PATCH /users/archive/:id (and every typed :id route) answered 500 in production; pipes now only validate classes that carry class-validator rules
Search returned 400 when orders was empty or absent, and rejected the 1/-1 directions its type allows
Unescaped user input in RegExp (isFieldUnique, findByField, search LIKE): ( caused a 500, . matched any character (e.g. john.doe@… reported as a duplicate of johnxdoe@…)
GET /products/search required a token: the middleware exclusion still carried the api/ prefix, which NestJS 12 now applies itself
NoSQL injection in search: key could be a Mongo operator ($where ran server-side JavaScript) and an EQUALSvalue could be an operator object ({ "$ne": null }, { "$regex": … }); key must now be a field path and value a string, number, boolean or null
Negative skip/take reached Mongo and answered 500: search rejects them with 400, /paginate falls back to the defaults
TOKEN_EXPIRATION / RESET_PASSWORD_EXPIRATION are checked at startup with the same grammar as ms (used by jsonwebtoken)
Optional take/skip query params were rejected with 400 "No data submitted" (empty-value check now limited to the body)
npm run build emitted nothing after prebuild wiped dist/ (stale root tsconfig.build.tsbuildinfo); build info now lives in dist/ and *.tsbuildinfo is git-ignored
node dist/main crashed with compression is not a function: default imports for compression and serve-favicon
Verified
Unit tests: 131/131
E2E tests: 102/102
npm run build emits the full dist/; node dist/main boots on Node 22.14 (Swagger /docs 200, routes + auth middleware OK)