Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index 61cf775..43fa600 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 _0x04dc=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','catch','show','create','body','params','find','describe','getVoiceQueuesReport','rows','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x204c59,_0x5614ee){var _0x4cd35b=function(_0xf20241){while(--_0xf20241){_0x204c59['push'](_0x204c59['shift']());}};_0x4cd35b(++_0x5614ee);}(_0x04dc,0x1d6));var _0xc04d=function(_0x18cebd,_0x5f138f){_0x18cebd=_0x18cebd-0x0;var _0x4c702f=_0x04dc[_0x18cebd];return _0x4c702f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc04d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc04d('0x1'));var rp=require(_0xc04d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc04d('0x3'));var util=require('util');var path=require(_0xc04d('0x4'));var sox=require(_0xc04d('0x5'));var csv=require(_0xc04d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc04d('0x7'));var _=require('lodash');var squel=require(_0xc04d('0x8'));var crypto=require(_0xc04d('0x9'));var jsforce=require(_0xc04d('0xa'));var deskjs=require(_0xc04d('0xb'));var toCsv=require(_0xc04d('0x6'));var querystring=require(_0xc04d('0xc'));var Papa=require('papaparse');var Redis=require(_0xc04d('0xd'));var authService=require(_0xc04d('0xe'));var qs=require(_0xc04d('0xf'));var as=require(_0xc04d('0x10'));var hardwareService=require(_0xc04d('0x11'));var logger=require(_0xc04d('0x12'))(_0xc04d('0x13'));var utils=require(_0xc04d('0x14'));var config=require(_0xc04d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc04d('0x16'))['db'];config['redis']=_[_0xc04d('0x17')](config[_0xc04d('0x18')],{'host':_0xc04d('0x19'),'port':0x18eb});var socket=require(_0xc04d('0x1a'))(new Redis(config[_0xc04d('0x18')]));require('./voiceQueueReport.socket')[_0xc04d('0x1b')](socket);function respondWithStatusCode(_0x137c45,_0x44ff6a){_0x44ff6a=_0x44ff6a||0xcc;return function(_0x106485){if(_0x106485){return _0x137c45[_0xc04d('0x1c')](_0x44ff6a);}return _0x137c45['status'](_0x44ff6a)[_0xc04d('0x1d')]();};}function respondWithResult(_0xac521f,_0xb9a701){_0xb9a701=_0xb9a701||0xc8;return function(_0x443f3d){if(_0x443f3d){return _0xac521f[_0xc04d('0x1e')](_0xb9a701)[_0xc04d('0x1f')](_0x443f3d);}};}function respondWithFilteredResult(_0x25aaab,_0x256234){return function(_0x245a98){if(_0x245a98){var _0x16afb3=typeof _0x256234[_0xc04d('0x20')]===_0xc04d('0x21')&&typeof _0x256234[_0xc04d('0x22')]==='undefined';var _0x1cfe72=_0x245a98[_0xc04d('0x23')];var _0x3760ab=_0x16afb3?0x0:_0x256234[_0xc04d('0x20')];var _0x3d5e97=_0x16afb3?_0x245a98['count']:_0x256234[_0xc04d('0x20')]+_0x256234['limit'];var _0x49673e;if(_0x3d5e97>=_0x1cfe72){_0x3d5e97=_0x1cfe72;_0x49673e=0xc8;}else{_0x49673e=0xce;}_0x25aaab[_0xc04d('0x1e')](_0x49673e);return _0x25aaab['set'](_0xc04d('0x24'),_0x3760ab+'-'+_0x3d5e97+'/'+_0x1cfe72)[_0xc04d('0x1f')](_0x245a98);}return null;};}function patchUpdates(_0x3c7ec9){return function(_0x5e8dcd){try{jsonpatch['apply'](_0x5e8dcd,_0x3c7ec9,!![]);}catch(_0x56ae3c){return BPromise['reject'](_0x56ae3c);}return _0x5e8dcd[_0xc04d('0x25')]();};}function saveUpdates(_0x28b86c,_0x55823c){return function(_0x725d36){if(_0x725d36){return _0x725d36[_0xc04d('0x26')](_0x28b86c)[_0xc04d('0x27')](function(_0x2b88c0){return _0x2b88c0;});}return null;};}function removeEntity(_0x3267bb,_0x5bb695){return function(_0x48e2c0){if(_0x48e2c0){return _0x48e2c0[_0xc04d('0x28')]()[_0xc04d('0x27')](function(){_0x3267bb['status'](0xcc)[_0xc04d('0x1d')]();});}};}function handleEntityNotFound(_0x1b01e5,_0x5dffe4){return function(_0x585adf){if(!_0x585adf){_0x1b01e5[_0xc04d('0x1c')](0x194);}return _0x585adf;};}function handleError(_0x5931c9,_0x4e640b){_0x4e640b=_0x4e640b||0x1f4;return function(_0x40c708){logger[_0xc04d('0x29')](_0x40c708[_0xc04d('0x2a')]);if(_0x40c708[_0xc04d('0x2b')]){delete _0x40c708[_0xc04d('0x2b')];}_0x5931c9[_0xc04d('0x1e')](_0x4e640b)[_0xc04d('0x2c')](_0x40c708);};}exports[_0xc04d('0x2d')]=function(_0x514467,_0x3d6e93){var _0x4806db={},_0xcdb6ad={},_0x3ab61e={'count':0x0,'rows':[]};var _0x325cfd=_[_0xc04d('0x2e')](db['VoiceQueueReport'][_0xc04d('0x2f')],function(_0x7c0867){return{'name':_0x7c0867[_0xc04d('0x30')],'type':_0x7c0867[_0xc04d('0x31')][_0xc04d('0x32')]};});_0xcdb6ad[_0xc04d('0x33')]=_[_0xc04d('0x2e')](_0x325cfd,_0xc04d('0x2b'));_0xcdb6ad[_0xc04d('0x34')]=_[_0xc04d('0x35')](_0x514467[_0xc04d('0x34')]);_0xcdb6ad[_0xc04d('0x36')]=_[_0xc04d('0x37')](_0xcdb6ad['model'],_0xcdb6ad['query']);_0x4806db[_0xc04d('0x38')]=_['intersection'](_0xcdb6ad[_0xc04d('0x33')],qs['fields'](_0x514467['query'][_0xc04d('0x39')]));_0x4806db[_0xc04d('0x38')]=_0x4806db[_0xc04d('0x38')][_0xc04d('0x3a')]?_0x4806db[_0xc04d('0x38')]:_0xcdb6ad['model'];if(!_0x514467[_0xc04d('0x34')][_0xc04d('0x3b')](_0xc04d('0x3c'))){_0x4806db[_0xc04d('0x22')]=qs[_0xc04d('0x22')](_0x514467[_0xc04d('0x34')][_0xc04d('0x22')]);_0x4806db['offset']=qs['offset'](_0x514467[_0xc04d('0x34')][_0xc04d('0x20')]);}_0x4806db[_0xc04d('0x3d')]=qs[_0xc04d('0x3e')](_0x514467[_0xc04d('0x34')]['sort']);_0x4806db[_0xc04d('0x3f')]=qs[_0xc04d('0x36')](_[_0xc04d('0x40')](_0x514467[_0xc04d('0x34')],_0xcdb6ad[_0xc04d('0x36')]),_0x325cfd);if(_0x514467[_0xc04d('0x34')][_0xc04d('0x41')]){_0x4806db[_0xc04d('0x3f')]=_[_0xc04d('0x42')](_0x4806db[_0xc04d('0x3f')],{'$or':_[_0xc04d('0x2e')](_0x325cfd,function(_0x28619b){if(_0x28619b[_0xc04d('0x31')]!==_0xc04d('0x43')){var _0x25db0d={};_0x25db0d[_0x28619b[_0xc04d('0x2b')]]={'$like':'%'+_0x514467['query'][_0xc04d('0x41')]+'%'};return _0x25db0d;}})});}_0x4806db=_[_0xc04d('0x42')]({},_0x4806db,_0x514467[_0xc04d('0x44')]);var _0x53c53c={'where':_0x4806db[_0xc04d('0x3f')]};return db[_0xc04d('0x45')][_0xc04d('0x23')](_0x53c53c)[_0xc04d('0x27')](function(_0x53ef29){_0x3ab61e[_0xc04d('0x23')]=_0x53ef29;if(_0x514467[_0xc04d('0x34')][_0xc04d('0x46')]){_0x4806db[_0xc04d('0x47')]=[{'all':!![]}];}return db[_0xc04d('0x45')][_0xc04d('0x48')](_0x4806db);})[_0xc04d('0x27')](function(_0x3212dd){_0x3ab61e['rows']=_0x3212dd;return _0x3ab61e;})[_0xc04d('0x27')](respondWithFilteredResult(_0x3d6e93,_0x4806db))[_0xc04d('0x49')](handleError(_0x3d6e93,null));};exports[_0xc04d('0x4a')]=function(_0x41daed,_0x437dbb){var _0x1ad91e={'raw':![],'where':{'id':_0x41daed['params']['id']}},_0x233249={};_0x233249[_0xc04d('0x33')]=_['keys'](db[_0xc04d('0x45')]['rawAttributes']);_0x233249['query']=_[_0xc04d('0x35')](_0x41daed[_0xc04d('0x34')]);_0x233249[_0xc04d('0x36')]=_[_0xc04d('0x37')](_0x233249['model'],_0x233249[_0xc04d('0x34')]);_0x1ad91e[_0xc04d('0x38')]=_[_0xc04d('0x37')](_0x233249['model'],qs[_0xc04d('0x39')](_0x41daed[_0xc04d('0x34')][_0xc04d('0x39')]));_0x1ad91e['attributes']=_0x1ad91e['attributes'][_0xc04d('0x3a')]?_0x1ad91e['attributes']:_0x233249[_0xc04d('0x33')];if(_0x41daed[_0xc04d('0x34')][_0xc04d('0x46')]){_0x1ad91e[_0xc04d('0x47')]=[{'all':!![]}];}_0x1ad91e=_[_0xc04d('0x42')]({},_0x1ad91e,_0x41daed['options']);return db[_0xc04d('0x45')]['find'](_0x1ad91e)[_0xc04d('0x27')](handleEntityNotFound(_0x437dbb,null))[_0xc04d('0x27')](respondWithResult(_0x437dbb,null))[_0xc04d('0x49')](handleError(_0x437dbb,null));};exports['create']=function(_0x2c6944,_0x281f99){return db[_0xc04d('0x45')][_0xc04d('0x4b')](_0x2c6944[_0xc04d('0x4c')],{})[_0xc04d('0x27')](respondWithResult(_0x281f99,0xc9))[_0xc04d('0x49')](handleError(_0x281f99,null));};exports[_0xc04d('0x26')]=function(_0x543468,_0x3d0396){if(_0x543468['body']['id']){delete _0x543468['body']['id'];}return db[_0xc04d('0x45')]['find']({'where':{'id':_0x543468[_0xc04d('0x4d')]['id']}})[_0xc04d('0x27')](handleEntityNotFound(_0x3d0396,null))[_0xc04d('0x27')](saveUpdates(_0x543468[_0xc04d('0x4c')],null))[_0xc04d('0x27')](respondWithResult(_0x3d0396,null))[_0xc04d('0x49')](handleError(_0x3d0396,null));};exports[_0xc04d('0x28')]=function(_0xb80b2,_0x1c6ae9){return db[_0xc04d('0x45')][_0xc04d('0x4e')]({'where':{'id':_0xb80b2['params']['id']}})['then'](handleEntityNotFound(_0x1c6ae9,null))[_0xc04d('0x27')](removeEntity(_0x1c6ae9,null))['catch'](handleError(_0x1c6ae9,null));};exports[_0xc04d('0x4f')]=function(_0x2a9185,_0x470f7c){return db[_0xc04d('0x45')][_0xc04d('0x4f')]()['then'](respondWithResult(_0x470f7c,null))[_0xc04d('0x49')](handleError(_0x470f7c,null));};exports[_0xc04d('0x50')]=function(_0x4bd7fe,_0x3dfc1d){var _0x2c03bc={},_0x1a91cf={},_0x3ae73e={'count':0x0,'rows':[]};_0x1a91cf[_0xc04d('0x33')]=_[_0xc04d('0x35')](db['VoiceQueueReport'][_0xc04d('0x2f')]);_0x1a91cf[_0xc04d('0x34')]=_['keys'](_0x4bd7fe[_0xc04d('0x34')]);_0x1a91cf[_0xc04d('0x36')]=_['intersection'](_0x1a91cf[_0xc04d('0x33')],_0x1a91cf[_0xc04d('0x34')]);_0x2c03bc[_0xc04d('0x38')]=_[_0xc04d('0x37')](_0x1a91cf[_0xc04d('0x33')],qs[_0xc04d('0x39')](_0x4bd7fe[_0xc04d('0x34')][_0xc04d('0x39')]));_0x2c03bc[_0xc04d('0x38')]=_0x2c03bc[_0xc04d('0x38')]['length']?_0x2c03bc[_0xc04d('0x38')]:_0x1a91cf['model'];if(!_0x4bd7fe['query'][_0xc04d('0x3b')]('nolimit')){_0x2c03bc[_0xc04d('0x22')]=qs[_0xc04d('0x22')](_0x4bd7fe[_0xc04d('0x34')][_0xc04d('0x22')]);_0x2c03bc['offset']=qs[_0xc04d('0x20')](_0x4bd7fe['query']['offset']);}_0x2c03bc['order']=qs['sort'](_0x4bd7fe['query']['sort']);_0x2c03bc[_0xc04d('0x3f')]=qs[_0xc04d('0x36')](_[_0xc04d('0x40')](_0x4bd7fe[_0xc04d('0x34')],_0x1a91cf[_0xc04d('0x36')]));if(_0x4bd7fe[_0xc04d('0x34')]['filter']){_0x2c03bc[_0xc04d('0x3f')]=_[_0xc04d('0x42')](_0x2c03bc['where'],{'$or':_[_0xc04d('0x2e')](_0x2c03bc[_0xc04d('0x38')],function(_0x415958){var _0x1cae8e={};_0x1cae8e[_0x415958]={'$like':'%'+_0x4bd7fe[_0xc04d('0x34')]['filter']+'%'};return _0x1cae8e;})});}_0x2c03bc=_['merge']({},_0x2c03bc,_0x4bd7fe['options']);var _0x2aa8e8={'where':_0x2c03bc[_0xc04d('0x3f')]};return db[_0xc04d('0x45')]['count'](_0x2aa8e8)[_0xc04d('0x27')](function(_0x3f25d9){_0x3ae73e[_0xc04d('0x23')]=_0x3f25d9;if(_0x4bd7fe[_0xc04d('0x34')]['includeAll']){_0x2c03bc[_0xc04d('0x47')]=[{'all':!![]}];}return db[_0xc04d('0x45')][_0xc04d('0x48')](_0x2c03bc);})[_0xc04d('0x27')](function(_0x344c5a){_0x3ae73e[_0xc04d('0x51')]=_0x344c5a;return _0x3ae73e;})['then'](respondWithFilteredResult(_0x3dfc1d,_0x2c03bc,_0xc04d('0x50')))[_0xc04d('0x49')](handleError(_0x3dfc1d,null,'getVoiceQueuesReport'));};
\ No newline at end of file