Built motion from commit (unavailable).|2.5.17
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.controller.js
index 9f19219..9a6d1e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f67=['fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','set','json','save','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes'];(function(_0x1e2447,_0x5fea89){var _0x306f03=function(_0x11ac2c){while(--_0x11ac2c){_0x1e2447['push'](_0x1e2447['shift']());}};_0x306f03(++_0x5fea89);}(_0x2f67,0x9f));var _0x72f6=function(_0x2ef663,_0x3baaa8){_0x2ef663=_0x2ef663-0x0;var _0x290093=_0x2f67[_0x2ef663];return _0x290093;};'use strict';var pdf=require(_0x72f6('0x0'));var emlformat=require(_0x72f6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x72f6('0x2'));var jsonpatch=require(_0x72f6('0x3'));var rp=require(_0x72f6('0x4'));var moment=require(_0x72f6('0x5'));var BPromise=require(_0x72f6('0x6'));var Mustache=require(_0x72f6('0x7'));var util=require(_0x72f6('0x8'));var path=require('path');var sox=require(_0x72f6('0x9'));var csv=require(_0x72f6('0xa'));var ejs=require(_0x72f6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x72f6('0xc'));var crypto=require(_0x72f6('0xd'));var jsforce=require(_0x72f6('0xe'));var deskjs=require(_0x72f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x72f6('0x10'));var Papa=require(_0x72f6('0x11'));var Redis=require(_0x72f6('0x12'));var authService=require(_0x72f6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72f6('0x14'));var logger=require('../../config/logger')(_0x72f6('0x15'));var utils=require(_0x72f6('0x16'));var config=require(_0x72f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cc0f3,_0x1bdd3d){_0x1bdd3d=_0x1bdd3d||0xcc;return function(_0x5afa8f){if(_0x5afa8f){return _0x3cc0f3[_0x72f6('0x18')](_0x1bdd3d);}return _0x3cc0f3['status'](_0x1bdd3d)[_0x72f6('0x19')]();};}function respondWithResult(_0x382e9d,_0xcbd50){_0xcbd50=_0xcbd50||0xc8;return function(_0x3ef3b4){if(_0x3ef3b4){return _0x382e9d[_0x72f6('0x1a')](_0xcbd50)['json'](_0x3ef3b4);}};}function respondWithFilteredResult(_0x4ccf4f,_0x217818){return function(_0x36eb77){if(_0x36eb77){var _0x4c6887=_0x36eb77['count'],_0x51f424=_0x217818[_0x72f6('0x1b')],_0x545339=_0x217818['offset']+_0x217818['limit'],_0x143566;if(_0x545339>=_0x4c6887){_0x545339=_0x4c6887;_0x143566=0xc8;}else{_0x143566=0xce;}_0x4ccf4f[_0x72f6('0x1a')](_0x143566);return _0x4ccf4f[_0x72f6('0x1c')]('Content-Range',_0x51f424+'-'+_0x545339+'/'+_0x4c6887)[_0x72f6('0x1d')](_0x36eb77);}return null;};}function patchUpdates(_0x51651f){return function(_0x63fd64){try{jsonpatch['apply'](_0x63fd64,_0x51651f,!![]);}catch(_0xa63218){return BPromise['reject'](_0xa63218);}return _0x63fd64[_0x72f6('0x1e')]();};}function saveUpdates(_0x549f28,_0x1c427c){return function(_0x593716){if(_0x593716){return _0x593716['update'](_0x549f28)['then'](function(_0x5c2aa7){return _0x5c2aa7;});}return null;};}function removeEntity(_0x51b0c7,_0x50c89a){return function(_0xb75894){if(_0xb75894){return _0xb75894[_0x72f6('0x1f')]()[_0x72f6('0x20')](function(){_0x51b0c7[_0x72f6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb8a4,_0x57a02d){return function(_0x7c4024){if(!_0x7c4024){_0x1cb8a4[_0x72f6('0x18')](0x194);}return _0x7c4024;};}function handleError(_0x4a87f1,_0xa08864){_0xa08864=_0xa08864||0x1f4;return function(_0x583804){logger[_0x72f6('0x21')](_0x583804[_0x72f6('0x22')]);if(_0x583804[_0x72f6('0x23')]){delete _0x583804[_0x72f6('0x23')];}_0x4a87f1[_0x72f6('0x1a')](_0xa08864)['send'](_0x583804);};}exports[_0x72f6('0x24')]=function(_0x45e3bb,_0x55b87a){var _0x32efea={},_0x14829d={},_0x197fb9={'count':0x0,'rows':[]};var _0x52da2a=_[_0x72f6('0x25')](db[_0x72f6('0x26')][_0x72f6('0x27')],function(_0x4da2ff){return{'name':_0x4da2ff[_0x72f6('0x28')],'type':_0x4da2ff['type'][_0x72f6('0x29')]};});_0x14829d['model']=_[_0x72f6('0x25')](_0x52da2a,_0x72f6('0x23'));_0x14829d['query']=_[_0x72f6('0x2a')](_0x45e3bb[_0x72f6('0x2b')]);_0x14829d[_0x72f6('0x2c')]=_[_0x72f6('0x2d')](_0x14829d[_0x72f6('0x2e')],_0x14829d[_0x72f6('0x2b')]);_0x32efea[_0x72f6('0x2f')]=_[_0x72f6('0x2d')](_0x14829d['model'],qs[_0x72f6('0x30')](_0x45e3bb[_0x72f6('0x2b')][_0x72f6('0x30')]));_0x32efea[_0x72f6('0x2f')]=_0x32efea[_0x72f6('0x2f')]['length']?_0x32efea[_0x72f6('0x2f')]:_0x14829d['model'];if(!_0x45e3bb['query'][_0x72f6('0x31')]('nolimit')){_0x32efea[_0x72f6('0x32')]=qs['limit'](_0x45e3bb[_0x72f6('0x2b')][_0x72f6('0x32')]);_0x32efea['offset']=qs[_0x72f6('0x1b')](_0x45e3bb[_0x72f6('0x2b')][_0x72f6('0x1b')]);}_0x32efea[_0x72f6('0x33')]=qs[_0x72f6('0x34')](_0x45e3bb['query'][_0x72f6('0x34')]);_0x32efea[_0x72f6('0x35')]=qs['filters'](_[_0x72f6('0x36')](_0x45e3bb[_0x72f6('0x2b')],_0x14829d['filters']));if(_0x45e3bb['query'][_0x72f6('0x37')]){_0x32efea[_0x72f6('0x35')]=_[_0x72f6('0x38')](_0x32efea['where'],{'$or':_['map'](_0x52da2a,function(_0x18be61){if(_0x18be61['type']!==_0x72f6('0x39')){var _0x437450={};_0x437450[_0x18be61[_0x72f6('0x23')]]={'$like':'%'+_0x45e3bb[_0x72f6('0x2b')][_0x72f6('0x37')]+'%'};return _0x437450;}})});}_0x32efea=_[_0x72f6('0x38')]({},_0x32efea,_0x45e3bb[_0x72f6('0x3a')]);var _0x4f32a7={'where':_0x32efea['where']};return db['OpenchannelTransferReport'][_0x72f6('0x3b')](_0x4f32a7)[_0x72f6('0x20')](function(_0x4fce86){_0x197fb9[_0x72f6('0x3b')]=_0x4fce86;if(_0x45e3bb[_0x72f6('0x2b')][_0x72f6('0x3c')]){_0x32efea[_0x72f6('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x72f6('0x3e')](_0x32efea);})['then'](function(_0x2d6259){_0x197fb9['rows']=_0x2d6259;return _0x197fb9;})[_0x72f6('0x20')](respondWithFilteredResult(_0x55b87a,_0x32efea))[_0x72f6('0x3f')](handleError(_0x55b87a,null));};exports['show']=function(_0x45f658,_0x4e4d3a){var _0x95cd9c={'raw':!![],'where':{'id':_0x45f658['params']['id']}},_0x34dfcf={};_0x34dfcf[_0x72f6('0x2e')]=_[_0x72f6('0x2a')](db[_0x72f6('0x26')][_0x72f6('0x27')]);_0x34dfcf[_0x72f6('0x2b')]=_['keys'](_0x45f658[_0x72f6('0x2b')]);_0x34dfcf['filters']=_['intersection'](_0x34dfcf[_0x72f6('0x2e')],_0x34dfcf['query']);_0x95cd9c[_0x72f6('0x2f')]=_['intersection'](_0x34dfcf[_0x72f6('0x2e')],qs['fields'](_0x45f658[_0x72f6('0x2b')][_0x72f6('0x30')]));_0x95cd9c[_0x72f6('0x2f')]=_0x95cd9c[_0x72f6('0x2f')]['length']?_0x95cd9c['attributes']:_0x34dfcf[_0x72f6('0x2e')];if(_0x45f658[_0x72f6('0x2b')][_0x72f6('0x3c')]){_0x95cd9c[_0x72f6('0x3d')]=[{'all':!![]}];}_0x95cd9c=_['merge']({},_0x95cd9c,_0x45f658[_0x72f6('0x3a')]);return db['OpenchannelTransferReport'][_0x72f6('0x40')](_0x95cd9c)[_0x72f6('0x20')](handleEntityNotFound(_0x4e4d3a,null))[_0x72f6('0x20')](respondWithResult(_0x4e4d3a,null))[_0x72f6('0x3f')](handleError(_0x4e4d3a,null));};exports[_0x72f6('0x41')]=function(_0x6c17d8,_0x4aa624){return db[_0x72f6('0x26')][_0x72f6('0x41')](_0x6c17d8[_0x72f6('0x42')],{})['then'](respondWithResult(_0x4aa624,0xc9))['catch'](handleError(_0x4aa624,null));};exports['update']=function(_0x5d157b,_0x4179fd){if(_0x5d157b[_0x72f6('0x42')]['id']){delete _0x5d157b[_0x72f6('0x42')]['id'];}return db[_0x72f6('0x26')]['find']({'where':{'id':_0x5d157b['params']['id']}})[_0x72f6('0x20')](handleEntityNotFound(_0x4179fd,null))[_0x72f6('0x20')](saveUpdates(_0x5d157b['body'],null))[_0x72f6('0x20')](respondWithResult(_0x4179fd,null))[_0x72f6('0x3f')](handleError(_0x4179fd,null));};exports[_0x72f6('0x1f')]=function(_0x5b1d83,_0x3ab522){return db['OpenchannelTransferReport'][_0x72f6('0x40')]({'where':{'id':_0x5b1d83[_0x72f6('0x43')]['id']}})[_0x72f6('0x20')](handleEntityNotFound(_0x3ab522,null))['then'](removeEntity(_0x3ab522,null))[_0x72f6('0x3f')](handleError(_0x3ab522,null));};exports[_0x72f6('0x44')]=function(_0x285ebc,_0x5da755){return db['OpenchannelTransferReport'][_0x72f6('0x44')]()['then'](respondWithResult(_0x5da755,null))['catch'](handleError(_0x5da755,null));};
\ No newline at end of file
+var _0xb07a=['reject','save','update','then','sendStatus','error','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','filter','options','include','rows','catch','show','params','includeAll','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','Content-Range'];(function(_0x37687f,_0x1e7078){var _0x5f14aa=function(_0x5f50ba){while(--_0x5f50ba){_0x37687f['push'](_0x37687f['shift']());}};_0x5f14aa(++_0x1e7078);}(_0xb07a,0xad));var _0xab07=function(_0x14c240,_0x1d23fc){_0x14c240=_0x14c240-0x0;var _0x518d01=_0xb07a[_0x14c240];return _0x518d01;};'use strict';var pdf=require(_0xab07('0x0'));var emlformat=require(_0xab07('0x1'));var rimraf=require(_0xab07('0x2'));var zipdir=require(_0xab07('0x3'));var jsonpatch=require(_0xab07('0x4'));var rp=require('request-promise');var moment=require(_0xab07('0x5'));var BPromise=require(_0xab07('0x6'));var Mustache=require(_0xab07('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab07('0x8'));var fs=require('fs');var _=require(_0xab07('0x9'));var squel=require(_0xab07('0xa'));var crypto=require(_0xab07('0xb'));var jsforce=require(_0xab07('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab07('0xd'));var Redis=require('ioredis');var authService=require(_0xab07('0xe'));var qs=require(_0xab07('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab07('0x10'));var logger=require(_0xab07('0x11'))(_0xab07('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab07('0x13'));var db=require(_0xab07('0x14'))['db'];function respondWithStatusCode(_0x3ee5f9,_0x515616){_0x515616=_0x515616||0xcc;return function(_0x4b0b58){if(_0x4b0b58){return _0x3ee5f9['sendStatus'](_0x515616);}return _0x3ee5f9[_0xab07('0x15')](_0x515616)[_0xab07('0x16')]();};}function respondWithResult(_0xa0f755,_0x19452b){_0x19452b=_0x19452b||0xc8;return function(_0x1d776a){if(_0x1d776a){return _0xa0f755['status'](_0x19452b)[_0xab07('0x17')](_0x1d776a);}};}function respondWithFilteredResult(_0x206862,_0xb96a2d){return function(_0xf194b6){if(_0xf194b6){var _0x23df9a=_0xf194b6[_0xab07('0x18')],_0x134b33=_0xb96a2d[_0xab07('0x19')],_0x56b708=_0xb96a2d[_0xab07('0x19')]+_0xb96a2d[_0xab07('0x1a')],_0x24c659;if(_0x56b708>=_0x23df9a){_0x56b708=_0x23df9a;_0x24c659=0xc8;}else{_0x24c659=0xce;}_0x206862[_0xab07('0x15')](_0x24c659);return _0x206862['set'](_0xab07('0x1b'),_0x134b33+'-'+_0x56b708+'/'+_0x23df9a)[_0xab07('0x17')](_0xf194b6);}return null;};}function patchUpdates(_0x54002e){return function(_0x2e00b2){try{jsonpatch['apply'](_0x2e00b2,_0x54002e,!![]);}catch(_0x212e29){return BPromise[_0xab07('0x1c')](_0x212e29);}return _0x2e00b2[_0xab07('0x1d')]();};}function saveUpdates(_0x1818db,_0x2a0d53){return function(_0x14d846){if(_0x14d846){return _0x14d846[_0xab07('0x1e')](_0x1818db)[_0xab07('0x1f')](function(_0x465423){return _0x465423;});}return null;};}function removeEntity(_0x21a513,_0x44c1c2){return function(_0x104c01){if(_0x104c01){return _0x104c01['destroy']()['then'](function(){_0x21a513[_0xab07('0x15')](0xcc)[_0xab07('0x16')]();});}};}function handleEntityNotFound(_0x1b4860,_0x242440){return function(_0x4ec916){if(!_0x4ec916){_0x1b4860[_0xab07('0x20')](0x194);}return _0x4ec916;};}function handleError(_0x1b9269,_0x9d117e){_0x9d117e=_0x9d117e||0x1f4;return function(_0x1dcde3){logger[_0xab07('0x21')](_0x1dcde3['stack']);if(_0x1dcde3[_0xab07('0x22')]){delete _0x1dcde3[_0xab07('0x22')];}_0x1b9269['status'](_0x9d117e)[_0xab07('0x23')](_0x1dcde3);};}exports[_0xab07('0x24')]=function(_0x42bad8,_0x1bb111){var _0x3a1a1d={},_0x7c29f4={},_0x57f06d={'count':0x0,'rows':[]};var _0x36b4ab=_['map'](db[_0xab07('0x25')][_0xab07('0x26')],function(_0x45ef17){return{'name':_0x45ef17[_0xab07('0x27')],'type':_0x45ef17[_0xab07('0x28')][_0xab07('0x29')]};});_0x7c29f4[_0xab07('0x2a')]=_['map'](_0x36b4ab,_0xab07('0x22'));_0x7c29f4[_0xab07('0x2b')]=_[_0xab07('0x2c')](_0x42bad8['query']);_0x7c29f4[_0xab07('0x2d')]=_[_0xab07('0x2e')](_0x7c29f4[_0xab07('0x2a')],_0x7c29f4[_0xab07('0x2b')]);_0x3a1a1d[_0xab07('0x2f')]=_[_0xab07('0x2e')](_0x7c29f4[_0xab07('0x2a')],qs['fields'](_0x42bad8[_0xab07('0x2b')][_0xab07('0x30')]));_0x3a1a1d[_0xab07('0x2f')]=_0x3a1a1d[_0xab07('0x2f')][_0xab07('0x31')]?_0x3a1a1d[_0xab07('0x2f')]:_0x7c29f4['model'];if(!_0x42bad8[_0xab07('0x2b')][_0xab07('0x32')](_0xab07('0x33'))){_0x3a1a1d[_0xab07('0x1a')]=qs[_0xab07('0x1a')](_0x42bad8['query'][_0xab07('0x1a')]);_0x3a1a1d['offset']=qs[_0xab07('0x19')](_0x42bad8[_0xab07('0x2b')]['offset']);}_0x3a1a1d['order']=qs[_0xab07('0x34')](_0x42bad8[_0xab07('0x2b')]['sort']);_0x3a1a1d['where']=qs['filters'](_['pick'](_0x42bad8[_0xab07('0x2b')],_0x7c29f4[_0xab07('0x2d')]),_0x36b4ab);if(_0x42bad8[_0xab07('0x2b')]['filter']){_0x3a1a1d[_0xab07('0x35')]=_[_0xab07('0x36')](_0x3a1a1d['where'],{'$or':_[_0xab07('0x37')](_0x36b4ab,function(_0x2e666c){if(_0x2e666c['type']!=='VIRTUAL'){var _0x96f013={};_0x96f013[_0x2e666c[_0xab07('0x22')]]={'$like':'%'+_0x42bad8[_0xab07('0x2b')][_0xab07('0x38')]+'%'};return _0x96f013;}})});}_0x3a1a1d=_[_0xab07('0x36')]({},_0x3a1a1d,_0x42bad8[_0xab07('0x39')]);var _0x11bc81={'where':_0x3a1a1d[_0xab07('0x35')]};return db['OpenchannelTransferReport'][_0xab07('0x18')](_0x11bc81)[_0xab07('0x1f')](function(_0x363d89){_0x57f06d[_0xab07('0x18')]=_0x363d89;if(_0x42bad8[_0xab07('0x2b')]['includeAll']){_0x3a1a1d[_0xab07('0x3a')]=[{'all':!![]}];}return db[_0xab07('0x25')]['findAll'](_0x3a1a1d);})[_0xab07('0x1f')](function(_0x356332){_0x57f06d[_0xab07('0x3b')]=_0x356332;return _0x57f06d;})[_0xab07('0x1f')](respondWithFilteredResult(_0x1bb111,_0x3a1a1d))[_0xab07('0x3c')](handleError(_0x1bb111,null));};exports[_0xab07('0x3d')]=function(_0x126925,_0x1531c6){var _0x3def65={'raw':!![],'where':{'id':_0x126925[_0xab07('0x3e')]['id']}},_0x3de28a={};_0x3de28a['model']=_[_0xab07('0x2c')](db[_0xab07('0x25')][_0xab07('0x26')]);_0x3de28a[_0xab07('0x2b')]=_['keys'](_0x126925['query']);_0x3de28a[_0xab07('0x2d')]=_[_0xab07('0x2e')](_0x3de28a[_0xab07('0x2a')],_0x3de28a['query']);_0x3def65[_0xab07('0x2f')]=_['intersection'](_0x3de28a[_0xab07('0x2a')],qs[_0xab07('0x30')](_0x126925['query'][_0xab07('0x30')]));_0x3def65[_0xab07('0x2f')]=_0x3def65[_0xab07('0x2f')][_0xab07('0x31')]?_0x3def65['attributes']:_0x3de28a[_0xab07('0x2a')];if(_0x126925[_0xab07('0x2b')][_0xab07('0x3f')]){_0x3def65['include']=[{'all':!![]}];}_0x3def65=_[_0xab07('0x36')]({},_0x3def65,_0x126925[_0xab07('0x39')]);return db[_0xab07('0x25')]['find'](_0x3def65)[_0xab07('0x1f')](handleEntityNotFound(_0x1531c6,null))[_0xab07('0x1f')](respondWithResult(_0x1531c6,null))[_0xab07('0x3c')](handleError(_0x1531c6,null));};exports[_0xab07('0x40')]=function(_0x1fbe77,_0x1e5fff){return db[_0xab07('0x25')][_0xab07('0x40')](_0x1fbe77[_0xab07('0x41')],{})[_0xab07('0x1f')](respondWithResult(_0x1e5fff,0xc9))[_0xab07('0x3c')](handleError(_0x1e5fff,null));};exports[_0xab07('0x1e')]=function(_0x2cec38,_0x5ee6fa){if(_0x2cec38[_0xab07('0x41')]['id']){delete _0x2cec38['body']['id'];}return db[_0xab07('0x25')]['find']({'where':{'id':_0x2cec38[_0xab07('0x3e')]['id']}})[_0xab07('0x1f')](handleEntityNotFound(_0x5ee6fa,null))['then'](saveUpdates(_0x2cec38[_0xab07('0x41')],null))[_0xab07('0x1f')](respondWithResult(_0x5ee6fa,null))[_0xab07('0x3c')](handleError(_0x5ee6fa,null));};exports['destroy']=function(_0x281799,_0x454905){return db[_0xab07('0x25')]['find']({'where':{'id':_0x281799['params']['id']}})['then'](handleEntityNotFound(_0x454905,null))['then'](removeEntity(_0x454905,null))[_0xab07('0x3c')](handleError(_0x454905,null));};exports['describe']=function(_0xe114d3,_0x336643){return db[_0xab07('0x25')][_0xab07('0x42')]()[_0xab07('0x1f')](respondWithResult(_0x336643,null))[_0xab07('0x3c')](handleError(_0x336643,null));};
\ No newline at end of file