Built motion from commit 8dca541896b0ff92bb88a36cc13f4f385b593b4b. Version 3.0.0...
[motion-next.git] / server / api / analyticMetric / analyticMetric.controller.js
index 57f181c..c7a9420 100644 (file)
@@ -1 +1 @@
-const a21_0x172b=['merge','get','filter','query','filters','body','where','catch','lodash','findAll','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','rawAttributes','name','nolimit','status','show','type','create','userProfileId','options','keys','intersection','attributes','map','destroy','includeAll','error','user','count','../../config/logger','include','sendStatus','AnalyticMetric','fields','order','Content-Range','findOne','then','pick','end','UserProfileSection','role','offset','send','params','undefined','sequelize','VIRTUAL','json','../../mysqldb','limit','UserProfileResource','Unable\x20to\x20retrieve\x20the\x20current\x20user','rows','sort','stack','api','../../components/parsers/qs','key','model','autoAssociation','index','fieldName'];(function(_0x257958,_0x172b43){const _0x10bb65=function(_0x53cbd6){while(--_0x53cbd6){_0x257958['push'](_0x257958['shift']());}};_0x10bb65(++_0x172b43);}(a21_0x172b,0x18a));const a21_0x10bb=function(_0x257958,_0x172b43){_0x257958=_0x257958-0x0;let _0x10bb65=a21_0x172b[_0x257958];return _0x10bb65;};const _0x4e10d1=a21_0x10bb;'use strict';const _=require(_0x4e10d1('0x3e')),qs=require(_0x4e10d1('0x30')),logger=require(_0x4e10d1('0x14'))(_0x4e10d1('0x2f')),db=require(_0x4e10d1('0x28'))['db'],{Op}=require(_0x4e10d1('0x25'));function respondWithResult(_0x53cbd6,_0x2b2393){return _0x2b2393=_0x2b2393||0xc8,function(_0x2c7855){const _0x39ad53=a21_0x10bb;if(_0x2c7855)return _0x53cbd6['status'](_0x2b2393)[_0x39ad53('0x27')](_0x2c7855);};}function respondWithFilteredResult(_0x2c47fe,_0x52f00a){return function(_0x542ef3){const _0x1de507=a21_0x10bb;if(_0x542ef3){const _0x5d28b1=_0x542ef3[_0x1de507('0x13')],_0x1c925b=_0x52f00a[_0x1de507('0x21')];let _0x31d8b5=_0x52f00a[_0x1de507('0x21')]+_0x52f00a[_0x1de507('0x29')],_0x56f05e;return _0x31d8b5>=_0x5d28b1?(_0x31d8b5=_0x5d28b1,_0x56f05e=0xc8):_0x56f05e=0xce,_0x2c47fe[_0x1de507('0x5')](_0x56f05e),_0x2c47fe['set'](_0x1de507('0x1a'),_0x1c925b+'-'+_0x31d8b5+'/'+_0x5d28b1)[_0x1de507('0x27')](_0x542ef3);}return null;};}function saveUpdates(_0x4d8c69){return function(_0x5272b7){const _0x2750aa=a21_0x10bb;if(_0x5272b7)return _0x5272b7['update'](_0x4d8c69)[_0x2750aa('0x1c')](function(_0x5aa697){return _0x5aa697;});return null;};}function removeEntity(_0x2e547d){return function(_0x131a4e){const _0x1cbd41=a21_0x10bb;if(_0x131a4e)return _0x131a4e[_0x1cbd41('0xf')]()['then'](function(){const _0x3857ba=_0x1cbd41,_0x4f2a01=_0x131a4e['get']({'plain':!![]}),_0x1451b0='Metrics';return db[_0x3857ba('0x2a')][_0x3857ba('0xf')]({'where':{'type':_0x1451b0,'resourceId':_0x4f2a01['id']}})[_0x3857ba('0x1c')](function(){return _0x131a4e;});})[_0x1cbd41('0x1c')](function(){const _0x4ac94a=_0x1cbd41;_0x2e547d['status'](0xcc)[_0x4ac94a('0x1e')]();});};}function handleEntityNotFound(_0x11c586){return function(_0x5035f6){const _0x35cf59=a21_0x10bb;return!_0x5035f6&&_0x11c586[_0x35cf59('0x16')](0x194),_0x5035f6;};}function handleError(_0x44e665,_0x165bf1){return _0x165bf1=_0x165bf1||0x1f4,function(_0xfe5665){const _0x21f330=a21_0x10bb;logger[_0x21f330('0x11')](_0xfe5665[_0x21f330('0x2e')]),_0xfe5665['name']&&delete _0xfe5665[_0x21f330('0x3')],_0x44e665[_0x21f330('0x5')](_0x165bf1)[_0x21f330('0x22')](_0xfe5665);};}exports[_0x4e10d1('0x34')]=function(_0x37523e,_0xfed739){const _0x59a325=_0x4e10d1;let _0x2693dc={};const _0x581569={},_0x3c5f87={'count':0x0,'rows':[]},_0x51dc76=_['map'](db['AnalyticMetric'][_0x59a325('0x2')],function(_0x477186){const _0x4ad058=_0x59a325;return{'name':_0x477186[_0x4ad058('0x35')],'type':_0x477186[_0x4ad058('0x7')][_0x4ad058('0x31')]};});_0x581569[_0x59a325('0x32')]=_[_0x59a325('0xe')](_0x51dc76,_0x59a325('0x3')),_0x581569[_0x59a325('0x39')]=_[_0x59a325('0xb')](_0x37523e[_0x59a325('0x39')]),_0x581569[_0x59a325('0x3a')]=_[_0x59a325('0xc')](_0x581569[_0x59a325('0x32')],_0x581569[_0x59a325('0x39')]),_0x2693dc['attributes']=_[_0x59a325('0xc')](_0x581569[_0x59a325('0x32')],qs[_0x59a325('0x18')](_0x37523e[_0x59a325('0x39')][_0x59a325('0x18')])),_0x2693dc['attributes']=_0x2693dc[_0x59a325('0xd')][_0x59a325('0x1')]?_0x2693dc[_0x59a325('0xd')]:_0x581569['model'];typeof _0x37523e['query'][_0x59a325('0x4')]===_0x59a325('0x24')&&(_0x2693dc['limit']=qs[_0x59a325('0x29')](_0x37523e[_0x59a325('0x39')][_0x59a325('0x29')]),_0x2693dc[_0x59a325('0x21')]=qs[_0x59a325('0x21')](_0x37523e[_0x59a325('0x39')][_0x59a325('0x21')]));_0x2693dc[_0x59a325('0x19')]=qs[_0x59a325('0x2d')](_0x37523e['query'][_0x59a325('0x2d')]),_0x2693dc[_0x59a325('0x3c')]=qs[_0x59a325('0x3a')](_[_0x59a325('0x1d')](_0x37523e[_0x59a325('0x39')],_0x581569['filters']),_0x51dc76);_0x37523e[_0x59a325('0x39')]['filter']&&(_0x2693dc[_0x59a325('0x3c')]=_[_0x59a325('0x36')](_0x2693dc[_0x59a325('0x3c')],{[Op['or']]:_[_0x59a325('0xe')](_0x51dc76,function(_0xd45558){const _0x3358e2=_0x59a325;if(_0xd45558[_0x3358e2('0x7')]!==_0x3358e2('0x26')){const _0x1774f1={};return _0x1774f1[_0xd45558[_0x3358e2('0x3')]]={[Op['like']]:'%'+_0x37523e[_0x3358e2('0x39')][_0x3358e2('0x38')]+'%'},_0x1774f1;}})}));_0x2693dc=_[_0x59a325('0x36')]({},_0x2693dc,_0x37523e[_0x59a325('0xa')]);const _0x10e76e={'where':_0x2693dc[_0x59a325('0x3c')]};return db[_0x59a325('0x17')]['count'](_0x10e76e)[_0x59a325('0x1c')](function(_0x1ace09){const _0x21d8b4=_0x59a325;return _0x3c5f87[_0x21d8b4('0x13')]=_0x1ace09,_0x37523e[_0x21d8b4('0x39')][_0x21d8b4('0x10')]&&(_0x2693dc[_0x21d8b4('0x15')]=[{'all':!![]}]),db[_0x21d8b4('0x17')][_0x21d8b4('0x3f')](_0x2693dc);})[_0x59a325('0x1c')](function(_0x234e59){const _0x30b330=_0x59a325;return _0x3c5f87[_0x30b330('0x2c')]=_0x234e59,_0x3c5f87;})[_0x59a325('0x1c')](respondWithFilteredResult(_0xfed739,_0x2693dc))[_0x59a325('0x3d')](handleError(_0xfed739,null));},exports[_0x4e10d1('0x6')]=function(_0x13c60f,_0x55af37){const _0x3e3bb2=_0x4e10d1;let _0x2a603a={'raw':!![],'where':{'id':_0x13c60f[_0x3e3bb2('0x23')]['id']}};const _0x562086={};return _0x562086[_0x3e3bb2('0x32')]=_[_0x3e3bb2('0xb')](db[_0x3e3bb2('0x17')][_0x3e3bb2('0x2')]),_0x562086[_0x3e3bb2('0x39')]=_[_0x3e3bb2('0xb')](_0x13c60f['query']),_0x562086[_0x3e3bb2('0x3a')]=_[_0x3e3bb2('0xc')](_0x562086[_0x3e3bb2('0x32')],_0x562086[_0x3e3bb2('0x39')]),_0x2a603a[_0x3e3bb2('0xd')]=_[_0x3e3bb2('0xc')](_0x562086['model'],qs['fields'](_0x13c60f[_0x3e3bb2('0x39')]['fields'])),_0x2a603a[_0x3e3bb2('0xd')]=_0x2a603a['attributes']['length']?_0x2a603a[_0x3e3bb2('0xd')]:_0x562086[_0x3e3bb2('0x32')],_0x13c60f[_0x3e3bb2('0x39')][_0x3e3bb2('0x10')]&&(_0x2a603a[_0x3e3bb2('0x15')]=[{'all':!![]}]),_0x2a603a=_[_0x3e3bb2('0x36')]({},_0x2a603a,_0x13c60f['options']),db[_0x3e3bb2('0x17')]['findOne'](_0x2a603a)[_0x3e3bb2('0x1c')](handleEntityNotFound(_0x55af37,null))['then'](respondWithResult(_0x55af37,null))[_0x3e3bb2('0x3d')](handleError(_0x55af37,null));},exports[_0x4e10d1('0x8')]=function(_0x3882dc,_0x12cbca){const _0x2bb9c0=_0x4e10d1;return db[_0x2bb9c0('0x17')]['create'](_0x3882dc['body'],{})[_0x2bb9c0('0x1c')](function(_0x173381){const _0x2ce5b1=_0x2bb9c0,_0x29ac9c=_0x3882dc[_0x2ce5b1('0x12')][_0x2ce5b1('0x37')]({'plain':!![]});if(!_0x29ac9c)throw new Error(_0x2ce5b1('0x2b'));if(_0x29ac9c[_0x2ce5b1('0x20')]===_0x2ce5b1('0x12')){const _0x451406=_0x173381[_0x2ce5b1('0x37')]({'plain':!![]}),_0x59c6cf='Metrics';return db[_0x2ce5b1('0x1f')]['findOne']({'where':{'name':_0x59c6cf,'userProfileId':_0x29ac9c[_0x2ce5b1('0x9')]},'raw':!![]})[_0x2ce5b1('0x1c')](function(_0x2b3822){const _0x10ddd1=_0x2ce5b1;return _0x2b3822&&_0x2b3822[_0x10ddd1('0x33')]===0x0?db['UserProfileResource'][_0x10ddd1('0x8')]({'name':_0x451406[_0x10ddd1('0x3')],'resourceId':_0x451406['id'],'type':_0x2b3822['name'],'sectionId':_0x2b3822['id']},{})[_0x10ddd1('0x1c')](function(){return _0x173381;}):_0x173381;})[_0x2ce5b1('0x3d')](function(_0x68eb72){const _0x43ae27=_0x2ce5b1;logger['error'](_0x43ae27('0x0'),_0x68eb72);throw _0x68eb72;});}return _0x173381;})[_0x2bb9c0('0x1c')](respondWithResult(_0x12cbca,0xc9))[_0x2bb9c0('0x3d')](handleError(_0x12cbca,null));},exports['update']=function(_0x1f52f6,_0x5bd951){const _0x2a225a=_0x4e10d1;return _0x1f52f6[_0x2a225a('0x3b')]['id']&&delete _0x1f52f6[_0x2a225a('0x3b')]['id'],db[_0x2a225a('0x17')][_0x2a225a('0x1b')]({'where':{'id':_0x1f52f6[_0x2a225a('0x23')]['id']}})[_0x2a225a('0x1c')](handleEntityNotFound(_0x5bd951,null))[_0x2a225a('0x1c')](saveUpdates(_0x1f52f6[_0x2a225a('0x3b')],null))[_0x2a225a('0x1c')](respondWithResult(_0x5bd951,null))[_0x2a225a('0x3d')](handleError(_0x5bd951,null));},exports[_0x4e10d1('0xf')]=function(_0x4bf8b9,_0x66643d){const _0x16635f=_0x4e10d1;return db['AnalyticMetric']['findOne']({'where':{'id':_0x4bf8b9['params']['id']}})['then'](handleEntityNotFound(_0x66643d,null))[_0x16635f('0x1c')](removeEntity(_0x66643d,null))[_0x16635f('0x3d')](handleError(_0x66643d,null));};
\ No newline at end of file
+const a21_0x375d=['sendStatus','keys','model','json','userProfileId','limit','user','then','autoAssociation','error','length','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','AnalyticMetric','show','destroy','fields','offset','update','intersection','rows','options','api','UserProfileSection','type','count','findAll','sort','end','like','../../components/parsers/qs','create','set','catch','status','Metrics','index','filters','filter','../../mysqldb','Unable\x20to\x20retrieve\x20the\x20current\x20user','pick','body','UserProfileResource','params','name','includeAll','query','rawAttributes','where','merge','map','attributes','send','key','fieldName','stack','findOne','include','order','role'];(function(_0x2515d7,_0x375d07){const _0x2a2705=function(_0x19010e){while(--_0x19010e){_0x2515d7['push'](_0x2515d7['shift']());}};_0x2a2705(++_0x375d07);}(a21_0x375d,0xb7));const a21_0x2a27=function(_0x2515d7,_0x375d07){_0x2515d7=_0x2515d7-0x0;let _0x2a2705=a21_0x375d[_0x2515d7];return _0x2a2705;};const _0x2cb7d9=a21_0x2a27;'use strict';const _=require('lodash'),qs=require(_0x2cb7d9('0x1a')),logger=require('../../config/logger')(_0x2cb7d9('0x12')),db=require(_0x2cb7d9('0x23'))['db'],{Op}=require('sequelize');function respondWithResult(_0x19010e,_0x440e75){return _0x440e75=_0x440e75||0xc8,function(_0x52a3a7){const _0x37810f=a21_0x2a27;if(_0x52a3a7)return _0x19010e[_0x37810f('0x1e')](_0x440e75)['json'](_0x52a3a7);};}function respondWithFilteredResult(_0x1073d4,_0x2a0f09){return function(_0x2bef64){const _0x5253db=a21_0x2a27;if(_0x2bef64){const _0x14225e=_0x2bef64['count'],_0x5bcd16=_0x2a0f09[_0x5253db('0xd')];let _0x461f16=_0x2a0f09[_0x5253db('0xd')]+_0x2a0f09[_0x5253db('0x2')],_0x185b45;return _0x461f16>=_0x14225e?(_0x461f16=_0x14225e,_0x185b45=0xc8):_0x185b45=0xce,_0x1073d4[_0x5253db('0x1e')](_0x185b45),_0x1073d4[_0x5253db('0x1c')]('Content-Range',_0x5bcd16+'-'+_0x461f16+'/'+_0x14225e)[_0x5253db('0x0')](_0x2bef64);}return null;};}function saveUpdates(_0x4dba03){return function(_0xad2c15){const _0x4a9ce0=a21_0x2a27;if(_0xad2c15)return _0xad2c15['update'](_0x4dba03)[_0x4a9ce0('0x4')](function(_0x2cb7bd){return _0x2cb7bd;});return null;};}function removeEntity(_0x4586a9){return function(_0x6cc032){const _0x1521c3=a21_0x2a27;if(_0x6cc032)return _0x6cc032['destroy']()[_0x1521c3('0x4')](function(){const _0x5ac07=_0x1521c3,_0x38f990=_0x6cc032['get']({'plain':!![]}),_0x145bd5=_0x5ac07('0x1f');return db[_0x5ac07('0x27')][_0x5ac07('0xb')]({'where':{'type':_0x145bd5,'resourceId':_0x38f990['id']}})[_0x5ac07('0x4')](function(){return _0x6cc032;});})['then'](function(){const _0x17bc7f=_0x1521c3;_0x4586a9[_0x17bc7f('0x1e')](0xcc)[_0x17bc7f('0x18')]();});};}function handleEntityNotFound(_0x441b93){return function(_0x3cc8dc){const _0x5a032b=a21_0x2a27;return!_0x3cc8dc&&_0x441b93[_0x5a032b('0x39')](0x194),_0x3cc8dc;};}function handleError(_0x235a06,_0x451442){return _0x451442=_0x451442||0x1f4,function(_0x38ffc7){const _0x22acde=a21_0x2a27;logger[_0x22acde('0x6')](_0x38ffc7[_0x22acde('0x34')]),_0x38ffc7[_0x22acde('0x29')]&&delete _0x38ffc7[_0x22acde('0x29')],_0x235a06[_0x22acde('0x1e')](_0x451442)[_0x22acde('0x31')](_0x38ffc7);};}exports[_0x2cb7d9('0x20')]=function(_0x2f70ae,_0x2af718){const _0x5d469b=_0x2cb7d9;let _0x23ae81={};const _0x1be86a={},_0x50895d={'count':0x0,'rows':[]},_0x48e105=_[_0x5d469b('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x4e3c7f){const _0x424fd0=_0x5d469b;return{'name':_0x4e3c7f[_0x424fd0('0x33')],'type':_0x4e3c7f[_0x424fd0('0x14')][_0x424fd0('0x32')]};});_0x1be86a[_0x5d469b('0x3b')]=_[_0x5d469b('0x2f')](_0x48e105,_0x5d469b('0x29')),_0x1be86a[_0x5d469b('0x2b')]=_[_0x5d469b('0x3a')](_0x2f70ae[_0x5d469b('0x2b')]),_0x1be86a['filters']=_[_0x5d469b('0xf')](_0x1be86a[_0x5d469b('0x3b')],_0x1be86a[_0x5d469b('0x2b')]),_0x23ae81[_0x5d469b('0x30')]=_[_0x5d469b('0xf')](_0x1be86a[_0x5d469b('0x3b')],qs[_0x5d469b('0xc')](_0x2f70ae[_0x5d469b('0x2b')][_0x5d469b('0xc')])),_0x23ae81[_0x5d469b('0x30')]=_0x23ae81[_0x5d469b('0x30')][_0x5d469b('0x7')]?_0x23ae81[_0x5d469b('0x30')]:_0x1be86a[_0x5d469b('0x3b')];typeof _0x2f70ae[_0x5d469b('0x2b')]['nolimit']==='undefined'&&(_0x23ae81[_0x5d469b('0x2')]=qs[_0x5d469b('0x2')](_0x2f70ae['query']['limit']),_0x23ae81[_0x5d469b('0xd')]=qs[_0x5d469b('0xd')](_0x2f70ae[_0x5d469b('0x2b')][_0x5d469b('0xd')]));_0x23ae81[_0x5d469b('0x37')]=qs['sort'](_0x2f70ae[_0x5d469b('0x2b')][_0x5d469b('0x17')]),_0x23ae81[_0x5d469b('0x2d')]=qs[_0x5d469b('0x21')](_[_0x5d469b('0x25')](_0x2f70ae[_0x5d469b('0x2b')],_0x1be86a[_0x5d469b('0x21')]),_0x48e105);_0x2f70ae['query']['filter']&&(_0x23ae81['where']=_['merge'](_0x23ae81[_0x5d469b('0x2d')],{[Op['or']]:_[_0x5d469b('0x2f')](_0x48e105,function(_0x43b212){const _0x2d3eb5=_0x5d469b;if(_0x43b212[_0x2d3eb5('0x14')]!=='VIRTUAL'){const _0x6bc4a8={};return _0x6bc4a8[_0x43b212[_0x2d3eb5('0x29')]]={[Op[_0x2d3eb5('0x19')]]:'%'+_0x2f70ae[_0x2d3eb5('0x2b')][_0x2d3eb5('0x22')]+'%'},_0x6bc4a8;}})}));_0x23ae81=_[_0x5d469b('0x2e')]({},_0x23ae81,_0x2f70ae[_0x5d469b('0x11')]);const _0x568bab={'where':_0x23ae81[_0x5d469b('0x2d')]};return db[_0x5d469b('0x9')]['count'](_0x568bab)[_0x5d469b('0x4')](function(_0x544dd6){const _0x5b5712=_0x5d469b;return _0x50895d[_0x5b5712('0x15')]=_0x544dd6,_0x2f70ae[_0x5b5712('0x2b')][_0x5b5712('0x2a')]&&(_0x23ae81[_0x5b5712('0x36')]=[{'all':!![]}]),db[_0x5b5712('0x9')][_0x5b5712('0x16')](_0x23ae81);})[_0x5d469b('0x4')](function(_0x328e2d){const _0x38a408=_0x5d469b;return _0x50895d[_0x38a408('0x10')]=_0x328e2d,_0x50895d;})[_0x5d469b('0x4')](respondWithFilteredResult(_0x2af718,_0x23ae81))[_0x5d469b('0x1d')](handleError(_0x2af718,null));},exports[_0x2cb7d9('0xa')]=function(_0x3c30ce,_0x1410e0){const _0x55b12c=_0x2cb7d9;let _0x33679c={'raw':!![],'where':{'id':_0x3c30ce[_0x55b12c('0x28')]['id']}};const _0x51f0b9={};return _0x51f0b9[_0x55b12c('0x3b')]=_['keys'](db[_0x55b12c('0x9')][_0x55b12c('0x2c')]),_0x51f0b9[_0x55b12c('0x2b')]=_[_0x55b12c('0x3a')](_0x3c30ce[_0x55b12c('0x2b')]),_0x51f0b9[_0x55b12c('0x21')]=_[_0x55b12c('0xf')](_0x51f0b9['model'],_0x51f0b9[_0x55b12c('0x2b')]),_0x33679c['attributes']=_['intersection'](_0x51f0b9['model'],qs[_0x55b12c('0xc')](_0x3c30ce[_0x55b12c('0x2b')][_0x55b12c('0xc')])),_0x33679c[_0x55b12c('0x30')]=_0x33679c[_0x55b12c('0x30')][_0x55b12c('0x7')]?_0x33679c[_0x55b12c('0x30')]:_0x51f0b9[_0x55b12c('0x3b')],_0x3c30ce[_0x55b12c('0x2b')][_0x55b12c('0x2a')]&&(_0x33679c[_0x55b12c('0x36')]=[{'all':!![]}]),_0x33679c=_['merge']({},_0x33679c,_0x3c30ce['options']),db[_0x55b12c('0x9')][_0x55b12c('0x35')](_0x33679c)[_0x55b12c('0x4')](handleEntityNotFound(_0x1410e0,null))[_0x55b12c('0x4')](respondWithResult(_0x1410e0,null))[_0x55b12c('0x1d')](handleError(_0x1410e0,null));},exports[_0x2cb7d9('0x1b')]=function(_0x3686b2,_0x1374e6){const _0x5960d3=_0x2cb7d9;return db[_0x5960d3('0x9')][_0x5960d3('0x1b')](_0x3686b2['body'],{})[_0x5960d3('0x4')](function(_0x2430c8){const _0x98d5c8=_0x5960d3,_0x503563=_0x3686b2['user']['get']({'plain':!![]});if(!_0x503563)throw new Error(_0x98d5c8('0x24'));if(_0x503563[_0x98d5c8('0x38')]===_0x98d5c8('0x3')){const _0x2edcc0=_0x2430c8['get']({'plain':!![]}),_0x513cd1=_0x98d5c8('0x1f');return db[_0x98d5c8('0x13')][_0x98d5c8('0x35')]({'where':{'name':_0x513cd1,'userProfileId':_0x503563[_0x98d5c8('0x1')]},'raw':!![]})['then'](function(_0x3746b8){const _0x432eca=_0x98d5c8;return _0x3746b8&&_0x3746b8[_0x432eca('0x5')]===0x0?db[_0x432eca('0x27')][_0x432eca('0x1b')]({'name':_0x2edcc0[_0x432eca('0x29')],'resourceId':_0x2edcc0['id'],'type':_0x3746b8[_0x432eca('0x29')],'sectionId':_0x3746b8['id']},{})['then'](function(){return _0x2430c8;}):_0x2430c8;})[_0x98d5c8('0x1d')](function(_0x41020a){const _0x11aaa5=_0x98d5c8;logger[_0x11aaa5('0x6')](_0x11aaa5('0x8'),_0x41020a);throw _0x41020a;});}return _0x2430c8;})['then'](respondWithResult(_0x1374e6,0xc9))[_0x5960d3('0x1d')](handleError(_0x1374e6,null));},exports[_0x2cb7d9('0xe')]=function(_0x5a182a,_0x1a90a4){const _0x4aec30=_0x2cb7d9;return _0x5a182a['body']['id']&&delete _0x5a182a[_0x4aec30('0x26')]['id'],db['AnalyticMetric']['findOne']({'where':{'id':_0x5a182a[_0x4aec30('0x28')]['id']}})[_0x4aec30('0x4')](handleEntityNotFound(_0x1a90a4,null))['then'](saveUpdates(_0x5a182a[_0x4aec30('0x26')],null))[_0x4aec30('0x4')](respondWithResult(_0x1a90a4,null))[_0x4aec30('0x1d')](handleError(_0x1a90a4,null));},exports['destroy']=function(_0x40c528,_0x324349){const _0x6d0c43=_0x2cb7d9;return db[_0x6d0c43('0x9')][_0x6d0c43('0x35')]({'where':{'id':_0x40c528[_0x6d0c43('0x28')]['id']}})[_0x6d0c43('0x4')](handleEntityNotFound(_0x324349,null))[_0x6d0c43('0x4')](removeEntity(_0x324349,null))[_0x6d0c43('0x1d')](handleError(_0x324349,null));};
\ No newline at end of file