aeremmiddleware 1.0.2 → 1.0.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.
@@ -1,97 +1,97 @@
1
- interface WhatsAppMessageData {
2
- from: string;
3
- to: string;
4
- body?: string;
5
- content?: WhatsappContentType;
6
- }
7
- interface Templatetype {
8
- name: string;
9
- language: {
10
- policy: string;
11
- code: string;
12
- };
13
- components: Array<{
14
- type: string;
15
- parameters: Array<{
16
- type: string;
17
- text: string;
18
- }>;
19
- }>;
20
- }
21
- interface WhatsappContentType {
22
- type: string;
23
- text?: {
24
- preview_url: string;
25
- body: string;
26
- };
27
- document?: any;
28
- image?: any;
29
- video?: any;
30
- recipient_type: any;
31
- template?: Templatetype;
32
- }
33
- export interface DemoBody {
34
- whatsapp: {
35
- messages: Array<WhatsAppMessageData>;
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
- export interface WhatsAppTemplateDemoBody {
60
- whatsapp: {
61
- messages: Array<WhatsAppTemplateMessage>;
62
- };
63
- }
64
- export interface EmiReminderAug2023 {
65
- code: number;
66
- error_data: null;
67
- status: string;
68
- data: {
69
- waba_id: string;
70
- name: string;
71
- components: Array<HeaderComponent | BodyComponent>;
72
- };
73
- }
74
- interface HeaderComponent {
75
- type: string;
76
- format: string;
77
- text: string;
78
- example: {
79
- header_text: Array<string>;
80
- };
81
- }
82
- interface BodyComponent {
83
- type: string;
84
- text: string;
85
- example: {
86
- body_text: Array<Array<string>>;
87
- };
88
- }
89
- export interface SmsDemoBody {
90
- To: string;
91
- Body: string;
92
- }
93
- export declare enum Provider {
94
- EXOTEL = "EXOTEL",
95
- GUPSHUP = "GUPSHUP"
96
- }
97
- export {};
1
+ interface WhatsAppMessageData {
2
+ from: string;
3
+ to: string;
4
+ body?: string;
5
+ content?: WhatsappContentType;
6
+ }
7
+ interface Templatetype {
8
+ name: string;
9
+ language: {
10
+ policy: string;
11
+ code: string;
12
+ };
13
+ components: Array<{
14
+ type: string;
15
+ parameters: Array<{
16
+ type: string;
17
+ text: string;
18
+ }>;
19
+ }>;
20
+ }
21
+ interface WhatsappContentType {
22
+ type: string;
23
+ text?: {
24
+ preview_url: string;
25
+ body: string;
26
+ };
27
+ document?: any;
28
+ image?: any;
29
+ video?: any;
30
+ recipient_type: any;
31
+ template?: Templatetype;
32
+ }
33
+ export interface DemoBody {
34
+ whatsapp: {
35
+ messages: Array<WhatsAppMessageData>;
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
+ export interface WhatsAppTemplateDemoBody {
60
+ whatsapp: {
61
+ messages: Array<WhatsAppTemplateMessage>;
62
+ };
63
+ }
64
+ export interface EmiReminderAug2023 {
65
+ code: number;
66
+ error_data: null;
67
+ status: string;
68
+ data: {
69
+ waba_id: string;
70
+ name: string;
71
+ components: Array<HeaderComponent | BodyComponent>;
72
+ };
73
+ }
74
+ interface HeaderComponent {
75
+ type: string;
76
+ format: string;
77
+ text: string;
78
+ example: {
79
+ header_text: Array<string>;
80
+ };
81
+ }
82
+ interface BodyComponent {
83
+ type: string;
84
+ text: string;
85
+ example: {
86
+ body_text: Array<Array<string>>;
87
+ };
88
+ }
89
+ export interface SmsDemoBody {
90
+ To: string;
91
+ Body: string;
92
+ }
93
+ export declare enum Provider {
94
+ EXOTEL = "EXOTEL",
95
+ GUPSHUP = "GUPSHUP"
96
+ }
97
+ export {};
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Provider = void 0;
4
- var Provider;
5
- (function (Provider) {
6
- Provider["EXOTEL"] = "EXOTEL";
7
- Provider["GUPSHUP"] = "GUPSHUP";
8
- })(Provider || (exports.Provider = Provider = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Provider = void 0;
4
+ var Provider;
5
+ (function (Provider) {
6
+ Provider["EXOTEL"] = "EXOTEL";
7
+ Provider["GUPSHUP"] = "GUPSHUP";
8
+ })(Provider || (exports.Provider = Provider = {}));
9
9
  //# sourceMappingURL=Whatsapp.types.js.map
@@ -1,4 +1,4 @@
1
- import Socials from './message';
2
- export declare const socials: {
3
- message: typeof Socials;
4
- };
1
+ import Socials from './message';
2
+ export declare const socials: {
3
+ message: typeof Socials;
4
+ };
@@ -1,11 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.socials = void 0;
7
- const message_1 = __importDefault(require("./message"));
8
- exports.socials = {
9
- message: message_1.default,
10
- };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.socials = void 0;
7
+ const message_1 = __importDefault(require("./message"));
8
+ exports.socials = {
9
+ message: message_1.default,
10
+ };
11
11
  //# sourceMappingURL=index.js.map
@@ -1,26 +1,26 @@
1
- import { DemoBody, EmiReminderAug2023, SmsDemoBody, WhatsAppTemplateDemoBody } from "./Whatsapp.types";
2
- declare class MessageSender {
3
- private exotelSid;
4
- private exotelToken;
5
- private exotelApiKey;
6
- private whatsappApiUrl;
7
- private smsUrl;
8
- private provider;
9
- constructor(payload: {
10
- exotelSid: string;
11
- exotelToken: string;
12
- exotelApiKey: string;
13
- provider: string;
14
- });
15
- getTemplates(): Promise<any>;
16
- getUniquePlaceholderCount(str: string): number;
17
- validateTemplatePayload(template: EmiReminderAug2023, payload: any): true | undefined;
18
- testType(obj: DemoBody): boolean;
19
- private sendMessage;
20
- private sendTemplateMessage;
21
- private sendOtpMessage;
22
- sendOtpSms(obj: SmsDemoBody): Promise<boolean>;
23
- sendWhatsAppMessage(obj: DemoBody): Promise<boolean>;
24
- sendWhatsappTemplateMessage(obj: WhatsAppTemplateDemoBody): Promise<boolean>;
25
- }
26
- export default MessageSender;
1
+ import { DemoBody, EmiReminderAug2023, SmsDemoBody, WhatsAppTemplateDemoBody } from "./Whatsapp.types";
2
+ declare class MessageSender {
3
+ private exotelSid;
4
+ private exotelToken;
5
+ private exotelApiKey;
6
+ private whatsappApiUrl;
7
+ private smsUrl;
8
+ private provider;
9
+ constructor(payload: {
10
+ exotelSid: string;
11
+ exotelToken: string;
12
+ exotelApiKey: string;
13
+ provider: string;
14
+ });
15
+ getTemplates(): Promise<any>;
16
+ getUniquePlaceholderCount(str: string): number;
17
+ validateTemplatePayload(template: EmiReminderAug2023, payload: any): true | undefined;
18
+ testType(obj: DemoBody): boolean;
19
+ private sendMessage;
20
+ private sendTemplateMessage;
21
+ private sendOtpMessage;
22
+ sendOtpSms(obj: SmsDemoBody): Promise<boolean>;
23
+ sendWhatsAppMessage(obj: DemoBody): Promise<boolean>;
24
+ sendWhatsappTemplateMessage(obj: WhatsAppTemplateDemoBody): Promise<boolean>;
25
+ }
26
+ export default MessageSender;