@nathapp/nestjs-notification 2.1.1 → 2.2.0

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 (57) hide show
  1. package/UPGRADE-PLAN-PHASE7-8.md +307 -0
  2. package/UPGRADE-PLAN-PHASE9.md +361 -0
  3. package/UPGRADE-PLAN.md +425 -0
  4. package/dist/index.d.ts +3 -2
  5. package/dist/index.js +20 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/interface/index.d.ts +3 -3
  8. package/dist/interface/message.interface.d.ts +10 -2
  9. package/dist/interface/payload.inteface.d.ts +51 -0
  10. package/dist/notification/errors.d.ts +3 -0
  11. package/dist/notification/errors.js +11 -0
  12. package/dist/notification/errors.js.map +1 -0
  13. package/dist/notification/index.d.ts +6 -2
  14. package/dist/notification/index.js +7 -1
  15. package/dist/notification/index.js.map +1 -1
  16. package/dist/notification/notification-provider.factory.d.ts +5 -0
  17. package/dist/notification/notification-provider.factory.js +33 -0
  18. package/dist/notification/notification-provider.factory.js.map +1 -0
  19. package/dist/notification/notification.interceptor.d.ts +18 -0
  20. package/dist/notification/notification.interceptor.js +5 -0
  21. package/dist/notification/notification.interceptor.js.map +1 -0
  22. package/dist/notification/notification.module.d.ts +28 -18
  23. package/dist/notification/notification.module.js +324 -63
  24. package/dist/notification/notification.module.js.map +1 -1
  25. package/dist/notification/notification.service.d.ts +18 -2
  26. package/dist/notification/notification.service.js +274 -13
  27. package/dist/notification/notification.service.js.map +1 -1
  28. package/dist/notification/provider-config.d.ts +17 -0
  29. package/dist/notification/provider-config.js +3 -0
  30. package/dist/notification/provider-config.js.map +1 -0
  31. package/dist/push-notification/push-notification.service.js +2 -1
  32. package/dist/push-notification/push-notification.service.js.map +1 -1
  33. package/dist/template/constant.d.ts +1 -0
  34. package/dist/template/constant.js +2 -1
  35. package/dist/template/constant.js.map +1 -1
  36. package/dist/template/engines/string-format.engine.d.ts +6 -0
  37. package/dist/template/engines/string-format.engine.js +17 -0
  38. package/dist/template/engines/string-format.engine.js.map +1 -0
  39. package/dist/template/index.d.ts +4 -2
  40. package/dist/template/index.js +4 -1
  41. package/dist/template/index.js.map +1 -1
  42. package/dist/template/template-engine.d.ts +5 -0
  43. package/dist/template/template-engine.js +3 -0
  44. package/dist/template/template-engine.js.map +1 -0
  45. package/dist/template/template.loader.d.ts +4 -1
  46. package/dist/template/template.loader.js +22 -14
  47. package/dist/template/template.loader.js.map +1 -1
  48. package/dist/whatsapp/constant.d.ts +1 -0
  49. package/dist/whatsapp/constant.js +5 -0
  50. package/dist/whatsapp/constant.js.map +1 -0
  51. package/dist/whatsapp/index.d.ts +2 -0
  52. package/dist/whatsapp/index.js +19 -0
  53. package/dist/whatsapp/index.js.map +1 -0
  54. package/dist/whatsapp/whatsapp.service.d.ts +7 -0
  55. package/dist/whatsapp/whatsapp.service.js +7 -0
  56. package/dist/whatsapp/whatsapp.service.js.map +1 -0
  57. package/package.json +2 -1
@@ -0,0 +1,18 @@
1
+ import { SendResult, NotificationChannel } from "../interface";
2
+ export interface NotificationContext {
3
+ channel: NotificationChannel;
4
+ templateCode: string;
5
+ recipient: string;
6
+ resolvedMessage?: {
7
+ subject?: string;
8
+ content: string;
9
+ };
10
+ isFallback?: boolean;
11
+ failedChannel?: NotificationChannel;
12
+ }
13
+ export interface NotificationInterceptor {
14
+ beforeSend?(context: NotificationContext): Promise<NotificationContext> | NotificationContext;
15
+ afterSend?(context: NotificationContext, result: SendResult): Promise<void> | void;
16
+ onError?(context: NotificationContext, error: Error): Promise<void> | void;
17
+ }
18
+ export declare const NOTIFICATION_INTERCEPTORS = "NOTIFICATION_INTERCEPTORS";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NOTIFICATION_INTERCEPTORS = void 0;
4
+ exports.NOTIFICATION_INTERCEPTORS = 'NOTIFICATION_INTERCEPTORS';
5
+ //# sourceMappingURL=notification.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.interceptor.js","sourceRoot":"","sources":["../../lib/notification/notification.interceptor.ts"],"names":[],"mappings":";;;AAmBa,QAAA,yBAAyB,GAAG,2BAA2B,CAAC"}
@@ -1,39 +1,52 @@
1
1
  import { DynamicModule, ModuleMetadata, Type } from '@nestjs/common';
2
- import { EmailModuleAsyncOptions, EmailModuleOptions } from '../email';
3
- import { TemplateLoader } from '../template';
2
+ import { TemplateLoader, TemplateEngine } from '../template';
4
3
  import { TemplateService } from '../template/template.service';
5
4
  import { NotificationService } from './notification.service';
6
- import { PushNotificationModuleAsyncOptions, PushNotificationModuleOptions } from '../push-notification';
5
+ import { ProviderConfig } from './provider-config';
6
+ import { ProviderManager } from '../push-notification/push-notification-provider.manager';
7
+ import { UserTokenStore } from '../push-notification/user-token.store';
7
8
  export declare class NotificationModule {
8
9
  static forRoot(options: NotificationModuleOptions): DynamicModule;
9
10
  static forRootAsync(options: NotificationModuleAsyncOptions): Promise<DynamicModule>;
11
+ private static createChannelProviders;
12
+ private static groupProvidersByChannel;
13
+ private static createInterceptorProviders;
14
+ private static createTemplateEngine;
10
15
  private static createTemplateLoader;
11
16
  private static createTemplateService;
12
17
  private static createNotificationService;
13
- private static santitizeOptions;
14
- private static isEmailModuleAsyncOption;
15
- private static isPushNotificationModuleAsyncOption;
18
+ private static createProviderManagerAsync;
19
+ private static createUserTokenStoreAsync;
20
+ private static sanitizeOptions;
16
21
  private static createAsyncOptionsProviders;
17
22
  private static createAsyncOptionsProvider;
18
23
  }
19
24
  export interface NotificationModuleOptions {
20
- emailOptions?: EmailModuleOptions | EmailModuleAsyncOptions;
21
- pushNotificationOptions?: PushNotificationModuleOptions | PushNotificationModuleAsyncOptions;
22
- templateLoader: Type<TemplateLoader>;
25
+ providers?: ProviderConfig[];
26
+ templateLoader: Type<TemplateLoader> | ProviderAsyncOptions<TemplateLoader>;
27
+ templateEngine?: Type<TemplateEngine>;
23
28
  templateService?: Type<TemplateService>;
24
29
  notificationService?: Type<NotificationService>;
30
+ interceptors?: Type<any>[];
31
+ strict?: boolean;
32
+ providerManager?: Type<ProviderManager>;
33
+ userTokenStore?: Type<UserTokenStore>;
25
34
  }
26
- export type NotificationModuleOptionsWithoutProvider = Omit<NotificationModuleOptions, 'templateLoader' | 'templateService' | 'notificationService'>;
27
35
  export interface NotificationModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
28
- emailOptions?: EmailModuleOptions | EmailModuleAsyncOptions;
29
- pushNotificationOptions?: PushNotificationModuleOptions | PushNotificationModuleAsyncOptions;
30
- useExisting?: Type<NotificationModuleOptionsFactory>;
31
36
  useClass?: Type<NotificationModuleOptionsFactory>;
32
- useFactory?: (...args: any[]) => Promise<NotificationModuleOptionsWithoutProvider> | NotificationModuleOptionsWithoutProvider;
37
+ useExisting?: Type<NotificationModuleOptionsFactory>;
38
+ useFactory?: (...args: any[]) => NotificationModuleOptions | Promise<NotificationModuleOptions>;
33
39
  inject?: any[];
34
- templateLoader: Type<TemplateLoader> | ProviderAsyncOptions<TemplateLoader>;
40
+ templateEngine?: Type<TemplateEngine> | ProviderAsyncOptions<TemplateEngine>;
41
+ templateLoader?: Type<TemplateLoader> | ProviderAsyncOptions<TemplateLoader>;
35
42
  templateService?: Type<TemplateService> | ProviderAsyncOptions<TemplateService>;
36
43
  notificationService?: Type<NotificationService> | ProviderAsyncOptions<NotificationService>;
44
+ interceptors?: Type<any>[];
45
+ providerManager?: Type<ProviderManager> | ProviderAsyncOptions<ProviderManager>;
46
+ userTokenStore?: Type<UserTokenStore> | ProviderAsyncOptions<UserTokenStore>;
47
+ }
48
+ export interface NotificationModuleOptionsFactory {
49
+ createOptions(): NotificationModuleOptions | Promise<NotificationModuleOptions>;
37
50
  }
38
51
  export interface ProviderAsyncOptions<T = any> extends Pick<ModuleMetadata, 'imports'> {
39
52
  useExisting?: Type<T>;
@@ -41,6 +54,3 @@ export interface ProviderAsyncOptions<T = any> extends Pick<ModuleMetadata, 'imp
41
54
  useFactory?: (...args: any[]) => T | Promise<T>;
42
55
  inject?: any[];
43
56
  }
44
- export interface NotificationModuleOptionsFactory {
45
- createOptions(): NotificationModuleOptionsWithoutProvider | Promise<NotificationModuleOptionsWithoutProvider>;
46
- }
@@ -9,90 +9,293 @@ 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
84
  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,
85
+ options = this.sanitizeOptions(options);
86
+ const imports = options.imports || [];
87
+ const providers = [];
88
+ const asyncOptionsProviders = this.createAsyncOptionsProviders(options);
89
+ providers.push(...asyncOptionsProviders);
90
+ const channelProvidersFactory = {
91
+ provide: 'CHANNEL_PROVIDERS',
92
+ useFactory: (resolvedOptions) => {
93
+ return this.createChannelProviders(resolvedOptions.providers || []);
94
+ },
95
+ inject: [constant_1.NOTIFICATION_OPTIONS],
96
+ };
97
+ providers.push(channelProvidersFactory);
98
+ const channelServicesProvider = {
99
+ provide: 'CHANNEL_SERVICES_SETUP',
100
+ useFactory: (channelProviders) => {
101
+ return channelProviders;
102
+ },
103
+ inject: ['CHANNEL_PROVIDERS'],
87
104
  };
105
+ providers.push(channelServicesProvider);
106
+ providers.push({
107
+ provide: constant_2.EMAIL_PROVIDER,
108
+ useFactory: (resolvedOptions) => {
109
+ const emailConfig = (resolvedOptions.providers || []).find(p => p.channel === 'email');
110
+ if (!emailConfig)
111
+ return null;
112
+ return notification_provider_factory_1.NotificationProviderFactory.create(emailConfig);
113
+ },
114
+ inject: [constant_1.NOTIFICATION_OPTIONS],
115
+ });
116
+ providers.push({
117
+ provide: email_1.EmailService,
118
+ useFactory: (emailProvider) => {
119
+ if (!emailProvider)
120
+ return null;
121
+ return new email_1.EmailService(emailProvider);
122
+ },
123
+ inject: [constant_2.EMAIL_PROVIDER],
124
+ });
125
+ providers.push({
126
+ provide: constant_3.PUSH_NOTIFICATION_PROVIDERS,
127
+ useFactory: (resolvedOptions) => {
128
+ const pushConfigs = (resolvedOptions.providers || []).filter(p => p.channel === 'push');
129
+ return pushConfigs.map(config => notification_provider_factory_1.NotificationProviderFactory.create(config));
130
+ },
131
+ inject: [constant_1.NOTIFICATION_OPTIONS],
132
+ });
133
+ const providerManagerProvider = this.createProviderManagerAsync(options);
134
+ providers.push(providerManagerProvider);
135
+ const userTokenStoreProvider = this.createUserTokenStoreAsync(options);
136
+ providers.push(userTokenStoreProvider);
137
+ providers.push({
138
+ provide: push_notification_service_1.PushNotificationService,
139
+ useFactory: (pushProviders, manager, store) => {
140
+ if (!pushProviders || pushProviders.length === 0)
141
+ return null;
142
+ return new push_notification_service_1.PushNotificationService(manager, store);
143
+ },
144
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS, push_notification_provider_manager_1.ProviderManager, user_token_store_1.UserTokenStore],
145
+ });
146
+ providers.push({
147
+ provide: sms_1.SmsService,
148
+ useFactory: (resolvedOptions) => {
149
+ const smsConfig = (resolvedOptions.providers || []).find(p => p.channel === 'sms');
150
+ if (!smsConfig)
151
+ return null;
152
+ return notification_provider_factory_1.NotificationProviderFactory.create(smsConfig);
153
+ },
154
+ inject: [constant_1.NOTIFICATION_OPTIONS],
155
+ });
156
+ providers.push({
157
+ provide: whatsapp_1.WhatsAppService,
158
+ useFactory: (resolvedOptions) => {
159
+ const whatsappConfig = (resolvedOptions.providers || []).find(p => p.channel === 'whatsapp');
160
+ if (!whatsappConfig)
161
+ return null;
162
+ return notification_provider_factory_1.NotificationProviderFactory.create(whatsappConfig);
163
+ },
164
+ inject: [constant_1.NOTIFICATION_OPTIONS],
165
+ });
166
+ const templateEngine = this.createTemplateEngine(options);
167
+ providers.push(templateEngine);
88
168
  const templateLoader = this.createTemplateLoader(options);
169
+ providers.push(templateLoader);
89
170
  const templateService = this.createTemplateService(options);
171
+ providers.push(templateService);
90
172
  const notificationService = this.createNotificationService(options);
173
+ providers.push(notificationService);
174
+ const interceptorProviders = this.createInterceptorProviders(options.interceptors || []);
175
+ providers.push(...interceptorProviders);
91
176
  return {
92
177
  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],
178
+ imports,
179
+ providers,
180
+ exports: [
181
+ constant_1.NOTIFICATION_OPTIONS,
182
+ template_1.TEMPLATE_ENGINE,
183
+ template_1.TEMPLATE_LOADER,
184
+ template_service_1.TemplateService,
185
+ notification_service_1.NotificationService,
186
+ email_1.EmailService,
187
+ push_notification_service_1.PushNotificationService,
188
+ sms_1.SmsService,
189
+ whatsapp_1.WhatsAppService,
190
+ ],
191
+ };
192
+ }
193
+ static createChannelProviders(configs) {
194
+ const providers = [];
195
+ const groupedByChannel = this.groupProvidersByChannel(configs);
196
+ if (groupedByChannel.email.length > 0) {
197
+ const emailConfig = groupedByChannel.email[0];
198
+ const emailProvider = notification_provider_factory_1.NotificationProviderFactory.create(emailConfig);
199
+ providers.push({
200
+ provide: constant_2.EMAIL_PROVIDER,
201
+ useValue: emailProvider,
202
+ });
203
+ providers.push({
204
+ provide: email_1.EmailService,
205
+ useFactory: (provider) => new email_1.EmailService(provider),
206
+ inject: [constant_2.EMAIL_PROVIDER],
207
+ });
208
+ }
209
+ if (groupedByChannel.push.length > 0) {
210
+ const pushProviders = groupedByChannel.push.map(config => notification_provider_factory_1.NotificationProviderFactory.create(config));
211
+ providers.push({
212
+ provide: constant_3.PUSH_NOTIFICATION_PROVIDERS,
213
+ useValue: pushProviders,
214
+ });
215
+ providers.push({
216
+ provide: push_notification_provider_manager_1.ProviderManager,
217
+ useFactory: (providers) => new push_notification_provider_manager_1.DefaultProviderManager(providers),
218
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS],
219
+ });
220
+ providers.push({
221
+ provide: user_token_store_1.UserTokenStore,
222
+ useFactory: () => new user_token_store_1.InMemoryUserTokenStore(),
223
+ });
224
+ providers.push({
225
+ provide: push_notification_service_1.PushNotificationService,
226
+ useFactory: (manager, store) => new push_notification_service_1.PushNotificationService(manager, store),
227
+ inject: [push_notification_provider_manager_1.ProviderManager, user_token_store_1.UserTokenStore],
228
+ });
229
+ }
230
+ if (groupedByChannel.sms.length > 0) {
231
+ const smsConfig = groupedByChannel.sms[0];
232
+ const smsProvider = notification_provider_factory_1.NotificationProviderFactory.create(smsConfig);
233
+ providers.push({
234
+ provide: sms_1.SmsService,
235
+ useValue: smsProvider,
236
+ });
237
+ }
238
+ if (groupedByChannel.whatsapp.length > 0) {
239
+ const whatsappConfig = groupedByChannel.whatsapp[0];
240
+ const whatsappProvider = notification_provider_factory_1.NotificationProviderFactory.create(whatsappConfig);
241
+ providers.push({
242
+ provide: whatsapp_1.WhatsAppService,
243
+ useValue: whatsappProvider,
244
+ });
245
+ }
246
+ return providers;
247
+ }
248
+ static groupProvidersByChannel(configs) {
249
+ return configs.reduce((acc, config) => {
250
+ acc[config.channel].push(config);
251
+ return acc;
252
+ }, { email: [], push: [], sms: [], whatsapp: [] });
253
+ }
254
+ static createInterceptorProviders(interceptors) {
255
+ if (!interceptors || interceptors.length === 0) {
256
+ return [];
257
+ }
258
+ const providers = [];
259
+ providers.push(...interceptors.map(interceptor => ({
260
+ provide: interceptor,
261
+ useClass: interceptor,
262
+ })));
263
+ providers.push({
264
+ provide: notification_interceptor_1.NOTIFICATION_INTERCEPTORS,
265
+ useFactory: (...interceptorInstances) => interceptorInstances,
266
+ inject: interceptors,
267
+ });
268
+ return providers;
269
+ }
270
+ static createTemplateEngine(options) {
271
+ const providerOptions = 'templateEngine' in options ? options.templateEngine : undefined;
272
+ if (!providerOptions) {
273
+ return {
274
+ provide: template_1.TEMPLATE_ENGINE,
275
+ useClass: template_1.StringFormatEngine,
276
+ };
277
+ }
278
+ if (!isProviderAsyncOptions(providerOptions)) {
279
+ return {
280
+ provide: template_1.TEMPLATE_ENGINE,
281
+ useClass: providerOptions,
282
+ };
283
+ }
284
+ if (providerOptions.useFactory) {
285
+ return {
286
+ provide: template_1.TEMPLATE_ENGINE,
287
+ useFactory(...args) {
288
+ return providerOptions.useFactory(...args);
289
+ },
290
+ inject: providerOptions.inject || [],
291
+ };
292
+ }
293
+ return {
294
+ provide: template_1.TEMPLATE_ENGINE,
295
+ useFactory(engine) {
296
+ return engine;
297
+ },
298
+ inject: [providerOptions.useClass || providerOptions.useExisting],
96
299
  };
97
300
  }
98
301
  static createTemplateLoader(options) {
@@ -170,18 +373,76 @@ let NotificationModule = NotificationModule_1 = class NotificationModule {
170
373
  inject: [providerOptions.useClass || providerOptions.useExisting],
171
374
  };
172
375
  }
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;
376
+ static createProviderManagerAsync(options) {
377
+ const providerOptions = options.providerManager;
378
+ if (!providerOptions) {
379
+ return {
380
+ provide: push_notification_provider_manager_1.ProviderManager,
381
+ useFactory: (providers) => {
382
+ if (!providers || providers.length === 0)
383
+ return null;
384
+ return new push_notification_provider_manager_1.DefaultProviderManager(providers);
385
+ },
386
+ inject: [constant_3.PUSH_NOTIFICATION_PROVIDERS],
387
+ };
388
+ }
389
+ if (!isProviderAsyncOptions(providerOptions)) {
390
+ return {
391
+ provide: push_notification_provider_manager_1.ProviderManager,
392
+ useClass: providerOptions,
393
+ };
394
+ }
395
+ if (providerOptions.useFactory) {
396
+ return {
397
+ provide: push_notification_provider_manager_1.ProviderManager,
398
+ useFactory(...args) {
399
+ return providerOptions.useFactory(...args);
400
+ },
401
+ inject: providerOptions.inject || [],
402
+ };
403
+ }
404
+ return {
405
+ provide: push_notification_provider_manager_1.ProviderManager,
406
+ useFactory(manager) {
407
+ return manager;
408
+ },
409
+ inject: [providerOptions.useClass || providerOptions.useExisting],
410
+ };
179
411
  }
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;
412
+ static createUserTokenStoreAsync(options) {
413
+ const providerOptions = options.userTokenStore;
414
+ if (!providerOptions) {
415
+ return {
416
+ provide: user_token_store_1.UserTokenStore,
417
+ useFactory: () => new user_token_store_1.InMemoryUserTokenStore(),
418
+ };
419
+ }
420
+ if (!isProviderAsyncOptions(providerOptions)) {
421
+ return {
422
+ provide: user_token_store_1.UserTokenStore,
423
+ useClass: providerOptions,
424
+ };
184
425
  }
426
+ if (providerOptions.useFactory) {
427
+ return {
428
+ provide: user_token_store_1.UserTokenStore,
429
+ useFactory(...args) {
430
+ return providerOptions.useFactory(...args);
431
+ },
432
+ inject: providerOptions.inject || [],
433
+ };
434
+ }
435
+ return {
436
+ provide: user_token_store_1.UserTokenStore,
437
+ useFactory(store) {
438
+ return store;
439
+ },
440
+ inject: [providerOptions.useClass || providerOptions.useExisting],
441
+ };
442
+ }
443
+ static sanitizeOptions(options) {
444
+ options = { ...defaultOptions, ...options };
445
+ return options;
185
446
  }
186
447
  static createAsyncOptionsProviders(options) {
187
448
  if (options.useExisting || options.useFactory) {
@@ -200,14 +461,14 @@ let NotificationModule = NotificationModule_1 = class NotificationModule {
200
461
  return {
201
462
  provide: constant_1.NOTIFICATION_OPTIONS,
202
463
  useFactory: async (...args) => {
203
- return this.santitizeOptions((await options.useFactory(...args)));
464
+ return this.sanitizeOptions((await options.useFactory(...args)));
204
465
  },
205
466
  inject: options.inject || [],
206
467
  };
207
468
  }
208
469
  return {
209
470
  provide: constant_1.NOTIFICATION_OPTIONS,
210
- useFactory: async (optionsFactory) => this.santitizeOptions((await optionsFactory.createOptions())),
471
+ useFactory: async (optionsFactory) => this.sanitizeOptions((await optionsFactory.createOptions())),
211
472
  inject: [options.useClass || options.useExisting],
212
473
  };
213
474
  }
@@ -217,6 +478,6 @@ exports.NotificationModule = NotificationModule = NotificationModule_1 = __decor
217
478
  (0, common_1.Module)({})
218
479
  ], NotificationModule);
219
480
  const isProviderAsyncOptions = (options) => {
220
- return 'useExisting' in options || 'useClass' in options || 'useFactory' in options;
481
+ return options && ('useExisting' in options || 'useClass' in options || 'useFactory' in options);
221
482
  };
222
483
  //# 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,6BAAkB;IAClC,mBAAmB,EAAE,0CAAmB;CACzC,CAAC;AAMK,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,OAAkC;QAC/C,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAEzC,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,EAAE,YAAY,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC;QAE1D,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChD,OAAO,CAAC,IAAI,CAAC,mBAAW,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;YACtD,CAAC;iBAAM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,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,gCAAoC;AACpC,0CAA8C;AAC9C,yEAAuE;AAEvE,mFAA8E;AAC9E,gDAAmD;AACnD,oCAAwC;AACxC,4DAA4E;AAC5E,8FAAyF;AACzF,gHAAkH;AAClH,4EAA+F;AAE/F,MAAM,cAAc,GAAwE;IAC1F,eAAe,EAAE,kCAAe;IAChC,cAAc,EAAE,6BAAkB;IAClC,mBAAmB,EAAE,0CAAmB;IACxC,MAAM,EAAE,IAAI;CACb,CAAC;AAMK,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,OAAkC;QAC/C,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAExC,MAAM,SAAS,GAAe,EAAE,CAAC;QAGjC,MAAM,aAAa,GAAkB;YACnC,OAAO,EAAE,+BAAoB;YAC7B,QAAQ,EAAE,OAAO;SAClB,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAG9B,MAAM,g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oB;gBAC7B,UAAU,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;oBAC5B,OAAO,IAAI,CAAC,eAAe,CACzB,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,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;AAtkBY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CAskB9B;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
  }