@takentrade/takentrade-libs 4.0.8 → 4.1.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.
|
@@ -330,6 +330,11 @@ let NotificationClient = class NotificationClient {
|
|
|
330
330
|
this.validatePhoneNumber(recipient);
|
|
331
331
|
this.natsClient.emit(notification_enum_1.NotificationSubcribedNATSSubject.NOTIFICATION_OTP_VOICE, { to: recipient, ...data, user_id, bypassPreferenceCheck });
|
|
332
332
|
}
|
|
333
|
+
else if (channel == notification_enum_1.OTPNotificationChannel.whatsapp) {
|
|
334
|
+
const recipient = Array.isArray(to) ? to[0] : to;
|
|
335
|
+
this.validatePhoneNumber(recipient);
|
|
336
|
+
this.natsClient.emit(notification_enum_1.NotificationSubcribedNATSSubject.NOTIFICATION_OTP_WHATSAPP, { to: recipient, ...data, user_id, bypassPreferenceCheck });
|
|
337
|
+
}
|
|
333
338
|
else {
|
|
334
339
|
throw new common_1.BadRequestException('Invalid OTP channel');
|
|
335
340
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export declare enum NotificationTextChannel {
|
|
2
|
-
sms = "sms"
|
|
2
|
+
sms = "sms",
|
|
3
|
+
whatsapp = "whatsapp"
|
|
3
4
|
}
|
|
4
5
|
export declare enum OTPNotificationChannel {
|
|
5
6
|
sms = "sms",
|
|
6
7
|
voice = "voice",
|
|
8
|
+
whatsapp = "whatsapp",
|
|
7
9
|
mail = "mail"
|
|
8
10
|
}
|
|
9
11
|
export declare enum NotificationSubcribedNATSSubject {
|
|
@@ -41,6 +43,7 @@ export declare enum NotificationSubcribedNATSSubject {
|
|
|
41
43
|
NOTIFICATION_OTP_TEXT = "notification.text.otp",
|
|
42
44
|
NOTIFICATION_TEXT_PREFERENCE = "notification.text.preference",
|
|
43
45
|
NOTIFICATION_OTP_VOICE = "notification.voice.otp",
|
|
46
|
+
NOTIFICATION_OTP_WHATSAPP = "notification.whatsapp.otp",
|
|
44
47
|
NOTIFICATION_PUSH = "notification.push",
|
|
45
48
|
NOTIFICATION_PUSH_ALL = "notification.push.all"
|
|
46
49
|
}
|
|
@@ -4,11 +4,13 @@ exports.NotificationSubcribedNATSSubject = exports.OTPNotificationChannel = expo
|
|
|
4
4
|
var NotificationTextChannel;
|
|
5
5
|
(function (NotificationTextChannel) {
|
|
6
6
|
NotificationTextChannel["sms"] = "sms";
|
|
7
|
+
NotificationTextChannel["whatsapp"] = "whatsapp";
|
|
7
8
|
})(NotificationTextChannel || (exports.NotificationTextChannel = NotificationTextChannel = {}));
|
|
8
9
|
var OTPNotificationChannel;
|
|
9
10
|
(function (OTPNotificationChannel) {
|
|
10
11
|
OTPNotificationChannel["sms"] = "sms";
|
|
11
12
|
OTPNotificationChannel["voice"] = "voice";
|
|
13
|
+
OTPNotificationChannel["whatsapp"] = "whatsapp";
|
|
12
14
|
OTPNotificationChannel["mail"] = "mail";
|
|
13
15
|
})(OTPNotificationChannel || (exports.OTPNotificationChannel = OTPNotificationChannel = {}));
|
|
14
16
|
var NotificationSubcribedNATSSubject;
|
|
@@ -50,6 +52,8 @@ var NotificationSubcribedNATSSubject;
|
|
|
50
52
|
NotificationSubcribedNATSSubject["NOTIFICATION_TEXT_PREFERENCE"] = "notification.text.preference";
|
|
51
53
|
// VOICE
|
|
52
54
|
NotificationSubcribedNATSSubject["NOTIFICATION_OTP_VOICE"] = "notification.voice.otp";
|
|
55
|
+
// WHATSAPP
|
|
56
|
+
NotificationSubcribedNATSSubject["NOTIFICATION_OTP_WHATSAPP"] = "notification.whatsapp.otp";
|
|
53
57
|
// PUSH
|
|
54
58
|
NotificationSubcribedNATSSubject["NOTIFICATION_PUSH"] = "notification.push";
|
|
55
59
|
NotificationSubcribedNATSSubject["NOTIFICATION_PUSH_ALL"] = "notification.push.all";
|
|
@@ -27,7 +27,8 @@ export interface BaseEmailData {
|
|
|
27
27
|
firstName: string;
|
|
28
28
|
currentYear: number;
|
|
29
29
|
}
|
|
30
|
-
export interface OTPMailData extends BaseEmailData {
|
|
30
|
+
export interface OTPMailData extends Omit<BaseEmailData, 'firstName'> {
|
|
31
|
+
firstName?: string;
|
|
31
32
|
otp: number;
|
|
32
33
|
expiration: string;
|
|
33
34
|
}
|