@nathapp/nestjs-prisma 4.0.0 → 4.0.2
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/dist/prisma.module.js +8 -0
- package/dist/prisma.module.js.map +1 -1
- package/package.json +4 -4
- package/.eslintrc.js +0 -8
- package/.turbo/turbo-build.log +0 -4
- package/CHANGELOG.md +0 -314
- package/docs/20260215-fix-plan-prisma.md +0 -37
- package/docs/20260215-review-prisma.md +0 -598
- package/docs/20260216-plan-prisma-a-minus.md +0 -70
- package/lib/errors/prisma-error.mapper.ts +0 -164
- package/lib/filter/prisma-exception.filter.ts +0 -67
- package/lib/index.ts +0 -12
- package/lib/pagination/index.ts +0 -1
- package/lib/pagination/paginate.ts +0 -44
- package/lib/prisma.constants.ts +0 -40
- package/lib/prisma.decorator.ts +0 -8
- package/lib/prisma.health.ts +0 -40
- package/lib/prisma.interfaces.ts +0 -51
- package/lib/prisma.module.ts +0 -281
- package/lib/prisma.service.ts +0 -179
- package/lib/repository/abstract-prisma.repository.ts +0 -138
- package/lib/repository/index.ts +0 -1
- package/lib/testing/index.ts +0 -1
- package/lib/testing/prisma-testing.utils.ts +0 -29
- package/lib/transaction/index.ts +0 -2
- package/lib/transaction/prisma-transaction-manager.ts +0 -77
- package/lib/transaction/prisma-transaction.constants.ts +0 -29
- package/test/error-mapping.spec.ts +0 -231
- package/test/jest-nax.json +0 -27
- package/test/jest-test.json +0 -29
- package/test/lifecycle.spec.ts +0 -241
- package/test/multi-db-als.spec.ts +0 -142
- package/test/multi-db-transaction.spec.ts +0 -75
- package/test/pagination/paginate.spec.ts +0 -359
- package/test/prisma-exception-filter.spec.ts +0 -213
- package/test/prisma-transaction-manager.spec.ts +0 -285
- package/test/prisma.decorator.spec.ts +0 -257
- package/test/prisma.health.spec.ts +0 -226
- package/test/prisma.module.spec.ts +0 -506
- package/test/prisma.service.spec.ts +0 -359
- package/test/repository/abstract-prisma.repository.spec.ts +0 -157
- package/test/transaction-manager-e2e.spec.ts +0 -496
- package/test/transaction.spec.ts +0 -371
- package/test/transparent-transaction.spec.ts +0 -500
- package/tsconfig.json +0 -9
package/dist/prisma.module.js
CHANGED
|
@@ -88,6 +88,10 @@ let PrismaModule = PrismaModule_1 = class PrismaModule {
|
|
|
88
88
|
useFactory: () => new prisma_transaction_manager_1.PrismaTransactionManager(originalClient, capturedAls),
|
|
89
89
|
inject: [connectionToken],
|
|
90
90
|
});
|
|
91
|
+
if (!isDefaultConnection) {
|
|
92
|
+
new common_1.Logger(PrismaModule_1.name).warn(`Named Prisma connection "${name}" registers the PrismaTransactionManager class token. ` +
|
|
93
|
+
'In multi-database applications inject getPrismaTransactionManagerToken(name) to select a connection explicitly.');
|
|
94
|
+
}
|
|
91
95
|
providers.push({
|
|
92
96
|
provide: prisma_transaction_manager_1.PrismaTransactionManager,
|
|
93
97
|
useExisting: namedTxToken,
|
|
@@ -140,6 +144,10 @@ let PrismaModule = PrismaModule_1 = class PrismaModule {
|
|
|
140
144
|
return new prisma_transaction_manager_1.PrismaTransactionManager(ctx.originalClient, ctx.als);
|
|
141
145
|
},
|
|
142
146
|
});
|
|
147
|
+
if (!isDefaultConnection) {
|
|
148
|
+
new common_1.Logger(PrismaModule_1.name).warn(`Named Prisma connection "${name}" registers the PrismaTransactionManager class token. ` +
|
|
149
|
+
'In multi-database applications inject getPrismaTransactionManagerToken(name) to select a connection explicitly.');
|
|
150
|
+
}
|
|
143
151
|
providers.push({
|
|
144
152
|
provide: prisma_transaction_manager_1.PrismaTransactionManager,
|
|
145
153
|
useExisting: namedTxToken,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../lib/prisma.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../lib/prisma.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,6CAAgD;AAChD,sDAA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C,GAAG,CAAC,CAAC;wBAC9C,CAAC;wBACD,OAAO,OAAO,CAAC;oBACjB,CAAC;oBACD,MAAM,EAAE,CAAC,wCAAqB,CAAC;iBAChC;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAC;IACzG,CAAC;CAEF,CAAA;AAjPY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAiPxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-prisma",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "NestJS Prisma integration with multi-database support",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist/ .turbo/",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"types": "dist/index.d.ts",
|
|
20
20
|
"main": "dist/index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@nathapp/nestjs-common": "^4.0.
|
|
23
|
-
"@nathapp/nestjs-data": "^4.0.
|
|
22
|
+
"@nathapp/nestjs-common": "^4.0.2",
|
|
23
|
+
"@nathapp/nestjs-data": "^4.0.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@nathapp/eslint-config": "1.0.1",
|
|
27
27
|
"@nathapp/typescript-config": "1.0.1",
|
|
28
|
-
"@golevelup/ts-jest": "^0.
|
|
28
|
+
"@golevelup/ts-jest": "^3.0.0",
|
|
29
29
|
"eslint": "^8.57.0",
|
|
30
30
|
"typescript": "^5"
|
|
31
31
|
},
|
package/.eslintrc.js
DELETED
package/.turbo/turbo-build.log
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
# @nathapp/nestjs-prisma
|
|
2
|
-
|
|
3
|
-
## 4.0.0
|
|
4
|
-
|
|
5
|
-
### Major Changes
|
|
6
|
-
|
|
7
|
-
- 2319e9d: BREAKING: drop NestJS 8/9 peer ranges and require Node ^20.19.0 || >=22.12.0. Support NestJS 12. Peer ranges now cover NestJS 10, 11 and 12 (Node ^20.19.0 || >=22.12.0 is required because NestJS 12 is ESM-only). The configurable module builder no longer deep-imports a directory that is unresolvable on NestJS 12, and TwoFactorGuard / TwoFactorForceGuard redeclare their constructor DI metadata because NestJS 12 no longer inherits @Optional() from base classes.
|
|
8
|
-
|
|
9
|
-
Other consumer-facing changes:
|
|
10
|
-
|
|
11
|
-
- `@nathapp/nestjs-health`: `@nestjs/terminus` moved from `dependencies` to `peerDependencies` (`^11.0.0 || ^12.0.0`) so NestJS 12 apps can use terminus 12. Install `@nestjs/terminus` in your app.
|
|
12
|
-
- Optional-package loading (`loadPackage`) now throws a descriptive `Error` (original error on `cause`) instead of logging and calling `process.exit(1)` when an optional package is missing.
|
|
13
|
-
|
|
14
|
-
### Patch Changes
|
|
15
|
-
|
|
16
|
-
- Updated dependencies [668055b]
|
|
17
|
-
- Updated dependencies [2319e9d]
|
|
18
|
-
- @nathapp/nestjs-common@4.0.0
|
|
19
|
-
- @nathapp/nestjs-data@4.0.0
|
|
20
|
-
|
|
21
|
-
## 4.0.0-rc.0
|
|
22
|
-
|
|
23
|
-
### Major Changes
|
|
24
|
-
|
|
25
|
-
- c3aeb46: BREAKING: drop NestJS 8/9 peer ranges and require Node ^20.19.0 || >=22.12.0. Support NestJS 12. Peer ranges now cover NestJS 10, 11 and 12 (Node ^20.19.0 || >=22.12.0 is required because NestJS 12 is ESM-only). The configurable module builder no longer deep-imports a directory that is unresolvable on NestJS 12, and TwoFactorGuard / TwoFactorForceGuard redeclare their constructor DI metadata because NestJS 12 no longer inherits @Optional() from base classes.
|
|
26
|
-
|
|
27
|
-
Other consumer-facing changes:
|
|
28
|
-
|
|
29
|
-
- `@nathapp/nestjs-health`: `@nestjs/terminus` moved from `dependencies` to `peerDependencies` (`^11.0.0 || ^12.0.0`) so NestJS 12 apps can use terminus 12. Install `@nestjs/terminus` in your app.
|
|
30
|
-
- Optional-package loading (`loadPackage`) now throws a descriptive `Error` (original error on `cause`) instead of logging and calling `process.exit(1)` when an optional package is missing.
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
|
-
- Updated dependencies [c3aeb46]
|
|
35
|
-
- @nathapp/nestjs-common@4.0.0-rc.0
|
|
36
|
-
- @nathapp/nestjs-data@4.0.0-rc.0
|
|
37
|
-
|
|
38
|
-
## 3.3.0
|
|
39
|
-
|
|
40
|
-
### Patch Changes
|
|
41
|
-
|
|
42
|
-
- @nathapp/nestjs-common@3.3.0
|
|
43
|
-
- @nathapp/nestjs-data@3.3.0
|
|
44
|
-
|
|
45
|
-
## 3.2.2
|
|
46
|
-
|
|
47
|
-
### Patch Changes
|
|
48
|
-
|
|
49
|
-
- 73d5885: Comprehensive code review of the entire NestJS monorepo covering security, memory leaks, performance, and correctness bugs. All CRITICAL/HIGH/MEDIUM findings fixed; only LOW findings remain.
|
|
50
|
-
|
|
51
|
-
### Security Fixes
|
|
52
|
-
|
|
53
|
-
- **nestjs-typeorm**: `DatabaseErrorMapper` now strips raw DB error details (`originalError`, `dbCode`, `dbErrno`) from `AppException.args` — these are logged server-side instead of exposed in HTTP responses
|
|
54
|
-
- **nestjs-notification**: `EmailProvider` now extracts `err.message` instead of `JSON.stringify(err)` (which always returned `"{}"` for Error objects)
|
|
55
|
-
- **nestjs-common**: `createAsyncOptionsProvider` throws on invalid async options instead of silently returning a broken provider
|
|
56
|
-
- **nestjs-queue**: RabbitMQ provider logs and re-queues sanitized error messages (strips raw stack traces from DLQ metadata)
|
|
57
|
-
- **nestjs-storage**: OSS callback validates pub-key URL prefix before fetching (prevents SSRF)
|
|
58
|
-
|
|
59
|
-
### Memory Leak Fixes
|
|
60
|
-
|
|
61
|
-
- **nestjs-notification**: `UserTokenStore.addToken()` was pushing to a local array copy without calling `cache.set()` — tokens were lost immediately after being added
|
|
62
|
-
- **nestjs-cache**: Validated config warning uses NestJS `Logger` (not `console.warn`) for consistent log routing
|
|
63
|
-
- **nestjs-common**: `RequestIpSecurity` uses NestJS `Logger` instead of `console.warn`
|
|
64
|
-
- **nestjs-queue**: BullMQ/Kafka/RabbitMQ providers properly clean up workers, event listeners, and queues in `close()`
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
- **nestjs-queue**: Restored BullMQ branch in idempotency provider switch (was accidentally removed)
|
|
69
|
-
- **nestjs-queue**: RabbitMQ `resume()` remains warn-only — does not throw (interface contract)
|
|
70
|
-
- **nestjs-auth**: JWT refresh strategy passes `undefined` (not `{}`) as req when `passReqToCallback=false`
|
|
71
|
-
- **nestjs-microservices**: `canActivateGrpc` now calls `strategyProvider.validate()` and sets `request.user = principal` (not raw JWT payload)
|
|
72
|
-
- **nestjs-storage**: OSS callback signature verification stays on RSA-MD5 (Alibaba OSS protocol mandates MD5)
|
|
73
|
-
|
|
74
|
-
### Code Quality
|
|
75
|
-
|
|
76
|
-
- **nestjs-common**: `sanitizeHeader` strips non-word characters (spaces become empty) — documented in tests
|
|
77
|
-
- **nestjs-common**: `isValidLocaleCode` enforces strict `xx_XX` format (bare `en` is invalid)
|
|
78
|
-
- **nestjs-queue**: TypeScript union casts use `as unknown as T` pattern to avoid overlap errors
|
|
79
|
-
|
|
80
|
-
- Updated dependencies [73d5885]
|
|
81
|
-
- @nathapp/nestjs-common@3.2.3
|
|
82
|
-
|
|
83
|
-
## 3.2.1
|
|
84
|
-
|
|
85
|
-
### Patch Changes
|
|
86
|
-
|
|
87
|
-
- 0610b83: Fix Exception Bug on nestjs-common
|
|
88
|
-
- Updated dependencies [0610b83]
|
|
89
|
-
- @nathapp/nestjs-common@3.2.1
|
|
90
|
-
- @nathapp/nestjs-data@3.2.1
|
|
91
|
-
|
|
92
|
-
## 3.2.0
|
|
93
|
-
|
|
94
|
-
### Minor Changes
|
|
95
|
-
|
|
96
|
-
- 1876b9a: ### nestjs-auth
|
|
97
|
-
|
|
98
|
-
- Add JWKS support via `JwksJwtStrategyProvider` and `createJwksStrategyProvider` factory — enables remote key resolution through `jwks-rsa` (optional peer dep)
|
|
99
|
-
- Add `validateJwksOptions` security guard and `JwksOptions` interface
|
|
100
|
-
- Export `JwksJwtStrategyProvider` and `JwksOptions` from the public API
|
|
101
|
-
- Fix permission guard and JWT module immutability issues from code review
|
|
102
|
-
|
|
103
|
-
### nestjs-typeorm
|
|
104
|
-
|
|
105
|
-
- Add `AbstractTypeOrmRepository<TDomain, TEntity, TId>` — portable `IRepository` implementation decoupled from TypeORM internals
|
|
106
|
-
- Add `TYPEORM_TRANSACTION_ALS` DI token and publish it from `forRoot`/`forRootAsync`
|
|
107
|
-
- `forCustomRepository` now instantiates `AbstractTypeOrmRepository` subclasses with the correct per-DataSource tx manager token
|
|
108
|
-
- Add `getTypeOrmTransactionManagerToken(name?)` helper for multi-DataSource wiring
|
|
109
|
-
- Named DataSource tx tokens no longer collide; default DataSource still aliases the global `TRANSACTION_MANAGER` symbol
|
|
110
|
-
|
|
111
|
-
### nestjs-prisma
|
|
112
|
-
|
|
113
|
-
- Add `getPrismaTransactionManagerToken(name?)` helper for multi-DataSource wiring
|
|
114
|
-
- `forRoot` / `forRootAsync` register named tx manager token + default-only guard to prevent collision
|
|
115
|
-
|
|
116
|
-
### nestjs-data
|
|
117
|
-
|
|
118
|
-
- Add `IRepository<TDomain, TId>` portable repository contract
|
|
119
|
-
- Fix missing `@nathapp/nestjs-common` peer dep for turborepo build resolution
|
|
120
|
-
|
|
121
|
-
### nestjs-common
|
|
122
|
-
|
|
123
|
-
- Add `request-ip` utility for extracting client IP across Express and Fastify adapters
|
|
124
|
-
|
|
125
|
-
### nestjs-cache
|
|
126
|
-
|
|
127
|
-
- Fix cache interceptor, cache manager, and cache tag registry immutability and type issues
|
|
128
|
-
|
|
129
|
-
### nestjs-app
|
|
130
|
-
|
|
131
|
-
- Fix `nathapp.ts` and `app-factory.ts` code review findings (immutability, error handling)
|
|
132
|
-
|
|
133
|
-
### nestjs-queue
|
|
134
|
-
|
|
135
|
-
- Upgrade `uuid` dependency from `^9.0.0` to `^11.1.1` (security)
|
|
136
|
-
- Fix BullMQ health check to use `IRedisClient.info()` (aligned with BullMQ interface)
|
|
137
|
-
|
|
138
|
-
### nestjs-notification
|
|
139
|
-
|
|
140
|
-
- Upgrade `nodemailer` dev dep from `^7` to `^8` — resolves SMTP command injection CVEs (GHSA-c7w3-x93f-qmm8, GHSA-vvjj-xcjg-gr5g)
|
|
141
|
-
|
|
142
|
-
### nestjs-storage
|
|
143
|
-
|
|
144
|
-
- Fix code review findings (immutability, validation)
|
|
145
|
-
|
|
146
|
-
### nestjs-throttler
|
|
147
|
-
|
|
148
|
-
- Fix code review findings
|
|
149
|
-
|
|
150
|
-
### All packages
|
|
151
|
-
|
|
152
|
-
- Upgrade AJV to v8 (removes root override that broke `@fastify/ajv-compiler`)
|
|
153
|
-
- Align all package versions to 3.1.3 as baseline for this minor release
|
|
154
|
-
|
|
155
|
-
### Patch Changes
|
|
156
|
-
|
|
157
|
-
- Updated dependencies [1876b9a]
|
|
158
|
-
- @nathapp/nestjs-common@3.2.0
|
|
159
|
-
- @nathapp/nestjs-data@3.2.0
|
|
160
|
-
|
|
161
|
-
## 3.1.3
|
|
162
|
-
|
|
163
|
-
### Patch Changes
|
|
164
|
-
|
|
165
|
-
- a48beb2: transaction manager symbol bug fix
|
|
166
|
-
- Updated dependencies [a48beb2]
|
|
167
|
-
- @nathapp/nestjs-data@3.0.4
|
|
168
|
-
|
|
169
|
-
## 3.1.2
|
|
170
|
-
|
|
171
|
-
### Patch Changes
|
|
172
|
-
|
|
173
|
-
- cb97b64: fix typeorm and transactionManager issue
|
|
174
|
-
- Updated dependencies [cb97b64]
|
|
175
|
-
- @nathapp/nestjs-data@3.0.3
|
|
176
|
-
|
|
177
|
-
## 3.1.1
|
|
178
|
-
|
|
179
|
-
### Patch Changes
|
|
180
|
-
|
|
181
|
-
- a448f5b: add irepository and abstract repository
|
|
182
|
-
- Updated dependencies [a448f5b]
|
|
183
|
-
- @nathapp/nestjs-data@3.0.2
|
|
184
|
-
|
|
185
|
-
## 3.1.0
|
|
186
|
-
|
|
187
|
-
### Minor Changes
|
|
188
|
-
|
|
189
|
-
- feat: add transparent transaction support via `transaction: true` option
|
|
190
|
-
|
|
191
|
-
**nestjs-prisma:**
|
|
192
|
-
|
|
193
|
-
- `PrismaModule.forRoot({ transaction: true })` wraps the injected client in a transparent proxy
|
|
194
|
-
- Repos automatically use the transaction client inside `txManager.run()` — no code changes needed
|
|
195
|
-
- Provides `TRANSACTION_MANAGER` token from `@nathapp/nestjs-data`
|
|
196
|
-
- `PrismaTransactionManager` accepts optional shared AsyncLocalStorage for proxy integration
|
|
197
|
-
|
|
198
|
-
**nestjs-typeorm:**
|
|
199
|
-
|
|
200
|
-
- `TypeOrmExModule.forRoot({ transaction: true })` provides `TRANSACTION_MANAGER` token
|
|
201
|
-
- TypeORM repos use explicit injection pattern (`@Optional() @Inject(TRANSACTION_MANAGER)`)
|
|
202
|
-
- Transparent proxy not feasible for TypeORM (repos hold manager references at creation time)
|
|
203
|
-
- `TypeOrmTransactionManager` accepts optional shared AsyncLocalStorage
|
|
204
|
-
|
|
205
|
-
## 3.0.1
|
|
206
|
-
|
|
207
|
-
### Patch Changes
|
|
208
|
-
|
|
209
|
-
- Add ITransactionManager interface and ORM-specific implementations
|
|
210
|
-
|
|
211
|
-
- **nestjs-data**: New package with `ITransactionManager` interface and `TRANSACTION_MANAGER` DI token for ORM-agnostic transaction management via AsyncLocalStorage
|
|
212
|
-
- **nestjs-prisma**: Add `PrismaTransactionManager` implementing `ITransactionManager` with Prisma interactive transactions
|
|
213
|
-
- **nestjs-typeorm**: Add `TypeOrmTransactionManager` implementing `ITransactionManager` with TypeORM QueryRunner transactions
|
|
214
|
-
|
|
215
|
-
- Updated dependencies
|
|
216
|
-
- @nathapp/nestjs-data@3.0.1
|
|
217
|
-
|
|
218
|
-
## 3.0.0
|
|
219
|
-
|
|
220
|
-
### Major Changes
|
|
221
|
-
|
|
222
|
-
- 86a36b8: # 🚀 v3.0.0 Monorepo Enterprise Upgrade
|
|
223
|
-
|
|
224
|
-
This release brings significant security hardening, strict typing, improved observability, and comprehensive documentation across the entire Nathapp NestJS ecosystem.
|
|
225
|
-
|
|
226
|
-
## ⚠️ Breaking Changes
|
|
227
|
-
|
|
228
|
-
### nestjs-common
|
|
229
|
-
|
|
230
|
-
- **Trust Proxy (Fail-Closed)**: Trust proxy is now disabled by default. Production deployments behind a reverse proxy MUST configure `trustedProxies` or use a preset (`cloudflare`, `aws-alb`, `nginx-local`, etc.). See `docs/trust-proxy-security.md`.
|
|
231
|
-
- **SerializableInterceptor**: Now uses pure transformation — original response objects are no longer mutated. Primitives in arrays are preserved correctly.
|
|
232
|
-
- **AppException**: Now generic `AppException<T>` for strict argument typing.
|
|
233
|
-
|
|
234
|
-
### nestjs-logging
|
|
235
|
-
|
|
236
|
-
- **Redaction**: Default redact paths are now constrained to 3 levels deep (`*.*.key`).
|
|
237
|
-
- **Structured Logs**: Standardized field names for ELK/Loki/Datadog compatibility.
|
|
238
|
-
- **Graceful Drain**: Logger now implements `OnModuleDestroy` to flush pending writes on shutdown.
|
|
239
|
-
|
|
240
|
-
### nestjs-typeorm
|
|
241
|
-
|
|
242
|
-
- **Connection Validation**: `TypeOrmExModule.forRoot()` now throws `"Connection Not Supported"` when no valid connection type is provided (previously defaulted silently to MySQL).
|
|
243
|
-
|
|
244
|
-
## 🔒 Security
|
|
245
|
-
|
|
246
|
-
- **nestjs-common**: Trust proxy fail-closed default prevents IP spoofing when misconfigured. Comprehensive security documentation with provider presets.
|
|
247
|
-
- **nestjs-storage**: GDrive refreshToken security best practices documented. Provider capability matrix added.
|
|
248
|
-
- **nestjs-throttler**: Documented that `getTracker()` executes synchronously — no async TOCTOU race condition in rate limiting.
|
|
249
|
-
- **nestjs-typeorm**: Stored procedure name validation with whitelist pattern (`/^[a-zA-Z_][a-zA-Z0-9_.]*$/`) prevents SQL injection.
|
|
250
|
-
- **nestjs-cache**: Tag registry now receives TTL for proper expiration of tag-to-key mappings.
|
|
251
|
-
- **nestjs-microservices**: Fixed gRPC Bearer token extraction whitespace bug. Full test coverage for all guards.
|
|
252
|
-
- **nestjs-auth-2fa**: Timing-safe TOTP verification prevents timing attacks.
|
|
253
|
-
|
|
254
|
-
## ✨ Features & Improvements
|
|
255
|
-
|
|
256
|
-
- **nestjs-storage**: Added native support for **Azure Blob Storage** and **Google Cloud Storage**. Provider capability matrix documents supported methods per provider.
|
|
257
|
-
- **nestjs-microservices**: Full guard coverage (100%), Service Identity JWT + HMAC authentication, `ServicePermissionRegistry` for fine-grained access control.
|
|
258
|
-
- **nestjs-typeorm**: Automatic mapping of database errors to `AppException` via `TypeOrmExceptionFilter`.
|
|
259
|
-
- **nestjs-auth-2fa**: `BaseTwoFactorGuard` with flexible policy engine. DI-aware provider factory with comprehensive architectural documentation.
|
|
260
|
-
- **nestjs-cache**: Deep-cloning of cached objects to prevent cross-request state leakage. Touch fallback avoided for distributed strategies (race condition prevention).
|
|
261
|
-
- **nestjs-queue**: Race-condition fixes in BullMQ/RabbitMQ batch accumulators.
|
|
262
|
-
- **nestjs-prisma**: `PrismaExceptionFilter` and transaction helper. Parallel query execution validated.
|
|
263
|
-
- **nestjs-auth**: Comprehensive JSDoc on all public APIs. All TODO comments resolved.
|
|
264
|
-
- **nestjs-common**: `ConfigurableModuleBuilder` with `externallyConfigured()` support.
|
|
265
|
-
- **Global**: 2,500+ tests across all 13 packages. Comprehensive JSDoc for all public APIs.
|
|
266
|
-
|
|
267
|
-
## 📚 Documentation
|
|
268
|
-
|
|
269
|
-
- `nestjs-common/docs/trust-proxy-security.md` — IP spoofing risks, preset configurations, verification steps
|
|
270
|
-
- `nestjs-storage/docs/gdrive-security.md` — refreshToken security best practices
|
|
271
|
-
- `nestjs-storage/docs/provider-capabilities.md` — method support matrix per provider
|
|
272
|
-
- All packages: JSDoc on public APIs, MIGRATION.md guides where applicable
|
|
273
|
-
|
|
274
|
-
### Patch Changes
|
|
275
|
-
|
|
276
|
-
- Updated dependencies [86a36b8]
|
|
277
|
-
- @nathapp/nestjs-common@3.0.0
|
|
278
|
-
|
|
279
|
-
## 3.0.0-rc.0
|
|
280
|
-
|
|
281
|
-
### Major Changes
|
|
282
|
-
|
|
283
|
-
- # 🚀 v3.0.0-rc Monorepo Enterprise Upgrade
|
|
284
|
-
|
|
285
|
-
This release brings significant security, reliability, and observability improvements across the entire Nathapp ecosystem.
|
|
286
|
-
|
|
287
|
-
## ⚠️ [BREAKING CHANGES]
|
|
288
|
-
|
|
289
|
-
### nestjs-common
|
|
290
|
-
|
|
291
|
-
- **Trust Proxy (Fail-Closed)**: Trust proxy is now disabled by default. Production deployments MUST configure `trustedProxies` or use a preset (`cloudflare`, `aws-alb`, etc.).
|
|
292
|
-
- **SerializableInterceptor**: Now uses pure transformation. Original response objects are no longer mutated.
|
|
293
|
-
- **AppException**: Now generic `AppException<T>` for strict argument typing.
|
|
294
|
-
|
|
295
|
-
### nestjs-logging
|
|
296
|
-
|
|
297
|
-
- **Redaction**: Default redact paths are now constrained to 3 levels deep (`*.*.key`).
|
|
298
|
-
- **Structured Logs**: Standardized field names for ELK/Loki/Datadog compatibility.
|
|
299
|
-
|
|
300
|
-
## ✨ Features & Improvements
|
|
301
|
-
|
|
302
|
-
- **nestjs-storage**: Added native support for **Azure Blob Storage** and **Google Cloud Storage**.
|
|
303
|
-
- **nestjs-microservices**: Full guard coverage and secured gRPC Bearer token extraction.
|
|
304
|
-
- **nestjs-typeorm**: Automatic mapping of database errors to `AppException`.
|
|
305
|
-
- **nestjs-auth-2fa**: Timing-safe TOTP verification and flexible policy engine.
|
|
306
|
-
- **nestjs-cache**: Deep-cloning of cached objects to prevent cross-request state leakage.
|
|
307
|
-
- **nestjs-queue**: Race-condition fixes in BullMQ/RabbitMQ batch accumulators.
|
|
308
|
-
- **nestjs-throttler**: Added async trust proxy support.
|
|
309
|
-
- **Global**: Comprehensive JSDoc for all public APIs across all packages.
|
|
310
|
-
|
|
311
|
-
### Patch Changes
|
|
312
|
-
|
|
313
|
-
- Updated dependencies
|
|
314
|
-
- @nathapp/nestjs-common@3.0.0-rc.0
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Fix Plan: @nathapp/nestjs-prisma Enterprise Upgrade
|
|
2
|
-
**Date:** 2026-02-15
|
|
3
|
-
**Branch:** feat/monorepo-enterprise-upgrade
|
|
4
|
-
|
|
5
|
-
## Phase 1: Error Handling & Security
|
|
6
|
-
### Fix P1: Prisma Error -> AppException Mapping
|
|
7
|
-
**Files:**
|
|
8
|
-
- `packages/nestjs-prisma/lib/errors/prisma-error.mapper.ts` (New)
|
|
9
|
-
- `packages/nestjs-prisma/lib/filter/prisma-exception.filter.ts` (New)
|
|
10
|
-
**Impact:** Standardizes error reporting for Prisma-based services.
|
|
11
|
-
**Change:** Implement a mapper for Prisma Client Known Request Errors (P2002, P2025, etc.) and a global filter.
|
|
12
|
-
|
|
13
|
-
## Phase 2: Lifecycle & Reliability
|
|
14
|
-
### Fix P2: Event Listener Memory Leak
|
|
15
|
-
**File:** `packages/nestjs-prisma/lib/prisma.service.ts`
|
|
16
|
-
**Impact:** Prevents memory leaks during hot-reloads or module destruction.
|
|
17
|
-
**Change:** Ensure `$on('query', ...)` listeners are properly cleaned up in `onModuleDestroy()`.
|
|
18
|
-
|
|
19
|
-
## Phase 3: Transaction Support
|
|
20
|
-
### Fix P3: Transaction Helper Utility
|
|
21
|
-
**File:** `packages/nestjs-prisma/lib/prisma.service.ts`
|
|
22
|
-
**Impact:** Simplifies transactional logic for consumers.
|
|
23
|
-
**Change:** Add a `withTransaction()` helper that wraps the native `$transaction` API with standard error mapping.
|
|
24
|
-
|
|
25
|
-
## Test Strategy
|
|
26
|
-
- Mode: two-session-tdd
|
|
27
|
-
- TDD targets:
|
|
28
|
-
- `packages/nestjs-prisma/test/error-mapping.spec.ts` (Prisma error codes to AppException)
|
|
29
|
-
- `packages/nestjs-prisma/test/lifecycle.spec.ts` (Listener cleanup verification)
|
|
30
|
-
- `packages/nestjs-prisma/test/transaction.spec.ts` (Transaction success/rollback)
|
|
31
|
-
- Test-after targets:
|
|
32
|
-
- `packages/nestjs-prisma/test/prisma.service.spec.ts` (Regression check)
|
|
33
|
-
|
|
34
|
-
## Commits
|
|
35
|
-
- `feat(nestjs-prisma): implement PrismaExceptionFilter for AppException consistency`
|
|
36
|
-
- `fix(nestjs-prisma): resolve memory leak in query event listeners`
|
|
37
|
-
- `feat(nestjs-prisma): add withTransaction helper with standard error mapping`
|