@nathapp/nestjs-auth-2fa 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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @nathapp/nestjs-auth-2fa@2.1.4 build
2
+ > @nathapp/nestjs-auth-2fa@2.1.5 build
3
3
  > rimraf dist && tsc -p tsconfig.json
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,113 @@
1
1
  # @nathapp/nestjs-auth-2fa
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-auth@2.1.5
109
+ - @nathapp/nestjs-common@2.1.5
110
+
3
111
  ## 2.1.1
4
112
 
5
113
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nestjs-auth-2fa",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "nestjs-auth-2fa",
5
5
  "scripts": {
6
6
  "clean": "rimraf dist/ .turbo/",
@@ -30,12 +30,12 @@
30
30
  "lib": "lib"
31
31
  },
32
32
  "dependencies": {
33
- "@nathapp/nestjs-auth": "^2.1.1",
34
- "@nathapp/nestjs-common": "^2.1.1"
33
+ "@nathapp/nestjs-auth": "^2.1.5",
34
+ "@nathapp/nestjs-common": "^2.1.5"
35
35
  },
36
36
  "peerDependencies": {
37
- "@nathapp/nestjs-auth": "^2.1.1",
38
- "@nathapp/nestjs-common": "^2.1.1",
37
+ "@nathapp/nestjs-auth": "^2.1.5",
38
+ "@nathapp/nestjs-common": "^2.1.5",
39
39
  "otplib": "^12.0.1",
40
40
  "qrcode": "^1.5.4"
41
41
  },