Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index d43c935..7652f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','getVoiceQueuesReport','pick','filter','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x66fa,0x117));var _0xa66f=function(_0x4a6990,_0x64925f){_0x4a6990=_0x4a6990-0x0;var _0x1f01c3=_0x66fa[_0x4a6990];return _0x1f01c3;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){_0x337602['status'](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x598942,_0x3a3e4f){return function(_0xc661f2){if(!_0xc661f2){_0x598942[_0xa66f('0x19')](0x194);}return _0xc661f2;};}function handleError(_0x57da7f,_0x4683c7){_0x4683c7=_0x4683c7||0x1f4;return function(_0x1c2903){logger[_0xa66f('0x28')](_0x1c2903[_0xa66f('0x29')]);if(_0x1c2903[_0xa66f('0x2a')]){delete _0x1c2903[_0xa66f('0x2a')];}_0x57da7f[_0xa66f('0x1a')](_0x4683c7)[_0xa66f('0x2b')](_0x1c2903);};}exports[_0xa66f('0x2c')]=function(_0x117d03,_0x45f71c){var _0x63650b={},_0x42b966={},_0xeeb22e={'count':0x0,'rows':[]};var _0x49f615=_['map'](db[_0xa66f('0x2d')][_0xa66f('0x2e')],function(_0x55f309){return{'name':_0x55f309[_0xa66f('0x2f')],'type':_0x55f309[_0xa66f('0x30')]['key']};});_0x42b966[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x49f615,_0xa66f('0x2a'));_0x42b966[_0xa66f('0x33')]=_[_0xa66f('0x34')](_0x117d03['query']);_0x42b966[_0xa66f('0x35')]=_['intersection'](_0x42b966[_0xa66f('0x31')],_0x42b966[_0xa66f('0x33')]);_0x63650b[_0xa66f('0x36')]=_['intersection'](_0x42b966[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x117d03['query'][_0xa66f('0x37')]));_0x63650b[_0xa66f('0x36')]=_0x63650b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x63650b[_0xa66f('0x36')]:_0x42b966[_0xa66f('0x31')];if(!_0x117d03[_0xa66f('0x33')][_0xa66f('0x39')](_0xa66f('0x3a'))){_0x63650b[_0xa66f('0x1f')]=qs['limit'](_0x117d03[_0xa66f('0x33')]['limit']);_0x63650b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x63650b[_0xa66f('0x3b')]=qs[_0xa66f('0x3c')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x63650b['where']=qs[_0xa66f('0x35')](_['pick'](_0x117d03[_0xa66f('0x33')],_0x42b966[_0xa66f('0x35')]));if(_0x117d03[_0xa66f('0x33')]['filter']){_0x63650b['where']=_[_0xa66f('0x3d')](_0x63650b[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x32')](_0x49f615,function(_0x1f5a5f){if(_0x1f5a5f[_0xa66f('0x30')]!=='VIRTUAL'){var _0x5cb0a9={};_0x5cb0a9[_0x1f5a5f['name']]={'$like':'%'+_0x117d03[_0xa66f('0x33')]['filter']+'%'};return _0x5cb0a9;}})});}_0x63650b=_['merge']({},_0x63650b,_0x117d03['options']);var _0x5fdc3e={'where':_0x63650b['where']};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x5fdc3e)[_0xa66f('0x26')](function(_0x1647a0){_0xeeb22e[_0xa66f('0x1d')]=_0x1647a0;if(_0x117d03[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x63650b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x63650b);})[_0xa66f('0x26')](function(_0x93f6ff){_0xeeb22e[_0xa66f('0x42')]=_0x93f6ff;return _0xeeb22e;})[_0xa66f('0x26')](respondWithFilteredResult(_0x45f71c,_0x63650b))['catch'](handleError(_0x45f71c,null));};exports[_0xa66f('0x43')]=function(_0x25c2cb,_0x58c1f2){var _0x248587={'raw':![],'where':{'id':_0x25c2cb[_0xa66f('0x44')]['id']}},_0x4b6e6b={};_0x4b6e6b[_0xa66f('0x31')]=_['keys'](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0x4b6e6b[_0xa66f('0x33')]=_['keys'](_0x25c2cb[_0xa66f('0x33')]);_0x4b6e6b['filters']=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],_0x4b6e6b[_0xa66f('0x33')]);_0x248587[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x25c2cb['query'][_0xa66f('0x37')]));_0x248587[_0xa66f('0x36')]=_0x248587[_0xa66f('0x36')][_0xa66f('0x38')]?_0x248587[_0xa66f('0x36')]:_0x4b6e6b['model'];if(_0x25c2cb['query'][_0xa66f('0x3f')]){_0x248587[_0xa66f('0x40')]=[{'all':!![]}];}_0x248587=_[_0xa66f('0x3d')]({},_0x248587,_0x25c2cb[_0xa66f('0x46')]);return db[_0xa66f('0x2d')][_0xa66f('0x47')](_0x248587)['then'](handleEntityNotFound(_0x58c1f2,null))[_0xa66f('0x26')](respondWithResult(_0x58c1f2,null))[_0xa66f('0x48')](handleError(_0x58c1f2,null));};exports[_0xa66f('0x49')]=function(_0x5651e9,_0x57c8a0){return db[_0xa66f('0x2d')][_0xa66f('0x49')](_0x5651e9[_0xa66f('0x4a')],{})['then'](respondWithResult(_0x57c8a0,0xc9))['catch'](handleError(_0x57c8a0,null));};exports['update']=function(_0x19e7ce,_0x35e477){if(_0x19e7ce[_0xa66f('0x4a')]['id']){delete _0x19e7ce[_0xa66f('0x4a')]['id'];}return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0x19e7ce[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x35e477,null))['then'](saveUpdates(_0x19e7ce[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x35e477,null))[_0xa66f('0x48')](handleError(_0x35e477,null));};exports[_0xa66f('0x27')]=function(_0x11597b,_0x33cdc7){return db['VoiceQueueReport'][_0xa66f('0x47')]({'where':{'id':_0x11597b[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x33cdc7,null))[_0xa66f('0x26')](removeEntity(_0x33cdc7,null))[_0xa66f('0x48')](handleError(_0x33cdc7,null));};exports['describe']=function(_0x389b9a,_0x50e0cd){return db[_0xa66f('0x2d')]['describe']()['then'](respondWithResult(_0x50e0cd,null))[_0xa66f('0x48')](handleError(_0x50e0cd,null));};exports[_0xa66f('0x4b')]=function(_0x12271d,_0x2c79df){var _0x35ed5b={},_0xe97cf4={},_0x53a62f={'count':0x0,'rows':[]};_0xe97cf4[_0xa66f('0x31')]=_[_0xa66f('0x34')](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0xe97cf4['query']=_[_0xa66f('0x34')](_0x12271d['query']);_0xe97cf4[_0xa66f('0x35')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],_0xe97cf4[_0xa66f('0x33')]);_0x35ed5b[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],qs['fields'](_0x12271d[_0xa66f('0x33')][_0xa66f('0x37')]));_0x35ed5b[_0xa66f('0x36')]=_0x35ed5b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x35ed5b[_0xa66f('0x36')]:_0xe97cf4[_0xa66f('0x31')];if(!_0x12271d[_0xa66f('0x33')][_0xa66f('0x39')]('nolimit')){_0x35ed5b['limit']=qs[_0xa66f('0x1f')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1f')]);_0x35ed5b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x35ed5b['order']=qs[_0xa66f('0x3c')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x35ed5b[_0xa66f('0x3e')]=qs['filters'](_[_0xa66f('0x4c')](_0x12271d[_0xa66f('0x33')],_0xe97cf4[_0xa66f('0x35')]));if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]){_0x35ed5b[_0xa66f('0x3e')]=_['merge'](_0x35ed5b['where'],{'$or':_[_0xa66f('0x32')](_0x35ed5b[_0xa66f('0x36')],function(_0x174aad){var _0x52edb3={};_0x52edb3[_0x174aad]={'$like':'%'+_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]+'%'};return _0x52edb3;})});}_0x35ed5b=_[_0xa66f('0x3d')]({},_0x35ed5b,_0x12271d[_0xa66f('0x46')]);var _0x17b2cf={'where':_0x35ed5b[_0xa66f('0x3e')]};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x17b2cf)[_0xa66f('0x26')](function(_0x5d4299){_0x53a62f[_0xa66f('0x1d')]=_0x5d4299;if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x35ed5b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x35ed5b);})[_0xa66f('0x26')](function(_0x3b38ad){_0x53a62f['rows']=_0x3b38ad;return _0x53a62f;})['then'](respondWithFilteredResult(_0x2c79df,_0x35ed5b,_0xa66f('0x4b')))[_0xa66f('0x48')](handleError(_0x2c79df,null,_0xa66f('0x4b')));};
\ 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