Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index 47b89cf..7652f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f36=['save','then','destroy','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','intersection','catch','create','update','body','find','describe','nolimit','includeAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4f36,0x12f));var _0x64f3=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x4f36[_0x49d19d];return _0x4ebef1;};'use strict';var emlformat=require(_0x64f3('0x0'));var rimraf=require(_0x64f3('0x1'));var zipdir=require(_0x64f3('0x2'));var jsonpatch=require(_0x64f3('0x3'));var rp=require(_0x64f3('0x4'));var moment=require(_0x64f3('0x5'));var BPromise=require(_0x64f3('0x6'));var Mustache=require(_0x64f3('0x7'));var util=require(_0x64f3('0x8'));var path=require(_0x64f3('0x9'));var sox=require(_0x64f3('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64f3('0xb'));var _=require(_0x64f3('0xc'));var squel=require(_0x64f3('0xd'));var crypto=require(_0x64f3('0xe'));var jsforce=require(_0x64f3('0xf'));var deskjs=require(_0x64f3('0x10'));var toCsv=require(_0x64f3('0x11'));var querystring=require(_0x64f3('0x12'));var Papa=require(_0x64f3('0x13'));var Redis=require('ioredis');var authService=require(_0x64f3('0x14'));var qs=require(_0x64f3('0x15'));var as=require(_0x64f3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64f3('0x17'))('api');var utils=require(_0x64f3('0x18'));var config=require(_0x64f3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x64f3('0x1a'))['db'];config[_0x64f3('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x64f3('0x1c'))(new Redis(config[_0x64f3('0x1b')]));require(_0x64f3('0x1d'))[_0x64f3('0x1e')](socket);function respondWithStatusCode(_0x1c4f67,_0x3e5c0c){_0x3e5c0c=_0x3e5c0c||0xcc;return function(_0x12869a){if(_0x12869a){return _0x1c4f67[_0x64f3('0x1f')](_0x3e5c0c);}return _0x1c4f67[_0x64f3('0x20')](_0x3e5c0c)[_0x64f3('0x21')]();};}function respondWithResult(_0x8fda88,_0x10fb9d){_0x10fb9d=_0x10fb9d||0xc8;return function(_0x525c7f){if(_0x525c7f){return _0x8fda88[_0x64f3('0x20')](_0x10fb9d)[_0x64f3('0x22')](_0x525c7f);}};}function respondWithFilteredResult(_0x64fd30,_0x120d17){return function(_0x3bdcb7){if(_0x3bdcb7){var _0x44c351=typeof _0x120d17[_0x64f3('0x23')]===_0x64f3('0x24')&&typeof _0x120d17['limit']==='undefined';var _0x2b7be9=_0x3bdcb7[_0x64f3('0x25')];var _0x3d1cab=_0x44c351?0x0:_0x120d17[_0x64f3('0x23')];var _0x347407=_0x44c351?_0x3bdcb7[_0x64f3('0x25')]:_0x120d17[_0x64f3('0x23')]+_0x120d17['limit'];var _0x3fb7f2;if(_0x347407>=_0x2b7be9){_0x347407=_0x2b7be9;_0x3fb7f2=0xc8;}else{_0x3fb7f2=0xce;}_0x64fd30[_0x64f3('0x20')](_0x3fb7f2);return _0x64fd30[_0x64f3('0x26')](_0x64f3('0x27'),_0x3d1cab+'-'+_0x347407+'/'+_0x2b7be9)[_0x64f3('0x22')](_0x3bdcb7);}return null;};}function patchUpdates(_0x33f678){return function(_0x47ed26){try{jsonpatch[_0x64f3('0x28')](_0x47ed26,_0x33f678,!![]);}catch(_0x52209f){return BPromise['reject'](_0x52209f);}return _0x47ed26[_0x64f3('0x29')]();};}function saveUpdates(_0x45948b,_0x16008d){return function(_0x412b5d){if(_0x412b5d){return _0x412b5d['update'](_0x45948b)[_0x64f3('0x2a')](function(_0x491b3f){return _0x491b3f;});}return null;};}function removeEntity(_0x224d46,_0x1c944d){return function(_0x6fd82){if(_0x6fd82){return _0x6fd82[_0x64f3('0x2b')]()['then'](function(){_0x224d46[_0x64f3('0x20')](0xcc)[_0x64f3('0x21')]();});}};}function handleEntityNotFound(_0x43881d,_0x5814e4){return function(_0x243de5){if(!_0x243de5){_0x43881d[_0x64f3('0x1f')](0x194);}return _0x243de5;};}function handleError(_0x1bdf6c,_0x365e15){_0x365e15=_0x365e15||0x1f4;return function(_0x5acbf7){logger['error'](_0x5acbf7[_0x64f3('0x2c')]);if(_0x5acbf7['name']){delete _0x5acbf7[_0x64f3('0x2d')];}_0x1bdf6c[_0x64f3('0x20')](_0x365e15)[_0x64f3('0x2e')](_0x5acbf7);};}exports[_0x64f3('0x2f')]=function(_0x2eee89,_0x709b7f){var _0x1f7b37={},_0x20b061={},_0x295488={'count':0x0,'rows':[]};var _0x20cbbd=_[_0x64f3('0x30')](db[_0x64f3('0x31')][_0x64f3('0x32')],function(_0x5b126d){return{'name':_0x5b126d[_0x64f3('0x33')],'type':_0x5b126d[_0x64f3('0x34')][_0x64f3('0x35')]};});_0x20b061[_0x64f3('0x36')]=_[_0x64f3('0x30')](_0x20cbbd,_0x64f3('0x2d'));_0x20b061['query']=_[_0x64f3('0x37')](_0x2eee89[_0x64f3('0x38')]);_0x20b061['filters']=_['intersection'](_0x20b061[_0x64f3('0x36')],_0x20b061[_0x64f3('0x38')]);_0x1f7b37['attributes']=_['intersection'](_0x20b061['model'],qs[_0x64f3('0x39')](_0x2eee89[_0x64f3('0x38')]['fields']));_0x1f7b37[_0x64f3('0x3a')]=_0x1f7b37[_0x64f3('0x3a')][_0x64f3('0x3b')]?_0x1f7b37[_0x64f3('0x3a')]:_0x20b061[_0x64f3('0x36')];if(!_0x2eee89[_0x64f3('0x38')][_0x64f3('0x3c')]('nolimit')){_0x1f7b37['limit']=qs[_0x64f3('0x3d')](_0x2eee89[_0x64f3('0x38')][_0x64f3('0x3d')]);_0x1f7b37['offset']=qs[_0x64f3('0x23')](_0x2eee89[_0x64f3('0x38')][_0x64f3('0x23')]);}_0x1f7b37[_0x64f3('0x3e')]=qs[_0x64f3('0x3f')](_0x2eee89[_0x64f3('0x38')][_0x64f3('0x3f')]);_0x1f7b37[_0x64f3('0x40')]=qs['filters'](_[_0x64f3('0x41')](_0x2eee89[_0x64f3('0x38')],_0x20b061[_0x64f3('0x42')]),_0x20cbbd);if(_0x2eee89[_0x64f3('0x38')][_0x64f3('0x43')]){_0x1f7b37[_0x64f3('0x40')]=_[_0x64f3('0x44')](_0x1f7b37[_0x64f3('0x40')],{'$or':_[_0x64f3('0x30')](_0x20cbbd,function(_0x4e92a8){if(_0x4e92a8['type']!==_0x64f3('0x45')){var _0x13da29={};_0x13da29[_0x4e92a8[_0x64f3('0x2d')]]={'$like':'%'+_0x2eee89[_0x64f3('0x38')][_0x64f3('0x43')]+'%'};return _0x13da29;}})});}_0x1f7b37=_[_0x64f3('0x44')]({},_0x1f7b37,_0x2eee89[_0x64f3('0x46')]);var _0x593151={'where':_0x1f7b37[_0x64f3('0x40')]};return db[_0x64f3('0x31')][_0x64f3('0x25')](_0x593151)[_0x64f3('0x2a')](function(_0x9ba3f2){_0x295488['count']=_0x9ba3f2;if(_0x2eee89[_0x64f3('0x38')]['includeAll']){_0x1f7b37[_0x64f3('0x47')]=[{'all':!![]}];}return db[_0x64f3('0x31')][_0x64f3('0x48')](_0x1f7b37);})[_0x64f3('0x2a')](function(_0x170f77){_0x295488[_0x64f3('0x49')]=_0x170f77;return _0x295488;})[_0x64f3('0x2a')](respondWithFilteredResult(_0x709b7f,_0x1f7b37))['catch'](handleError(_0x709b7f,null));};exports[_0x64f3('0x4a')]=function(_0x1ecceb,_0x308c01){var _0x3841c5={'raw':![],'where':{'id':_0x1ecceb[_0x64f3('0x4b')]['id']}},_0x43f1fc={};_0x43f1fc[_0x64f3('0x36')]=_[_0x64f3('0x37')](db['VoiceQueueReport'][_0x64f3('0x32')]);_0x43f1fc[_0x64f3('0x38')]=_['keys'](_0x1ecceb[_0x64f3('0x38')]);_0x43f1fc['filters']=_[_0x64f3('0x4c')](_0x43f1fc[_0x64f3('0x36')],_0x43f1fc['query']);_0x3841c5[_0x64f3('0x3a')]=_[_0x64f3('0x4c')](_0x43f1fc['model'],qs[_0x64f3('0x39')](_0x1ecceb[_0x64f3('0x38')][_0x64f3('0x39')]));_0x3841c5[_0x64f3('0x3a')]=_0x3841c5[_0x64f3('0x3a')][_0x64f3('0x3b')]?_0x3841c5[_0x64f3('0x3a')]:_0x43f1fc[_0x64f3('0x36')];if(_0x1ecceb[_0x64f3('0x38')]['includeAll']){_0x3841c5[_0x64f3('0x47')]=[{'all':!![]}];}_0x3841c5=_['merge']({},_0x3841c5,_0x1ecceb[_0x64f3('0x46')]);return db[_0x64f3('0x31')]['find'](_0x3841c5)[_0x64f3('0x2a')](handleEntityNotFound(_0x308c01,null))[_0x64f3('0x2a')](respondWithResult(_0x308c01,null))[_0x64f3('0x4d')](handleError(_0x308c01,null));};exports[_0x64f3('0x4e')]=function(_0x13263c,_0x4de11f){return db[_0x64f3('0x31')][_0x64f3('0x4e')](_0x13263c['body'],{})[_0x64f3('0x2a')](respondWithResult(_0x4de11f,0xc9))[_0x64f3('0x4d')](handleError(_0x4de11f,null));};exports[_0x64f3('0x4f')]=function(_0x277d3f,_0x1a32fa){if(_0x277d3f[_0x64f3('0x50')]['id']){delete _0x277d3f['body']['id'];}return db[_0x64f3('0x31')][_0x64f3('0x51')]({'where':{'id':_0x277d3f['params']['id']}})[_0x64f3('0x2a')](handleEntityNotFound(_0x1a32fa,null))[_0x64f3('0x2a')](saveUpdates(_0x277d3f[_0x64f3('0x50')],null))[_0x64f3('0x2a')](respondWithResult(_0x1a32fa,null))[_0x64f3('0x4d')](handleError(_0x1a32fa,null));};exports['destroy']=function(_0x417269,_0x4e6189){return db[_0x64f3('0x31')]['find']({'where':{'id':_0x417269[_0x64f3('0x4b')]['id']}})[_0x64f3('0x2a')](handleEntityNotFound(_0x4e6189,null))[_0x64f3('0x2a')](removeEntity(_0x4e6189,null))[_0x64f3('0x4d')](handleError(_0x4e6189,null));};exports[_0x64f3('0x52')]=function(_0x4dd017,_0xcee53c){return db['VoiceQueueReport'][_0x64f3('0x52')]()[_0x64f3('0x2a')](respondWithResult(_0xcee53c,null))['catch'](handleError(_0xcee53c,null));};exports['getVoiceQueuesReport']=function(_0x5e2eee,_0x2f2038){var _0x12aafe={},_0x5303d1={},_0x3da942={'count':0x0,'rows':[]};_0x5303d1['model']=_[_0x64f3('0x37')](db['VoiceQueueReport'][_0x64f3('0x32')]);_0x5303d1[_0x64f3('0x38')]=_[_0x64f3('0x37')](_0x5e2eee['query']);_0x5303d1[_0x64f3('0x42')]=_['intersection'](_0x5303d1[_0x64f3('0x36')],_0x5303d1[_0x64f3('0x38')]);_0x12aafe[_0x64f3('0x3a')]=_[_0x64f3('0x4c')](_0x5303d1['model'],qs[_0x64f3('0x39')](_0x5e2eee[_0x64f3('0x38')]['fields']));_0x12aafe[_0x64f3('0x3a')]=_0x12aafe[_0x64f3('0x3a')][_0x64f3('0x3b')]?_0x12aafe[_0x64f3('0x3a')]:_0x5303d1[_0x64f3('0x36')];if(!_0x5e2eee[_0x64f3('0x38')][_0x64f3('0x3c')](_0x64f3('0x53'))){_0x12aafe[_0x64f3('0x3d')]=qs[_0x64f3('0x3d')](_0x5e2eee['query'][_0x64f3('0x3d')]);_0x12aafe[_0x64f3('0x23')]=qs[_0x64f3('0x23')](_0x5e2eee[_0x64f3('0x38')]['offset']);}_0x12aafe[_0x64f3('0x3e')]=qs[_0x64f3('0x3f')](_0x5e2eee['query'][_0x64f3('0x3f')]);_0x12aafe[_0x64f3('0x40')]=qs[_0x64f3('0x42')](_[_0x64f3('0x41')](_0x5e2eee['query'],_0x5303d1[_0x64f3('0x42')]));if(_0x5e2eee[_0x64f3('0x38')][_0x64f3('0x43')]){_0x12aafe[_0x64f3('0x40')]=_[_0x64f3('0x44')](_0x12aafe[_0x64f3('0x40')],{'$or':_['map'](_0x12aafe[_0x64f3('0x3a')],function(_0x3fc110){var _0x38c394={};_0x38c394[_0x3fc110]={'$like':'%'+_0x5e2eee[_0x64f3('0x38')][_0x64f3('0x43')]+'%'};return _0x38c394;})});}_0x12aafe=_[_0x64f3('0x44')]({},_0x12aafe,_0x5e2eee[_0x64f3('0x46')]);var _0x25d123={'where':_0x12aafe[_0x64f3('0x40')]};return db['VoiceQueueReport'][_0x64f3('0x25')](_0x25d123)[_0x64f3('0x2a')](function(_0x5592e7){_0x3da942[_0x64f3('0x25')]=_0x5592e7;if(_0x5e2eee['query'][_0x64f3('0x54')]){_0x12aafe[_0x64f3('0x47')]=[{'all':!![]}];}return db[_0x64f3('0x31')]['findAll'](_0x12aafe);})[_0x64f3('0x2a')](function(_0xc7279c){_0x3da942[_0x64f3('0x49')]=_0xc7279c;return _0x3da942;})[_0x64f3('0x2a')](respondWithFilteredResult(_0x2f2038,_0x12aafe,_0x64f3('0x55')))[_0x64f3('0x4d')](handleError(_0x2f2038,null,_0x64f3('0x55')));};
\ No newline at end of file
+var _0xf8d6=['json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','map','VoiceQueueReport','rawAttributes','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','status','end'];(function(_0x50b14a,_0x304296){var _0x2887f3=function(_0x146811){while(--_0x146811){_0x50b14a['push'](_0x50b14a['shift']());}};_0x2887f3(++_0x304296);}(_0xf8d6,0xcc));var _0x6f8d=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0xf8d6[_0x136619];return _0x38c4a5;};'use strict';var emlformat=require(_0x6f8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f8d('0x1'));var jsonpatch=require(_0x6f8d('0x2'));var rp=require(_0x6f8d('0x3'));var moment=require('moment');var BPromise=require(_0x6f8d('0x4'));var Mustache=require(_0x6f8d('0x5'));var util=require(_0x6f8d('0x6'));var path=require(_0x6f8d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6f8d('0x8'));var fs=require('fs');var fs_extra=require(_0x6f8d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6f8d('0xa'));var deskjs=require(_0x6f8d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6f8d('0xc'));var Papa=require(_0x6f8d('0xd'));var Redis=require(_0x6f8d('0xe'));var authService=require(_0x6f8d('0xf'));var qs=require(_0x6f8d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f8d('0x11'));var logger=require(_0x6f8d('0x12'))(_0x6f8d('0x13'));var utils=require(_0x6f8d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f8d('0x15'));var db=require(_0x6f8d('0x16'))['db'];config['redis']=_[_0x6f8d('0x17')](config[_0x6f8d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f8d('0x19'))(new Redis(config[_0x6f8d('0x18')]));require(_0x6f8d('0x1a'))[_0x6f8d('0x1b')](socket);function respondWithStatusCode(_0x4cdfec,_0xf38585){_0xf38585=_0xf38585||0xcc;return function(_0x5d43c4){if(_0x5d43c4){return _0x4cdfec['sendStatus'](_0xf38585);}return _0x4cdfec[_0x6f8d('0x1c')](_0xf38585)[_0x6f8d('0x1d')]();};}function respondWithResult(_0x23ff7c,_0x3dfa5d){_0x3dfa5d=_0x3dfa5d||0xc8;return function(_0xfb8194){if(_0xfb8194){return _0x23ff7c[_0x6f8d('0x1c')](_0x3dfa5d)[_0x6f8d('0x1e')](_0xfb8194);}};}function respondWithFilteredResult(_0x58d430,_0x4b3f9b){return function(_0x5d2a5c){if(_0x5d2a5c){var _0x4348cb=typeof _0x4b3f9b['offset']===_0x6f8d('0x1f')&&typeof _0x4b3f9b[_0x6f8d('0x20')]===_0x6f8d('0x1f');var _0x5f3f30=_0x5d2a5c[_0x6f8d('0x21')];var _0x1fd64f=_0x4348cb?0x0:_0x4b3f9b[_0x6f8d('0x22')];var _0x2652ec=_0x4348cb?_0x5d2a5c[_0x6f8d('0x21')]:_0x4b3f9b[_0x6f8d('0x22')]+_0x4b3f9b[_0x6f8d('0x20')];var _0x3c2635;if(_0x2652ec>=_0x5f3f30){_0x2652ec=_0x5f3f30;_0x3c2635=0xc8;}else{_0x3c2635=0xce;}_0x58d430['status'](_0x3c2635);return _0x58d430['set'](_0x6f8d('0x23'),_0x1fd64f+'-'+_0x2652ec+'/'+_0x5f3f30)[_0x6f8d('0x1e')](_0x5d2a5c);}return null;};}function patchUpdates(_0x501fa2){return function(_0x509c1f){try{jsonpatch[_0x6f8d('0x24')](_0x509c1f,_0x501fa2,!![]);}catch(_0x33e336){return BPromise[_0x6f8d('0x25')](_0x33e336);}return _0x509c1f['save']();};}function saveUpdates(_0x5d45b2,_0x2da601){return function(_0x3da215){if(_0x3da215){return _0x3da215['update'](_0x5d45b2)[_0x6f8d('0x26')](function(_0x58b8b5){return _0x58b8b5;});}return null;};}function removeEntity(_0x5eb447,_0x451d02){return function(_0x4fa2ec){if(_0x4fa2ec){return _0x4fa2ec[_0x6f8d('0x27')]()[_0x6f8d('0x26')](function(){_0x5eb447[_0x6f8d('0x1c')](0xcc)[_0x6f8d('0x1d')]();});}};}function handleEntityNotFound(_0x4a0f0d,_0x5647d8){return function(_0x5a93f2){if(!_0x5a93f2){_0x4a0f0d[_0x6f8d('0x28')](0x194);}return _0x5a93f2;};}function handleError(_0x134d32,_0x15f13f){_0x15f13f=_0x15f13f||0x1f4;return function(_0x101d06){logger['error'](_0x101d06[_0x6f8d('0x29')]);if(_0x101d06['name']){delete _0x101d06['name'];}_0x134d32['status'](_0x15f13f)['send'](_0x101d06);};}exports[_0x6f8d('0x2a')]=function(_0x33ef44,_0x447df2){var _0x4a03ab={},_0x4f19ef={},_0x4a5466={'count':0x0,'rows':[]};var _0x269233=_[_0x6f8d('0x2b')](db[_0x6f8d('0x2c')][_0x6f8d('0x2d')],function(_0x3d4403){return{'name':_0x3d4403['fieldName'],'type':_0x3d4403[_0x6f8d('0x2e')][_0x6f8d('0x2f')]};});_0x4f19ef['model']=_[_0x6f8d('0x2b')](_0x269233,_0x6f8d('0x30'));_0x4f19ef[_0x6f8d('0x31')]=_[_0x6f8d('0x32')](_0x33ef44[_0x6f8d('0x31')]);_0x4f19ef['filters']=_[_0x6f8d('0x33')](_0x4f19ef[_0x6f8d('0x34')],_0x4f19ef['query']);_0x4a03ab[_0x6f8d('0x35')]=_[_0x6f8d('0x33')](_0x4f19ef['model'],qs['fields'](_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x36')]));_0x4a03ab[_0x6f8d('0x35')]=_0x4a03ab['attributes'][_0x6f8d('0x37')]?_0x4a03ab[_0x6f8d('0x35')]:_0x4f19ef[_0x6f8d('0x34')];if(!_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x38')](_0x6f8d('0x39'))){_0x4a03ab['limit']=qs[_0x6f8d('0x20')](_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x20')]);_0x4a03ab[_0x6f8d('0x22')]=qs[_0x6f8d('0x22')](_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x22')]);}_0x4a03ab[_0x6f8d('0x3a')]=qs[_0x6f8d('0x3b')](_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x3b')]);_0x4a03ab['where']=qs['filters'](_[_0x6f8d('0x3c')](_0x33ef44[_0x6f8d('0x31')],_0x4f19ef[_0x6f8d('0x3d')]),_0x269233);if(_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x3e')]){_0x4a03ab[_0x6f8d('0x3f')]=_[_0x6f8d('0x40')](_0x4a03ab[_0x6f8d('0x3f')],{'$or':_[_0x6f8d('0x2b')](_0x269233,function(_0x356058){if(_0x356058[_0x6f8d('0x2e')]!=='VIRTUAL'){var _0x5a7095={};_0x5a7095[_0x356058[_0x6f8d('0x30')]]={'$like':'%'+_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x3e')]+'%'};return _0x5a7095;}})});}_0x4a03ab=_['merge']({},_0x4a03ab,_0x33ef44['options']);var _0x536ed7={'where':_0x4a03ab[_0x6f8d('0x3f')]};return db[_0x6f8d('0x2c')][_0x6f8d('0x21')](_0x536ed7)[_0x6f8d('0x26')](function(_0x5e250f){_0x4a5466[_0x6f8d('0x21')]=_0x5e250f;if(_0x33ef44[_0x6f8d('0x31')][_0x6f8d('0x41')]){_0x4a03ab[_0x6f8d('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6f8d('0x43')](_0x4a03ab);})[_0x6f8d('0x26')](function(_0x488001){_0x4a5466[_0x6f8d('0x44')]=_0x488001;return _0x4a5466;})[_0x6f8d('0x26')](respondWithFilteredResult(_0x447df2,_0x4a03ab))[_0x6f8d('0x45')](handleError(_0x447df2,null));};exports[_0x6f8d('0x46')]=function(_0x333cd2,_0x4227c1){var _0x4c5a6e={'raw':![],'where':{'id':_0x333cd2[_0x6f8d('0x47')]['id']}},_0x187a64={};_0x187a64['model']=_['keys'](db[_0x6f8d('0x2c')][_0x6f8d('0x2d')]);_0x187a64[_0x6f8d('0x31')]=_[_0x6f8d('0x32')](_0x333cd2[_0x6f8d('0x31')]);_0x187a64[_0x6f8d('0x3d')]=_[_0x6f8d('0x33')](_0x187a64[_0x6f8d('0x34')],_0x187a64[_0x6f8d('0x31')]);_0x4c5a6e[_0x6f8d('0x35')]=_['intersection'](_0x187a64[_0x6f8d('0x34')],qs[_0x6f8d('0x36')](_0x333cd2[_0x6f8d('0x31')][_0x6f8d('0x36')]));_0x4c5a6e[_0x6f8d('0x35')]=_0x4c5a6e[_0x6f8d('0x35')][_0x6f8d('0x37')]?_0x4c5a6e[_0x6f8d('0x35')]:_0x187a64[_0x6f8d('0x34')];if(_0x333cd2['query']['includeAll']){_0x4c5a6e[_0x6f8d('0x42')]=[{'all':!![]}];}_0x4c5a6e=_['merge']({},_0x4c5a6e,_0x333cd2[_0x6f8d('0x48')]);return db[_0x6f8d('0x2c')][_0x6f8d('0x49')](_0x4c5a6e)[_0x6f8d('0x26')](handleEntityNotFound(_0x4227c1,null))[_0x6f8d('0x26')](respondWithResult(_0x4227c1,null))['catch'](handleError(_0x4227c1,null));};exports[_0x6f8d('0x4a')]=function(_0x5c3502,_0x322da9){return db['VoiceQueueReport']['create'](_0x5c3502[_0x6f8d('0x4b')],{})[_0x6f8d('0x26')](respondWithResult(_0x322da9,0xc9))[_0x6f8d('0x45')](handleError(_0x322da9,null));};exports['update']=function(_0x2ea8ba,_0x5cdf42){if(_0x2ea8ba[_0x6f8d('0x4b')]['id']){delete _0x2ea8ba[_0x6f8d('0x4b')]['id'];}return db[_0x6f8d('0x2c')][_0x6f8d('0x49')]({'where':{'id':_0x2ea8ba[_0x6f8d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cdf42,null))[_0x6f8d('0x26')](saveUpdates(_0x2ea8ba[_0x6f8d('0x4b')],null))[_0x6f8d('0x26')](respondWithResult(_0x5cdf42,null))[_0x6f8d('0x45')](handleError(_0x5cdf42,null));};exports[_0x6f8d('0x27')]=function(_0x326d6d,_0x213004){return db[_0x6f8d('0x2c')][_0x6f8d('0x49')]({'where':{'id':_0x326d6d[_0x6f8d('0x47')]['id']}})[_0x6f8d('0x26')](handleEntityNotFound(_0x213004,null))[_0x6f8d('0x26')](removeEntity(_0x213004,null))[_0x6f8d('0x45')](handleError(_0x213004,null));};exports[_0x6f8d('0x4c')]=function(_0x474aeb,_0x525234){return db['VoiceQueueReport'][_0x6f8d('0x4c')]()[_0x6f8d('0x26')](respondWithResult(_0x525234,null))[_0x6f8d('0x45')](handleError(_0x525234,null));};exports[_0x6f8d('0x4d')]=function(_0x4b0254,_0x1a0d12){var _0x155804={},_0x4e30a3={},_0x3757e0={'count':0x0,'rows':[]};_0x4e30a3[_0x6f8d('0x34')]=_[_0x6f8d('0x32')](db[_0x6f8d('0x2c')][_0x6f8d('0x2d')]);_0x4e30a3['query']=_[_0x6f8d('0x32')](_0x4b0254['query']);_0x4e30a3[_0x6f8d('0x3d')]=_['intersection'](_0x4e30a3['model'],_0x4e30a3[_0x6f8d('0x31')]);_0x155804[_0x6f8d('0x35')]=_[_0x6f8d('0x33')](_0x4e30a3['model'],qs[_0x6f8d('0x36')](_0x4b0254[_0x6f8d('0x31')][_0x6f8d('0x36')]));_0x155804[_0x6f8d('0x35')]=_0x155804['attributes']['length']?_0x155804[_0x6f8d('0x35')]:_0x4e30a3[_0x6f8d('0x34')];if(!_0x4b0254[_0x6f8d('0x31')][_0x6f8d('0x38')](_0x6f8d('0x39'))){_0x155804[_0x6f8d('0x20')]=qs[_0x6f8d('0x20')](_0x4b0254[_0x6f8d('0x31')][_0x6f8d('0x20')]);_0x155804['offset']=qs['offset'](_0x4b0254[_0x6f8d('0x31')][_0x6f8d('0x22')]);}_0x155804[_0x6f8d('0x3a')]=qs['sort'](_0x4b0254[_0x6f8d('0x31')]['sort']);_0x155804['where']=qs[_0x6f8d('0x3d')](_[_0x6f8d('0x3c')](_0x4b0254['query'],_0x4e30a3['filters']));if(_0x4b0254['query'][_0x6f8d('0x3e')]){_0x155804[_0x6f8d('0x3f')]=_[_0x6f8d('0x40')](_0x155804[_0x6f8d('0x3f')],{'$or':_[_0x6f8d('0x2b')](_0x155804[_0x6f8d('0x35')],function(_0x882972){var _0x5ad844={};_0x5ad844[_0x882972]={'$like':'%'+_0x4b0254[_0x6f8d('0x31')][_0x6f8d('0x3e')]+'%'};return _0x5ad844;})});}_0x155804=_[_0x6f8d('0x40')]({},_0x155804,_0x4b0254[_0x6f8d('0x48')]);var _0x4cbb98={'where':_0x155804[_0x6f8d('0x3f')]};return db[_0x6f8d('0x2c')][_0x6f8d('0x21')](_0x4cbb98)[_0x6f8d('0x26')](function(_0x1c87e2){_0x3757e0[_0x6f8d('0x21')]=_0x1c87e2;if(_0x4b0254[_0x6f8d('0x31')]['includeAll']){_0x155804[_0x6f8d('0x42')]=[{'all':!![]}];}return db[_0x6f8d('0x2c')][_0x6f8d('0x43')](_0x155804);})['then'](function(_0x3d18c1){_0x3757e0[_0x6f8d('0x44')]=_0x3d18c1;return _0x3757e0;})['then'](respondWithFilteredResult(_0x1a0d12,_0x155804,_0x6f8d('0x4d')))['catch'](handleError(_0x1a0d12,null,_0x6f8d('0x4d')));};
\ No newline at end of file