Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.controller.js
index 05fc19c..c849391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','name','index','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','catch','body','find','params','html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0x28da54,_0x92c496){var _0x3eddc1=function(_0x4b099b){while(--_0x4b099b){_0x28da54['push'](_0x28da54['shift']());}};_0x3eddc1(++_0x92c496);}(_0xfcf9,0x1ae));var _0x9fcf=function(_0x48bce7,_0x2fb44c){_0x48bce7=_0x48bce7-0x0;var _0x3925a6=_0xfcf9[_0x48bce7];return _0x3925a6;};'use strict';var pdf=require(_0x9fcf('0x0'));var emlformat=require(_0x9fcf('0x1'));var rimraf=require(_0x9fcf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9fcf('0x3'));var moment=require('moment');var BPromise=require(_0x9fcf('0x4'));var Mustache=require('mustache');var util=require(_0x9fcf('0x5'));var path=require(_0x9fcf('0x6'));var sox=require(_0x9fcf('0x7'));var csv=require(_0x9fcf('0x8'));var ejs=require(_0x9fcf('0x9'));var fs=require('fs');var _=require(_0x9fcf('0xa'));var squel=require(_0x9fcf('0xb'));var crypto=require('crypto');var jsforce=require(_0x9fcf('0xc'));var deskjs=require(_0x9fcf('0xd'));var toCsv=require(_0x9fcf('0x8'));var querystring=require('querystring');var Papa=require(_0x9fcf('0xe'));var Redis=require(_0x9fcf('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9fcf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9fcf('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9fcf('0x12'));var db=require(_0x9fcf('0x13'))['db'];function respondWithStatusCode(_0x5618a0,_0x1f092b){_0x1f092b=_0x1f092b||0xcc;return function(_0x4dd6ba){if(_0x4dd6ba){return _0x5618a0[_0x9fcf('0x14')](_0x1f092b);}return _0x5618a0[_0x9fcf('0x15')](_0x1f092b)[_0x9fcf('0x16')]();};}function respondWithResult(_0x33dcc4,_0x4a51d6){_0x4a51d6=_0x4a51d6||0xc8;return function(_0x27d5fd){if(_0x27d5fd){return _0x33dcc4[_0x9fcf('0x15')](_0x4a51d6)[_0x9fcf('0x17')](_0x27d5fd);}};}function respondWithFilteredResult(_0x3770de,_0x421b09){return function(_0x2098ba){if(_0x2098ba){var _0x326bab=_0x2098ba[_0x9fcf('0x18')],_0x16361e=_0x421b09[_0x9fcf('0x19')],_0x1629f0=_0x421b09['offset']+_0x421b09['limit'],_0x8c9f32;if(_0x1629f0>=_0x326bab){_0x1629f0=_0x326bab;_0x8c9f32=0xc8;}else{_0x8c9f32=0xce;}_0x3770de[_0x9fcf('0x15')](_0x8c9f32);return _0x3770de[_0x9fcf('0x1a')](_0x9fcf('0x1b'),_0x16361e+'-'+_0x1629f0+'/'+_0x326bab)['json'](_0x2098ba);}return null;};}function patchUpdates(_0x586720){return function(_0x5c86d2){try{jsonpatch['apply'](_0x5c86d2,_0x586720,!![]);}catch(_0x4d7831){return BPromise[_0x9fcf('0x1c')](_0x4d7831);}return _0x5c86d2[_0x9fcf('0x1d')]();};}function saveUpdates(_0x561e83,_0x2e510e){return function(_0x17c08b){if(_0x17c08b){return _0x17c08b[_0x9fcf('0x1e')](_0x561e83)[_0x9fcf('0x1f')](function(_0x49a2e1){return _0x49a2e1;});}return null;};}function removeEntity(_0x17b4a2,_0x299388){return function(_0x3f120d){if(_0x3f120d){return _0x3f120d[_0x9fcf('0x20')]()[_0x9fcf('0x1f')](function(){_0x17b4a2[_0x9fcf('0x15')](0xcc)[_0x9fcf('0x16')]();});}};}function handleEntityNotFound(_0x1cb7e8,_0xe210d1){return function(_0x569be8){if(!_0x569be8){_0x1cb7e8[_0x9fcf('0x14')](0x194);}return _0x569be8;};}function handleError(_0x4b0d30,_0x2ed827){_0x2ed827=_0x2ed827||0x1f4;return function(_0x4c3df2){logger['error'](_0x4c3df2['stack']);if(_0x4c3df2[_0x9fcf('0x21')]){delete _0x4c3df2[_0x9fcf('0x21')];}_0x4b0d30[_0x9fcf('0x15')](_0x2ed827)['send'](_0x4c3df2);};}exports[_0x9fcf('0x22')]=function(_0x208318,_0x349c93){var _0xfae4db={},_0x53426b={},_0x37c3f3={'count':0x0,'rows':[]};var _0x4ecee8=_['map'](db[_0x9fcf('0x23')][_0x9fcf('0x24')],function(_0x397ac3){return{'name':_0x397ac3['fieldName'],'type':_0x397ac3[_0x9fcf('0x25')][_0x9fcf('0x26')]};});_0x53426b[_0x9fcf('0x27')]=_['map'](_0x4ecee8,_0x9fcf('0x21'));_0x53426b[_0x9fcf('0x28')]=_[_0x9fcf('0x29')](_0x208318['query']);_0x53426b[_0x9fcf('0x2a')]=_['intersection'](_0x53426b[_0x9fcf('0x27')],_0x53426b[_0x9fcf('0x28')]);_0xfae4db['attributes']=_[_0x9fcf('0x2b')](_0x53426b[_0x9fcf('0x27')],qs[_0x9fcf('0x2c')](_0x208318[_0x9fcf('0x28')]['fields']));_0xfae4db[_0x9fcf('0x2d')]=_0xfae4db[_0x9fcf('0x2d')]['length']?_0xfae4db['attributes']:_0x53426b[_0x9fcf('0x27')];if(!_0x208318[_0x9fcf('0x28')][_0x9fcf('0x2e')](_0x9fcf('0x2f'))){_0xfae4db['limit']=qs[_0x9fcf('0x30')](_0x208318[_0x9fcf('0x28')][_0x9fcf('0x30')]);_0xfae4db[_0x9fcf('0x19')]=qs['offset'](_0x208318[_0x9fcf('0x28')][_0x9fcf('0x19')]);}_0xfae4db[_0x9fcf('0x31')]=qs['sort'](_0x208318[_0x9fcf('0x28')][_0x9fcf('0x32')]);_0xfae4db[_0x9fcf('0x33')]=qs[_0x9fcf('0x2a')](_[_0x9fcf('0x34')](_0x208318[_0x9fcf('0x28')],_0x53426b[_0x9fcf('0x2a')]),_0x4ecee8);if(_0x208318[_0x9fcf('0x28')][_0x9fcf('0x35')]){_0xfae4db['where']=_[_0x9fcf('0x36')](_0xfae4db[_0x9fcf('0x33')],{'$or':_[_0x9fcf('0x37')](_0x4ecee8,function(_0x2535ac){if(_0x2535ac[_0x9fcf('0x25')]!==_0x9fcf('0x38')){var _0x4e9da0={};_0x4e9da0[_0x2535ac[_0x9fcf('0x21')]]={'$like':'%'+_0x208318[_0x9fcf('0x28')][_0x9fcf('0x35')]+'%'};return _0x4e9da0;}})});}_0xfae4db=_[_0x9fcf('0x36')]({},_0xfae4db,_0x208318[_0x9fcf('0x39')]);var _0x3fec31={'where':_0xfae4db[_0x9fcf('0x33')]};return db[_0x9fcf('0x23')][_0x9fcf('0x18')](_0x3fec31)[_0x9fcf('0x1f')](function(_0x50404e){_0x37c3f3[_0x9fcf('0x18')]=_0x50404e;if(_0x208318[_0x9fcf('0x28')][_0x9fcf('0x3a')]){_0xfae4db[_0x9fcf('0x3b')]=[{'all':!![]}];}return db[_0x9fcf('0x23')]['findAll'](_0xfae4db);})[_0x9fcf('0x1f')](function(_0x53e5d3){_0x37c3f3['rows']=_0x53e5d3;return _0x37c3f3;})[_0x9fcf('0x1f')](respondWithFilteredResult(_0x349c93,_0xfae4db))[_0x9fcf('0x3c')](handleError(_0x349c93,null));};exports['show']=function(_0x341ec6,_0x4197a9){var _0x8fc2b5={'raw':!![],'where':{'id':_0x341ec6['params']['id']}},_0x33e171={};_0x33e171['model']=_[_0x9fcf('0x29')](db['VoiceQueuesLog']['rawAttributes']);_0x33e171['query']=_[_0x9fcf('0x29')](_0x341ec6[_0x9fcf('0x28')]);_0x33e171[_0x9fcf('0x2a')]=_[_0x9fcf('0x2b')](_0x33e171[_0x9fcf('0x27')],_0x33e171[_0x9fcf('0x28')]);_0x8fc2b5[_0x9fcf('0x2d')]=_[_0x9fcf('0x2b')](_0x33e171['model'],qs[_0x9fcf('0x2c')](_0x341ec6[_0x9fcf('0x28')][_0x9fcf('0x2c')]));_0x8fc2b5['attributes']=_0x8fc2b5['attributes']['length']?_0x8fc2b5[_0x9fcf('0x2d')]:_0x33e171[_0x9fcf('0x27')];if(_0x341ec6[_0x9fcf('0x28')][_0x9fcf('0x3a')]){_0x8fc2b5[_0x9fcf('0x3b')]=[{'all':!![]}];}_0x8fc2b5=_[_0x9fcf('0x36')]({},_0x8fc2b5,_0x341ec6[_0x9fcf('0x39')]);return db['VoiceQueuesLog']['find'](_0x8fc2b5)[_0x9fcf('0x1f')](handleEntityNotFound(_0x4197a9,null))[_0x9fcf('0x1f')](respondWithResult(_0x4197a9,null))['catch'](handleError(_0x4197a9,null));};exports['create']=function(_0x198f89,_0x224280){return db[_0x9fcf('0x23')]['create'](_0x198f89[_0x9fcf('0x3d')],{})[_0x9fcf('0x1f')](respondWithResult(_0x224280,0xc9))[_0x9fcf('0x3c')](handleError(_0x224280,null));};exports[_0x9fcf('0x1e')]=function(_0x45b4ea,_0x370d75){if(_0x45b4ea[_0x9fcf('0x3d')]['id']){delete _0x45b4ea['body']['id'];}return db[_0x9fcf('0x23')][_0x9fcf('0x3e')]({'where':{'id':_0x45b4ea[_0x9fcf('0x3f')]['id']}})[_0x9fcf('0x1f')](handleEntityNotFound(_0x370d75,null))[_0x9fcf('0x1f')](saveUpdates(_0x45b4ea[_0x9fcf('0x3d')],null))[_0x9fcf('0x1f')](respondWithResult(_0x370d75,null))[_0x9fcf('0x3c')](handleError(_0x370d75,null));};exports[_0x9fcf('0x20')]=function(_0x11ed57,_0x243f87){return db[_0x9fcf('0x23')][_0x9fcf('0x3e')]({'where':{'id':_0x11ed57[_0x9fcf('0x3f')]['id']}})[_0x9fcf('0x1f')](handleEntityNotFound(_0x243f87,null))['then'](removeEntity(_0x243f87,null))['catch'](handleError(_0x243f87,null));};
\ No newline at end of file
+var _0x413d=['sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','VoiceQueuesLog','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','name','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x21b47c,_0xac49e3){var _0x119133=function(_0x2b93c3){while(--_0x2b93c3){_0x21b47c['push'](_0x21b47c['shift']());}};_0x119133(++_0xac49e3);}(_0x413d,0x165));var _0xd413=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x413d[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xd413('0x0'));var rimraf=require(_0xd413('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd413('0x2'));var rp=require(_0xd413('0x3'));var moment=require(_0xd413('0x4'));var BPromise=require(_0xd413('0x5'));var Mustache=require(_0xd413('0x6'));var util=require(_0xd413('0x7'));var path=require(_0xd413('0x8'));var sox=require(_0xd413('0x9'));var csv=require('to-csv');var ejs=require(_0xd413('0xa'));var fs=require('fs');var fs_extra=require(_0xd413('0xb'));var _=require(_0xd413('0xc'));var squel=require(_0xd413('0xd'));var crypto=require(_0xd413('0xe'));var jsforce=require(_0xd413('0xf'));var deskjs=require(_0xd413('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd413('0x11'));var Papa=require(_0xd413('0x12'));var Redis=require(_0xd413('0x13'));var authService=require(_0xd413('0x14'));var qs=require(_0xd413('0x15'));var as=require(_0xd413('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd413('0x17'))(_0xd413('0x18'));var utils=require(_0xd413('0x19'));var config=require(_0xd413('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd413('0x1b'))['db'];function respondWithStatusCode(_0x40fff0,_0x431a38){_0x431a38=_0x431a38||0xcc;return function(_0x53beb8){if(_0x53beb8){return _0x40fff0[_0xd413('0x1c')](_0x431a38);}return _0x40fff0[_0xd413('0x1d')](_0x431a38)[_0xd413('0x1e')]();};}function respondWithResult(_0x8efa93,_0x43c231){_0x43c231=_0x43c231||0xc8;return function(_0x20c4b7){if(_0x20c4b7){return _0x8efa93[_0xd413('0x1d')](_0x43c231)[_0xd413('0x1f')](_0x20c4b7);}};}function respondWithFilteredResult(_0x116c5a,_0x2a9f6){return function(_0x2dcb82){if(_0x2dcb82){var _0x3174bf=typeof _0x2a9f6[_0xd413('0x20')]===_0xd413('0x21')&&typeof _0x2a9f6['limit']==='undefined';var _0x24b41f=_0x2dcb82['count'];var _0x127465=_0x3174bf?0x0:_0x2a9f6[_0xd413('0x20')];var _0x1527ac=_0x3174bf?_0x2dcb82[_0xd413('0x22')]:_0x2a9f6['offset']+_0x2a9f6['limit'];var _0xadbbbe;if(_0x1527ac>=_0x24b41f){_0x1527ac=_0x24b41f;_0xadbbbe=0xc8;}else{_0xadbbbe=0xce;}_0x116c5a['status'](_0xadbbbe);return _0x116c5a['set'](_0xd413('0x23'),_0x127465+'-'+_0x1527ac+'/'+_0x24b41f)['json'](_0x2dcb82);}return null;};}function patchUpdates(_0x4bd151){return function(_0x59a700){try{jsonpatch[_0xd413('0x24')](_0x59a700,_0x4bd151,!![]);}catch(_0x3949aa){return BPromise[_0xd413('0x25')](_0x3949aa);}return _0x59a700[_0xd413('0x26')]();};}function saveUpdates(_0x2887a3,_0x20e5e5){return function(_0x4ab101){if(_0x4ab101){return _0x4ab101[_0xd413('0x27')](_0x2887a3)[_0xd413('0x28')](function(_0x4b673b){return _0x4b673b;});}return null;};}function removeEntity(_0x50aaa2,_0xaab600){return function(_0x257d87){if(_0x257d87){return _0x257d87[_0xd413('0x29')]()[_0xd413('0x28')](function(){_0x50aaa2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf89855,_0x2a21ec){return function(_0x49a5ba){if(!_0x49a5ba){_0xf89855[_0xd413('0x1c')](0x194);}return _0x49a5ba;};}function handleError(_0x1ebb05,_0x45c88a){_0x45c88a=_0x45c88a||0x1f4;return function(_0x216a59){logger[_0xd413('0x2a')](_0x216a59[_0xd413('0x2b')]);if(_0x216a59['name']){delete _0x216a59['name'];}_0x1ebb05[_0xd413('0x1d')](_0x45c88a)['send'](_0x216a59);};}exports[_0xd413('0x2c')]=function(_0xea9363,_0x54d8f9){var _0x417d9f={},_0x94e80c={},_0x39249c={'count':0x0,'rows':[]};var _0x4f11e2=_[_0xd413('0x2d')](db[_0xd413('0x2e')][_0xd413('0x2f')],function(_0x231544){return{'name':_0x231544['fieldName'],'type':_0x231544[_0xd413('0x30')]['key']};});_0x94e80c[_0xd413('0x31')]=_[_0xd413('0x2d')](_0x4f11e2,'name');_0x94e80c[_0xd413('0x32')]=_[_0xd413('0x33')](_0xea9363[_0xd413('0x32')]);_0x94e80c[_0xd413('0x34')]=_[_0xd413('0x35')](_0x94e80c['model'],_0x94e80c[_0xd413('0x32')]);_0x417d9f[_0xd413('0x36')]=_[_0xd413('0x35')](_0x94e80c[_0xd413('0x31')],qs['fields'](_0xea9363[_0xd413('0x32')][_0xd413('0x37')]));_0x417d9f[_0xd413('0x36')]=_0x417d9f[_0xd413('0x36')][_0xd413('0x38')]?_0x417d9f[_0xd413('0x36')]:_0x94e80c[_0xd413('0x31')];if(!_0xea9363[_0xd413('0x32')][_0xd413('0x39')](_0xd413('0x3a'))){_0x417d9f[_0xd413('0x3b')]=qs['limit'](_0xea9363[_0xd413('0x32')][_0xd413('0x3b')]);_0x417d9f[_0xd413('0x20')]=qs[_0xd413('0x20')](_0xea9363[_0xd413('0x32')][_0xd413('0x20')]);}_0x417d9f[_0xd413('0x3c')]=qs[_0xd413('0x3d')](_0xea9363[_0xd413('0x32')]['sort']);_0x417d9f[_0xd413('0x3e')]=qs[_0xd413('0x34')](_[_0xd413('0x3f')](_0xea9363[_0xd413('0x32')],_0x94e80c['filters']),_0x4f11e2);if(_0xea9363[_0xd413('0x32')][_0xd413('0x40')]){_0x417d9f[_0xd413('0x3e')]=_[_0xd413('0x41')](_0x417d9f[_0xd413('0x3e')],{'$or':_['map'](_0x4f11e2,function(_0x4483df){if(_0x4483df[_0xd413('0x30')]!=='VIRTUAL'){var _0x42b925={};_0x42b925[_0x4483df[_0xd413('0x42')]]={'$like':'%'+_0xea9363[_0xd413('0x32')][_0xd413('0x40')]+'%'};return _0x42b925;}})});}_0x417d9f=_[_0xd413('0x41')]({},_0x417d9f,_0xea9363[_0xd413('0x43')]);var _0x29be41={'where':_0x417d9f['where']};return db[_0xd413('0x2e')][_0xd413('0x22')](_0x29be41)[_0xd413('0x28')](function(_0x53a4d6){_0x39249c[_0xd413('0x22')]=_0x53a4d6;if(_0xea9363['query'][_0xd413('0x44')]){_0x417d9f[_0xd413('0x45')]=[{'all':!![]}];}return db[_0xd413('0x2e')]['findAll'](_0x417d9f);})['then'](function(_0x17cd4b){_0x39249c[_0xd413('0x46')]=_0x17cd4b;return _0x39249c;})[_0xd413('0x28')](respondWithFilteredResult(_0x54d8f9,_0x417d9f))[_0xd413('0x47')](handleError(_0x54d8f9,null));};exports[_0xd413('0x48')]=function(_0xa47615,_0x101627){var _0x1d925c={'raw':!![],'where':{'id':_0xa47615[_0xd413('0x49')]['id']}},_0x347dab={};_0x347dab[_0xd413('0x31')]=_[_0xd413('0x33')](db[_0xd413('0x2e')]['rawAttributes']);_0x347dab[_0xd413('0x32')]=_[_0xd413('0x33')](_0xa47615[_0xd413('0x32')]);_0x347dab[_0xd413('0x34')]=_['intersection'](_0x347dab[_0xd413('0x31')],_0x347dab[_0xd413('0x32')]);_0x1d925c['attributes']=_['intersection'](_0x347dab['model'],qs[_0xd413('0x37')](_0xa47615[_0xd413('0x32')][_0xd413('0x37')]));_0x1d925c[_0xd413('0x36')]=_0x1d925c[_0xd413('0x36')][_0xd413('0x38')]?_0x1d925c[_0xd413('0x36')]:_0x347dab['model'];if(_0xa47615[_0xd413('0x32')][_0xd413('0x44')]){_0x1d925c[_0xd413('0x45')]=[{'all':!![]}];}_0x1d925c=_[_0xd413('0x41')]({},_0x1d925c,_0xa47615[_0xd413('0x43')]);return db['VoiceQueuesLog'][_0xd413('0x4a')](_0x1d925c)[_0xd413('0x28')](handleEntityNotFound(_0x101627,null))['then'](respondWithResult(_0x101627,null))[_0xd413('0x47')](handleError(_0x101627,null));};exports[_0xd413('0x4b')]=function(_0x46fdea,_0x16167c){return db[_0xd413('0x2e')][_0xd413('0x4b')](_0x46fdea['body'],{})[_0xd413('0x28')](respondWithResult(_0x16167c,0xc9))[_0xd413('0x47')](handleError(_0x16167c,null));};exports[_0xd413('0x27')]=function(_0x156b28,_0x2a3a91){if(_0x156b28[_0xd413('0x4c')]['id']){delete _0x156b28[_0xd413('0x4c')]['id'];}return db[_0xd413('0x2e')][_0xd413('0x4a')]({'where':{'id':_0x156b28[_0xd413('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a3a91,null))[_0xd413('0x28')](saveUpdates(_0x156b28['body'],null))['then'](respondWithResult(_0x2a3a91,null))[_0xd413('0x47')](handleError(_0x2a3a91,null));};exports[_0xd413('0x29')]=function(_0x291930,_0x29f7fe){return db[_0xd413('0x2e')][_0xd413('0x4a')]({'where':{'id':_0x291930[_0xd413('0x49')]['id']}})[_0xd413('0x28')](handleEntityNotFound(_0x29f7fe,null))['then'](removeEntity(_0x29f7fe,null))[_0xd413('0x47')](handleError(_0x29f7fe,null));};
\ No newline at end of file