Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / analyticExtractedReport / analyticExtractedReport.controller.js
index 037e2d3..93db83d 100644 (file)
@@ -1 +1 @@
-const a16_0x6b4f=['existsSync','findOne','sort','count','autoAssociation','sequelize','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','get','Report\x20not\x20found\x20or\x20empty','api','../../components/parsers/qs','limit','../../mysqldb','name','type','rawAttributes','model','root','fields','params','update','options','path','Content-Range','include','query','offset','UserProfileResource','ExtractedReports','error','catch','order','create','../../config/environment','where','set','filter','fieldName','format','toLowerCase','undefined','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','includeAll','UserProfileSection','filters','intersection','map','pick','keys','json','merge','lodash','userProfileId','basename','stack','%s.%s','body','status','util','savename','output','then','join','../../config/logger','attributes','files/reports','key','AnalyticExtractedReport','like','show','index'];(function(_0x5de274,_0x10a681){const _0x6b4f63=function(_0x2cba63){while(--_0x2cba63){_0x5de274['push'](_0x5de274['shift']());}};_0x6b4f63(++_0x10a681);}(a16_0x6b4f,0x172));const a16_0x2cba=function(_0x5de274,_0x10a681){_0x5de274=_0x5de274-0xc8;let _0x6b4f63=a16_0x6b4f[_0x5de274];return _0x6b4f63;};const a16_0x4609c9=a16_0x2cba;'use strict';const util=require(a16_0x4609c9(0xff)),path=require(a16_0x4609c9(0xda)),fs=require('fs'),_=require(a16_0x4609c9(0xf8)),qs=require(a16_0x4609c9(0xce)),logger=require(a16_0x4609c9(0x104))(a16_0x4609c9(0xcd)),config=require(a16_0x4609c9(0xe5)),{db}=require(a16_0x4609c9(0xd0)),{Op,ValidationError}=require(a16_0x4609c9(0xc8));function respondWithResult(_0x3299c9,_0x40c9e7){return _0x40c9e7=_0x40c9e7||0xc8,function(_0xc4db45){const _0x1d6812=a16_0x2cba;if(_0xc4db45)return _0x3299c9[_0x1d6812(0xfe)](_0x40c9e7)[_0x1d6812(0xf6)](_0xc4db45);};}function respondWithFilteredResult(_0x32d7b1,_0x3407db){return function(_0x76fbe5){const _0x3f4259=a16_0x2cba;if(_0x76fbe5){const _0x5c5c53=_0x76fbe5['count'],_0x186c07=_0x3407db[_0x3f4259(0xde)];let _0xfbbf5b=_0x3407db[_0x3f4259(0xde)]+_0x3407db[_0x3f4259(0xcf)],_0x49441a;return _0xfbbf5b>=_0x5c5c53?(_0xfbbf5b=_0x5c5c53,_0x49441a=0xc8):_0x49441a=0xce,_0x32d7b1[_0x3f4259(0xfe)](_0x49441a),_0x32d7b1[_0x3f4259(0xe7)](_0x3f4259(0xdb),_0x186c07+'-'+_0xfbbf5b+'/'+_0x5c5c53)[_0x3f4259(0xf6)](_0x76fbe5);}return null;};}function saveUpdates(_0x12236d){return function(_0x4450ab){if(_0x4450ab)return _0x4450ab['update'](_0x12236d)['then'](function(_0x451a24){return _0x451a24;});return null;};}function removeEntity(_0x2ed70b){return function(_0xbaabba){const _0x1b5b06=a16_0x2cba;if(_0xbaabba)return _0xbaabba['destroy']()[_0x1b5b06(0x102)](function(){const _0x4a957b=_0x1b5b06,_0x3c3f12=_0xbaabba[_0x4a957b(0xcb)]({'plain':!![]}),_0x5bde5f=_0x4a957b(0xe0);return db[_0x4a957b(0xdf)]['destroy']({'where':{'type':_0x5bde5f,'resourceId':_0x3c3f12['id']}})[_0x4a957b(0x102)](function(){return _0xbaabba;});})[_0x1b5b06(0x102)](function(){const _0x4d3d90=_0x1b5b06;_0x2ed70b[_0x4d3d90(0xfe)](0xcc)['end']();});};}function handleEntityNotFound(_0x35c1dd){return function(_0xbca1ba){return!_0xbca1ba&&_0x35c1dd['sendStatus'](0x194),_0xbca1ba;};}function handleError(_0x1ad10f,_0x3dfe3){return _0x3dfe3=_0x3dfe3||0x1f4,function(_0x10082a){const _0x1bc513=a16_0x2cba;logger[_0x1bc513(0xe1)](_0x10082a[_0x1bc513(0xfb)]),_0x10082a[_0x1bc513(0xd1)]&&delete _0x10082a['name'],_0x1ad10f[_0x1bc513(0xfe)](_0x3dfe3)[_0x1bc513(0xed)](_0x10082a);};}exports[a16_0x4609c9(0x10b)]=function(_0x5393a5,_0x1b2cef){const _0x1be1dd=a16_0x4609c9;let _0x2b48cd={};const _0xca0102={},_0x2e300d={'count':0x0,'rows':[]},_0x27ff5d=_['map'](db[_0x1be1dd(0x108)][_0x1be1dd(0xd3)],function(_0x29fd70){const _0x248729=_0x1be1dd;return{'name':_0x29fd70[_0x248729(0xe9)],'type':_0x29fd70[_0x248729(0xd2)][_0x248729(0x107)]};});_0xca0102['model']=_[_0x1be1dd(0xf3)](_0x27ff5d,_0x1be1dd(0xd1)),_0xca0102[_0x1be1dd(0xdd)]=_['keys'](_0x5393a5['query']),_0xca0102[_0x1be1dd(0xf1)]=_['intersection'](_0xca0102[_0x1be1dd(0xd4)],_0xca0102[_0x1be1dd(0xdd)]),_0x2b48cd[_0x1be1dd(0x105)]=_[_0x1be1dd(0xf2)](_0xca0102[_0x1be1dd(0xd4)],qs[_0x1be1dd(0xd6)](_0x5393a5[_0x1be1dd(0xdd)][_0x1be1dd(0xd6)])),_0x2b48cd[_0x1be1dd(0x105)]=_0x2b48cd[_0x1be1dd(0x105)]['length']?_0x2b48cd[_0x1be1dd(0x105)]:_0xca0102[_0x1be1dd(0xd4)];typeof _0x5393a5[_0x1be1dd(0xdd)]['nolimit']===_0x1be1dd(0xec)&&(_0x2b48cd[_0x1be1dd(0xcf)]=qs[_0x1be1dd(0xcf)](_0x5393a5[_0x1be1dd(0xdd)]['limit']),_0x2b48cd[_0x1be1dd(0xde)]=qs['offset'](_0x5393a5[_0x1be1dd(0xdd)][_0x1be1dd(0xde)]));_0x2b48cd[_0x1be1dd(0xe3)]=qs[_0x1be1dd(0x10e)](_0x5393a5[_0x1be1dd(0xdd)][_0x1be1dd(0x10e)]),_0x2b48cd[_0x1be1dd(0xe6)]=qs[_0x1be1dd(0xf1)](_[_0x1be1dd(0xf4)](_0x5393a5['query'],_0xca0102[_0x1be1dd(0xf1)]),_0x27ff5d);_0x5393a5['query']['filter']&&(_0x2b48cd['where']=_[_0x1be1dd(0xf7)](_0x2b48cd[_0x1be1dd(0xe6)],{[Op['or']]:_[_0x1be1dd(0xf3)](_0x27ff5d,function(_0x16ab08){const _0x49b506=_0x1be1dd;if(_0x16ab08['type']!=='VIRTUAL'){const _0x162707={};return _0x162707[_0x16ab08['name']]={[Op[_0x49b506(0x109)]]:'%'+_0x5393a5[_0x49b506(0xdd)][_0x49b506(0xe8)]+'%'},_0x162707;}})}));_0x2b48cd=_[_0x1be1dd(0xf7)]({},_0x2b48cd,_0x5393a5[_0x1be1dd(0xd9)]);const _0x1b4151={'where':_0x2b48cd[_0x1be1dd(0xe6)]};return db[_0x1be1dd(0x108)][_0x1be1dd(0x10f)](_0x1b4151)[_0x1be1dd(0x102)](function(_0x26790f){const _0x3eeffa=_0x1be1dd;return _0x2e300d['count']=_0x26790f,_0x5393a5[_0x3eeffa(0xdd)][_0x3eeffa(0xef)]&&(_0x2b48cd[_0x3eeffa(0xdc)]=[{'all':!![]}]),db['AnalyticExtractedReport']['findAll'](_0x2b48cd);})[_0x1be1dd(0x102)](function(_0x3f5f96){return _0x2e300d['rows']=_0x3f5f96,_0x2e300d;})['then'](respondWithFilteredResult(_0x1b2cef,_0x2b48cd))[_0x1be1dd(0xe2)](handleError(_0x1b2cef,null));},exports[a16_0x4609c9(0x10a)]=function(_0x4397b7,_0x25996a){const _0x240895=a16_0x4609c9;let _0x1d45ac={'raw':!![],'where':{'id':_0x4397b7[_0x240895(0xd7)]['id']}};const _0x22c24b={};return _0x22c24b[_0x240895(0xd4)]=_[_0x240895(0xf5)](db[_0x240895(0x108)]['rawAttributes']),_0x22c24b['query']=_[_0x240895(0xf5)](_0x4397b7[_0x240895(0xdd)]),_0x22c24b[_0x240895(0xf1)]=_[_0x240895(0xf2)](_0x22c24b['model'],_0x22c24b[_0x240895(0xdd)]),_0x1d45ac[_0x240895(0x105)]=_[_0x240895(0xf2)](_0x22c24b['model'],qs[_0x240895(0xd6)](_0x4397b7['query']['fields'])),_0x1d45ac[_0x240895(0x105)]=_0x1d45ac[_0x240895(0x105)]['length']?_0x1d45ac[_0x240895(0x105)]:_0x22c24b[_0x240895(0xd4)],_0x4397b7['query']['includeAll']&&(_0x1d45ac['include']=[{'all':!![]}]),_0x1d45ac=_['merge']({},_0x1d45ac,_0x4397b7[_0x240895(0xd9)]),db[_0x240895(0x108)][_0x240895(0x10d)](_0x1d45ac)[_0x240895(0x102)](handleEntityNotFound(_0x25996a,null))[_0x240895(0x102)](respondWithResult(_0x25996a,null))[_0x240895(0xe2)](handleError(_0x25996a,null));},exports[a16_0x4609c9(0xe4)]=function(_0x495dfb,_0x30feaa){const _0x4e5b7d=a16_0x4609c9;return db['AnalyticExtractedReport'][_0x4e5b7d(0xe4)](_0x495dfb[_0x4e5b7d(0xfd)],{})[_0x4e5b7d(0x102)](function(_0x4709ea){const _0x2d44d7=_0x4e5b7d,_0x433187=_0x495dfb[_0x2d44d7(0xc9)][_0x2d44d7(0xcb)]({'plain':!![]});if(!_0x433187)throw new Error(_0x2d44d7(0xee));if(_0x433187['role']===_0x2d44d7(0xc9)){const _0x3842c0=_0x4709ea[_0x2d44d7(0xcb)]({'plain':!![]}),_0x5138bd=_0x2d44d7(0xe0);return db[_0x2d44d7(0xf0)]['findOne']({'where':{'name':_0x5138bd,'userProfileId':_0x433187[_0x2d44d7(0xf9)]},'raw':!![]})[_0x2d44d7(0x102)](function(_0x166d90){const _0x1a84d0=_0x2d44d7;return _0x166d90&&_0x166d90[_0x1a84d0(0x110)]===0x0?db[_0x1a84d0(0xdf)][_0x1a84d0(0xe4)]({'name':_0x3842c0[_0x1a84d0(0xd1)],'resourceId':_0x3842c0['id'],'type':_0x166d90['name'],'sectionId':_0x166d90['id']},{})[_0x1a84d0(0x102)](function(){return _0x4709ea;}):_0x4709ea;})[_0x2d44d7(0xe2)](function(_0x1b9d14){const _0x343e7e=_0x2d44d7;logger[_0x343e7e(0xe1)](_0x343e7e(0xca),_0x1b9d14);throw _0x1b9d14;});}return _0x4709ea;})[_0x4e5b7d(0x102)](respondWithResult(_0x30feaa,0xc9))[_0x4e5b7d(0xe2)](handleError(_0x30feaa,null));},exports[a16_0x4609c9(0xd8)]=function(_0x371c26,_0x2695c2){const _0x4bf8a8=a16_0x4609c9;return _0x371c26[_0x4bf8a8(0xfd)]['id']&&delete _0x371c26[_0x4bf8a8(0xfd)]['id'],db['AnalyticExtractedReport']['findOne']({'where':{'id':_0x371c26[_0x4bf8a8(0xd7)]['id']}})[_0x4bf8a8(0x102)](handleEntityNotFound(_0x2695c2,null))[_0x4bf8a8(0x102)](saveUpdates(_0x371c26[_0x4bf8a8(0xfd)],null))['then'](respondWithResult(_0x2695c2,null))[_0x4bf8a8(0xe2)](handleError(_0x2695c2,null));},exports['destroy']=function(_0x5ee172,_0x5cbf00){const _0x1b4f93=a16_0x4609c9;return db[_0x1b4f93(0x108)][_0x1b4f93(0x10d)]({'where':{'id':_0x5ee172[_0x1b4f93(0xd7)]['id']}})[_0x1b4f93(0x102)](handleEntityNotFound(_0x5cbf00,null))[_0x1b4f93(0x102)](removeEntity(_0x5cbf00,null))['catch'](handleError(_0x5cbf00,null));},exports['download']=function(_0x7843aa,_0x122512){const _0x4861d2=a16_0x4609c9;return db[_0x4861d2(0x108)][_0x4861d2(0x10d)]({'where':{'id':_0x7843aa[_0x4861d2(0xd7)]['id']},'attributes':[_0x4861d2(0xd1),_0x4861d2(0xfa),'savename',_0x4861d2(0x101)],'raw':!![]})[_0x4861d2(0x102)](handleEntityNotFound(_0x122512,null))[_0x4861d2(0x102)](function(_0x279af1){const _0x21d37d=_0x4861d2;if(_0x279af1){if(!fs[_0x21d37d(0x10c)](path['join'](config[_0x21d37d(0xd5)],'files/reports',_0x279af1[_0x21d37d(0x100)])))throw new ValidationError(_0x21d37d(0xcc));if(_0x7843aa[_0x21d37d(0xdd)]['exists'])return _0x122512['sendStatus'](0xc8);return _0x122512['download'](path[_0x21d37d(0x103)](config['root'],_0x21d37d(0x106),_0x279af1['savename']),util[_0x21d37d(0xea)](_0x21d37d(0xfc),_0x279af1[_0x21d37d(0xfa)]||_0x279af1['name'],_0x279af1[_0x21d37d(0x101)][_0x21d37d(0xeb)]()));}})['catch'](handleError(_0x122512,null));};
\ No newline at end of file
+const a16_0x1265=['update','get','../../mysqldb','AnalyticExtractedReport','attributes','includeAll','intersection','index','Unable\x20to\x20retrieve\x20the\x20current\x20user','catch','api','where','params','root','limit','send','body','length','util','existsSync','query','key','stack','status','role','exists','create','end','map','like','undefined','model','../../config/environment','../../config/logger','destroy','set','join','include','output','count','filters','filter','path','files/reports','toLowerCase','offset','VIRTUAL','name','keys','type','user','basename','savename','rows','fieldName','fields','ExtractedReports','sendStatus','findAll','merge','sort','json','autoAssociation','show','download','nolimit','rawAttributes','error','then','pick','findOne','userProfileId'];(function(_0x42f373,_0xd4d742){const _0x12653c=function(_0x53161f){while(--_0x53161f){_0x42f373['push'](_0x42f373['shift']());}};_0x12653c(++_0xd4d742);}(a16_0x1265,0x111));const a16_0x5316=function(_0x42f373,_0xd4d742){_0x42f373=_0x42f373-0x1bf;let _0x12653c=a16_0x1265[_0x42f373];return _0x12653c;};const a16_0x451135=a16_0x5316;'use strict';const util=require(a16_0x451135(0x1e0)),path=require(a16_0x451135(0x1f8)),fs=require('fs'),_=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(a16_0x451135(0x1ef))(a16_0x451135(0x1d8)),config=require(a16_0x451135(0x1ee)),{db}=require(a16_0x451135(0x1d0)),{Op,ValidationError}=require('sequelize');function respondWithResult(_0x17e9d2,_0x14c2ea){return _0x14c2ea=_0x14c2ea||0xc8,function(_0x3de955){const _0x11c65c=a16_0x5316;if(_0x3de955)return _0x17e9d2[_0x11c65c(0x1e5)](_0x14c2ea)['json'](_0x3de955);};}function respondWithFilteredResult(_0x1b5f2e,_0x54e6d5){return function(_0x3453f3){const _0x2b6fd6=a16_0x5316;if(_0x3453f3){const _0x375038=_0x3453f3[_0x2b6fd6(0x1f5)],_0x59510f=_0x54e6d5[_0x2b6fd6(0x1fb)];let _0x4525d4=_0x54e6d5['offset']+_0x54e6d5[_0x2b6fd6(0x1dc)],_0x324d7d;return _0x4525d4>=_0x375038?(_0x4525d4=_0x375038,_0x324d7d=0xc8):_0x324d7d=0xce,_0x1b5f2e[_0x2b6fd6(0x1e5)](_0x324d7d),_0x1b5f2e[_0x2b6fd6(0x1f1)]('Content-Range',_0x59510f+'-'+_0x4525d4+'/'+_0x375038)[_0x2b6fd6(0x1c3)](_0x3453f3);}return null;};}function saveUpdates(_0x56061f){return function(_0x11e584){const _0x4812cb=a16_0x5316;if(_0x11e584)return _0x11e584['update'](_0x56061f)[_0x4812cb(0x1ca)](function(_0x42e667){return _0x42e667;});return null;};}function removeEntity(_0x105c3f){return function(_0x48346e){const _0x2e67b9=a16_0x5316;if(_0x48346e)return _0x48346e[_0x2e67b9(0x1f0)]()[_0x2e67b9(0x1ca)](function(){const _0x383779=_0x2e67b9,_0x1079a3=_0x48346e[_0x383779(0x1cf)]({'plain':!![]}),_0x53f489=_0x383779(0x206);return db['UserProfileResource'][_0x383779(0x1f0)]({'where':{'type':_0x53f489,'resourceId':_0x1079a3['id']}})[_0x383779(0x1ca)](function(){return _0x48346e;});})[_0x2e67b9(0x1ca)](function(){const _0x137b77=_0x2e67b9;_0x105c3f['status'](0xcc)[_0x137b77(0x1e9)]();});};}function handleEntityNotFound(_0x8ab18a){return function(_0x58bf1b){const _0x2fd671=a16_0x5316;return!_0x58bf1b&&_0x8ab18a[_0x2fd671(0x1bf)](0x194),_0x58bf1b;};}function handleError(_0x4d269b,_0x27d289){return _0x27d289=_0x27d289||0x1f4,function(_0x1a3e0d){const _0x245248=a16_0x5316;logger[_0x245248(0x1c9)](_0x1a3e0d[_0x245248(0x1e4)]),_0x1a3e0d[_0x245248(0x1fd)]&&delete _0x1a3e0d[_0x245248(0x1fd)],_0x4d269b[_0x245248(0x1e5)](_0x27d289)[_0x245248(0x1dd)](_0x1a3e0d);};}exports[a16_0x451135(0x1d5)]=function(_0x36f89a,_0x37b89a){const _0x191aa8=a16_0x451135;let _0x526419={};const _0xa6c1d3={},_0x22b1aa={'count':0x0,'rows':[]},_0x18a709=_[_0x191aa8(0x1ea)](db[_0x191aa8(0x1d1)][_0x191aa8(0x1c8)],function(_0xbc6468){const _0x329d05=_0x191aa8;return{'name':_0xbc6468[_0x329d05(0x204)],'type':_0xbc6468[_0x329d05(0x1ff)][_0x329d05(0x1e3)]};});_0xa6c1d3[_0x191aa8(0x1ed)]=_['map'](_0x18a709,_0x191aa8(0x1fd)),_0xa6c1d3[_0x191aa8(0x1e2)]=_[_0x191aa8(0x1fe)](_0x36f89a['query']),_0xa6c1d3[_0x191aa8(0x1f6)]=_[_0x191aa8(0x1d4)](_0xa6c1d3[_0x191aa8(0x1ed)],_0xa6c1d3['query']),_0x526419[_0x191aa8(0x1d2)]=_[_0x191aa8(0x1d4)](_0xa6c1d3[_0x191aa8(0x1ed)],qs['fields'](_0x36f89a['query'][_0x191aa8(0x205)])),_0x526419[_0x191aa8(0x1d2)]=_0x526419['attributes'][_0x191aa8(0x1df)]?_0x526419['attributes']:_0xa6c1d3[_0x191aa8(0x1ed)];typeof _0x36f89a['query'][_0x191aa8(0x1c7)]===_0x191aa8(0x1ec)&&(_0x526419[_0x191aa8(0x1dc)]=qs['limit'](_0x36f89a[_0x191aa8(0x1e2)][_0x191aa8(0x1dc)]),_0x526419[_0x191aa8(0x1fb)]=qs[_0x191aa8(0x1fb)](_0x36f89a[_0x191aa8(0x1e2)]['offset']));_0x526419['order']=qs[_0x191aa8(0x1c2)](_0x36f89a[_0x191aa8(0x1e2)][_0x191aa8(0x1c2)]),_0x526419[_0x191aa8(0x1d9)]=qs[_0x191aa8(0x1f6)](_[_0x191aa8(0x1cb)](_0x36f89a[_0x191aa8(0x1e2)],_0xa6c1d3[_0x191aa8(0x1f6)]),_0x18a709);_0x36f89a[_0x191aa8(0x1e2)][_0x191aa8(0x1f7)]&&(_0x526419['where']=_['merge'](_0x526419[_0x191aa8(0x1d9)],{[Op['or']]:_[_0x191aa8(0x1ea)](_0x18a709,function(_0x5b9cb8){const _0x21d6f=_0x191aa8;if(_0x5b9cb8[_0x21d6f(0x1ff)]!==_0x21d6f(0x1fc)){const _0xbd9aa0={};return _0xbd9aa0[_0x5b9cb8[_0x21d6f(0x1fd)]]={[Op[_0x21d6f(0x1eb)]]:'%'+_0x36f89a[_0x21d6f(0x1e2)]['filter']+'%'},_0xbd9aa0;}})}));_0x526419=_[_0x191aa8(0x1c1)]({},_0x526419,_0x36f89a['options']);const _0x4a2a95={'where':_0x526419[_0x191aa8(0x1d9)]};return db[_0x191aa8(0x1d1)][_0x191aa8(0x1f5)](_0x4a2a95)[_0x191aa8(0x1ca)](function(_0x3d2773){const _0x56eed5=_0x191aa8;return _0x22b1aa['count']=_0x3d2773,_0x36f89a['query'][_0x56eed5(0x1d3)]&&(_0x526419[_0x56eed5(0x1f3)]=[{'all':!![]}]),db[_0x56eed5(0x1d1)][_0x56eed5(0x1c0)](_0x526419);})[_0x191aa8(0x1ca)](function(_0x22e18b){const _0x5e1bc7=_0x191aa8;return _0x22b1aa[_0x5e1bc7(0x203)]=_0x22e18b,_0x22b1aa;})[_0x191aa8(0x1ca)](respondWithFilteredResult(_0x37b89a,_0x526419))[_0x191aa8(0x1d7)](handleError(_0x37b89a,null));},exports[a16_0x451135(0x1c5)]=function(_0x499ccb,_0x4201ac){const _0x20100a=a16_0x451135;let _0x19a21c={'raw':!![],'where':{'id':_0x499ccb[_0x20100a(0x1da)]['id']}};const _0x4027a8={};return _0x4027a8['model']=_[_0x20100a(0x1fe)](db['AnalyticExtractedReport'][_0x20100a(0x1c8)]),_0x4027a8['query']=_['keys'](_0x499ccb['query']),_0x4027a8[_0x20100a(0x1f6)]=_[_0x20100a(0x1d4)](_0x4027a8[_0x20100a(0x1ed)],_0x4027a8[_0x20100a(0x1e2)]),_0x19a21c['attributes']=_[_0x20100a(0x1d4)](_0x4027a8[_0x20100a(0x1ed)],qs[_0x20100a(0x205)](_0x499ccb[_0x20100a(0x1e2)][_0x20100a(0x205)])),_0x19a21c[_0x20100a(0x1d2)]=_0x19a21c[_0x20100a(0x1d2)][_0x20100a(0x1df)]?_0x19a21c[_0x20100a(0x1d2)]:_0x4027a8['model'],_0x499ccb[_0x20100a(0x1e2)][_0x20100a(0x1d3)]&&(_0x19a21c[_0x20100a(0x1f3)]=[{'all':!![]}]),_0x19a21c=_[_0x20100a(0x1c1)]({},_0x19a21c,_0x499ccb['options']),db[_0x20100a(0x1d1)][_0x20100a(0x1cc)](_0x19a21c)['then'](handleEntityNotFound(_0x4201ac,null))[_0x20100a(0x1ca)](respondWithResult(_0x4201ac,null))['catch'](handleError(_0x4201ac,null));},exports[a16_0x451135(0x1e8)]=function(_0x3417c3,_0x4c14ba){const _0x1b34ab=a16_0x451135;return db['AnalyticExtractedReport']['create'](_0x3417c3[_0x1b34ab(0x1de)],{})[_0x1b34ab(0x1ca)](function(_0x47b8c6){const _0xc2bcff=_0x1b34ab,_0xa0328=_0x3417c3[_0xc2bcff(0x200)]['get']({'plain':!![]});if(!_0xa0328)throw new Error(_0xc2bcff(0x1d6));if(_0xa0328[_0xc2bcff(0x1e6)]===_0xc2bcff(0x200)){const _0x591744=_0x47b8c6['get']({'plain':!![]}),_0x106e8c=_0xc2bcff(0x206);return db['UserProfileSection'][_0xc2bcff(0x1cc)]({'where':{'name':_0x106e8c,'userProfileId':_0xa0328[_0xc2bcff(0x1cd)]},'raw':!![]})[_0xc2bcff(0x1ca)](function(_0x230da4){const _0x3af0a4=_0xc2bcff;return _0x230da4&&_0x230da4[_0x3af0a4(0x1c4)]===0x0?db['UserProfileResource'][_0x3af0a4(0x1e8)]({'name':_0x591744['name'],'resourceId':_0x591744['id'],'type':_0x230da4[_0x3af0a4(0x1fd)],'sectionId':_0x230da4['id']},{})['then'](function(){return _0x47b8c6;}):_0x47b8c6;})[_0xc2bcff(0x1d7)](function(_0x280198){const _0x128177=_0xc2bcff;logger[_0x128177(0x1c9)]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x280198);throw _0x280198;});}return _0x47b8c6;})[_0x1b34ab(0x1ca)](respondWithResult(_0x4c14ba,0xc9))[_0x1b34ab(0x1d7)](handleError(_0x4c14ba,null));},exports[a16_0x451135(0x1ce)]=function(_0x5add0e,_0x1f8913){const _0x25db3c=a16_0x451135;return _0x5add0e[_0x25db3c(0x1de)]['id']&&delete _0x5add0e[_0x25db3c(0x1de)]['id'],db['AnalyticExtractedReport'][_0x25db3c(0x1cc)]({'where':{'id':_0x5add0e[_0x25db3c(0x1da)]['id']}})[_0x25db3c(0x1ca)](handleEntityNotFound(_0x1f8913,null))[_0x25db3c(0x1ca)](saveUpdates(_0x5add0e['body'],null))[_0x25db3c(0x1ca)](respondWithResult(_0x1f8913,null))[_0x25db3c(0x1d7)](handleError(_0x1f8913,null));},exports[a16_0x451135(0x1f0)]=function(_0x670453,_0x404509){const _0x14de62=a16_0x451135;return db[_0x14de62(0x1d1)][_0x14de62(0x1cc)]({'where':{'id':_0x670453[_0x14de62(0x1da)]['id']}})[_0x14de62(0x1ca)](handleEntityNotFound(_0x404509,null))['then'](removeEntity(_0x404509,null))[_0x14de62(0x1d7)](handleError(_0x404509,null));},exports[a16_0x451135(0x1c6)]=function(_0x5d4590,_0x5aa285){const _0x284eb3=a16_0x451135;return db[_0x284eb3(0x1d1)][_0x284eb3(0x1cc)]({'where':{'id':_0x5d4590[_0x284eb3(0x1da)]['id']},'attributes':[_0x284eb3(0x1fd),_0x284eb3(0x201),_0x284eb3(0x202),'output'],'raw':!![]})[_0x284eb3(0x1ca)](handleEntityNotFound(_0x5aa285,null))['then'](function(_0x26a001){const _0x290200=_0x284eb3;if(_0x26a001){if(!fs[_0x290200(0x1e1)](path['join'](config['root'],_0x290200(0x1f9),_0x26a001[_0x290200(0x202)])))throw new ValidationError('Report\x20not\x20found\x20or\x20empty');if(_0x5d4590[_0x290200(0x1e2)][_0x290200(0x1e7)])return _0x5aa285[_0x290200(0x1bf)](0xc8);return _0x5aa285[_0x290200(0x1c6)](path[_0x290200(0x1f2)](config[_0x290200(0x1db)],_0x290200(0x1f9),_0x26a001[_0x290200(0x202)]),util['format']('%s.%s',_0x26a001[_0x290200(0x201)]||_0x26a001[_0x290200(0x1fd)],_0x26a001[_0x290200(0x1f4)][_0x290200(0x1fa)]()));}})[_0x284eb3(0x1d7)](handleError(_0x5aa285,null));};
\ No newline at end of file