Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / analyticExtractedReport / analyticExtractedReport.controller.js
index 4f5fc07..18682de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['basename','savename','join','root','Sequelize','ValidationError','exists','server/files/reports','format','%s.%s','output','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download'];(function(_0x405c6e,_0x52915d){var _0x4c345e=function(_0x3cb7bd){while(--_0x3cb7bd){_0x405c6e['push'](_0x405c6e['shift']());}};_0x4c345e(++_0x52915d);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4a400d,_0x333bc3){_0x4a400d=_0x4a400d-0x0;var _0x5658b8=_0xb03e[_0x4a400d];return _0x5658b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){var _0x16cd4=_0x5dcda3[_0xeb03('0x2a')]({'plain':!![]});var _0x3f276a=_0xeb03('0x2b');return db[_0xeb03('0x2c')][_0xeb03('0x29')]({'where':{'type':_0x3f276a,'resourceId':_0x16cd4['id']}})[_0xeb03('0x28')](function(){return _0x5dcda3;});})['then'](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x2683f9,_0x1ada2e){return function(_0x4cdea6){if(!_0x4cdea6){_0x2683f9['sendStatus'](0x194);}return _0x4cdea6;};}function handleError(_0x1064a5,_0x49e449){_0x49e449=_0x49e449||0x1f4;return function(_0x31a622){logger[_0xeb03('0x2d')](_0x31a622[_0xeb03('0x2e')]);if(_0x31a622['name']){delete _0x31a622[_0xeb03('0x2f')];}_0x1064a5['status'](_0x49e449)['send'](_0x31a622);};}exports['index']=function(_0x538d19,_0x421a27){var _0x433ce8={},_0x5d0cc1={},_0x528479={'count':0x0,'rows':[]};var _0x4d830a=_['map'](db[_0xeb03('0x30')][_0xeb03('0x31')],function(_0x32aff7){return{'name':_0x32aff7[_0xeb03('0x32')],'type':_0x32aff7[_0xeb03('0x33')]['key']};});_0x5d0cc1[_0xeb03('0x34')]=_['map'](_0x4d830a,_0xeb03('0x2f'));_0x5d0cc1[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x538d19[_0xeb03('0x35')]);_0x5d0cc1[_0xeb03('0x37')]=_[_0xeb03('0x38')](_0x5d0cc1[_0xeb03('0x34')],_0x5d0cc1[_0xeb03('0x35')]);_0x433ce8['attributes']=_[_0xeb03('0x38')](_0x5d0cc1['model'],qs[_0xeb03('0x39')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x39')]));_0x433ce8[_0xeb03('0x3a')]=_0x433ce8[_0xeb03('0x3a')][_0xeb03('0x3b')]?_0x433ce8['attributes']:_0x5d0cc1[_0xeb03('0x34')];if(!_0x538d19['query']['hasOwnProperty']('nolimit')){_0x433ce8[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x20')]);_0x433ce8[_0xeb03('0x22')]=qs['offset'](_0x538d19[_0xeb03('0x35')][_0xeb03('0x22')]);}_0x433ce8[_0xeb03('0x3c')]=qs['sort'](_0x538d19['query'][_0xeb03('0x3d')]);_0x433ce8[_0xeb03('0x3e')]=qs[_0xeb03('0x37')](_['pick'](_0x538d19[_0xeb03('0x35')],_0x5d0cc1[_0xeb03('0x37')]),_0x4d830a);if(_0x538d19['query']['filter']){_0x433ce8[_0xeb03('0x3e')]=_[_0xeb03('0x3f')](_0x433ce8['where'],{'$or':_[_0xeb03('0x40')](_0x4d830a,function(_0x16551c){if(_0x16551c[_0xeb03('0x33')]!==_0xeb03('0x41')){var _0x376088={};_0x376088[_0x16551c[_0xeb03('0x2f')]]={'$like':'%'+_0x538d19[_0xeb03('0x35')][_0xeb03('0x42')]+'%'};return _0x376088;}})});}_0x433ce8=_[_0xeb03('0x3f')]({},_0x433ce8,_0x538d19[_0xeb03('0x43')]);var _0x367d19={'where':_0x433ce8[_0xeb03('0x3e')]};return db[_0xeb03('0x30')][_0xeb03('0x21')](_0x367d19)[_0xeb03('0x28')](function(_0x6b95dd){_0x528479[_0xeb03('0x21')]=_0x6b95dd;if(_0x538d19[_0xeb03('0x35')][_0xeb03('0x44')]){_0x433ce8[_0xeb03('0x45')]=[{'all':!![]}];}return db[_0xeb03('0x30')][_0xeb03('0x46')](_0x433ce8);})[_0xeb03('0x28')](function(_0x5bb7d9){_0x528479['rows']=_0x5bb7d9;return _0x528479;})[_0xeb03('0x28')](respondWithFilteredResult(_0x421a27,_0x433ce8))[_0xeb03('0x47')](handleError(_0x421a27,null));};exports[_0xeb03('0x48')]=function(_0x3c8d42,_0x5e27da){var _0x39ab97={'raw':!![],'where':{'id':_0x3c8d42[_0xeb03('0x49')]['id']}},_0x103c78={};_0x103c78['model']=_[_0xeb03('0x36')](db[_0xeb03('0x30')][_0xeb03('0x31')]);_0x103c78[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x3c8d42['query']);_0x103c78['filters']=_[_0xeb03('0x38')](_0x103c78['model'],_0x103c78['query']);_0x39ab97['attributes']=_[_0xeb03('0x38')](_0x103c78[_0xeb03('0x34')],qs[_0xeb03('0x39')](_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x39')]));_0x39ab97[_0xeb03('0x3a')]=_0x39ab97['attributes'][_0xeb03('0x3b')]?_0x39ab97['attributes']:_0x103c78['model'];if(_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x44')]){_0x39ab97[_0xeb03('0x45')]=[{'all':!![]}];}_0x39ab97=_['merge']({},_0x39ab97,_0x3c8d42[_0xeb03('0x43')]);return db[_0xeb03('0x30')][_0xeb03('0x4a')](_0x39ab97)[_0xeb03('0x28')](handleEntityNotFound(_0x5e27da,null))[_0xeb03('0x28')](respondWithResult(_0x5e27da,null))['catch'](handleError(_0x5e27da,null));};exports[_0xeb03('0x4b')]=function(_0x4dc1f6,_0x13c295){return db[_0xeb03('0x30')][_0xeb03('0x4b')](_0x4dc1f6[_0xeb03('0x4c')],{})[_0xeb03('0x28')](function(_0x46f4a7){var _0x42e73f=_0x4dc1f6[_0xeb03('0x4d')][_0xeb03('0x2a')]({'plain':!![]});if(!_0x42e73f)throw new Error(_0xeb03('0x4e'));if(_0x42e73f[_0xeb03('0x4f')]===_0xeb03('0x4d')){var _0x2f2066=_0x46f4a7[_0xeb03('0x2a')]({'plain':!![]});var _0x2a7eaf=_0xeb03('0x2b');return db[_0xeb03('0x50')][_0xeb03('0x4a')]({'where':{'name':_0x2a7eaf,'userProfileId':_0x42e73f[_0xeb03('0x51')]},'raw':!![]})[_0xeb03('0x28')](function(_0x353e29){if(_0x353e29&&_0x353e29[_0xeb03('0x52')]===0x0){return db[_0xeb03('0x2c')][_0xeb03('0x4b')]({'name':_0x2f2066['name'],'resourceId':_0x2f2066['id'],'type':_0x353e29[_0xeb03('0x2f')],'sectionId':_0x353e29['id']},{})[_0xeb03('0x28')](function(){return _0x46f4a7;});}else{return _0x46f4a7;}})[_0xeb03('0x47')](function(_0x5405b4){logger[_0xeb03('0x2d')](_0xeb03('0x53'),_0x5405b4);throw _0x5405b4;});}return _0x46f4a7;})[_0xeb03('0x28')](respondWithResult(_0x13c295,0xc9))[_0xeb03('0x47')](handleError(_0x13c295,null));};exports[_0xeb03('0x27')]=function(_0x68d263,_0x3ee370){if(_0x68d263[_0xeb03('0x4c')]['id']){delete _0x68d263[_0xeb03('0x4c')]['id'];}return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x68d263[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x3ee370,null))[_0xeb03('0x28')](saveUpdates(_0x68d263['body'],null))[_0xeb03('0x28')](respondWithResult(_0x3ee370,null))[_0xeb03('0x47')](handleError(_0x3ee370,null));};exports[_0xeb03('0x29')]=function(_0x259db7,_0x10fed0){return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x259db7[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x10fed0,null))[_0xeb03('0x28')](removeEntity(_0x10fed0,null))['catch'](handleError(_0x10fed0,null));};exports[_0xeb03('0x54')]=function(_0x3a1cd2,_0x2bb0be,_0x62105a){return db['AnalyticExtractedReport'][_0xeb03('0x4a')]({'where':{'id':_0x3a1cd2[_0xeb03('0x49')]['id']},'attributes':[_0xeb03('0x2f'),_0xeb03('0x55'),_0xeb03('0x56'),'output'],'raw':!![]})[_0xeb03('0x28')](handleEntityNotFound(_0x2bb0be,null))[_0xeb03('0x28')](function(_0x28e488){if(_0x28e488){if(!fs['existsSync'](path[_0xeb03('0x57')](config[_0xeb03('0x58')],'server/files/reports',_0x28e488[_0xeb03('0x56')]))){throw new db[(_0xeb03('0x59'))][(_0xeb03('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3a1cd2[_0xeb03('0x35')][_0xeb03('0x5b')]){return _0x2bb0be['sendStatus'](0xc8);}return _0x2bb0be[_0xeb03('0x54')](path[_0xeb03('0x57')](config[_0xeb03('0x58')],_0xeb03('0x5c'),_0x28e488[_0xeb03('0x56')]),util[_0xeb03('0x5d')](_0xeb03('0x5e'),_0x28e488[_0xeb03('0x55')]||_0x28e488['name'],_0x28e488[_0xeb03('0x5f')]['toLowerCase']()));}})[_0xeb03('0x47')](handleError(_0x2bb0be,null));};
\ No newline at end of file
+var _0xbfcc=['moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','toLowerCase','eml-format','fast-json-patch','request-promise'];(function(_0x2d70f0,_0x312ee1){var _0x37a85d=function(_0x241eeb){while(--_0x241eeb){_0x2d70f0['push'](_0x2d70f0['shift']());}};_0x37a85d(++_0x312ee1);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0xbfcc[_0x56fe98];return _0x212f4f;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){var _0x49f5bf=_0x34cffa[_0xcbfc('0x23')]({'plain':!![]});var _0x51284a=_0xcbfc('0x24');return db[_0xcbfc('0x25')]['destroy']({'where':{'type':_0x51284a,'resourceId':_0x49f5bf['id']}})[_0xcbfc('0x21')](function(){return _0x34cffa;});})[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x3c3afd,_0x2f7549){return function(_0x41f3b8){if(!_0x41f3b8){_0x3c3afd['sendStatus'](0x194);}return _0x41f3b8;};}function handleError(_0x29f896,_0x1ec530){_0x1ec530=_0x1ec530||0x1f4;return function(_0x4f632a){logger[_0xcbfc('0x26')](_0x4f632a[_0xcbfc('0x27')]);if(_0x4f632a[_0xcbfc('0x28')]){delete _0x4f632a[_0xcbfc('0x28')];}_0x29f896[_0xcbfc('0x18')](_0x1ec530)[_0xcbfc('0x29')](_0x4f632a);};}exports[_0xcbfc('0x2a')]=function(_0x5366cf,_0x41b68b){var _0x433300={},_0x3f9d20={},_0x20a378={'count':0x0,'rows':[]};var _0x500a0b=_[_0xcbfc('0x2b')](db[_0xcbfc('0x2c')][_0xcbfc('0x2d')],function(_0x245986){return{'name':_0x245986[_0xcbfc('0x2e')],'type':_0x245986[_0xcbfc('0x2f')][_0xcbfc('0x30')]};});_0x3f9d20['model']=_[_0xcbfc('0x2b')](_0x500a0b,_0xcbfc('0x28'));_0x3f9d20['query']=_[_0xcbfc('0x31')](_0x5366cf[_0xcbfc('0x32')]);_0x3f9d20[_0xcbfc('0x33')]=_['intersection'](_0x3f9d20['model'],_0x3f9d20['query']);_0x433300[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x3f9d20[_0xcbfc('0x36')],qs[_0xcbfc('0x37')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x433300[_0xcbfc('0x34')]=_0x433300[_0xcbfc('0x34')]['length']?_0x433300[_0xcbfc('0x34')]:_0x3f9d20[_0xcbfc('0x36')];if(!_0x5366cf['query'][_0xcbfc('0x38')]('nolimit')){_0x433300[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x5366cf[_0xcbfc('0x32')]['limit']);_0x433300[_0xcbfc('0x1b')]=qs['offset'](_0x5366cf['query'][_0xcbfc('0x1b')]);}_0x433300[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x433300[_0xcbfc('0x3b')]=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x5366cf['query'],_0x3f9d20[_0xcbfc('0x33')]),_0x500a0b);if(_0x5366cf['query'][_0xcbfc('0x3d')]){_0x433300[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x433300[_0xcbfc('0x3b')],{'$or':_['map'](_0x500a0b,function(_0x5306e9){if(_0x5306e9[_0xcbfc('0x2f')]!==_0xcbfc('0x3f')){var _0x404f46={};_0x404f46[_0x5306e9[_0xcbfc('0x28')]]={'$like':'%'+_0x5366cf[_0xcbfc('0x32')]['filter']+'%'};return _0x404f46;}})});}_0x433300=_[_0xcbfc('0x3e')]({},_0x433300,_0x5366cf[_0xcbfc('0x40')]);var _0xf2da32={'where':_0x433300['where']};return db[_0xcbfc('0x2c')][_0xcbfc('0x1c')](_0xf2da32)[_0xcbfc('0x21')](function(_0x4ca55c){_0x20a378[_0xcbfc('0x1c')]=_0x4ca55c;if(_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0x433300[_0xcbfc('0x42')]=[{'all':!![]}];}return db[_0xcbfc('0x2c')][_0xcbfc('0x43')](_0x433300);})[_0xcbfc('0x21')](function(_0x561544){_0x20a378[_0xcbfc('0x44')]=_0x561544;return _0x20a378;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x41b68b,_0x433300))['catch'](handleError(_0x41b68b,null));};exports[_0xcbfc('0x45')]=function(_0x50a01c,_0x17b87b){var _0xdc0521={'raw':!![],'where':{'id':_0x50a01c[_0xcbfc('0x46')]['id']}},_0xd609ec={};_0xd609ec[_0xcbfc('0x36')]=_[_0xcbfc('0x31')](db['AnalyticExtractedReport'][_0xcbfc('0x2d')]);_0xd609ec[_0xcbfc('0x32')]=_[_0xcbfc('0x31')](_0x50a01c[_0xcbfc('0x32')]);_0xd609ec[_0xcbfc('0x33')]=_[_0xcbfc('0x35')](_0xd609ec[_0xcbfc('0x36')],_0xd609ec['query']);_0xdc0521[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0xd609ec['model'],qs[_0xcbfc('0x37')](_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0xdc0521['attributes']=_0xdc0521[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0xdc0521[_0xcbfc('0x34')]:_0xd609ec[_0xcbfc('0x36')];if(_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0xdc0521[_0xcbfc('0x42')]=[{'all':!![]}];}_0xdc0521=_['merge']({},_0xdc0521,_0x50a01c['options']);return db[_0xcbfc('0x2c')][_0xcbfc('0x48')](_0xdc0521)[_0xcbfc('0x21')](handleEntityNotFound(_0x17b87b,null))[_0xcbfc('0x21')](respondWithResult(_0x17b87b,null))['catch'](handleError(_0x17b87b,null));};exports['create']=function(_0x2e89bf,_0xe5c5ef){return db[_0xcbfc('0x2c')]['create'](_0x2e89bf[_0xcbfc('0x49')],{})[_0xcbfc('0x21')](function(_0x4446b7){var _0x4b3096=_0x2e89bf[_0xcbfc('0x4a')][_0xcbfc('0x23')]({'plain':!![]});if(!_0x4b3096)throw new Error(_0xcbfc('0x4b'));if(_0x4b3096[_0xcbfc('0x4c')]===_0xcbfc('0x4a')){var _0xd9976d=_0x4446b7[_0xcbfc('0x23')]({'plain':!![]});var _0x374998=_0xcbfc('0x24');return db[_0xcbfc('0x4d')]['find']({'where':{'name':_0x374998,'userProfileId':_0x4b3096[_0xcbfc('0x4e')]},'raw':!![]})[_0xcbfc('0x21')](function(_0x44cc11){if(_0x44cc11&&_0x44cc11['autoAssociation']===0x0){return db[_0xcbfc('0x25')][_0xcbfc('0x4f')]({'name':_0xd9976d['name'],'resourceId':_0xd9976d['id'],'type':_0x44cc11[_0xcbfc('0x28')],'sectionId':_0x44cc11['id']},{})[_0xcbfc('0x21')](function(){return _0x4446b7;});}else{return _0x4446b7;}})[_0xcbfc('0x50')](function(_0x25e48d){logger['error'](_0xcbfc('0x51'),_0x25e48d);throw _0x25e48d;});}return _0x4446b7;})[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,0xc9))['catch'](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x52')]=function(_0x34db13,_0x3ed9f0){if(_0x34db13[_0xcbfc('0x49')]['id']){delete _0x34db13[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x34db13[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x3ed9f0,null))[_0xcbfc('0x21')](saveUpdates(_0x34db13['body'],null))[_0xcbfc('0x21')](respondWithResult(_0x3ed9f0,null))['catch'](handleError(_0x3ed9f0,null));};exports['destroy']=function(_0x4a10e6,_0x4239da){return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x4a10e6[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x4239da,null))[_0xcbfc('0x21')](removeEntity(_0x4239da,null))[_0xcbfc('0x50')](handleError(_0x4239da,null));};exports[_0xcbfc('0x53')]=function(_0x4d2df1,_0x9e0c38,_0xf5f5e1){return db[_0xcbfc('0x2c')]['find']({'where':{'id':_0x4d2df1[_0xcbfc('0x46')]['id']},'attributes':[_0xcbfc('0x28'),_0xcbfc('0x54'),_0xcbfc('0x55'),_0xcbfc('0x56')],'raw':!![]})[_0xcbfc('0x21')](handleEntityNotFound(_0x9e0c38,null))[_0xcbfc('0x21')](function(_0x57150c){if(_0x57150c){if(!fs[_0xcbfc('0x57')](path['join'](config[_0xcbfc('0x58')],_0xcbfc('0x59'),_0x57150c['savename']))){throw new db[(_0xcbfc('0x5a'))]['ValidationError'](_0xcbfc('0x5b'));}if(_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x5c')]){return _0x9e0c38[_0xcbfc('0x16')](0xc8);}return _0x9e0c38[_0xcbfc('0x53')](path[_0xcbfc('0x5d')](config['root'],_0xcbfc('0x59'),_0x57150c[_0xcbfc('0x55')]),util['format'](_0xcbfc('0x5e'),_0x57150c[_0xcbfc('0x54')]||_0x57150c[_0xcbfc('0x28')],_0x57150c[_0xcbfc('0x56')][_0xcbfc('0x5f')]()));}})[_0xcbfc('0x50')](handleError(_0x9e0c38,null));};
\ No newline at end of file