Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index c6c92a6..7652f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x054d=['name','index','map','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','show','keys','rawAttributes','filters','find','create','catch','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','status','end','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x054d,0x1aa));var _0xd054=function(_0x5c72e5,_0xfa04f8){_0x5c72e5=_0x5c72e5-0x0;var _0x4be004=_0x054d[_0x5c72e5];return _0x4be004;};'use strict';var emlformat=require(_0xd054('0x0'));var rimraf=require(_0xd054('0x1'));var zipdir=require(_0xd054('0x2'));var jsonpatch=require(_0xd054('0x3'));var rp=require('request-promise');var moment=require(_0xd054('0x4'));var BPromise=require(_0xd054('0x5'));var Mustache=require(_0xd054('0x6'));var util=require(_0xd054('0x7'));var path=require(_0xd054('0x8'));var sox=require('sox');var csv=require(_0xd054('0x9'));var ejs=require(_0xd054('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd054('0xb'));var crypto=require(_0xd054('0xc'));var jsforce=require(_0xd054('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd054('0x9'));var querystring=require(_0xd054('0xe'));var Papa=require(_0xd054('0xf'));var Redis=require('ioredis');var authService=require(_0xd054('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd054('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd054('0x12'));var licenseUtil=require(_0xd054('0x13'));var db=require(_0xd054('0x14'))['db'];config['redis']=_[_0xd054('0x15')](config[_0xd054('0x16')],{'host':_0xd054('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd054('0x16')]));require(_0xd054('0x18'))[_0xd054('0x19')](socket);function respondWithStatusCode(_0x1cb0ce,_0x3154ef){_0x3154ef=_0x3154ef||0xcc;return function(_0x496b60){if(_0x496b60){return _0x1cb0ce['sendStatus'](_0x3154ef);}return _0x1cb0ce[_0xd054('0x1a')](_0x3154ef)[_0xd054('0x1b')]();};}function respondWithResult(_0x292f81,_0x3759cf){_0x3759cf=_0x3759cf||0xc8;return function(_0x2a609f){if(_0x2a609f){return _0x292f81[_0xd054('0x1a')](_0x3759cf)['json'](_0x2a609f);}};}function respondWithFilteredResult(_0x460de9,_0x48f394){return function(_0x4d051f){if(_0x4d051f){var _0x5660db=typeof _0x48f394[_0xd054('0x1c')]===_0xd054('0x1d')&&typeof _0x48f394['limit']==='undefined';var _0x301e54=_0x4d051f[_0xd054('0x1e')];var _0x2a79b0=_0x5660db?0x0:_0x48f394['offset'];var _0x57f9af=_0x5660db?_0x4d051f['count']:_0x48f394['offset']+_0x48f394['limit'];var _0x5371b4;if(_0x57f9af>=_0x301e54){_0x57f9af=_0x301e54;_0x5371b4=0xc8;}else{_0x5371b4=0xce;}_0x460de9[_0xd054('0x1a')](_0x5371b4);return _0x460de9[_0xd054('0x1f')]('Content-Range',_0x2a79b0+'-'+_0x57f9af+'/'+_0x301e54)[_0xd054('0x20')](_0x4d051f);}return null;};}function patchUpdates(_0x32c6bd){return function(_0xb5bcda){try{jsonpatch[_0xd054('0x21')](_0xb5bcda,_0x32c6bd,!![]);}catch(_0x25799b){return BPromise[_0xd054('0x22')](_0x25799b);}return _0xb5bcda[_0xd054('0x23')]();};}function saveUpdates(_0x427536,_0x48764c){return function(_0x49f93d){if(_0x49f93d){return _0x49f93d[_0xd054('0x24')](_0x427536)[_0xd054('0x25')](function(_0x2e5bf3){return _0x2e5bf3;});}return null;};}function removeEntity(_0x5033f0,_0x2376e4){return function(_0x7f40b1){if(_0x7f40b1){return _0x7f40b1[_0xd054('0x26')]()[_0xd054('0x25')](function(){_0x5033f0['status'](0xcc)[_0xd054('0x1b')]();});}};}function handleEntityNotFound(_0x563236,_0x29f4f8){return function(_0x437726){if(!_0x437726){_0x563236[_0xd054('0x27')](0x194);}return _0x437726;};}function handleError(_0x419278,_0x59fc6e){_0x59fc6e=_0x59fc6e||0x1f4;return function(_0x36d875){logger[_0xd054('0x28')](_0x36d875[_0xd054('0x29')]);if(_0x36d875[_0xd054('0x2a')]){delete _0x36d875['name'];}_0x419278[_0xd054('0x1a')](_0x59fc6e)['send'](_0x36d875);};}exports[_0xd054('0x2b')]=function(_0x400c36,_0x5440a0){var _0x18ebd0={},_0x377684={},_0xdf039={'count':0x0,'rows':[]};var _0x304b7d=_[_0xd054('0x2c')](db['VoiceQueueReport']['rawAttributes'],function(_0x35b428){return{'name':_0x35b428[_0xd054('0x2d')],'type':_0x35b428[_0xd054('0x2e')][_0xd054('0x2f')]};});_0x377684['model']=_[_0xd054('0x2c')](_0x304b7d,'name');_0x377684['query']=_['keys'](_0x400c36[_0xd054('0x30')]);_0x377684['filters']=_[_0xd054('0x31')](_0x377684[_0xd054('0x32')],_0x377684[_0xd054('0x30')]);_0x18ebd0['attributes']=_[_0xd054('0x31')](_0x377684[_0xd054('0x32')],qs[_0xd054('0x33')](_0x400c36['query']['fields']));_0x18ebd0['attributes']=_0x18ebd0[_0xd054('0x34')]['length']?_0x18ebd0[_0xd054('0x34')]:_0x377684['model'];if(!_0x400c36[_0xd054('0x30')][_0xd054('0x35')](_0xd054('0x36'))){_0x18ebd0[_0xd054('0x37')]=qs[_0xd054('0x37')](_0x400c36[_0xd054('0x30')][_0xd054('0x37')]);_0x18ebd0[_0xd054('0x1c')]=qs[_0xd054('0x1c')](_0x400c36['query'][_0xd054('0x1c')]);}_0x18ebd0['order']=qs[_0xd054('0x38')](_0x400c36[_0xd054('0x30')][_0xd054('0x38')]);_0x18ebd0[_0xd054('0x39')]=qs['filters'](_[_0xd054('0x3a')](_0x400c36[_0xd054('0x30')],_0x377684['filters']),_0x304b7d);if(_0x400c36[_0xd054('0x30')]['filter']){_0x18ebd0[_0xd054('0x39')]=_[_0xd054('0x3b')](_0x18ebd0[_0xd054('0x39')],{'$or':_[_0xd054('0x2c')](_0x304b7d,function(_0x2597e1){if(_0x2597e1['type']!==_0xd054('0x3c')){var _0x298aee={};_0x298aee[_0x2597e1[_0xd054('0x2a')]]={'$like':'%'+_0x400c36[_0xd054('0x30')]['filter']+'%'};return _0x298aee;}})});}_0x18ebd0=_[_0xd054('0x3b')]({},_0x18ebd0,_0x400c36[_0xd054('0x3d')]);var _0x3170f3={'where':_0x18ebd0[_0xd054('0x39')]};return db[_0xd054('0x3e')]['count'](_0x3170f3)[_0xd054('0x25')](function(_0x3ecd0b){_0xdf039['count']=_0x3ecd0b;if(_0x400c36['query'][_0xd054('0x3f')]){_0x18ebd0[_0xd054('0x40')]=[{'all':!![]}];}return db[_0xd054('0x3e')][_0xd054('0x41')](_0x18ebd0);})['then'](function(_0x59ca43){_0xdf039[_0xd054('0x42')]=_0x59ca43;return _0xdf039;})['then'](respondWithFilteredResult(_0x5440a0,_0x18ebd0))['catch'](handleError(_0x5440a0,null));};exports[_0xd054('0x43')]=function(_0x47567f,_0x4c7c9d){var _0x1738d0={'raw':![],'where':{'id':_0x47567f['params']['id']}},_0x55048f={};_0x55048f[_0xd054('0x32')]=_[_0xd054('0x44')](db[_0xd054('0x3e')][_0xd054('0x45')]);_0x55048f['query']=_['keys'](_0x47567f['query']);_0x55048f[_0xd054('0x46')]=_[_0xd054('0x31')](_0x55048f['model'],_0x55048f['query']);_0x1738d0[_0xd054('0x34')]=_[_0xd054('0x31')](_0x55048f['model'],qs[_0xd054('0x33')](_0x47567f['query']['fields']));_0x1738d0['attributes']=_0x1738d0[_0xd054('0x34')]['length']?_0x1738d0[_0xd054('0x34')]:_0x55048f[_0xd054('0x32')];if(_0x47567f['query'][_0xd054('0x3f')]){_0x1738d0['include']=[{'all':!![]}];}_0x1738d0=_['merge']({},_0x1738d0,_0x47567f[_0xd054('0x3d')]);return db['VoiceQueueReport'][_0xd054('0x47')](_0x1738d0)[_0xd054('0x25')](handleEntityNotFound(_0x4c7c9d,null))[_0xd054('0x25')](respondWithResult(_0x4c7c9d,null))['catch'](handleError(_0x4c7c9d,null));};exports[_0xd054('0x48')]=function(_0x3d1b90,_0x1daa57){return db[_0xd054('0x3e')]['create'](_0x3d1b90['body'],{})[_0xd054('0x25')](respondWithResult(_0x1daa57,0xc9))[_0xd054('0x49')](handleError(_0x1daa57,null));};exports[_0xd054('0x24')]=function(_0x5242f3,_0x5e648d){if(_0x5242f3[_0xd054('0x4a')]['id']){delete _0x5242f3[_0xd054('0x4a')]['id'];}return db['VoiceQueueReport'][_0xd054('0x47')]({'where':{'id':_0x5242f3[_0xd054('0x4b')]['id']}})[_0xd054('0x25')](handleEntityNotFound(_0x5e648d,null))['then'](saveUpdates(_0x5242f3[_0xd054('0x4a')],null))[_0xd054('0x25')](respondWithResult(_0x5e648d,null))[_0xd054('0x49')](handleError(_0x5e648d,null));};exports['destroy']=function(_0x4a2f0c,_0x10a329){return db[_0xd054('0x3e')][_0xd054('0x47')]({'where':{'id':_0x4a2f0c[_0xd054('0x4b')]['id']}})[_0xd054('0x25')](handleEntityNotFound(_0x10a329,null))['then'](removeEntity(_0x10a329,null))['catch'](handleError(_0x10a329,null));};exports['describe']=function(_0x2c7cb2,_0x2232c9){return db[_0xd054('0x3e')][_0xd054('0x4c')]()[_0xd054('0x25')](respondWithResult(_0x2232c9,null))[_0xd054('0x49')](handleError(_0x2232c9,null));};exports['getVoiceQueuesReport']=function(_0x25c19a,_0x5679cc){var _0x23611e={},_0xe7b871={},_0x2f6964={'count':0x0,'rows':[]};_0xe7b871[_0xd054('0x32')]=_['keys'](db[_0xd054('0x3e')][_0xd054('0x45')]);_0xe7b871[_0xd054('0x30')]=_['keys'](_0x25c19a[_0xd054('0x30')]);_0xe7b871['filters']=_[_0xd054('0x31')](_0xe7b871[_0xd054('0x32')],_0xe7b871[_0xd054('0x30')]);_0x23611e[_0xd054('0x34')]=_[_0xd054('0x31')](_0xe7b871[_0xd054('0x32')],qs[_0xd054('0x33')](_0x25c19a[_0xd054('0x30')][_0xd054('0x33')]));_0x23611e[_0xd054('0x34')]=_0x23611e[_0xd054('0x34')]['length']?_0x23611e['attributes']:_0xe7b871['model'];if(!_0x25c19a[_0xd054('0x30')][_0xd054('0x35')](_0xd054('0x36'))){_0x23611e[_0xd054('0x37')]=qs[_0xd054('0x37')](_0x25c19a[_0xd054('0x30')]['limit']);_0x23611e[_0xd054('0x1c')]=qs[_0xd054('0x1c')](_0x25c19a[_0xd054('0x30')][_0xd054('0x1c')]);}_0x23611e['order']=qs[_0xd054('0x38')](_0x25c19a[_0xd054('0x30')]['sort']);_0x23611e[_0xd054('0x39')]=qs[_0xd054('0x46')](_[_0xd054('0x3a')](_0x25c19a[_0xd054('0x30')],_0xe7b871[_0xd054('0x46')]));if(_0x25c19a[_0xd054('0x30')]['filter']){_0x23611e[_0xd054('0x39')]=_[_0xd054('0x3b')](_0x23611e['where'],{'$or':_[_0xd054('0x2c')](_0x23611e[_0xd054('0x34')],function(_0x1845d9){var _0x5c07c6={};_0x5c07c6[_0x1845d9]={'$like':'%'+_0x25c19a[_0xd054('0x30')]['filter']+'%'};return _0x5c07c6;})});}_0x23611e=_[_0xd054('0x3b')]({},_0x23611e,_0x25c19a[_0xd054('0x3d')]);var _0x393e6e={'where':_0x23611e[_0xd054('0x39')]};return db[_0xd054('0x3e')][_0xd054('0x1e')](_0x393e6e)[_0xd054('0x25')](function(_0x501b1b){_0x2f6964[_0xd054('0x1e')]=_0x501b1b;if(_0x25c19a[_0xd054('0x30')]['includeAll']){_0x23611e[_0xd054('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd054('0x41')](_0x23611e);})[_0xd054('0x25')](function(_0x465954){_0x2f6964[_0xd054('0x42')]=_0x465954;return _0x2f6964;})['then'](respondWithFilteredResult(_0x5679cc,_0x23611e,_0xd054('0x4d')))[_0xd054('0x49')](handleError(_0x5679cc,null,'getVoiceQueuesReport'));};
\ 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