@nathapp/nestjs-logging 4.0.0 → 4.0.1

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @nathapp/nestjs-logging@4.0.0 build
2
+ > @nathapp/nestjs-logging@4.0.1 build
3
3
  > rimraf dist && tsc -p tsconfig.json
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nestjs-logging",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "nestjs-logging",
5
5
  "scripts": {
6
6
  "clean": "rimraf dist/ .turbo/",
@@ -57,7 +57,7 @@
57
57
  "lib": "lib"
58
58
  },
59
59
  "dependencies": {
60
- "@nathapp/nestjs-common": "^4.0.0",
60
+ "@nathapp/nestjs-common": "^4.0.1",
61
61
  "fast-redact": "^3.0.0"
62
62
  }
63
63
  }
package/.eslintrc.js DELETED
@@ -1,24 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- project: 'tsconfig.json',
5
- sourceType: 'module',
6
- },
7
- plugins: ['@typescript-eslint/eslint-plugin'],
8
- extends: [
9
- 'plugin:@typescript-eslint/recommended',
10
- 'plugin:prettier/recommended',
11
- ],
12
- root: true,
13
- env: {
14
- node: true,
15
- jest: true,
16
- },
17
- ignorePatterns: ['.eslintrc.js'],
18
- rules: {
19
- '@typescript-eslint/interface-name-prefix': 'off',
20
- '@typescript-eslint/explicit-function-return-type': 'off',
21
- '@typescript-eslint/explicit-module-boundary-types': 'off',
22
- '@typescript-eslint/no-explicit-any': 'off',
23
- },
24
- };
package/CHANGELOG.md DELETED
@@ -1,397 +0,0 @@
1
- # @nathapp/nestjs-logging
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
-
20
- ## 4.0.0-rc.0
21
-
22
- ### Major Changes
23
-
24
- - 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.
25
-
26
- Other consumer-facing changes:
27
-
28
- - `@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.
29
- - 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.
30
-
31
- ### Patch Changes
32
-
33
- - Updated dependencies [c3aeb46]
34
- - @nathapp/nestjs-common@4.0.0-rc.0
35
-
36
- ## 3.3.0
37
-
38
- ### Patch Changes
39
-
40
- - @nathapp/nestjs-common@3.3.0
41
-
42
- ## 3.2.1
43
-
44
- ### Patch Changes
45
-
46
- - 0610b83: Fix Exception Bug on nestjs-common
47
- - Updated dependencies [0610b83]
48
- - @nathapp/nestjs-common@3.2.1
49
-
50
- ## 3.2.0
51
-
52
- ### Minor Changes
53
-
54
- - 1876b9a: ### nestjs-auth
55
-
56
- - Add JWKS support via `JwksJwtStrategyProvider` and `createJwksStrategyProvider` factory — enables remote key resolution through `jwks-rsa` (optional peer dep)
57
- - Add `validateJwksOptions` security guard and `JwksOptions` interface
58
- - Export `JwksJwtStrategyProvider` and `JwksOptions` from the public API
59
- - Fix permission guard and JWT module immutability issues from code review
60
-
61
- ### nestjs-typeorm
62
-
63
- - Add `AbstractTypeOrmRepository<TDomain, TEntity, TId>` — portable `IRepository` implementation decoupled from TypeORM internals
64
- - Add `TYPEORM_TRANSACTION_ALS` DI token and publish it from `forRoot`/`forRootAsync`
65
- - `forCustomRepository` now instantiates `AbstractTypeOrmRepository` subclasses with the correct per-DataSource tx manager token
66
- - Add `getTypeOrmTransactionManagerToken(name?)` helper for multi-DataSource wiring
67
- - Named DataSource tx tokens no longer collide; default DataSource still aliases the global `TRANSACTION_MANAGER` symbol
68
-
69
- ### nestjs-prisma
70
-
71
- - Add `getPrismaTransactionManagerToken(name?)` helper for multi-DataSource wiring
72
- - `forRoot` / `forRootAsync` register named tx manager token + default-only guard to prevent collision
73
-
74
- ### nestjs-data
75
-
76
- - Add `IRepository<TDomain, TId>` portable repository contract
77
- - Fix missing `@nathapp/nestjs-common` peer dep for turborepo build resolution
78
-
79
- ### nestjs-common
80
-
81
- - Add `request-ip` utility for extracting client IP across Express and Fastify adapters
82
-
83
- ### nestjs-cache
84
-
85
- - Fix cache interceptor, cache manager, and cache tag registry immutability and type issues
86
-
87
- ### nestjs-app
88
-
89
- - Fix `nathapp.ts` and `app-factory.ts` code review findings (immutability, error handling)
90
-
91
- ### nestjs-queue
92
-
93
- - Upgrade `uuid` dependency from `^9.0.0` to `^11.1.1` (security)
94
- - Fix BullMQ health check to use `IRedisClient.info()` (aligned with BullMQ interface)
95
-
96
- ### nestjs-notification
97
-
98
- - Upgrade `nodemailer` dev dep from `^7` to `^8` — resolves SMTP command injection CVEs (GHSA-c7w3-x93f-qmm8, GHSA-vvjj-xcjg-gr5g)
99
-
100
- ### nestjs-storage
101
-
102
- - Fix code review findings (immutability, validation)
103
-
104
- ### nestjs-throttler
105
-
106
- - Fix code review findings
107
-
108
- ### All packages
109
-
110
- - Upgrade AJV to v8 (removes root override that broke `@fastify/ajv-compiler`)
111
- - Align all package versions to 3.1.3 as baseline for this minor release
112
-
113
- ### Patch Changes
114
-
115
- - Updated dependencies [1876b9a]
116
- - @nathapp/nestjs-common@3.2.0
117
-
118
- ## 3.0.0
119
-
120
- ### Major Changes
121
-
122
- - 86a36b8: # 🚀 v3.0.0 Monorepo Enterprise Upgrade
123
-
124
- This release brings significant security hardening, strict typing, improved observability, and comprehensive documentation across the entire Nathapp NestJS ecosystem.
125
-
126
- ## ⚠️ Breaking Changes
127
-
128
- ### nestjs-common
129
-
130
- - **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`.
131
- - **SerializableInterceptor**: Now uses pure transformation — original response objects are no longer mutated. Primitives in arrays are preserved correctly.
132
- - **AppException**: Now generic `AppException<T>` for strict argument typing.
133
-
134
- ### nestjs-logging
135
-
136
- - **Redaction**: Default redact paths are now constrained to 3 levels deep (`*.*.key`).
137
- - **Structured Logs**: Standardized field names for ELK/Loki/Datadog compatibility.
138
- - **Graceful Drain**: Logger now implements `OnModuleDestroy` to flush pending writes on shutdown.
139
-
140
- ### nestjs-typeorm
141
-
142
- - **Connection Validation**: `TypeOrmExModule.forRoot()` now throws `"Connection Not Supported"` when no valid connection type is provided (previously defaulted silently to MySQL).
143
-
144
- ## 🔒 Security
145
-
146
- - **nestjs-common**: Trust proxy fail-closed default prevents IP spoofing when misconfigured. Comprehensive security documentation with provider presets.
147
- - **nestjs-storage**: GDrive refreshToken security best practices documented. Provider capability matrix added.
148
- - **nestjs-throttler**: Documented that `getTracker()` executes synchronously — no async TOCTOU race condition in rate limiting.
149
- - **nestjs-typeorm**: Stored procedure name validation with whitelist pattern (`/^[a-zA-Z_][a-zA-Z0-9_.]*$/`) prevents SQL injection.
150
- - **nestjs-cache**: Tag registry now receives TTL for proper expiration of tag-to-key mappings.
151
- - **nestjs-microservices**: Fixed gRPC Bearer token extraction whitespace bug. Full test coverage for all guards.
152
- - **nestjs-auth-2fa**: Timing-safe TOTP verification prevents timing attacks.
153
-
154
- ## ✨ Features & Improvements
155
-
156
- - **nestjs-storage**: Added native support for **Azure Blob Storage** and **Google Cloud Storage**. Provider capability matrix documents supported methods per provider.
157
- - **nestjs-microservices**: Full guard coverage (100%), Service Identity JWT + HMAC authentication, `ServicePermissionRegistry` for fine-grained access control.
158
- - **nestjs-typeorm**: Automatic mapping of database errors to `AppException` via `TypeOrmExceptionFilter`.
159
- - **nestjs-auth-2fa**: `BaseTwoFactorGuard` with flexible policy engine. DI-aware provider factory with comprehensive architectural documentation.
160
- - **nestjs-cache**: Deep-cloning of cached objects to prevent cross-request state leakage. Touch fallback avoided for distributed strategies (race condition prevention).
161
- - **nestjs-queue**: Race-condition fixes in BullMQ/RabbitMQ batch accumulators.
162
- - **nestjs-prisma**: `PrismaExceptionFilter` and transaction helper. Parallel query execution validated.
163
- - **nestjs-auth**: Comprehensive JSDoc on all public APIs. All TODO comments resolved.
164
- - **nestjs-common**: `ConfigurableModuleBuilder` with `externallyConfigured()` support.
165
- - **Global**: 2,500+ tests across all 13 packages. Comprehensive JSDoc for all public APIs.
166
-
167
- ## 📚 Documentation
168
-
169
- - `nestjs-common/docs/trust-proxy-security.md` — IP spoofing risks, preset configurations, verification steps
170
- - `nestjs-storage/docs/gdrive-security.md` — refreshToken security best practices
171
- - `nestjs-storage/docs/provider-capabilities.md` — method support matrix per provider
172
- - All packages: JSDoc on public APIs, MIGRATION.md guides where applicable
173
-
174
- ### Patch Changes
175
-
176
- - Updated dependencies [86a36b8]
177
- - @nathapp/nestjs-common@3.0.0
178
-
179
- ## 3.0.0-rc.0
180
-
181
- ### Major Changes
182
-
183
- - # 🚀 v3.0.0-rc Monorepo Enterprise Upgrade
184
-
185
- This release brings significant security, reliability, and observability improvements across the entire Nathapp ecosystem.
186
-
187
- ## ⚠️ [BREAKING CHANGES]
188
-
189
- ### nestjs-common
190
-
191
- - **Trust Proxy (Fail-Closed)**: Trust proxy is now disabled by default. Production deployments MUST configure `trustedProxies` or use a preset (`cloudflare`, `aws-alb`, etc.).
192
- - **SerializableInterceptor**: Now uses pure transformation. Original response objects are no longer mutated.
193
- - **AppException**: Now generic `AppException<T>` for strict argument typing.
194
-
195
- ### nestjs-logging
196
-
197
- - **Redaction**: Default redact paths are now constrained to 3 levels deep (`*.*.key`).
198
- - **Structured Logs**: Standardized field names for ELK/Loki/Datadog compatibility.
199
-
200
- ## ✨ Features & Improvements
201
-
202
- - **nestjs-storage**: Added native support for **Azure Blob Storage** and **Google Cloud Storage**.
203
- - **nestjs-microservices**: Full guard coverage and secured gRPC Bearer token extraction.
204
- - **nestjs-typeorm**: Automatic mapping of database errors to `AppException`.
205
- - **nestjs-auth-2fa**: Timing-safe TOTP verification and flexible policy engine.
206
- - **nestjs-cache**: Deep-cloning of cached objects to prevent cross-request state leakage.
207
- - **nestjs-queue**: Race-condition fixes in BullMQ/RabbitMQ batch accumulators.
208
- - **nestjs-throttler**: Added async trust proxy support.
209
- - **Global**: Comprehensive JSDoc for all public APIs across all packages.
210
-
211
- ### Patch Changes
212
-
213
- - Updated dependencies
214
- - @nathapp/nestjs-common@3.0.0-rc.0
215
-
216
- ## 2.1.5
217
-
218
- ### Patch Changes
219
-
220
- - # @nathapp/nestjs-notification v2.2.0 - Enterprise-Grade Upgrade
221
-
222
- Major enterprise enhancements to the notification system with 9 phases of improvements:
223
-
224
- ## New Features
225
-
226
- ### Phase 1: Pluggable Template Engine
227
-
228
- - `TemplateEngine` interface for custom template rendering
229
- - `StringFormatEngine` as default (backwards compatible)
230
- - Apps can now inject Handlebars, EJS, or custom engines
231
-
232
- ### Phase 2: Configurable Strict Mode
233
-
234
- - `strict: true` (default) throws errors when services aren't configured
235
- - `strict: false` for graceful degradation (returns `{ success: false }`)
236
- - Clear error messages via `NotificationConfigError`
237
-
238
- ### Phase 3: Unified `send()` Method
239
-
240
- - Single method dispatches to multiple channels
241
- - `NotificationPayload` with `channels: ['email', 'push', 'sms']`
242
- - Aggregated results across all channels
243
-
244
- ### Phase 4: Platform Alias
245
-
246
- - Added `platform` field (deprecated `paltform` typo)
247
- - Backwards compatible with fallback
248
-
249
- ### Phase 5: SMS Integration
250
-
251
- - `SmsService` wired into `NotificationModule`
252
- - `sendSms()` with full template support
253
- - Ready for provider packages (Twilio, SNS)
254
-
255
- ### Phase 6: Interceptors & Hooks
256
-
257
- - `NotificationInterceptor` interface
258
- - `beforeSend`, `afterSend`, `onError` hooks
259
- - Global logging, auditing, message modification
260
-
261
- ### Phase 7: WhatsApp Channel
262
-
263
- - `WhatsAppService` abstract class
264
- - `WhatsAppMessage` interface with Meta Business API support
265
- - Template-based WhatsApp notifications
266
-
267
- ### Phase 8: Channel Fallback
268
-
269
- - `fallback: ['sms']` on `NotificationPayload`
270
- - Auto-retry through fallback channels when primary fails
271
- - Interceptors receive `isFallback` + `failedChannel` context
272
-
273
- ### Phase 9: Unified Provider Registry (⚠️ Breaking)
274
-
275
- - Replaced per-channel modules with unified `providers` array
276
- - `NotificationProviderFactory` validates provider ↔ channel match
277
- - `NotificationModuleOptionsFactory` for async configuration
278
- - Simplified API: `NotificationModule.forRoot({ providers: [...] })`
279
-
280
- ## Breaking Changes (Phase 9)
281
-
282
- - `emailOptions` → removed (use `providers` array)
283
- - `pushNotificationOptions` → removed (use `providers` array)
284
- - `smsService` → removed (use `providers` array)
285
- - `whatsAppService` → removed (use `providers` array)
286
- - `EmailModule`, `PushNotificationModule` no longer exported from main index
287
-
288
- ## Migration Guide
289
-
290
- ### Before
291
-
292
- ```typescript
293
- NotificationModule.forRoot({
294
- emailOptions: EmailModule.forRoot({ option: { type: 'smtp', options: {...} } }),
295
- templateLoader: MyLoader,
296
- })
297
- ```
298
-
299
- ### After
300
-
301
- ```typescript
302
- NotificationModule.forRoot({
303
- providers: [
304
- {
305
- channel: "email",
306
- provider: SmtpEmailProvider,
307
- options: { url: "...", from: "..." },
308
- },
309
- ],
310
- templateLoader: MyLoader,
311
- });
312
- ```
313
-
314
- ## Stats
315
-
316
- - **159 tests** (all passing)
317
- - **88.5% code coverage**
318
- - Fully backwards compatible (except Phase 9 breaking changes)
319
-
320
- - Updated dependencies
321
- - @nathapp/nestjs-common@2.1.5
322
-
323
- ## 2.1.1
324
-
325
- ### Patch Changes
326
-
327
- - 1244520: fix: correct main/types paths to dist/ directory
328
- - Updated dependencies [1244520]
329
- - @nathapp/nestjs-common@2.1.1
330
-
331
- ## 3.0.0-rc.4
332
-
333
- ### Minor Changes
334
-
335
- - de7078f: bump version
336
-
337
- ### Patch Changes
338
-
339
- - Updated dependencies [de7078f]
340
- - @nathapp/nestjs-common@3.0.0-rc.4
341
-
342
- ## 2.0.4
343
-
344
- ### Patch Changes
345
-
346
- - 65148c4: security patch
347
- - Updated dependencies [65148c4]
348
- - @nathapp/nestjs-common@2.0.4
349
-
350
- ## 2.0.3
351
-
352
- ### Patch Changes
353
-
354
- - ac0012d: LoggingInterceptor bug fix
355
- - Updated dependencies [9da9d5a]
356
- - @nathapp/nestjs-common@2.0.3
357
-
358
- ## 2.0.3-rc.0
359
-
360
- ### Patch Changes
361
-
362
- - ac0012d: LoggingInterceptor bug fix
363
- - Updated dependencies [9da9d5a]
364
- - @nathapp/nestjs-common@2.0.3-rc.0
365
-
366
- ## 2.0.2
367
-
368
- ### Patch Changes
369
-
370
- - 5b4c986: add @nathapp/nestjs-logging and depreciated @nathapp/nestjs-common logging
371
- - 184e23b: refactory LoggerFactory and add FlushLogs on nathapp
372
- - e493769: implement additionalFactoryOptions and bug fix
373
- - a9cfacb: release nestjs-logging and add logErrorResponse
374
-
375
- ## 2.0.1-rc.5
376
-
377
- ### Patch Changes
378
-
379
- - e493769: implement additionalFactoryOptions and bug fix
380
-
381
- ## 2.0.1-rc.4
382
-
383
- ### Patch Changes
384
-
385
- - 5b4c986: add @nathapp/nestjs-logging and depreciated @nathapp/nestjs-common logging
386
-
387
- ## 2.0.1-rc.3
388
-
389
- ### Patch Changes
390
-
391
- - 184e23b: refactory LoggerFactory and add FlushLogs on nathapp
392
-
393
- ## 2.0.1-rc.2
394
-
395
- ### Patch Changes
396
-
397
- - a9cfacb: release nestjs-logging and add logErrorResponse