aeremmiddleware 1.0.12 → 1.0.14
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/README.md +28 -28
- package/dist/Finance/ingenicoHtml.js +114 -114
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/package.json +21 -20
- package/src/Finance/Ingenico.types.ts +21 -21
- package/src/Finance/crimeCheck.ts +135 -135
- package/src/Finance/crimecheck.types.ts +31 -31
- package/src/Finance/encrypt.ts +18 -18
- package/src/Finance/idfy.ts +542 -542
- package/src/Finance/index.ts +13 -13
- package/src/Finance/ingenico.ts +110 -110
- package/src/Finance/ingenicoHtml.ts +119 -119
- package/src/Finance/novel.ts +226 -226
- package/src/Finance/novel.types.ts +24 -24
- package/src/Finance/qbrik.ts +822 -822
- package/src/Finance/qbrik.types.ts +81 -81
- package/src/{pushNotification → PushNotification}/pushNotificationFCM.ts +35 -35
- package/src/Socials/Sms.types.ts +9 -9
- package/src/Socials/SmsSender.ts +78 -78
- package/src/Socials/Whatsapp.types.ts +95 -95
- package/src/Socials/index.ts +6 -6
- package/src/Socials/whatsApp.ts +188 -188
- package/src/index.ts +9 -9
- package/tsconfig.json +111 -111
- package/dist/Finance/qbrik.d.ts +0 -100
- package/dist/Finance/qbrik.js +0 -506
- package/dist/Finance/qbrik.js.map +0 -1
- package/dist/Finance/qbrik.types.d.ts +0 -76
- package/dist/Finance/qbrik.types.js +0 -3
- package/dist/Finance/qbrik.types.js.map +0 -1
- package/dist/pushNotification/index.d.ts +0 -4
- package/dist/pushNotification/index.js +0 -8
- package/dist/pushNotification/index.js.map +0 -1
- package/dist/pushNotification/pushNotificationFCM.d.ts +0 -1
- package/dist/pushNotification/pushNotificationFCM.js +0 -42
- package/dist/pushNotification/pushNotificationFCM.js.map +0 -1
- package/src/pushNotification/index.ts +0 -5
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
export interface LoginDetails {
|
|
2
|
-
username: string;
|
|
3
|
-
password: string;
|
|
4
|
-
version?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface CustomerDetails {
|
|
8
|
-
enrollment_date: string;
|
|
9
|
-
legal_name: string;
|
|
10
|
-
date_of_incorporation: string;
|
|
11
|
-
branch_code: string;
|
|
12
|
-
branch_name: string;
|
|
13
|
-
client_type: string;
|
|
14
|
-
institutional_type: string;
|
|
15
|
-
identity_proof_type: string;
|
|
16
|
-
identity_proof_number: string;
|
|
17
|
-
identity_proof_is_primary: string;
|
|
18
|
-
identity_proof_is_address_proof: string;
|
|
19
|
-
identity_proof_is_id_proof: string;
|
|
20
|
-
identity_proof_is_address_proof_primary: string;
|
|
21
|
-
identity_proof_is_id_proof_primary: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface MasterListInput {
|
|
25
|
-
name_0: string;
|
|
26
|
-
name_1?: string;
|
|
27
|
-
name_2?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface EntityPayload {
|
|
31
|
-
entity_no: string;
|
|
32
|
-
identity_proof_type: string;
|
|
33
|
-
identity_proof_number: string;
|
|
34
|
-
identity_proof_is_id_proof: string;
|
|
35
|
-
identity_proof_is_id_proof_primary: string;
|
|
36
|
-
identity_proof_is_address_proof: string;
|
|
37
|
-
transaction_id: string;
|
|
38
|
-
identity_proof_is_address_proof_primary: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ApproveData {
|
|
42
|
-
account_no: string;
|
|
43
|
-
approved_loan_amount: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface AssociateDetails {
|
|
47
|
-
account_no: string;
|
|
48
|
-
associate_type: string;
|
|
49
|
-
associate_entity_no?: string;
|
|
50
|
-
associate_relation?: string;
|
|
51
|
-
associate_legal_name?: string;
|
|
52
|
-
associate_alias?: string;
|
|
53
|
-
associate_date_of_birth?: string;
|
|
54
|
-
associate_gender?: string;
|
|
55
|
-
associate_occupation?: string;
|
|
56
|
-
associate_father_name?: string;
|
|
57
|
-
associate_telephone?: string;
|
|
58
|
-
associate_education_level?: string;
|
|
59
|
-
associate_marital_status?: string;
|
|
60
|
-
auto_create_area?: string;
|
|
61
|
-
associate_address_residence_state_name?: string;
|
|
62
|
-
associate_address_residence_district_name?: string;
|
|
63
|
-
associate_address_residence_block_name?: string;
|
|
64
|
-
associate_address_residence_area_name?: string;
|
|
65
|
-
associate_address_residence_pincode?: string;
|
|
66
|
-
associate_address_residence_address?: string;
|
|
67
|
-
associate_address_office_address?: string;
|
|
68
|
-
associate_address_office_state_name?: string;
|
|
69
|
-
associate_address_office_district_name?: string;
|
|
70
|
-
associate_address_office_block_name?: string;
|
|
71
|
-
associate_address_office_area_name?: string;
|
|
72
|
-
associate_address_office_pincode?: string;
|
|
73
|
-
associate_bank_details_bank_name?: string;
|
|
74
|
-
associate_bank_details_branch_name?: string;
|
|
75
|
-
associate_bank_details_IFSCCode?: string;
|
|
76
|
-
associate_bank_details_account_no?: string;
|
|
77
|
-
associate_bank_details_account_type?: string;
|
|
78
|
-
associate_bank_details_beneficiary_name?: string;
|
|
79
|
-
associate_bank_details_is_primary?: string;
|
|
80
|
-
associate_comment?: string;
|
|
81
|
-
}
|
|
1
|
+
export interface LoginDetails {
|
|
2
|
+
username: string;
|
|
3
|
+
password: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface CustomerDetails {
|
|
8
|
+
enrollment_date: string;
|
|
9
|
+
legal_name: string;
|
|
10
|
+
date_of_incorporation: string;
|
|
11
|
+
branch_code: string;
|
|
12
|
+
branch_name: string;
|
|
13
|
+
client_type: string;
|
|
14
|
+
institutional_type: string;
|
|
15
|
+
identity_proof_type: string;
|
|
16
|
+
identity_proof_number: string;
|
|
17
|
+
identity_proof_is_primary: string;
|
|
18
|
+
identity_proof_is_address_proof: string;
|
|
19
|
+
identity_proof_is_id_proof: string;
|
|
20
|
+
identity_proof_is_address_proof_primary: string;
|
|
21
|
+
identity_proof_is_id_proof_primary: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface MasterListInput {
|
|
25
|
+
name_0: string;
|
|
26
|
+
name_1?: string;
|
|
27
|
+
name_2?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface EntityPayload {
|
|
31
|
+
entity_no: string;
|
|
32
|
+
identity_proof_type: string;
|
|
33
|
+
identity_proof_number: string;
|
|
34
|
+
identity_proof_is_id_proof: string;
|
|
35
|
+
identity_proof_is_id_proof_primary: string;
|
|
36
|
+
identity_proof_is_address_proof: string;
|
|
37
|
+
transaction_id: string;
|
|
38
|
+
identity_proof_is_address_proof_primary: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ApproveData {
|
|
42
|
+
account_no: string;
|
|
43
|
+
approved_loan_amount: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AssociateDetails {
|
|
47
|
+
account_no: string;
|
|
48
|
+
associate_type: string;
|
|
49
|
+
associate_entity_no?: string;
|
|
50
|
+
associate_relation?: string;
|
|
51
|
+
associate_legal_name?: string;
|
|
52
|
+
associate_alias?: string;
|
|
53
|
+
associate_date_of_birth?: string;
|
|
54
|
+
associate_gender?: string;
|
|
55
|
+
associate_occupation?: string;
|
|
56
|
+
associate_father_name?: string;
|
|
57
|
+
associate_telephone?: string;
|
|
58
|
+
associate_education_level?: string;
|
|
59
|
+
associate_marital_status?: string;
|
|
60
|
+
auto_create_area?: string;
|
|
61
|
+
associate_address_residence_state_name?: string;
|
|
62
|
+
associate_address_residence_district_name?: string;
|
|
63
|
+
associate_address_residence_block_name?: string;
|
|
64
|
+
associate_address_residence_area_name?: string;
|
|
65
|
+
associate_address_residence_pincode?: string;
|
|
66
|
+
associate_address_residence_address?: string;
|
|
67
|
+
associate_address_office_address?: string;
|
|
68
|
+
associate_address_office_state_name?: string;
|
|
69
|
+
associate_address_office_district_name?: string;
|
|
70
|
+
associate_address_office_block_name?: string;
|
|
71
|
+
associate_address_office_area_name?: string;
|
|
72
|
+
associate_address_office_pincode?: string;
|
|
73
|
+
associate_bank_details_bank_name?: string;
|
|
74
|
+
associate_bank_details_branch_name?: string;
|
|
75
|
+
associate_bank_details_IFSCCode?: string;
|
|
76
|
+
associate_bank_details_account_no?: string;
|
|
77
|
+
associate_bank_details_account_type?: string;
|
|
78
|
+
associate_bank_details_beneficiary_name?: string;
|
|
79
|
+
associate_bank_details_is_primary?: string;
|
|
80
|
+
associate_comment?: string;
|
|
81
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const FCM = require("fcm-node");
|
|
2
|
-
|
|
3
|
-
export async function sendPushNotification(
|
|
4
|
-
serverKey:string,
|
|
5
|
-
registrationIds: string[],
|
|
6
|
-
title: string,
|
|
7
|
-
body: string,
|
|
8
|
-
data: {},
|
|
9
|
-
icon?: string,
|
|
10
|
-
sound?: string,
|
|
11
|
-
): Promise<any> {
|
|
12
|
-
const fcm = new FCM(serverKey);
|
|
13
|
-
|
|
14
|
-
return new Promise((resolve, reject) => {
|
|
15
|
-
const pushMessage = {
|
|
16
|
-
registration_ids: registrationIds,
|
|
17
|
-
notification: {
|
|
18
|
-
body: body,
|
|
19
|
-
icon: icon || "myicon",
|
|
20
|
-
sound: sound || "mySound",
|
|
21
|
-
title: title,
|
|
22
|
-
},
|
|
23
|
-
data: data,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
fcm.send(pushMessage, (err: any, response: any) => {
|
|
27
|
-
if (err) {
|
|
28
|
-
console.log("Something has gone wrong!", err);
|
|
29
|
-
reject(err);
|
|
30
|
-
} else {
|
|
31
|
-
console.log("Push notification sent.", response);
|
|
32
|
-
resolve(response);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
1
|
+
const FCM = require("fcm-node");
|
|
2
|
+
|
|
3
|
+
export async function sendPushNotification(
|
|
4
|
+
serverKey:string,
|
|
5
|
+
registrationIds: string[],
|
|
6
|
+
title: string,
|
|
7
|
+
body: string,
|
|
8
|
+
data: {},
|
|
9
|
+
icon?: string,
|
|
10
|
+
sound?: string,
|
|
11
|
+
): Promise<any> {
|
|
12
|
+
const fcm = new FCM(serverKey);
|
|
13
|
+
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
const pushMessage = {
|
|
16
|
+
registration_ids: registrationIds,
|
|
17
|
+
notification: {
|
|
18
|
+
body: body,
|
|
19
|
+
icon: icon || "myicon",
|
|
20
|
+
sound: sound || "mySound",
|
|
21
|
+
title: title,
|
|
22
|
+
},
|
|
23
|
+
data: data,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
fcm.send(pushMessage, (err: any, response: any) => {
|
|
27
|
+
if (err) {
|
|
28
|
+
console.log("Something has gone wrong!", err);
|
|
29
|
+
reject(err);
|
|
30
|
+
} else {
|
|
31
|
+
console.log("Push notification sent.", response);
|
|
32
|
+
resolve(response);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
36
|
}
|
package/src/Socials/Sms.types.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export enum Provider {
|
|
2
|
-
EXOTEL = "EXOTEL",
|
|
3
|
-
GUPSHUP = "GUPSHUP",
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface DemoBody{
|
|
7
|
-
To:string,
|
|
8
|
-
Body:string,
|
|
9
|
-
}
|
|
1
|
+
export enum Provider {
|
|
2
|
+
EXOTEL = "EXOTEL",
|
|
3
|
+
GUPSHUP = "GUPSHUP",
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface DemoBody{
|
|
7
|
+
To:string,
|
|
8
|
+
Body:string,
|
|
9
|
+
}
|
package/src/Socials/SmsSender.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { DemoBody, Provider } from "./Sms.types";
|
|
3
|
-
|
|
4
|
-
class SmsSender {
|
|
5
|
-
private exotelSid: string;
|
|
6
|
-
private exotelToken: string;
|
|
7
|
-
private exotelApiKey: string;
|
|
8
|
-
private smsUrl!: string;
|
|
9
|
-
private provider: string;
|
|
10
|
-
|
|
11
|
-
constructor(payload: {
|
|
12
|
-
exotelSid: string;
|
|
13
|
-
exotelToken: string;
|
|
14
|
-
exotelApiKey: string;
|
|
15
|
-
provider: string;
|
|
16
|
-
}) {
|
|
17
|
-
const { exotelSid, exotelToken, exotelApiKey, provider } = payload;
|
|
18
|
-
this.exotelSid = exotelSid;
|
|
19
|
-
this.exotelToken = exotelToken;
|
|
20
|
-
this.exotelApiKey = exotelApiKey;
|
|
21
|
-
this.provider = provider;
|
|
22
|
-
|
|
23
|
-
if (this.provider === Provider.EXOTEL) {
|
|
24
|
-
this.smsUrl = `https://${this.exotelApiKey}:${this.exotelToken}@api.exotel.com/v1/Accounts/${this.exotelSid}/Sms/send`;
|
|
25
|
-
} else if (this.provider === Provider.GUPSHUP) {
|
|
26
|
-
// Define the URL for Gupshup API
|
|
27
|
-
// this.gupshupApiUrl = ...;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
private async sendOtpMessage(messageData: DemoBody): Promise<boolean> {
|
|
32
|
-
if (messageData.To && messageData.Body) {
|
|
33
|
-
if (messageData.Body.length != 6) {
|
|
34
|
-
throw new Error("Please enter 6 digit number");
|
|
35
|
-
}
|
|
36
|
-
} else throw new Error("All input data not found");
|
|
37
|
-
|
|
38
|
-
const bodyFormData = new FormData();
|
|
39
|
-
|
|
40
|
-
const smsTemplateMsg =
|
|
41
|
-
"Your OTP for AEREMS login is %d. This %d will expire in 10 minutes.";
|
|
42
|
-
|
|
43
|
-
bodyFormData.append("To", messageData.To);
|
|
44
|
-
bodyFormData.append("From", "AEREM");
|
|
45
|
-
bodyFormData.append(
|
|
46
|
-
"Body",
|
|
47
|
-
smsTemplateMsg.replace(/%d/g, messageData.Body)
|
|
48
|
-
);
|
|
49
|
-
bodyFormData.append("EncodingType", "plain");
|
|
50
|
-
bodyFormData.append("DltEntityId", "1301164059765333889");
|
|
51
|
-
bodyFormData.append("DltTemplateId", "1307164663997173809");
|
|
52
|
-
bodyFormData.append("SmsType", "transactional");
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
let config = {
|
|
56
|
-
method: "post",
|
|
57
|
-
maxBodyLength: Infinity,
|
|
58
|
-
url: this.smsUrl,
|
|
59
|
-
headers: {
|
|
60
|
-
"Content-Type": "multipart/form-data",
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
data: bodyFormData,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
await axios.request(config);
|
|
67
|
-
return true;
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error("Error sending sms:", error);
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
async sendOtpSms(obj: DemoBody): Promise<boolean> {
|
|
75
|
-
return this.sendOtpMessage(obj);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
export default SmsSender;
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { DemoBody, Provider } from "./Sms.types";
|
|
3
|
+
|
|
4
|
+
class SmsSender {
|
|
5
|
+
private exotelSid: string;
|
|
6
|
+
private exotelToken: string;
|
|
7
|
+
private exotelApiKey: string;
|
|
8
|
+
private smsUrl!: string;
|
|
9
|
+
private provider: string;
|
|
10
|
+
|
|
11
|
+
constructor(payload: {
|
|
12
|
+
exotelSid: string;
|
|
13
|
+
exotelToken: string;
|
|
14
|
+
exotelApiKey: string;
|
|
15
|
+
provider: string;
|
|
16
|
+
}) {
|
|
17
|
+
const { exotelSid, exotelToken, exotelApiKey, provider } = payload;
|
|
18
|
+
this.exotelSid = exotelSid;
|
|
19
|
+
this.exotelToken = exotelToken;
|
|
20
|
+
this.exotelApiKey = exotelApiKey;
|
|
21
|
+
this.provider = provider;
|
|
22
|
+
|
|
23
|
+
if (this.provider === Provider.EXOTEL) {
|
|
24
|
+
this.smsUrl = `https://${this.exotelApiKey}:${this.exotelToken}@api.exotel.com/v1/Accounts/${this.exotelSid}/Sms/send`;
|
|
25
|
+
} else if (this.provider === Provider.GUPSHUP) {
|
|
26
|
+
// Define the URL for Gupshup API
|
|
27
|
+
// this.gupshupApiUrl = ...;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private async sendOtpMessage(messageData: DemoBody): Promise<boolean> {
|
|
32
|
+
if (messageData.To && messageData.Body) {
|
|
33
|
+
if (messageData.Body.length != 6) {
|
|
34
|
+
throw new Error("Please enter 6 digit number");
|
|
35
|
+
}
|
|
36
|
+
} else throw new Error("All input data not found");
|
|
37
|
+
|
|
38
|
+
const bodyFormData = new FormData();
|
|
39
|
+
|
|
40
|
+
const smsTemplateMsg =
|
|
41
|
+
"Your OTP for AEREMS login is %d. This %d will expire in 10 minutes.";
|
|
42
|
+
|
|
43
|
+
bodyFormData.append("To", messageData.To);
|
|
44
|
+
bodyFormData.append("From", "AEREM");
|
|
45
|
+
bodyFormData.append(
|
|
46
|
+
"Body",
|
|
47
|
+
smsTemplateMsg.replace(/%d/g, messageData.Body)
|
|
48
|
+
);
|
|
49
|
+
bodyFormData.append("EncodingType", "plain");
|
|
50
|
+
bodyFormData.append("DltEntityId", "1301164059765333889");
|
|
51
|
+
bodyFormData.append("DltTemplateId", "1307164663997173809");
|
|
52
|
+
bodyFormData.append("SmsType", "transactional");
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
let config = {
|
|
56
|
+
method: "post",
|
|
57
|
+
maxBodyLength: Infinity,
|
|
58
|
+
url: this.smsUrl,
|
|
59
|
+
headers: {
|
|
60
|
+
"Content-Type": "multipart/form-data",
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
data: bodyFormData,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
await axios.request(config);
|
|
67
|
+
return true;
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error("Error sending sms:", error);
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async sendOtpSms(obj: DemoBody): Promise<boolean> {
|
|
75
|
+
return this.sendOtpMessage(obj);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export default SmsSender;
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
interface WhatsAppMessageData {
|
|
2
|
-
from: string;
|
|
3
|
-
to: string;
|
|
4
|
-
body?: string;
|
|
5
|
-
content?: WhatsappContentType;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface Templatetype {
|
|
9
|
-
name: string;
|
|
10
|
-
language: {
|
|
11
|
-
policy: string;
|
|
12
|
-
code: string;
|
|
13
|
-
};
|
|
14
|
-
components: Array<{
|
|
15
|
-
type: string;
|
|
16
|
-
parameters: Array<{
|
|
17
|
-
type: string;
|
|
18
|
-
text: string;
|
|
19
|
-
}>;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
22
|
-
interface WhatsappContentType {
|
|
23
|
-
type: string; //"text", "document", "image", "video", "template";
|
|
24
|
-
text?: { preview_url: string; body: string };
|
|
25
|
-
document?: any;
|
|
26
|
-
image?: any;
|
|
27
|
-
video?: any;
|
|
28
|
-
recipient_type: any;
|
|
29
|
-
template?: Templatetype;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface DemoBody {
|
|
33
|
-
whatsapp: {
|
|
34
|
-
messages: Array<WhatsAppMessageData>;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface WhatsAppTemplateMessage {
|
|
39
|
-
from: string;
|
|
40
|
-
to: string;
|
|
41
|
-
content: {
|
|
42
|
-
type: string;
|
|
43
|
-
template: {
|
|
44
|
-
name: string;
|
|
45
|
-
language: {
|
|
46
|
-
policy?: string;
|
|
47
|
-
code: string;
|
|
48
|
-
};
|
|
49
|
-
components: Array<{
|
|
50
|
-
type: string;
|
|
51
|
-
parameters: Array<{
|
|
52
|
-
type: string;
|
|
53
|
-
text: string;
|
|
54
|
-
}>;
|
|
55
|
-
}>;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface WhatsAppTemplateDemoBody {
|
|
61
|
-
whatsapp: {
|
|
62
|
-
messages: Array<WhatsAppTemplateMessage>;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface EmiReminderAug2023 {
|
|
67
|
-
code: number;
|
|
68
|
-
error_data: null;
|
|
69
|
-
status: string;
|
|
70
|
-
data: {
|
|
71
|
-
waba_id: string;
|
|
72
|
-
name: string;
|
|
73
|
-
components: Array<HeaderComponent | BodyComponent>;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
interface HeaderComponent {
|
|
78
|
-
type: string;
|
|
79
|
-
format: string;
|
|
80
|
-
text: string;
|
|
81
|
-
example: {
|
|
82
|
-
header_text: Array<string>;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
interface BodyComponent {
|
|
86
|
-
type: string;
|
|
87
|
-
text: string;
|
|
88
|
-
example: {
|
|
89
|
-
body_text: Array<Array<string>>;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export enum Provider {
|
|
94
|
-
EXOTEL = "EXOTEL",
|
|
95
|
-
GUPSHUP = "GUPSHUP",
|
|
1
|
+
interface WhatsAppMessageData {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
body?: string;
|
|
5
|
+
content?: WhatsappContentType;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Templatetype {
|
|
9
|
+
name: string;
|
|
10
|
+
language: {
|
|
11
|
+
policy: string;
|
|
12
|
+
code: string;
|
|
13
|
+
};
|
|
14
|
+
components: Array<{
|
|
15
|
+
type: string;
|
|
16
|
+
parameters: Array<{
|
|
17
|
+
type: string;
|
|
18
|
+
text: string;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
interface WhatsappContentType {
|
|
23
|
+
type: string; //"text", "document", "image", "video", "template";
|
|
24
|
+
text?: { preview_url: string; body: string };
|
|
25
|
+
document?: any;
|
|
26
|
+
image?: any;
|
|
27
|
+
video?: any;
|
|
28
|
+
recipient_type: any;
|
|
29
|
+
template?: Templatetype;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface DemoBody {
|
|
33
|
+
whatsapp: {
|
|
34
|
+
messages: Array<WhatsAppMessageData>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface WhatsAppTemplateMessage {
|
|
39
|
+
from: string;
|
|
40
|
+
to: string;
|
|
41
|
+
content: {
|
|
42
|
+
type: string;
|
|
43
|
+
template: {
|
|
44
|
+
name: string;
|
|
45
|
+
language: {
|
|
46
|
+
policy?: string;
|
|
47
|
+
code: string;
|
|
48
|
+
};
|
|
49
|
+
components: Array<{
|
|
50
|
+
type: string;
|
|
51
|
+
parameters: Array<{
|
|
52
|
+
type: string;
|
|
53
|
+
text: string;
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface WhatsAppTemplateDemoBody {
|
|
61
|
+
whatsapp: {
|
|
62
|
+
messages: Array<WhatsAppTemplateMessage>;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface EmiReminderAug2023 {
|
|
67
|
+
code: number;
|
|
68
|
+
error_data: null;
|
|
69
|
+
status: string;
|
|
70
|
+
data: {
|
|
71
|
+
waba_id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
components: Array<HeaderComponent | BodyComponent>;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface HeaderComponent {
|
|
78
|
+
type: string;
|
|
79
|
+
format: string;
|
|
80
|
+
text: string;
|
|
81
|
+
example: {
|
|
82
|
+
header_text: Array<string>;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface BodyComponent {
|
|
86
|
+
type: string;
|
|
87
|
+
text: string;
|
|
88
|
+
example: {
|
|
89
|
+
body_text: Array<Array<string>>;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export enum Provider {
|
|
94
|
+
EXOTEL = "EXOTEL",
|
|
95
|
+
GUPSHUP = "GUPSHUP",
|
|
96
96
|
}
|
package/src/Socials/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Socials from './whatsApp'
|
|
2
|
-
import Sms from './SmsSender'
|
|
3
|
-
|
|
4
|
-
export const socials = {
|
|
5
|
-
whatsapp : Socials,
|
|
6
|
-
text:Sms
|
|
1
|
+
import Socials from './whatsApp'
|
|
2
|
+
import Sms from './SmsSender'
|
|
3
|
+
|
|
4
|
+
export const socials = {
|
|
5
|
+
whatsapp : Socials,
|
|
6
|
+
text:Sms
|
|
7
7
|
}
|