Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.controller.js
index 8c44f32..2728ccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a89=['end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','params','keys','length','options','find','body','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','save','update','destroy','then'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0x5a89,0x184));var _0x95a8=function(_0x4e9b47,_0x3bd831){_0x4e9b47=_0x4e9b47-0x0;var _0x480059=_0x5a89[_0x4e9b47];return _0x480059;};'use strict';var pdf=require(_0x95a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x95a8('0x1'));var zipdir=require(_0x95a8('0x2'));var jsonpatch=require(_0x95a8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95a8('0x4'));var Mustache=require('mustache');var util=require(_0x95a8('0x5'));var path=require(_0x95a8('0x6'));var sox=require(_0x95a8('0x7'));var csv=require(_0x95a8('0x8'));var ejs=require(_0x95a8('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x95a8('0xa'));var jsforce=require(_0x95a8('0xb'));var deskjs=require(_0x95a8('0xc'));var toCsv=require(_0x95a8('0x8'));var querystring=require(_0x95a8('0xd'));var Papa=require('papaparse');var Redis=require(_0x95a8('0xe'));var authService=require(_0x95a8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95a8('0x10'));var logger=require(_0x95a8('0x11'))('api');var utils=require(_0x95a8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x95a8('0x13'));var db=require(_0x95a8('0x14'))['db'];function respondWithStatusCode(_0x3c00ca,_0x1c0987){_0x1c0987=_0x1c0987||0xcc;return function(_0x9223c){if(_0x9223c){return _0x3c00ca[_0x95a8('0x15')](_0x1c0987);}return _0x3c00ca[_0x95a8('0x16')](_0x1c0987)['end']();};}function respondWithResult(_0x4b60c8,_0x485c13){_0x485c13=_0x485c13||0xc8;return function(_0x5509f7){if(_0x5509f7){return _0x4b60c8[_0x95a8('0x16')](_0x485c13)[_0x95a8('0x17')](_0x5509f7);}};}function respondWithFilteredResult(_0x62e69e,_0x2c8818){return function(_0x581e69){if(_0x581e69){var _0x38ccaa=_0x581e69['count'],_0x277942=_0x2c8818[_0x95a8('0x18')],_0x3f9361=_0x2c8818['offset']+_0x2c8818[_0x95a8('0x19')],_0x25ba6f;if(_0x3f9361>=_0x38ccaa){_0x3f9361=_0x38ccaa;_0x25ba6f=0xc8;}else{_0x25ba6f=0xce;}_0x62e69e[_0x95a8('0x16')](_0x25ba6f);return _0x62e69e['set'](_0x95a8('0x1a'),_0x277942+'-'+_0x3f9361+'/'+_0x38ccaa)[_0x95a8('0x17')](_0x581e69);}return null;};}function patchUpdates(_0x328e63){return function(_0x5046ff){try{jsonpatch['apply'](_0x5046ff,_0x328e63,!![]);}catch(_0x335ef2){return BPromise[_0x95a8('0x1b')](_0x335ef2);}return _0x5046ff[_0x95a8('0x1c')]();};}function saveUpdates(_0x2ede60,_0x53e84b){return function(_0x2d4a2c){if(_0x2d4a2c){return _0x2d4a2c[_0x95a8('0x1d')](_0x2ede60)['then'](function(_0x1d184c){return _0x1d184c;});}return null;};}function removeEntity(_0x4b4bab,_0x49c65c){return function(_0x2c47d1){if(_0x2c47d1){return _0x2c47d1[_0x95a8('0x1e')]()[_0x95a8('0x1f')](function(){_0x4b4bab[_0x95a8('0x16')](0xcc)[_0x95a8('0x20')]();});}};}function handleEntityNotFound(_0x263b49,_0x14189b){return function(_0x4175af){if(!_0x4175af){_0x263b49[_0x95a8('0x15')](0x194);}return _0x4175af;};}function handleError(_0x1e3ca0,_0x6ce4f0){_0x6ce4f0=_0x6ce4f0||0x1f4;return function(_0xd64e47){logger[_0x95a8('0x21')](_0xd64e47[_0x95a8('0x22')]);if(_0xd64e47[_0x95a8('0x23')]){delete _0xd64e47[_0x95a8('0x23')];}_0x1e3ca0[_0x95a8('0x16')](_0x6ce4f0)[_0x95a8('0x24')](_0xd64e47);};}exports[_0x95a8('0x25')]=function(_0x1f45c4,_0x260186){var _0x3a5520={},_0x38ab87={},_0x4622e7={'count':0x0,'rows':[]};var _0x22282b=_[_0x95a8('0x26')](db[_0x95a8('0x27')][_0x95a8('0x28')],function(_0x4fc6d7){return{'name':_0x4fc6d7[_0x95a8('0x29')],'type':_0x4fc6d7['type'][_0x95a8('0x2a')]};});_0x38ab87[_0x95a8('0x2b')]=_[_0x95a8('0x26')](_0x22282b,_0x95a8('0x23'));_0x38ab87['query']=_['keys'](_0x1f45c4[_0x95a8('0x2c')]);_0x38ab87[_0x95a8('0x2d')]=_[_0x95a8('0x2e')](_0x38ab87[_0x95a8('0x2b')],_0x38ab87[_0x95a8('0x2c')]);_0x3a5520[_0x95a8('0x2f')]=_['intersection'](_0x38ab87[_0x95a8('0x2b')],qs[_0x95a8('0x30')](_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x30')]));_0x3a5520['attributes']=_0x3a5520['attributes']['length']?_0x3a5520[_0x95a8('0x2f')]:_0x38ab87['model'];if(!_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x31')](_0x95a8('0x32'))){_0x3a5520['limit']=qs[_0x95a8('0x19')](_0x1f45c4[_0x95a8('0x2c')]['limit']);_0x3a5520[_0x95a8('0x18')]=qs['offset'](_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x18')]);}_0x3a5520['order']=qs[_0x95a8('0x33')](_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x33')]);_0x3a5520[_0x95a8('0x34')]=qs['filters'](_[_0x95a8('0x35')](_0x1f45c4[_0x95a8('0x2c')],_0x38ab87[_0x95a8('0x2d')]),_0x22282b);if(_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x36')]){_0x3a5520[_0x95a8('0x34')]=_['merge'](_0x3a5520['where'],{'$or':_[_0x95a8('0x26')](_0x22282b,function(_0x6d3414){if(_0x6d3414[_0x95a8('0x37')]!==_0x95a8('0x38')){var _0x3df201={};_0x3df201[_0x6d3414[_0x95a8('0x23')]]={'$like':'%'+_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x36')]+'%'};return _0x3df201;}})});}_0x3a5520=_[_0x95a8('0x39')]({},_0x3a5520,_0x1f45c4['options']);var _0x441414={'where':_0x3a5520[_0x95a8('0x34')]};return db[_0x95a8('0x27')][_0x95a8('0x3a')](_0x441414)[_0x95a8('0x1f')](function(_0x1ab276){_0x4622e7[_0x95a8('0x3a')]=_0x1ab276;if(_0x1f45c4[_0x95a8('0x2c')][_0x95a8('0x3b')]){_0x3a5520[_0x95a8('0x3c')]=[{'all':!![]}];}return db[_0x95a8('0x27')][_0x95a8('0x3d')](_0x3a5520);})[_0x95a8('0x1f')](function(_0x1ba071){_0x4622e7['rows']=_0x1ba071;return _0x4622e7;})[_0x95a8('0x1f')](respondWithFilteredResult(_0x260186,_0x3a5520))[_0x95a8('0x3e')](handleError(_0x260186,null));};exports[_0x95a8('0x3f')]=function(_0x3066f1,_0x2983cf){var _0x42dd31={'raw':!![],'where':{'id':_0x3066f1[_0x95a8('0x40')]['id']}},_0x1c0adf={};_0x1c0adf[_0x95a8('0x2b')]=_[_0x95a8('0x41')](db[_0x95a8('0x27')][_0x95a8('0x28')]);_0x1c0adf[_0x95a8('0x2c')]=_[_0x95a8('0x41')](_0x3066f1[_0x95a8('0x2c')]);_0x1c0adf[_0x95a8('0x2d')]=_[_0x95a8('0x2e')](_0x1c0adf[_0x95a8('0x2b')],_0x1c0adf[_0x95a8('0x2c')]);_0x42dd31[_0x95a8('0x2f')]=_[_0x95a8('0x2e')](_0x1c0adf[_0x95a8('0x2b')],qs[_0x95a8('0x30')](_0x3066f1[_0x95a8('0x2c')]['fields']));_0x42dd31[_0x95a8('0x2f')]=_0x42dd31[_0x95a8('0x2f')][_0x95a8('0x42')]?_0x42dd31[_0x95a8('0x2f')]:_0x1c0adf[_0x95a8('0x2b')];if(_0x3066f1['query'][_0x95a8('0x3b')]){_0x42dd31[_0x95a8('0x3c')]=[{'all':!![]}];}_0x42dd31=_[_0x95a8('0x39')]({},_0x42dd31,_0x3066f1[_0x95a8('0x43')]);return db[_0x95a8('0x27')][_0x95a8('0x44')](_0x42dd31)[_0x95a8('0x1f')](handleEntityNotFound(_0x2983cf,null))[_0x95a8('0x1f')](respondWithResult(_0x2983cf,null))['catch'](handleError(_0x2983cf,null));};exports['create']=function(_0x3aac7a,_0x5572ef){return db[_0x95a8('0x27')]['create'](_0x3aac7a['body'],{})['then'](respondWithResult(_0x5572ef,0xc9))[_0x95a8('0x3e')](handleError(_0x5572ef,null));};exports[_0x95a8('0x1d')]=function(_0x3279b4,_0x1b9cf6){if(_0x3279b4[_0x95a8('0x45')]['id']){delete _0x3279b4[_0x95a8('0x45')]['id'];}return db[_0x95a8('0x27')][_0x95a8('0x44')]({'where':{'id':_0x3279b4[_0x95a8('0x40')]['id']}})[_0x95a8('0x1f')](handleEntityNotFound(_0x1b9cf6,null))[_0x95a8('0x1f')](saveUpdates(_0x3279b4[_0x95a8('0x45')],null))['then'](respondWithResult(_0x1b9cf6,null))[_0x95a8('0x3e')](handleError(_0x1b9cf6,null));};exports[_0x95a8('0x1e')]=function(_0x2242e6,_0x2b54c8){return db['VoiceTransferReport'][_0x95a8('0x44')]({'where':{'id':_0x2242e6['params']['id']}})[_0x95a8('0x1f')](handleEntityNotFound(_0x2b54c8,null))[_0x95a8('0x1f')](removeEntity(_0x2b54c8,null))['catch'](handleError(_0x2b54c8,null));};
\ No newline at end of file
+var _0x88b7=['find','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','count','includeAll','include','findAll','rows','catch','show','intersection'];(function(_0x4cd733,_0x43d616){var _0x47290a=function(_0x22b57b){while(--_0x22b57b){_0x4cd733['push'](_0x4cd733['shift']());}};_0x47290a(++_0x43d616);}(_0x88b7,0x13f));var _0x788b=function(_0x278e80,_0x17bcc9){_0x278e80=_0x278e80-0x0;var _0x13f0d7=_0x88b7[_0x278e80];return _0x13f0d7;};'use strict';var pdf=require(_0x788b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x788b('0x1'));var zipdir=require(_0x788b('0x2'));var jsonpatch=require(_0x788b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x788b('0x4'));var util=require(_0x788b('0x5'));var path=require(_0x788b('0x6'));var sox=require(_0x788b('0x7'));var csv=require(_0x788b('0x8'));var ejs=require(_0x788b('0x9'));var fs=require('fs');var _=require(_0x788b('0xa'));var squel=require(_0x788b('0xb'));var crypto=require(_0x788b('0xc'));var jsforce=require(_0x788b('0xd'));var deskjs=require(_0x788b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x788b('0xf'));var Papa=require(_0x788b('0x10'));var Redis=require(_0x788b('0x11'));var authService=require(_0x788b('0x12'));var qs=require(_0x788b('0x13'));var as=require(_0x788b('0x14'));var hardwareService=require(_0x788b('0x15'));var logger=require(_0x788b('0x16'))(_0x788b('0x17'));var utils=require('../../config/utils');var config=require(_0x788b('0x18'));var licenseUtil=require(_0x788b('0x19'));var db=require(_0x788b('0x1a'))['db'];function respondWithStatusCode(_0xdfba6d,_0xddabaf){_0xddabaf=_0xddabaf||0xcc;return function(_0x5b4daf){if(_0x5b4daf){return _0xdfba6d[_0x788b('0x1b')](_0xddabaf);}return _0xdfba6d[_0x788b('0x1c')](_0xddabaf)[_0x788b('0x1d')]();};}function respondWithResult(_0x3deaae,_0x349603){_0x349603=_0x349603||0xc8;return function(_0x28b95a){if(_0x28b95a){return _0x3deaae[_0x788b('0x1c')](_0x349603)[_0x788b('0x1e')](_0x28b95a);}};}function respondWithFilteredResult(_0x8bdd22,_0x5e8299){return function(_0x9edee9){if(_0x9edee9){var _0x42080c=_0x9edee9['count'],_0x32789d=_0x5e8299[_0x788b('0x1f')],_0x5ded52=_0x5e8299[_0x788b('0x1f')]+_0x5e8299[_0x788b('0x20')],_0x9ce17f;if(_0x5ded52>=_0x42080c){_0x5ded52=_0x42080c;_0x9ce17f=0xc8;}else{_0x9ce17f=0xce;}_0x8bdd22['status'](_0x9ce17f);return _0x8bdd22[_0x788b('0x21')](_0x788b('0x22'),_0x32789d+'-'+_0x5ded52+'/'+_0x42080c)[_0x788b('0x1e')](_0x9edee9);}return null;};}function patchUpdates(_0x48ce5a){return function(_0x3e4c58){try{jsonpatch[_0x788b('0x23')](_0x3e4c58,_0x48ce5a,!![]);}catch(_0x4db890){return BPromise[_0x788b('0x24')](_0x4db890);}return _0x3e4c58[_0x788b('0x25')]();};}function saveUpdates(_0x502b4b,_0x5863ed){return function(_0x96504f){if(_0x96504f){return _0x96504f[_0x788b('0x26')](_0x502b4b)['then'](function(_0xc71202){return _0xc71202;});}return null;};}function removeEntity(_0x38453f,_0x147224){return function(_0x35ebab){if(_0x35ebab){return _0x35ebab[_0x788b('0x27')]()['then'](function(){_0x38453f[_0x788b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a0c19,_0x26277c){return function(_0x217f79){if(!_0x217f79){_0x3a0c19[_0x788b('0x1b')](0x194);}return _0x217f79;};}function handleError(_0x418465,_0x350027){_0x350027=_0x350027||0x1f4;return function(_0x5ade84){logger['error'](_0x5ade84[_0x788b('0x28')]);if(_0x5ade84[_0x788b('0x29')]){delete _0x5ade84[_0x788b('0x29')];}_0x418465[_0x788b('0x1c')](_0x350027)[_0x788b('0x2a')](_0x5ade84);};}exports[_0x788b('0x2b')]=function(_0x218716,_0x57e80f){var _0x36aab0={},_0x1dbeda={},_0x137a24={'count':0x0,'rows':[]};var _0x54ab50=_[_0x788b('0x2c')](db[_0x788b('0x2d')][_0x788b('0x2e')],function(_0x4483c1){return{'name':_0x4483c1[_0x788b('0x2f')],'type':_0x4483c1[_0x788b('0x30')][_0x788b('0x31')]};});_0x1dbeda['model']=_[_0x788b('0x2c')](_0x54ab50,_0x788b('0x29'));_0x1dbeda[_0x788b('0x32')]=_[_0x788b('0x33')](_0x218716[_0x788b('0x32')]);_0x1dbeda[_0x788b('0x34')]=_['intersection'](_0x1dbeda[_0x788b('0x35')],_0x1dbeda[_0x788b('0x32')]);_0x36aab0[_0x788b('0x36')]=_['intersection'](_0x1dbeda[_0x788b('0x35')],qs[_0x788b('0x37')](_0x218716[_0x788b('0x32')][_0x788b('0x37')]));_0x36aab0[_0x788b('0x36')]=_0x36aab0['attributes'][_0x788b('0x38')]?_0x36aab0[_0x788b('0x36')]:_0x1dbeda[_0x788b('0x35')];if(!_0x218716['query'][_0x788b('0x39')](_0x788b('0x3a'))){_0x36aab0['limit']=qs[_0x788b('0x20')](_0x218716[_0x788b('0x32')][_0x788b('0x20')]);_0x36aab0[_0x788b('0x1f')]=qs[_0x788b('0x1f')](_0x218716[_0x788b('0x32')][_0x788b('0x1f')]);}_0x36aab0[_0x788b('0x3b')]=qs[_0x788b('0x3c')](_0x218716[_0x788b('0x32')][_0x788b('0x3c')]);_0x36aab0['where']=qs[_0x788b('0x34')](_[_0x788b('0x3d')](_0x218716['query'],_0x1dbeda['filters']),_0x54ab50);if(_0x218716[_0x788b('0x32')][_0x788b('0x3e')]){_0x36aab0['where']=_['merge'](_0x36aab0[_0x788b('0x3f')],{'$or':_[_0x788b('0x2c')](_0x54ab50,function(_0x41740c){if(_0x41740c[_0x788b('0x30')]!==_0x788b('0x40')){var _0x480de1={};_0x480de1[_0x41740c[_0x788b('0x29')]]={'$like':'%'+_0x218716['query'][_0x788b('0x3e')]+'%'};return _0x480de1;}})});}_0x36aab0=_[_0x788b('0x41')]({},_0x36aab0,_0x218716[_0x788b('0x42')]);var _0x245087={'where':_0x36aab0[_0x788b('0x3f')]};return db[_0x788b('0x2d')]['count'](_0x245087)[_0x788b('0x43')](function(_0x10e27c){_0x137a24[_0x788b('0x44')]=_0x10e27c;if(_0x218716['query'][_0x788b('0x45')]){_0x36aab0[_0x788b('0x46')]=[{'all':!![]}];}return db[_0x788b('0x2d')][_0x788b('0x47')](_0x36aab0);})[_0x788b('0x43')](function(_0x2df5a3){_0x137a24[_0x788b('0x48')]=_0x2df5a3;return _0x137a24;})[_0x788b('0x43')](respondWithFilteredResult(_0x57e80f,_0x36aab0))[_0x788b('0x49')](handleError(_0x57e80f,null));};exports[_0x788b('0x4a')]=function(_0x5b2cc9,_0x359538){var _0x2356ef={'raw':!![],'where':{'id':_0x5b2cc9['params']['id']}},_0x49700d={};_0x49700d[_0x788b('0x35')]=_[_0x788b('0x33')](db[_0x788b('0x2d')]['rawAttributes']);_0x49700d[_0x788b('0x32')]=_[_0x788b('0x33')](_0x5b2cc9[_0x788b('0x32')]);_0x49700d['filters']=_[_0x788b('0x4b')](_0x49700d[_0x788b('0x35')],_0x49700d['query']);_0x2356ef[_0x788b('0x36')]=_[_0x788b('0x4b')](_0x49700d[_0x788b('0x35')],qs['fields'](_0x5b2cc9[_0x788b('0x32')][_0x788b('0x37')]));_0x2356ef['attributes']=_0x2356ef[_0x788b('0x36')][_0x788b('0x38')]?_0x2356ef['attributes']:_0x49700d[_0x788b('0x35')];if(_0x5b2cc9[_0x788b('0x32')][_0x788b('0x45')]){_0x2356ef[_0x788b('0x46')]=[{'all':!![]}];}_0x2356ef=_['merge']({},_0x2356ef,_0x5b2cc9[_0x788b('0x42')]);return db[_0x788b('0x2d')][_0x788b('0x4c')](_0x2356ef)[_0x788b('0x43')](handleEntityNotFound(_0x359538,null))[_0x788b('0x43')](respondWithResult(_0x359538,null))[_0x788b('0x49')](handleError(_0x359538,null));};exports['create']=function(_0x1f28e8,_0x166e2f){return db[_0x788b('0x2d')]['create'](_0x1f28e8['body'],{})[_0x788b('0x43')](respondWithResult(_0x166e2f,0xc9))[_0x788b('0x49')](handleError(_0x166e2f,null));};exports[_0x788b('0x26')]=function(_0xfac483,_0x6c06f0){if(_0xfac483[_0x788b('0x4d')]['id']){delete _0xfac483[_0x788b('0x4d')]['id'];}return db[_0x788b('0x2d')]['find']({'where':{'id':_0xfac483[_0x788b('0x4e')]['id']}})[_0x788b('0x43')](handleEntityNotFound(_0x6c06f0,null))[_0x788b('0x43')](saveUpdates(_0xfac483[_0x788b('0x4d')],null))[_0x788b('0x43')](respondWithResult(_0x6c06f0,null))[_0x788b('0x49')](handleError(_0x6c06f0,null));};exports[_0x788b('0x27')]=function(_0x2153e4,_0x540b2c){return db[_0x788b('0x2d')]['find']({'where':{'id':_0x2153e4['params']['id']}})[_0x788b('0x43')](handleEntityNotFound(_0x540b2c,null))[_0x788b('0x43')](removeEntity(_0x540b2c,null))['catch'](handleError(_0x540b2c,null));};
\ No newline at end of file