Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / schedule / schedule.controller.js
index e3a62ba..ec582e3 100644 (file)
@@ -1 +1 @@
-const a530_0x3c20=['offset','includeAll','UserProfileSection','index','include','create','count','merge','nolimit','fieldName','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','like','undefined','sendStatus','Schedule','update','sort','filters','end','params','catch','Scheduler','set','map','findAll','../../config/logger','attributes','role','fields','name','UserProfileResource','autoAssociation','limit','order','../../mysqldb','rawAttributes','status','key','model','stack','run','length','filter','json','where','query','api','type','sequelize','keys','then','send','user','pick','lodash','error','intersection','destroy','../../components/parsers/qs','Content-Range','get','body','../../config/schedule'];(function(_0x4b090d,_0x3c2077){const _0x170483=function(_0xc0ab93){while(--_0xc0ab93){_0x4b090d['push'](_0x4b090d['shift']());}};_0x170483(++_0x3c2077);}(a530_0x3c20,0x123));const a530_0x1704=function(_0x4b090d,_0x3c2077){_0x4b090d=_0x4b090d-0x0;let _0x170483=a530_0x3c20[_0x4b090d];return _0x170483;};const _0x295e48=a530_0x1704;'use strict';const _=require(_0x295e48('0x14')),qs=require(_0x295e48('0x18')),logger=require(_0x295e48('0x37'))(_0x295e48('0xc')),db=require(_0x295e48('0x0'))['db'],{Op}=require(_0x295e48('0xe'));function respondWithStatusCode(_0xc0ab93,_0x54e48e){return _0x54e48e=_0x54e48e||0xcc,function(_0x1e2b10){const _0x4d01eb=a530_0x1704;if(_0x1e2b10)return _0xc0ab93[_0x4d01eb('0x2b')](_0x54e48e);return _0xc0ab93[_0x4d01eb('0x2')](_0x54e48e)[_0x4d01eb('0x30')]();};}function respondWithResult(_0x1852c3,_0x33263e){return _0x33263e=_0x33263e||0xc8,function(_0x546605){const _0x254c33=a530_0x1704;if(_0x546605)return _0x1852c3[_0x254c33('0x2')](_0x33263e)[_0x254c33('0x9')](_0x546605);};}function respondWithFilteredResult(_0x5e4ac1,_0x2a967a){return function(_0x75bfd4){const _0xf65ef8=a530_0x1704;if(_0x75bfd4){const _0x56130f=_0x75bfd4['count'],_0x3fd38e=_0x2a967a[_0xf65ef8('0x1d')];let _0x1b5989=_0x2a967a[_0xf65ef8('0x1d')]+_0x2a967a[_0xf65ef8('0x3e')],_0x2d00dc;return _0x1b5989>=_0x56130f?(_0x1b5989=_0x56130f,_0x2d00dc=0xc8):_0x2d00dc=0xce,_0x5e4ac1['status'](_0x2d00dc),_0x5e4ac1[_0xf65ef8('0x34')](_0xf65ef8('0x19'),_0x3fd38e+'-'+_0x1b5989+'/'+_0x56130f)[_0xf65ef8('0x9')](_0x75bfd4);}return null;};}function saveUpdates(_0x4861c4){return function(_0x55b6fa){const _0xf94d01=a530_0x1704;if(_0x55b6fa)return _0x55b6fa[_0xf94d01('0x2d')](_0x4861c4)[_0xf94d01('0x10')](function(_0x326d30){return _0x326d30;});return null;};}function removeEntity(_0x17d553){return function(_0x4e60f1){const _0x3c5dda=a530_0x1704;if(_0x4e60f1)return _0x4e60f1[_0x3c5dda('0x17')]()['then'](function(){const _0x381980=_0x3c5dda,_0x29301f=_0x4e60f1[_0x381980('0x1a')]({'plain':!![]}),_0x5b4376='Scheduler';return db[_0x381980('0x3c')][_0x381980('0x17')]({'where':{'type':_0x5b4376,'resourceId':_0x29301f['id']}})[_0x381980('0x10')](function(){return _0x4e60f1;});})[_0x3c5dda('0x10')](function(){const _0x5033ac=_0x3c5dda;_0x17d553[_0x5033ac('0x2')](0xcc)[_0x5033ac('0x30')]();});};}function handleEntityNotFound(_0x944bd6){return function(_0x5b420b){const _0x2beed8=a530_0x1704;return!_0x5b420b&&_0x944bd6[_0x2beed8('0x2b')](0x194),_0x5b420b;};}function handleError(_0x5c28ac,_0x359995){return _0x359995=_0x359995||0x1f4,function(_0x1e9735){const _0x5f490c=a530_0x1704;logger['error'](_0x1e9735[_0x5f490c('0x5')]),_0x1e9735['name']&&delete _0x1e9735[_0x5f490c('0x3b')],_0x5c28ac[_0x5f490c('0x2')](_0x359995)[_0x5f490c('0x11')](_0x1e9735);};}exports[_0x295e48('0x20')]=function(_0x97a65,_0x2b0eb8){const _0x26ea7e=_0x295e48;let _0x390b0e={};const _0x36108f={},_0x4b44d2={'count':0x0,'rows':[]},_0x49c5e0=_[_0x26ea7e('0x35')](db['Schedule'][_0x26ea7e('0x1')],function(_0x3a643){const _0x22729e=_0x26ea7e;return{'name':_0x3a643[_0x22729e('0x26')],'type':_0x3a643[_0x22729e('0xd')][_0x22729e('0x3')]};});_0x36108f[_0x26ea7e('0x4')]=_[_0x26ea7e('0x35')](_0x49c5e0,_0x26ea7e('0x3b')),_0x36108f[_0x26ea7e('0xb')]=_[_0x26ea7e('0xf')](_0x97a65[_0x26ea7e('0xb')]),_0x36108f['filters']=_[_0x26ea7e('0x16')](_0x36108f[_0x26ea7e('0x4')],_0x36108f[_0x26ea7e('0xb')]),_0x390b0e[_0x26ea7e('0x38')]=_[_0x26ea7e('0x16')](_0x36108f[_0x26ea7e('0x4')],qs[_0x26ea7e('0x3a')](_0x97a65[_0x26ea7e('0xb')][_0x26ea7e('0x3a')])),_0x390b0e[_0x26ea7e('0x38')]=_0x390b0e[_0x26ea7e('0x38')][_0x26ea7e('0x7')]?_0x390b0e[_0x26ea7e('0x38')]:_0x36108f[_0x26ea7e('0x4')];typeof _0x97a65[_0x26ea7e('0xb')][_0x26ea7e('0x25')]===_0x26ea7e('0x2a')&&(_0x390b0e[_0x26ea7e('0x3e')]=qs[_0x26ea7e('0x3e')](_0x97a65[_0x26ea7e('0xb')]['limit']),_0x390b0e[_0x26ea7e('0x1d')]=qs['offset'](_0x97a65['query']['offset']));_0x390b0e[_0x26ea7e('0x3f')]=qs[_0x26ea7e('0x2e')](_0x97a65[_0x26ea7e('0xb')][_0x26ea7e('0x2e')]),_0x390b0e[_0x26ea7e('0xa')]=qs[_0x26ea7e('0x2f')](_[_0x26ea7e('0x13')](_0x97a65[_0x26ea7e('0xb')],_0x36108f[_0x26ea7e('0x2f')]),_0x49c5e0);_0x97a65[_0x26ea7e('0xb')][_0x26ea7e('0x8')]&&(_0x390b0e['where']=_['merge'](_0x390b0e[_0x26ea7e('0xa')],{[Op['or']]:_[_0x26ea7e('0x35')](_0x49c5e0,function(_0x4c3b14){const _0x527052=_0x26ea7e;if(_0x4c3b14['type']!=='VIRTUAL'){const _0x4447fb={};return _0x4447fb[_0x4c3b14[_0x527052('0x3b')]]={[Op[_0x527052('0x29')]]:'%'+_0x97a65['query']['filter']+'%'},_0x4447fb;}})}));_0x390b0e=_[_0x26ea7e('0x24')]({},_0x390b0e,_0x97a65['options']);const _0x1f6e32={'where':_0x390b0e[_0x26ea7e('0xa')]};return db[_0x26ea7e('0x2c')][_0x26ea7e('0x23')](_0x1f6e32)[_0x26ea7e('0x10')](function(_0x27c461){const _0x5830d7=_0x26ea7e;return _0x4b44d2[_0x5830d7('0x23')]=_0x27c461,_0x97a65['query'][_0x5830d7('0x1e')]&&(_0x390b0e[_0x5830d7('0x21')]=[{'all':!![]}]),db[_0x5830d7('0x2c')][_0x5830d7('0x36')](_0x390b0e);})[_0x26ea7e('0x10')](function(_0x3db4c6){return _0x4b44d2['rows']=_0x3db4c6,_0x4b44d2;})[_0x26ea7e('0x10')](respondWithFilteredResult(_0x2b0eb8,_0x390b0e))[_0x26ea7e('0x32')](handleError(_0x2b0eb8,null));},exports['show']=function(_0x53a26e,_0x213231){const _0xcad6cd=_0x295e48;let _0xa52628={'raw':![],'where':{'id':_0x53a26e[_0xcad6cd('0x31')]['id']}};const _0x414f72={};return _0x414f72[_0xcad6cd('0x4')]=_[_0xcad6cd('0xf')](db['Schedule'][_0xcad6cd('0x1')]),_0x414f72[_0xcad6cd('0xb')]=_[_0xcad6cd('0xf')](_0x53a26e[_0xcad6cd('0xb')]),_0x414f72[_0xcad6cd('0x2f')]=_['intersection'](_0x414f72[_0xcad6cd('0x4')],_0x414f72['query']),_0xa52628[_0xcad6cd('0x38')]=_[_0xcad6cd('0x16')](_0x414f72[_0xcad6cd('0x4')],qs[_0xcad6cd('0x3a')](_0x53a26e[_0xcad6cd('0xb')][_0xcad6cd('0x3a')])),_0xa52628[_0xcad6cd('0x38')]=_0xa52628[_0xcad6cd('0x38')]['length']?_0xa52628[_0xcad6cd('0x38')]:_0x414f72[_0xcad6cd('0x4')],_0x53a26e[_0xcad6cd('0xb')][_0xcad6cd('0x1e')]&&(_0xa52628[_0xcad6cd('0x21')]=[{'all':!![]}]),_0xa52628=_[_0xcad6cd('0x24')]({},_0xa52628,_0x53a26e['options']),db[_0xcad6cd('0x2c')][_0xcad6cd('0x28')](_0xa52628)['then'](handleEntityNotFound(_0x213231,null))[_0xcad6cd('0x10')](respondWithResult(_0x213231,null))[_0xcad6cd('0x32')](handleError(_0x213231,null));},exports[_0x295e48('0x22')]=function(_0x1361f4,_0xf7ebb1){const _0x193bd4=_0x295e48;return db['Schedule']['create'](_0x1361f4['body'],{})[_0x193bd4('0x10')](function(_0x1e98c0){const _0x1039fb=_0x193bd4,_0x39df48=_0x1361f4['user'][_0x1039fb('0x1a')]({'plain':!![]});if(!_0x39df48)throw new Error(_0x1039fb('0x27'));if(_0x39df48[_0x1039fb('0x39')]===_0x1039fb('0x12')){const _0x1192ec=_0x1e98c0['get']({'plain':!![]}),_0x3e5b97=_0x1039fb('0x33');return db[_0x1039fb('0x1f')][_0x1039fb('0x28')]({'where':{'name':_0x3e5b97,'userProfileId':_0x39df48['userProfileId']},'raw':!![]})[_0x1039fb('0x10')](function(_0x34b569){const _0x2ecde1=_0x1039fb;return _0x34b569&&_0x34b569[_0x2ecde1('0x3d')]===0x0?db[_0x2ecde1('0x3c')][_0x2ecde1('0x22')]({'name':_0x1192ec[_0x2ecde1('0x3b')],'resourceId':_0x1192ec['id'],'type':_0x34b569[_0x2ecde1('0x3b')],'sectionId':_0x34b569['id']},{})[_0x2ecde1('0x10')](function(){return _0x1e98c0;}):_0x1e98c0;})[_0x1039fb('0x32')](function(_0x452e82){const _0x2a4afd=_0x1039fb;logger[_0x2a4afd('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x452e82);throw _0x452e82;});}return _0x1e98c0;})[_0x193bd4('0x10')](respondWithResult(_0xf7ebb1,0xc9))[_0x193bd4('0x32')](handleError(_0xf7ebb1,null));},exports[_0x295e48('0x2d')]=function(_0x3ffd12,_0xd2c057){const _0x51ac34=_0x295e48;return _0x3ffd12[_0x51ac34('0x1b')]['id']&&delete _0x3ffd12['body']['id'],db[_0x51ac34('0x2c')][_0x51ac34('0x28')]({'where':{'id':_0x3ffd12[_0x51ac34('0x31')]['id']}})[_0x51ac34('0x10')](handleEntityNotFound(_0xd2c057,null))[_0x51ac34('0x10')](saveUpdates(_0x3ffd12[_0x51ac34('0x1b')],null))[_0x51ac34('0x10')](respondWithResult(_0xd2c057,null))[_0x51ac34('0x32')](handleError(_0xd2c057,null));},exports[_0x295e48('0x17')]=function(_0x40f49b,_0x56b460){const _0x5a82df=_0x295e48;return db[_0x5a82df('0x2c')][_0x5a82df('0x28')]({'where':{'id':_0x40f49b[_0x5a82df('0x31')]['id']}})['then'](handleEntityNotFound(_0x56b460,null))['then'](removeEntity(_0x56b460,null))[_0x5a82df('0x32')](handleError(_0x56b460,null));},exports[_0x295e48('0x6')]=function(_0xefb909,_0x52210a){const _0x3a1ee0=_0x295e48,_0x50e64d=require(_0x3a1ee0('0x1c'));return db['Schedule'][_0x3a1ee0('0x28')]({'where':{'id':_0xefb909[_0x3a1ee0('0x31')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x52210a,null))['then'](function(){const _0x4ce60b=_0x3a1ee0;_0x50e64d['run'](_0xefb909[_0x4ce60b('0x31')]['id']);})[_0x3a1ee0('0x10')](respondWithStatusCode(_0x52210a,null))[_0x3a1ee0('0x32')](handleError(_0x52210a,null));};
\ No newline at end of file
+const a530_0x59df=['../../components/parsers/qs','sendStatus','include','send','run','attributes','undefined','offset','end','rows','where','destroy','json','../../config/schedule','../../mysqldb','role','params','key','catch','filter','findOne','limit','stack','findAll','Schedule','name','../../config/logger','includeAll','Content-Range','fieldName','body','show','status','fields','merge','length','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Scheduler','options','index','then','type','filters','user','model','error','sort','intersection','query','create','count','lodash','autoAssociation','map','get','rawAttributes','order'];(function(_0x101706,_0x59dff4){const _0x2595da=function(_0xc4066c){while(--_0xc4066c){_0x101706['push'](_0x101706['shift']());}};_0x2595da(++_0x59dff4);}(a530_0x59df,0x100));const a530_0x2595=function(_0x101706,_0x59dff4){_0x101706=_0x101706-0x0;let _0x2595da=a530_0x59df[_0x101706];return _0x2595da;};const _0x34b450=a530_0x2595;'use strict';const _=require(_0x34b450('0x26')),qs=require(_0x34b450('0x2c')),logger=require(_0x34b450('0xa'))('api'),db=require(_0x34b450('0x3a'))['db'],{Op}=require('sequelize');function respondWithStatusCode(_0xc4066c,_0x1a8bd7){return _0x1a8bd7=_0x1a8bd7||0xcc,function(_0x2905a8){const _0x53c685=a530_0x2595;if(_0x2905a8)return _0xc4066c[_0x53c685('0x2d')](_0x1a8bd7);return _0xc4066c[_0x53c685('0x10')](_0x1a8bd7)['end']();};}function respondWithResult(_0xbc29d9,_0x1123ba){return _0x1123ba=_0x1123ba||0xc8,function(_0x13125a){const _0x3baf14=a530_0x2595;if(_0x13125a)return _0xbc29d9[_0x3baf14('0x10')](_0x1123ba)[_0x3baf14('0x38')](_0x13125a);};}function respondWithFilteredResult(_0x58e137,_0x458da4){return function(_0x1ad1b1){const _0x480652=a530_0x2595;if(_0x1ad1b1){const _0x370ab1=_0x1ad1b1[_0x480652('0x25')],_0x2ae925=_0x458da4[_0x480652('0x33')];let _0x2091b9=_0x458da4['offset']+_0x458da4[_0x480652('0x5')],_0x38f8df;return _0x2091b9>=_0x370ab1?(_0x2091b9=_0x370ab1,_0x38f8df=0xc8):_0x38f8df=0xce,_0x58e137['status'](_0x38f8df),_0x58e137['set'](_0x480652('0xc'),_0x2ae925+'-'+_0x2091b9+'/'+_0x370ab1)[_0x480652('0x38')](_0x1ad1b1);}return null;};}function saveUpdates(_0xd27854){return function(_0x44bc48){const _0x33c38e=a530_0x2595;if(_0x44bc48)return _0x44bc48['update'](_0xd27854)[_0x33c38e('0x1b')](function(_0x147f48){return _0x147f48;});return null;};}function removeEntity(_0x2700f8){return function(_0x324449){const _0x110c29=a530_0x2595;if(_0x324449)return _0x324449['destroy']()[_0x110c29('0x1b')](function(){const _0x35609e=_0x110c29,_0x4a6245=_0x324449[_0x35609e('0x29')]({'plain':!![]}),_0x3a86c9='Scheduler';return db['UserProfileResource'][_0x35609e('0x37')]({'where':{'type':_0x3a86c9,'resourceId':_0x4a6245['id']}})[_0x35609e('0x1b')](function(){return _0x324449;});})['then'](function(){const _0x14a424=_0x110c29;_0x2700f8[_0x14a424('0x10')](0xcc)[_0x14a424('0x34')]();});};}function handleEntityNotFound(_0x19a091){return function(_0x16c697){const _0x33e611=a530_0x2595;return!_0x16c697&&_0x19a091[_0x33e611('0x2d')](0x194),_0x16c697;};}function handleError(_0x2af20e,_0x390550){return _0x390550=_0x390550||0x1f4,function(_0x5791b3){const _0x8361b1=a530_0x2595;logger[_0x8361b1('0x20')](_0x5791b3[_0x8361b1('0x6')]),_0x5791b3['name']&&delete _0x5791b3[_0x8361b1('0x9')],_0x2af20e[_0x8361b1('0x10')](_0x390550)[_0x8361b1('0x2f')](_0x5791b3);};}exports[_0x34b450('0x1a')]=function(_0x21c1b8,_0x5c0043){const _0x190688=_0x34b450;let _0x303a92={};const _0x32280b={},_0x5d8255={'count':0x0,'rows':[]},_0x54b165=_[_0x190688('0x28')](db[_0x190688('0x8')][_0x190688('0x2a')],function(_0x4abcc1){const _0x10dd7b=_0x190688;return{'name':_0x4abcc1[_0x10dd7b('0xd')],'type':_0x4abcc1[_0x10dd7b('0x1c')][_0x10dd7b('0x1')]};});_0x32280b[_0x190688('0x1f')]=_[_0x190688('0x28')](_0x54b165,_0x190688('0x9')),_0x32280b[_0x190688('0x23')]=_['keys'](_0x21c1b8[_0x190688('0x23')]),_0x32280b[_0x190688('0x1d')]=_[_0x190688('0x22')](_0x32280b[_0x190688('0x1f')],_0x32280b[_0x190688('0x23')]),_0x303a92['attributes']=_['intersection'](_0x32280b[_0x190688('0x1f')],qs[_0x190688('0x11')](_0x21c1b8[_0x190688('0x23')][_0x190688('0x11')])),_0x303a92[_0x190688('0x31')]=_0x303a92[_0x190688('0x31')]['length']?_0x303a92[_0x190688('0x31')]:_0x32280b[_0x190688('0x1f')];typeof _0x21c1b8[_0x190688('0x23')]['nolimit']===_0x190688('0x32')&&(_0x303a92['limit']=qs[_0x190688('0x5')](_0x21c1b8[_0x190688('0x23')][_0x190688('0x5')]),_0x303a92[_0x190688('0x33')]=qs[_0x190688('0x33')](_0x21c1b8['query']['offset']));_0x303a92[_0x190688('0x2b')]=qs[_0x190688('0x21')](_0x21c1b8[_0x190688('0x23')][_0x190688('0x21')]),_0x303a92[_0x190688('0x36')]=qs['filters'](_[_0x190688('0x15')](_0x21c1b8[_0x190688('0x23')],_0x32280b[_0x190688('0x1d')]),_0x54b165);_0x21c1b8['query'][_0x190688('0x3')]&&(_0x303a92[_0x190688('0x36')]=_[_0x190688('0x12')](_0x303a92[_0x190688('0x36')],{[Op['or']]:_['map'](_0x54b165,function(_0x9cff81){const _0x2ec936=_0x190688;if(_0x9cff81[_0x2ec936('0x1c')]!=='VIRTUAL'){const _0x19c25b={};return _0x19c25b[_0x9cff81[_0x2ec936('0x9')]]={[Op['like']]:'%'+_0x21c1b8[_0x2ec936('0x23')][_0x2ec936('0x3')]+'%'},_0x19c25b;}})}));_0x303a92=_[_0x190688('0x12')]({},_0x303a92,_0x21c1b8['options']);const _0x2b5e64={'where':_0x303a92[_0x190688('0x36')]};return db[_0x190688('0x8')][_0x190688('0x25')](_0x2b5e64)[_0x190688('0x1b')](function(_0x5f0f5a){const _0x4292cd=_0x190688;return _0x5d8255[_0x4292cd('0x25')]=_0x5f0f5a,_0x21c1b8[_0x4292cd('0x23')][_0x4292cd('0xb')]&&(_0x303a92[_0x4292cd('0x2e')]=[{'all':!![]}]),db[_0x4292cd('0x8')][_0x4292cd('0x7')](_0x303a92);})[_0x190688('0x1b')](function(_0x3641f6){const _0x5a0183=_0x190688;return _0x5d8255[_0x5a0183('0x35')]=_0x3641f6,_0x5d8255;})['then'](respondWithFilteredResult(_0x5c0043,_0x303a92))['catch'](handleError(_0x5c0043,null));},exports[_0x34b450('0xf')]=function(_0x466fb0,_0x350e4b){const _0x318eb8=_0x34b450;let _0x2ec6c0={'raw':![],'where':{'id':_0x466fb0['params']['id']}};const _0x402852={};return _0x402852[_0x318eb8('0x1f')]=_['keys'](db[_0x318eb8('0x8')]['rawAttributes']),_0x402852['query']=_['keys'](_0x466fb0[_0x318eb8('0x23')]),_0x402852['filters']=_[_0x318eb8('0x22')](_0x402852[_0x318eb8('0x1f')],_0x402852['query']),_0x2ec6c0[_0x318eb8('0x31')]=_['intersection'](_0x402852[_0x318eb8('0x1f')],qs[_0x318eb8('0x11')](_0x466fb0[_0x318eb8('0x23')][_0x318eb8('0x11')])),_0x2ec6c0[_0x318eb8('0x31')]=_0x2ec6c0['attributes'][_0x318eb8('0x13')]?_0x2ec6c0[_0x318eb8('0x31')]:_0x402852[_0x318eb8('0x1f')],_0x466fb0[_0x318eb8('0x23')]['includeAll']&&(_0x2ec6c0[_0x318eb8('0x2e')]=[{'all':!![]}]),_0x2ec6c0=_[_0x318eb8('0x12')]({},_0x2ec6c0,_0x466fb0[_0x318eb8('0x19')]),db[_0x318eb8('0x8')][_0x318eb8('0x4')](_0x2ec6c0)[_0x318eb8('0x1b')](handleEntityNotFound(_0x350e4b,null))[_0x318eb8('0x1b')](respondWithResult(_0x350e4b,null))[_0x318eb8('0x2')](handleError(_0x350e4b,null));},exports[_0x34b450('0x24')]=function(_0x525a71,_0x144cd4){const _0xded8cf=_0x34b450;return db[_0xded8cf('0x8')]['create'](_0x525a71[_0xded8cf('0xe')],{})[_0xded8cf('0x1b')](function(_0x5dcef6){const _0x301b9c=_0xded8cf,_0x467831=_0x525a71[_0x301b9c('0x1e')][_0x301b9c('0x29')]({'plain':!![]});if(!_0x467831)throw new Error(_0x301b9c('0x16'));if(_0x467831[_0x301b9c('0x3b')]===_0x301b9c('0x1e')){const _0x462326=_0x5dcef6[_0x301b9c('0x29')]({'plain':!![]}),_0x27b91b=_0x301b9c('0x18');return db[_0x301b9c('0x17')][_0x301b9c('0x4')]({'where':{'name':_0x27b91b,'userProfileId':_0x467831['userProfileId']},'raw':!![]})['then'](function(_0x4fae12){const _0x295045=_0x301b9c;return _0x4fae12&&_0x4fae12[_0x295045('0x27')]===0x0?db['UserProfileResource'][_0x295045('0x24')]({'name':_0x462326[_0x295045('0x9')],'resourceId':_0x462326['id'],'type':_0x4fae12[_0x295045('0x9')],'sectionId':_0x4fae12['id']},{})[_0x295045('0x1b')](function(){return _0x5dcef6;}):_0x5dcef6;})[_0x301b9c('0x2')](function(_0x1dd706){const _0x1223ff=_0x301b9c;logger[_0x1223ff('0x20')](_0x1223ff('0x14'),_0x1dd706);throw _0x1dd706;});}return _0x5dcef6;})['then'](respondWithResult(_0x144cd4,0xc9))[_0xded8cf('0x2')](handleError(_0x144cd4,null));},exports['update']=function(_0x1caca7,_0x50e811){const _0x350f6a=_0x34b450;return _0x1caca7[_0x350f6a('0xe')]['id']&&delete _0x1caca7['body']['id'],db[_0x350f6a('0x8')][_0x350f6a('0x4')]({'where':{'id':_0x1caca7[_0x350f6a('0x0')]['id']}})['then'](handleEntityNotFound(_0x50e811,null))[_0x350f6a('0x1b')](saveUpdates(_0x1caca7[_0x350f6a('0xe')],null))[_0x350f6a('0x1b')](respondWithResult(_0x50e811,null))[_0x350f6a('0x2')](handleError(_0x50e811,null));},exports['destroy']=function(_0x490696,_0x486853){const _0x302945=_0x34b450;return db[_0x302945('0x8')][_0x302945('0x4')]({'where':{'id':_0x490696['params']['id']}})['then'](handleEntityNotFound(_0x486853,null))['then'](removeEntity(_0x486853,null))[_0x302945('0x2')](handleError(_0x486853,null));},exports[_0x34b450('0x30')]=function(_0x19e359,_0x431711){const _0x507ba5=_0x34b450,_0x36dc7e=require(_0x507ba5('0x39'));return db[_0x507ba5('0x8')][_0x507ba5('0x4')]({'where':{'id':_0x19e359['params']['id']},'raw':!![]})[_0x507ba5('0x1b')](handleEntityNotFound(_0x431711,null))[_0x507ba5('0x1b')](function(){const _0x1f8af9=_0x507ba5;_0x36dc7e[_0x1f8af9('0x30')](_0x19e359[_0x1f8af9('0x0')]['id']);})[_0x507ba5('0x1b')](respondWithStatusCode(_0x431711,null))[_0x507ba5('0x2')](handleError(_0x431711,null));};
\ No newline at end of file