Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index da1655b..3ac19aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba4f=['create','body','update','catch','describe','getVoiceQueuesReport','hasOwnProperty','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','json','apply','save','then','destroy','end','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','find'];(function(_0x525290,_0x493c29){var _0x1231ca=function(_0x2aaded){while(--_0x2aaded){_0x525290['push'](_0x525290['shift']());}};_0x1231ca(++_0x493c29);}(_0xba4f,0xf2));var _0xfba4=function(_0x418893,_0x557eb2){_0x418893=_0x418893-0x0;var _0x3b8cf0=_0xba4f[_0x418893];return _0x3b8cf0;};'use strict';var emlformat=require(_0xfba4('0x0'));var rimraf=require(_0xfba4('0x1'));var zipdir=require(_0xfba4('0x2'));var jsonpatch=require(_0xfba4('0x3'));var rp=require(_0xfba4('0x4'));var moment=require(_0xfba4('0x5'));var BPromise=require(_0xfba4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfba4('0x7'));var sox=require(_0xfba4('0x8'));var csv=require(_0xfba4('0x9'));var ejs=require(_0xfba4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfba4('0xb'));var crypto=require(_0xfba4('0xc'));var jsforce=require(_0xfba4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfba4('0x9'));var querystring=require('querystring');var Papa=require(_0xfba4('0xe'));var Redis=require('ioredis');var authService=require(_0xfba4('0xf'));var qs=require(_0xfba4('0x10'));var as=require(_0xfba4('0x11'));var hardwareService=require(_0xfba4('0x12'));var logger=require(_0xfba4('0x13'))(_0xfba4('0x14'));var utils=require(_0xfba4('0x15'));var config=require(_0xfba4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfba4('0x17'))['db'];config[_0xfba4('0x18')]=_[_0xfba4('0x19')](config['redis'],{'host':_0xfba4('0x1a'),'port':0x18eb});var socket=require(_0xfba4('0x1b'))(new Redis(config[_0xfba4('0x18')]));require('./voiceQueueReport.socket')[_0xfba4('0x1c')](socket);function respondWithStatusCode(_0x2f77aa,_0x3b597a){_0x3b597a=_0x3b597a||0xcc;return function(_0x27d4b5){if(_0x27d4b5){return _0x2f77aa[_0xfba4('0x1d')](_0x3b597a);}return _0x2f77aa[_0xfba4('0x1e')](_0x3b597a)['end']();};}function respondWithResult(_0x5eb9ec,_0x2cc6d5){_0x2cc6d5=_0x2cc6d5||0xc8;return function(_0x4d1755){if(_0x4d1755){return _0x5eb9ec['status'](_0x2cc6d5)['json'](_0x4d1755);}};}function respondWithFilteredResult(_0x2d737a,_0x4fab32){return function(_0x10f2f3){if(_0x10f2f3){var _0x448091=typeof _0x4fab32[_0xfba4('0x1f')]===_0xfba4('0x20')&&typeof _0x4fab32[_0xfba4('0x21')]===_0xfba4('0x20');var _0x3b27d9=_0x10f2f3[_0xfba4('0x22')];var _0x104174=_0x448091?0x0:_0x4fab32[_0xfba4('0x1f')];var _0x6f9527=_0x448091?_0x10f2f3[_0xfba4('0x22')]:_0x4fab32[_0xfba4('0x1f')]+_0x4fab32['limit'];var _0x58d249;if(_0x6f9527>=_0x3b27d9){_0x6f9527=_0x3b27d9;_0x58d249=0xc8;}else{_0x58d249=0xce;}_0x2d737a[_0xfba4('0x1e')](_0x58d249);return _0x2d737a['set']('Content-Range',_0x104174+'-'+_0x6f9527+'/'+_0x3b27d9)[_0xfba4('0x23')](_0x10f2f3);}return null;};}function patchUpdates(_0x393ca3){return function(_0x442735){try{jsonpatch[_0xfba4('0x24')](_0x442735,_0x393ca3,!![]);}catch(_0x25bb9c){return BPromise['reject'](_0x25bb9c);}return _0x442735[_0xfba4('0x25')]();};}function saveUpdates(_0x2ac06e,_0x3968a3){return function(_0x189ca0){if(_0x189ca0){return _0x189ca0['update'](_0x2ac06e)[_0xfba4('0x26')](function(_0x4434fd){return _0x4434fd;});}return null;};}function removeEntity(_0x211e0a,_0x4e116d){return function(_0x3c43be){if(_0x3c43be){return _0x3c43be[_0xfba4('0x27')]()[_0xfba4('0x26')](function(){_0x211e0a[_0xfba4('0x1e')](0xcc)[_0xfba4('0x28')]();});}};}function handleEntityNotFound(_0x4232e2,_0xa73753){return function(_0x2988ef){if(!_0x2988ef){_0x4232e2[_0xfba4('0x1d')](0x194);}return _0x2988ef;};}function handleError(_0x49d158,_0x33e05a){_0x33e05a=_0x33e05a||0x1f4;return function(_0x182f28){logger['error'](_0x182f28[_0xfba4('0x29')]);if(_0x182f28[_0xfba4('0x2a')]){delete _0x182f28[_0xfba4('0x2a')];}_0x49d158['status'](_0x33e05a)['send'](_0x182f28);};}exports['index']=function(_0x21e93b,_0x1ac530){var _0x189298={},_0x7de437={},_0x3e6ea6={'count':0x0,'rows':[]};var _0x384204=_[_0xfba4('0x2b')](db[_0xfba4('0x2c')][_0xfba4('0x2d')],function(_0x4a7bcd){return{'name':_0x4a7bcd[_0xfba4('0x2e')],'type':_0x4a7bcd[_0xfba4('0x2f')][_0xfba4('0x30')]};});_0x7de437[_0xfba4('0x31')]=_[_0xfba4('0x2b')](_0x384204,'name');_0x7de437['query']=_[_0xfba4('0x32')](_0x21e93b['query']);_0x7de437[_0xfba4('0x33')]=_[_0xfba4('0x34')](_0x7de437['model'],_0x7de437[_0xfba4('0x35')]);_0x189298['attributes']=_['intersection'](_0x7de437[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x21e93b[_0xfba4('0x35')]['fields']));_0x189298['attributes']=_0x189298['attributes'][_0xfba4('0x37')]?_0x189298[_0xfba4('0x38')]:_0x7de437['model'];if(!_0x21e93b[_0xfba4('0x35')]['hasOwnProperty'](_0xfba4('0x39'))){_0x189298[_0xfba4('0x21')]=qs[_0xfba4('0x21')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x21')]);_0x189298[_0xfba4('0x1f')]=qs[_0xfba4('0x1f')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x1f')]);}_0x189298[_0xfba4('0x3a')]=qs[_0xfba4('0x3b')](_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3b')]);_0x189298[_0xfba4('0x3c')]=qs[_0xfba4('0x33')](_[_0xfba4('0x3d')](_0x21e93b[_0xfba4('0x35')],_0x7de437[_0xfba4('0x33')]),_0x384204);if(_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3e')]){_0x189298[_0xfba4('0x3c')]=_[_0xfba4('0x3f')](_0x189298[_0xfba4('0x3c')],{'$or':_[_0xfba4('0x2b')](_0x384204,function(_0x2d1972){if(_0x2d1972[_0xfba4('0x2f')]!=='VIRTUAL'){var _0x571e21={};_0x571e21[_0x2d1972[_0xfba4('0x2a')]]={'$like':'%'+_0x21e93b[_0xfba4('0x35')][_0xfba4('0x3e')]+'%'};return _0x571e21;}})});}_0x189298=_[_0xfba4('0x3f')]({},_0x189298,_0x21e93b[_0xfba4('0x40')]);var _0x3aefab={'where':_0x189298[_0xfba4('0x3c')]};return db[_0xfba4('0x2c')][_0xfba4('0x22')](_0x3aefab)[_0xfba4('0x26')](function(_0x17fd35){_0x3e6ea6[_0xfba4('0x22')]=_0x17fd35;if(_0x21e93b[_0xfba4('0x35')][_0xfba4('0x41')]){_0x189298['include']=[{'all':!![]}];}return db[_0xfba4('0x2c')][_0xfba4('0x42')](_0x189298);})['then'](function(_0x1892e9){_0x3e6ea6['rows']=_0x1892e9;return _0x3e6ea6;})[_0xfba4('0x26')](respondWithFilteredResult(_0x1ac530,_0x189298))['catch'](handleError(_0x1ac530,null));};exports[_0xfba4('0x43')]=function(_0x224df5,_0x39e295){var _0x53ccb3={'raw':![],'where':{'id':_0x224df5[_0xfba4('0x44')]['id']}},_0x2fb29e={};_0x2fb29e[_0xfba4('0x31')]=_[_0xfba4('0x32')](db[_0xfba4('0x2c')][_0xfba4('0x2d')]);_0x2fb29e[_0xfba4('0x35')]=_['keys'](_0x224df5[_0xfba4('0x35')]);_0x2fb29e['filters']=_[_0xfba4('0x34')](_0x2fb29e['model'],_0x2fb29e[_0xfba4('0x35')]);_0x53ccb3[_0xfba4('0x38')]=_[_0xfba4('0x34')](_0x2fb29e[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x224df5[_0xfba4('0x35')][_0xfba4('0x36')]));_0x53ccb3[_0xfba4('0x38')]=_0x53ccb3[_0xfba4('0x38')]['length']?_0x53ccb3['attributes']:_0x2fb29e[_0xfba4('0x31')];if(_0x224df5[_0xfba4('0x35')][_0xfba4('0x41')]){_0x53ccb3['include']=[{'all':!![]}];}_0x53ccb3=_[_0xfba4('0x3f')]({},_0x53ccb3,_0x224df5['options']);return db[_0xfba4('0x2c')][_0xfba4('0x45')](_0x53ccb3)['then'](handleEntityNotFound(_0x39e295,null))['then'](respondWithResult(_0x39e295,null))['catch'](handleError(_0x39e295,null));};exports[_0xfba4('0x46')]=function(_0x548f54,_0x50b2c2){return db[_0xfba4('0x2c')][_0xfba4('0x46')](_0x548f54[_0xfba4('0x47')],{})[_0xfba4('0x26')](respondWithResult(_0x50b2c2,0xc9))['catch'](handleError(_0x50b2c2,null));};exports[_0xfba4('0x48')]=function(_0x5ab533,_0x311cf2){if(_0x5ab533[_0xfba4('0x47')]['id']){delete _0x5ab533[_0xfba4('0x47')]['id'];}return db[_0xfba4('0x2c')][_0xfba4('0x45')]({'where':{'id':_0x5ab533[_0xfba4('0x44')]['id']}})[_0xfba4('0x26')](handleEntityNotFound(_0x311cf2,null))[_0xfba4('0x26')](saveUpdates(_0x5ab533['body'],null))['then'](respondWithResult(_0x311cf2,null))[_0xfba4('0x49')](handleError(_0x311cf2,null));};exports['destroy']=function(_0x5aa40e,_0x45a255){return db[_0xfba4('0x2c')]['find']({'where':{'id':_0x5aa40e[_0xfba4('0x44')]['id']}})['then'](handleEntityNotFound(_0x45a255,null))[_0xfba4('0x26')](removeEntity(_0x45a255,null))['catch'](handleError(_0x45a255,null));};exports[_0xfba4('0x4a')]=function(_0x215ad5,_0x31fde6){return db[_0xfba4('0x2c')]['describe']()['then'](respondWithResult(_0x31fde6,null))['catch'](handleError(_0x31fde6,null));};exports[_0xfba4('0x4b')]=function(_0x7d55d4,_0x449791){var _0x2f179b={},_0x20a889={},_0x4ddfdc={'count':0x0,'rows':[]};_0x20a889[_0xfba4('0x31')]=_[_0xfba4('0x32')](db[_0xfba4('0x2c')]['rawAttributes']);_0x20a889[_0xfba4('0x35')]=_[_0xfba4('0x32')](_0x7d55d4[_0xfba4('0x35')]);_0x20a889['filters']=_[_0xfba4('0x34')](_0x20a889['model'],_0x20a889['query']);_0x2f179b[_0xfba4('0x38')]=_[_0xfba4('0x34')](_0x20a889[_0xfba4('0x31')],qs[_0xfba4('0x36')](_0x7d55d4['query']['fields']));_0x2f179b[_0xfba4('0x38')]=_0x2f179b[_0xfba4('0x38')][_0xfba4('0x37')]?_0x2f179b[_0xfba4('0x38')]:_0x20a889[_0xfba4('0x31')];if(!_0x7d55d4['query'][_0xfba4('0x4c')](_0xfba4('0x39'))){_0x2f179b['limit']=qs[_0xfba4('0x21')](_0x7d55d4['query'][_0xfba4('0x21')]);_0x2f179b[_0xfba4('0x1f')]=qs[_0xfba4('0x1f')](_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x1f')]);}_0x2f179b[_0xfba4('0x3a')]=qs[_0xfba4('0x3b')](_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x3b')]);_0x2f179b['where']=qs[_0xfba4('0x33')](_[_0xfba4('0x3d')](_0x7d55d4[_0xfba4('0x35')],_0x20a889[_0xfba4('0x33')]));if(_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x3e')]){_0x2f179b[_0xfba4('0x3c')]=_[_0xfba4('0x3f')](_0x2f179b[_0xfba4('0x3c')],{'$or':_[_0xfba4('0x2b')](_0x2f179b[_0xfba4('0x38')],function(_0x119dcf){var _0xbd26f2={};_0xbd26f2[_0x119dcf]={'$like':'%'+_0x7d55d4['query'][_0xfba4('0x3e')]+'%'};return _0xbd26f2;})});}_0x2f179b=_[_0xfba4('0x3f')]({},_0x2f179b,_0x7d55d4['options']);var _0x4656a9={'where':_0x2f179b[_0xfba4('0x3c')]};return db[_0xfba4('0x2c')][_0xfba4('0x22')](_0x4656a9)[_0xfba4('0x26')](function(_0x1e25cd){_0x4ddfdc[_0xfba4('0x22')]=_0x1e25cd;if(_0x7d55d4[_0xfba4('0x35')][_0xfba4('0x41')]){_0x2f179b['include']=[{'all':!![]}];}return db[_0xfba4('0x2c')]['findAll'](_0x2f179b);})['then'](function(_0x55aac8){_0x4ddfdc[_0xfba4('0x4d')]=_0x55aac8;return _0x4ddfdc;})[_0xfba4('0x26')](respondWithFilteredResult(_0x449791,_0x2f179b,_0xfba4('0x4b')))['catch'](handleError(_0x449791,null,_0xfba4('0x4b')));};
\ No newline at end of file
+var _0x8191=['register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','sort','pick','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x24ed5b,_0x49db60){var _0x23479a=function(_0x1bddf3){while(--_0x1bddf3){_0x24ed5b['push'](_0x24ed5b['shift']());}};_0x23479a(++_0x49db60);}(_0x8191,0xe3));var _0x1819=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x8191[_0x5c2c7c];return _0xea7ffe;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require(_0x1819('0x2'));var jsonpatch=require(_0x1819('0x3'));var rp=require('request-promise');var moment=require(_0x1819('0x4'));var BPromise=require(_0x1819('0x5'));var Mustache=require('mustache');var util=require(_0x1819('0x6'));var path=require(_0x1819('0x7'));var sox=require('sox');var csv=require(_0x1819('0x8'));var ejs=require(_0x1819('0x9'));var fs=require('fs');var fs_extra=require(_0x1819('0xa'));var _=require(_0x1819('0xb'));var squel=require(_0x1819('0xc'));var crypto=require('crypto');var jsforce=require(_0x1819('0xd'));var deskjs=require(_0x1819('0xe'));var toCsv=require(_0x1819('0x8'));var querystring=require(_0x1819('0xf'));var Papa=require(_0x1819('0x10'));var Redis=require('ioredis');var authService=require(_0x1819('0x11'));var qs=require(_0x1819('0x12'));var as=require(_0x1819('0x13'));var hardwareService=require(_0x1819('0x14'));var logger=require(_0x1819('0x15'))('api');var utils=require(_0x1819('0x16'));var config=require(_0x1819('0x17'));var licenseUtil=require(_0x1819('0x18'));var db=require(_0x1819('0x19'))['db'];config[_0x1819('0x1a')]=_[_0x1819('0x1b')](config['redis'],{'host':_0x1819('0x1c'),'port':0x18eb});var socket=require(_0x1819('0x1d'))(new Redis(config['redis']));require(_0x1819('0x1e'))[_0x1819('0x1f')](socket);function respondWithStatusCode(_0x44e186,_0x3972da){_0x3972da=_0x3972da||0xcc;return function(_0x5e396b){if(_0x5e396b){return _0x44e186[_0x1819('0x20')](_0x3972da);}return _0x44e186[_0x1819('0x21')](_0x3972da)[_0x1819('0x22')]();};}function respondWithResult(_0x59c689,_0x3b3b53){_0x3b3b53=_0x3b3b53||0xc8;return function(_0x5460ba){if(_0x5460ba){return _0x59c689[_0x1819('0x21')](_0x3b3b53)['json'](_0x5460ba);}};}function respondWithFilteredResult(_0x3874c2,_0x2f1dfc){return function(_0x19b99f){if(_0x19b99f){var _0x17e102=typeof _0x2f1dfc['offset']===_0x1819('0x23')&&typeof _0x2f1dfc[_0x1819('0x24')]===_0x1819('0x23');var _0x20a415=_0x19b99f[_0x1819('0x25')];var _0x4f1388=_0x17e102?0x0:_0x2f1dfc['offset'];var _0x3e2c57=_0x17e102?_0x19b99f[_0x1819('0x25')]:_0x2f1dfc[_0x1819('0x26')]+_0x2f1dfc[_0x1819('0x24')];var _0x5d80ab;if(_0x3e2c57>=_0x20a415){_0x3e2c57=_0x20a415;_0x5d80ab=0xc8;}else{_0x5d80ab=0xce;}_0x3874c2['status'](_0x5d80ab);return _0x3874c2[_0x1819('0x27')](_0x1819('0x28'),_0x4f1388+'-'+_0x3e2c57+'/'+_0x20a415)['json'](_0x19b99f);}return null;};}function patchUpdates(_0x52aea9){return function(_0x337449){try{jsonpatch['apply'](_0x337449,_0x52aea9,!![]);}catch(_0x369032){return BPromise[_0x1819('0x29')](_0x369032);}return _0x337449['save']();};}function saveUpdates(_0xbf4540,_0x13d08d){return function(_0x23c669){if(_0x23c669){return _0x23c669[_0x1819('0x2a')](_0xbf4540)[_0x1819('0x2b')](function(_0x579d8d){return _0x579d8d;});}return null;};}function removeEntity(_0x3fd256,_0x4e78ed){return function(_0x59e0d7){if(_0x59e0d7){return _0x59e0d7[_0x1819('0x2c')]()['then'](function(){_0x3fd256[_0x1819('0x21')](0xcc)[_0x1819('0x22')]();});}};}function handleEntityNotFound(_0x2ca200,_0x5b0b95){return function(_0x50dd71){if(!_0x50dd71){_0x2ca200[_0x1819('0x20')](0x194);}return _0x50dd71;};}function handleError(_0x3e0956,_0x4cf4da){_0x4cf4da=_0x4cf4da||0x1f4;return function(_0x4fd2cb){logger[_0x1819('0x2d')](_0x4fd2cb[_0x1819('0x2e')]);if(_0x4fd2cb[_0x1819('0x2f')]){delete _0x4fd2cb[_0x1819('0x2f')];}_0x3e0956[_0x1819('0x21')](_0x4cf4da)[_0x1819('0x30')](_0x4fd2cb);};}exports[_0x1819('0x31')]=function(_0x55c187,_0x619897){var _0x4fc900={},_0x2fe3ca={},_0x391255={'count':0x0,'rows':[]};var _0x3866c1=_[_0x1819('0x32')](db[_0x1819('0x33')]['rawAttributes'],function(_0x4fcd1b){return{'name':_0x4fcd1b[_0x1819('0x34')],'type':_0x4fcd1b['type'][_0x1819('0x35')]};});_0x2fe3ca[_0x1819('0x36')]=_[_0x1819('0x32')](_0x3866c1,_0x1819('0x2f'));_0x2fe3ca[_0x1819('0x37')]=_[_0x1819('0x38')](_0x55c187['query']);_0x2fe3ca[_0x1819('0x39')]=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],_0x2fe3ca[_0x1819('0x37')]);_0x4fc900['attributes']=_[_0x1819('0x3a')](_0x2fe3ca[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x55c187[_0x1819('0x37')]['fields']));_0x4fc900[_0x1819('0x3c')]=_0x4fc900[_0x1819('0x3c')][_0x1819('0x3d')]?_0x4fc900[_0x1819('0x3c')]:_0x2fe3ca[_0x1819('0x36')];if(!_0x55c187[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x4fc900['limit']=qs[_0x1819('0x24')](_0x55c187['query'][_0x1819('0x24')]);_0x4fc900[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x55c187['query'][_0x1819('0x26')]);}_0x4fc900[_0x1819('0x40')]=qs['sort'](_0x55c187[_0x1819('0x37')]['sort']);_0x4fc900[_0x1819('0x41')]=qs['filters'](_['pick'](_0x55c187[_0x1819('0x37')],_0x2fe3ca[_0x1819('0x39')]),_0x3866c1);if(_0x55c187[_0x1819('0x37')][_0x1819('0x42')]){_0x4fc900['where']=_[_0x1819('0x43')](_0x4fc900[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x3866c1,function(_0x2c6766){if(_0x2c6766[_0x1819('0x44')]!==_0x1819('0x45')){var _0x5e317a={};_0x5e317a[_0x2c6766[_0x1819('0x2f')]]={'$like':'%'+_0x55c187[_0x1819('0x37')]['filter']+'%'};return _0x5e317a;}})});}_0x4fc900=_['merge']({},_0x4fc900,_0x55c187[_0x1819('0x46')]);var _0x49e283={'where':_0x4fc900['where']};return db['VoiceQueueReport']['count'](_0x49e283)[_0x1819('0x2b')](function(_0x4ddcf1){_0x391255['count']=_0x4ddcf1;if(_0x55c187[_0x1819('0x37')][_0x1819('0x47')]){_0x4fc900[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')]['findAll'](_0x4fc900);})[_0x1819('0x2b')](function(_0x3f0134){_0x391255[_0x1819('0x49')]=_0x3f0134;return _0x391255;})[_0x1819('0x2b')](respondWithFilteredResult(_0x619897,_0x4fc900))[_0x1819('0x4a')](handleError(_0x619897,null));};exports[_0x1819('0x4b')]=function(_0x317778,_0xd1575f){var _0x5cb8e3={'raw':![],'where':{'id':_0x317778[_0x1819('0x4c')]['id']}},_0x384190={};_0x384190[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')][_0x1819('0x4d')]);_0x384190['query']=_[_0x1819('0x38')](_0x317778[_0x1819('0x37')]);_0x384190['filters']=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],_0x384190[_0x1819('0x37')]);_0x5cb8e3[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x384190[_0x1819('0x36')],qs['fields'](_0x317778[_0x1819('0x37')][_0x1819('0x3b')]));_0x5cb8e3[_0x1819('0x3c')]=_0x5cb8e3[_0x1819('0x3c')][_0x1819('0x3d')]?_0x5cb8e3[_0x1819('0x3c')]:_0x384190[_0x1819('0x36')];if(_0x317778[_0x1819('0x37')][_0x1819('0x47')]){_0x5cb8e3['include']=[{'all':!![]}];}_0x5cb8e3=_[_0x1819('0x43')]({},_0x5cb8e3,_0x317778['options']);return db['VoiceQueueReport'][_0x1819('0x4e')](_0x5cb8e3)[_0x1819('0x2b')](handleEntityNotFound(_0xd1575f,null))[_0x1819('0x2b')](respondWithResult(_0xd1575f,null))[_0x1819('0x4a')](handleError(_0xd1575f,null));};exports[_0x1819('0x4f')]=function(_0x350e34,_0x5e6b78){return db[_0x1819('0x33')]['create'](_0x350e34[_0x1819('0x50')],{})['then'](respondWithResult(_0x5e6b78,0xc9))[_0x1819('0x4a')](handleError(_0x5e6b78,null));};exports['update']=function(_0x4ce206,_0xdb56ab){if(_0x4ce206[_0x1819('0x50')]['id']){delete _0x4ce206['body']['id'];}return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4ce206[_0x1819('0x4c')]['id']}})[_0x1819('0x2b')](handleEntityNotFound(_0xdb56ab,null))['then'](saveUpdates(_0x4ce206['body'],null))[_0x1819('0x2b')](respondWithResult(_0xdb56ab,null))[_0x1819('0x4a')](handleError(_0xdb56ab,null));};exports[_0x1819('0x2c')]=function(_0x4a205d,_0x5dc4df){return db[_0x1819('0x33')][_0x1819('0x4e')]({'where':{'id':_0x4a205d[_0x1819('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dc4df,null))['then'](removeEntity(_0x5dc4df,null))[_0x1819('0x4a')](handleError(_0x5dc4df,null));};exports[_0x1819('0x51')]=function(_0x487133,_0x4865ff){return db['VoiceQueueReport']['describe']()[_0x1819('0x2b')](respondWithResult(_0x4865ff,null))[_0x1819('0x4a')](handleError(_0x4865ff,null));};exports['getVoiceQueuesReport']=function(_0x28f941,_0x106275){var _0x168a8a={},_0x4d6025={},_0x4ef6a9={'count':0x0,'rows':[]};_0x4d6025[_0x1819('0x36')]=_[_0x1819('0x38')](db[_0x1819('0x33')]['rawAttributes']);_0x4d6025[_0x1819('0x37')]=_[_0x1819('0x38')](_0x28f941['query']);_0x4d6025[_0x1819('0x39')]=_['intersection'](_0x4d6025['model'],_0x4d6025[_0x1819('0x37')]);_0x168a8a[_0x1819('0x3c')]=_[_0x1819('0x3a')](_0x4d6025[_0x1819('0x36')],qs[_0x1819('0x3b')](_0x28f941[_0x1819('0x37')][_0x1819('0x3b')]));_0x168a8a['attributes']=_0x168a8a[_0x1819('0x3c')][_0x1819('0x3d')]?_0x168a8a[_0x1819('0x3c')]:_0x4d6025['model'];if(!_0x28f941[_0x1819('0x37')][_0x1819('0x3e')](_0x1819('0x3f'))){_0x168a8a[_0x1819('0x24')]=qs[_0x1819('0x24')](_0x28f941[_0x1819('0x37')][_0x1819('0x24')]);_0x168a8a[_0x1819('0x26')]=qs[_0x1819('0x26')](_0x28f941['query'][_0x1819('0x26')]);}_0x168a8a[_0x1819('0x40')]=qs[_0x1819('0x52')](_0x28f941['query'][_0x1819('0x52')]);_0x168a8a[_0x1819('0x41')]=qs[_0x1819('0x39')](_[_0x1819('0x53')](_0x28f941[_0x1819('0x37')],_0x4d6025[_0x1819('0x39')]));if(_0x28f941[_0x1819('0x37')]['filter']){_0x168a8a[_0x1819('0x41')]=_[_0x1819('0x43')](_0x168a8a[_0x1819('0x41')],{'$or':_[_0x1819('0x32')](_0x168a8a[_0x1819('0x3c')],function(_0x149436){var _0x3c680d={};_0x3c680d[_0x149436]={'$like':'%'+_0x28f941[_0x1819('0x37')][_0x1819('0x42')]+'%'};return _0x3c680d;})});}_0x168a8a=_[_0x1819('0x43')]({},_0x168a8a,_0x28f941[_0x1819('0x46')]);var _0x1775eb={'where':_0x168a8a['where']};return db[_0x1819('0x33')]['count'](_0x1775eb)['then'](function(_0x452e6b){_0x4ef6a9['count']=_0x452e6b;if(_0x28f941[_0x1819('0x37')][_0x1819('0x47')]){_0x168a8a[_0x1819('0x48')]=[{'all':!![]}];}return db[_0x1819('0x33')][_0x1819('0x54')](_0x168a8a);})[_0x1819('0x2b')](function(_0xe1378c){_0x4ef6a9[_0x1819('0x49')]=_0xe1378c;return _0x4ef6a9;})[_0x1819('0x2b')](respondWithFilteredResult(_0x106275,_0x168a8a,_0x1819('0x55')))[_0x1819('0x4a')](handleError(_0x106275,null,_0x1819('0x55')));};
\ No newline at end of file