import { Utils } from "./utils"; import request from 'request'; export enum WhatsappAccountType{ sales='sales', sales24='sales24', support='support', ld='ld' } export enum WhatsappVendor{ sobot='sobot', interact='interact', aiSensy='aiSensy', aiSensyDhanda='aiSensyDhanda', } export class WhatsApp { public static async sendTransactionalMessageRotatory(args: { vendor?:WhatsappVendor, accountType:WhatsappAccountType, phone?: string, phones?: string[], templateIds: string[], headerValues: string[], bodyValues: string[], buttonValues: { [key: string]: string[], }, carouselCards?:{ imageUrl:string, actionUrl:string } [], debug?:boolean, scheduledStamp?:number, async?:boolean, }){ let msgIds=[]; if(args?.phones?.length){ for(let i=0;i { request(reqOptions, (error: any, response: any) => { if (error) { return resolve(error) }; if(response && response?.body){ return resolve(response?.body); } return resolve(''); }); }); } }