Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / schedule / schedule.controller.js
index a0acf77..733f0c7 100644 (file)
@@ -1 +1 @@
-const a530_0xea9f=['keys','UserProfileResource','order','limit','sort','map','pick','rawAttributes','type','get','end','include','update','findOne','then','user','model','run','destroy','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fields','sendStatus','lodash','sequelize','includeAll','length','api','filters','UserProfileSection','body','send','params','set','intersection','show','stack','fieldName','../../components/parsers/qs','error','where','filter','json','VIRTUAL','findAll','merge','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','offset','status','name','options','index','Schedule','nolimit','key','catch','like','Scheduler','query','count','rows','create','../../mysqldb','userProfileId','attributes'];(function(_0x3ad1cb,_0xea9f36){const _0x47dbf0=function(_0x299fcd){while(--_0x299fcd){_0x3ad1cb['push'](_0x3ad1cb['shift']());}};_0x47dbf0(++_0xea9f36);}(a530_0xea9f,0x1c7));const a530_0x47db=function(_0x3ad1cb,_0xea9f36){_0x3ad1cb=_0x3ad1cb-0x0;let _0x47dbf0=a530_0xea9f[_0x3ad1cb];return _0x47dbf0;};const _0x5e424c=a530_0x47db;'use strict';const _=require(_0x5e424c('0x16')),qs=require(_0x5e424c('0x25')),logger=require('../../config/logger')(_0x5e424c('0x1a')),db=require(_0x5e424c('0x3e'))['db'],{Op}=require(_0x5e424c('0x17'));function respondWithStatusCode(_0x299fcd,_0xc064db){return _0xc064db=_0xc064db||0xcc,function(_0x28e520){const _0x3be852=a530_0x47db;if(_0x28e520)return _0x299fcd['sendStatus'](_0xc064db);return _0x299fcd['status'](_0xc064db)[_0x3be852('0xa')]();};}function respondWithResult(_0x3e0909,_0x30fe81){return _0x30fe81=_0x30fe81||0xc8,function(_0x1d9c69){const _0x457589=a530_0x47db;if(_0x1d9c69)return _0x3e0909[_0x457589('0x30')](_0x30fe81)['json'](_0x1d9c69);};}function respondWithFilteredResult(_0x1680c3,_0x37c0bd){return function(_0x4367e6){const _0x1692c2=a530_0x47db;if(_0x4367e6){const _0x1e4380=_0x4367e6['count'],_0x4f6173=_0x37c0bd[_0x1692c2('0x2f')];let _0x4c9616=_0x37c0bd['offset']+_0x37c0bd[_0x1692c2('0x3')],_0x1c3edb;return _0x4c9616>=_0x1e4380?(_0x4c9616=_0x1e4380,_0x1c3edb=0xc8):_0x1c3edb=0xce,_0x1680c3[_0x1692c2('0x30')](_0x1c3edb),_0x1680c3[_0x1692c2('0x20')]('Content-Range',_0x4f6173+'-'+_0x4c9616+'/'+_0x1e4380)[_0x1692c2('0x29')](_0x4367e6);}return null;};}function saveUpdates(_0x32cffb){return function(_0x3c740b){const _0x53819c=a530_0x47db;if(_0x3c740b)return _0x3c740b['update'](_0x32cffb)[_0x53819c('0xe')](function(_0x30d220){return _0x30d220;});return null;};}function removeEntity(_0x58837c){return function(_0x5b7979){const _0x2b3965=a530_0x47db;if(_0x5b7979)return _0x5b7979['destroy']()[_0x2b3965('0xe')](function(){const _0x5f2ce6=_0x2b3965,_0xb7e2b4=_0x5b7979[_0x5f2ce6('0x9')]({'plain':!![]}),_0x105c1c=_0x5f2ce6('0x39');return db[_0x5f2ce6('0x1')][_0x5f2ce6('0x12')]({'where':{'type':_0x105c1c,'resourceId':_0xb7e2b4['id']}})[_0x5f2ce6('0xe')](function(){return _0x5b7979;});})[_0x2b3965('0xe')](function(){const _0x4fc466=_0x2b3965;_0x58837c['status'](0xcc)[_0x4fc466('0xa')]();});};}function handleEntityNotFound(_0x7bc5c){return function(_0x1199d6){const _0xe20b6=a530_0x47db;return!_0x1199d6&&_0x7bc5c[_0xe20b6('0x15')](0x194),_0x1199d6;};}function handleError(_0x15d0ab,_0x3c2629){return _0x3c2629=_0x3c2629||0x1f4,function(_0x344bf8){const _0x4ef6eb=a530_0x47db;logger[_0x4ef6eb('0x26')](_0x344bf8[_0x4ef6eb('0x23')]),_0x344bf8[_0x4ef6eb('0x31')]&&delete _0x344bf8[_0x4ef6eb('0x31')],_0x15d0ab['status'](_0x3c2629)[_0x4ef6eb('0x1e')](_0x344bf8);};}exports[_0x5e424c('0x33')]=function(_0x4bed18,_0x6a244a){const _0x4aa267=_0x5e424c;let _0x136b76={};const _0x1bbed8={},_0x480120={'count':0x0,'rows':[]},_0x2ad548=_[_0x4aa267('0x5')](db[_0x4aa267('0x34')][_0x4aa267('0x7')],function(_0x54876f){const _0x4eed2b=_0x4aa267;return{'name':_0x54876f[_0x4eed2b('0x24')],'type':_0x54876f['type'][_0x4eed2b('0x36')]};});_0x1bbed8['model']=_[_0x4aa267('0x5')](_0x2ad548,_0x4aa267('0x31')),_0x1bbed8['query']=_[_0x4aa267('0x0')](_0x4bed18[_0x4aa267('0x3a')]),_0x1bbed8['filters']=_[_0x4aa267('0x21')](_0x1bbed8[_0x4aa267('0x10')],_0x1bbed8['query']),_0x136b76[_0x4aa267('0x40')]=_['intersection'](_0x1bbed8['model'],qs[_0x4aa267('0x14')](_0x4bed18[_0x4aa267('0x3a')][_0x4aa267('0x14')])),_0x136b76[_0x4aa267('0x40')]=_0x136b76['attributes']['length']?_0x136b76[_0x4aa267('0x40')]:_0x1bbed8[_0x4aa267('0x10')];typeof _0x4bed18[_0x4aa267('0x3a')][_0x4aa267('0x35')]==='undefined'&&(_0x136b76[_0x4aa267('0x3')]=qs[_0x4aa267('0x3')](_0x4bed18[_0x4aa267('0x3a')][_0x4aa267('0x3')]),_0x136b76[_0x4aa267('0x2f')]=qs[_0x4aa267('0x2f')](_0x4bed18[_0x4aa267('0x3a')]['offset']));_0x136b76[_0x4aa267('0x2')]=qs[_0x4aa267('0x4')](_0x4bed18[_0x4aa267('0x3a')][_0x4aa267('0x4')]),_0x136b76[_0x4aa267('0x27')]=qs['filters'](_[_0x4aa267('0x6')](_0x4bed18['query'],_0x1bbed8[_0x4aa267('0x1b')]),_0x2ad548);_0x4bed18[_0x4aa267('0x3a')][_0x4aa267('0x28')]&&(_0x136b76[_0x4aa267('0x27')]=_[_0x4aa267('0x2c')](_0x136b76[_0x4aa267('0x27')],{[Op['or']]:_[_0x4aa267('0x5')](_0x2ad548,function(_0x482728){const _0x684a87=_0x4aa267;if(_0x482728[_0x684a87('0x8')]!==_0x684a87('0x2a')){const _0x38efec={};return _0x38efec[_0x482728[_0x684a87('0x31')]]={[Op[_0x684a87('0x38')]]:'%'+_0x4bed18['query'][_0x684a87('0x28')]+'%'},_0x38efec;}})}));_0x136b76=_['merge']({},_0x136b76,_0x4bed18[_0x4aa267('0x32')]);const _0x53bb90={'where':_0x136b76[_0x4aa267('0x27')]};return db[_0x4aa267('0x34')][_0x4aa267('0x3b')](_0x53bb90)[_0x4aa267('0xe')](function(_0x3b59c1){const _0x148984=_0x4aa267;return _0x480120[_0x148984('0x3b')]=_0x3b59c1,_0x4bed18[_0x148984('0x3a')][_0x148984('0x18')]&&(_0x136b76[_0x148984('0xb')]=[{'all':!![]}]),db[_0x148984('0x34')][_0x148984('0x2b')](_0x136b76);})[_0x4aa267('0xe')](function(_0x1984b2){const _0x287391=_0x4aa267;return _0x480120[_0x287391('0x3c')]=_0x1984b2,_0x480120;})[_0x4aa267('0xe')](respondWithFilteredResult(_0x6a244a,_0x136b76))[_0x4aa267('0x37')](handleError(_0x6a244a,null));},exports[_0x5e424c('0x22')]=function(_0x5cf300,_0x367b6a){const _0x2d56bf=_0x5e424c;let _0x981803={'raw':![],'where':{'id':_0x5cf300['params']['id']}};const _0x5a0307={};return _0x5a0307[_0x2d56bf('0x10')]=_['keys'](db[_0x2d56bf('0x34')][_0x2d56bf('0x7')]),_0x5a0307[_0x2d56bf('0x3a')]=_[_0x2d56bf('0x0')](_0x5cf300[_0x2d56bf('0x3a')]),_0x5a0307[_0x2d56bf('0x1b')]=_[_0x2d56bf('0x21')](_0x5a0307[_0x2d56bf('0x10')],_0x5a0307[_0x2d56bf('0x3a')]),_0x981803['attributes']=_['intersection'](_0x5a0307[_0x2d56bf('0x10')],qs[_0x2d56bf('0x14')](_0x5cf300[_0x2d56bf('0x3a')]['fields'])),_0x981803[_0x2d56bf('0x40')]=_0x981803[_0x2d56bf('0x40')][_0x2d56bf('0x19')]?_0x981803[_0x2d56bf('0x40')]:_0x5a0307[_0x2d56bf('0x10')],_0x5cf300[_0x2d56bf('0x3a')]['includeAll']&&(_0x981803['include']=[{'all':!![]}]),_0x981803=_['merge']({},_0x981803,_0x5cf300[_0x2d56bf('0x32')]),db['Schedule'][_0x2d56bf('0xd')](_0x981803)[_0x2d56bf('0xe')](handleEntityNotFound(_0x367b6a,null))[_0x2d56bf('0xe')](respondWithResult(_0x367b6a,null))['catch'](handleError(_0x367b6a,null));},exports[_0x5e424c('0x3d')]=function(_0x33d0af,_0x23e34e){const _0x1ad562=_0x5e424c;return db['Schedule'][_0x1ad562('0x3d')](_0x33d0af[_0x1ad562('0x1d')],{})[_0x1ad562('0xe')](function(_0x13b73e){const _0x532599=_0x1ad562,_0x352055=_0x33d0af[_0x532599('0xf')][_0x532599('0x9')]({'plain':!![]});if(!_0x352055)throw new Error(_0x532599('0x2d'));if(_0x352055[_0x532599('0x2e')]===_0x532599('0xf')){const _0x3d48ae=_0x13b73e[_0x532599('0x9')]({'plain':!![]}),_0x1e51fe='Scheduler';return db[_0x532599('0x1c')][_0x532599('0xd')]({'where':{'name':_0x1e51fe,'userProfileId':_0x352055[_0x532599('0x3f')]},'raw':!![]})[_0x532599('0xe')](function(_0x590db5){const _0x254689=_0x532599;return _0x590db5&&_0x590db5['autoAssociation']===0x0?db[_0x254689('0x1')]['create']({'name':_0x3d48ae['name'],'resourceId':_0x3d48ae['id'],'type':_0x590db5[_0x254689('0x31')],'sectionId':_0x590db5['id']},{})[_0x254689('0xe')](function(){return _0x13b73e;}):_0x13b73e;})[_0x532599('0x37')](function(_0x4ec9f1){const _0x5f1954=_0x532599;logger['error'](_0x5f1954('0x13'),_0x4ec9f1);throw _0x4ec9f1;});}return _0x13b73e;})[_0x1ad562('0xe')](respondWithResult(_0x23e34e,0xc9))[_0x1ad562('0x37')](handleError(_0x23e34e,null));},exports[_0x5e424c('0xc')]=function(_0x5d6fa9,_0x45daff){const _0x5d90b6=_0x5e424c;return _0x5d6fa9[_0x5d90b6('0x1d')]['id']&&delete _0x5d6fa9[_0x5d90b6('0x1d')]['id'],db[_0x5d90b6('0x34')][_0x5d90b6('0xd')]({'where':{'id':_0x5d6fa9[_0x5d90b6('0x1f')]['id']}})[_0x5d90b6('0xe')](handleEntityNotFound(_0x45daff,null))[_0x5d90b6('0xe')](saveUpdates(_0x5d6fa9[_0x5d90b6('0x1d')],null))[_0x5d90b6('0xe')](respondWithResult(_0x45daff,null))[_0x5d90b6('0x37')](handleError(_0x45daff,null));},exports[_0x5e424c('0x12')]=function(_0x2fe83f,_0x519d9e){const _0x154c38=_0x5e424c;return db[_0x154c38('0x34')]['findOne']({'where':{'id':_0x2fe83f['params']['id']}})[_0x154c38('0xe')](handleEntityNotFound(_0x519d9e,null))[_0x154c38('0xe')](removeEntity(_0x519d9e,null))['catch'](handleError(_0x519d9e,null));},exports['run']=function(_0x5e4252,_0x5bfb2c){const _0x317fba=_0x5e424c,_0x532437=require('../../config/schedule');return db['Schedule'][_0x317fba('0xd')]({'where':{'id':_0x5e4252[_0x317fba('0x1f')]['id']},'raw':!![]})[_0x317fba('0xe')](handleEntityNotFound(_0x5bfb2c,null))[_0x317fba('0xe')](function(){const _0x4d0605=_0x317fba;_0x532437[_0x4d0605('0x11')](_0x5e4252[_0x4d0605('0x1f')]['id']);})[_0x317fba('0xe')](respondWithStatusCode(_0x5bfb2c,null))[_0x317fba('0x37')](handleError(_0x5bfb2c,null));};
\ No newline at end of file
+const a530_0x4b3f=['VIRTUAL','autoAssociation','run','../../components/parsers/qs','limit','intersection','sequelize','status','where','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','json','params','UserProfileSection','Schedule','rows','update','like','set','Unable\x20to\x20retrieve\x20the\x20current\x20user','nolimit','Scheduler','attributes','map','pick','order','then','Content-Range','findOne','query','findAll','body','index','filter','count','keys','catch','include','includeAll','stack','error','undefined','destroy','options','lodash','../../config/logger','name','end','key','../../config/schedule','type','length','userProfileId','filters','api','fieldName','sendStatus','get','role','model','merge','show','fields','rawAttributes','offset','user'];(function(_0x12e1f4,_0x4b3f44){const _0x1f567b=function(_0x17e010){while(--_0x17e010){_0x12e1f4['push'](_0x12e1f4['shift']());}};_0x1f567b(++_0x4b3f44);}(a530_0x4b3f,0x16a));const a530_0x1f56=function(_0x12e1f4,_0x4b3f44){_0x12e1f4=_0x12e1f4-0x0;let _0x1f567b=a530_0x4b3f[_0x12e1f4];return _0x1f567b;};const _0x346c99=a530_0x1f56;'use strict';const _=require(_0x346c99('0x12')),qs=require(_0x346c99('0x2b')),logger=require(_0x346c99('0x13'))(_0x346c99('0x1c')),db=require('../../mysqldb')['db'],{Op}=require(_0x346c99('0x2e'));function respondWithStatusCode(_0x17e010,_0x2e7982){return _0x2e7982=_0x2e7982||0xcc,function(_0x2138df){const _0x4d6deb=a530_0x1f56;if(_0x2138df)return _0x17e010[_0x4d6deb('0x1e')](_0x2e7982);return _0x17e010[_0x4d6deb('0x2f')](_0x2e7982)['end']();};}function respondWithResult(_0x528407,_0x56d736){return _0x56d736=_0x56d736||0xc8,function(_0x50acf3){const _0x5398ca=a530_0x1f56;if(_0x50acf3)return _0x528407['status'](_0x56d736)[_0x5398ca('0x34')](_0x50acf3);};}function respondWithFilteredResult(_0x120e88,_0x48b9f8){return function(_0x4bd1f8){const _0x63d0a0=a530_0x1f56;if(_0x4bd1f8){const _0xdd0afb=_0x4bd1f8['count'],_0x4e945e=_0x48b9f8[_0x63d0a0('0x26')];let _0x47de4c=_0x48b9f8['offset']+_0x48b9f8[_0x63d0a0('0x2c')],_0x16057b;return _0x47de4c>=_0xdd0afb?(_0x47de4c=_0xdd0afb,_0x16057b=0xc8):_0x16057b=0xce,_0x120e88[_0x63d0a0('0x2f')](_0x16057b),_0x120e88[_0x63d0a0('0x3b')](_0x63d0a0('0x1'),_0x4e945e+'-'+_0x47de4c+'/'+_0xdd0afb)[_0x63d0a0('0x34')](_0x4bd1f8);}return null;};}function saveUpdates(_0x37cf56){return function(_0x76f4ac){const _0x3208e0=a530_0x1f56;if(_0x76f4ac)return _0x76f4ac[_0x3208e0('0x39')](_0x37cf56)[_0x3208e0('0x0')](function(_0x54a6ca){return _0x54a6ca;});return null;};}function removeEntity(_0x4a1c95){return function(_0x1c4983){const _0xf1db15=a530_0x1f56;if(_0x1c4983)return _0x1c4983[_0xf1db15('0x10')]()[_0xf1db15('0x0')](function(){const _0xc1df74=_0xf1db15,_0xd16537=_0x1c4983['get']({'plain':!![]}),_0x54891a=_0xc1df74('0x3e');return db[_0xc1df74('0x31')]['destroy']({'where':{'type':_0x54891a,'resourceId':_0xd16537['id']}})[_0xc1df74('0x0')](function(){return _0x1c4983;});})['then'](function(){const _0x47a8e5=_0xf1db15;_0x4a1c95[_0x47a8e5('0x2f')](0xcc)[_0x47a8e5('0x15')]();});};}function handleEntityNotFound(_0x5cdaac){return function(_0x151b0a){const _0x7e649e=a530_0x1f56;return!_0x151b0a&&_0x5cdaac[_0x7e649e('0x1e')](0x194),_0x151b0a;};}function handleError(_0x457889,_0xfc4793){return _0xfc4793=_0xfc4793||0x1f4,function(_0x486896){const _0xe33a45=a530_0x1f56;logger['error'](_0x486896[_0xe33a45('0xd')]),_0x486896[_0xe33a45('0x14')]&&delete _0x486896['name'],_0x457889['status'](_0xfc4793)['send'](_0x486896);};}exports[_0x346c99('0x6')]=function(_0x4eb272,_0x83bd78){const _0x99276e=_0x346c99;let _0xc762d5={};const _0x45e1ba={},_0x1704aa={'count':0x0,'rows':[]},_0x407693=_[_0x99276e('0x40')](db[_0x99276e('0x37')][_0x99276e('0x25')],function(_0x2aec2e){const _0xe5283a=_0x99276e;return{'name':_0x2aec2e[_0xe5283a('0x1d')],'type':_0x2aec2e[_0xe5283a('0x18')][_0xe5283a('0x16')]};});_0x45e1ba[_0x99276e('0x21')]=_[_0x99276e('0x40')](_0x407693,_0x99276e('0x14')),_0x45e1ba[_0x99276e('0x3')]=_['keys'](_0x4eb272[_0x99276e('0x3')]),_0x45e1ba['filters']=_[_0x99276e('0x2d')](_0x45e1ba[_0x99276e('0x21')],_0x45e1ba[_0x99276e('0x3')]),_0xc762d5['attributes']=_[_0x99276e('0x2d')](_0x45e1ba['model'],qs[_0x99276e('0x24')](_0x4eb272[_0x99276e('0x3')][_0x99276e('0x24')])),_0xc762d5[_0x99276e('0x3f')]=_0xc762d5[_0x99276e('0x3f')]['length']?_0xc762d5[_0x99276e('0x3f')]:_0x45e1ba[_0x99276e('0x21')];typeof _0x4eb272[_0x99276e('0x3')][_0x99276e('0x3d')]===_0x99276e('0xf')&&(_0xc762d5[_0x99276e('0x2c')]=qs[_0x99276e('0x2c')](_0x4eb272[_0x99276e('0x3')][_0x99276e('0x2c')]),_0xc762d5[_0x99276e('0x26')]=qs['offset'](_0x4eb272['query'][_0x99276e('0x26')]));_0xc762d5[_0x99276e('0x42')]=qs['sort'](_0x4eb272[_0x99276e('0x3')]['sort']),_0xc762d5[_0x99276e('0x30')]=qs[_0x99276e('0x1b')](_[_0x99276e('0x41')](_0x4eb272[_0x99276e('0x3')],_0x45e1ba[_0x99276e('0x1b')]),_0x407693);_0x4eb272['query'][_0x99276e('0x7')]&&(_0xc762d5['where']=_[_0x99276e('0x22')](_0xc762d5[_0x99276e('0x30')],{[Op['or']]:_[_0x99276e('0x40')](_0x407693,function(_0x3f3460){const _0x41561b=_0x99276e;if(_0x3f3460[_0x41561b('0x18')]!==_0x41561b('0x28')){const _0x2832a3={};return _0x2832a3[_0x3f3460[_0x41561b('0x14')]]={[Op[_0x41561b('0x3a')]]:'%'+_0x4eb272[_0x41561b('0x3')][_0x41561b('0x7')]+'%'},_0x2832a3;}})}));_0xc762d5=_[_0x99276e('0x22')]({},_0xc762d5,_0x4eb272[_0x99276e('0x11')]);const _0x800d8b={'where':_0xc762d5[_0x99276e('0x30')]};return db[_0x99276e('0x37')][_0x99276e('0x8')](_0x800d8b)[_0x99276e('0x0')](function(_0x3b93b7){const _0x7ba105=_0x99276e;return _0x1704aa[_0x7ba105('0x8')]=_0x3b93b7,_0x4eb272[_0x7ba105('0x3')][_0x7ba105('0xc')]&&(_0xc762d5[_0x7ba105('0xb')]=[{'all':!![]}]),db['Schedule'][_0x7ba105('0x4')](_0xc762d5);})[_0x99276e('0x0')](function(_0x3903e1){const _0x2d943e=_0x99276e;return _0x1704aa[_0x2d943e('0x38')]=_0x3903e1,_0x1704aa;})[_0x99276e('0x0')](respondWithFilteredResult(_0x83bd78,_0xc762d5))['catch'](handleError(_0x83bd78,null));},exports[_0x346c99('0x23')]=function(_0x36b64d,_0x14198e){const _0x18e8c9=_0x346c99;let _0x13d62a={'raw':![],'where':{'id':_0x36b64d[_0x18e8c9('0x35')]['id']}};const _0x679ef3={};return _0x679ef3[_0x18e8c9('0x21')]=_[_0x18e8c9('0x9')](db[_0x18e8c9('0x37')][_0x18e8c9('0x25')]),_0x679ef3[_0x18e8c9('0x3')]=_[_0x18e8c9('0x9')](_0x36b64d[_0x18e8c9('0x3')]),_0x679ef3[_0x18e8c9('0x1b')]=_[_0x18e8c9('0x2d')](_0x679ef3[_0x18e8c9('0x21')],_0x679ef3[_0x18e8c9('0x3')]),_0x13d62a['attributes']=_['intersection'](_0x679ef3[_0x18e8c9('0x21')],qs[_0x18e8c9('0x24')](_0x36b64d['query'][_0x18e8c9('0x24')])),_0x13d62a[_0x18e8c9('0x3f')]=_0x13d62a[_0x18e8c9('0x3f')][_0x18e8c9('0x19')]?_0x13d62a[_0x18e8c9('0x3f')]:_0x679ef3[_0x18e8c9('0x21')],_0x36b64d[_0x18e8c9('0x3')][_0x18e8c9('0xc')]&&(_0x13d62a[_0x18e8c9('0xb')]=[{'all':!![]}]),_0x13d62a=_[_0x18e8c9('0x22')]({},_0x13d62a,_0x36b64d[_0x18e8c9('0x11')]),db['Schedule'][_0x18e8c9('0x2')](_0x13d62a)[_0x18e8c9('0x0')](handleEntityNotFound(_0x14198e,null))[_0x18e8c9('0x0')](respondWithResult(_0x14198e,null))[_0x18e8c9('0xa')](handleError(_0x14198e,null));},exports['create']=function(_0x40a717,_0x4acf72){const _0x5789c9=_0x346c99;return db[_0x5789c9('0x37')]['create'](_0x40a717[_0x5789c9('0x5')],{})[_0x5789c9('0x0')](function(_0x404e99){const _0x26be22=_0x5789c9,_0x3d9a76=_0x40a717[_0x26be22('0x27')][_0x26be22('0x1f')]({'plain':!![]});if(!_0x3d9a76)throw new Error(_0x26be22('0x3c'));if(_0x3d9a76[_0x26be22('0x20')]===_0x26be22('0x27')){const _0x54b1ff=_0x404e99['get']({'plain':!![]}),_0x27feb6=_0x26be22('0x3e');return db[_0x26be22('0x36')][_0x26be22('0x2')]({'where':{'name':_0x27feb6,'userProfileId':_0x3d9a76[_0x26be22('0x1a')]},'raw':!![]})[_0x26be22('0x0')](function(_0x5349a0){const _0x9b29a9=_0x26be22;return _0x5349a0&&_0x5349a0[_0x9b29a9('0x29')]===0x0?db[_0x9b29a9('0x31')][_0x9b29a9('0x32')]({'name':_0x54b1ff[_0x9b29a9('0x14')],'resourceId':_0x54b1ff['id'],'type':_0x5349a0[_0x9b29a9('0x14')],'sectionId':_0x5349a0['id']},{})[_0x9b29a9('0x0')](function(){return _0x404e99;}):_0x404e99;})[_0x26be22('0xa')](function(_0x1e9efc){const _0x2eec1a=_0x26be22;logger[_0x2eec1a('0xe')](_0x2eec1a('0x33'),_0x1e9efc);throw _0x1e9efc;});}return _0x404e99;})[_0x5789c9('0x0')](respondWithResult(_0x4acf72,0xc9))[_0x5789c9('0xa')](handleError(_0x4acf72,null));},exports[_0x346c99('0x39')]=function(_0x18f8e4,_0x162fbb){const _0x569e00=_0x346c99;return _0x18f8e4[_0x569e00('0x5')]['id']&&delete _0x18f8e4[_0x569e00('0x5')]['id'],db['Schedule'][_0x569e00('0x2')]({'where':{'id':_0x18f8e4['params']['id']}})[_0x569e00('0x0')](handleEntityNotFound(_0x162fbb,null))[_0x569e00('0x0')](saveUpdates(_0x18f8e4[_0x569e00('0x5')],null))[_0x569e00('0x0')](respondWithResult(_0x162fbb,null))[_0x569e00('0xa')](handleError(_0x162fbb,null));},exports[_0x346c99('0x10')]=function(_0x5abad8,_0x17b958){const _0x500ad3=_0x346c99;return db[_0x500ad3('0x37')][_0x500ad3('0x2')]({'where':{'id':_0x5abad8[_0x500ad3('0x35')]['id']}})['then'](handleEntityNotFound(_0x17b958,null))[_0x500ad3('0x0')](removeEntity(_0x17b958,null))[_0x500ad3('0xa')](handleError(_0x17b958,null));},exports['run']=function(_0x1b1c9b,_0x5ea234){const _0xbac36a=_0x346c99,_0xfbf186=require(_0xbac36a('0x17'));return db[_0xbac36a('0x37')][_0xbac36a('0x2')]({'where':{'id':_0x1b1c9b[_0xbac36a('0x35')]['id']},'raw':!![]})[_0xbac36a('0x0')](handleEntityNotFound(_0x5ea234,null))[_0xbac36a('0x0')](function(){const _0x93ef12=_0xbac36a;_0xfbf186[_0x93ef12('0x2a')](_0x1b1c9b[_0x93ef12('0x35')]['id']);})[_0xbac36a('0x0')](respondWithStatusCode(_0x5ea234,null))[_0xbac36a('0xa')](handleError(_0x5ea234,null));};
\ No newline at end of file