Built motion from commit 5b761a7b.|2.5.36
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index 61cf775..bf57478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc3c=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','VoiceQueueReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','rawAttributes','options','create','body','find','params','destroy','describe','nolimit','order','pick','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x25be02,_0x10cf35){var _0x14c4d1=function(_0x1006b8){while(--_0x1006b8){_0x25be02['push'](_0x25be02['shift']());}};_0x14c4d1(++_0x10cf35);}(_0xcc3c,0x9d));var _0xccc3=function(_0x4d5b3e,_0x49beed){_0x4d5b3e=_0x4d5b3e-0x0;var _0x4b67c6=_0xcc3c[_0x4d5b3e];return _0x4b67c6;};'use strict';var emlformat=require(_0xccc3('0x0'));var rimraf=require(_0xccc3('0x1'));var zipdir=require(_0xccc3('0x2'));var jsonpatch=require(_0xccc3('0x3'));var rp=require(_0xccc3('0x4'));var moment=require(_0xccc3('0x5'));var BPromise=require(_0xccc3('0x6'));var Mustache=require(_0xccc3('0x7'));var util=require('util');var path=require(_0xccc3('0x8'));var sox=require(_0xccc3('0x9'));var csv=require('to-csv');var ejs=require(_0xccc3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccc3('0xb'));var squel=require(_0xccc3('0xc'));var crypto=require(_0xccc3('0xd'));var jsforce=require(_0xccc3('0xe'));var deskjs=require(_0xccc3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xccc3('0x10'));var Papa=require(_0xccc3('0x11'));var Redis=require(_0xccc3('0x12'));var authService=require(_0xccc3('0x13'));var qs=require(_0xccc3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccc3('0x15'));var logger=require('../../config/logger')(_0xccc3('0x16'));var utils=require(_0xccc3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xccc3('0x18'));var db=require(_0xccc3('0x19'))['db'];config[_0xccc3('0x1a')]=_[_0xccc3('0x1b')](config[_0xccc3('0x1a')],{'host':_0xccc3('0x1c'),'port':0x18eb});var socket=require(_0xccc3('0x1d'))(new Redis(config[_0xccc3('0x1a')]));require(_0xccc3('0x1e'))['register'](socket);function respondWithStatusCode(_0x5abbbb,_0xf01a1d){_0xf01a1d=_0xf01a1d||0xcc;return function(_0x82c3cc){if(_0x82c3cc){return _0x5abbbb['sendStatus'](_0xf01a1d);}return _0x5abbbb['status'](_0xf01a1d)[_0xccc3('0x1f')]();};}function respondWithResult(_0x56f230,_0x3bc9b8){_0x3bc9b8=_0x3bc9b8||0xc8;return function(_0x1e8822){if(_0x1e8822){return _0x56f230[_0xccc3('0x20')](_0x3bc9b8)['json'](_0x1e8822);}};}function respondWithFilteredResult(_0x11d6c8,_0x546ed7){return function(_0x403ca0){if(_0x403ca0){var _0x18e152=typeof _0x546ed7[_0xccc3('0x21')]===_0xccc3('0x22')&&typeof _0x546ed7[_0xccc3('0x23')]===_0xccc3('0x22');var _0x21d639=_0x403ca0['count'];var _0x183be7=_0x18e152?0x0:_0x546ed7[_0xccc3('0x21')];var _0x28f8f8=_0x18e152?_0x403ca0['count']:_0x546ed7['offset']+_0x546ed7[_0xccc3('0x23')];var _0x390769;if(_0x28f8f8>=_0x21d639){_0x28f8f8=_0x21d639;_0x390769=0xc8;}else{_0x390769=0xce;}_0x11d6c8[_0xccc3('0x20')](_0x390769);return _0x11d6c8[_0xccc3('0x24')](_0xccc3('0x25'),_0x183be7+'-'+_0x28f8f8+'/'+_0x21d639)['json'](_0x403ca0);}return null;};}function patchUpdates(_0x575dc9){return function(_0x505509){try{jsonpatch[_0xccc3('0x26')](_0x505509,_0x575dc9,!![]);}catch(_0x40330b){return BPromise[_0xccc3('0x27')](_0x40330b);}return _0x505509[_0xccc3('0x28')]();};}function saveUpdates(_0x3e360a,_0x491d7c){return function(_0x3ae47b){if(_0x3ae47b){return _0x3ae47b[_0xccc3('0x29')](_0x3e360a)[_0xccc3('0x2a')](function(_0x5e121f){return _0x5e121f;});}return null;};}function removeEntity(_0x35787d,_0x5a8394){return function(_0x1c8de5){if(_0x1c8de5){return _0x1c8de5['destroy']()[_0xccc3('0x2a')](function(){_0x35787d['status'](0xcc)[_0xccc3('0x1f')]();});}};}function handleEntityNotFound(_0x1b74cb,_0x2b57b3){return function(_0x18e62e){if(!_0x18e62e){_0x1b74cb[_0xccc3('0x2b')](0x194);}return _0x18e62e;};}function handleError(_0x10f376,_0x3173e0){_0x3173e0=_0x3173e0||0x1f4;return function(_0x28a9b7){logger[_0xccc3('0x2c')](_0x28a9b7[_0xccc3('0x2d')]);if(_0x28a9b7[_0xccc3('0x2e')]){delete _0x28a9b7[_0xccc3('0x2e')];}_0x10f376[_0xccc3('0x20')](_0x3173e0)[_0xccc3('0x2f')](_0x28a9b7);};}exports['index']=function(_0x739985,_0x2d56e1){var _0x4fe971={},_0x187e0f={},_0x59ab8e={'count':0x0,'rows':[]};var _0x258a7b=_[_0xccc3('0x30')](db[_0xccc3('0x31')]['rawAttributes'],function(_0x2a14ba){return{'name':_0x2a14ba['fieldName'],'type':_0x2a14ba[_0xccc3('0x32')][_0xccc3('0x33')]};});_0x187e0f['model']=_[_0xccc3('0x30')](_0x258a7b,_0xccc3('0x2e'));_0x187e0f[_0xccc3('0x34')]=_[_0xccc3('0x35')](_0x739985[_0xccc3('0x34')]);_0x187e0f[_0xccc3('0x36')]=_[_0xccc3('0x37')](_0x187e0f[_0xccc3('0x38')],_0x187e0f[_0xccc3('0x34')]);_0x4fe971[_0xccc3('0x39')]=_[_0xccc3('0x37')](_0x187e0f[_0xccc3('0x38')],qs[_0xccc3('0x3a')](_0x739985[_0xccc3('0x34')][_0xccc3('0x3a')]));_0x4fe971['attributes']=_0x4fe971['attributes'][_0xccc3('0x3b')]?_0x4fe971[_0xccc3('0x39')]:_0x187e0f[_0xccc3('0x38')];if(!_0x739985['query'][_0xccc3('0x3c')]('nolimit')){_0x4fe971[_0xccc3('0x23')]=qs[_0xccc3('0x23')](_0x739985[_0xccc3('0x34')]['limit']);_0x4fe971['offset']=qs[_0xccc3('0x21')](_0x739985['query'][_0xccc3('0x21')]);}_0x4fe971['order']=qs[_0xccc3('0x3d')](_0x739985[_0xccc3('0x34')]['sort']);_0x4fe971['where']=qs['filters'](_['pick'](_0x739985['query'],_0x187e0f[_0xccc3('0x36')]),_0x258a7b);if(_0x739985[_0xccc3('0x34')][_0xccc3('0x3e')]){_0x4fe971[_0xccc3('0x3f')]=_[_0xccc3('0x40')](_0x4fe971[_0xccc3('0x3f')],{'$or':_['map'](_0x258a7b,function(_0x24d08c){if(_0x24d08c[_0xccc3('0x32')]!==_0xccc3('0x41')){var _0x376d4c={};_0x376d4c[_0x24d08c[_0xccc3('0x2e')]]={'$like':'%'+_0x739985[_0xccc3('0x34')][_0xccc3('0x3e')]+'%'};return _0x376d4c;}})});}_0x4fe971=_[_0xccc3('0x40')]({},_0x4fe971,_0x739985['options']);var _0x133870={'where':_0x4fe971[_0xccc3('0x3f')]};return db[_0xccc3('0x31')][_0xccc3('0x42')](_0x133870)[_0xccc3('0x2a')](function(_0x591e78){_0x59ab8e[_0xccc3('0x42')]=_0x591e78;if(_0x739985[_0xccc3('0x34')][_0xccc3('0x43')]){_0x4fe971[_0xccc3('0x44')]=[{'all':!![]}];}return db[_0xccc3('0x31')][_0xccc3('0x45')](_0x4fe971);})['then'](function(_0x30a52d){_0x59ab8e['rows']=_0x30a52d;return _0x59ab8e;})['then'](respondWithFilteredResult(_0x2d56e1,_0x4fe971))[_0xccc3('0x46')](handleError(_0x2d56e1,null));};exports[_0xccc3('0x47')]=function(_0x5cb06,_0x8bfc1d){var _0x68d5a4={'raw':![],'where':{'id':_0x5cb06['params']['id']}},_0x46b3a9={};_0x46b3a9[_0xccc3('0x38')]=_[_0xccc3('0x35')](db['VoiceQueueReport'][_0xccc3('0x48')]);_0x46b3a9[_0xccc3('0x34')]=_[_0xccc3('0x35')](_0x5cb06[_0xccc3('0x34')]);_0x46b3a9[_0xccc3('0x36')]=_['intersection'](_0x46b3a9[_0xccc3('0x38')],_0x46b3a9[_0xccc3('0x34')]);_0x68d5a4['attributes']=_['intersection'](_0x46b3a9['model'],qs['fields'](_0x5cb06[_0xccc3('0x34')]['fields']));_0x68d5a4['attributes']=_0x68d5a4['attributes']['length']?_0x68d5a4['attributes']:_0x46b3a9['model'];if(_0x5cb06[_0xccc3('0x34')][_0xccc3('0x43')]){_0x68d5a4[_0xccc3('0x44')]=[{'all':!![]}];}_0x68d5a4=_[_0xccc3('0x40')]({},_0x68d5a4,_0x5cb06[_0xccc3('0x49')]);return db[_0xccc3('0x31')]['find'](_0x68d5a4)[_0xccc3('0x2a')](handleEntityNotFound(_0x8bfc1d,null))[_0xccc3('0x2a')](respondWithResult(_0x8bfc1d,null))['catch'](handleError(_0x8bfc1d,null));};exports[_0xccc3('0x4a')]=function(_0x581b4e,_0x546b52){return db[_0xccc3('0x31')][_0xccc3('0x4a')](_0x581b4e[_0xccc3('0x4b')],{})[_0xccc3('0x2a')](respondWithResult(_0x546b52,0xc9))[_0xccc3('0x46')](handleError(_0x546b52,null));};exports[_0xccc3('0x29')]=function(_0x23b389,_0x1dc221){if(_0x23b389[_0xccc3('0x4b')]['id']){delete _0x23b389[_0xccc3('0x4b')]['id'];}return db[_0xccc3('0x31')][_0xccc3('0x4c')]({'where':{'id':_0x23b389[_0xccc3('0x4d')]['id']}})[_0xccc3('0x2a')](handleEntityNotFound(_0x1dc221,null))['then'](saveUpdates(_0x23b389[_0xccc3('0x4b')],null))[_0xccc3('0x2a')](respondWithResult(_0x1dc221,null))[_0xccc3('0x46')](handleError(_0x1dc221,null));};exports[_0xccc3('0x4e')]=function(_0x11a40f,_0x4a584c){return db[_0xccc3('0x31')][_0xccc3('0x4c')]({'where':{'id':_0x11a40f['params']['id']}})[_0xccc3('0x2a')](handleEntityNotFound(_0x4a584c,null))[_0xccc3('0x2a')](removeEntity(_0x4a584c,null))['catch'](handleError(_0x4a584c,null));};exports[_0xccc3('0x4f')]=function(_0x4c98e1,_0x5128b1){return db[_0xccc3('0x31')][_0xccc3('0x4f')]()[_0xccc3('0x2a')](respondWithResult(_0x5128b1,null))['catch'](handleError(_0x5128b1,null));};exports['getVoiceQueuesReport']=function(_0x1f8386,_0x236426){var _0x153a5a={},_0x656c73={},_0x364786={'count':0x0,'rows':[]};_0x656c73[_0xccc3('0x38')]=_['keys'](db[_0xccc3('0x31')][_0xccc3('0x48')]);_0x656c73['query']=_[_0xccc3('0x35')](_0x1f8386['query']);_0x656c73['filters']=_[_0xccc3('0x37')](_0x656c73[_0xccc3('0x38')],_0x656c73[_0xccc3('0x34')]);_0x153a5a['attributes']=_[_0xccc3('0x37')](_0x656c73[_0xccc3('0x38')],qs['fields'](_0x1f8386['query'][_0xccc3('0x3a')]));_0x153a5a[_0xccc3('0x39')]=_0x153a5a['attributes'][_0xccc3('0x3b')]?_0x153a5a[_0xccc3('0x39')]:_0x656c73['model'];if(!_0x1f8386[_0xccc3('0x34')][_0xccc3('0x3c')](_0xccc3('0x50'))){_0x153a5a[_0xccc3('0x23')]=qs[_0xccc3('0x23')](_0x1f8386[_0xccc3('0x34')]['limit']);_0x153a5a[_0xccc3('0x21')]=qs[_0xccc3('0x21')](_0x1f8386['query'][_0xccc3('0x21')]);}_0x153a5a[_0xccc3('0x51')]=qs[_0xccc3('0x3d')](_0x1f8386[_0xccc3('0x34')]['sort']);_0x153a5a['where']=qs[_0xccc3('0x36')](_[_0xccc3('0x52')](_0x1f8386[_0xccc3('0x34')],_0x656c73['filters']));if(_0x1f8386[_0xccc3('0x34')]['filter']){_0x153a5a[_0xccc3('0x3f')]=_['merge'](_0x153a5a['where'],{'$or':_[_0xccc3('0x30')](_0x153a5a[_0xccc3('0x39')],function(_0x396639){var _0x1a0f37={};_0x1a0f37[_0x396639]={'$like':'%'+_0x1f8386[_0xccc3('0x34')]['filter']+'%'};return _0x1a0f37;})});}_0x153a5a=_['merge']({},_0x153a5a,_0x1f8386['options']);var _0x577f60={'where':_0x153a5a[_0xccc3('0x3f')]};return db[_0xccc3('0x31')][_0xccc3('0x42')](_0x577f60)[_0xccc3('0x2a')](function(_0x1a53b8){_0x364786[_0xccc3('0x42')]=_0x1a53b8;if(_0x1f8386[_0xccc3('0x34')]['includeAll']){_0x153a5a['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xccc3('0x45')](_0x153a5a);})['then'](function(_0x4b3fec){_0x364786['rows']=_0x4b3fec;return _0x364786;})[_0xccc3('0x2a')](respondWithFilteredResult(_0x236426,_0x153a5a,_0xccc3('0x53')))[_0xccc3('0x46')](handleError(_0x236426,null,_0xccc3('0x53')));};
\ No newline at end of file
+var _0xb209=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','offset','undefined','limit','Content-Range','json','apply','save','update','destroy','then','end','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','count','includeAll','include','findAll','catch','show','params','merge','options','create','body','find','describe','getVoiceQueuesReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x38d8e2,_0x48603c){var _0x5afbee=function(_0x2eca5e){while(--_0x2eca5e){_0x38d8e2['push'](_0x38d8e2['shift']());}};_0x5afbee(++_0x48603c);}(_0xb209,0x14b));var _0x9b20=function(_0x18b97c,_0x142f1e){_0x18b97c=_0x18b97c-0x0;var _0x3c99e4=_0xb209[_0x18b97c];return _0x3c99e4;};'use strict';var emlformat=require(_0x9b20('0x0'));var rimraf=require(_0x9b20('0x1'));var zipdir=require(_0x9b20('0x2'));var jsonpatch=require(_0x9b20('0x3'));var rp=require(_0x9b20('0x4'));var moment=require(_0x9b20('0x5'));var BPromise=require(_0x9b20('0x6'));var Mustache=require(_0x9b20('0x7'));var util=require(_0x9b20('0x8'));var path=require(_0x9b20('0x9'));var sox=require(_0x9b20('0xa'));var csv=require('to-csv');var ejs=require(_0x9b20('0xb'));var fs=require('fs');var fs_extra=require(_0x9b20('0xc'));var _=require(_0x9b20('0xd'));var squel=require(_0x9b20('0xe'));var crypto=require(_0x9b20('0xf'));var jsforce=require(_0x9b20('0x10'));var deskjs=require(_0x9b20('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9b20('0x12'));var Papa=require('papaparse');var Redis=require(_0x9b20('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9b20('0x14'));var as=require(_0x9b20('0x15'));var hardwareService=require(_0x9b20('0x16'));var logger=require(_0x9b20('0x17'))(_0x9b20('0x18'));var utils=require(_0x9b20('0x19'));var config=require(_0x9b20('0x1a'));var licenseUtil=require(_0x9b20('0x1b'));var db=require(_0x9b20('0x1c'))['db'];config[_0x9b20('0x1d')]=_[_0x9b20('0x1e')](config[_0x9b20('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b20('0x1f'))(new Redis(config[_0x9b20('0x1d')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x59a30e,_0x59d788){_0x59d788=_0x59d788||0xcc;return function(_0x30f588){if(_0x30f588){return _0x59a30e[_0x9b20('0x20')](_0x59d788);}return _0x59a30e[_0x9b20('0x21')](_0x59d788)['end']();};}function respondWithResult(_0x2c0231,_0x43ed74){_0x43ed74=_0x43ed74||0xc8;return function(_0x4ccd95){if(_0x4ccd95){return _0x2c0231[_0x9b20('0x21')](_0x43ed74)['json'](_0x4ccd95);}};}function respondWithFilteredResult(_0x230dec,_0x6288dd){return function(_0x2bf4d9){if(_0x2bf4d9){var _0x4ef399=typeof _0x6288dd[_0x9b20('0x22')]===_0x9b20('0x23')&&typeof _0x6288dd[_0x9b20('0x24')]===_0x9b20('0x23');var _0xb698e5=_0x2bf4d9['count'];var _0x13b831=_0x4ef399?0x0:_0x6288dd[_0x9b20('0x22')];var _0x1fa63f=_0x4ef399?_0x2bf4d9['count']:_0x6288dd[_0x9b20('0x22')]+_0x6288dd[_0x9b20('0x24')];var _0x4631fe;if(_0x1fa63f>=_0xb698e5){_0x1fa63f=_0xb698e5;_0x4631fe=0xc8;}else{_0x4631fe=0xce;}_0x230dec[_0x9b20('0x21')](_0x4631fe);return _0x230dec['set'](_0x9b20('0x25'),_0x13b831+'-'+_0x1fa63f+'/'+_0xb698e5)[_0x9b20('0x26')](_0x2bf4d9);}return null;};}function patchUpdates(_0x57331b){return function(_0x49426c){try{jsonpatch[_0x9b20('0x27')](_0x49426c,_0x57331b,!![]);}catch(_0xe811ad){return BPromise['reject'](_0xe811ad);}return _0x49426c[_0x9b20('0x28')]();};}function saveUpdates(_0x55ef6d,_0x6c5be9){return function(_0x17c0cd){if(_0x17c0cd){return _0x17c0cd[_0x9b20('0x29')](_0x55ef6d)['then'](function(_0x234097){return _0x234097;});}return null;};}function removeEntity(_0x4d4cb3,_0x5b36e2){return function(_0x539ce9){if(_0x539ce9){return _0x539ce9[_0x9b20('0x2a')]()[_0x9b20('0x2b')](function(){_0x4d4cb3[_0x9b20('0x21')](0xcc)[_0x9b20('0x2c')]();});}};}function handleEntityNotFound(_0x346fee,_0xcd848c){return function(_0x544f1b){if(!_0x544f1b){_0x346fee[_0x9b20('0x20')](0x194);}return _0x544f1b;};}function handleError(_0x546a8e,_0x2f8b8d){_0x2f8b8d=_0x2f8b8d||0x1f4;return function(_0x25f32a){logger['error'](_0x25f32a[_0x9b20('0x2d')]);if(_0x25f32a[_0x9b20('0x2e')]){delete _0x25f32a[_0x9b20('0x2e')];}_0x546a8e['status'](_0x2f8b8d)['send'](_0x25f32a);};}exports[_0x9b20('0x2f')]=function(_0x4cc298,_0x2c9c09){var _0x5dfe8c={},_0x4adb38={},_0x374026={'count':0x0,'rows':[]};var _0x38dec5=_[_0x9b20('0x30')](db[_0x9b20('0x31')][_0x9b20('0x32')],function(_0x4a09a9){return{'name':_0x4a09a9[_0x9b20('0x33')],'type':_0x4a09a9['type'][_0x9b20('0x34')]};});_0x4adb38[_0x9b20('0x35')]=_['map'](_0x38dec5,_0x9b20('0x2e'));_0x4adb38['query']=_[_0x9b20('0x36')](_0x4cc298[_0x9b20('0x37')]);_0x4adb38[_0x9b20('0x38')]=_['intersection'](_0x4adb38[_0x9b20('0x35')],_0x4adb38[_0x9b20('0x37')]);_0x5dfe8c[_0x9b20('0x39')]=_[_0x9b20('0x3a')](_0x4adb38[_0x9b20('0x35')],qs[_0x9b20('0x3b')](_0x4cc298[_0x9b20('0x37')][_0x9b20('0x3b')]));_0x5dfe8c[_0x9b20('0x39')]=_0x5dfe8c[_0x9b20('0x39')][_0x9b20('0x3c')]?_0x5dfe8c[_0x9b20('0x39')]:_0x4adb38[_0x9b20('0x35')];if(!_0x4cc298[_0x9b20('0x37')][_0x9b20('0x3d')](_0x9b20('0x3e'))){_0x5dfe8c[_0x9b20('0x24')]=qs[_0x9b20('0x24')](_0x4cc298['query'][_0x9b20('0x24')]);_0x5dfe8c[_0x9b20('0x22')]=qs[_0x9b20('0x22')](_0x4cc298[_0x9b20('0x37')][_0x9b20('0x22')]);}_0x5dfe8c[_0x9b20('0x3f')]=qs[_0x9b20('0x40')](_0x4cc298[_0x9b20('0x37')]['sort']);_0x5dfe8c[_0x9b20('0x41')]=qs[_0x9b20('0x38')](_[_0x9b20('0x42')](_0x4cc298[_0x9b20('0x37')],_0x4adb38[_0x9b20('0x38')]),_0x38dec5);if(_0x4cc298[_0x9b20('0x37')][_0x9b20('0x43')]){_0x5dfe8c['where']=_['merge'](_0x5dfe8c['where'],{'$or':_[_0x9b20('0x30')](_0x38dec5,function(_0x2b7086){if(_0x2b7086[_0x9b20('0x44')]!==_0x9b20('0x45')){var _0x4c027e={};_0x4c027e[_0x2b7086[_0x9b20('0x2e')]]={'$like':'%'+_0x4cc298[_0x9b20('0x37')]['filter']+'%'};return _0x4c027e;}})});}_0x5dfe8c=_['merge']({},_0x5dfe8c,_0x4cc298['options']);var _0x3446e7={'where':_0x5dfe8c[_0x9b20('0x41')]};return db['VoiceQueueReport'][_0x9b20('0x46')](_0x3446e7)[_0x9b20('0x2b')](function(_0x50f1c1){_0x374026[_0x9b20('0x46')]=_0x50f1c1;if(_0x4cc298[_0x9b20('0x37')][_0x9b20('0x47')]){_0x5dfe8c[_0x9b20('0x48')]=[{'all':!![]}];}return db[_0x9b20('0x31')][_0x9b20('0x49')](_0x5dfe8c);})[_0x9b20('0x2b')](function(_0x3d46e4){_0x374026['rows']=_0x3d46e4;return _0x374026;})[_0x9b20('0x2b')](respondWithFilteredResult(_0x2c9c09,_0x5dfe8c))[_0x9b20('0x4a')](handleError(_0x2c9c09,null));};exports[_0x9b20('0x4b')]=function(_0x90411f,_0x5c5388){var _0x2af5d8={'raw':![],'where':{'id':_0x90411f[_0x9b20('0x4c')]['id']}},_0x240e33={};_0x240e33[_0x9b20('0x35')]=_['keys'](db[_0x9b20('0x31')][_0x9b20('0x32')]);_0x240e33[_0x9b20('0x37')]=_[_0x9b20('0x36')](_0x90411f[_0x9b20('0x37')]);_0x240e33[_0x9b20('0x38')]=_[_0x9b20('0x3a')](_0x240e33[_0x9b20('0x35')],_0x240e33[_0x9b20('0x37')]);_0x2af5d8['attributes']=_[_0x9b20('0x3a')](_0x240e33[_0x9b20('0x35')],qs[_0x9b20('0x3b')](_0x90411f[_0x9b20('0x37')]['fields']));_0x2af5d8[_0x9b20('0x39')]=_0x2af5d8[_0x9b20('0x39')][_0x9b20('0x3c')]?_0x2af5d8[_0x9b20('0x39')]:_0x240e33['model'];if(_0x90411f[_0x9b20('0x37')]['includeAll']){_0x2af5d8[_0x9b20('0x48')]=[{'all':!![]}];}_0x2af5d8=_[_0x9b20('0x4d')]({},_0x2af5d8,_0x90411f[_0x9b20('0x4e')]);return db[_0x9b20('0x31')]['find'](_0x2af5d8)[_0x9b20('0x2b')](handleEntityNotFound(_0x5c5388,null))[_0x9b20('0x2b')](respondWithResult(_0x5c5388,null))['catch'](handleError(_0x5c5388,null));};exports[_0x9b20('0x4f')]=function(_0xa8600a,_0x1c42dd){return db['VoiceQueueReport'][_0x9b20('0x4f')](_0xa8600a[_0x9b20('0x50')],{})[_0x9b20('0x2b')](respondWithResult(_0x1c42dd,0xc9))[_0x9b20('0x4a')](handleError(_0x1c42dd,null));};exports[_0x9b20('0x29')]=function(_0x5bdbbf,_0x563e22){if(_0x5bdbbf[_0x9b20('0x50')]['id']){delete _0x5bdbbf[_0x9b20('0x50')]['id'];}return db[_0x9b20('0x31')][_0x9b20('0x51')]({'where':{'id':_0x5bdbbf[_0x9b20('0x4c')]['id']}})[_0x9b20('0x2b')](handleEntityNotFound(_0x563e22,null))[_0x9b20('0x2b')](saveUpdates(_0x5bdbbf[_0x9b20('0x50')],null))['then'](respondWithResult(_0x563e22,null))[_0x9b20('0x4a')](handleError(_0x563e22,null));};exports[_0x9b20('0x2a')]=function(_0x51deb2,_0x58e645){return db[_0x9b20('0x31')][_0x9b20('0x51')]({'where':{'id':_0x51deb2['params']['id']}})[_0x9b20('0x2b')](handleEntityNotFound(_0x58e645,null))[_0x9b20('0x2b')](removeEntity(_0x58e645,null))[_0x9b20('0x4a')](handleError(_0x58e645,null));};exports[_0x9b20('0x52')]=function(_0x347bb7,_0x5af4c8){return db['VoiceQueueReport'][_0x9b20('0x52')]()[_0x9b20('0x2b')](respondWithResult(_0x5af4c8,null))['catch'](handleError(_0x5af4c8,null));};exports[_0x9b20('0x53')]=function(_0xa53224,_0x122e06){var _0x23c83c={},_0x1de0ac={},_0x3cf2b2={'count':0x0,'rows':[]};_0x1de0ac['model']=_[_0x9b20('0x36')](db[_0x9b20('0x31')][_0x9b20('0x32')]);_0x1de0ac[_0x9b20('0x37')]=_[_0x9b20('0x36')](_0xa53224['query']);_0x1de0ac[_0x9b20('0x38')]=_[_0x9b20('0x3a')](_0x1de0ac[_0x9b20('0x35')],_0x1de0ac['query']);_0x23c83c[_0x9b20('0x39')]=_['intersection'](_0x1de0ac[_0x9b20('0x35')],qs[_0x9b20('0x3b')](_0xa53224['query'][_0x9b20('0x3b')]));_0x23c83c[_0x9b20('0x39')]=_0x23c83c[_0x9b20('0x39')][_0x9b20('0x3c')]?_0x23c83c[_0x9b20('0x39')]:_0x1de0ac['model'];if(!_0xa53224[_0x9b20('0x37')][_0x9b20('0x3d')](_0x9b20('0x3e'))){_0x23c83c[_0x9b20('0x24')]=qs[_0x9b20('0x24')](_0xa53224[_0x9b20('0x37')][_0x9b20('0x24')]);_0x23c83c[_0x9b20('0x22')]=qs[_0x9b20('0x22')](_0xa53224[_0x9b20('0x37')][_0x9b20('0x22')]);}_0x23c83c[_0x9b20('0x3f')]=qs['sort'](_0xa53224[_0x9b20('0x37')][_0x9b20('0x40')]);_0x23c83c['where']=qs[_0x9b20('0x38')](_[_0x9b20('0x42')](_0xa53224[_0x9b20('0x37')],_0x1de0ac['filters']));if(_0xa53224[_0x9b20('0x37')][_0x9b20('0x43')]){_0x23c83c['where']=_[_0x9b20('0x4d')](_0x23c83c[_0x9b20('0x41')],{'$or':_[_0x9b20('0x30')](_0x23c83c[_0x9b20('0x39')],function(_0x7144c4){var _0x4a2b02={};_0x4a2b02[_0x7144c4]={'$like':'%'+_0xa53224[_0x9b20('0x37')]['filter']+'%'};return _0x4a2b02;})});}_0x23c83c=_[_0x9b20('0x4d')]({},_0x23c83c,_0xa53224[_0x9b20('0x4e')]);var _0xb64180={'where':_0x23c83c['where']};return db[_0x9b20('0x31')][_0x9b20('0x46')](_0xb64180)[_0x9b20('0x2b')](function(_0x31e464){_0x3cf2b2[_0x9b20('0x46')]=_0x31e464;if(_0xa53224[_0x9b20('0x37')][_0x9b20('0x47')]){_0x23c83c[_0x9b20('0x48')]=[{'all':!![]}];}return db[_0x9b20('0x31')][_0x9b20('0x49')](_0x23c83c);})[_0x9b20('0x2b')](function(_0x47ca7b){_0x3cf2b2[_0x9b20('0x54')]=_0x47ca7b;return _0x3cf2b2;})[_0x9b20('0x2b')](respondWithFilteredResult(_0x122e06,_0x23c83c,_0x9b20('0x53')))[_0x9b20('0x4a')](handleError(_0x122e06,null,_0x9b20('0x53')));};
\ No newline at end of file