bfee35042cedc73d615f7a3e2dca420cd8b7f681
[motion2.git] / server / services / routing / server / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x74f4=['slice','dialogflow','dialogflowv2','appdata','tag','TagId','tvox','ContactId','%s:%s:%s','./interval','condition','intervals','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','name','paused','waiting','mailQueues','available','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','rules','message','interaction','applications','isArray','length','join','.js','app','toLowerCase','autoreply','split','channel','push'];(function(_0x849f43,_0x27d0d9){var _0x2be45f=function(_0x167b4c){while(--_0x167b4c){_0x849f43['push'](_0x849f43['shift']());}};_0x2be45f(++_0x27d0d9);}(_0x74f4,0xaa));var _0x474f=function(_0x1d5d01,_0x5b8282){_0x1d5d01=_0x1d5d01-0x0;var _0x13b6ea=_0x74f4[_0x1d5d01];return _0x13b6ea;};'use strict';var _=require(_0x474f('0x0'));var util=require(_0x474f('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x474f('0x2'));var BPromise=require(_0x474f('0x3'));var uuid=require('uuid');var utils=require(_0x474f('0x4'));var config=require('../../../config/environment');var logger=require(_0x474f('0x5'))(_0x474f('0x6'));var rpc={'openchannelQueueReport':require(_0x474f('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x474f('0x8')),'smsQueueReport':require(_0x474f('0x9')),'faxQueueReport':require(_0x474f('0xa')),'whatsappQueueReport':require(_0x474f('0xb'))};var RuleEngine=require(_0x474f('0xc'));function getId(_0x461707,_0x18fdc1,_0x3b06be){return util[_0x474f('0xd')](_0x474f('0xe'),_0x461707,_0x18fdc1||0x0,_0x3b06be||0x0);}function getIntervals(_0x403d67,_0x52c8a5){var _0x38779f=[];if(!_[_0x474f('0xf')](_0x52c8a5[_0x474f('0x10')])&&!_['isNil'](_0x403d67[_0x52c8a5[_0x474f('0x10')]])&&!_[_0x474f('0xf')](_0x403d67[_0x52c8a5[_0x474f('0x10')]]['Intervals'])){_0x38779f=_[_0x474f('0x11')](_0x403d67[_0x52c8a5[_0x474f('0x10')]]['Intervals'],_0x474f('0x12'));}else if(!_[_0x474f('0xf')](_0x52c8a5[_0x474f('0x12')])){_0x38779f=[_0x52c8a5['interval']];}return _0x38779f;}exports[_0x474f('0x13')]=function(_0x7ffcb){_0x7ffcb[_0x474f('0x14')]={};return new BPromise(function(_0x3caae0,_0x2dd5bf){var _0x3e5f86={'Start':function(_0x38d085){var _0x591cbd=this;return new Promise(function(_0xe4b5d3,_0x5e1d32){if(_0x38d085){try{var _0x396fba=[];var _0xb8d368=getId(_0x38d085['channel'],_0x38d085[_0x474f('0x15')]?_0x38d085['message']['id']:0x0,_0x38d085[_0x474f('0x16')]?_0x38d085[_0x474f('0x16')]['id']:0x0);if(_0x38d085[_0x474f('0x17')]&&_[_0x474f('0x18')](_0x38d085[_0x474f('0x17')])&&_0x38d085['applications'][_0x474f('0x19')]){for(var _0x32abe1=0x0;_0x32abe1<_0x38d085[_0x474f('0x17')][_0x474f('0x19')];_0x32abe1+=0x1){var _0x2d3777=_0x38d085['applications'][_0x32abe1];if(fs['existsSync'](path[_0x474f('0x1a')](__dirname,_0x474f('0x17'),_0x2d3777['app']+_0x474f('0x1b')))){var _0x5bf9dd=[];switch(_0x2d3777[_0x474f('0x1c')][_0x474f('0x1d')]()){case _0x474f('0x1e'):var _0x4958de=_0x2d3777['appdata'][_0x474f('0x1f')](',');if(_0x38d085[_0x474f('0x20')]==='mail'){_0x5bf9dd[_0x474f('0x21')](_0x4958de[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x4958de[0x1]);_0x5bf9dd[_0x474f('0x21')](_0x4958de[_0x474f('0x22')](0x2,_0x4958de[_0x474f('0x19')])[_0x474f('0x1a')](','));}else{_0x5bf9dd['push'](_0x4958de[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x4958de[_0x474f('0x22')](0x1,_0x4958de[_0x474f('0x19')])[_0x474f('0x1a')](','));}break;case _0x474f('0x23'):var _0x413117=_0x2d3777['appdata'][_0x474f('0x1f')](',');_0x5bf9dd[_0x474f('0x21')](_0x413117[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x413117[0x1]);_0x5bf9dd[_0x474f('0x21')](_0x413117[_0x474f('0x22')](0x2,_0x413117['length'])['join'](','));break;case _0x474f('0x24'):var _0x3c2cb6=_0x2d3777[_0x474f('0x25')][_0x474f('0x1f')](',');_0x5bf9dd[_0x474f('0x21')](_0x3c2cb6[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x3c2cb6[0x1]);_0x5bf9dd['push'](_0x3c2cb6[0x2]);_0x5bf9dd[_0x474f('0x21')](_0x3c2cb6[0x3]);_0x5bf9dd[_0x474f('0x21')](_0x3c2cb6['slice'](0x4,_0x3c2cb6['length'])[_0x474f('0x1a')](','));break;case'amazonlex':var _0x12668f=_0x2d3777[_0x474f('0x25')][_0x474f('0x1f')](',');_0x5bf9dd[_0x474f('0x21')](_0x12668f[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x12668f[0x1]);_0x5bf9dd[_0x474f('0x21')](_0x12668f[0x2]);_0x5bf9dd[_0x474f('0x21')](_0x12668f[0x3]);_0x5bf9dd[_0x474f('0x21')](_0x12668f[_0x474f('0x22')](0x4,_0x12668f[_0x474f('0x19')])[_0x474f('0x1a')](','));break;case'message':_0x5bf9dd[_0x474f('0x21')](_0x2d3777[_0x474f('0x25')]);break;case _0x474f('0x26'):_0x5bf9dd[_0x474f('0x21')](_0x2d3777[_0x474f('0x27')]);_0x5bf9dd[_0x474f('0x21')](_0x2d3777[_0x474f('0x25')]);break;case _0x474f('0x28'):var _0x46ae8c=utils['getMustacheRender'](_0x38d085['account']['notificationTemplate'],_0x38d085);var _0x377a97=_0x2d3777['appdata']['split'](',');_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x0]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x1]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x2]);_0x5bf9dd['push'](_0x377a97[0x3]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x4]);_0x5bf9dd['push'](_0x377a97[0x5]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x6]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x7]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x8]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0x9]);_0x5bf9dd[_0x474f('0x21')](_0x377a97[0xa]);_0x5bf9dd[_0x474f('0x21')](_0x38d085[_0x474f('0x16')]['id']);_0x5bf9dd[_0x474f('0x21')](_0x38d085[_0x474f('0x15')]['id']);_0x5bf9dd['push'](_0x2d3777['ChatWebsiteId']);_0x5bf9dd['push'](_0x38d085[_0x474f('0x16')][_0x474f('0x29')]);_0x5bf9dd['push'](_0x38d085['body']['body']);_0x5bf9dd[_0x474f('0x21')](_0x46ae8c);break;default:_0x5bf9dd=_[_0x474f('0xf')](_0x2d3777[_0x474f('0x25')])?[]:_0x2d3777[_0x474f('0x25')][_0x474f('0x1f')](',');}var _0x38cd52={'id':util[_0x474f('0xd')](_0x474f('0x2a'),_0xb8d368,_0x2d3777['id'],_0x2d3777['app']),'condition':require(_0x474f('0x2b'))[_0x474f('0x2c')](_0xb8d368,getIntervals(_0x7ffcb[_0x474f('0x2d')],_0x2d3777),_0x7ffcb),'consequence':require('./applications/'+_0x2d3777[_0x474f('0x1c')])[_0x474f('0x2e')](_0xb8d368,_0x5bf9dd,_0x7ffcb,_0x38d085),'p':_0x2d3777[_0x474f('0x2f')]||0x0};logger['info'](_0x474f('0x30'),_0x38cd52['id'],_0x474f('0x31'),getIntervals(_0x7ffcb[_0x474f('0x2d')],_0x2d3777)[_0x474f('0x1a')](_0x474f('0x32')));_0x396fba[_0x474f('0x21')](_0x38cd52);}else{logger[_0x474f('0x33')](_0x474f('0x34'),path[_0x474f('0x1a')](__dirname,_0x474f('0x17'),_0x2d3777[_0x474f('0x1c')]+_0x474f('0x1b')));}}_0x7ffcb[_0x474f('0x14')][_0xb8d368]=new RuleEngine(_0x396fba);_0x7ffcb[_0x474f('0x14')][_0xb8d368][_0x474f('0x35')](_0x38d085,function(_0x26d05f){logger[_0x474f('0x36')]('Applications\x20executed',JSON[_0x474f('0x37')](_0x26d05f[_0x474f('0x38')]));if(_0x7ffcb[_0x474f('0x14')][_0xb8d368]){_0x7ffcb[_0x474f('0x14')][_0xb8d368][_0x474f('0x39')](_0x474f('0x3a'));}});return _0xe4b5d3({'code':0xc8,'message':_0x38d085});}else{logger['info'](_0x474f('0x3b'));return _0xe4b5d3({'code':0xc8,'message':_0x38d085});}}catch(_0x4bcfe6){logger['error'](_0x4bcfe6[_0x474f('0x3c')]);return _0x5e1d32(_0x591cbd['error'](0x1f4,_0x4bcfe6));}}return _0x5e1d32(_0x474f('0x3d'));});},'AcceptMessage':function(_0x578243){var _0x1a88db=this;return new Promise(function(_0x53dd12,_0x40197e){if(_0x578243[_0x474f('0x3e')]&&_0x578243[_0x474f('0x3e')]['id']){if(_0x7ffcb[_0x474f('0x3f')][_0x578243[_0x474f('0x3e')]['id']]){_0x7ffcb[_0x474f('0x3f')][_0x578243[_0x474f('0x3e')]['id']][_0x474f('0x40')]=![];_0x7ffcb['agents'][_0x578243[_0x474f('0x3e')]['id']][_0x474f('0x41')]=undefined;}}if(_0x578243['message']&&_0x578243[_0x474f('0x15')]['id']){try{var _0x212a2f=getId(_0x578243[_0x474f('0x20')],_0x578243[_0x474f('0x15')]?_0x578243[_0x474f('0x15')]['id']:0x0,_0x578243[_0x474f('0x16')]?_0x578243[_0x474f('0x16')]['id']:0x0);if(_0x7ffcb['rules'][_0x212a2f]){_0x7ffcb[_0x474f('0x14')][_0x212a2f][_0x474f('0x39')](_0x474f('0x42'));if(rpc[_0x578243[_0x474f('0x20')]+_0x474f('0x43')]){rpc[_0x578243[_0x474f('0x20')]+_0x474f('0x43')][_0x474f('0x44')](_0x212a2f,{'UserId':_0x578243[_0x474f('0x15')][_0x474f('0x45')]})[_0x474f('0x46')](function(_0x239da5){logger[_0x474f('0x33')](_0x474f('0x47'));});}}return _0x53dd12({'code':0xc8,'message':_0x578243});}catch(_0x3f5cdd){logger[_0x474f('0x33')](_0x3f5cdd[_0x474f('0x3c')]);return _0x40197e(_0x1a88db[_0x474f('0x33')](0x1f4,_0x3f5cdd));}}logger['error'](_0x474f('0x48'));return _0x40197e(_0x1a88db['error'](0x1f4,_0x474f('0x48')));});},'RejectMessage':function(_0x323bfb){var _0x5e1d98=this;return new Promise(function(_0x2d732f,_0x199796){if(_0x323bfb['agent']&&_0x323bfb[_0x474f('0x3e')]['id']){try{if(_0x7ffcb[_0x474f('0x3f')][_0x323bfb[_0x474f('0x3e')]['id']]){_0x7ffcb[_0x474f('0x3f')][_0x323bfb['agent']['id']][_0x474f('0x40')]=![];_0x7ffcb[_0x474f('0x3f')][_0x323bfb[_0x474f('0x3e')]['id']]['busyQueue']=undefined;}return _0x2d732f({'code':0xc8,'message':_0x323bfb});}catch(_0x14b956){logger['error'](_0x14b956[_0x474f('0x3c')]);return _0x199796(_0x5e1d98[_0x474f('0x33')](0x1f4,_0x14b956));}}logger[_0x474f('0x33')](_0x474f('0x48'));return _0x199796(_0x5e1d98[_0x474f('0x33')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xb6457){var _0x46378f=this;return new Promise(function(_0x22e9f7,_0x1df15e){if(_0xb6457['channel']&&_0xb6457[_0x474f('0x16')]&&_0xb6457['interaction']['id']){try{var _0x5495e8=getId(_0xb6457[_0x474f('0x20')],_0xb6457[_0x474f('0x15')]?_0xb6457['message']['id']:0x0,_0xb6457[_0x474f('0x16')]?_0xb6457['interaction']['id']:0x0);if(_0x7ffcb[_0x474f('0x14')][_0x5495e8]){_0x7ffcb['rules'][_0x5495e8][_0x474f('0x39')](_0x474f('0x42'));}return _0x22e9f7({'code':0xc8,'message':_0xb6457});}catch(_0x53eb58){logger['error'](_0x53eb58[_0x474f('0x3c')]);return _0x1df15e(_0x46378f['error'](0x1f4,_0x53eb58));}}logger[_0x474f('0x33')](_0x474f('0x48'));return _0x1df15e(_0x46378f[_0x474f('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1b73b3){var _0x2a603=this;return new Promise(function(_0x68af9b,_0x169653){if(_0x7ffcb[_0x474f('0x3f')][_0x474f('0x49')](_0x1b73b3['id'])){for(var _0x54c486 in _0x1b73b3[_0x474f('0x4a')]){if(_0x1b73b3[_0x474f('0x4a')][_0x474f('0x49')](_0x54c486)){if(_0x7ffcb[_0x474f('0x3f')][_0x1b73b3['id']]['hasOwnProperty'](_0x54c486+_0x474f('0x4b'))){_0x7ffcb[_0x474f('0x3f')][_0x1b73b3['id']][_0x54c486+_0x474f('0x4b')]=parseInt(_0x1b73b3[_0x474f('0x4a')][_0x54c486],0xa);}}}_0x7ffcb[_0x474f('0x3f')][_0x1b73b3['id']][_0x474f('0x4c')]();return _0x68af9b({'code':0xc8,'message':_0x7ffcb['agents'][_0x1b73b3['id']]});}else{return _0x169653(_0x2a603['error'](0x1f4,_0x474f('0x4d')));}});},'Agents':function(_0x5b2a56){return new Promise(function(_0x37363b,_0x515521){var _0x4b0b2a=_[_0x474f('0x4e')](_0x7ffcb['agents']);_0x37363b({'count':_0x4b0b2a[_0x474f('0x19')],'rows':_0x4b0b2a});});},'ChatQueues':function(_0x4546e4){return new Promise(function(_0xcecefb,_0x1c1c90){var _0x2e528d=[];for(var _0xeb1e32 in _0x7ffcb[_0x474f('0x4f')]){if(_0x7ffcb[_0x474f('0x4f')][_0x474f('0x49')](_0xeb1e32)){var _0x2b727c=_0x7ffcb[_0x474f('0x4f')][_0xeb1e32];var _0x4add4c={'id':_0x2b727c['id'],'available':_0x2b727c['available'],'loggedIn':_0x2b727c['loggedIn'],'name':_0x2b727c[_0x474f('0x50')],'paused':_0x2b727c[_0x474f('0x51')],'waiting':_0x2b727c[_0x474f('0x52')]};_0x2e528d[_0x474f('0x21')](_0x4add4c);}}_0xcecefb({'count':_0x2e528d[_0x474f('0x19')],'rows':_0x2e528d});});},'MailQueues':function(_0x4e84b8){return new Promise(function(_0x5978b2,_0x24fd26){var _0x136511=[];for(var _0x17380e in _0x7ffcb[_0x474f('0x53')]){if(_0x7ffcb[_0x474f('0x53')][_0x474f('0x49')](_0x17380e)){var _0x51d675=_0x7ffcb['mailQueues'][_0x17380e];var _0x31b3d9={'id':_0x51d675['id'],'available':_0x51d675[_0x474f('0x54')],'loggedIn':_0x51d675[_0x474f('0x55')],'name':_0x51d675[_0x474f('0x50')],'paused':_0x51d675[_0x474f('0x51')],'waiting':_0x51d675[_0x474f('0x52')]};_0x136511[_0x474f('0x21')](_0x31b3d9);}}_0x5978b2({'count':_0x136511['length'],'rows':_0x136511});});},'OpenchannelQueues':function(_0x38b497){return new Promise(function(_0x9a14b8,_0x310246){var _0x511ca5=[];for(var _0x331640 in _0x7ffcb[_0x474f('0x56')]){if(_0x7ffcb[_0x474f('0x56')]['hasOwnProperty'](_0x331640)){var _0x33c19d=_0x7ffcb[_0x474f('0x56')][_0x331640];var _0x5f3786={'id':_0x33c19d['id'],'available':_0x33c19d[_0x474f('0x54')],'loggedIn':_0x33c19d['loggedIn'],'name':_0x33c19d[_0x474f('0x50')],'paused':_0x33c19d['paused'],'waiting':_0x33c19d[_0x474f('0x52')]};_0x511ca5[_0x474f('0x21')](_0x5f3786);}}_0x9a14b8({'count':_0x511ca5[_0x474f('0x19')],'rows':_0x511ca5});});},'SmsQueues':function(_0x1dad22){return new Promise(function(_0x338416,_0x158c01){var _0x34a2ea=[];for(var _0x562ac9 in _0x7ffcb[_0x474f('0x57')]){if(_0x7ffcb['smsQueues'][_0x474f('0x49')](_0x562ac9)){var _0x24cad1=_0x7ffcb[_0x474f('0x57')][_0x562ac9];var _0x307203={'id':_0x24cad1['id'],'available':_0x24cad1[_0x474f('0x54')],'loggedIn':_0x24cad1['loggedIn'],'name':_0x24cad1['name'],'paused':_0x24cad1[_0x474f('0x51')],'waiting':_0x24cad1['waiting']};_0x34a2ea[_0x474f('0x21')](_0x307203);}}_0x338416({'count':_0x34a2ea[_0x474f('0x19')],'rows':_0x34a2ea});});},'FaxQueues':function(_0x515bc5){return new Promise(function(_0xe133e0,_0x592926){var _0x3224c1=[];for(var _0x64fd34 in _0x7ffcb[_0x474f('0x58')]){if(_0x7ffcb['faxQueues'][_0x474f('0x49')](_0x64fd34)){var _0x5e989c=_0x7ffcb[_0x474f('0x58')][_0x64fd34];var _0x48678b={'id':_0x5e989c['id'],'available':_0x5e989c[_0x474f('0x54')],'loggedIn':_0x5e989c[_0x474f('0x55')],'name':_0x5e989c['name'],'paused':_0x5e989c['paused'],'waiting':_0x5e989c[_0x474f('0x52')]};_0x3224c1[_0x474f('0x21')](_0x48678b);}}_0xe133e0({'count':_0x3224c1['length'],'rows':_0x3224c1});});},'WhatsappQueues':function(_0x410cb9){return new Promise(function(_0x1a1ccc,_0x3baa02){var _0xca2bb9=[];for(var _0x3be22e in _0x7ffcb[_0x474f('0x59')]){if(_0x7ffcb[_0x474f('0x59')][_0x474f('0x49')](_0x3be22e)){var _0x2aed0a=_0x7ffcb['whatsappQueues'][_0x3be22e];var _0x2d54b7={'id':_0x2aed0a['id'],'available':_0x2aed0a[_0x474f('0x54')],'loggedIn':_0x2aed0a[_0x474f('0x55')],'name':_0x2aed0a[_0x474f('0x50')],'paused':_0x2aed0a[_0x474f('0x51')],'waiting':_0x2aed0a['waiting']};_0xca2bb9[_0x474f('0x21')](_0x2d54b7);}}_0x1a1ccc({'count':_0xca2bb9[_0x474f('0x19')],'rows':_0xca2bb9});});},'ChatQueuesWaitingInteractions':function(_0x58c215){return new Promise(function(_0x9abd8b,_0x57b0aa){var _0x2722bd=_['values'](_0x7ffcb[_0x474f('0x5a')]);_0x9abd8b({'count':_0x2722bd[_0x474f('0x19')],'rows':_0x2722bd});});},'MailQueuesWaitingInteractions':function(_0x5bb9de){return new Promise(function(_0x5c15cd,_0x43b5c5){var _0x584726=_[_0x474f('0x4e')](_0x7ffcb[_0x474f('0x5b')]);_0x5c15cd({'count':_0x584726[_0x474f('0x19')],'rows':_0x584726});});},'OpenchannelQueuesWaitingInteractions':function(_0x1581ed){return new Promise(function(_0x1f4fcb,_0x257022){var _0x24ec81=_[_0x474f('0x4e')](_0x7ffcb[_0x474f('0x5c')]);_0x1f4fcb({'count':_0x24ec81[_0x474f('0x19')],'rows':_0x24ec81});});},'SmsQueuesWaitingInteractions':function(_0x3f104b){return new Promise(function(_0x3dbf77,_0x158a01){var _0x18bfd2=_[_0x474f('0x4e')](_0x7ffcb[_0x474f('0x5d')]);_0x3dbf77({'count':_0x18bfd2[_0x474f('0x19')],'rows':_0x18bfd2});});},'FaxQueuesWaitingInteractions':function(_0x5ad807){return new Promise(function(_0x34416e,_0x5c84d1){var _0x5b0377=_[_0x474f('0x4e')](_0x7ffcb[_0x474f('0x5e')]);_0x34416e({'count':_0x5b0377['length'],'rows':_0x5b0377});});},'WhatsappQueuesWaitingInteractions':function(_0x2cde1e){return new Promise(function(_0x13ea99,_0x41bdc8){var _0x32ed4f=_['values'](_0x7ffcb[_0x474f('0x5f')]);_0x13ea99({'count':_0x32ed4f[_0x474f('0x19')],'rows':_0x32ed4f});});}};var _0x4011cb=jayson[_0x474f('0x60')](_0x3e5f86)[_0x474f('0x61')]();_0x4011cb['on']('error',function(_0xb81ad8){logger[_0x474f('0x33')](JSON[_0x474f('0x37')](_0xb81ad8));return _0x2dd5bf(_0xb81ad8);});_0x4011cb['listen'](0x232c,_0x474f('0x62'),function(){console[_0x474f('0x63')](_0x474f('0x64'),0x232c);return _0x3caae0(_0x474f('0x65')+0x232c);});});};