@nathapp/nestjs-logging 2.1.4 → 2.1.5
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +107 -0
- package/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
# @nathapp/nestjs-logging
|
|
2
2
|
|
|
3
|
+
## 2.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- # @nathapp/nestjs-notification v2.2.0 - Enterprise-Grade Upgrade
|
|
8
|
+
|
|
9
|
+
Major enterprise enhancements to the notification system with 9 phases of improvements:
|
|
10
|
+
|
|
11
|
+
## New Features
|
|
12
|
+
|
|
13
|
+
### Phase 1: Pluggable Template Engine
|
|
14
|
+
|
|
15
|
+
- `TemplateEngine` interface for custom template rendering
|
|
16
|
+
- `StringFormatEngine` as default (backwards compatible)
|
|
17
|
+
- Apps can now inject Handlebars, EJS, or custom engines
|
|
18
|
+
|
|
19
|
+
### Phase 2: Configurable Strict Mode
|
|
20
|
+
|
|
21
|
+
- `strict: true` (default) throws errors when services aren't configured
|
|
22
|
+
- `strict: false` for graceful degradation (returns `{ success: false }`)
|
|
23
|
+
- Clear error messages via `NotificationConfigError`
|
|
24
|
+
|
|
25
|
+
### Phase 3: Unified `send()` Method
|
|
26
|
+
|
|
27
|
+
- Single method dispatches to multiple channels
|
|
28
|
+
- `NotificationPayload` with `channels: ['email', 'push', 'sms']`
|
|
29
|
+
- Aggregated results across all channels
|
|
30
|
+
|
|
31
|
+
### Phase 4: Platform Alias
|
|
32
|
+
|
|
33
|
+
- Added `platform` field (deprecated `paltform` typo)
|
|
34
|
+
- Backwards compatible with fallback
|
|
35
|
+
|
|
36
|
+
### Phase 5: SMS Integration
|
|
37
|
+
|
|
38
|
+
- `SmsService` wired into `NotificationModule`
|
|
39
|
+
- `sendSms()` with full template support
|
|
40
|
+
- Ready for provider packages (Twilio, SNS)
|
|
41
|
+
|
|
42
|
+
### Phase 6: Interceptors & Hooks
|
|
43
|
+
|
|
44
|
+
- `NotificationInterceptor` interface
|
|
45
|
+
- `beforeSend`, `afterSend`, `onError` hooks
|
|
46
|
+
- Global logging, auditing, message modification
|
|
47
|
+
|
|
48
|
+
### Phase 7: WhatsApp Channel
|
|
49
|
+
|
|
50
|
+
- `WhatsAppService` abstract class
|
|
51
|
+
- `WhatsAppMessage` interface with Meta Business API support
|
|
52
|
+
- Template-based WhatsApp notifications
|
|
53
|
+
|
|
54
|
+
### Phase 8: Channel Fallback
|
|
55
|
+
|
|
56
|
+
- `fallback: ['sms']` on `NotificationPayload`
|
|
57
|
+
- Auto-retry through fallback channels when primary fails
|
|
58
|
+
- Interceptors receive `isFallback` + `failedChannel` context
|
|
59
|
+
|
|
60
|
+
### Phase 9: Unified Provider Registry (⚠️ Breaking)
|
|
61
|
+
|
|
62
|
+
- Replaced per-channel modules with unified `providers` array
|
|
63
|
+
- `NotificationProviderFactory` validates provider ↔ channel match
|
|
64
|
+
- `NotificationModuleOptionsFactory` for async configuration
|
|
65
|
+
- Simplified API: `NotificationModule.forRoot({ providers: [...] })`
|
|
66
|
+
|
|
67
|
+
## Breaking Changes (Phase 9)
|
|
68
|
+
|
|
69
|
+
- `emailOptions` → removed (use `providers` array)
|
|
70
|
+
- `pushNotificationOptions` → removed (use `providers` array)
|
|
71
|
+
- `smsService` → removed (use `providers` array)
|
|
72
|
+
- `whatsAppService` → removed (use `providers` array)
|
|
73
|
+
- `EmailModule`, `PushNotificationModule` no longer exported from main index
|
|
74
|
+
|
|
75
|
+
## Migration Guide
|
|
76
|
+
|
|
77
|
+
### Before
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
NotificationModule.forRoot({
|
|
81
|
+
emailOptions: EmailModule.forRoot({ option: { type: 'smtp', options: {...} } }),
|
|
82
|
+
templateLoader: MyLoader,
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### After
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
NotificationModule.forRoot({
|
|
90
|
+
providers: [
|
|
91
|
+
{
|
|
92
|
+
channel: "email",
|
|
93
|
+
provider: SmtpEmailProvider,
|
|
94
|
+
options: { url: "...", from: "..." },
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
templateLoader: MyLoader,
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Stats
|
|
102
|
+
|
|
103
|
+
- **159 tests** (all passing)
|
|
104
|
+
- **88.5% code coverage**
|
|
105
|
+
- Fully backwards compatible (except Phase 9 breaking changes)
|
|
106
|
+
|
|
107
|
+
- Updated dependencies
|
|
108
|
+
- @nathapp/nestjs-common@2.1.5
|
|
109
|
+
|
|
3
110
|
## 2.1.1
|
|
4
111
|
|
|
5
112
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-logging",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "nestjs-logging",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist/ .turbo/",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"winston-loki": "^6.1.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@nathapp/nestjs-common": "^2.1.
|
|
31
|
+
"@nathapp/nestjs-common": "^2.1.5",
|
|
32
32
|
"fast-redact": "^3.0.0",
|
|
33
33
|
"pino": "^7.5.0 || ^8.0.0 || ^9.0.0",
|
|
34
34
|
"rotating-file-stream": "^3.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"lib": "lib"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@nathapp/nestjs-common": "^2.1.
|
|
58
|
+
"@nathapp/nestjs-common": "^2.1.5",
|
|
59
59
|
"fast-redact": "^3.0.0"
|
|
60
60
|
}
|
|
61
61
|
}
|