Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / analyticExtractedReport / analyticExtractedReport.controller.js
index 58f06b9..7775992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f7b=['pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','keys','intersection','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','nolimit','offset','order','sort','where'];(function(_0x2229de,_0x596a5b){var _0x25d05e=function(_0x2c8bda){while(--_0x2c8bda){_0x2229de['push'](_0x2229de['shift']());}};_0x25d05e(++_0x596a5b);}(_0x1f7b,0x81));var _0xb1f7=function(_0x5a91a5,_0x1eb099){_0x5a91a5=_0x5a91a5-0x0;var _0x8f99de=_0x1f7b[_0x5a91a5];return _0x8f99de;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb1f7('0x0'));var jsonpatch=require(_0xb1f7('0x1'));var rp=require(_0xb1f7('0x2'));var moment=require(_0xb1f7('0x3'));var BPromise=require(_0xb1f7('0x4'));var Mustache=require(_0xb1f7('0x5'));var util=require(_0xb1f7('0x6'));var path=require('path');var sox=require(_0xb1f7('0x7'));var csv=require(_0xb1f7('0x8'));var ejs=require(_0xb1f7('0x9'));var fs=require('fs');var _=require(_0xb1f7('0xa'));var squel=require(_0xb1f7('0xb'));var crypto=require(_0xb1f7('0xc'));var jsforce=require(_0xb1f7('0xd'));var deskjs=require(_0xb1f7('0xe'));var toCsv=require(_0xb1f7('0x8'));var querystring=require(_0xb1f7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb1f7('0x10'));var as=require(_0xb1f7('0x11'));var hardwareService=require(_0xb1f7('0x12'));var logger=require(_0xb1f7('0x13'))(_0xb1f7('0x14'));var utils=require('../../config/utils');var config=require(_0xb1f7('0x15'));var db=require(_0xb1f7('0x16'))['db'];function respondWithStatusCode(_0x111f64,_0x4f25b3){_0x4f25b3=_0x4f25b3||0xcc;return function(_0x236e63){if(_0x236e63){return _0x111f64[_0xb1f7('0x17')](_0x4f25b3);}return _0x111f64[_0xb1f7('0x18')](_0x4f25b3)[_0xb1f7('0x19')]();};}function respondWithResult(_0x3c5227,_0x985ac5){_0x985ac5=_0x985ac5||0xc8;return function(_0x1658ed){if(_0x1658ed){return _0x3c5227['status'](_0x985ac5)[_0xb1f7('0x1a')](_0x1658ed);}};}function respondWithFilteredResult(_0x25b1c3,_0x48e78d){return function(_0x2d9112){if(_0x2d9112){var _0x2716b6=_0x2d9112[_0xb1f7('0x1b')],_0x5cd37f=_0x48e78d['offset'],_0x3589de=_0x48e78d['offset']+_0x48e78d[_0xb1f7('0x1c')],_0x27e301;if(_0x3589de>=_0x2716b6){_0x3589de=_0x2716b6;_0x27e301=0xc8;}else{_0x27e301=0xce;}_0x25b1c3[_0xb1f7('0x18')](_0x27e301);return _0x25b1c3[_0xb1f7('0x1d')](_0xb1f7('0x1e'),_0x5cd37f+'-'+_0x3589de+'/'+_0x2716b6)[_0xb1f7('0x1a')](_0x2d9112);}return null;};}function patchUpdates(_0x151e6a){return function(_0x228580){try{jsonpatch[_0xb1f7('0x1f')](_0x228580,_0x151e6a,!![]);}catch(_0x48581c){return BPromise[_0xb1f7('0x20')](_0x48581c);}return _0x228580[_0xb1f7('0x21')]();};}function saveUpdates(_0x2041c0,_0x2a1b1e){return function(_0x289006){if(_0x289006){return _0x289006[_0xb1f7('0x22')](_0x2041c0)['then'](function(_0x496d0e){return _0x496d0e;});}return null;};}function removeEntity(_0x244ef5,_0x41fe58){return function(_0x534c11){if(_0x534c11){return _0x534c11[_0xb1f7('0x23')]()[_0xb1f7('0x24')](function(){var _0x4c3db3=_0x534c11[_0xb1f7('0x25')]({'plain':!![]});var _0x1e79c5=_0xb1f7('0x26');return db[_0xb1f7('0x27')][_0xb1f7('0x23')]({'where':{'type':_0x1e79c5,'resourceId':_0x4c3db3['id']}})[_0xb1f7('0x24')](function(){return _0x534c11;});})[_0xb1f7('0x24')](function(){_0x244ef5[_0xb1f7('0x18')](0xcc)[_0xb1f7('0x19')]();});}};}function handleEntityNotFound(_0x2c8bbb,_0x538676){return function(_0x44093b){if(!_0x44093b){_0x2c8bbb[_0xb1f7('0x17')](0x194);}return _0x44093b;};}function handleError(_0x10f4bc,_0x37aa4c){_0x37aa4c=_0x37aa4c||0x1f4;return function(_0x245b66){logger[_0xb1f7('0x28')](_0x245b66[_0xb1f7('0x29')]);if(_0x245b66[_0xb1f7('0x2a')]){delete _0x245b66[_0xb1f7('0x2a')];}_0x10f4bc[_0xb1f7('0x18')](_0x37aa4c)[_0xb1f7('0x2b')](_0x245b66);};}exports[_0xb1f7('0x2c')]=function(_0x41b942,_0x5c9120){var _0x36b1cd={},_0x175e42={},_0x2ed355={'count':0x0,'rows':[]};var _0x184ae6=_[_0xb1f7('0x2d')](db[_0xb1f7('0x2e')][_0xb1f7('0x2f')],function(_0x57983f){return{'name':_0x57983f[_0xb1f7('0x30')],'type':_0x57983f[_0xb1f7('0x31')][_0xb1f7('0x32')]};});_0x175e42['model']=_[_0xb1f7('0x2d')](_0x184ae6,_0xb1f7('0x2a'));_0x175e42[_0xb1f7('0x33')]=_['keys'](_0x41b942['query']);_0x175e42[_0xb1f7('0x34')]=_['intersection'](_0x175e42[_0xb1f7('0x35')],_0x175e42[_0xb1f7('0x33')]);_0x36b1cd['attributes']=_['intersection'](_0x175e42['model'],qs[_0xb1f7('0x36')](_0x41b942[_0xb1f7('0x33')][_0xb1f7('0x36')]));_0x36b1cd[_0xb1f7('0x37')]=_0x36b1cd[_0xb1f7('0x37')]['length']?_0x36b1cd[_0xb1f7('0x37')]:_0x175e42[_0xb1f7('0x35')];if(!_0x41b942['query']['hasOwnProperty'](_0xb1f7('0x38'))){_0x36b1cd[_0xb1f7('0x1c')]=qs[_0xb1f7('0x1c')](_0x41b942[_0xb1f7('0x33')][_0xb1f7('0x1c')]);_0x36b1cd[_0xb1f7('0x39')]=qs[_0xb1f7('0x39')](_0x41b942[_0xb1f7('0x33')]['offset']);}_0x36b1cd[_0xb1f7('0x3a')]=qs[_0xb1f7('0x3b')](_0x41b942['query']['sort']);_0x36b1cd[_0xb1f7('0x3c')]=qs[_0xb1f7('0x34')](_[_0xb1f7('0x3d')](_0x41b942[_0xb1f7('0x33')],_0x175e42[_0xb1f7('0x34')]),_0x184ae6);if(_0x41b942[_0xb1f7('0x33')][_0xb1f7('0x3e')]){_0x36b1cd[_0xb1f7('0x3c')]=_['merge'](_0x36b1cd['where'],{'$or':_[_0xb1f7('0x2d')](_0x184ae6,function(_0x49ece7){if(_0x49ece7['type']!==_0xb1f7('0x3f')){var _0x573681={};_0x573681[_0x49ece7[_0xb1f7('0x2a')]]={'$like':'%'+_0x41b942[_0xb1f7('0x33')][_0xb1f7('0x3e')]+'%'};return _0x573681;}})});}_0x36b1cd=_[_0xb1f7('0x40')]({},_0x36b1cd,_0x41b942[_0xb1f7('0x41')]);var _0x5dbc14={'where':_0x36b1cd[_0xb1f7('0x3c')]};return db[_0xb1f7('0x2e')][_0xb1f7('0x1b')](_0x5dbc14)['then'](function(_0x2911d1){_0x2ed355[_0xb1f7('0x1b')]=_0x2911d1;if(_0x41b942[_0xb1f7('0x33')][_0xb1f7('0x42')]){_0x36b1cd['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xb1f7('0x43')](_0x36b1cd);})['then'](function(_0x5c0479){_0x2ed355['rows']=_0x5c0479;return _0x2ed355;})[_0xb1f7('0x24')](respondWithFilteredResult(_0x5c9120,_0x36b1cd))[_0xb1f7('0x44')](handleError(_0x5c9120,null));};exports[_0xb1f7('0x45')]=function(_0x1604d6,_0x1f32b8){var _0x4938b3={'raw':!![],'where':{'id':_0x1604d6[_0xb1f7('0x46')]['id']}},_0x48d248={};_0x48d248[_0xb1f7('0x35')]=_['keys'](db['AnalyticExtractedReport'][_0xb1f7('0x2f')]);_0x48d248['query']=_[_0xb1f7('0x47')](_0x1604d6['query']);_0x48d248[_0xb1f7('0x34')]=_[_0xb1f7('0x48')](_0x48d248['model'],_0x48d248[_0xb1f7('0x33')]);_0x4938b3[_0xb1f7('0x37')]=_[_0xb1f7('0x48')](_0x48d248[_0xb1f7('0x35')],qs['fields'](_0x1604d6['query'][_0xb1f7('0x36')]));_0x4938b3[_0xb1f7('0x37')]=_0x4938b3['attributes'][_0xb1f7('0x49')]?_0x4938b3[_0xb1f7('0x37')]:_0x48d248[_0xb1f7('0x35')];if(_0x1604d6[_0xb1f7('0x33')][_0xb1f7('0x42')]){_0x4938b3['include']=[{'all':!![]}];}_0x4938b3=_[_0xb1f7('0x40')]({},_0x4938b3,_0x1604d6[_0xb1f7('0x41')]);return db['AnalyticExtractedReport']['find'](_0x4938b3)[_0xb1f7('0x24')](handleEntityNotFound(_0x1f32b8,null))[_0xb1f7('0x24')](respondWithResult(_0x1f32b8,null))['catch'](handleError(_0x1f32b8,null));};exports[_0xb1f7('0x4a')]=function(_0x37bc9a,_0x1ab427){return db[_0xb1f7('0x2e')][_0xb1f7('0x4a')](_0x37bc9a['body'],{})[_0xb1f7('0x24')](function(_0x12ece4){var _0xed0ef=_0x37bc9a[_0xb1f7('0x4b')][_0xb1f7('0x25')]({'plain':!![]});if(!_0xed0ef)throw new Error(_0xb1f7('0x4c'));if(_0xed0ef[_0xb1f7('0x4d')]===_0xb1f7('0x4b')){var _0x18dab9=_0x12ece4['get']({'plain':!![]});var _0xf096ea=_0xb1f7('0x26');return db['UserProfileSection'][_0xb1f7('0x4e')]({'where':{'name':_0xf096ea,'userProfileId':_0xed0ef[_0xb1f7('0x4f')]},'raw':!![]})[_0xb1f7('0x24')](function(_0x22bc57){if(_0x22bc57&&_0x22bc57[_0xb1f7('0x50')]===0x0){return db[_0xb1f7('0x27')][_0xb1f7('0x4a')]({'name':_0x18dab9['name'],'resourceId':_0x18dab9['id'],'type':_0x22bc57[_0xb1f7('0x2a')],'sectionId':_0x22bc57['id']},{})[_0xb1f7('0x24')](function(){return _0x12ece4;});}else{return _0x12ece4;}})[_0xb1f7('0x44')](function(_0x3b8679){logger[_0xb1f7('0x28')](_0xb1f7('0x51'),_0x3b8679);throw _0x3b8679;});}return _0x12ece4;})[_0xb1f7('0x24')](respondWithResult(_0x1ab427,0xc9))[_0xb1f7('0x44')](handleError(_0x1ab427,null));};exports[_0xb1f7('0x22')]=function(_0x2bcaf0,_0x284bc7){if(_0x2bcaf0[_0xb1f7('0x52')]['id']){delete _0x2bcaf0[_0xb1f7('0x52')]['id'];}return db['AnalyticExtractedReport'][_0xb1f7('0x4e')]({'where':{'id':_0x2bcaf0[_0xb1f7('0x46')]['id']}})[_0xb1f7('0x24')](handleEntityNotFound(_0x284bc7,null))[_0xb1f7('0x24')](saveUpdates(_0x2bcaf0[_0xb1f7('0x52')],null))[_0xb1f7('0x24')](respondWithResult(_0x284bc7,null))[_0xb1f7('0x44')](handleError(_0x284bc7,null));};exports['destroy']=function(_0x1ae7f2,_0x16bc1b){return db[_0xb1f7('0x2e')]['find']({'where':{'id':_0x1ae7f2['params']['id']}})[_0xb1f7('0x24')](handleEntityNotFound(_0x16bc1b,null))[_0xb1f7('0x24')](removeEntity(_0x16bc1b,null))[_0xb1f7('0x44')](handleError(_0x16bc1b,null));};exports[_0xb1f7('0x53')]=function(_0x5033d8,_0x368008,_0x1f1c7f){return db[_0xb1f7('0x2e')]['find']({'where':{'id':_0x5033d8[_0xb1f7('0x46')]['id']},'attributes':[_0xb1f7('0x2a'),'basename',_0xb1f7('0x54'),_0xb1f7('0x55')],'raw':!![]})[_0xb1f7('0x24')](handleEntityNotFound(_0x368008,null))[_0xb1f7('0x24')](function(_0x299783){if(_0x299783){if(!fs['existsSync'](path[_0xb1f7('0x56')](config[_0xb1f7('0x57')],_0xb1f7('0x58'),_0x299783['savename']))){throw new db[(_0xb1f7('0x59'))][(_0xb1f7('0x5a'))](_0xb1f7('0x5b'));}if(_0x5033d8[_0xb1f7('0x33')]['exists']){return _0x368008[_0xb1f7('0x17')](0xc8);}return _0x368008['download'](path['join'](config[_0xb1f7('0x57')],_0xb1f7('0x58'),_0x299783['savename']),util[_0xb1f7('0x5c')](_0xb1f7('0x5d'),_0x299783['basename']||_0x299783['name'],_0x299783[_0xb1f7('0x55')][_0xb1f7('0x5e')]()));}})['catch'](handleError(_0x368008,null));};
\ No newline at end of file
+var _0xa68c=['basename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','json','count','offset','limit','status','set','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','end','stack','name','index','map','rawAttributes','type','key','query','filters','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','params','keys','intersection','length','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa68c,0x191));var _0xca68=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa68c[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xca68('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xca68('0x1'));var zipdir=require(_0xca68('0x2'));var jsonpatch=require(_0xca68('0x3'));var rp=require(_0xca68('0x4'));var moment=require(_0xca68('0x5'));var BPromise=require(_0xca68('0x6'));var Mustache=require(_0xca68('0x7'));var util=require(_0xca68('0x8'));var path=require(_0xca68('0x9'));var sox=require(_0xca68('0xa'));var csv=require('to-csv');var ejs=require(_0xca68('0xb'));var fs=require('fs');var _=require(_0xca68('0xc'));var squel=require('squel');var crypto=require(_0xca68('0xd'));var jsforce=require(_0xca68('0xe'));var deskjs=require(_0xca68('0xf'));var toCsv=require(_0xca68('0x10'));var querystring=require('querystring');var Papa=require(_0xca68('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca68('0x12'));var as=require(_0xca68('0x13'));var hardwareService=require(_0xca68('0x14'));var logger=require(_0xca68('0x15'))('api');var utils=require(_0xca68('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xca68('0x17'));var db=require(_0xca68('0x18'))['db'];function respondWithStatusCode(_0x10f8c3,_0x26b6de){_0x26b6de=_0x26b6de||0xcc;return function(_0x3fd41f){if(_0x3fd41f){return _0x10f8c3['sendStatus'](_0x26b6de);}return _0x10f8c3['status'](_0x26b6de)['end']();};}function respondWithResult(_0x37ae88,_0x5620c9){_0x5620c9=_0x5620c9||0xc8;return function(_0x45ded8){if(_0x45ded8){return _0x37ae88['status'](_0x5620c9)[_0xca68('0x19')](_0x45ded8);}};}function respondWithFilteredResult(_0x590db2,_0x2f5b6a){return function(_0xded6ef){if(_0xded6ef){var _0x58b66f=_0xded6ef[_0xca68('0x1a')],_0x7f5427=_0x2f5b6a['offset'],_0x3cbc03=_0x2f5b6a[_0xca68('0x1b')]+_0x2f5b6a[_0xca68('0x1c')],_0x55275a;if(_0x3cbc03>=_0x58b66f){_0x3cbc03=_0x58b66f;_0x55275a=0xc8;}else{_0x55275a=0xce;}_0x590db2[_0xca68('0x1d')](_0x55275a);return _0x590db2[_0xca68('0x1e')]('Content-Range',_0x7f5427+'-'+_0x3cbc03+'/'+_0x58b66f)[_0xca68('0x19')](_0xded6ef);}return null;};}function patchUpdates(_0xc34dda){return function(_0x220b01){try{jsonpatch[_0xca68('0x1f')](_0x220b01,_0xc34dda,!![]);}catch(_0x30f7c9){return BPromise['reject'](_0x30f7c9);}return _0x220b01[_0xca68('0x20')]();};}function saveUpdates(_0x37e75f,_0x1e400f){return function(_0x929b0f){if(_0x929b0f){return _0x929b0f[_0xca68('0x21')](_0x37e75f)[_0xca68('0x22')](function(_0x511b88){return _0x511b88;});}return null;};}function removeEntity(_0x53a0a5,_0x4e7fa6){return function(_0x1c4c0d){if(_0x1c4c0d){return _0x1c4c0d[_0xca68('0x23')]()[_0xca68('0x22')](function(){var _0x3ce042=_0x1c4c0d['get']({'plain':!![]});var _0x38d4d6=_0xca68('0x24');return db[_0xca68('0x25')][_0xca68('0x23')]({'where':{'type':_0x38d4d6,'resourceId':_0x3ce042['id']}})[_0xca68('0x22')](function(){return _0x1c4c0d;});})[_0xca68('0x22')](function(){_0x53a0a5[_0xca68('0x1d')](0xcc)[_0xca68('0x26')]();});}};}function handleEntityNotFound(_0x3bbfe3,_0x11f351){return function(_0x16db65){if(!_0x16db65){_0x3bbfe3['sendStatus'](0x194);}return _0x16db65;};}function handleError(_0x4b510b,_0x4c609b){_0x4c609b=_0x4c609b||0x1f4;return function(_0x28cf87){logger['error'](_0x28cf87[_0xca68('0x27')]);if(_0x28cf87[_0xca68('0x28')]){delete _0x28cf87['name'];}_0x4b510b[_0xca68('0x1d')](_0x4c609b)['send'](_0x28cf87);};}exports[_0xca68('0x29')]=function(_0x2f31a9,_0x11cce6){var _0x2327c8={},_0x30ac3c={},_0x2fc9b9={'count':0x0,'rows':[]};var _0x53c5fe=_[_0xca68('0x2a')](db['AnalyticExtractedReport'][_0xca68('0x2b')],function(_0x18b506){return{'name':_0x18b506['fieldName'],'type':_0x18b506[_0xca68('0x2c')][_0xca68('0x2d')]};});_0x30ac3c['model']=_[_0xca68('0x2a')](_0x53c5fe,_0xca68('0x28'));_0x30ac3c[_0xca68('0x2e')]=_['keys'](_0x2f31a9[_0xca68('0x2e')]);_0x30ac3c[_0xca68('0x2f')]=_['intersection'](_0x30ac3c['model'],_0x30ac3c[_0xca68('0x2e')]);_0x2327c8['attributes']=_['intersection'](_0x30ac3c['model'],qs[_0xca68('0x30')](_0x2f31a9['query']['fields']));_0x2327c8[_0xca68('0x31')]=_0x2327c8[_0xca68('0x31')]['length']?_0x2327c8[_0xca68('0x31')]:_0x30ac3c[_0xca68('0x32')];if(!_0x2f31a9[_0xca68('0x2e')][_0xca68('0x33')](_0xca68('0x34'))){_0x2327c8['limit']=qs['limit'](_0x2f31a9[_0xca68('0x2e')][_0xca68('0x1c')]);_0x2327c8['offset']=qs[_0xca68('0x1b')](_0x2f31a9[_0xca68('0x2e')][_0xca68('0x1b')]);}_0x2327c8[_0xca68('0x35')]=qs[_0xca68('0x36')](_0x2f31a9['query'][_0xca68('0x36')]);_0x2327c8[_0xca68('0x37')]=qs[_0xca68('0x2f')](_[_0xca68('0x38')](_0x2f31a9[_0xca68('0x2e')],_0x30ac3c[_0xca68('0x2f')]),_0x53c5fe);if(_0x2f31a9[_0xca68('0x2e')][_0xca68('0x39')]){_0x2327c8[_0xca68('0x37')]=_[_0xca68('0x3a')](_0x2327c8[_0xca68('0x37')],{'$or':_[_0xca68('0x2a')](_0x53c5fe,function(_0x48f25f){if(_0x48f25f[_0xca68('0x2c')]!==_0xca68('0x3b')){var _0x197237={};_0x197237[_0x48f25f[_0xca68('0x28')]]={'$like':'%'+_0x2f31a9['query']['filter']+'%'};return _0x197237;}})});}_0x2327c8=_['merge']({},_0x2327c8,_0x2f31a9[_0xca68('0x3c')]);var _0x42c574={'where':_0x2327c8[_0xca68('0x37')]};return db[_0xca68('0x3d')][_0xca68('0x1a')](_0x42c574)[_0xca68('0x22')](function(_0x15bf79){_0x2fc9b9[_0xca68('0x1a')]=_0x15bf79;if(_0x2f31a9['query'][_0xca68('0x3e')]){_0x2327c8['include']=[{'all':!![]}];}return db[_0xca68('0x3d')][_0xca68('0x3f')](_0x2327c8);})[_0xca68('0x22')](function(_0x3b671e){_0x2fc9b9[_0xca68('0x40')]=_0x3b671e;return _0x2fc9b9;})[_0xca68('0x22')](respondWithFilteredResult(_0x11cce6,_0x2327c8))[_0xca68('0x41')](handleError(_0x11cce6,null));};exports['show']=function(_0x2a27bf,_0x131a65){var _0x38ad20={'raw':!![],'where':{'id':_0x2a27bf[_0xca68('0x42')]['id']}},_0x16072b={};_0x16072b[_0xca68('0x32')]=_['keys'](db[_0xca68('0x3d')][_0xca68('0x2b')]);_0x16072b[_0xca68('0x2e')]=_[_0xca68('0x43')](_0x2a27bf['query']);_0x16072b['filters']=_[_0xca68('0x44')](_0x16072b['model'],_0x16072b['query']);_0x38ad20[_0xca68('0x31')]=_[_0xca68('0x44')](_0x16072b[_0xca68('0x32')],qs[_0xca68('0x30')](_0x2a27bf[_0xca68('0x2e')][_0xca68('0x30')]));_0x38ad20[_0xca68('0x31')]=_0x38ad20['attributes'][_0xca68('0x45')]?_0x38ad20['attributes']:_0x16072b['model'];if(_0x2a27bf['query'][_0xca68('0x3e')]){_0x38ad20[_0xca68('0x46')]=[{'all':!![]}];}_0x38ad20=_['merge']({},_0x38ad20,_0x2a27bf['options']);return db['AnalyticExtractedReport']['find'](_0x38ad20)[_0xca68('0x22')](handleEntityNotFound(_0x131a65,null))['then'](respondWithResult(_0x131a65,null))['catch'](handleError(_0x131a65,null));};exports['create']=function(_0x2763dd,_0x5009b7){return db[_0xca68('0x3d')][_0xca68('0x47')](_0x2763dd['body'],{})[_0xca68('0x22')](function(_0x46429c){var _0x346fcd=_0x2763dd[_0xca68('0x48')][_0xca68('0x49')]({'plain':!![]});if(!_0x346fcd)throw new Error(_0xca68('0x4a'));if(_0x346fcd[_0xca68('0x4b')]==='user'){var _0x20ec82=_0x46429c[_0xca68('0x49')]({'plain':!![]});var _0x283486='ExtractedReports';return db[_0xca68('0x4c')][_0xca68('0x4d')]({'where':{'name':_0x283486,'userProfileId':_0x346fcd[_0xca68('0x4e')]},'raw':!![]})['then'](function(_0x5a524a){if(_0x5a524a&&_0x5a524a[_0xca68('0x4f')]===0x0){return db[_0xca68('0x25')][_0xca68('0x47')]({'name':_0x20ec82[_0xca68('0x28')],'resourceId':_0x20ec82['id'],'type':_0x5a524a[_0xca68('0x28')],'sectionId':_0x5a524a['id']},{})[_0xca68('0x22')](function(){return _0x46429c;});}else{return _0x46429c;}})['catch'](function(_0x224bc7){logger[_0xca68('0x50')](_0xca68('0x51'),_0x224bc7);throw _0x224bc7;});}return _0x46429c;})[_0xca68('0x22')](respondWithResult(_0x5009b7,0xc9))[_0xca68('0x41')](handleError(_0x5009b7,null));};exports[_0xca68('0x21')]=function(_0x1e4e16,_0xd4468a){if(_0x1e4e16[_0xca68('0x52')]['id']){delete _0x1e4e16['body']['id'];}return db[_0xca68('0x3d')][_0xca68('0x4d')]({'where':{'id':_0x1e4e16[_0xca68('0x42')]['id']}})[_0xca68('0x22')](handleEntityNotFound(_0xd4468a,null))['then'](saveUpdates(_0x1e4e16[_0xca68('0x52')],null))[_0xca68('0x22')](respondWithResult(_0xd4468a,null))[_0xca68('0x41')](handleError(_0xd4468a,null));};exports[_0xca68('0x23')]=function(_0xb3560b,_0x45ddc0){return db[_0xca68('0x3d')][_0xca68('0x4d')]({'where':{'id':_0xb3560b[_0xca68('0x42')]['id']}})[_0xca68('0x22')](handleEntityNotFound(_0x45ddc0,null))[_0xca68('0x22')](removeEntity(_0x45ddc0,null))[_0xca68('0x41')](handleError(_0x45ddc0,null));};exports[_0xca68('0x53')]=function(_0x3f2555,_0x4198b6,_0x418b2e){return db['AnalyticExtractedReport'][_0xca68('0x4d')]({'where':{'id':_0x3f2555['params']['id']},'attributes':[_0xca68('0x28'),_0xca68('0x54'),'savename',_0xca68('0x55')],'raw':!![]})[_0xca68('0x22')](handleEntityNotFound(_0x4198b6,null))[_0xca68('0x22')](function(_0xd20f7b){if(_0xd20f7b){if(!fs[_0xca68('0x56')](path[_0xca68('0x57')](config[_0xca68('0x58')],_0xca68('0x59'),_0xd20f7b['savename']))){throw new db['Sequelize'][(_0xca68('0x5a'))](_0xca68('0x5b'));}if(_0x3f2555['query'][_0xca68('0x5c')]){return _0x4198b6['sendStatus'](0xc8);}return _0x4198b6[_0xca68('0x53')](path['join'](config[_0xca68('0x58')],_0xca68('0x59'),_0xd20f7b[_0xca68('0x5d')]),util[_0xca68('0x5e')](_0xca68('0x5f'),_0xd20f7b[_0xca68('0x54')]||_0xd20f7b[_0xca68('0x28')],_0xd20f7b['output'][_0xca68('0x60')]()));}})[_0xca68('0x41')](handleError(_0x4198b6,null));};
\ No newline at end of file