const { io } = require("socket.io-client"); const init = ()=>{ const socket = io(`ws://127.0.0.1:5000/gps`, { reconnectionDelay: 20000, reconnectionDelayMax: 20000, auth: { token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NmM2ZmYyY2NkMDJiNTNkMzRkMjNiYTYiLCJpYXQiOjE3MjczNTQ3OTYsImV4cCI6MTcyOTk0Njc5Nn0.7W3ZsjZbW-fbbZWCX1wxJ8Wfmdro5wM7ow-b7xwE4Fk" } }) // eslint-disable-next-line node/handle-callback-err socket.on('connect_error', err => {}) /// /////////////////////////////////////////// events socket.on('connect', () => { // console.log('**************** You have access to agent notifications') socket.emit('gps:fetchNotifications') }) socket.on(`gps:allNotifs`, data => { console.log(data); }) socket.on(`gps:notifications`, data => { console.log(data); }) socket.on(`gps:notify`, data => { if (data.type === 'updateAgentInbox') { // update store console.log(data); } if (data.type === 'newAgentInbox') { console.log(data); } }) } init() // const nodemailer = require('nodemailer') // function sendConfirmationEmail() { // return new Promise(async (resolve, reject) => { // try { // /// //// email configs // // const hostURL = 'www.asan-service.com' // const transporter = nodemailer.createTransport({ // host: 'smtp.c1.liara.email', // port: 587, // secure: false, // true for 465, false for other ports // auth: { // user: 'awesome_bell_ncc1hi', // pass: '509f8938-db95-4b8d-83e7-9ea8eccfd28b' // }, // tls: { // rejectUnauthorized: false // } // }) // const emailHTMLTemplate = ` //
// ` // // send mail with defined transport object // await transporter.sendMail({ // from: '"AsanService"