@nathapp/nestjs-notification 2.1.4 → 3.0.0-rc.4

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.
Files changed (123) hide show
  1. package/CLAUDE.md +21 -0
  2. package/UPGRADE-PLAN-PHASE7-8.md +307 -0
  3. package/UPGRADE-PLAN-PHASE9.md +361 -0
  4. package/UPGRADE-PLAN.md +425 -0
  5. package/dist/email/email.interface.d.ts +1 -1
  6. package/dist/email/email.provider.d.ts +2 -2
  7. package/dist/email/email.provider.js +7 -5
  8. package/dist/email/email.provider.js.map +1 -1
  9. package/dist/email/index.d.ts +1 -3
  10. package/dist/email/index.js +1 -6
  11. package/dist/email/index.js.map +1 -1
  12. package/dist/index.d.ts +4 -3
  13. package/dist/index.js +22 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/interface/index.d.ts +3 -3
  16. package/dist/interface/message.interface.d.ts +11 -4
  17. package/dist/interface/payload.interface.d.ts +71 -0
  18. package/dist/{push-notification/push-notification-module.interface.js → interface/payload.interface.js} +1 -2
  19. package/dist/interface/payload.interface.js.map +1 -0
  20. package/dist/interface/result.interface.d.ts +2 -1
  21. package/dist/notification/errors.d.ts +3 -0
  22. package/dist/notification/errors.js +11 -0
  23. package/dist/notification/errors.js.map +1 -0
  24. package/dist/notification/index.d.ts +6 -2
  25. package/dist/notification/index.js +7 -1
  26. package/dist/notification/index.js.map +1 -1
  27. package/dist/notification/notification-provider.factory.d.ts +5 -0
  28. package/dist/notification/notification-provider.factory.js +33 -0
  29. package/dist/notification/notification-provider.factory.js.map +1 -0
  30. package/dist/notification/notification.interceptor.d.ts +18 -0
  31. package/dist/notification/notification.interceptor.js +5 -0
  32. package/dist/notification/notification.interceptor.js.map +1 -0
  33. package/dist/notification/notification.module.d.ts +29 -19
  34. package/dist/notification/notification.module.js +338 -65
  35. package/dist/notification/notification.module.js.map +1 -1
  36. package/dist/notification/notification.service.d.ts +18 -2
  37. package/dist/notification/notification.service.js +277 -16
  38. package/dist/notification/notification.service.js.map +1 -1
  39. package/dist/notification/provider-config.d.ts +17 -0
  40. package/dist/{interface/payload.inteface.js → notification/provider-config.js} +1 -1
  41. package/dist/notification/provider-config.js.map +1 -0
  42. package/dist/push-notification/fcm-push-notification.provider.d.ts +3 -0
  43. package/dist/push-notification/fcm-push-notification.provider.js +17 -2
  44. package/dist/push-notification/fcm-push-notification.provider.js.map +1 -1
  45. package/dist/push-notification/firebase.interface.d.ts +1 -0
  46. package/dist/push-notification/index.d.ts +1 -4
  47. package/dist/push-notification/index.js +1 -5
  48. package/dist/push-notification/index.js.map +1 -1
  49. package/dist/push-notification/push-notification-provider.manager.d.ts +8 -3
  50. package/dist/push-notification/push-notification-provider.manager.js +12 -3
  51. package/dist/push-notification/push-notification-provider.manager.js.map +1 -1
  52. package/dist/push-notification/push-notification.provider.d.ts +1 -0
  53. package/dist/push-notification/push-notification.provider.js.map +1 -1
  54. package/dist/push-notification/push-notification.service.js +3 -2
  55. package/dist/push-notification/push-notification.service.js.map +1 -1
  56. package/dist/push-notification/user-token.store.js +7 -7
  57. package/dist/push-notification/user-token.store.js.map +1 -1
  58. package/dist/sms/constant.d.ts +1 -0
  59. package/dist/sms/constant.js +5 -0
  60. package/dist/sms/constant.js.map +1 -0
  61. package/dist/sms/index.d.ts +3 -2
  62. package/dist/sms/index.js +6 -2
  63. package/dist/sms/index.js.map +1 -1
  64. package/dist/sms/sms.provider.d.ts +9 -0
  65. package/dist/sms/sms.provider.js +7 -0
  66. package/dist/sms/sms.provider.js.map +1 -0
  67. package/dist/sms/sms.service.d.ts +8 -7
  68. package/dist/sms/sms.service.js +30 -2
  69. package/dist/sms/sms.service.js.map +1 -1
  70. package/dist/template/constant.d.ts +1 -0
  71. package/dist/template/constant.js +2 -1
  72. package/dist/template/constant.js.map +1 -1
  73. package/dist/template/engines/string-format.engine.d.ts +6 -0
  74. package/dist/template/engines/string-format.engine.js +17 -0
  75. package/dist/template/engines/string-format.engine.js.map +1 -0
  76. package/dist/template/fake-template.loader.js +14 -18
  77. package/dist/template/fake-template.loader.js.map +1 -1
  78. package/dist/template/index.d.ts +4 -2
  79. package/dist/template/index.js +4 -1
  80. package/dist/template/index.js.map +1 -1
  81. package/dist/template/template-engine.d.ts +5 -0
  82. package/dist/template/template-engine.js +3 -0
  83. package/dist/template/template-engine.js.map +1 -0
  84. package/dist/template/template.loader.d.ts +4 -1
  85. package/dist/template/template.loader.js +22 -14
  86. package/dist/template/template.loader.js.map +1 -1
  87. package/dist/whatsapp/constant.d.ts +2 -0
  88. package/dist/whatsapp/constant.js +6 -0
  89. package/dist/whatsapp/constant.js.map +1 -0
  90. package/dist/whatsapp/index.d.ts +3 -0
  91. package/dist/whatsapp/index.js +11 -0
  92. package/dist/whatsapp/index.js.map +1 -0
  93. package/dist/whatsapp/whatsapp.provider.d.ts +9 -0
  94. package/dist/whatsapp/whatsapp.provider.js +7 -0
  95. package/dist/whatsapp/whatsapp.provider.js.map +1 -0
  96. package/dist/whatsapp/whatsapp.service.d.ts +9 -0
  97. package/dist/whatsapp/whatsapp.service.js +35 -0
  98. package/dist/whatsapp/whatsapp.service.js.map +1 -0
  99. package/docs/20260214-fix-plan-notification.md +149 -0
  100. package/docs/20260214-fix-plan-post-refactor.md +118 -0
  101. package/docs/20260214-nestjs-notification-review.md +390 -0
  102. package/docs/20260214-review-post-refactor.md +285 -0
  103. package/docs/20260215-review-notification-post-fix.md +933 -0
  104. package/package.json +2 -1
  105. package/dist/email/email-provider.factory.d.ts +0 -5
  106. package/dist/email/email-provider.factory.js +0 -18
  107. package/dist/email/email-provider.factory.js.map +0 -1
  108. package/dist/email/email.module.d.ts +0 -27
  109. package/dist/email/email.module.js +0 -110
  110. package/dist/email/email.module.js.map +0 -1
  111. package/dist/interface/payload.inteface.d.ts +0 -22
  112. package/dist/interface/payload.inteface.js.map +0 -1
  113. package/dist/push-notification/push-notification-module.interface.d.ts +0 -33
  114. package/dist/push-notification/push-notification-module.interface.js.map +0 -1
  115. package/dist/push-notification/push-notification-provider-module.factory.d.ts +0 -5
  116. package/dist/push-notification/push-notification-provider-module.factory.js +0 -13
  117. package/dist/push-notification/push-notification-provider-module.factory.js.map +0 -1
  118. package/dist/push-notification/push-notification-provider.factory.d.ts +0 -5
  119. package/dist/push-notification/push-notification-provider.factory.js +0 -16
  120. package/dist/push-notification/push-notification-provider.factory.js.map +0 -1
  121. package/dist/push-notification/push-notification.module.d.ts +0 -15
  122. package/dist/push-notification/push-notification.module.js +0 -189
  123. package/dist/push-notification/push-notification.module.js.map +0 -1
@@ -9,90 +9,305 @@ var NotificationModule_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.NotificationModule = void 0;
11
11
  const common_1 = require("@nestjs/common");
12
- const email_1 = require("../email");
13
12
  const constant_1 = require("./constant");
14
13
  const template_1 = require("../template");
15
14
  const template_service_1 = require("../template/template.service");
16
15
  const notification_service_1 = require("./notification.service");
17
- const push_notification_1 = require("../push-notification");
16
+ const sms_1 = require("../sms");
17
+ const whatsapp_1 = require("../whatsapp");
18
+ const notification_interceptor_1 = require("./notification.interceptor");
19
+ const notification_provider_factory_1 = require("./notification-provider.factory");
20
+ const constant_2 = require("../email/constant");
21
+ const email_1 = require("../email");
22
+ const constant_3 = require("../push-notification/constant");
23
+ const push_notification_service_1 = require("../push-notification/push-notification.service");
24
+ const push_notification_provider_manager_1 = require("../push-notification/push-notification-provider.manager");
25
+ const user_token_store_1 = require("../push-notification/user-token.store");
18
26
  const defaultOptions = {
19
27
  templateService: template_service_1.TemplateService,
20
28
  templateLoader: template_1.FakeTemplateLoader,
21
29
  notificationService: notification_service_1.NotificationService,
30
+ strict: true,
22
31
  };
23
32
  let NotificationModule = NotificationModule_1 = class NotificationModule {
24
33
  static forRoot(options) {
25
- options = this.santitizeOptions(options);
26
- const modules = [];
27
- const { emailOptions, pushNotificationOptions } = options;
28
- if (emailOptions) {
29
- if (this.isEmailModuleAsyncOption(emailOptions)) {
30
- modules.push(email_1.EmailModule.forRootAsync(emailOptions));
31
- }
32
- else {
33
- modules.push(email_1.EmailModule.forRoot(emailOptions));
34
- }
35
- }
36
- if (pushNotificationOptions) {
37
- if (this.isPushNotificationModuleAsyncOption(pushNotificationOptions)) {
38
- modules.push(push_notification_1.PushNotificationModule.registerAsync(pushNotificationOptions));
39
- }
40
- else {
41
- modules.push(push_notification_1.PushNotificationModule.register(pushNotificationOptions));
42
- }
43
- }
34
+ options = this.sanitizeOptions(options);
35
+ const providers = [];
44
36
  const moduleOptions = {
45
37
  provide: constant_1.NOTIFICATION_OPTIONS,
46
38
  useValue: options,
47
39
  };
40
+ providers.push(moduleOptions);
41
+ const channelProviders = this.createChannelProviders(options.providers || []);
42
+ providers.push(...channelProviders);
43
+ const templateEngine = this.createTemplateEngine(options);
44
+ providers.push(templateEngine);
48
45
  const templateLoader = this.createTemplateLoader(options);
46
+ providers.push(templateLoader);
49
47
  const templateService = {
50
48
  provide: template_service_1.TemplateService,
51
- useClass: options.templateService || template_service_1.TemplateService
49
+ useClass: options.templateService || template_service_1.TemplateService,
52
50
  };
51
+ providers.push(templateService);
53
52
  const notificationService = {
54
53
  provide: notification_service_1.NotificationService,
55
54
  useClass: options.notificationService || notification_service_1.NotificationService,
56
55
  };
56
+ providers.push(notificationService);
57
+ const interceptorProviders = this.createInterceptorProviders(options.interceptors || []);
58
+ providers.push(...interceptorProviders);
59
+ const exports = [
60
+ constant_1.NOTIFICATION_OPTIONS,
61
+ template_1.TEMPLATE_ENGINE,
62
+ template_1.TEMPLATE_LOADER,
63
+ templateService,
64
+ notificationService,
65
+ ];
66
+ if (channelProviders.some(p => 'provide' in p && p.provide === email_1.EmailService)) {
67
+ exports.push(email_1.EmailService);
68
+ }
69
+ if (channelProviders.some(p => 'provide' in p && p.provide === push_notification_service_1.PushNotificationService)) {
70
+ exports.push(push_notification_service_1.PushNotificationService);
71
+ }
72
+ if (channelProviders.some(p => 'provide' in p && p.provide === sms_1.SmsService)) {
73
+ exports.push(sms_1.SmsService);
74
+ }
75
+ if (channelProviders.some(p => 'provide' in p && p.provide === whatsapp_1.WhatsAppService)) {
76
+ exports.push(whatsapp_1.WhatsAppService);
77
+ }
57
78
  return {
58
79
  module: NotificationModule_1,
59
- imports: [...modules],
60
- providers: [moduleOptions, templateLoader, templateService, notificationService],
61
- exports: [...modules, constant_1.NOTIFICATION_OPTIONS, template_1.TEMPLATE_LOADER, templateService, notificationService],
80
+ providers,
81
+ exports,
62
82
  };
63
83
  }
64
- static async forRootAsync(options) {
65
- options = this.santitizeOptions(options);
66
- const importedModules = options.imports ? await Promise.all(options.imports) : [];
67
- const { emailOptions, pushNotificationOptions } = options;
68
- if (emailOptions) {
69
- if (this.isEmailModuleAsyncOption(emailOptions)) {
70
- importedModules.push(email_1.EmailModule.forRootAsync(emailOptions));
71
- }
72
- else {
73
- importedModules.push(email_1.EmailModule.forRoot(emailOptions));
74
- }
75
- }
76
- if (pushNotificationOptions) {
77
- if (this.isPushNotificationModuleAsyncOption(pushNotificationOptions)) {
78
- importedModules.push(push_notification_1.PushNotificationModule.registerAsync(pushNotificationOptions));
79
- }
80
- else {
81
- importedModules.push(push_notification_1.PushNotificationModule.register(pushNotificationOptions));
82
- }
83
- }
84
- const moduleOptions = {
85
- provide: constant_1.NOTIFICATION_OPTIONS,
86
- useValue: options,
87
- };
84
+ static forRootAsync(options) {
85
+ options = this.sanitizeOptions(options);
86
+ const imports = options.imports || [];
87
+ const providers = [];
88
+ const asyncOptionsProviders = this.createAsyncOptionsProviders(options);
89
+ providers.push(...asyncOptionsProviders);
90
+ providers.push({
91
+ provide: constant_2.EMAIL_PROVIDER,
92
+ useFactory: (resolvedOptions) => {
93
+ const emailConfig = (resolvedOptions.providers || []).find(p => p.channel === 'email');
94
+ if (!emailConfig)
95
+ return null;
96
+ return notification_provider_factory_1.NotificationProviderFactory.create(emailConfig);
97
+ },
98
+ inject: [constant_1.NOTIFICATION_OPTIONS],
99
+ });
100
+ providers.push({
101
+ provide: email_1.EmailService,
102
+ useFactory: (emailProvider) => {
103
+ if (!emailProvider)
104
+ return null;
105
+ return new email_1.EmailService(emailProvider);
106
+ },
107
+ inject: [constant_2.EMAIL_PROVIDER],
108
+ });
109
+ providers.push({
110
+ provide: constant_3.PUSH_NOTIFICATION_PROVIDERS,
111
+ useFactory: (resolvedOptions) => {
112
+ const pushConfigs = (resolvedOptions.providers || []).filter(p => p.channel === 'push');
113
+ return pushConfigs.map(config => notification_provider_factory_1.NotificationProviderFactory.create(config));
114
+ },
115
+ inject: [constant_1.NOTIFICATION_OPTIONS],
116
+ });
117
+ const providerManagerProvider = this.createProviderManagerAsync(options);
118
+ providers.push(providerManagerProvider);
119
+ const userTokenStoreProvider = this.createUserTokenStoreAsync(options);
120
+ providers.push(userTokenStoreProvider);
121
+ providers.push({
122
+ provide: push_notification_service_1.PushNotificationService,
123
+ useFactory: (pushProviders, manager, store) => {
124
+ if (!pushProviders || pushProviders.length === 0)
125
+ return null;
126
+ return new push_notification_service_1.PushNotificationService(manager, store);
127
+ },
128
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS, push_notification_provider_manager_1.ProviderManager, user_token_store_1.UserTokenStore],
129
+ });
130
+ providers.push({
131
+ provide: sms_1.SMS_PROVIDER,
132
+ useFactory: (resolvedOptions) => {
133
+ const smsConfig = (resolvedOptions.providers || []).find(p => p.channel === 'sms');
134
+ if (!smsConfig)
135
+ return null;
136
+ return notification_provider_factory_1.NotificationProviderFactory.create(smsConfig);
137
+ },
138
+ inject: [constant_1.NOTIFICATION_OPTIONS],
139
+ });
140
+ providers.push({
141
+ provide: sms_1.SmsService,
142
+ useFactory: (smsProvider) => {
143
+ if (!smsProvider)
144
+ return null;
145
+ return new sms_1.SmsService(smsProvider);
146
+ },
147
+ inject: [sms_1.SMS_PROVIDER],
148
+ });
149
+ providers.push({
150
+ provide: whatsapp_1.WHATSAPP_PROVIDER,
151
+ useFactory: (resolvedOptions) => {
152
+ const whatsappConfig = (resolvedOptions.providers || []).find(p => p.channel === 'whatsapp');
153
+ if (!whatsappConfig)
154
+ return null;
155
+ return notification_provider_factory_1.NotificationProviderFactory.create(whatsappConfig);
156
+ },
157
+ inject: [constant_1.NOTIFICATION_OPTIONS],
158
+ });
159
+ providers.push({
160
+ provide: whatsapp_1.WhatsAppService,
161
+ useFactory: (whatsappProvider) => {
162
+ if (!whatsappProvider)
163
+ return null;
164
+ return new whatsapp_1.WhatsAppService(whatsappProvider);
165
+ },
166
+ inject: [whatsapp_1.WHATSAPP_PROVIDER],
167
+ });
168
+ const templateEngine = this.createTemplateEngine(options);
169
+ providers.push(templateEngine);
88
170
  const templateLoader = this.createTemplateLoader(options);
171
+ providers.push(templateLoader);
89
172
  const templateService = this.createTemplateService(options);
173
+ providers.push(templateService);
90
174
  const notificationService = this.createNotificationService(options);
175
+ providers.push(notificationService);
176
+ const interceptorProviders = this.createInterceptorProviders(options.interceptors || []);
177
+ providers.push(...interceptorProviders);
91
178
  return {
92
179
  module: NotificationModule_1,
93
- imports: [...importedModules,],
94
- providers: [moduleOptions, templateLoader, templateService, notificationService],
95
- exports: [...importedModules, constant_1.NOTIFICATION_OPTIONS, template_1.TEMPLATE_LOADER, templateService, notificationService],
180
+ imports,
181
+ providers,
182
+ exports: [
183
+ constant_1.NOTIFICATION_OPTIONS,
184
+ template_1.TEMPLATE_ENGINE,
185
+ template_1.TEMPLATE_LOADER,
186
+ template_service_1.TemplateService,
187
+ notification_service_1.NotificationService,
188
+ email_1.EmailService,
189
+ push_notification_service_1.PushNotificationService,
190
+ sms_1.SmsService,
191
+ whatsapp_1.WhatsAppService,
192
+ ],
193
+ };
194
+ }
195
+ static createChannelProviders(configs) {
196
+ const providers = [];
197
+ const groupedByChannel = this.groupProvidersByChannel(configs);
198
+ if (groupedByChannel.email.length > 0) {
199
+ const emailConfig = groupedByChannel.email[0];
200
+ const emailProvider = notification_provider_factory_1.NotificationProviderFactory.create(emailConfig);
201
+ providers.push({
202
+ provide: constant_2.EMAIL_PROVIDER,
203
+ useValue: emailProvider,
204
+ });
205
+ providers.push({
206
+ provide: email_1.EmailService,
207
+ useFactory: (provider) => new email_1.EmailService(provider),
208
+ inject: [constant_2.EMAIL_PROVIDER],
209
+ });
210
+ }
211
+ if (groupedByChannel.push.length > 0) {
212
+ const pushProviders = groupedByChannel.push.map(config => notification_provider_factory_1.NotificationProviderFactory.create(config));
213
+ providers.push({
214
+ provide: constant_3.PUSH_NOTIFICATION_PROVIDERS,
215
+ useValue: pushProviders,
216
+ });
217
+ providers.push({
218
+ provide: push_notification_provider_manager_1.ProviderManager,
219
+ useFactory: (providers) => new push_notification_provider_manager_1.DefaultProviderManager(providers),
220
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS],
221
+ });
222
+ providers.push({
223
+ provide: user_token_store_1.UserTokenStore,
224
+ useFactory: () => new user_token_store_1.InMemoryUserTokenStore(),
225
+ });
226
+ providers.push({
227
+ provide: push_notification_service_1.PushNotificationService,
228
+ useFactory: (manager, store) => new push_notification_service_1.PushNotificationService(manager, store),
229
+ inject: [push_notification_provider_manager_1.ProviderManager, user_token_store_1.UserTokenStore],
230
+ });
231
+ }
232
+ if (groupedByChannel.sms.length > 0) {
233
+ const smsConfig = groupedByChannel.sms[0];
234
+ const smsProvider = notification_provider_factory_1.NotificationProviderFactory.create(smsConfig);
235
+ providers.push({
236
+ provide: sms_1.SMS_PROVIDER,
237
+ useValue: smsProvider,
238
+ });
239
+ providers.push({
240
+ provide: sms_1.SmsService,
241
+ useFactory: (provider) => new sms_1.SmsService(provider),
242
+ inject: [sms_1.SMS_PROVIDER],
243
+ });
244
+ }
245
+ if (groupedByChannel.whatsapp.length > 0) {
246
+ const whatsappConfig = groupedByChannel.whatsapp[0];
247
+ const whatsappProvider = notification_provider_factory_1.NotificationProviderFactory.create(whatsappConfig);
248
+ providers.push({
249
+ provide: whatsapp_1.WHATSAPP_PROVIDER,
250
+ useValue: whatsappProvider,
251
+ });
252
+ providers.push({
253
+ provide: whatsapp_1.WhatsAppService,
254
+ useFactory: (provider) => new whatsapp_1.WhatsAppService(provider),
255
+ inject: [whatsapp_1.WHATSAPP_PROVIDER],
256
+ });
257
+ }
258
+ return providers;
259
+ }
260
+ static groupProvidersByChannel(configs) {
261
+ return configs.reduce((acc, config) => {
262
+ acc[config.channel].push(config);
263
+ return acc;
264
+ }, { email: [], push: [], sms: [], whatsapp: [] });
265
+ }
266
+ static createInterceptorProviders(interceptors) {
267
+ if (!interceptors || interceptors.length === 0) {
268
+ return [];
269
+ }
270
+ const providers = [];
271
+ providers.push(...interceptors.map(interceptor => ({
272
+ provide: interceptor,
273
+ useClass: interceptor,
274
+ })));
275
+ providers.push({
276
+ provide: notification_interceptor_1.NOTIFICATION_INTERCEPTORS,
277
+ useFactory: (...interceptorInstances) => interceptorInstances,
278
+ inject: interceptors,
279
+ });
280
+ return providers;
281
+ }
282
+ static createTemplateEngine(options) {
283
+ const providerOptions = 'templateEngine' in options ? options.templateEngine : undefined;
284
+ if (!providerOptions) {
285
+ return {
286
+ provide: template_1.TEMPLATE_ENGINE,
287
+ useClass: template_1.StringFormatEngine,
288
+ };
289
+ }
290
+ if (!isProviderAsyncOptions(providerOptions)) {
291
+ return {
292
+ provide: template_1.TEMPLATE_ENGINE,
293
+ useClass: providerOptions,
294
+ };
295
+ }
296
+ if (providerOptions.useFactory) {
297
+ return {
298
+ provide: template_1.TEMPLATE_ENGINE,
299
+ useFactory(...args) {
300
+ return providerOptions.useFactory(...args);
301
+ },
302
+ inject: providerOptions.inject || [],
303
+ };
304
+ }
305
+ return {
306
+ provide: template_1.TEMPLATE_ENGINE,
307
+ useFactory(engine) {
308
+ return engine;
309
+ },
310
+ inject: [providerOptions.useClass || providerOptions.useExisting],
96
311
  };
97
312
  }
98
313
  static createTemplateLoader(options) {
@@ -170,18 +385,76 @@ let NotificationModule = NotificationModule_1 = class NotificationModule {
170
385
  inject: [providerOptions.useClass || providerOptions.useExisting],
171
386
  };
172
387
  }
173
- static santitizeOptions(options) {
174
- options = { ...defaultOptions, ...options };
175
- return options;
176
- }
177
- static isEmailModuleAsyncOption(options) {
178
- return 'useExisting' in options || 'useClass' in options || 'useFactory' in options || 'inject' in options;
388
+ static createProviderManagerAsync(options) {
389
+ const providerOptions = options.providerManager;
390
+ if (!providerOptions) {
391
+ return {
392
+ provide: push_notification_provider_manager_1.ProviderManager,
393
+ useFactory: (providers) => {
394
+ if (!providers || providers.length === 0)
395
+ return null;
396
+ return new push_notification_provider_manager_1.DefaultProviderManager(providers);
397
+ },
398
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS],
399
+ };
400
+ }
401
+ if (!isProviderAsyncOptions(providerOptions)) {
402
+ return {
403
+ provide: push_notification_provider_manager_1.ProviderManager,
404
+ useClass: providerOptions,
405
+ };
406
+ }
407
+ if (providerOptions.useFactory) {
408
+ return {
409
+ provide: push_notification_provider_manager_1.ProviderManager,
410
+ useFactory(...args) {
411
+ return providerOptions.useFactory(...args);
412
+ },
413
+ inject: providerOptions.inject || [],
414
+ };
415
+ }
416
+ return {
417
+ provide: push_notification_provider_manager_1.ProviderManager,
418
+ useFactory(manager) {
419
+ return manager;
420
+ },
421
+ inject: [providerOptions.useClass || providerOptions.useExisting],
422
+ };
179
423
  }
180
- static isPushNotificationModuleAsyncOption(options) {
181
- if (options.providers.length > 0) {
182
- const provider = options.providers[0];
183
- return 'useExisting' in provider || 'useClass' in provider || 'useFactory' in provider || 'inject' in provider;
424
+ static createUserTokenStoreAsync(options) {
425
+ const providerOptions = options.userTokenStore;
426
+ if (!providerOptions) {
427
+ return {
428
+ provide: user_token_store_1.UserTokenStore,
429
+ useFactory: () => new user_token_store_1.InMemoryUserTokenStore(),
430
+ };
431
+ }
432
+ if (!isProviderAsyncOptions(providerOptions)) {
433
+ return {
434
+ provide: user_token_store_1.UserTokenStore,
435
+ useClass: providerOptions,
436
+ };
184
437
  }
438
+ if (providerOptions.useFactory) {
439
+ return {
440
+ provide: user_token_store_1.UserTokenStore,
441
+ useFactory(...args) {
442
+ return providerOptions.useFactory(...args);
443
+ },
444
+ inject: providerOptions.inject || [],
445
+ };
446
+ }
447
+ return {
448
+ provide: user_token_store_1.UserTokenStore,
449
+ useFactory(store) {
450
+ return store;
451
+ },
452
+ inject: [providerOptions.useClass || providerOptions.useExisting],
453
+ };
454
+ }
455
+ static sanitizeOptions(options) {
456
+ options = { ...defaultOptions, ...options };
457
+ return options;
185
458
  }
186
459
  static createAsyncOptionsProviders(options) {
187
460
  if (options.useExisting || options.useFactory) {
@@ -200,14 +473,14 @@ let NotificationModule = NotificationModule_1 = class NotificationModule {
200
473
  return {
201
474
  provide: constant_1.NOTIFICATION_OPTIONS,
202
475
  useFactory: async (...args) => {
203
- return this.santitizeOptions((await options.useFactory(...args)));
476
+ return this.sanitizeOptions((await options.useFactory(...args)));
204
477
  },
205
478
  inject: options.inject || [],
206
479
  };
207
480
  }
208
481
  return {
209
482
  provide: constant_1.NOTIFICATION_OPTIONS,
210
- useFactory: async (optionsFactory) => this.santitizeOptions((await optionsFactory.createOptions())),
483
+ useFactory: async (optionsFactory) => this.sanitizeOptions((await optionsFactory.createOptions())),
211
484
  inject: [options.useClass || options.useExisting],
212
485
  };
213
486
  }
@@ -217,6 +490,6 @@ exports.NotificationModule = NotificationModule = NotificationModule_1 = __decor
217
490
  (0, common_1.Module)({})
218
491
  ], NotificationModule);
219
492
  const isProviderAsyncOptions = (options) => {
220
- return 'useExisting' in options || 'useClass' in options || 'useFactory' in options;
493
+ return options && ('useExisting' in options || 'useClass' in options || 'useFactory' in options);
221
494
  };
222
495
  //# sourceMappingURL=notification.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../lib/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAQwB;AACxB,oCAAoF;AACpF,yCAAkD;AAClD,0CAAkF;AAClF,mEAA+D;AAC/D,iEAA6D;AAC7D,4DAAiI;AAEjI,MAAM,cAAc,GAAwE;IAC1F,eAAe,EAAE,kCAAe;IAChC,cAAc,EAAE,6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B;SACF,CAAC;IACJ,CAAC;IAEO,MAAM,CAAC,0BAA0B,CACvC,OAAuC;QAEvC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO;gBACL,OAAO,EAAE,+BAAoB;gBAC7B,UAAU,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;oBAC5B,OAAO,IAAI,CAAC,gBAAgB,CAC1B,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAQ,CAC3C,CAAC;gBACJ,CAAC;gBACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;aAC7B,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,+BAAoB;YAC7B,UAAU,EAAE,KAAK,EAAE,cAAgD,EAAE,EAAE,CACrE,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,cAAc,CAAC,aAAa,EAAE,CAAQ,CAAC;YACtE,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAA;AA9OY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CA8O9B;AAoCD,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAmC,EAAE;IAC/E,OAAO,aAAa,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC;AACtF,CAAC,CAAA"}
1
+ {"version":3,"file":"notification.module.js","sourceRoot":"","sources":["../../lib/notification/notification.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAQwB;AACxB,yCAAkD;AAClD,0CAAuI;AACvI,mEAA+D;AAC/D,iEAA6D;AAC7D,gCAA+D;AAC/D,0CAAmF;AACnF,yEAAuE;AAEvE,mFAA8E;AAC9E,gDAAmD;AACnD,oCAAwC;AACxC,4DAA4E;AAC5E,8FAAyF;AACzF,gHAAkH;AACl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,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,cAAc,CAAC,aAAa,EAAE,CAAQ,CAAC;YACrE,MAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAA;AA7kBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CA6kB9B;AAuED,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAmC,EAAE;IAC/E,OAAO,OAAO,IAAI,CAAC,aAAa,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,IAAI,YAAY,IAAI,OAAO,CAAC,CAAC;AACnG,CAAC,CAAC"}
@@ -1,13 +1,25 @@
1
1
  import { ResolveOption, TemplateLoader } from "../template";
2
2
  import { EmailService } from "../email";
3
- import { BatchSendResult, SendResult, EmailAttachment, EmailMessage, PushMessage, PushMessageOnly, EmailNotificationPayload, PushNotificationPayload } from "../interface";
3
+ import { BatchSendResult, SendResult, EmailAttachment, EmailMessage, PushMessage, PushMessageOnly, EmailNotificationPayload, PushNotificationPayload, SmsNotificationPayload, WhatsAppNotificationPayload, NotificationPayload, NotificationResult } from "../interface";
4
4
  import { DeviceToken, PushNotificationService } from "../push-notification";
5
+ import { SmsService } from "../sms";
6
+ import { WhatsAppService } from "../whatsapp";
7
+ import { NotificationModuleOptions } from "./notification.module";
8
+ import { NotificationInterceptor } from "./notification.interceptor";
5
9
  export declare class NotificationService {
6
10
  private readonly templateLoader;
7
11
  private readonly emailService;
8
12
  private readonly pushNotificationService;
13
+ private readonly smsService;
14
+ private readonly whatsAppService;
15
+ private readonly options?;
16
+ private readonly interceptors?;
9
17
  private readonly logger;
10
- constructor(templateLoader: TemplateLoader, emailService: EmailService, pushNotificationService: PushNotificationService);
18
+ private readonly strict;
19
+ constructor(templateLoader: TemplateLoader, emailService: EmailService, pushNotificationService: PushNotificationService, smsService: SmsService, whatsAppService: WhatsAppService, options?: NotificationModuleOptions, interceptors?: NotificationInterceptor[]);
20
+ private runBeforeSendHooks;
21
+ private runAfterSendHooks;
22
+ private runOnErrorHooks;
11
23
  sendEmailRaw(message: EmailMessage): Promise<SendResult>;
12
24
  sendEmail(payload: EmailNotificationPayload): Promise<SendResult>;
13
25
  sendEmail(templateCode: string, email: string, resolveOption: ResolveOption, attachments: EmailAttachment[]): Promise<SendResult>;
@@ -18,4 +30,8 @@ export declare class NotificationService {
18
30
  sendPushNotificationMulticast(templateCode: string, tokens: DeviceToken[], resolveOption: ResolveOption): Promise<BatchSendResult>;
19
31
  protected isEmailPayload(value: any): value is EmailNotificationPayload;
20
32
  protected isPushNotificationPayload(value: any): value is PushNotificationPayload;
33
+ sendSms(payload: SmsNotificationPayload): Promise<SendResult>;
34
+ sendWhatsApp(payload: WhatsAppNotificationPayload): Promise<SendResult>;
35
+ private sendToChannel;
36
+ send(payload: NotificationPayload): Promise<NotificationResult>;
21
37
  }