Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.controller.js
index aa820c0..3d193ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82b=['../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','create','body','catch','describe','getVoiceQueuesReport','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3007be,_0x40ae2d){var _0xef118e=function(_0x3475a6){while(--_0x3475a6){_0x3007be['push'](_0x3007be['shift']());}};_0xef118e(++_0x40ae2d);}(_0xa82b,0xe1));var _0xba82=function(_0x261038,_0x2fab28){_0x261038=_0x261038-0x0;var _0x2fd230=_0xa82b[_0x261038];return _0x2fd230;};'use strict';var emlformat=require(_0xba82('0x0'));var rimraf=require(_0xba82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xba82('0x2'));var moment=require('moment');var BPromise=require(_0xba82('0x3'));var Mustache=require(_0xba82('0x4'));var util=require('util');var path=require(_0xba82('0x5'));var sox=require(_0xba82('0x6'));var csv=require(_0xba82('0x7'));var ejs=require(_0xba82('0x8'));var fs=require('fs');var fs_extra=require(_0xba82('0x9'));var _=require(_0xba82('0xa'));var squel=require(_0xba82('0xb'));var crypto=require(_0xba82('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba82('0x7'));var querystring=require(_0xba82('0xd'));var Papa=require(_0xba82('0xe'));var Redis=require(_0xba82('0xf'));var authService=require(_0xba82('0x10'));var qs=require(_0xba82('0x11'));var as=require(_0xba82('0x12'));var hardwareService=require(_0xba82('0x13'));var logger=require(_0xba82('0x14'))(_0xba82('0x15'));var utils=require(_0xba82('0x16'));var config=require(_0xba82('0x17'));var licenseUtil=require(_0xba82('0x18'));var db=require('../../mysqldb')['db'];config[_0xba82('0x19')]=_[_0xba82('0x1a')](config[_0xba82('0x19')],{'host':_0xba82('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba82('0x19')]));require(_0xba82('0x1c'))[_0xba82('0x1d')](socket);function respondWithStatusCode(_0x300ff3,_0x394a5e){_0x394a5e=_0x394a5e||0xcc;return function(_0x40fb8e){if(_0x40fb8e){return _0x300ff3[_0xba82('0x1e')](_0x394a5e);}return _0x300ff3[_0xba82('0x1f')](_0x394a5e)[_0xba82('0x20')]();};}function respondWithResult(_0x3f6869,_0x1c9bc0){_0x1c9bc0=_0x1c9bc0||0xc8;return function(_0x4f9359){if(_0x4f9359){return _0x3f6869[_0xba82('0x1f')](_0x1c9bc0)[_0xba82('0x21')](_0x4f9359);}};}function respondWithFilteredResult(_0x1f19c2,_0x4b8546){return function(_0x192d52){if(_0x192d52){var _0x42a632=typeof _0x4b8546[_0xba82('0x22')]===_0xba82('0x23')&&typeof _0x4b8546[_0xba82('0x24')]===_0xba82('0x23');var _0x726897=_0x192d52[_0xba82('0x25')];var _0x5663a1=_0x42a632?0x0:_0x4b8546[_0xba82('0x22')];var _0x26d012=_0x42a632?_0x192d52[_0xba82('0x25')]:_0x4b8546[_0xba82('0x22')]+_0x4b8546[_0xba82('0x24')];var _0xa9ea71;if(_0x26d012>=_0x726897){_0x26d012=_0x726897;_0xa9ea71=0xc8;}else{_0xa9ea71=0xce;}_0x1f19c2[_0xba82('0x1f')](_0xa9ea71);return _0x1f19c2[_0xba82('0x26')](_0xba82('0x27'),_0x5663a1+'-'+_0x26d012+'/'+_0x726897)[_0xba82('0x21')](_0x192d52);}return null;};}function patchUpdates(_0x5b3ae1){return function(_0x18a68e){try{jsonpatch[_0xba82('0x28')](_0x18a68e,_0x5b3ae1,!![]);}catch(_0x2ecdd8){return BPromise[_0xba82('0x29')](_0x2ecdd8);}return _0x18a68e['save']();};}function saveUpdates(_0xa664,_0x2dbca3){return function(_0x1fd347){if(_0x1fd347){return _0x1fd347[_0xba82('0x2a')](_0xa664)[_0xba82('0x2b')](function(_0x4dce50){return _0x4dce50;});}return null;};}function removeEntity(_0x5ce240,_0x10e232){return function(_0x40bca8){if(_0x40bca8){return _0x40bca8[_0xba82('0x2c')]()['then'](function(){_0x5ce240['status'](0xcc)[_0xba82('0x20')]();});}};}function handleEntityNotFound(_0x4d0ed1,_0x4b6527){return function(_0x397685){if(!_0x397685){_0x4d0ed1[_0xba82('0x1e')](0x194);}return _0x397685;};}function handleError(_0x3272f2,_0x49829c){_0x49829c=_0x49829c||0x1f4;return function(_0x2140a8){logger[_0xba82('0x2d')](_0x2140a8['stack']);if(_0x2140a8['name']){delete _0x2140a8[_0xba82('0x2e')];}_0x3272f2[_0xba82('0x1f')](_0x49829c)[_0xba82('0x2f')](_0x2140a8);};}exports[_0xba82('0x30')]=function(_0x43d61d,_0x31c67e){var _0x380882={},_0x151690={},_0x33464d={'count':0x0,'rows':[]};var _0x2d39bc=_['map'](db[_0xba82('0x31')][_0xba82('0x32')],function(_0x383967){return{'name':_0x383967[_0xba82('0x33')],'type':_0x383967[_0xba82('0x34')]['key']};});_0x151690[_0xba82('0x35')]=_['map'](_0x2d39bc,'name');_0x151690['query']=_[_0xba82('0x36')](_0x43d61d[_0xba82('0x37')]);_0x151690[_0xba82('0x38')]=_[_0xba82('0x39')](_0x151690[_0xba82('0x35')],_0x151690[_0xba82('0x37')]);_0x380882[_0xba82('0x3a')]=_[_0xba82('0x39')](_0x151690['model'],qs[_0xba82('0x3b')](_0x43d61d['query'][_0xba82('0x3b')]));_0x380882[_0xba82('0x3a')]=_0x380882[_0xba82('0x3a')]['length']?_0x380882[_0xba82('0x3a')]:_0x151690[_0xba82('0x35')];if(!_0x43d61d[_0xba82('0x37')][_0xba82('0x3c')]('nolimit')){_0x380882[_0xba82('0x24')]=qs[_0xba82('0x24')](_0x43d61d[_0xba82('0x37')][_0xba82('0x24')]);_0x380882[_0xba82('0x22')]=qs['offset'](_0x43d61d[_0xba82('0x37')][_0xba82('0x22')]);}_0x380882[_0xba82('0x3d')]=qs[_0xba82('0x3e')](_0x43d61d[_0xba82('0x37')][_0xba82('0x3e')]);_0x380882[_0xba82('0x3f')]=qs['filters'](_[_0xba82('0x40')](_0x43d61d[_0xba82('0x37')],_0x151690[_0xba82('0x38')]),_0x2d39bc);if(_0x43d61d[_0xba82('0x37')][_0xba82('0x41')]){_0x380882[_0xba82('0x3f')]=_[_0xba82('0x42')](_0x380882[_0xba82('0x3f')],{'$or':_[_0xba82('0x43')](_0x2d39bc,function(_0x319b25){if(_0x319b25[_0xba82('0x34')]!==_0xba82('0x44')){var _0x3f8778={};_0x3f8778[_0x319b25[_0xba82('0x2e')]]={'$like':'%'+_0x43d61d[_0xba82('0x37')][_0xba82('0x41')]+'%'};return _0x3f8778;}})});}_0x380882=_['merge']({},_0x380882,_0x43d61d[_0xba82('0x45')]);var _0x29d90d={'where':_0x380882[_0xba82('0x3f')]};return db[_0xba82('0x31')][_0xba82('0x25')](_0x29d90d)[_0xba82('0x2b')](function(_0x4d0b34){_0x33464d[_0xba82('0x25')]=_0x4d0b34;if(_0x43d61d['query']['includeAll']){_0x380882[_0xba82('0x46')]=[{'all':!![]}];}return db[_0xba82('0x31')][_0xba82('0x47')](_0x380882);})['then'](function(_0x3a1718){_0x33464d[_0xba82('0x48')]=_0x3a1718;return _0x33464d;})[_0xba82('0x2b')](respondWithFilteredResult(_0x31c67e,_0x380882))['catch'](handleError(_0x31c67e,null));};exports[_0xba82('0x49')]=function(_0x517b65,_0x315cdd){var _0x3c0ad3={'raw':![],'where':{'id':_0x517b65[_0xba82('0x4a')]['id']}},_0xb958a8={};_0xb958a8['model']=_[_0xba82('0x36')](db['VoiceQueueReport'][_0xba82('0x32')]);_0xb958a8[_0xba82('0x37')]=_[_0xba82('0x36')](_0x517b65[_0xba82('0x37')]);_0xb958a8[_0xba82('0x38')]=_[_0xba82('0x39')](_0xb958a8[_0xba82('0x35')],_0xb958a8[_0xba82('0x37')]);_0x3c0ad3['attributes']=_[_0xba82('0x39')](_0xb958a8[_0xba82('0x35')],qs[_0xba82('0x3b')](_0x517b65[_0xba82('0x37')][_0xba82('0x3b')]));_0x3c0ad3[_0xba82('0x3a')]=_0x3c0ad3[_0xba82('0x3a')][_0xba82('0x4b')]?_0x3c0ad3['attributes']:_0xb958a8[_0xba82('0x35')];if(_0x517b65['query'][_0xba82('0x4c')]){_0x3c0ad3[_0xba82('0x46')]=[{'all':!![]}];}_0x3c0ad3=_[_0xba82('0x42')]({},_0x3c0ad3,_0x517b65[_0xba82('0x45')]);return db['VoiceQueueReport'][_0xba82('0x4d')](_0x3c0ad3)[_0xba82('0x2b')](handleEntityNotFound(_0x315cdd,null))[_0xba82('0x2b')](respondWithResult(_0x315cdd,null))['catch'](handleError(_0x315cdd,null));};exports[_0xba82('0x4e')]=function(_0x18dce8,_0x393ca7){return db[_0xba82('0x31')]['create'](_0x18dce8[_0xba82('0x4f')],{})['then'](respondWithResult(_0x393ca7,0xc9))['catch'](handleError(_0x393ca7,null));};exports[_0xba82('0x2a')]=function(_0x575fce,_0xe39c9f){if(_0x575fce['body']['id']){delete _0x575fce[_0xba82('0x4f')]['id'];}return db[_0xba82('0x31')][_0xba82('0x4d')]({'where':{'id':_0x575fce[_0xba82('0x4a')]['id']}})[_0xba82('0x2b')](handleEntityNotFound(_0xe39c9f,null))[_0xba82('0x2b')](saveUpdates(_0x575fce[_0xba82('0x4f')],null))[_0xba82('0x2b')](respondWithResult(_0xe39c9f,null))[_0xba82('0x50')](handleError(_0xe39c9f,null));};exports['destroy']=function(_0x1dd0ab,_0x24739e){return db['VoiceQueueReport'][_0xba82('0x4d')]({'where':{'id':_0x1dd0ab[_0xba82('0x4a')]['id']}})[_0xba82('0x2b')](handleEntityNotFound(_0x24739e,null))[_0xba82('0x2b')](removeEntity(_0x24739e,null))[_0xba82('0x50')](handleError(_0x24739e,null));};exports[_0xba82('0x51')]=function(_0x2a9e8c,_0x2ca0ba){return db[_0xba82('0x31')][_0xba82('0x51')]()[_0xba82('0x2b')](respondWithResult(_0x2ca0ba,null))[_0xba82('0x50')](handleError(_0x2ca0ba,null));};exports[_0xba82('0x52')]=function(_0x1cd9d0,_0x529a01){var _0xd1f8b3={},_0x5625e7={},_0x7278e={'count':0x0,'rows':[]};_0x5625e7[_0xba82('0x35')]=_[_0xba82('0x36')](db[_0xba82('0x31')]['rawAttributes']);_0x5625e7[_0xba82('0x37')]=_[_0xba82('0x36')](_0x1cd9d0[_0xba82('0x37')]);_0x5625e7[_0xba82('0x38')]=_[_0xba82('0x39')](_0x5625e7[_0xba82('0x35')],_0x5625e7['query']);_0xd1f8b3[_0xba82('0x3a')]=_['intersection'](_0x5625e7[_0xba82('0x35')],qs['fields'](_0x1cd9d0[_0xba82('0x37')][_0xba82('0x3b')]));_0xd1f8b3[_0xba82('0x3a')]=_0xd1f8b3['attributes'][_0xba82('0x4b')]?_0xd1f8b3[_0xba82('0x3a')]:_0x5625e7[_0xba82('0x35')];if(!_0x1cd9d0[_0xba82('0x37')][_0xba82('0x3c')]('nolimit')){_0xd1f8b3[_0xba82('0x24')]=qs[_0xba82('0x24')](_0x1cd9d0[_0xba82('0x37')][_0xba82('0x24')]);_0xd1f8b3[_0xba82('0x22')]=qs[_0xba82('0x22')](_0x1cd9d0[_0xba82('0x37')][_0xba82('0x22')]);}_0xd1f8b3[_0xba82('0x3d')]=qs[_0xba82('0x3e')](_0x1cd9d0[_0xba82('0x37')]['sort']);_0xd1f8b3['where']=qs[_0xba82('0x38')](_[_0xba82('0x40')](_0x1cd9d0['query'],_0x5625e7[_0xba82('0x38')]));if(_0x1cd9d0[_0xba82('0x37')][_0xba82('0x41')]){_0xd1f8b3[_0xba82('0x3f')]=_[_0xba82('0x42')](_0xd1f8b3[_0xba82('0x3f')],{'$or':_[_0xba82('0x43')](_0xd1f8b3['attributes'],function(_0x501d33){var _0x3f3803={};_0x3f3803[_0x501d33]={'$like':'%'+_0x1cd9d0[_0xba82('0x37')][_0xba82('0x41')]+'%'};return _0x3f3803;})});}_0xd1f8b3=_[_0xba82('0x42')]({},_0xd1f8b3,_0x1cd9d0['options']);var _0x5a2733={'where':_0xd1f8b3[_0xba82('0x3f')]};return db['VoiceQueueReport'][_0xba82('0x25')](_0x5a2733)['then'](function(_0x51751a){_0x7278e[_0xba82('0x25')]=_0x51751a;if(_0x1cd9d0[_0xba82('0x37')][_0xba82('0x4c')]){_0xd1f8b3[_0xba82('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0xd1f8b3);})[_0xba82('0x2b')](function(_0x421d84){_0x7278e[_0xba82('0x48')]=_0x421d84;return _0x7278e;})[_0xba82('0x2b')](respondWithFilteredResult(_0x529a01,_0xd1f8b3,'getVoiceQueuesReport'))[_0xba82('0x50')](handleError(_0x529a01,null,_0xba82('0x52')));};
\ No newline at end of file
+var _0x07a7=['merge','options','includeAll','include','rows','show','params','rawAttributes','keys','length','catch','create','body','find','destroy','describe','getVoiceQueuesReport','hasOwnProperty','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','name','send','index','map','VoiceQueueReport','fieldName','type','key','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter'];(function(_0x32361f,_0x4173df){var _0x22b487=function(_0x7b1a21){while(--_0x7b1a21){_0x32361f['push'](_0x32361f['shift']());}};_0x22b487(++_0x4173df);}(_0x07a7,0x10c));var _0x707a=function(_0x3c3ad6,_0x861dbf){_0x3c3ad6=_0x3c3ad6-0x0;var _0xb11f11=_0x07a7[_0x3c3ad6];return _0xb11f11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x707a('0x0'));var zipdir=require(_0x707a('0x1'));var jsonpatch=require(_0x707a('0x2'));var rp=require(_0x707a('0x3'));var moment=require(_0x707a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x707a('0x5'));var util=require(_0x707a('0x6'));var path=require('path');var sox=require(_0x707a('0x7'));var csv=require(_0x707a('0x8'));var ejs=require(_0x707a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x707a('0xa'));var squel=require(_0x707a('0xb'));var crypto=require('crypto');var jsforce=require(_0x707a('0xc'));var deskjs=require(_0x707a('0xd'));var toCsv=require(_0x707a('0x8'));var querystring=require(_0x707a('0xe'));var Papa=require(_0x707a('0xf'));var Redis=require(_0x707a('0x10'));var authService=require(_0x707a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x707a('0x12'));var hardwareService=require(_0x707a('0x13'));var logger=require('../../config/logger')(_0x707a('0x14'));var utils=require(_0x707a('0x15'));var config=require(_0x707a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x707a('0x17'))['db'];config[_0x707a('0x18')]=_[_0x707a('0x19')](config[_0x707a('0x18')],{'host':_0x707a('0x1a'),'port':0x18eb});var socket=require(_0x707a('0x1b'))(new Redis(config[_0x707a('0x18')]));require(_0x707a('0x1c'))[_0x707a('0x1d')](socket);function respondWithStatusCode(_0x24b37f,_0x2864ca){_0x2864ca=_0x2864ca||0xcc;return function(_0x482f9a){if(_0x482f9a){return _0x24b37f['sendStatus'](_0x2864ca);}return _0x24b37f[_0x707a('0x1e')](_0x2864ca)[_0x707a('0x1f')]();};}function respondWithResult(_0x461ab3,_0x31ba4f){_0x31ba4f=_0x31ba4f||0xc8;return function(_0x39e461){if(_0x39e461){return _0x461ab3[_0x707a('0x1e')](_0x31ba4f)[_0x707a('0x20')](_0x39e461);}};}function respondWithFilteredResult(_0x2210b4,_0x336ec8){return function(_0x4dfd22){if(_0x4dfd22){var _0x2ac5b9=typeof _0x336ec8['offset']===_0x707a('0x21')&&typeof _0x336ec8[_0x707a('0x22')]==='undefined';var _0x479fb6=_0x4dfd22[_0x707a('0x23')];var _0x3dbc08=_0x2ac5b9?0x0:_0x336ec8['offset'];var _0x580318=_0x2ac5b9?_0x4dfd22['count']:_0x336ec8[_0x707a('0x24')]+_0x336ec8['limit'];var _0x298198;if(_0x580318>=_0x479fb6){_0x580318=_0x479fb6;_0x298198=0xc8;}else{_0x298198=0xce;}_0x2210b4[_0x707a('0x1e')](_0x298198);return _0x2210b4[_0x707a('0x25')](_0x707a('0x26'),_0x3dbc08+'-'+_0x580318+'/'+_0x479fb6)[_0x707a('0x20')](_0x4dfd22);}return null;};}function patchUpdates(_0x4022f8){return function(_0x4d3aa8){try{jsonpatch[_0x707a('0x27')](_0x4d3aa8,_0x4022f8,!![]);}catch(_0x391651){return BPromise[_0x707a('0x28')](_0x391651);}return _0x4d3aa8['save']();};}function saveUpdates(_0x101535,_0x521ff4){return function(_0x52f53e){if(_0x52f53e){return _0x52f53e[_0x707a('0x29')](_0x101535)[_0x707a('0x2a')](function(_0x144b23){return _0x144b23;});}return null;};}function removeEntity(_0x5573ad,_0x347750){return function(_0x40d6ef){if(_0x40d6ef){return _0x40d6ef['destroy']()[_0x707a('0x2a')](function(){_0x5573ad['status'](0xcc)[_0x707a('0x1f')]();});}};}function handleEntityNotFound(_0x1720fd,_0x13870a){return function(_0x55d96e){if(!_0x55d96e){_0x1720fd[_0x707a('0x2b')](0x194);}return _0x55d96e;};}function handleError(_0x4c6dca,_0x437132){_0x437132=_0x437132||0x1f4;return function(_0x3c74ea){logger['error'](_0x3c74ea['stack']);if(_0x3c74ea[_0x707a('0x2c')]){delete _0x3c74ea[_0x707a('0x2c')];}_0x4c6dca[_0x707a('0x1e')](_0x437132)[_0x707a('0x2d')](_0x3c74ea);};}exports[_0x707a('0x2e')]=function(_0x542f9e,_0x295b45){var _0x239225={},_0x1a6232={},_0x3db438={'count':0x0,'rows':[]};var _0x507e02=_[_0x707a('0x2f')](db[_0x707a('0x30')]['rawAttributes'],function(_0xd73fea){return{'name':_0xd73fea[_0x707a('0x31')],'type':_0xd73fea[_0x707a('0x32')][_0x707a('0x33')]};});_0x1a6232['model']=_['map'](_0x507e02,_0x707a('0x2c'));_0x1a6232[_0x707a('0x34')]=_['keys'](_0x542f9e['query']);_0x1a6232[_0x707a('0x35')]=_[_0x707a('0x36')](_0x1a6232['model'],_0x1a6232['query']);_0x239225[_0x707a('0x37')]=_[_0x707a('0x36')](_0x1a6232[_0x707a('0x38')],qs['fields'](_0x542f9e[_0x707a('0x34')][_0x707a('0x39')]));_0x239225[_0x707a('0x37')]=_0x239225[_0x707a('0x37')]['length']?_0x239225[_0x707a('0x37')]:_0x1a6232['model'];if(!_0x542f9e['query']['hasOwnProperty'](_0x707a('0x3a'))){_0x239225[_0x707a('0x22')]=qs[_0x707a('0x22')](_0x542f9e[_0x707a('0x34')][_0x707a('0x22')]);_0x239225['offset']=qs[_0x707a('0x24')](_0x542f9e['query']['offset']);}_0x239225[_0x707a('0x3b')]=qs[_0x707a('0x3c')](_0x542f9e['query']['sort']);_0x239225[_0x707a('0x3d')]=qs[_0x707a('0x35')](_[_0x707a('0x3e')](_0x542f9e['query'],_0x1a6232['filters']),_0x507e02);if(_0x542f9e[_0x707a('0x34')]['filter']){_0x239225[_0x707a('0x3d')]=_['merge'](_0x239225['where'],{'$or':_[_0x707a('0x2f')](_0x507e02,function(_0x537030){if(_0x537030[_0x707a('0x32')]!=='VIRTUAL'){var _0x2cb143={};_0x2cb143[_0x537030['name']]={'$like':'%'+_0x542f9e[_0x707a('0x34')][_0x707a('0x3f')]+'%'};return _0x2cb143;}})});}_0x239225=_[_0x707a('0x40')]({},_0x239225,_0x542f9e[_0x707a('0x41')]);var _0x370b16={'where':_0x239225[_0x707a('0x3d')]};return db[_0x707a('0x30')]['count'](_0x370b16)[_0x707a('0x2a')](function(_0x196b61){_0x3db438[_0x707a('0x23')]=_0x196b61;if(_0x542f9e['query'][_0x707a('0x42')]){_0x239225[_0x707a('0x43')]=[{'all':!![]}];}return db[_0x707a('0x30')]['findAll'](_0x239225);})[_0x707a('0x2a')](function(_0x33f4e4){_0x3db438[_0x707a('0x44')]=_0x33f4e4;return _0x3db438;})[_0x707a('0x2a')](respondWithFilteredResult(_0x295b45,_0x239225))['catch'](handleError(_0x295b45,null));};exports[_0x707a('0x45')]=function(_0x5172c4,_0x9d9145){var _0x1d086f={'raw':![],'where':{'id':_0x5172c4[_0x707a('0x46')]['id']}},_0x5b6a3d={};_0x5b6a3d[_0x707a('0x38')]=_['keys'](db[_0x707a('0x30')][_0x707a('0x47')]);_0x5b6a3d[_0x707a('0x34')]=_[_0x707a('0x48')](_0x5172c4[_0x707a('0x34')]);_0x5b6a3d[_0x707a('0x35')]=_[_0x707a('0x36')](_0x5b6a3d[_0x707a('0x38')],_0x5b6a3d[_0x707a('0x34')]);_0x1d086f['attributes']=_['intersection'](_0x5b6a3d['model'],qs['fields'](_0x5172c4[_0x707a('0x34')][_0x707a('0x39')]));_0x1d086f[_0x707a('0x37')]=_0x1d086f[_0x707a('0x37')][_0x707a('0x49')]?_0x1d086f['attributes']:_0x5b6a3d[_0x707a('0x38')];if(_0x5172c4['query']['includeAll']){_0x1d086f['include']=[{'all':!![]}];}_0x1d086f=_[_0x707a('0x40')]({},_0x1d086f,_0x5172c4[_0x707a('0x41')]);return db[_0x707a('0x30')]['find'](_0x1d086f)[_0x707a('0x2a')](handleEntityNotFound(_0x9d9145,null))['then'](respondWithResult(_0x9d9145,null))[_0x707a('0x4a')](handleError(_0x9d9145,null));};exports[_0x707a('0x4b')]=function(_0x34d6cb,_0x174a78){return db[_0x707a('0x30')][_0x707a('0x4b')](_0x34d6cb[_0x707a('0x4c')],{})[_0x707a('0x2a')](respondWithResult(_0x174a78,0xc9))[_0x707a('0x4a')](handleError(_0x174a78,null));};exports['update']=function(_0x4e03f2,_0x1ea906){if(_0x4e03f2['body']['id']){delete _0x4e03f2[_0x707a('0x4c')]['id'];}return db['VoiceQueueReport'][_0x707a('0x4d')]({'where':{'id':_0x4e03f2['params']['id']}})[_0x707a('0x2a')](handleEntityNotFound(_0x1ea906,null))[_0x707a('0x2a')](saveUpdates(_0x4e03f2['body'],null))[_0x707a('0x2a')](respondWithResult(_0x1ea906,null))[_0x707a('0x4a')](handleError(_0x1ea906,null));};exports[_0x707a('0x4e')]=function(_0x5e0554,_0x5c70cc){return db[_0x707a('0x30')][_0x707a('0x4d')]({'where':{'id':_0x5e0554[_0x707a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c70cc,null))[_0x707a('0x2a')](removeEntity(_0x5c70cc,null))[_0x707a('0x4a')](handleError(_0x5c70cc,null));};exports['describe']=function(_0x85980a,_0x25da53){return db['VoiceQueueReport'][_0x707a('0x4f')]()[_0x707a('0x2a')](respondWithResult(_0x25da53,null))[_0x707a('0x4a')](handleError(_0x25da53,null));};exports[_0x707a('0x50')]=function(_0x158e07,_0x3d679a){var _0x3dbaeb={},_0x255e59={},_0x5c5573={'count':0x0,'rows':[]};_0x255e59[_0x707a('0x38')]=_[_0x707a('0x48')](db['VoiceQueueReport']['rawAttributes']);_0x255e59[_0x707a('0x34')]=_['keys'](_0x158e07[_0x707a('0x34')]);_0x255e59[_0x707a('0x35')]=_[_0x707a('0x36')](_0x255e59[_0x707a('0x38')],_0x255e59[_0x707a('0x34')]);_0x3dbaeb[_0x707a('0x37')]=_['intersection'](_0x255e59['model'],qs['fields'](_0x158e07[_0x707a('0x34')][_0x707a('0x39')]));_0x3dbaeb[_0x707a('0x37')]=_0x3dbaeb[_0x707a('0x37')]['length']?_0x3dbaeb['attributes']:_0x255e59[_0x707a('0x38')];if(!_0x158e07['query'][_0x707a('0x51')](_0x707a('0x3a'))){_0x3dbaeb[_0x707a('0x22')]=qs[_0x707a('0x22')](_0x158e07['query']['limit']);_0x3dbaeb[_0x707a('0x24')]=qs[_0x707a('0x24')](_0x158e07['query']['offset']);}_0x3dbaeb[_0x707a('0x3b')]=qs[_0x707a('0x3c')](_0x158e07[_0x707a('0x34')][_0x707a('0x3c')]);_0x3dbaeb[_0x707a('0x3d')]=qs[_0x707a('0x35')](_[_0x707a('0x3e')](_0x158e07[_0x707a('0x34')],_0x255e59[_0x707a('0x35')]));if(_0x158e07[_0x707a('0x34')][_0x707a('0x3f')]){_0x3dbaeb[_0x707a('0x3d')]=_[_0x707a('0x40')](_0x3dbaeb[_0x707a('0x3d')],{'$or':_[_0x707a('0x2f')](_0x3dbaeb['attributes'],function(_0x330113){var _0x3a6fa7={};_0x3a6fa7[_0x330113]={'$like':'%'+_0x158e07['query']['filter']+'%'};return _0x3a6fa7;})});}_0x3dbaeb=_['merge']({},_0x3dbaeb,_0x158e07[_0x707a('0x41')]);var _0x48ddcd={'where':_0x3dbaeb[_0x707a('0x3d')]};return db['VoiceQueueReport'][_0x707a('0x23')](_0x48ddcd)[_0x707a('0x2a')](function(_0x2aab82){_0x5c5573[_0x707a('0x23')]=_0x2aab82;if(_0x158e07[_0x707a('0x34')][_0x707a('0x42')]){_0x3dbaeb['include']=[{'all':!![]}];}return db[_0x707a('0x30')][_0x707a('0x52')](_0x3dbaeb);})[_0x707a('0x2a')](function(_0x1e5933){_0x5c5573[_0x707a('0x44')]=_0x1e5933;return _0x5c5573;})['then'](respondWithFilteredResult(_0x3d679a,_0x3dbaeb,_0x707a('0x50')))[_0x707a('0x4a')](handleError(_0x3d679a,null,_0x707a('0x50')));};
\ No newline at end of file