Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / schedule / schedule.controller.js
index 90e767d..34c6f24 100644 (file)
@@ -1 +1 @@
-const a530_0x5852=['user','fieldName','status','filters','keys','../../config/schedule','fields','index','findOne','sendStatus','options','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attributes','VIRTUAL','filter','length','run','includeAll','rawAttributes','type','intersection','like','model','name','nolimit','destroy','findAll','UserProfileResource','role','Schedule','get','lodash','include','set','sort','../../components/parsers/qs','create','query','params','where','body','then','offset','limit','UserProfileSection','merge','order','show','count','userProfileId','end','catch','autoAssociation','../../config/logger','key','json','map','sequelize','update'];(function(_0x262402,_0x58525f){const _0x1cee66=function(_0x58336e){while(--_0x58336e){_0x262402['push'](_0x262402['shift']());}};_0x1cee66(++_0x58525f);}(a530_0x5852,0xd1));const a530_0x1cee=function(_0x262402,_0x58525f){_0x262402=_0x262402-0x0;let _0x1cee66=a530_0x5852[_0x262402];return _0x1cee66;};const _0x18dedb=a530_0x1cee;'use strict';const _=require(_0x18dedb('0x3a')),qs=require(_0x18dedb('0x3')),logger=require(_0x18dedb('0x15'))('api'),db=require('../../mysqldb')['db'],{Op}=require(_0x18dedb('0x19'));function respondWithStatusCode(_0x58336e,_0x4a0c3d){return _0x4a0c3d=_0x4a0c3d||0xcc,function(_0x46ad32){const _0x596b53=a530_0x1cee;if(_0x46ad32)return _0x58336e['sendStatus'](_0x4a0c3d);return _0x58336e[_0x596b53('0x1d')](_0x4a0c3d)[_0x596b53('0x12')]();};}function respondWithResult(_0xd4b3d6,_0x596c7f){return _0x596c7f=_0x596c7f||0xc8,function(_0x436a2d){const _0x428821=a530_0x1cee;if(_0x436a2d)return _0xd4b3d6['status'](_0x596c7f)[_0x428821('0x17')](_0x436a2d);};}function respondWithFilteredResult(_0x1eee86,_0x312181){return function(_0x15fe96){const _0xb9e22a=a530_0x1cee;if(_0x15fe96){const _0x529544=_0x15fe96[_0xb9e22a('0x10')],_0xc01d81=_0x312181[_0xb9e22a('0xa')];let _0x16ac7b=_0x312181[_0xb9e22a('0xa')]+_0x312181[_0xb9e22a('0xb')],_0x903807;return _0x16ac7b>=_0x529544?(_0x16ac7b=_0x529544,_0x903807=0xc8):_0x903807=0xce,_0x1eee86['status'](_0x903807),_0x1eee86[_0xb9e22a('0x1')]('Content-Range',_0xc01d81+'-'+_0x16ac7b+'/'+_0x529544)[_0xb9e22a('0x17')](_0x15fe96);}return null;};}function saveUpdates(_0x49e035){return function(_0x337d38){const _0x341553=a530_0x1cee;if(_0x337d38)return _0x337d38[_0x341553('0x1a')](_0x49e035)[_0x341553('0x9')](function(_0x1a7708){return _0x1a7708;});return null;};}function removeEntity(_0x2ce7f9){return function(_0x5944bb){const _0x1fb225=a530_0x1cee;if(_0x5944bb)return _0x5944bb[_0x1fb225('0x34')]()[_0x1fb225('0x9')](function(){const _0x5df1ef=_0x1fb225,_0x10ab89=_0x5944bb[_0x5df1ef('0x39')]({'plain':!![]}),_0x4fab9e='Scheduler';return db[_0x5df1ef('0x36')]['destroy']({'where':{'type':_0x4fab9e,'resourceId':_0x10ab89['id']}})['then'](function(){return _0x5944bb;});})[_0x1fb225('0x9')](function(){const _0xb573e1=_0x1fb225;_0x2ce7f9[_0xb573e1('0x1d')](0xcc)['end']();});};}function handleEntityNotFound(_0x4125f1){return function(_0x4a75f3){const _0x425232=a530_0x1cee;return!_0x4a75f3&&_0x4125f1[_0x425232('0x24')](0x194),_0x4a75f3;};}function handleError(_0x2d07e8,_0x314692){return _0x314692=_0x314692||0x1f4,function(_0x4c1189){const _0x49fd96=a530_0x1cee;logger['error'](_0x4c1189['stack']),_0x4c1189[_0x49fd96('0x32')]&&delete _0x4c1189['name'],_0x2d07e8[_0x49fd96('0x1d')](_0x314692)['send'](_0x4c1189);};}exports[_0x18dedb('0x22')]=function(_0xda6a61,_0x4012ed){const _0x49bd72=_0x18dedb;let _0x5b1f8b={};const _0x1d1410={},_0x5e769c={'count':0x0,'rows':[]},_0x4aa26e=_['map'](db[_0x49bd72('0x38')][_0x49bd72('0x2d')],function(_0x4f7cd4){const _0x4acf19=_0x49bd72;return{'name':_0x4f7cd4[_0x4acf19('0x1c')],'type':_0x4f7cd4[_0x4acf19('0x2e')][_0x4acf19('0x16')]};});_0x1d1410[_0x49bd72('0x31')]=_[_0x49bd72('0x18')](_0x4aa26e,'name'),_0x1d1410['query']=_['keys'](_0xda6a61[_0x49bd72('0x5')]),_0x1d1410[_0x49bd72('0x1e')]=_['intersection'](_0x1d1410[_0x49bd72('0x31')],_0x1d1410[_0x49bd72('0x5')]),_0x5b1f8b['attributes']=_[_0x49bd72('0x2f')](_0x1d1410[_0x49bd72('0x31')],qs[_0x49bd72('0x21')](_0xda6a61[_0x49bd72('0x5')][_0x49bd72('0x21')])),_0x5b1f8b['attributes']=_0x5b1f8b[_0x49bd72('0x27')][_0x49bd72('0x2a')]?_0x5b1f8b[_0x49bd72('0x27')]:_0x1d1410['model'];typeof _0xda6a61['query'][_0x49bd72('0x33')]==='undefined'&&(_0x5b1f8b[_0x49bd72('0xb')]=qs[_0x49bd72('0xb')](_0xda6a61['query']['limit']),_0x5b1f8b['offset']=qs[_0x49bd72('0xa')](_0xda6a61[_0x49bd72('0x5')]['offset']));_0x5b1f8b[_0x49bd72('0xe')]=qs[_0x49bd72('0x2')](_0xda6a61[_0x49bd72('0x5')][_0x49bd72('0x2')]),_0x5b1f8b[_0x49bd72('0x7')]=qs[_0x49bd72('0x1e')](_['pick'](_0xda6a61[_0x49bd72('0x5')],_0x1d1410['filters']),_0x4aa26e);_0xda6a61[_0x49bd72('0x5')][_0x49bd72('0x29')]&&(_0x5b1f8b['where']=_[_0x49bd72('0xd')](_0x5b1f8b['where'],{[Op['or']]:_[_0x49bd72('0x18')](_0x4aa26e,function(_0x312f1a){const _0x54bbdd=_0x49bd72;if(_0x312f1a[_0x54bbdd('0x2e')]!==_0x54bbdd('0x28')){const _0x507b1e={};return _0x507b1e[_0x312f1a[_0x54bbdd('0x32')]]={[Op[_0x54bbdd('0x30')]]:'%'+_0xda6a61[_0x54bbdd('0x5')][_0x54bbdd('0x29')]+'%'},_0x507b1e;}})}));_0x5b1f8b=_[_0x49bd72('0xd')]({},_0x5b1f8b,_0xda6a61[_0x49bd72('0x25')]);const _0x1c3ac6={'where':_0x5b1f8b[_0x49bd72('0x7')]};return db[_0x49bd72('0x38')][_0x49bd72('0x10')](_0x1c3ac6)[_0x49bd72('0x9')](function(_0x143973){const _0x119e66=_0x49bd72;return _0x5e769c[_0x119e66('0x10')]=_0x143973,_0xda6a61['query'][_0x119e66('0x2c')]&&(_0x5b1f8b[_0x119e66('0x0')]=[{'all':!![]}]),db[_0x119e66('0x38')][_0x119e66('0x35')](_0x5b1f8b);})[_0x49bd72('0x9')](function(_0x2b83c5){return _0x5e769c['rows']=_0x2b83c5,_0x5e769c;})[_0x49bd72('0x9')](respondWithFilteredResult(_0x4012ed,_0x5b1f8b))['catch'](handleError(_0x4012ed,null));},exports[_0x18dedb('0xf')]=function(_0x32d8d4,_0x240033){const _0x4a9259=_0x18dedb;let _0x4e825e={'raw':![],'where':{'id':_0x32d8d4['params']['id']}};const _0x3c192b={};return _0x3c192b['model']=_['keys'](db['Schedule'][_0x4a9259('0x2d')]),_0x3c192b['query']=_[_0x4a9259('0x1f')](_0x32d8d4[_0x4a9259('0x5')]),_0x3c192b[_0x4a9259('0x1e')]=_['intersection'](_0x3c192b[_0x4a9259('0x31')],_0x3c192b[_0x4a9259('0x5')]),_0x4e825e[_0x4a9259('0x27')]=_[_0x4a9259('0x2f')](_0x3c192b['model'],qs[_0x4a9259('0x21')](_0x32d8d4['query'][_0x4a9259('0x21')])),_0x4e825e[_0x4a9259('0x27')]=_0x4e825e[_0x4a9259('0x27')][_0x4a9259('0x2a')]?_0x4e825e[_0x4a9259('0x27')]:_0x3c192b[_0x4a9259('0x31')],_0x32d8d4[_0x4a9259('0x5')][_0x4a9259('0x2c')]&&(_0x4e825e[_0x4a9259('0x0')]=[{'all':!![]}]),_0x4e825e=_['merge']({},_0x4e825e,_0x32d8d4['options']),db[_0x4a9259('0x38')]['findOne'](_0x4e825e)[_0x4a9259('0x9')](handleEntityNotFound(_0x240033,null))[_0x4a9259('0x9')](respondWithResult(_0x240033,null))[_0x4a9259('0x13')](handleError(_0x240033,null));},exports['create']=function(_0x5c933b,_0x3114ef){const _0xec2637=_0x18dedb;return db[_0xec2637('0x38')][_0xec2637('0x4')](_0x5c933b[_0xec2637('0x8')],{})[_0xec2637('0x9')](function(_0x3de262){const _0xdcc8fc=_0xec2637,_0x2a6223=_0x5c933b[_0xdcc8fc('0x1b')][_0xdcc8fc('0x39')]({'plain':!![]});if(!_0x2a6223)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a6223[_0xdcc8fc('0x37')]===_0xdcc8fc('0x1b')){const _0x1ae14b=_0x3de262[_0xdcc8fc('0x39')]({'plain':!![]}),_0x2124ac='Scheduler';return db[_0xdcc8fc('0xc')]['findOne']({'where':{'name':_0x2124ac,'userProfileId':_0x2a6223[_0xdcc8fc('0x11')]},'raw':!![]})['then'](function(_0x1316ce){const _0x3599cd=_0xdcc8fc;return _0x1316ce&&_0x1316ce[_0x3599cd('0x14')]===0x0?db[_0x3599cd('0x36')][_0x3599cd('0x4')]({'name':_0x1ae14b[_0x3599cd('0x32')],'resourceId':_0x1ae14b['id'],'type':_0x1316ce[_0x3599cd('0x32')],'sectionId':_0x1316ce['id']},{})[_0x3599cd('0x9')](function(){return _0x3de262;}):_0x3de262;})[_0xdcc8fc('0x13')](function(_0x4e8495){const _0x4f4dbe=_0xdcc8fc;logger['error'](_0x4f4dbe('0x26'),_0x4e8495);throw _0x4e8495;});}return _0x3de262;})['then'](respondWithResult(_0x3114ef,0xc9))[_0xec2637('0x13')](handleError(_0x3114ef,null));},exports[_0x18dedb('0x1a')]=function(_0x4a05f5,_0x2ec257){const _0x5bcf11=_0x18dedb;return _0x4a05f5[_0x5bcf11('0x8')]['id']&&delete _0x4a05f5[_0x5bcf11('0x8')]['id'],db['Schedule'][_0x5bcf11('0x23')]({'where':{'id':_0x4a05f5[_0x5bcf11('0x6')]['id']}})[_0x5bcf11('0x9')](handleEntityNotFound(_0x2ec257,null))['then'](saveUpdates(_0x4a05f5[_0x5bcf11('0x8')],null))[_0x5bcf11('0x9')](respondWithResult(_0x2ec257,null))[_0x5bcf11('0x13')](handleError(_0x2ec257,null));},exports['destroy']=function(_0x52ee8b,_0x255b0e){const _0x1d2c6a=_0x18dedb;return db[_0x1d2c6a('0x38')]['findOne']({'where':{'id':_0x52ee8b[_0x1d2c6a('0x6')]['id']}})[_0x1d2c6a('0x9')](handleEntityNotFound(_0x255b0e,null))[_0x1d2c6a('0x9')](removeEntity(_0x255b0e,null))[_0x1d2c6a('0x13')](handleError(_0x255b0e,null));},exports[_0x18dedb('0x2b')]=function(_0x3f0ffc,_0x20f852){const _0x5b3b3f=_0x18dedb,_0x2a0276=require(_0x5b3b3f('0x20'));return db['Schedule']['findOne']({'where':{'id':_0x3f0ffc[_0x5b3b3f('0x6')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x20f852,null))[_0x5b3b3f('0x9')](function(){const _0x2521dd=_0x5b3b3f;_0x2a0276[_0x2521dd('0x2b')](_0x3f0ffc[_0x2521dd('0x6')]['id']);})['then'](respondWithStatusCode(_0x20f852,null))['catch'](handleError(_0x20f852,null));};
\ No newline at end of file
+const a530_0xcc34=['json','role','stack','Schedule','keys','Scheduler','findOne','api','run','create','sendStatus','userProfileId','type','options','end','get','nolimit','set','autoAssociation','../../components/parsers/qs','body','../../mysqldb','params','intersection','user','destroy','length','filters','UserProfileResource','filter','catch','like','sequelize','rows','VIRTUAL','sort','name','then','limit','pick','attributes','rawAttributes','count','findAll','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fields','Unable\x20to\x20retrieve\x20the\x20current\x20user','status','map','merge','key','includeAll','../../config/logger','error','query','offset','model','update','index','send','UserProfileSection','Content-Range','show','where','order'];(function(_0x29b878,_0xcc3480){const _0x269fe7=function(_0x37b880){while(--_0x37b880){_0x29b878['push'](_0x29b878['shift']());}};_0x269fe7(++_0xcc3480);}(a530_0xcc34,0x13d));const a530_0x269f=function(_0x29b878,_0xcc3480){_0x29b878=_0x29b878-0x0;let _0x269fe7=a530_0xcc34[_0x29b878];return _0x269fe7;};const _0x279737=a530_0x269f;'use strict';const _=require('lodash'),qs=require(_0x279737('0x1b')),logger=require(_0x279737('0x3c'))(_0x279737('0xf')),db=require(_0x279737('0x1d'))['db'],{Op}=require(_0x279737('0x28'));function respondWithStatusCode(_0x37b880,_0x524611){return _0x524611=_0x524611||0xcc,function(_0x38ac0c){const _0x1a1ab1=a530_0x269f;if(_0x38ac0c)return _0x37b880[_0x1a1ab1('0x12')](_0x524611);return _0x37b880[_0x1a1ab1('0x37')](_0x524611)[_0x1a1ab1('0x16')]();};}function respondWithResult(_0x20504e,_0x5e3e79){return _0x5e3e79=_0x5e3e79||0xc8,function(_0x196c0d){const _0x1cbedb=a530_0x269f;if(_0x196c0d)return _0x20504e[_0x1cbedb('0x37')](_0x5e3e79)[_0x1cbedb('0x8')](_0x196c0d);};}function respondWithFilteredResult(_0x2f5f66,_0x10f20b){return function(_0x55edbc){const _0x263214=a530_0x269f;if(_0x55edbc){const _0x3fb527=_0x55edbc['count'],_0x3ea538=_0x10f20b['offset'];let _0x3794dc=_0x10f20b[_0x263214('0x3f')]+_0x10f20b['limit'],_0x5e339c;return _0x3794dc>=_0x3fb527?(_0x3794dc=_0x3fb527,_0x5e339c=0xc8):_0x5e339c=0xce,_0x2f5f66[_0x263214('0x37')](_0x5e339c),_0x2f5f66[_0x263214('0x19')](_0x263214('0x4'),_0x3ea538+'-'+_0x3794dc+'/'+_0x3fb527)[_0x263214('0x8')](_0x55edbc);}return null;};}function saveUpdates(_0x36a53d){return function(_0x3df61e){const _0x4968d9=a530_0x269f;if(_0x3df61e)return _0x3df61e[_0x4968d9('0x0')](_0x36a53d)[_0x4968d9('0x2d')](function(_0x4c7fe0){return _0x4c7fe0;});return null;};}function removeEntity(_0x34e527){return function(_0x2c3b6b){const _0x5eebfe=a530_0x269f;if(_0x2c3b6b)return _0x2c3b6b[_0x5eebfe('0x21')]()[_0x5eebfe('0x2d')](function(){const _0x228ce7=_0x5eebfe,_0x5e14f9=_0x2c3b6b[_0x228ce7('0x17')]({'plain':!![]}),_0x510de9='Scheduler';return db[_0x228ce7('0x24')]['destroy']({'where':{'type':_0x510de9,'resourceId':_0x5e14f9['id']}})['then'](function(){return _0x2c3b6b;});})['then'](function(){const _0x570ab4=_0x5eebfe;_0x34e527['status'](0xcc)[_0x570ab4('0x16')]();});};}function handleEntityNotFound(_0x26bf21){return function(_0x2ea045){const _0x17d73c=a530_0x269f;return!_0x2ea045&&_0x26bf21[_0x17d73c('0x12')](0x194),_0x2ea045;};}function handleError(_0x5ac949,_0x2a04d7){return _0x2a04d7=_0x2a04d7||0x1f4,function(_0x18efe9){const _0x4aedfa=a530_0x269f;logger[_0x4aedfa('0x3d')](_0x18efe9[_0x4aedfa('0xa')]),_0x18efe9[_0x4aedfa('0x2c')]&&delete _0x18efe9[_0x4aedfa('0x2c')],_0x5ac949[_0x4aedfa('0x37')](_0x2a04d7)[_0x4aedfa('0x2')](_0x18efe9);};}exports[_0x279737('0x1')]=function(_0x528dd6,_0x40c960){const _0x45d5fa=_0x279737;let _0x392690={};const _0x56a9a3={},_0xf4258e={'count':0x0,'rows':[]},_0x5edfdf=_[_0x45d5fa('0x38')](db[_0x45d5fa('0xb')][_0x45d5fa('0x31')],function(_0x3d905b){const _0x30accb=_0x45d5fa;return{'name':_0x3d905b['fieldName'],'type':_0x3d905b[_0x30accb('0x14')][_0x30accb('0x3a')]};});_0x56a9a3['model']=_[_0x45d5fa('0x38')](_0x5edfdf,_0x45d5fa('0x2c')),_0x56a9a3[_0x45d5fa('0x3e')]=_['keys'](_0x528dd6[_0x45d5fa('0x3e')]),_0x56a9a3[_0x45d5fa('0x23')]=_[_0x45d5fa('0x1f')](_0x56a9a3[_0x45d5fa('0x40')],_0x56a9a3['query']),_0x392690[_0x45d5fa('0x30')]=_[_0x45d5fa('0x1f')](_0x56a9a3[_0x45d5fa('0x40')],qs[_0x45d5fa('0x35')](_0x528dd6[_0x45d5fa('0x3e')][_0x45d5fa('0x35')])),_0x392690[_0x45d5fa('0x30')]=_0x392690[_0x45d5fa('0x30')][_0x45d5fa('0x22')]?_0x392690[_0x45d5fa('0x30')]:_0x56a9a3[_0x45d5fa('0x40')];typeof _0x528dd6['query'][_0x45d5fa('0x18')]==='undefined'&&(_0x392690[_0x45d5fa('0x2e')]=qs['limit'](_0x528dd6['query'][_0x45d5fa('0x2e')]),_0x392690['offset']=qs[_0x45d5fa('0x3f')](_0x528dd6[_0x45d5fa('0x3e')][_0x45d5fa('0x3f')]));_0x392690[_0x45d5fa('0x7')]=qs['sort'](_0x528dd6[_0x45d5fa('0x3e')][_0x45d5fa('0x2b')]),_0x392690['where']=qs['filters'](_[_0x45d5fa('0x2f')](_0x528dd6['query'],_0x56a9a3[_0x45d5fa('0x23')]),_0x5edfdf);_0x528dd6[_0x45d5fa('0x3e')][_0x45d5fa('0x25')]&&(_0x392690['where']=_[_0x45d5fa('0x39')](_0x392690['where'],{[Op['or']]:_['map'](_0x5edfdf,function(_0x2d9594){const _0x4782e0=_0x45d5fa;if(_0x2d9594['type']!==_0x4782e0('0x2a')){const _0x55b934={};return _0x55b934[_0x2d9594['name']]={[Op[_0x4782e0('0x27')]]:'%'+_0x528dd6[_0x4782e0('0x3e')][_0x4782e0('0x25')]+'%'},_0x55b934;}})}));_0x392690=_[_0x45d5fa('0x39')]({},_0x392690,_0x528dd6[_0x45d5fa('0x15')]);const _0x202f5e={'where':_0x392690[_0x45d5fa('0x6')]};return db[_0x45d5fa('0xb')][_0x45d5fa('0x32')](_0x202f5e)[_0x45d5fa('0x2d')](function(_0x3e0f59){const _0x36009c=_0x45d5fa;return _0xf4258e['count']=_0x3e0f59,_0x528dd6[_0x36009c('0x3e')][_0x36009c('0x3b')]&&(_0x392690['include']=[{'all':!![]}]),db[_0x36009c('0xb')][_0x36009c('0x33')](_0x392690);})[_0x45d5fa('0x2d')](function(_0x287b97){const _0x63986a=_0x45d5fa;return _0xf4258e[_0x63986a('0x29')]=_0x287b97,_0xf4258e;})[_0x45d5fa('0x2d')](respondWithFilteredResult(_0x40c960,_0x392690))[_0x45d5fa('0x26')](handleError(_0x40c960,null));},exports[_0x279737('0x5')]=function(_0x57aabc,_0x1d1a83){const _0x5762d5=_0x279737;let _0x34ec2a={'raw':![],'where':{'id':_0x57aabc[_0x5762d5('0x1e')]['id']}};const _0x56eea9={};return _0x56eea9[_0x5762d5('0x40')]=_['keys'](db[_0x5762d5('0xb')]['rawAttributes']),_0x56eea9[_0x5762d5('0x3e')]=_[_0x5762d5('0xc')](_0x57aabc[_0x5762d5('0x3e')]),_0x56eea9['filters']=_[_0x5762d5('0x1f')](_0x56eea9[_0x5762d5('0x40')],_0x56eea9[_0x5762d5('0x3e')]),_0x34ec2a['attributes']=_[_0x5762d5('0x1f')](_0x56eea9[_0x5762d5('0x40')],qs['fields'](_0x57aabc[_0x5762d5('0x3e')][_0x5762d5('0x35')])),_0x34ec2a[_0x5762d5('0x30')]=_0x34ec2a[_0x5762d5('0x30')][_0x5762d5('0x22')]?_0x34ec2a['attributes']:_0x56eea9[_0x5762d5('0x40')],_0x57aabc[_0x5762d5('0x3e')][_0x5762d5('0x3b')]&&(_0x34ec2a['include']=[{'all':!![]}]),_0x34ec2a=_['merge']({},_0x34ec2a,_0x57aabc[_0x5762d5('0x15')]),db['Schedule'][_0x5762d5('0xe')](_0x34ec2a)['then'](handleEntityNotFound(_0x1d1a83,null))[_0x5762d5('0x2d')](respondWithResult(_0x1d1a83,null))[_0x5762d5('0x26')](handleError(_0x1d1a83,null));},exports['create']=function(_0x263ff0,_0x14c33c){const _0x1e137b=_0x279737;return db[_0x1e137b('0xb')][_0x1e137b('0x11')](_0x263ff0[_0x1e137b('0x1c')],{})[_0x1e137b('0x2d')](function(_0x272336){const _0x1db5da=_0x1e137b,_0x5177d0=_0x263ff0[_0x1db5da('0x20')][_0x1db5da('0x17')]({'plain':!![]});if(!_0x5177d0)throw new Error(_0x1db5da('0x36'));if(_0x5177d0[_0x1db5da('0x9')]===_0x1db5da('0x20')){const _0x3745a3=_0x272336[_0x1db5da('0x17')]({'plain':!![]}),_0x32ce9b=_0x1db5da('0xd');return db[_0x1db5da('0x3')][_0x1db5da('0xe')]({'where':{'name':_0x32ce9b,'userProfileId':_0x5177d0[_0x1db5da('0x13')]},'raw':!![]})[_0x1db5da('0x2d')](function(_0x4392b8){const _0x2fe432=_0x1db5da;return _0x4392b8&&_0x4392b8[_0x2fe432('0x1a')]===0x0?db[_0x2fe432('0x24')][_0x2fe432('0x11')]({'name':_0x3745a3[_0x2fe432('0x2c')],'resourceId':_0x3745a3['id'],'type':_0x4392b8[_0x2fe432('0x2c')],'sectionId':_0x4392b8['id']},{})[_0x2fe432('0x2d')](function(){return _0x272336;}):_0x272336;})[_0x1db5da('0x26')](function(_0x135ead){const _0x363161=_0x1db5da;logger[_0x363161('0x3d')](_0x363161('0x34'),_0x135ead);throw _0x135ead;});}return _0x272336;})[_0x1e137b('0x2d')](respondWithResult(_0x14c33c,0xc9))['catch'](handleError(_0x14c33c,null));},exports['update']=function(_0x233b7b,_0x5473bb){const _0xb909a9=_0x279737;return _0x233b7b[_0xb909a9('0x1c')]['id']&&delete _0x233b7b['body']['id'],db['Schedule']['findOne']({'where':{'id':_0x233b7b[_0xb909a9('0x1e')]['id']}})[_0xb909a9('0x2d')](handleEntityNotFound(_0x5473bb,null))[_0xb909a9('0x2d')](saveUpdates(_0x233b7b[_0xb909a9('0x1c')],null))[_0xb909a9('0x2d')](respondWithResult(_0x5473bb,null))[_0xb909a9('0x26')](handleError(_0x5473bb,null));},exports[_0x279737('0x21')]=function(_0x77b38c,_0x4d615a){const _0x3e0776=_0x279737;return db[_0x3e0776('0xb')][_0x3e0776('0xe')]({'where':{'id':_0x77b38c[_0x3e0776('0x1e')]['id']}})[_0x3e0776('0x2d')](handleEntityNotFound(_0x4d615a,null))['then'](removeEntity(_0x4d615a,null))[_0x3e0776('0x26')](handleError(_0x4d615a,null));},exports[_0x279737('0x10')]=function(_0x217ed3,_0x3e2c99){const _0x4871ca=_0x279737,_0x2ae7af=require('../../config/schedule');return db[_0x4871ca('0xb')]['findOne']({'where':{'id':_0x217ed3[_0x4871ca('0x1e')]['id']},'raw':!![]})[_0x4871ca('0x2d')](handleEntityNotFound(_0x3e2c99,null))[_0x4871ca('0x2d')](function(){const _0x225ca7=_0x4871ca;_0x2ae7af[_0x225ca7('0x10')](_0x217ed3[_0x225ca7('0x1e')]['id']);})[_0x4871ca('0x2d')](respondWithStatusCode(_0x3e2c99,null))['catch'](handleError(_0x3e2c99,null));};
\ No newline at end of file