Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.controller.js
index 65d3e09..ac8bd90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776f=['keys','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x776f,0x68));var _0xf776=function(_0x567ad7,_0x4f55e0){_0x567ad7=_0x567ad7-0x0;var _0x338c0e=_0x776f[_0x567ad7];return _0x338c0e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf776('0x0'));var zipdir=require(_0xf776('0x1'));var jsonpatch=require(_0xf776('0x2'));var rp=require(_0xf776('0x3'));var moment=require(_0xf776('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf776('0x5'));var util=require('util');var path=require(_0xf776('0x6'));var sox=require(_0xf776('0x7'));var csv=require('to-csv');var ejs=require(_0xf776('0x8'));var fs=require('fs');var _=require(_0xf776('0x9'));var squel=require('squel');var crypto=require(_0xf776('0xa'));var jsforce=require(_0xf776('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf776('0xc'));var querystring=require(_0xf776('0xd'));var Papa=require('papaparse');var Redis=require(_0xf776('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf776('0xf'));var as=require(_0xf776('0x10'));var hardwareService=require(_0xf776('0x11'));var logger=require(_0xf776('0x12'))(_0xf776('0x13'));var utils=require(_0xf776('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf776('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43ddb9,_0x1dc676){_0x1dc676=_0x1dc676||0xcc;return function(_0x3af2c3){if(_0x3af2c3){return _0x43ddb9['sendStatus'](_0x1dc676);}return _0x43ddb9[_0xf776('0x16')](_0x1dc676)['end']();};}function respondWithResult(_0x126991,_0x46b002){_0x46b002=_0x46b002||0xc8;return function(_0x24b946){if(_0x24b946){return _0x126991['status'](_0x46b002)['json'](_0x24b946);}};}function respondWithFilteredResult(_0x2eff1a,_0x288543){return function(_0x5740ff){if(_0x5740ff){var _0xcca8ef=_0x5740ff[_0xf776('0x17')],_0x4161f8=_0x288543[_0xf776('0x18')],_0x1c0f6b=_0x288543['offset']+_0x288543['limit'],_0xd5f3c2;if(_0x1c0f6b>=_0xcca8ef){_0x1c0f6b=_0xcca8ef;_0xd5f3c2=0xc8;}else{_0xd5f3c2=0xce;}_0x2eff1a[_0xf776('0x16')](_0xd5f3c2);return _0x2eff1a[_0xf776('0x19')](_0xf776('0x1a'),_0x4161f8+'-'+_0x1c0f6b+'/'+_0xcca8ef)[_0xf776('0x1b')](_0x5740ff);}return null;};}function patchUpdates(_0x5628b0){return function(_0x3dd749){try{jsonpatch[_0xf776('0x1c')](_0x3dd749,_0x5628b0,!![]);}catch(_0x34d876){return BPromise[_0xf776('0x1d')](_0x34d876);}return _0x3dd749[_0xf776('0x1e')]();};}function saveUpdates(_0x5bcb1f,_0x1abb03){return function(_0x4c7dc8){if(_0x4c7dc8){return _0x4c7dc8[_0xf776('0x1f')](_0x5bcb1f)[_0xf776('0x20')](function(_0x368684){return _0x368684;});}return null;};}function removeEntity(_0x3521e3,_0x54bc24){return function(_0x24fbf7){if(_0x24fbf7){return _0x24fbf7[_0xf776('0x21')]()[_0xf776('0x20')](function(){_0x3521e3[_0xf776('0x16')](0xcc)[_0xf776('0x22')]();});}};}function handleEntityNotFound(_0x23e01b,_0x12cebb){return function(_0x487d2a){if(!_0x487d2a){_0x23e01b[_0xf776('0x23')](0x194);}return _0x487d2a;};}function handleError(_0x3bd9a9,_0x1ebb90){_0x1ebb90=_0x1ebb90||0x1f4;return function(_0x43d056){logger[_0xf776('0x24')](_0x43d056['stack']);if(_0x43d056[_0xf776('0x25')]){delete _0x43d056[_0xf776('0x25')];}_0x3bd9a9[_0xf776('0x16')](_0x1ebb90)[_0xf776('0x26')](_0x43d056);};}exports[_0xf776('0x27')]=function(_0xc14b80,_0x15399e){var _0x223160={},_0x966847={},_0x9ea20={'count':0x0,'rows':[]};var _0x11ff73=_[_0xf776('0x28')](db[_0xf776('0x29')][_0xf776('0x2a')],function(_0x3ae8bc){return{'name':_0x3ae8bc[_0xf776('0x2b')],'type':_0x3ae8bc[_0xf776('0x2c')][_0xf776('0x2d')]};});_0x966847[_0xf776('0x2e')]=_[_0xf776('0x28')](_0x11ff73,_0xf776('0x25'));_0x966847[_0xf776('0x2f')]=_[_0xf776('0x30')](_0xc14b80['query']);_0x966847['filters']=_[_0xf776('0x31')](_0x966847[_0xf776('0x2e')],_0x966847[_0xf776('0x2f')]);_0x223160[_0xf776('0x32')]=_[_0xf776('0x31')](_0x966847['model'],qs['fields'](_0xc14b80[_0xf776('0x2f')]['fields']));_0x223160['attributes']=_0x223160[_0xf776('0x32')]['length']?_0x223160[_0xf776('0x32')]:_0x966847[_0xf776('0x2e')];if(!_0xc14b80[_0xf776('0x2f')][_0xf776('0x33')](_0xf776('0x34'))){_0x223160[_0xf776('0x35')]=qs['limit'](_0xc14b80[_0xf776('0x2f')][_0xf776('0x35')]);_0x223160['offset']=qs[_0xf776('0x18')](_0xc14b80[_0xf776('0x2f')][_0xf776('0x18')]);}_0x223160[_0xf776('0x36')]=qs['sort'](_0xc14b80[_0xf776('0x2f')][_0xf776('0x37')]);_0x223160[_0xf776('0x38')]=qs[_0xf776('0x39')](_[_0xf776('0x3a')](_0xc14b80[_0xf776('0x2f')],_0x966847[_0xf776('0x39')]),_0x11ff73);if(_0xc14b80[_0xf776('0x2f')][_0xf776('0x3b')]){_0x223160['where']=_[_0xf776('0x3c')](_0x223160['where'],{'$or':_[_0xf776('0x28')](_0x11ff73,function(_0xf07e03){if(_0xf07e03['type']!==_0xf776('0x3d')){var _0x2fce52={};_0x2fce52[_0xf07e03[_0xf776('0x25')]]={'$like':'%'+_0xc14b80[_0xf776('0x2f')][_0xf776('0x3b')]+'%'};return _0x2fce52;}})});}_0x223160=_[_0xf776('0x3c')]({},_0x223160,_0xc14b80[_0xf776('0x3e')]);var _0x46c262={'where':_0x223160[_0xf776('0x38')]};return db[_0xf776('0x29')][_0xf776('0x17')](_0x46c262)[_0xf776('0x20')](function(_0x38724e){_0x9ea20[_0xf776('0x17')]=_0x38724e;if(_0xc14b80[_0xf776('0x2f')][_0xf776('0x3f')]){_0x223160[_0xf776('0x40')]=[{'all':!![]}];}return db[_0xf776('0x29')][_0xf776('0x41')](_0x223160);})['then'](function(_0x5c4713){_0x9ea20[_0xf776('0x42')]=_0x5c4713;return _0x9ea20;})['then'](respondWithFilteredResult(_0x15399e,_0x223160))[_0xf776('0x43')](handleError(_0x15399e,null));};exports[_0xf776('0x44')]=function(_0x28925c,_0x362fb7){var _0x54df7c={'raw':!![],'where':{'id':_0x28925c['params']['id']}},_0x1e1910={};_0x1e1910[_0xf776('0x2e')]=_[_0xf776('0x30')](db[_0xf776('0x29')][_0xf776('0x2a')]);_0x1e1910[_0xf776('0x2f')]=_[_0xf776('0x30')](_0x28925c[_0xf776('0x2f')]);_0x1e1910['filters']=_[_0xf776('0x31')](_0x1e1910[_0xf776('0x2e')],_0x1e1910['query']);_0x54df7c[_0xf776('0x32')]=_[_0xf776('0x31')](_0x1e1910[_0xf776('0x2e')],qs[_0xf776('0x45')](_0x28925c[_0xf776('0x2f')][_0xf776('0x45')]));_0x54df7c[_0xf776('0x32')]=_0x54df7c[_0xf776('0x32')][_0xf776('0x46')]?_0x54df7c[_0xf776('0x32')]:_0x1e1910[_0xf776('0x2e')];if(_0x28925c[_0xf776('0x2f')][_0xf776('0x3f')]){_0x54df7c[_0xf776('0x40')]=[{'all':!![]}];}_0x54df7c=_['merge']({},_0x54df7c,_0x28925c[_0xf776('0x3e')]);return db['VoiceTransferReport'][_0xf776('0x47')](_0x54df7c)[_0xf776('0x20')](handleEntityNotFound(_0x362fb7,null))['then'](respondWithResult(_0x362fb7,null))[_0xf776('0x43')](handleError(_0x362fb7,null));};exports[_0xf776('0x48')]=function(_0x315fe6,_0x5121a2){return db['VoiceTransferReport'][_0xf776('0x48')](_0x315fe6['body'],{})[_0xf776('0x20')](respondWithResult(_0x5121a2,0xc9))[_0xf776('0x43')](handleError(_0x5121a2,null));};exports[_0xf776('0x1f')]=function(_0x1b207a,_0x38a69e){if(_0x1b207a[_0xf776('0x49')]['id']){delete _0x1b207a[_0xf776('0x49')]['id'];}return db[_0xf776('0x29')][_0xf776('0x47')]({'where':{'id':_0x1b207a[_0xf776('0x4a')]['id']}})[_0xf776('0x20')](handleEntityNotFound(_0x38a69e,null))[_0xf776('0x20')](saveUpdates(_0x1b207a[_0xf776('0x49')],null))[_0xf776('0x20')](respondWithResult(_0x38a69e,null))['catch'](handleError(_0x38a69e,null));};exports['destroy']=function(_0x1752e9,_0x41f67b){return db[_0xf776('0x29')][_0xf776('0x47')]({'where':{'id':_0x1752e9[_0xf776('0x4a')]['id']}})[_0xf776('0x20')](handleEntityNotFound(_0x41f67b,null))[_0xf776('0x20')](removeEntity(_0x41f67b,null))[_0xf776('0x43')](handleError(_0x41f67b,null));};exports[_0xf776('0x4b')]=function(_0x2af9cc,_0x159a72){return db[_0xf776('0x29')][_0xf776('0x4b')]()[_0xf776('0x20')](respondWithResult(_0x159a72,null))[_0xf776('0x43')](handleError(_0x159a72,null));};
\ No newline at end of file
+var _0x96a2=['find','body','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','VoiceTransferReport','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','nolimit','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params'];(function(_0x8c9e44,_0x1feffa){var _0x49eb7f=function(_0x21ac40){while(--_0x21ac40){_0x8c9e44['push'](_0x8c9e44['shift']());}};_0x49eb7f(++_0x1feffa);}(_0x96a2,0x1df));var _0x296a=function(_0x52a39a,_0xeb3cbc){_0x52a39a=_0x52a39a-0x0;var _0x2daa85=_0x96a2[_0x52a39a];return _0x2daa85;};'use strict';var pdf=require(_0x296a('0x0'));var emlformat=require(_0x296a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x296a('0x2'));var rp=require(_0x296a('0x3'));var moment=require('moment');var BPromise=require(_0x296a('0x4'));var Mustache=require(_0x296a('0x5'));var util=require('util');var path=require(_0x296a('0x6'));var sox=require(_0x296a('0x7'));var csv=require('to-csv');var ejs=require(_0x296a('0x8'));var fs=require('fs');var _=require(_0x296a('0x9'));var squel=require(_0x296a('0xa'));var crypto=require(_0x296a('0xb'));var jsforce=require(_0x296a('0xc'));var deskjs=require(_0x296a('0xd'));var toCsv=require(_0x296a('0xe'));var querystring=require(_0x296a('0xf'));var Papa=require(_0x296a('0x10'));var Redis=require(_0x296a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x296a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x296a('0x13'));var logger=require(_0x296a('0x14'))(_0x296a('0x15'));var utils=require(_0x296a('0x16'));var config=require(_0x296a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x296a('0x18'))['db'];function respondWithStatusCode(_0x34172c,_0x1b62d1){_0x1b62d1=_0x1b62d1||0xcc;return function(_0x58c85a){if(_0x58c85a){return _0x34172c['sendStatus'](_0x1b62d1);}return _0x34172c[_0x296a('0x19')](_0x1b62d1)[_0x296a('0x1a')]();};}function respondWithResult(_0x33bbfa,_0x761806){_0x761806=_0x761806||0xc8;return function(_0x1d2409){if(_0x1d2409){return _0x33bbfa[_0x296a('0x19')](_0x761806)[_0x296a('0x1b')](_0x1d2409);}};}function respondWithFilteredResult(_0x5b6474,_0x4275d6){return function(_0x12465e){if(_0x12465e){var _0x33663f=_0x12465e[_0x296a('0x1c')],_0x5b191f=_0x4275d6[_0x296a('0x1d')],_0x23af8c=_0x4275d6[_0x296a('0x1d')]+_0x4275d6[_0x296a('0x1e')],_0x32b27a;if(_0x23af8c>=_0x33663f){_0x23af8c=_0x33663f;_0x32b27a=0xc8;}else{_0x32b27a=0xce;}_0x5b6474['status'](_0x32b27a);return _0x5b6474[_0x296a('0x1f')](_0x296a('0x20'),_0x5b191f+'-'+_0x23af8c+'/'+_0x33663f)[_0x296a('0x1b')](_0x12465e);}return null;};}function patchUpdates(_0x1d15cf){return function(_0x1978cf){try{jsonpatch[_0x296a('0x21')](_0x1978cf,_0x1d15cf,!![]);}catch(_0x2f95e8){return BPromise['reject'](_0x2f95e8);}return _0x1978cf['save']();};}function saveUpdates(_0x36dfa2,_0xdf3f8d){return function(_0x765415){if(_0x765415){return _0x765415[_0x296a('0x22')](_0x36dfa2)[_0x296a('0x23')](function(_0x482bb8){return _0x482bb8;});}return null;};}function removeEntity(_0x2e8cb0,_0x12cbad){return function(_0x1f666c){if(_0x1f666c){return _0x1f666c[_0x296a('0x24')]()[_0x296a('0x23')](function(){_0x2e8cb0[_0x296a('0x19')](0xcc)[_0x296a('0x1a')]();});}};}function handleEntityNotFound(_0x58f446,_0x1a52da){return function(_0x5bf21a){if(!_0x5bf21a){_0x58f446['sendStatus'](0x194);}return _0x5bf21a;};}function handleError(_0x1eed56,_0x5ed7c8){_0x5ed7c8=_0x5ed7c8||0x1f4;return function(_0x47e438){logger[_0x296a('0x25')](_0x47e438['stack']);if(_0x47e438[_0x296a('0x26')]){delete _0x47e438['name'];}_0x1eed56[_0x296a('0x19')](_0x5ed7c8)[_0x296a('0x27')](_0x47e438);};}exports['index']=function(_0x35c8e2,_0x2f598a){var _0x549282={},_0x4bf8d4={},_0x5065e0={'count':0x0,'rows':[]};var _0x17d79f=_['map'](db[_0x296a('0x28')][_0x296a('0x29')],function(_0xfe2029){return{'name':_0xfe2029[_0x296a('0x2a')],'type':_0xfe2029['type'][_0x296a('0x2b')]};});_0x4bf8d4[_0x296a('0x2c')]=_[_0x296a('0x2d')](_0x17d79f,_0x296a('0x26'));_0x4bf8d4['query']=_[_0x296a('0x2e')](_0x35c8e2[_0x296a('0x2f')]);_0x4bf8d4['filters']=_['intersection'](_0x4bf8d4['model'],_0x4bf8d4[_0x296a('0x2f')]);_0x549282[_0x296a('0x30')]=_[_0x296a('0x31')](_0x4bf8d4[_0x296a('0x2c')],qs[_0x296a('0x32')](_0x35c8e2[_0x296a('0x2f')][_0x296a('0x32')]));_0x549282[_0x296a('0x30')]=_0x549282[_0x296a('0x30')]['length']?_0x549282['attributes']:_0x4bf8d4[_0x296a('0x2c')];if(!_0x35c8e2[_0x296a('0x2f')]['hasOwnProperty'](_0x296a('0x33'))){_0x549282[_0x296a('0x1e')]=qs[_0x296a('0x1e')](_0x35c8e2[_0x296a('0x2f')][_0x296a('0x1e')]);_0x549282[_0x296a('0x1d')]=qs[_0x296a('0x1d')](_0x35c8e2[_0x296a('0x2f')]['offset']);}_0x549282['order']=qs['sort'](_0x35c8e2[_0x296a('0x2f')]['sort']);_0x549282[_0x296a('0x34')]=qs['filters'](_[_0x296a('0x35')](_0x35c8e2[_0x296a('0x2f')],_0x4bf8d4['filters']),_0x17d79f);if(_0x35c8e2['query'][_0x296a('0x36')]){_0x549282['where']=_['merge'](_0x549282[_0x296a('0x34')],{'$or':_[_0x296a('0x2d')](_0x17d79f,function(_0x42163b){if(_0x42163b[_0x296a('0x37')]!==_0x296a('0x38')){var _0x1edb77={};_0x1edb77[_0x42163b['name']]={'$like':'%'+_0x35c8e2[_0x296a('0x2f')][_0x296a('0x36')]+'%'};return _0x1edb77;}})});}_0x549282=_[_0x296a('0x39')]({},_0x549282,_0x35c8e2[_0x296a('0x3a')]);var _0x3f2880={'where':_0x549282['where']};return db[_0x296a('0x28')]['count'](_0x3f2880)['then'](function(_0x1006bb){_0x5065e0['count']=_0x1006bb;if(_0x35c8e2[_0x296a('0x2f')][_0x296a('0x3b')]){_0x549282[_0x296a('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x549282);})[_0x296a('0x23')](function(_0x40eb26){_0x5065e0[_0x296a('0x3d')]=_0x40eb26;return _0x5065e0;})[_0x296a('0x23')](respondWithFilteredResult(_0x2f598a,_0x549282))[_0x296a('0x3e')](handleError(_0x2f598a,null));};exports[_0x296a('0x3f')]=function(_0x22b77b,_0x112094){var _0x5037d4={'raw':!![],'where':{'id':_0x22b77b[_0x296a('0x40')]['id']}},_0x107ac2={};_0x107ac2[_0x296a('0x2c')]=_[_0x296a('0x2e')](db[_0x296a('0x28')][_0x296a('0x29')]);_0x107ac2[_0x296a('0x2f')]=_[_0x296a('0x2e')](_0x22b77b[_0x296a('0x2f')]);_0x107ac2['filters']=_['intersection'](_0x107ac2[_0x296a('0x2c')],_0x107ac2[_0x296a('0x2f')]);_0x5037d4['attributes']=_['intersection'](_0x107ac2[_0x296a('0x2c')],qs['fields'](_0x22b77b[_0x296a('0x2f')]['fields']));_0x5037d4[_0x296a('0x30')]=_0x5037d4['attributes']['length']?_0x5037d4[_0x296a('0x30')]:_0x107ac2[_0x296a('0x2c')];if(_0x22b77b[_0x296a('0x2f')][_0x296a('0x3b')]){_0x5037d4[_0x296a('0x3c')]=[{'all':!![]}];}_0x5037d4=_[_0x296a('0x39')]({},_0x5037d4,_0x22b77b[_0x296a('0x3a')]);return db[_0x296a('0x28')][_0x296a('0x41')](_0x5037d4)[_0x296a('0x23')](handleEntityNotFound(_0x112094,null))['then'](respondWithResult(_0x112094,null))[_0x296a('0x3e')](handleError(_0x112094,null));};exports['create']=function(_0x2e7393,_0x50c2f1){return db[_0x296a('0x28')]['create'](_0x2e7393[_0x296a('0x42')],{})[_0x296a('0x23')](respondWithResult(_0x50c2f1,0xc9))[_0x296a('0x3e')](handleError(_0x50c2f1,null));};exports['update']=function(_0x3707fd,_0x4a7c96){if(_0x3707fd[_0x296a('0x42')]['id']){delete _0x3707fd[_0x296a('0x42')]['id'];}return db['VoiceTransferReport'][_0x296a('0x41')]({'where':{'id':_0x3707fd['params']['id']}})['then'](handleEntityNotFound(_0x4a7c96,null))[_0x296a('0x23')](saveUpdates(_0x3707fd[_0x296a('0x42')],null))[_0x296a('0x23')](respondWithResult(_0x4a7c96,null))[_0x296a('0x3e')](handleError(_0x4a7c96,null));};exports[_0x296a('0x24')]=function(_0x5e8051,_0x481afb){return db[_0x296a('0x28')][_0x296a('0x41')]({'where':{'id':_0x5e8051[_0x296a('0x40')]['id']}})[_0x296a('0x23')](handleEntityNotFound(_0x481afb,null))[_0x296a('0x23')](removeEntity(_0x481afb,null))[_0x296a('0x3e')](handleError(_0x481afb,null));};exports[_0x296a('0x43')]=function(_0x5bae8f,_0x10a256){return db[_0x296a('0x28')][_0x296a('0x43')]()[_0x296a('0x23')](respondWithResult(_0x10a256,null))[_0x296a('0x3e')](handleError(_0x10a256,null));};
\ No newline at end of file