Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / analyticExtractedReport / analyticExtractedReport.controller.js
index b066b17..f314f1e 100644 (file)
@@ -1 +1 @@
-'use strict';const a16_0xccfe=['findOne','join','basename','name','rows','get','catch','send','status','map','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','AnalyticExtractedReport','util','%s.%s','150ZReXAR','attributes','filters','68767iJNVUn','count','109TrNBMn','exists','filter','Unable\x20to\x20retrieve\x20the\x20current\x20user','220428IRmQZA','@config/environment','sendStatus','654241xXMzLW','api','ExtractedReports','sort','where','params','779YSLBsm','type','include','includeAll','intersection','stack','update','format','234050KEmOXD','show','toLowerCase','UserProfileResource','create','query','set','sequelize','1RQXexT','1RmLfLu','fields','offset','keys','download','rawAttributes','limit','path','end','pick','@components/parsers/qs','error','length','model','269089kYpvsf','@utils/filter-attributes','242ibRGlS','Content-Range','body','files/reports','destroy','json','then','@config/logger','output','UserProfileSection','key','merge','order'];const a16_0x4a6b=function(_0x4a9cdf,_0x3aed96){_0x4a9cdf=_0x4a9cdf-0x157;let _0xccfed4=a16_0xccfe[_0x4a9cdf];return _0xccfed4;};const a16_0x93e469=a16_0x4a6b;(function(_0x2a9e4a,_0x131eb6){const _0x28bd35=a16_0x4a6b;while(!![]){try{const _0x58e24d=parseInt(_0x28bd35(0x189))+parseInt(_0x28bd35(0x172))*-parseInt(_0x28bd35(0x192))+parseInt(_0x28bd35(0x1a0))+parseInt(_0x28bd35(0x178))+-parseInt(_0x28bd35(0x16f))*-parseInt(_0x28bd35(0x181))+parseInt(_0x28bd35(0x1a2))*parseInt(_0x28bd35(0x174))+parseInt(_0x28bd35(0x191))*-parseInt(_0x28bd35(0x17b));if(_0x58e24d===_0x131eb6)break;else _0x2a9e4a['push'](_0x2a9e4a['shift']());}catch(_0x77863e){_0x2a9e4a['push'](_0x2a9e4a['shift']());}}}(a16_0xccfe,0x231ab));const util=require(a16_0x93e469(0x16d)),path=require(a16_0x93e469(0x199)),fs=require('fs'),_=require('lodash'),qs=require(a16_0x93e469(0x19c)),logger=require(a16_0x93e469(0x15a))(a16_0x93e469(0x17c)),config=require(a16_0x93e469(0x179)),{db}=require('@mysqldb'),{ValidationError}=require(a16_0x93e469(0x190)),{filterAttributes}=require(a16_0x93e469(0x1a1));function respondWithResult(_0x520352,_0x5ecff5){return _0x5ecff5=_0x5ecff5||0xc8,function(_0x499012){const _0xf836=a16_0x4a6b;if(_0x499012)return _0x520352[_0xf836(0x168)](_0x5ecff5)[_0xf836(0x158)](_0x499012);};}function respondWithFilteredResult(_0x533b19,_0x203454){return function(_0x363d49){const _0x49be50=a16_0x4a6b;if(_0x363d49){const _0x3d53b7=_0x363d49[_0x49be50(0x173)],_0x49f594=_0x203454[_0x49be50(0x194)];let _0x190315=_0x203454['offset']+_0x203454[_0x49be50(0x198)],_0x2b0e5d;return _0x190315>=_0x3d53b7?(_0x190315=_0x3d53b7,_0x2b0e5d=0xc8):_0x2b0e5d=0xce,_0x533b19[_0x49be50(0x168)](_0x2b0e5d),_0x533b19[_0x49be50(0x18f)](_0x49be50(0x1a3),_0x49f594+'-'+_0x190315+'/'+_0x3d53b7)[_0x49be50(0x158)](_0x363d49);}return null;};}function saveUpdates(_0x135354){return function(_0x3834ce){const _0x475eec=a16_0x4a6b;if(_0x3834ce)return _0x3834ce[_0x475eec(0x187)](_0x135354)[_0x475eec(0x159)](function(_0x33578f){return _0x33578f;});return null;};}function removeEntity(_0x159065){return function(_0x2f3205){const _0x42f3aa=a16_0x4a6b;if(_0x2f3205)return _0x2f3205['destroy']()[_0x42f3aa(0x159)](function(){const _0x210bff=_0x42f3aa,_0x35023d=_0x2f3205[_0x210bff(0x165)]({'plain':!![]}),_0x50f652=_0x210bff(0x17d);return db[_0x210bff(0x18c)][_0x210bff(0x157)]({'where':{'type':_0x50f652,'resourceId':_0x35023d['id']}})[_0x210bff(0x159)](function(){return _0x2f3205;});})[_0x42f3aa(0x159)](function(){const _0x52dc0c=_0x42f3aa;_0x159065[_0x52dc0c(0x168)](0xcc)[_0x52dc0c(0x19a)]();});};}function handleEntityNotFound(_0xb62419){return function(_0x52575c){return!_0x52575c&&_0xb62419['sendStatus'](0x194),_0x52575c;};}function handleError(_0x28e222,_0x43833a){return _0x43833a=_0x43833a||0x1f4,function(_0xff6763){const _0x1e886c=a16_0x4a6b;logger[_0x1e886c(0x19d)](_0xff6763[_0x1e886c(0x186)]),_0xff6763[_0x1e886c(0x163)]&&delete _0xff6763['name'],_0x28e222['status'](_0x43833a)[_0x1e886c(0x167)](_0xff6763);};}exports['index']=function(_0x2e70c0,_0x1d7b17){const _0x3ce957=a16_0x93e469;let _0x334323={};const _0x293186={},_0x346146={'count':0x0,'rows':[]},_0x873261=_[_0x3ce957(0x169)](db[_0x3ce957(0x16c)]['rawAttributes'],function(_0x7d82ad){const _0x4607b5=_0x3ce957;return{'name':_0x7d82ad['fieldName'],'type':_0x7d82ad[_0x4607b5(0x182)][_0x4607b5(0x15d)]};});_0x293186[_0x3ce957(0x19f)]=_['map'](_0x873261,'name'),_0x293186[_0x3ce957(0x18e)]=_[_0x3ce957(0x195)](_0x2e70c0[_0x3ce957(0x18e)]),_0x293186[_0x3ce957(0x171)]=_['intersection'](_0x293186[_0x3ce957(0x19f)],_0x293186[_0x3ce957(0x18e)]),_0x334323[_0x3ce957(0x170)]=_['intersection'](_0x293186[_0x3ce957(0x19f)],qs[_0x3ce957(0x193)](_0x2e70c0[_0x3ce957(0x18e)][_0x3ce957(0x193)])),_0x334323[_0x3ce957(0x170)]=_0x334323[_0x3ce957(0x170)]['length']?_0x334323[_0x3ce957(0x170)]:_0x293186[_0x3ce957(0x19f)];typeof _0x2e70c0[_0x3ce957(0x18e)]['nolimit']==='undefined'&&(_0x334323['limit']=qs[_0x3ce957(0x198)](_0x2e70c0['query'][_0x3ce957(0x198)]),_0x334323[_0x3ce957(0x194)]=qs['offset'](_0x2e70c0['query'][_0x3ce957(0x194)]));_0x334323[_0x3ce957(0x15f)]=qs[_0x3ce957(0x17e)](_0x2e70c0[_0x3ce957(0x18e)][_0x3ce957(0x17e)]),_0x334323[_0x3ce957(0x17f)]=qs[_0x3ce957(0x171)](_[_0x3ce957(0x19b)](_0x2e70c0[_0x3ce957(0x18e)],_0x293186[_0x3ce957(0x171)]),_0x873261),_0x334323=filterAttributes(_0x334323,_0x2e70c0['query'][_0x3ce957(0x176)],_0x873261,_0x2e70c0['options']);const _0x50ecca={'where':_0x334323[_0x3ce957(0x17f)]};return db[_0x3ce957(0x16c)][_0x3ce957(0x173)](_0x50ecca)['then'](function(_0x19e411){const _0x149ecf=_0x3ce957;return _0x346146[_0x149ecf(0x173)]=_0x19e411,_0x2e70c0[_0x149ecf(0x18e)]['includeAll']&&(_0x334323[_0x149ecf(0x183)]=[{'all':!![]}]),db['AnalyticExtractedReport']['findAll'](_0x334323);})[_0x3ce957(0x159)](function(_0x4c6312){const _0x129a9b=_0x3ce957;return _0x346146[_0x129a9b(0x164)]=_0x4c6312,_0x346146;})[_0x3ce957(0x159)](respondWithFilteredResult(_0x1d7b17,_0x334323))['catch'](handleError(_0x1d7b17,null));},exports[a16_0x93e469(0x18a)]=function(_0x3cb9a9,_0x167be7){const _0x407d07=a16_0x93e469;let _0x1ac86f={'raw':!![],'where':{'id':_0x3cb9a9['params']['id']}};const _0x16124d={};return _0x16124d['model']=_[_0x407d07(0x195)](db['AnalyticExtractedReport'][_0x407d07(0x197)]),_0x16124d[_0x407d07(0x18e)]=_['keys'](_0x3cb9a9[_0x407d07(0x18e)]),_0x16124d['filters']=_[_0x407d07(0x185)](_0x16124d['model'],_0x16124d['query']),_0x1ac86f[_0x407d07(0x170)]=_[_0x407d07(0x185)](_0x16124d[_0x407d07(0x19f)],qs[_0x407d07(0x193)](_0x3cb9a9[_0x407d07(0x18e)]['fields'])),_0x1ac86f[_0x407d07(0x170)]=_0x1ac86f[_0x407d07(0x170)][_0x407d07(0x19e)]?_0x1ac86f[_0x407d07(0x170)]:_0x16124d[_0x407d07(0x19f)],_0x3cb9a9[_0x407d07(0x18e)][_0x407d07(0x184)]&&(_0x1ac86f['include']=[{'all':!![]}]),_0x1ac86f=_[_0x407d07(0x15e)]({},_0x1ac86f,_0x3cb9a9['options']),db['AnalyticExtractedReport'][_0x407d07(0x160)](_0x1ac86f)[_0x407d07(0x159)](handleEntityNotFound(_0x167be7,null))[_0x407d07(0x159)](respondWithResult(_0x167be7,null))['catch'](handleError(_0x167be7,null));},exports[a16_0x93e469(0x18d)]=function(_0x6c38c9,_0x4e6a88){const _0x1021dd=a16_0x93e469;return db[_0x1021dd(0x16c)][_0x1021dd(0x18d)](_0x6c38c9['body'],{})[_0x1021dd(0x159)](function(_0xf8aa08){const _0x419bf9=_0x1021dd,_0x2e0a96=_0x6c38c9['user'][_0x419bf9(0x165)]({'plain':!![]});if(!_0x2e0a96)throw new Error(_0x419bf9(0x177));if(_0x2e0a96['role']==='user'){const _0x279e00=_0xf8aa08[_0x419bf9(0x165)]({'plain':!![]}),_0x32c400='ExtractedReports';return db[_0x419bf9(0x15c)][_0x419bf9(0x160)]({'where':{'name':_0x32c400,'userProfileId':_0x2e0a96['userProfileId']},'raw':!![]})['then'](function(_0x50d9eb){const _0x323960=_0x419bf9;return _0x50d9eb&&_0x50d9eb['autoAssociation']===0x0?db[_0x323960(0x18c)][_0x323960(0x18d)]({'name':_0x279e00[_0x323960(0x163)],'resourceId':_0x279e00['id'],'type':_0x50d9eb['name'],'sectionId':_0x50d9eb['id']},{})['then'](function(){return _0xf8aa08;}):_0xf8aa08;})[_0x419bf9(0x166)](function(_0x1d6e34){const _0x4e8595=_0x419bf9;logger[_0x4e8595(0x19d)](_0x4e8595(0x16a),_0x1d6e34);throw _0x1d6e34;});}return _0xf8aa08;})[_0x1021dd(0x159)](respondWithResult(_0x4e6a88,0xc9))[_0x1021dd(0x166)](handleError(_0x4e6a88,null));},exports[a16_0x93e469(0x187)]=function(_0x5d89db,_0x300893){const _0x3361c2=a16_0x93e469;return _0x5d89db['body']['id']&&delete _0x5d89db['body']['id'],db[_0x3361c2(0x16c)][_0x3361c2(0x160)]({'where':{'id':_0x5d89db[_0x3361c2(0x180)]['id']}})['then'](handleEntityNotFound(_0x300893,null))['then'](saveUpdates(_0x5d89db[_0x3361c2(0x1a4)],null))['then'](respondWithResult(_0x300893,null))[_0x3361c2(0x166)](handleError(_0x300893,null));},exports[a16_0x93e469(0x157)]=function(_0x4418d7,_0x22233c){const _0x51fe91=a16_0x93e469;return db['AnalyticExtractedReport'][_0x51fe91(0x160)]({'where':{'id':_0x4418d7[_0x51fe91(0x180)]['id']}})[_0x51fe91(0x159)](handleEntityNotFound(_0x22233c,null))[_0x51fe91(0x159)](removeEntity(_0x22233c,null))[_0x51fe91(0x166)](handleError(_0x22233c,null));},exports[a16_0x93e469(0x196)]=function(_0x4e4bcd,_0x3ff6dc){const _0x3fb6c2=a16_0x93e469;return db['AnalyticExtractedReport'][_0x3fb6c2(0x160)]({'where':{'id':_0x4e4bcd[_0x3fb6c2(0x180)]['id']},'attributes':['name',_0x3fb6c2(0x162),_0x3fb6c2(0x16b),_0x3fb6c2(0x15b)],'raw':!![]})['then'](handleEntityNotFound(_0x3ff6dc,null))[_0x3fb6c2(0x159)](function(_0x321ad5){const _0x257e23=_0x3fb6c2;if(_0x321ad5){if(!fs['existsSync'](path[_0x257e23(0x161)](config['root'],_0x257e23(0x1a5),_0x321ad5[_0x257e23(0x16b)])))throw new ValidationError('Report\x20not\x20found\x20or\x20empty');if(_0x4e4bcd['query'][_0x257e23(0x175)])return _0x3ff6dc[_0x257e23(0x17a)](0xc8);return _0x3ff6dc[_0x257e23(0x196)](path[_0x257e23(0x161)](config['root'],_0x257e23(0x1a5),_0x321ad5[_0x257e23(0x16b)]),util[_0x257e23(0x188)](_0x257e23(0x16e),_0x321ad5[_0x257e23(0x162)]||_0x321ad5[_0x257e23(0x163)],_0x321ad5[_0x257e23(0x15b)][_0x257e23(0x18b)]()));}})['catch'](handleError(_0x3ff6dc,null));};
\ No newline at end of file
+'use strict';const a16_0x33c3=['sequelize','includeAll','218039mJgSrH','name','limit','key','121OGoqTR','fieldName','then','error','isArray','download','count','@mysqldb','attributes','2EUgZJE','merge','create','files','where','rows','findOne','basename','transaction','lodash','undefined','14987YeKycQ','update','appRoot','sendStatus','AnalyticExtractedReport','map','exists','status','remove','options','fields','Report\x20not\x20found\x20or\x20empty','model','Unable\x20to\x20retrieve\x20the\x20current\x20user','40478YdZSxA','json','end','findAll','set','1784251NyxEmk','userProfileId','2tsfTTW','type','Could\x20not\x20delete\x20report\x20file\x20','@utils/console-logger','intersection','body','length','order','ExtractedReports','stack','catch','keys','output','23FRrrNB','send','show','join','171652OkxbKA','reports','get','role','params','filters','include','root','Content-Range','api','destroy','@config/logger','warn','offset','autoAssociation','fs-extra','57063pFfNLu','@components/parsers/qs','user','UserProfileResource','sort','792425XpEPSt','path','files/reports','toLowerCase','query'];const a16_0x3565=function(_0x26b438,_0x4d69a9){_0x26b438=_0x26b438-0x1a9;let _0x33c397=a16_0x33c3[_0x26b438];return _0x33c397;};const a16_0x4f1c0f=a16_0x3565;(function(_0x104eec,_0x822d51){const _0x507e7e=a16_0x3565;while(!![]){try{const _0x4c8e90=parseInt(_0x507e7e(0x1be))+parseInt(_0x507e7e(0x1cb))*-parseInt(_0x507e7e(0x1e4))+-parseInt(_0x507e7e(0x1b7))+parseInt(_0x507e7e(0x1c2))*-parseInt(_0x507e7e(0x1d6))+-parseInt(_0x507e7e(0x1eb))*-parseInt(_0x507e7e(0x1fc))+parseInt(_0x507e7e(0x1e9))+-parseInt(_0x507e7e(0x1b2))*-parseInt(_0x507e7e(0x1f8));if(_0x4c8e90===_0x822d51)break;else _0x104eec['push'](_0x104eec['shift']());}catch(_0x398f05){_0x104eec['push'](_0x104eec['shift']());}}}(a16_0x33c3,0xed1e3));const fs=require(a16_0x4f1c0f(0x1b1)),path=require(a16_0x4f1c0f(0x1b8)),_=require(a16_0x4f1c0f(0x1d4)),qs=require(a16_0x4f1c0f(0x1b3)),logger=require(a16_0x4f1c0f(0x1ad))(a16_0x4f1c0f(0x1ab)),{db}=require(a16_0x4f1c0f(0x1c9)),{ValidationError,Op}=require(a16_0x4f1c0f(0x1bc)),{filterAttributes}=require('@utils/filter-attributes'),{consoleLogger}=require(a16_0x4f1c0f(0x1ee)),{getConfig}=require('@config/get-config'),config=getConfig();function respondWithResult(_0x486df5,_0x1ad436){return _0x1ad436=_0x1ad436||0xc8,function(_0x2800a9){const _0x5399af=a16_0x3565;if(_0x2800a9)return _0x486df5[_0x5399af(0x1dd)](_0x1ad436)[_0x5399af(0x1e5)](_0x2800a9);};}function respondWithFilteredResult(_0x51d755,_0x144d70){return function(_0x2eb6a8){const _0x2f32ca=a16_0x3565;if(_0x2eb6a8){const _0x576f14=_0x2eb6a8[_0x2f32ca(0x1c8)],_0x29619f=_0x144d70[_0x2f32ca(0x1af)];let _0x31c06d=_0x144d70[_0x2f32ca(0x1af)]+_0x144d70[_0x2f32ca(0x1c0)],_0x5ad099;return _0x31c06d>=_0x576f14?(_0x31c06d=_0x576f14,_0x5ad099=0xc8):_0x5ad099=0xce,_0x51d755[_0x2f32ca(0x1dd)](_0x5ad099),_0x51d755[_0x2f32ca(0x1e8)](_0x2f32ca(0x1aa),_0x29619f+'-'+_0x31c06d+'/'+_0x576f14)[_0x2f32ca(0x1e5)](_0x2eb6a8);}return null;};}function saveUpdates(_0x19bd83){return function(_0x5790a4){const _0x53fce8=a16_0x3565;if(_0x5790a4)return _0x5790a4[_0x53fce8(0x1d7)](_0x19bd83)[_0x53fce8(0x1c4)](function(_0x22de37){return _0x22de37;});return null;};}async function removeEntities(_0x34d9e2,_0x10c77f,_0x5eeebe){const _0x383a7b=a16_0x4f1c0f,_0x4c70cb=_0x10c77f[_0x383a7b(0x1db)](_0x1c72c3=>_0x1c72c3['id']);await db[_0x383a7b(0x1da)][_0x383a7b(0x1ac)]({'where':{'id':{[Op['in']]:_0x4c70cb}},'transaction':_0x34d9e2});const _0x292b85=_0x10c77f['map'](_0x4483ff=>_0x4483ff[_0x383a7b(0x1fe)]({'plain':!![]})),_0x558a30='ExtractedReports';await db[_0x383a7b(0x1b5)]['destroy']({'where':{'type':_0x558a30,'resourceId':{[Op['in']]:_0x292b85[_0x383a7b(0x1db)](_0x1786db=>_0x1786db['id'])}},'transaction':_0x34d9e2});for(const _0x9c3906 of _0x10c77f){const _0x3c8157=path[_0x383a7b(0x1fb)](global[_0x383a7b(0x1d8)],_0x383a7b(0x1b9),_0x9c3906['savename']);try{await fs[_0x383a7b(0x1de)](_0x3c8157);}catch(_0x22b05e){consoleLogger[_0x383a7b(0x1ae)](_0x383a7b(0x1ed)+_0x3c8157+':',_0x22b05e);}}_0x5eeebe[_0x383a7b(0x1dd)](0xcc)[_0x383a7b(0x1e6)]();}function handleEntityNotFound(_0x242c7f){return function(_0x565704){const _0x5d1294=a16_0x3565;return(!_0x565704||Array[_0x5d1294(0x1c6)](_0x565704)&&_0x565704[_0x5d1294(0x1f1)]===0x0)&&_0x242c7f[_0x5d1294(0x1d9)](0x194),_0x565704;};}function handleError(_0x9d3396,_0x5e99d1){return _0x5e99d1=_0x5e99d1||0x1f4,function(_0x4d6a0a){const _0x3d67fd=a16_0x3565;logger[_0x3d67fd(0x1c5)](_0x4d6a0a[_0x3d67fd(0x1f4)]),_0x4d6a0a[_0x3d67fd(0x1bf)]&&delete _0x4d6a0a[_0x3d67fd(0x1bf)],_0x9d3396[_0x3d67fd(0x1dd)](_0x5e99d1)[_0x3d67fd(0x1f9)](_0x4d6a0a);};}exports['index']=function(_0x382a06,_0x1e2833){const _0x5555ae=a16_0x4f1c0f;let _0x572ba4={};const _0x4fb31e={},_0x2a1124={'count':0x0,'rows':[]},_0x54ca79=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0xa13e26){const _0x3fb53c=a16_0x3565;return{'name':_0xa13e26[_0x3fb53c(0x1c3)],'type':_0xa13e26[_0x3fb53c(0x1ec)][_0x3fb53c(0x1c1)]};});_0x4fb31e['model']=_[_0x5555ae(0x1db)](_0x54ca79,_0x5555ae(0x1bf)),_0x4fb31e[_0x5555ae(0x1bb)]=_[_0x5555ae(0x1f6)](_0x382a06['query']),_0x4fb31e[_0x5555ae(0x201)]=_[_0x5555ae(0x1ef)](_0x4fb31e[_0x5555ae(0x1e2)],_0x4fb31e[_0x5555ae(0x1bb)]),_0x572ba4['attributes']=_[_0x5555ae(0x1ef)](_0x4fb31e[_0x5555ae(0x1e2)],qs[_0x5555ae(0x1e0)](_0x382a06[_0x5555ae(0x1bb)]['fields'])),_0x572ba4['attributes']=_0x572ba4[_0x5555ae(0x1ca)][_0x5555ae(0x1f1)]?_0x572ba4[_0x5555ae(0x1ca)]:_0x4fb31e[_0x5555ae(0x1e2)];typeof _0x382a06[_0x5555ae(0x1bb)]['nolimit']===_0x5555ae(0x1d5)&&(_0x572ba4[_0x5555ae(0x1c0)]=qs[_0x5555ae(0x1c0)](_0x382a06[_0x5555ae(0x1bb)]['limit']),_0x572ba4[_0x5555ae(0x1af)]=qs[_0x5555ae(0x1af)](_0x382a06[_0x5555ae(0x1bb)][_0x5555ae(0x1af)]));_0x572ba4[_0x5555ae(0x1f2)]=qs[_0x5555ae(0x1b6)](_0x382a06[_0x5555ae(0x1bb)][_0x5555ae(0x1b6)]),_0x572ba4[_0x5555ae(0x1cf)]=qs[_0x5555ae(0x201)](_['pick'](_0x382a06['query'],_0x4fb31e['filters']),_0x54ca79),_0x572ba4=filterAttributes(_0x572ba4,_0x382a06[_0x5555ae(0x1bb)]['filter'],_0x54ca79,_0x382a06[_0x5555ae(0x1df)]);const _0x471a09={'where':_0x572ba4['where']};return db[_0x5555ae(0x1da)][_0x5555ae(0x1c8)](_0x471a09)[_0x5555ae(0x1c4)](function(_0x3820f2){const _0x1ef610=_0x5555ae;return _0x2a1124[_0x1ef610(0x1c8)]=_0x3820f2,_0x382a06['query'][_0x1ef610(0x1bd)]&&(_0x572ba4[_0x1ef610(0x202)]=[{'all':!![]}]),db['AnalyticExtractedReport'][_0x1ef610(0x1e7)](_0x572ba4);})[_0x5555ae(0x1c4)](function(_0xb2100d){const _0x1f8e84=_0x5555ae;return _0x2a1124[_0x1f8e84(0x1d0)]=_0xb2100d,_0x2a1124;})[_0x5555ae(0x1c4)](respondWithFilteredResult(_0x1e2833,_0x572ba4))[_0x5555ae(0x1f5)](handleError(_0x1e2833,null));},exports[a16_0x4f1c0f(0x1fa)]=function(_0x4f46ad,_0x4afe88){const _0x5ba773=a16_0x4f1c0f;let _0x5e45a0={'raw':!![],'where':{'id':_0x4f46ad[_0x5ba773(0x200)]['id']}};const _0x56e842={};return _0x56e842['model']=_[_0x5ba773(0x1f6)](db[_0x5ba773(0x1da)]['rawAttributes']),_0x56e842[_0x5ba773(0x1bb)]=_[_0x5ba773(0x1f6)](_0x4f46ad[_0x5ba773(0x1bb)]),_0x56e842[_0x5ba773(0x201)]=_[_0x5ba773(0x1ef)](_0x56e842['model'],_0x56e842[_0x5ba773(0x1bb)]),_0x5e45a0[_0x5ba773(0x1ca)]=_[_0x5ba773(0x1ef)](_0x56e842[_0x5ba773(0x1e2)],qs[_0x5ba773(0x1e0)](_0x4f46ad[_0x5ba773(0x1bb)][_0x5ba773(0x1e0)])),_0x5e45a0[_0x5ba773(0x1ca)]=_0x5e45a0['attributes']['length']?_0x5e45a0[_0x5ba773(0x1ca)]:_0x56e842[_0x5ba773(0x1e2)],_0x4f46ad[_0x5ba773(0x1bb)]['includeAll']&&(_0x5e45a0[_0x5ba773(0x202)]=[{'all':!![]}]),_0x5e45a0=_[_0x5ba773(0x1cc)]({},_0x5e45a0,_0x4f46ad[_0x5ba773(0x1df)]),db[_0x5ba773(0x1da)][_0x5ba773(0x1d1)](_0x5e45a0)[_0x5ba773(0x1c4)](handleEntityNotFound(_0x4afe88,null))['then'](respondWithResult(_0x4afe88,null))[_0x5ba773(0x1f5)](handleError(_0x4afe88,null));},exports[a16_0x4f1c0f(0x1cd)]=function(_0x61139,_0xf28ee0){const _0x447b49=a16_0x4f1c0f;return db['AnalyticExtractedReport']['create'](_0x61139[_0x447b49(0x1f0)],{})[_0x447b49(0x1c4)](function(_0x4f33fc){const _0xbefcd=_0x447b49,_0x1475e8=_0x61139[_0xbefcd(0x1b4)][_0xbefcd(0x1fe)]({'plain':!![]});if(!_0x1475e8)throw new Error(_0xbefcd(0x1e3));if(_0x1475e8[_0xbefcd(0x1ff)]===_0xbefcd(0x1b4)){const _0x5f3b29=_0x4f33fc[_0xbefcd(0x1fe)]({'plain':!![]}),_0x2e5133=_0xbefcd(0x1f3);return db['UserProfileSection'][_0xbefcd(0x1d1)]({'where':{'name':_0x2e5133,'userProfileId':_0x1475e8[_0xbefcd(0x1ea)]},'raw':!![]})[_0xbefcd(0x1c4)](function(_0x42db39){const _0x49b3b7=_0xbefcd;return _0x42db39&&_0x42db39[_0x49b3b7(0x1b0)]===0x0?db[_0x49b3b7(0x1b5)][_0x49b3b7(0x1cd)]({'name':_0x5f3b29[_0x49b3b7(0x1bf)],'resourceId':_0x5f3b29['id'],'type':_0x42db39['name'],'sectionId':_0x42db39['id']},{})[_0x49b3b7(0x1c4)](function(){return _0x4f33fc;}):_0x4f33fc;})[_0xbefcd(0x1f5)](function(_0x12217f){const _0x34527f=_0xbefcd;logger[_0x34527f(0x1c5)]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12217f);throw _0x12217f;});}return _0x4f33fc;})[_0x447b49(0x1c4)](respondWithResult(_0xf28ee0,0xc9))['catch'](handleError(_0xf28ee0,null));},exports['update']=function(_0x5aadfb,_0xe2a6f9){const _0x4d35f3=a16_0x4f1c0f;return _0x5aadfb['body']['id']&&delete _0x5aadfb['body']['id'],db[_0x4d35f3(0x1da)]['findOne']({'where':{'id':_0x5aadfb[_0x4d35f3(0x200)]['id']}})[_0x4d35f3(0x1c4)](handleEntityNotFound(_0xe2a6f9,null))[_0x4d35f3(0x1c4)](saveUpdates(_0x5aadfb[_0x4d35f3(0x1f0)],null))[_0x4d35f3(0x1c4)](respondWithResult(_0xe2a6f9,null))[_0x4d35f3(0x1f5)](handleError(_0xe2a6f9,null));},exports[a16_0x4f1c0f(0x1ac)]=function(_0x16c6d7,_0x36265e){const _0x38a8d8=a16_0x4f1c0f,_0x135db0=Array[_0x38a8d8(0x1c6)](_0x16c6d7[_0x38a8d8(0x200)]['id'])?_0x16c6d7[_0x38a8d8(0x200)]['id']:[_0x16c6d7[_0x38a8d8(0x200)]['id']];return db[_0x38a8d8(0x1da)][_0x38a8d8(0x1e7)]({'where':{'id':{[Op['in']]:_0x135db0}}})[_0x38a8d8(0x1c4)](handleEntityNotFound(_0x36265e,null))[_0x38a8d8(0x1c4)](_0x15ebd9=>db[_0x38a8d8(0x1bc)][_0x38a8d8(0x1d3)](_0x47078e=>removeEntities(_0x47078e,_0x15ebd9,_0x36265e)))['catch'](handleError(_0x36265e,null));},exports[a16_0x4f1c0f(0x1c7)]=function(_0x4a7adc,_0x3cdf39){const _0xee3ea2=a16_0x4f1c0f;return db['AnalyticExtractedReport'][_0xee3ea2(0x1d1)]({'where':{'id':_0x4a7adc[_0xee3ea2(0x200)]['id']},'attributes':[_0xee3ea2(0x1bf),_0xee3ea2(0x1d2),'savename',_0xee3ea2(0x1f7)],'raw':!![]})['then'](handleEntityNotFound(_0x3cdf39,null))[_0xee3ea2(0x1c4)](function(_0x5a1441){const _0x8e6ad3=_0xee3ea2;if(_0x5a1441){const _0x19a68b=path[_0x8e6ad3(0x1fb)](config[_0x8e6ad3(0x1a9)],_0x8e6ad3(0x1ce),_0x8e6ad3(0x1fd),_0x5a1441['savename']);if(!fs['existsSync'](_0x19a68b))throw new ValidationError(_0x8e6ad3(0x1e1));if(_0x4a7adc[_0x8e6ad3(0x1bb)][_0x8e6ad3(0x1dc)])return _0x3cdf39[_0x8e6ad3(0x1d9)](0xc8);return _0x3cdf39[_0x8e6ad3(0x1c7)](_0x19a68b,(_0x5a1441[_0x8e6ad3(0x1d2)]||_0x5a1441[_0x8e6ad3(0x1bf)])+'.'+_0x5a1441[_0x8e6ad3(0x1f7)][_0x8e6ad3(0x1ba)]());}})[_0xee3ea2(0x1f5)](handleError(_0x3cdf39,null));};
\ No newline at end of file