Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.controller.js
index 9a6d1e6..04a7bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x864f=['path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','length','order','sort','where','pick','merge','filter','options','includeAll','rows','show','params','keys','fields','include','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x2e9a06,_0x3d0b26){var _0x4a3e10=function(_0x4f8100){while(--_0x4f8100){_0x2e9a06['push'](_0x2e9a06['shift']());}};_0x4a3e10(++_0x3d0b26);}(_0x864f,0xd4));var _0xf864=function(_0x2d5915,_0x1aec02){_0x2d5915=_0x2d5915-0x0;var _0x3772b6=_0x864f[_0x2d5915];return _0x3772b6;};'use strict';var emlformat=require(_0xf864('0x0'));var rimraf=require(_0xf864('0x1'));var zipdir=require(_0xf864('0x2'));var jsonpatch=require(_0xf864('0x3'));var rp=require('request-promise');var moment=require(_0xf864('0x4'));var BPromise=require(_0xf864('0x5'));var Mustache=require('mustache');var util=require(_0xf864('0x6'));var path=require(_0xf864('0x7'));var sox=require(_0xf864('0x8'));var csv=require(_0xf864('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf864('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf864('0xb'));var jsforce=require(_0xf864('0xc'));var deskjs=require(_0xf864('0xd'));var toCsv=require(_0xf864('0x9'));var querystring=require(_0xf864('0xe'));var Papa=require('papaparse');var Redis=require(_0xf864('0xf'));var authService=require(_0xf864('0x10'));var qs=require(_0xf864('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf864('0x12'));var logger=require(_0xf864('0x13'))('api');var utils=require(_0xf864('0x14'));var config=require(_0xf864('0x15'));var licenseUtil=require(_0xf864('0x16'));var db=require(_0xf864('0x17'))['db'];function respondWithStatusCode(_0x95e132,_0x65163b){_0x65163b=_0x65163b||0xcc;return function(_0x568551){if(_0x568551){return _0x95e132[_0xf864('0x18')](_0x65163b);}return _0x95e132[_0xf864('0x19')](_0x65163b)['end']();};}function respondWithResult(_0x4c7140,_0x230dcc){_0x230dcc=_0x230dcc||0xc8;return function(_0x2ae283){if(_0x2ae283){return _0x4c7140[_0xf864('0x19')](_0x230dcc)[_0xf864('0x1a')](_0x2ae283);}};}function respondWithFilteredResult(_0x3923dc,_0x1db9e8){return function(_0x1150b3){if(_0x1150b3){var _0x2c5ec7=typeof _0x1db9e8[_0xf864('0x1b')]===_0xf864('0x1c')&&typeof _0x1db9e8[_0xf864('0x1d')]===_0xf864('0x1c');var _0x508361=_0x1150b3[_0xf864('0x1e')];var _0x1c1955=_0x2c5ec7?0x0:_0x1db9e8[_0xf864('0x1b')];var _0x24fb19=_0x2c5ec7?_0x1150b3[_0xf864('0x1e')]:_0x1db9e8[_0xf864('0x1b')]+_0x1db9e8[_0xf864('0x1d')];var _0x37b076;if(_0x24fb19>=_0x508361){_0x24fb19=_0x508361;_0x37b076=0xc8;}else{_0x37b076=0xce;}_0x3923dc[_0xf864('0x19')](_0x37b076);return _0x3923dc[_0xf864('0x1f')](_0xf864('0x20'),_0x1c1955+'-'+_0x24fb19+'/'+_0x508361)[_0xf864('0x1a')](_0x1150b3);}return null;};}function patchUpdates(_0x53c361){return function(_0x4ff75b){try{jsonpatch['apply'](_0x4ff75b,_0x53c361,!![]);}catch(_0x5a6c9a){return BPromise['reject'](_0x5a6c9a);}return _0x4ff75b[_0xf864('0x21')]();};}function saveUpdates(_0x5163f4,_0x583d80){return function(_0x35f5c5){if(_0x35f5c5){return _0x35f5c5[_0xf864('0x22')](_0x5163f4)['then'](function(_0x5500c4){return _0x5500c4;});}return null;};}function removeEntity(_0x2e972b,_0x1df2ad){return function(_0x3ef33d){if(_0x3ef33d){return _0x3ef33d['destroy']()[_0xf864('0x23')](function(){_0x2e972b[_0xf864('0x19')](0xcc)[_0xf864('0x24')]();});}};}function handleEntityNotFound(_0xc5ec46,_0x38a274){return function(_0x4f0864){if(!_0x4f0864){_0xc5ec46['sendStatus'](0x194);}return _0x4f0864;};}function handleError(_0x2ecb8d,_0x5a7501){_0x5a7501=_0x5a7501||0x1f4;return function(_0x7d75e0){logger[_0xf864('0x25')](_0x7d75e0[_0xf864('0x26')]);if(_0x7d75e0[_0xf864('0x27')]){delete _0x7d75e0[_0xf864('0x27')];}_0x2ecb8d[_0xf864('0x19')](_0x5a7501)[_0xf864('0x28')](_0x7d75e0);};}exports[_0xf864('0x29')]=function(_0x82b790,_0x251230){var _0x52e507={},_0x251cc6={},_0x315888={'count':0x0,'rows':[]};var _0x19d00f=_[_0xf864('0x2a')](db[_0xf864('0x2b')][_0xf864('0x2c')],function(_0x2e2984){return{'name':_0x2e2984[_0xf864('0x2d')],'type':_0x2e2984[_0xf864('0x2e')][_0xf864('0x2f')]};});_0x251cc6[_0xf864('0x30')]=_[_0xf864('0x2a')](_0x19d00f,'name');_0x251cc6['query']=_['keys'](_0x82b790['query']);_0x251cc6[_0xf864('0x31')]=_[_0xf864('0x32')](_0x251cc6[_0xf864('0x30')],_0x251cc6[_0xf864('0x33')]);_0x52e507['attributes']=_[_0xf864('0x32')](_0x251cc6[_0xf864('0x30')],qs['fields'](_0x82b790['query']['fields']));_0x52e507[_0xf864('0x34')]=_0x52e507[_0xf864('0x34')][_0xf864('0x35')]?_0x52e507[_0xf864('0x34')]:_0x251cc6['model'];if(!_0x82b790[_0xf864('0x33')]['hasOwnProperty']('nolimit')){_0x52e507[_0xf864('0x1d')]=qs['limit'](_0x82b790[_0xf864('0x33')][_0xf864('0x1d')]);_0x52e507['offset']=qs[_0xf864('0x1b')](_0x82b790[_0xf864('0x33')][_0xf864('0x1b')]);}_0x52e507[_0xf864('0x36')]=qs[_0xf864('0x37')](_0x82b790[_0xf864('0x33')]['sort']);_0x52e507[_0xf864('0x38')]=qs[_0xf864('0x31')](_[_0xf864('0x39')](_0x82b790[_0xf864('0x33')],_0x251cc6['filters']),_0x19d00f);if(_0x82b790['query']['filter']){_0x52e507[_0xf864('0x38')]=_[_0xf864('0x3a')](_0x52e507[_0xf864('0x38')],{'$or':_['map'](_0x19d00f,function(_0x4e9e3e){if(_0x4e9e3e[_0xf864('0x2e')]!=='VIRTUAL'){var _0x405ee2={};_0x405ee2[_0x4e9e3e[_0xf864('0x27')]]={'$like':'%'+_0x82b790['query'][_0xf864('0x3b')]+'%'};return _0x405ee2;}})});}_0x52e507=_['merge']({},_0x52e507,_0x82b790[_0xf864('0x3c')]);var _0x352152={'where':_0x52e507['where']};return db[_0xf864('0x2b')][_0xf864('0x1e')](_0x352152)[_0xf864('0x23')](function(_0x4b9e1b){_0x315888[_0xf864('0x1e')]=_0x4b9e1b;if(_0x82b790[_0xf864('0x33')][_0xf864('0x3d')]){_0x52e507['include']=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x52e507);})['then'](function(_0x4ad9e6){_0x315888[_0xf864('0x3e')]=_0x4ad9e6;return _0x315888;})[_0xf864('0x23')](respondWithFilteredResult(_0x251230,_0x52e507))['catch'](handleError(_0x251230,null));};exports[_0xf864('0x3f')]=function(_0x37215e,_0x44cbfc){var _0x2af4ad={'raw':!![],'where':{'id':_0x37215e[_0xf864('0x40')]['id']}},_0x529a62={};_0x529a62[_0xf864('0x30')]=_[_0xf864('0x41')](db[_0xf864('0x2b')][_0xf864('0x2c')]);_0x529a62[_0xf864('0x33')]=_[_0xf864('0x41')](_0x37215e[_0xf864('0x33')]);_0x529a62[_0xf864('0x31')]=_['intersection'](_0x529a62['model'],_0x529a62[_0xf864('0x33')]);_0x2af4ad['attributes']=_[_0xf864('0x32')](_0x529a62['model'],qs[_0xf864('0x42')](_0x37215e[_0xf864('0x33')][_0xf864('0x42')]));_0x2af4ad[_0xf864('0x34')]=_0x2af4ad[_0xf864('0x34')][_0xf864('0x35')]?_0x2af4ad[_0xf864('0x34')]:_0x529a62[_0xf864('0x30')];if(_0x37215e[_0xf864('0x33')][_0xf864('0x3d')]){_0x2af4ad[_0xf864('0x43')]=[{'all':!![]}];}_0x2af4ad=_[_0xf864('0x3a')]({},_0x2af4ad,_0x37215e[_0xf864('0x3c')]);return db[_0xf864('0x2b')][_0xf864('0x44')](_0x2af4ad)[_0xf864('0x23')](handleEntityNotFound(_0x44cbfc,null))['then'](respondWithResult(_0x44cbfc,null))['catch'](handleError(_0x44cbfc,null));};exports[_0xf864('0x45')]=function(_0x5f4c80,_0x4ccba6){return db['OpenchannelTransferReport']['create'](_0x5f4c80[_0xf864('0x46')],{})[_0xf864('0x23')](respondWithResult(_0x4ccba6,0xc9))['catch'](handleError(_0x4ccba6,null));};exports[_0xf864('0x22')]=function(_0x330c1a,_0x1c84c6){if(_0x330c1a[_0xf864('0x46')]['id']){delete _0x330c1a[_0xf864('0x46')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x330c1a[_0xf864('0x40')]['id']}})[_0xf864('0x23')](handleEntityNotFound(_0x1c84c6,null))['then'](saveUpdates(_0x330c1a[_0xf864('0x46')],null))['then'](respondWithResult(_0x1c84c6,null))[_0xf864('0x47')](handleError(_0x1c84c6,null));};exports['destroy']=function(_0x83acc8,_0x2717b0){return db['OpenchannelTransferReport'][_0xf864('0x44')]({'where':{'id':_0x83acc8[_0xf864('0x40')]['id']}})[_0xf864('0x23')](handleEntityNotFound(_0x2717b0,null))[_0xf864('0x23')](removeEntity(_0x2717b0,null))[_0xf864('0x47')](handleError(_0x2717b0,null));};exports[_0xf864('0x48')]=function(_0x138e0f,_0x3e11e2){return db['OpenchannelTransferReport'][_0xf864('0x48')]()[_0xf864('0x23')](respondWithResult(_0x3e11e2,null))['catch'](handleError(_0x3e11e2,null));};
\ No newline at end of file