Built motion from commit efa66e19.|2.6.22
[motion2.git] / server / api / userNotification / userNotification.controller.js
index a3d68bb..86431f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f4=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','team','user','includes','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','findOne','html','startCase','model','toLowerCase','union','ids','queue','replace','Queue','forEach','push','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status'];(function(_0xf53be4,_0x4f8e01){var _0x3fd007=function(_0x315764){while(--_0x315764){_0xf53be4['push'](_0xf53be4['shift']());}};_0x3fd007(++_0x4f8e01);}(_0x73f4,0x1cb));var _0x473f=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x73f4[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0x473f('0x0'));var rimraf=require(_0x473f('0x1'));var zipdir=require(_0x473f('0x2'));var jsonpatch=require(_0x473f('0x3'));var rp=require(_0x473f('0x4'));var moment=require(_0x473f('0x5'));var BPromise=require(_0x473f('0x6'));var Mustache=require(_0x473f('0x7'));var util=require(_0x473f('0x8'));var path=require(_0x473f('0x9'));var sox=require(_0x473f('0xa'));var csv=require(_0x473f('0xb'));var ejs=require(_0x473f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x473f('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x473f('0xe'));var deskjs=require(_0x473f('0xf'));var toCsv=require(_0x473f('0xb'));var querystring=require('querystring');var Papa=require(_0x473f('0x10'));var Redis=require(_0x473f('0x11'));var authService=require(_0x473f('0x12'));var qs=require(_0x473f('0x13'));var as=require(_0x473f('0x14'));var hardwareService=require(_0x473f('0x15'));var logger=require(_0x473f('0x16'))('api');var utils=require(_0x473f('0x17'));var config=require(_0x473f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x473f('0x19'))['db'];config[_0x473f('0x1a')]=_[_0x473f('0x1b')](config[_0x473f('0x1a')],{'host':_0x473f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x473f('0x1a')]));require('./userNotification.socket')[_0x473f('0x1d')](socket);function respondWithStatusCode(_0x1fa068,_0x522e0f){_0x522e0f=_0x522e0f||0xcc;return function(_0x547bba){if(_0x547bba){return _0x1fa068['sendStatus'](_0x522e0f);}return _0x1fa068[_0x473f('0x1e')](_0x522e0f)[_0x473f('0x1f')]();};}function respondWithResult(_0x4914d3,_0x440e01){_0x440e01=_0x440e01||0xc8;return function(_0x5ef2eb){if(_0x5ef2eb){return _0x4914d3[_0x473f('0x1e')](_0x440e01)[_0x473f('0x20')](_0x5ef2eb);}};}function respondWithFilteredResult(_0x335204,_0x3d3d01){return function(_0x500836){if(_0x500836){var _0x169fc4=typeof _0x3d3d01[_0x473f('0x21')]===_0x473f('0x22')&&typeof _0x3d3d01[_0x473f('0x23')]===_0x473f('0x22');var _0x30b139=_0x500836['count'];var _0x2d00de=_0x169fc4?0x0:_0x3d3d01[_0x473f('0x21')];var _0x3664e8=_0x169fc4?_0x500836[_0x473f('0x24')]:_0x3d3d01[_0x473f('0x21')]+_0x3d3d01[_0x473f('0x23')];var _0x2fe6f8;if(_0x3664e8>=_0x30b139){_0x3664e8=_0x30b139;_0x2fe6f8=0xc8;}else{_0x2fe6f8=0xce;}_0x335204['status'](_0x2fe6f8);return _0x335204[_0x473f('0x25')](_0x473f('0x26'),_0x2d00de+'-'+_0x3664e8+'/'+_0x30b139)[_0x473f('0x20')](_0x500836);}return null;};}function patchUpdates(_0x2ec3ea){return function(_0x1fb05d){try{jsonpatch[_0x473f('0x27')](_0x1fb05d,_0x2ec3ea,!![]);}catch(_0x1d8bc2){return BPromise['reject'](_0x1d8bc2);}return _0x1fb05d[_0x473f('0x28')]();};}function saveUpdates(_0xd8ee97,_0x556120){return function(_0x3005c7){if(_0x3005c7){return _0x3005c7[_0x473f('0x29')](_0xd8ee97)[_0x473f('0x2a')](function(_0x3c6071){return _0x3c6071;});}return null;};}function removeEntity(_0x17da92,_0x57a0c2){return function(_0x3be589){if(_0x3be589){return _0x3be589[_0x473f('0x2b')]()[_0x473f('0x2a')](function(){_0x17da92['status'](0xcc)[_0x473f('0x1f')]();});}};}function handleEntityNotFound(_0x4bc39a,_0x5a86d1){return function(_0x325476){if(!_0x325476){_0x4bc39a[_0x473f('0x2c')](0x194);}return _0x325476;};}function handleError(_0x346e45,_0x58bafc){_0x58bafc=_0x58bafc||0x1f4;return function(_0x2f8a1e){logger[_0x473f('0x2d')](_0x2f8a1e[_0x473f('0x2e')]);if(_0x2f8a1e[_0x473f('0x2f')]){delete _0x2f8a1e['name'];}_0x346e45[_0x473f('0x1e')](_0x58bafc)[_0x473f('0x30')](_0x2f8a1e);};}exports[_0x473f('0x31')]=function(_0x1c9ada,_0x18b2b7,_0xddddbe){if(!_0x1c9ada[_0x473f('0x32')][_0x473f('0x33')](_0x473f('0x34'))&&!_0x1c9ada['body']['hasOwnProperty'](_0x473f('0x35'))){throw new db['Sequelize'][(_0x473f('0x36'))](_0x473f('0x37'));}else{if(_0x1c9ada[_0x473f('0x32')][_0x473f('0x33')](_0x473f('0x35'))&&!_0x1c9ada['body'][_0x473f('0x33')](_0x473f('0x38'))){throw new db[(_0x473f('0x39'))][(_0x473f('0x36'))](_0x473f('0x3a'));}if(!_0x1c9ada[_0x473f('0x32')]['hasOwnProperty'](_0x473f('0x3b'))){throw new db[(_0x473f('0x39'))][(_0x473f('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x12de44=JSON[_0x473f('0x3c')](_0x1c9ada[_0x473f('0x32')][_0x473f('0x3b')]);}catch(_0xfbdd1e){logger[_0x473f('0x2d')](_0xfbdd1e);throw new db['Sequelize'][(_0x473f('0x36'))](_0x473f('0x3d'));}var _0x3a8899=[_0x473f('0x3e'),'faxqueue',_0x473f('0x3f'),'openchannelqueue','smsqueue','voicequeue','whatsappqueue',_0x473f('0x40'),_0x473f('0x41')];if(_['some'](_0x12de44,function(_0x5e3782){return!_[_0x473f('0x42')](_0x3a8899,_0x5e3782['model']['toLowerCase']());})){throw new db[(_0x473f('0x39'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1a960b={};_0x1a960b[_0x473f('0x43')]=_0x1c9ada['body'][_0x473f('0x33')](_0x473f('0x43'))?_0x1c9ada['body'][_0x473f('0x43')]:_0x1c9ada['user'][_0x473f('0x44')];_0x1a960b[_0x473f('0x45')]=_[_0x473f('0x46')](_0x1c9ada[_0x473f('0x32')][_0x473f('0x45')])?null:_0x1c9ada[_0x473f('0x32')][_0x473f('0x45')];_0x1a960b[_0x473f('0x47')]=_0x1c9ada[_0x473f('0x32')]['beep']||![];_0x1a960b[_0x473f('0x48')]=_0x1c9ada['user']['id'];return getContent(_0x1c9ada['body'])[_0x473f('0x2a')](function(_0x3df069){_0x1a960b[_0x473f('0x32')]=_0x3df069;return getRecipients(_0x12de44);})[_0x473f('0x2a')](function(_0x17e242){_0x1a960b['recipientsId']=_[_0x473f('0x49')](_0x17e242)[_0x473f('0x4a')](',');return db[_0x473f('0x4b')][_0x473f('0x4c')](function(_0x1b86c6){return db[_0x473f('0x4d')][_0x473f('0x4e')](_0x1a960b,{'raw':!![],'transaction':_0x1b86c6})[_0x473f('0x2a')](function(_0x3f25ba){var _0x293eed={'sender':_0x1a960b[_0x473f('0x43')],'description':_0x1a960b[_0x473f('0x45')],'content':_0x1a960b[_0x473f('0x32')],'beep':_0x1a960b[_0x473f('0x47')]};_0x17e242['forEach'](function(_0x597a46){_0x293eed[_0x473f('0x4f')]=_0x597a46;socket[_0x473f('0x50')](_0x473f('0x51'),_0x293eed);});return _0x3f25ba;});});})[_0x473f('0x2a')](respondWithResult(_0x18b2b7,0xc9))[_0x473f('0x52')](handleError(_0x18b2b7,null));};function getContent(_0x3cf285){return new BPromise(function(_0x3aa563,_0x2f8bd8){if(_0x3cf285['text']){_0x3aa563(_0x3cf285['text']);return;}return db['Template'][_0x473f('0x53')]({'attributes':[_0x473f('0x54')],'where':{'id':_0x3cf285[_0x473f('0x35')]},'raw':!![]})['then'](function(_0x384f5f){if(!_0x384f5f)throw new db['Sequelize'][(_0x473f('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x4087f0=Mustache['render'](_0x384f5f['html'],_0x3cf285[_0x473f('0x38')]);_0x3aa563(_0x4087f0);})[_0x473f('0x52')](function(_0x4db4fb){_0x2f8bd8(_0x4db4fb);});});}function getRecipients(_0x2ca9e1){return new BPromise(function(_0x3fa972,_0x2fe884){var _0x3b52b2=[];var _0x5e1f91=[];_0x2ca9e1['forEach'](function(_0x59f13d){var _0x455440=_[_0x473f('0x55')](_0x59f13d[_0x473f('0x56')][_0x473f('0x57')]());if(_0x455440==='User'){_0x3b52b2=_[_0x473f('0x58')](_0x3b52b2,_0x59f13d[_0x473f('0x59')]);}else{if(_['includes'](_0x455440,_0x473f('0x5a')))_0x455440=_0x455440[_0x473f('0x5b')](_0x473f('0x5a'),_0x473f('0x5c'));_0x59f13d['ids'][_0x473f('0x5d')](function(_0xdd5c2a){_0x5e1f91[_0x473f('0x5e')](getAgents(_0x455440,_0xdd5c2a));});}});return BPromise[_0x473f('0x5f')](_0x5e1f91)['then'](function(_0x160011){_0x3b52b2=_[_0x473f('0x58')](_0x3b52b2,_[_0x473f('0x60')](_0x160011));_0x3fa972(_0x3b52b2);})[_0x473f('0x52')](function(_0x4046a3){_0x2fe884(_0x4046a3);});});}function getAgents(_0x4a31d4,_0x4fdd78){return new BPromise(function(_0xfe6730,_0x309f54){return db[_0x4a31d4][_0x473f('0x53')]({'where':{'id':_0x4fdd78}})[_0x473f('0x2a')](function(_0x5e7bf8){return _0x5e7bf8['getAgents']({'attributes':['id'],'raw':!![]})[_0x473f('0x2a')](function(_0x298851){var _0x641fab=_[_0x473f('0x61')](_0x298851,'id');_0xfe6730(_0x641fab);});})[_0x473f('0x52')](function(_0x466c47){_0x309f54(_0x466c47);});});}
\ No newline at end of file
+var _0x11e8=['Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','join','sequelize','transaction','UserNotification','recipient','emit','catch','text','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','forEach','startCase','model','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','toLowerCase'];(function(_0x3409ae,_0x34a098){var _0x5c736d=function(_0x4800a0){while(--_0x4800a0){_0x3409ae['push'](_0x3409ae['shift']());}};_0x5c736d(++_0x34a098);}(_0x11e8,0x129));var _0x811e=function(_0x225f4f,_0xae43e8){_0x225f4f=_0x225f4f-0x0;var _0x3d0a36=_0x11e8[_0x225f4f];return _0x3d0a36;};'use strict';var emlformat=require(_0x811e('0x0'));var rimraf=require(_0x811e('0x1'));var zipdir=require(_0x811e('0x2'));var jsonpatch=require(_0x811e('0x3'));var rp=require('request-promise');var moment=require(_0x811e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x811e('0x5'));var path=require('path');var sox=require(_0x811e('0x6'));var csv=require(_0x811e('0x7'));var ejs=require(_0x811e('0x8'));var fs=require('fs');var fs_extra=require(_0x811e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x811e('0xa'));var deskjs=require(_0x811e('0xb'));var toCsv=require(_0x811e('0x7'));var querystring=require(_0x811e('0xc'));var Papa=require(_0x811e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x811e('0xe'));var as=require(_0x811e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x811e('0x10'));var licenseUtil=require(_0x811e('0x11'));var db=require(_0x811e('0x12'))['db'];config['redis']=_[_0x811e('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x811e('0x14'))(new Redis(config[_0x811e('0x15')]));require(_0x811e('0x16'))[_0x811e('0x17')](socket);function respondWithStatusCode(_0x4696ed,_0x5d9eb2){_0x5d9eb2=_0x5d9eb2||0xcc;return function(_0x369341){if(_0x369341){return _0x4696ed[_0x811e('0x18')](_0x5d9eb2);}return _0x4696ed[_0x811e('0x19')](_0x5d9eb2)[_0x811e('0x1a')]();};}function respondWithResult(_0x310e23,_0x4b7c92){_0x4b7c92=_0x4b7c92||0xc8;return function(_0x4927c9){if(_0x4927c9){return _0x310e23[_0x811e('0x19')](_0x4b7c92)[_0x811e('0x1b')](_0x4927c9);}};}function respondWithFilteredResult(_0x2892db,_0x1440d0){return function(_0x3f1612){if(_0x3f1612){var _0x363250=typeof _0x1440d0[_0x811e('0x1c')]===_0x811e('0x1d')&&typeof _0x1440d0[_0x811e('0x1e')]===_0x811e('0x1d');var _0x49985d=_0x3f1612[_0x811e('0x1f')];var _0x4697f=_0x363250?0x0:_0x1440d0[_0x811e('0x1c')];var _0x530b62=_0x363250?_0x3f1612[_0x811e('0x1f')]:_0x1440d0['offset']+_0x1440d0[_0x811e('0x1e')];var _0x5efca5;if(_0x530b62>=_0x49985d){_0x530b62=_0x49985d;_0x5efca5=0xc8;}else{_0x5efca5=0xce;}_0x2892db[_0x811e('0x19')](_0x5efca5);return _0x2892db[_0x811e('0x20')]('Content-Range',_0x4697f+'-'+_0x530b62+'/'+_0x49985d)[_0x811e('0x1b')](_0x3f1612);}return null;};}function patchUpdates(_0x3cf79b){return function(_0x3f3c95){try{jsonpatch['apply'](_0x3f3c95,_0x3cf79b,!![]);}catch(_0xd4a2d1){return BPromise[_0x811e('0x21')](_0xd4a2d1);}return _0x3f3c95[_0x811e('0x22')]();};}function saveUpdates(_0x5b356a,_0x405d67){return function(_0x331209){if(_0x331209){return _0x331209['update'](_0x5b356a)[_0x811e('0x23')](function(_0x2b0d00){return _0x2b0d00;});}return null;};}function removeEntity(_0x2a14c0,_0x16686a){return function(_0x46eac4){if(_0x46eac4){return _0x46eac4[_0x811e('0x24')]()[_0x811e('0x23')](function(){_0x2a14c0[_0x811e('0x19')](0xcc)[_0x811e('0x1a')]();});}};}function handleEntityNotFound(_0x48b786,_0x4b9397){return function(_0x243f4f){if(!_0x243f4f){_0x48b786[_0x811e('0x18')](0x194);}return _0x243f4f;};}function handleError(_0x303ba3,_0x3c9fc1){_0x3c9fc1=_0x3c9fc1||0x1f4;return function(_0x541cb2){logger[_0x811e('0x25')](_0x541cb2[_0x811e('0x26')]);if(_0x541cb2[_0x811e('0x27')]){delete _0x541cb2[_0x811e('0x27')];}_0x303ba3[_0x811e('0x19')](_0x3c9fc1)[_0x811e('0x28')](_0x541cb2);};}exports['sendUserNotification']=function(_0x5ab6b6,_0x2cd807,_0x23653d){if(!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('text')&&!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('TemplateId')){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))](_0x811e('0x2d'));}else{if(_0x5ab6b6['body'][_0x811e('0x2a')]('TemplateId')&&!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')](_0x811e('0x2e'))){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))](_0x811e('0x2f'));}if(!_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')](_0x811e('0x30'))){throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x81178c=JSON[_0x811e('0x31')](_0x5ab6b6[_0x811e('0x29')][_0x811e('0x30')]);}catch(_0x3bf70a){logger[_0x811e('0x25')](_0x3bf70a);throw new db[(_0x811e('0x2b'))][(_0x811e('0x2c'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x85002=[_0x811e('0x32'),_0x811e('0x33'),_0x811e('0x34'),'openchannelqueue',_0x811e('0x35'),_0x811e('0x36'),_0x811e('0x37'),'team',_0x811e('0x38')];if(_[_0x811e('0x39')](_0x81178c,function(_0x3a371a){return!_['includes'](_0x85002,_0x3a371a['model'][_0x811e('0x3a')]());})){throw new db['Sequelize'][(_0x811e('0x2c'))](_0x811e('0x3b'));}}}var _0x34ce21={};_0x34ce21[_0x811e('0x3c')]=_0x5ab6b6[_0x811e('0x29')][_0x811e('0x2a')]('senderName')?_0x5ab6b6[_0x811e('0x29')]['senderName']:_0x5ab6b6['user'][_0x811e('0x3d')];_0x34ce21['recipientsDescription']=_[_0x811e('0x3e')](_0x5ab6b6[_0x811e('0x29')][_0x811e('0x3f')])?null:_0x5ab6b6['body']['recipientsDescription'];_0x34ce21[_0x811e('0x40')]=_0x5ab6b6[_0x811e('0x29')][_0x811e('0x40')]||![];_0x34ce21['SenderId']=_0x5ab6b6[_0x811e('0x38')]['id'];return getContent(_0x5ab6b6[_0x811e('0x29')])[_0x811e('0x23')](function(_0x2673ef){_0x34ce21[_0x811e('0x29')]=_0x2673ef;return getRecipients(_0x81178c);})[_0x811e('0x23')](function(_0x22cec6){_0x34ce21['recipientsId']=_['sortBy'](_0x22cec6)[_0x811e('0x41')](',');return db[_0x811e('0x42')][_0x811e('0x43')](function(_0x5148e2){return db[_0x811e('0x44')]['create'](_0x34ce21,{'raw':!![],'transaction':_0x5148e2})['then'](function(_0x4de75f){var _0x46b4c0={'sender':_0x34ce21[_0x811e('0x3c')],'description':_0x34ce21['recipientsDescription'],'content':_0x34ce21[_0x811e('0x29')],'beep':_0x34ce21[_0x811e('0x40')]};_0x22cec6['forEach'](function(_0x23a092){_0x46b4c0[_0x811e('0x45')]=_0x23a092;socket[_0x811e('0x46')]('userNotification:send',_0x46b4c0);});return _0x4de75f;});});})[_0x811e('0x23')](respondWithResult(_0x2cd807,0xc9))[_0x811e('0x47')](handleError(_0x2cd807,null));};function getContent(_0x89bb71){return new BPromise(function(_0x39fad5,_0x50d210){if(_0x89bb71[_0x811e('0x48')]){_0x39fad5(_0x89bb71[_0x811e('0x48')]);return;}return db['Template']['findOne']({'attributes':[_0x811e('0x49')],'where':{'id':_0x89bb71[_0x811e('0x4a')]},'raw':!![]})['then'](function(_0x3552b3){if(!_0x3552b3)throw new db['Sequelize'][(_0x811e('0x2c'))](_0x811e('0x4b'));var _0x26738a=Mustache['render'](_0x3552b3[_0x811e('0x49')],_0x89bb71['view']);_0x39fad5(_0x26738a);})[_0x811e('0x47')](function(_0x2aab38){_0x50d210(_0x2aab38);});});}function getRecipients(_0x295782){return new BPromise(function(_0xe9cf15,_0x4b6bf1){var _0x417c07=[];var _0x12e718=[];_0x295782[_0x811e('0x4c')](function(_0x2dacef){var _0x7a165d=_[_0x811e('0x4d')](_0x2dacef[_0x811e('0x4e')]['toLowerCase']());if(_0x7a165d==='User'){_0x417c07=_[_0x811e('0x4f')](_0x417c07,_0x2dacef[_0x811e('0x50')]);}else{if(_['includes'](_0x7a165d,_0x811e('0x51')))_0x7a165d=_0x7a165d[_0x811e('0x52')](_0x811e('0x51'),'Queue');_0x2dacef['ids'][_0x811e('0x4c')](function(_0x46eda8){_0x12e718[_0x811e('0x53')](getAgents(_0x7a165d,_0x46eda8));});}});return BPromise[_0x811e('0x54')](_0x12e718)[_0x811e('0x23')](function(_0x2b36b0){_0x417c07=_[_0x811e('0x4f')](_0x417c07,_[_0x811e('0x55')](_0x2b36b0));_0xe9cf15(_0x417c07);})['catch'](function(_0x107f0b){_0x4b6bf1(_0x107f0b);});});}function getAgents(_0x4eacef,_0x3a29b5){return new BPromise(function(_0x1038fd,_0x275961){return db[_0x4eacef][_0x811e('0x56')]({'where':{'id':_0x3a29b5}})[_0x811e('0x23')](function(_0x567ded){return _0x567ded[_0x811e('0x57')]({'attributes':['id'],'raw':!![]})[_0x811e('0x23')](function(_0x3663c1){var _0x577c1d=_[_0x811e('0x58')](_0x3663c1,'id');_0x1038fd(_0x577c1d);});})[_0x811e('0x47')](function(_0x16d35d){_0x275961(_0x16d35d);});});}
\ No newline at end of file