Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.controller.js
index 34f3890..af6c265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92a5=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','merge','includeAll','rows','catch','show','keys','include','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto'];(function(_0x3fd963,_0x1491ec){var _0x3ddac2=function(_0x1a1ae5){while(--_0x1a1ae5){_0x3fd963['push'](_0x3fd963['shift']());}};_0x3ddac2(++_0x1491ec);}(_0x92a5,0x16f));var _0x592a=function(_0x28c36b,_0x2133d8){_0x28c36b=_0x28c36b-0x0;var _0x4498a7=_0x92a5[_0x28c36b];return _0x4498a7;};'use strict';var pdf=require(_0x592a('0x0'));var emlformat=require(_0x592a('0x1'));var rimraf=require(_0x592a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x592a('0x3'));var rp=require(_0x592a('0x4'));var moment=require(_0x592a('0x5'));var BPromise=require(_0x592a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x592a('0x7'));var sox=require(_0x592a('0x8'));var csv=require('to-csv');var ejs=require(_0x592a('0x9'));var fs=require('fs');var _=require(_0x592a('0xa'));var squel=require(_0x592a('0xb'));var crypto=require(_0x592a('0xc'));var jsforce=require(_0x592a('0xd'));var deskjs=require(_0x592a('0xe'));var toCsv=require(_0x592a('0xf'));var querystring=require(_0x592a('0x10'));var Papa=require(_0x592a('0x11'));var Redis=require(_0x592a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x592a('0x13'));var as=require(_0x592a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x592a('0x15'));var utils=require(_0x592a('0x16'));var config=require(_0x592a('0x17'));var db=require(_0x592a('0x18'))['db'];function respondWithStatusCode(_0x40021a,_0x3c0753){_0x3c0753=_0x3c0753||0xcc;return function(_0xad84a7){if(_0xad84a7){return _0x40021a[_0x592a('0x19')](_0x3c0753);}return _0x40021a[_0x592a('0x1a')](_0x3c0753)['end']();};}function respondWithResult(_0xd2851,_0x436229){_0x436229=_0x436229||0xc8;return function(_0x169e32){if(_0x169e32){return _0xd2851['status'](_0x436229)[_0x592a('0x1b')](_0x169e32);}};}function respondWithFilteredResult(_0x1621c9,_0x4a395b){return function(_0xab4a68){if(_0xab4a68){var _0x4ba548=_0xab4a68[_0x592a('0x1c')],_0x4dca9a=_0x4a395b['offset'],_0x40a046=_0x4a395b[_0x592a('0x1d')]+_0x4a395b['limit'],_0x3498be;if(_0x40a046>=_0x4ba548){_0x40a046=_0x4ba548;_0x3498be=0xc8;}else{_0x3498be=0xce;}_0x1621c9[_0x592a('0x1a')](_0x3498be);return _0x1621c9[_0x592a('0x1e')](_0x592a('0x1f'),_0x4dca9a+'-'+_0x40a046+'/'+_0x4ba548)[_0x592a('0x1b')](_0xab4a68);}return null;};}function patchUpdates(_0x45bf28){return function(_0x15e279){try{jsonpatch[_0x592a('0x20')](_0x15e279,_0x45bf28,!![]);}catch(_0x5cd7ef){return BPromise['reject'](_0x5cd7ef);}return _0x15e279['save']();};}function saveUpdates(_0x3cf2c9,_0x178093){return function(_0x2e0dd6){if(_0x2e0dd6){return _0x2e0dd6[_0x592a('0x21')](_0x3cf2c9)[_0x592a('0x22')](function(_0x40a657){return _0x40a657;});}return null;};}function removeEntity(_0x513164,_0x10595e){return function(_0x6874f4){if(_0x6874f4){return _0x6874f4[_0x592a('0x23')]()[_0x592a('0x22')](function(){_0x513164['status'](0xcc)[_0x592a('0x24')]();});}};}function handleEntityNotFound(_0x3d7c67,_0x258df5){return function(_0x458156){if(!_0x458156){_0x3d7c67[_0x592a('0x19')](0x194);}return _0x458156;};}function handleError(_0x34f789,_0x53ac67){_0x53ac67=_0x53ac67||0x1f4;return function(_0x53312e){logger[_0x592a('0x25')](_0x53312e[_0x592a('0x26')]);if(_0x53312e[_0x592a('0x27')]){delete _0x53312e[_0x592a('0x27')];}_0x34f789['status'](_0x53ac67)[_0x592a('0x28')](_0x53312e);};}exports[_0x592a('0x29')]=function(_0x32c6ce,_0x2125cb){var _0x5f463b={},_0x105747={},_0x24f629={'count':0x0,'rows':[]};var _0x4f62ba=_[_0x592a('0x2a')](db[_0x592a('0x2b')][_0x592a('0x2c')],function(_0x3954ce){return{'name':_0x3954ce[_0x592a('0x2d')],'type':_0x3954ce[_0x592a('0x2e')][_0x592a('0x2f')]};});_0x105747[_0x592a('0x30')]=_[_0x592a('0x2a')](_0x4f62ba,'name');_0x105747[_0x592a('0x31')]=_['keys'](_0x32c6ce[_0x592a('0x31')]);_0x105747['filters']=_[_0x592a('0x32')](_0x105747[_0x592a('0x30')],_0x105747['query']);_0x5f463b['attributes']=_['intersection'](_0x105747[_0x592a('0x30')],qs[_0x592a('0x33')](_0x32c6ce[_0x592a('0x31')]['fields']));_0x5f463b[_0x592a('0x34')]=_0x5f463b[_0x592a('0x34')][_0x592a('0x35')]?_0x5f463b[_0x592a('0x34')]:_0x105747[_0x592a('0x30')];if(!_0x32c6ce[_0x592a('0x31')][_0x592a('0x36')](_0x592a('0x37'))){_0x5f463b[_0x592a('0x38')]=qs[_0x592a('0x38')](_0x32c6ce[_0x592a('0x31')][_0x592a('0x38')]);_0x5f463b[_0x592a('0x1d')]=qs['offset'](_0x32c6ce[_0x592a('0x31')][_0x592a('0x1d')]);}_0x5f463b[_0x592a('0x39')]=qs[_0x592a('0x3a')](_0x32c6ce[_0x592a('0x31')][_0x592a('0x3a')]);_0x5f463b[_0x592a('0x3b')]=qs[_0x592a('0x3c')](_[_0x592a('0x3d')](_0x32c6ce['query'],_0x105747[_0x592a('0x3c')]),_0x4f62ba);if(_0x32c6ce['query']['filter']){_0x5f463b[_0x592a('0x3b')]=_['merge'](_0x5f463b[_0x592a('0x3b')],{'$or':_[_0x592a('0x2a')](_0x4f62ba,function(_0x49efd0){if(_0x49efd0['type']!==_0x592a('0x3e')){var _0x251689={};_0x251689[_0x49efd0[_0x592a('0x27')]]={'$like':'%'+_0x32c6ce['query']['filter']+'%'};return _0x251689;}})});}_0x5f463b=_[_0x592a('0x3f')]({},_0x5f463b,_0x32c6ce['options']);var _0x30aa7a={'where':_0x5f463b[_0x592a('0x3b')]};return db[_0x592a('0x2b')][_0x592a('0x1c')](_0x30aa7a)[_0x592a('0x22')](function(_0x2b880f){_0x24f629['count']=_0x2b880f;if(_0x32c6ce['query'][_0x592a('0x40')]){_0x5f463b['include']=[{'all':!![]}];}return db[_0x592a('0x2b')]['findAll'](_0x5f463b);})[_0x592a('0x22')](function(_0x5d1ce3){_0x24f629[_0x592a('0x41')]=_0x5d1ce3;return _0x24f629;})['then'](respondWithFilteredResult(_0x2125cb,_0x5f463b))[_0x592a('0x42')](handleError(_0x2125cb,null));};exports[_0x592a('0x43')]=function(_0x38b95e,_0x539105){var _0x36e497={'raw':!![],'where':{'id':_0x38b95e['params']['id']}},_0x517bf7={};_0x517bf7[_0x592a('0x30')]=_[_0x592a('0x44')](db[_0x592a('0x2b')][_0x592a('0x2c')]);_0x517bf7['query']=_[_0x592a('0x44')](_0x38b95e[_0x592a('0x31')]);_0x517bf7['filters']=_[_0x592a('0x32')](_0x517bf7[_0x592a('0x30')],_0x517bf7[_0x592a('0x31')]);_0x36e497[_0x592a('0x34')]=_['intersection'](_0x517bf7[_0x592a('0x30')],qs[_0x592a('0x33')](_0x38b95e[_0x592a('0x31')][_0x592a('0x33')]));_0x36e497['attributes']=_0x36e497['attributes']['length']?_0x36e497[_0x592a('0x34')]:_0x517bf7['model'];if(_0x38b95e[_0x592a('0x31')][_0x592a('0x40')]){_0x36e497[_0x592a('0x45')]=[{'all':!![]}];}_0x36e497=_[_0x592a('0x3f')]({},_0x36e497,_0x38b95e[_0x592a('0x46')]);return db[_0x592a('0x2b')][_0x592a('0x47')](_0x36e497)[_0x592a('0x22')](handleEntityNotFound(_0x539105,null))[_0x592a('0x22')](respondWithResult(_0x539105,null))[_0x592a('0x42')](handleError(_0x539105,null));};exports['create']=function(_0x303445,_0x4a7af6){return db[_0x592a('0x2b')][_0x592a('0x48')](_0x303445[_0x592a('0x49')],{})[_0x592a('0x22')](respondWithResult(_0x4a7af6,0xc9))['catch'](handleError(_0x4a7af6,null));};exports[_0x592a('0x21')]=function(_0x4001ad,_0x3f9da9){if(_0x4001ad['body']['id']){delete _0x4001ad['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x4001ad[_0x592a('0x4a')]['id']}})[_0x592a('0x22')](handleEntityNotFound(_0x3f9da9,null))[_0x592a('0x22')](saveUpdates(_0x4001ad['body'],null))[_0x592a('0x22')](respondWithResult(_0x3f9da9,null))[_0x592a('0x42')](handleError(_0x3f9da9,null));};exports[_0x592a('0x23')]=function(_0x4ec419,_0x1e4c93){return db[_0x592a('0x2b')][_0x592a('0x47')]({'where':{'id':_0x4ec419[_0x592a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1e4c93,null))[_0x592a('0x22')](removeEntity(_0x1e4c93,null))[_0x592a('0x42')](handleError(_0x1e4c93,null));};exports[_0x592a('0x4b')]=function(_0x5e1a41,_0x53b007){return db[_0x592a('0x2b')][_0x592a('0x4b')]()[_0x592a('0x22')](respondWithResult(_0x53b007,null))[_0x592a('0x42')](handleError(_0x53b007,null));};
\ No newline at end of file
+var _0x4f57=['options','include','rows','catch','show','fields','includeAll','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/utils','../../config/environment','end','json','count','offset','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','name'];(function(_0x4e5046,_0x245c09){var _0x291904=function(_0x28d3e3){while(--_0x28d3e3){_0x4e5046['push'](_0x4e5046['shift']());}};_0x291904(++_0x245c09);}(_0x4f57,0x13c));var _0x74f5=function(_0x92eeb6,_0x574acf){_0x92eeb6=_0x92eeb6-0x0;var _0x38067d=_0x4f57[_0x92eeb6];return _0x38067d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x74f5('0x0'));var rimraf=require(_0x74f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74f5('0x2'));var rp=require(_0x74f5('0x3'));var moment=require(_0x74f5('0x4'));var BPromise=require(_0x74f5('0x5'));var Mustache=require(_0x74f5('0x6'));var util=require(_0x74f5('0x7'));var path=require(_0x74f5('0x8'));var sox=require('sox');var csv=require(_0x74f5('0x9'));var ejs=require(_0x74f5('0xa'));var fs=require('fs');var _=require(_0x74f5('0xb'));var squel=require(_0x74f5('0xc'));var crypto=require(_0x74f5('0xd'));var jsforce=require(_0x74f5('0xe'));var deskjs=require(_0x74f5('0xf'));var toCsv=require(_0x74f5('0x9'));var querystring=require(_0x74f5('0x10'));var Papa=require(_0x74f5('0x11'));var Redis=require(_0x74f5('0x12'));var authService=require(_0x74f5('0x13'));var qs=require(_0x74f5('0x14'));var as=require(_0x74f5('0x15'));var hardwareService=require(_0x74f5('0x16'));var logger=require(_0x74f5('0x17'))(_0x74f5('0x18'));var utils=require(_0x74f5('0x19'));var config=require(_0x74f5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31ab9a,_0xdfaec4){_0xdfaec4=_0xdfaec4||0xcc;return function(_0x5d669){if(_0x5d669){return _0x31ab9a['sendStatus'](_0xdfaec4);}return _0x31ab9a['status'](_0xdfaec4)[_0x74f5('0x1b')]();};}function respondWithResult(_0x3e359c,_0x24029e){_0x24029e=_0x24029e||0xc8;return function(_0x20e3d8){if(_0x20e3d8){return _0x3e359c['status'](_0x24029e)[_0x74f5('0x1c')](_0x20e3d8);}};}function respondWithFilteredResult(_0x34f92d,_0x434ce5){return function(_0x162092){if(_0x162092){var _0x1cb1b6=_0x162092[_0x74f5('0x1d')],_0x1743ac=_0x434ce5[_0x74f5('0x1e')],_0xa34a07=_0x434ce5['offset']+_0x434ce5['limit'],_0x391e5e;if(_0xa34a07>=_0x1cb1b6){_0xa34a07=_0x1cb1b6;_0x391e5e=0xc8;}else{_0x391e5e=0xce;}_0x34f92d[_0x74f5('0x1f')](_0x391e5e);return _0x34f92d['set'](_0x74f5('0x20'),_0x1743ac+'-'+_0xa34a07+'/'+_0x1cb1b6)[_0x74f5('0x1c')](_0x162092);}return null;};}function patchUpdates(_0x1b0b63){return function(_0x3707d3){try{jsonpatch[_0x74f5('0x21')](_0x3707d3,_0x1b0b63,!![]);}catch(_0xeaed4d){return BPromise[_0x74f5('0x22')](_0xeaed4d);}return _0x3707d3[_0x74f5('0x23')]();};}function saveUpdates(_0x482e36,_0x3c35e8){return function(_0x47e616){if(_0x47e616){return _0x47e616[_0x74f5('0x24')](_0x482e36)[_0x74f5('0x25')](function(_0x59e984){return _0x59e984;});}return null;};}function removeEntity(_0x4a64fb,_0x47866a){return function(_0x4fae1a){if(_0x4fae1a){return _0x4fae1a[_0x74f5('0x26')]()['then'](function(){_0x4a64fb[_0x74f5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d71a4,_0x2cc5bc){return function(_0x3bf2e5){if(!_0x3bf2e5){_0x5d71a4[_0x74f5('0x27')](0x194);}return _0x3bf2e5;};}function handleError(_0x40d530,_0x537b9d){_0x537b9d=_0x537b9d||0x1f4;return function(_0x4a1f66){logger['error'](_0x4a1f66[_0x74f5('0x28')]);if(_0x4a1f66['name']){delete _0x4a1f66['name'];}_0x40d530[_0x74f5('0x1f')](_0x537b9d)['send'](_0x4a1f66);};}exports[_0x74f5('0x29')]=function(_0x271beb,_0xca6354){var _0x5bb7a9={},_0x1063dc={},_0x1b6922={'count':0x0,'rows':[]};var _0x13e4ce=_[_0x74f5('0x2a')](db[_0x74f5('0x2b')][_0x74f5('0x2c')],function(_0xaa986d){return{'name':_0xaa986d[_0x74f5('0x2d')],'type':_0xaa986d[_0x74f5('0x2e')][_0x74f5('0x2f')]};});_0x1063dc['model']=_[_0x74f5('0x2a')](_0x13e4ce,'name');_0x1063dc['query']=_[_0x74f5('0x30')](_0x271beb[_0x74f5('0x31')]);_0x1063dc['filters']=_[_0x74f5('0x32')](_0x1063dc[_0x74f5('0x33')],_0x1063dc[_0x74f5('0x31')]);_0x5bb7a9['attributes']=_[_0x74f5('0x32')](_0x1063dc[_0x74f5('0x33')],qs['fields'](_0x271beb[_0x74f5('0x31')]['fields']));_0x5bb7a9['attributes']=_0x5bb7a9[_0x74f5('0x34')][_0x74f5('0x35')]?_0x5bb7a9[_0x74f5('0x34')]:_0x1063dc[_0x74f5('0x33')];if(!_0x271beb[_0x74f5('0x31')][_0x74f5('0x36')]('nolimit')){_0x5bb7a9[_0x74f5('0x37')]=qs[_0x74f5('0x37')](_0x271beb[_0x74f5('0x31')][_0x74f5('0x37')]);_0x5bb7a9[_0x74f5('0x1e')]=qs['offset'](_0x271beb[_0x74f5('0x31')][_0x74f5('0x1e')]);}_0x5bb7a9[_0x74f5('0x38')]=qs[_0x74f5('0x39')](_0x271beb[_0x74f5('0x31')][_0x74f5('0x39')]);_0x5bb7a9[_0x74f5('0x3a')]=qs[_0x74f5('0x3b')](_['pick'](_0x271beb[_0x74f5('0x31')],_0x1063dc['filters']),_0x13e4ce);if(_0x271beb[_0x74f5('0x31')][_0x74f5('0x3c')]){_0x5bb7a9[_0x74f5('0x3a')]=_[_0x74f5('0x3d')](_0x5bb7a9['where'],{'$or':_['map'](_0x13e4ce,function(_0x3e6409){if(_0x3e6409[_0x74f5('0x2e')]!==_0x74f5('0x3e')){var _0x46b9fa={};_0x46b9fa[_0x3e6409[_0x74f5('0x3f')]]={'$like':'%'+_0x271beb[_0x74f5('0x31')][_0x74f5('0x3c')]+'%'};return _0x46b9fa;}})});}_0x5bb7a9=_[_0x74f5('0x3d')]({},_0x5bb7a9,_0x271beb[_0x74f5('0x40')]);var _0x31e196={'where':_0x5bb7a9[_0x74f5('0x3a')]};return db[_0x74f5('0x2b')]['count'](_0x31e196)[_0x74f5('0x25')](function(_0x1313f1){_0x1b6922[_0x74f5('0x1d')]=_0x1313f1;if(_0x271beb[_0x74f5('0x31')]['includeAll']){_0x5bb7a9[_0x74f5('0x41')]=[{'all':!![]}];}return db[_0x74f5('0x2b')]['findAll'](_0x5bb7a9);})[_0x74f5('0x25')](function(_0x1f844e){_0x1b6922[_0x74f5('0x42')]=_0x1f844e;return _0x1b6922;})[_0x74f5('0x25')](respondWithFilteredResult(_0xca6354,_0x5bb7a9))[_0x74f5('0x43')](handleError(_0xca6354,null));};exports[_0x74f5('0x44')]=function(_0x3e2684,_0x5677d5){var _0x22bc9e={'raw':!![],'where':{'id':_0x3e2684['params']['id']}},_0x46f8c1={};_0x46f8c1[_0x74f5('0x33')]=_['keys'](db['OpenchannelTransferReport'][_0x74f5('0x2c')]);_0x46f8c1['query']=_[_0x74f5('0x30')](_0x3e2684[_0x74f5('0x31')]);_0x46f8c1[_0x74f5('0x3b')]=_[_0x74f5('0x32')](_0x46f8c1[_0x74f5('0x33')],_0x46f8c1[_0x74f5('0x31')]);_0x22bc9e[_0x74f5('0x34')]=_['intersection'](_0x46f8c1[_0x74f5('0x33')],qs[_0x74f5('0x45')](_0x3e2684['query'][_0x74f5('0x45')]));_0x22bc9e['attributes']=_0x22bc9e[_0x74f5('0x34')][_0x74f5('0x35')]?_0x22bc9e[_0x74f5('0x34')]:_0x46f8c1['model'];if(_0x3e2684[_0x74f5('0x31')][_0x74f5('0x46')]){_0x22bc9e[_0x74f5('0x41')]=[{'all':!![]}];}_0x22bc9e=_[_0x74f5('0x3d')]({},_0x22bc9e,_0x3e2684[_0x74f5('0x40')]);return db[_0x74f5('0x2b')][_0x74f5('0x47')](_0x22bc9e)[_0x74f5('0x25')](handleEntityNotFound(_0x5677d5,null))[_0x74f5('0x25')](respondWithResult(_0x5677d5,null))['catch'](handleError(_0x5677d5,null));};exports['create']=function(_0x505202,_0x3f44a7){return db[_0x74f5('0x2b')][_0x74f5('0x48')](_0x505202['body'],{})[_0x74f5('0x25')](respondWithResult(_0x3f44a7,0xc9))[_0x74f5('0x43')](handleError(_0x3f44a7,null));};exports[_0x74f5('0x24')]=function(_0x3f9186,_0x5689b1){if(_0x3f9186[_0x74f5('0x49')]['id']){delete _0x3f9186[_0x74f5('0x49')]['id'];}return db[_0x74f5('0x2b')]['find']({'where':{'id':_0x3f9186[_0x74f5('0x4a')]['id']}})[_0x74f5('0x25')](handleEntityNotFound(_0x5689b1,null))['then'](saveUpdates(_0x3f9186[_0x74f5('0x49')],null))[_0x74f5('0x25')](respondWithResult(_0x5689b1,null))[_0x74f5('0x43')](handleError(_0x5689b1,null));};exports[_0x74f5('0x26')]=function(_0x325fd7,_0x13b53a){return db[_0x74f5('0x2b')][_0x74f5('0x47')]({'where':{'id':_0x325fd7[_0x74f5('0x4a')]['id']}})[_0x74f5('0x25')](handleEntityNotFound(_0x13b53a,null))[_0x74f5('0x25')](removeEntity(_0x13b53a,null))[_0x74f5('0x43')](handleError(_0x13b53a,null));};exports[_0x74f5('0x4b')]=function(_0x14db8f,_0x4f0875){return db[_0x74f5('0x2b')][_0x74f5('0x4b')]()[_0x74f5('0x25')](respondWithResult(_0x4f0875,null))[_0x74f5('0x43')](handleError(_0x4f0875,null));};
\ No newline at end of file