Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / squareProject / squareProject.controller.js
index c01ee17..890b167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd65f=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','pick','production','destroy','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','Content-Range','json','update','then','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','stack','name','index','map','SquareProject','fieldName','type','key','keys','query','filters','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','include','find','create','body','get','role','UserProfileSection','userProfileId'];(function(_0x59c6bb,_0x38c933){var _0x30cfc9=function(_0x544559){while(--_0x544559){_0x59c6bb['push'](_0x59c6bb['shift']());}};_0x30cfc9(++_0x38c933);}(_0xd65f,0xd5));var _0xfd65=function(_0x2b6f49,_0x3f5a45){_0x2b6f49=_0x2b6f49-0x0;var _0x26d444=_0xd65f[_0x2b6f49];return _0x26d444;};'use strict';var _=require(_0xfd65('0x0'));var Redis=require(_0xfd65('0x1'));var qs=require(_0xfd65('0x2'));var logger=require(_0xfd65('0x3'))('api');var config=require(_0xfd65('0x4'));var db=require('../../mysqldb')['db'];config[_0xfd65('0x5')]=_['defaults'](config[_0xfd65('0x5')],{'host':_0xfd65('0x6'),'port':0x18eb});var socket=require(_0xfd65('0x7'))(new Redis(config['redis']));require(_0xfd65('0x8'))[_0xfd65('0x9')](socket);function respondWithResult(_0x4be40e,_0x1e6bff){_0x1e6bff=_0x1e6bff||0xc8;return function(_0x1a50f6){if(_0x1a50f6){return _0x4be40e[_0xfd65('0xa')](_0x1e6bff)['json'](_0x1a50f6);}};}function respondWithFilteredResult(_0x6a5183,_0x1cb13f){return function(_0x20d9b9){if(_0x20d9b9){var _0x5794a2=typeof _0x1cb13f[_0xfd65('0xb')]===_0xfd65('0xc')&&typeof _0x1cb13f[_0xfd65('0xd')]===_0xfd65('0xc');var _0x1aee8f=_0x20d9b9[_0xfd65('0xe')];var _0x4b41a5=_0x5794a2?0x0:_0x1cb13f['offset'];var _0x57ceaa=_0x5794a2?_0x20d9b9['count']:_0x1cb13f['offset']+_0x1cb13f[_0xfd65('0xd')];var _0x57e9d7;if(_0x57ceaa>=_0x1aee8f){_0x57ceaa=_0x1aee8f;_0x57e9d7=0xc8;}else{_0x57e9d7=0xce;}_0x6a5183[_0xfd65('0xa')](_0x57e9d7);return _0x6a5183['set'](_0xfd65('0xf'),_0x4b41a5+'-'+_0x57ceaa+'/'+_0x1aee8f)[_0xfd65('0x10')](_0x20d9b9);}return null;};}function saveUpdates(_0x1bfd0b){return function(_0x1f2c75){if(_0x1f2c75){return _0x1f2c75[_0xfd65('0x11')](_0x1bfd0b)[_0xfd65('0x12')](function(_0x3cb600){return _0x3cb600;});}return null;};}function removeEntity(_0x18608f){return function(_0x4f6c3b){if(_0x4f6c3b){return _0x4f6c3b['destroy']()[_0xfd65('0x12')](function(){var _0x11db5c=_0x4f6c3b['get']({'plain':!![]});var _0x11c41=_0xfd65('0x13');return db[_0xfd65('0x14')]['destroy']({'where':{'type':_0x11c41,'resourceId':_0x11db5c['id']}})[_0xfd65('0x12')](function(){return _0x4f6c3b;});})[_0xfd65('0x12')](function(){var _0x58a0bb=new Redis(config[_0xfd65('0x5')]);_0x58a0bb[_0xfd65('0x15')](_0xfd65('0x16'),JSON[_0xfd65('0x17')]({'id':_0x4f6c3b['id'],'deleted':!![]}));})[_0xfd65('0x12')](function(){_0x18608f[_0xfd65('0xa')](0xcc)[_0xfd65('0x18')]();});}};}function handleEntityNotFound(_0x4d1cce){return function(_0x4d9750){if(!_0x4d9750){_0x4d1cce[_0xfd65('0x19')](0x194);}return _0x4d9750;};}function handleError(_0xa95689,_0x6a2fee){_0x6a2fee=_0x6a2fee||0x1f4;return function(_0xbb77c0){logger[_0xfd65('0x1a')](_0xbb77c0[_0xfd65('0x1b')]);if(_0xbb77c0['name']){delete _0xbb77c0[_0xfd65('0x1c')];}_0xa95689[_0xfd65('0xa')](_0x6a2fee)['send'](_0xbb77c0);};}exports[_0xfd65('0x1d')]=function(_0x59a93d,_0x36a6c4){var _0x41244d={},_0x195b73={},_0x41ca2f={'count':0x0,'rows':[]};var _0x2b2469=_[_0xfd65('0x1e')](db[_0xfd65('0x1f')]['rawAttributes'],function(_0x131e40){return{'name':_0x131e40[_0xfd65('0x20')],'type':_0x131e40[_0xfd65('0x21')][_0xfd65('0x22')]};});_0x195b73['model']=_[_0xfd65('0x1e')](_0x2b2469,'name');_0x195b73['query']=_[_0xfd65('0x23')](_0x59a93d[_0xfd65('0x24')]);_0x195b73[_0xfd65('0x25')]=_['intersection'](_0x195b73[_0xfd65('0x26')],_0x195b73['query']);_0x41244d[_0xfd65('0x27')]=_['intersection'](_0x195b73[_0xfd65('0x26')],qs[_0xfd65('0x28')](_0x59a93d['query'][_0xfd65('0x28')]));_0x41244d[_0xfd65('0x27')]=_0x41244d[_0xfd65('0x27')]['length']?_0x41244d[_0xfd65('0x27')]:_0x195b73['model'];if(!_0x59a93d['query'][_0xfd65('0x29')]('nolimit')){_0x41244d[_0xfd65('0xd')]=qs[_0xfd65('0xd')](_0x59a93d[_0xfd65('0x24')][_0xfd65('0xd')]);_0x41244d[_0xfd65('0xb')]=qs[_0xfd65('0xb')](_0x59a93d[_0xfd65('0x24')][_0xfd65('0xb')]);}_0x41244d['order']=qs['sort'](_0x59a93d['query'][_0xfd65('0x2a')]);_0x41244d[_0xfd65('0x2b')]=qs['filters'](_['pick'](_0x59a93d[_0xfd65('0x24')],_0x195b73['filters']),_0x2b2469);if(_0x59a93d[_0xfd65('0x24')][_0xfd65('0x2c')]){_0x41244d[_0xfd65('0x2b')]=_[_0xfd65('0x2d')](_0x41244d[_0xfd65('0x2b')],{'$or':_[_0xfd65('0x1e')](_0x2b2469,function(_0x325df1){if(_0x325df1[_0xfd65('0x21')]!==_0xfd65('0x2e')){var _0x1219a4={};_0x1219a4[_0x325df1['name']]={'$like':'%'+_0x59a93d[_0xfd65('0x24')][_0xfd65('0x2c')]+'%'};return _0x1219a4;}})});}_0x41244d=_[_0xfd65('0x2d')]({},_0x41244d,_0x59a93d[_0xfd65('0x2f')]);var _0x55244e={'where':_0x41244d['where']};return db[_0xfd65('0x1f')]['count'](_0x55244e)[_0xfd65('0x12')](function(_0x5982d6){_0x41ca2f[_0xfd65('0xe')]=_0x5982d6;if(_0x59a93d[_0xfd65('0x24')][_0xfd65('0x30')]){_0x41244d['include']=[{'all':!![]}];}return db[_0xfd65('0x1f')][_0xfd65('0x31')](_0x41244d);})['then'](function(_0xe944f9){_0x41ca2f[_0xfd65('0x32')]=_0xe944f9;return _0x41ca2f;})[_0xfd65('0x12')](respondWithFilteredResult(_0x36a6c4,_0x41244d))[_0xfd65('0x33')](handleError(_0x36a6c4,null));};exports[_0xfd65('0x34')]=function(_0x89ceb2,_0x515011){var _0x45645b={'raw':![],'where':{'id':_0x89ceb2['params']['id']}},_0x31c474={};_0x31c474[_0xfd65('0x26')]=_[_0xfd65('0x23')](db['SquareProject'][_0xfd65('0x35')]);_0x31c474[_0xfd65('0x24')]=_[_0xfd65('0x23')](_0x89ceb2[_0xfd65('0x24')]);_0x31c474['filters']=_[_0xfd65('0x36')](_0x31c474['model'],_0x31c474[_0xfd65('0x24')]);_0x45645b[_0xfd65('0x27')]=_[_0xfd65('0x36')](_0x31c474['model'],qs[_0xfd65('0x28')](_0x89ceb2[_0xfd65('0x24')][_0xfd65('0x28')]));_0x45645b[_0xfd65('0x27')]=_0x45645b[_0xfd65('0x27')]['length']?_0x45645b[_0xfd65('0x27')]:_0x31c474[_0xfd65('0x26')];if(_0x89ceb2[_0xfd65('0x24')][_0xfd65('0x30')]){_0x45645b[_0xfd65('0x37')]=[{'all':!![]}];}_0x45645b=_['merge']({},_0x45645b,_0x89ceb2[_0xfd65('0x2f')]);return db[_0xfd65('0x1f')][_0xfd65('0x38')](_0x45645b)[_0xfd65('0x12')](handleEntityNotFound(_0x515011,null))[_0xfd65('0x12')](respondWithResult(_0x515011,null))[_0xfd65('0x33')](handleError(_0x515011,null));};exports[_0xfd65('0x39')]=function(_0x2cb58d,_0x4150e0){return db[_0xfd65('0x1f')][_0xfd65('0x39')](_0x2cb58d[_0xfd65('0x3a')],{})['then'](function(_0x41c6bd){var _0x2fbaf8=_0x2cb58d['user'][_0xfd65('0x3b')]({'plain':!![]});if(!_0x2fbaf8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbaf8[_0xfd65('0x3c')]==='user'){var _0x2c3bc0=_0x41c6bd['get']({'plain':!![]});var _0x486289='SquareProjects';return db[_0xfd65('0x3d')]['find']({'where':{'name':_0x486289,'userProfileId':_0x2fbaf8[_0xfd65('0x3e')]},'raw':!![]})[_0xfd65('0x12')](function(_0x2dc450){if(_0x2dc450&&_0x2dc450[_0xfd65('0x3f')]===0x0){return db[_0xfd65('0x14')][_0xfd65('0x39')]({'name':_0x2c3bc0[_0xfd65('0x1c')],'resourceId':_0x2c3bc0['id'],'type':_0x2dc450[_0xfd65('0x1c')],'sectionId':_0x2dc450['id']},{})[_0xfd65('0x12')](function(){return _0x41c6bd;});}else{return _0x41c6bd;}})[_0xfd65('0x33')](function(_0x383656){logger[_0xfd65('0x1a')](_0xfd65('0x40'),_0x383656);throw _0x383656;});}return _0x41c6bd;})[_0xfd65('0x12')](respondWithResult(_0x4150e0,0xc9))[_0xfd65('0x33')](handleError(_0x4150e0,null));};exports[_0xfd65('0x11')]=function(_0x16d620,_0x506d8e){if(_0x16d620[_0xfd65('0x3a')]['id']){delete _0x16d620[_0xfd65('0x3a')]['id'];}return db['SquareProject'][_0xfd65('0x38')]({'where':{'id':_0x16d620[_0xfd65('0x41')]['id']}})[_0xfd65('0x12')](handleEntityNotFound(_0x506d8e,null))[_0xfd65('0x12')](saveUpdates(_0x16d620[_0xfd65('0x3a')],null))[_0xfd65('0x12')](function(_0x394235){if(!_0x394235)return;var _0x2ad6d0=_0x394235[_0xfd65('0x3b')]({'plain':!![]});return _0x2ad6d0;})[_0xfd65('0x12')](function(_0x22f847){var _0x13b993=new Redis(config[_0xfd65('0x5')]);_0x13b993[_0xfd65('0x15')](_0xfd65('0x16'),JSON[_0xfd65('0x17')](_[_0xfd65('0x42')](_0x22f847,['id',_0xfd65('0x1c'),_0xfd65('0x43')])));return _0x22f847;})[_0xfd65('0x12')](respondWithResult(_0x506d8e,null))[_0xfd65('0x33')](handleError(_0x506d8e,null));};exports[_0xfd65('0x44')]=function(_0x3b40f9,_0x2320a5){return db['SquareProject']['find']({'where':{'id':_0x3b40f9[_0xfd65('0x41')]['id']}})['then'](handleEntityNotFound(_0x2320a5,null))[_0xfd65('0x12')](removeEntity(_0x2320a5,null))[_0xfd65('0x33')](handleError(_0x2320a5,null));};
\ No newline at end of file
+var _0x7f20=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','publish','agi','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','show','params','options','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId'];(function(_0x27b588,_0x176012){var _0x1ed0c0=function(_0x5b8f06){while(--_0x5b8f06){_0x27b588['push'](_0x27b588['shift']());}};_0x1ed0c0(++_0x176012);}(_0x7f20,0x163));var _0x07f2=function(_0x263402,_0x9e792e){_0x263402=_0x263402-0x0;var _0x4b886b=_0x7f20[_0x263402];return _0x4b886b;};'use strict';var _=require(_0x07f2('0x0'));var Redis=require(_0x07f2('0x1'));var qs=require(_0x07f2('0x2'));var logger=require(_0x07f2('0x3'))('api');var config=require('../../config/environment');var db=require(_0x07f2('0x4'))['db'];config[_0x07f2('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x07f2('0x6'))(new Redis(config[_0x07f2('0x5')]));require(_0x07f2('0x7'))[_0x07f2('0x8')](socket);function respondWithResult(_0x3cbb03,_0x124ec5){_0x124ec5=_0x124ec5||0xc8;return function(_0x10b8df){if(_0x10b8df){return _0x3cbb03[_0x07f2('0x9')](_0x124ec5)[_0x07f2('0xa')](_0x10b8df);}};}function respondWithFilteredResult(_0x97ee16,_0xee98d0){return function(_0x3cc594){if(_0x3cc594){var _0x5473c9=typeof _0xee98d0[_0x07f2('0xb')]===_0x07f2('0xc')&&typeof _0xee98d0['limit']===_0x07f2('0xc');var _0x30fac2=_0x3cc594['count'];var _0x33b3b9=_0x5473c9?0x0:_0xee98d0[_0x07f2('0xb')];var _0x58423c=_0x5473c9?_0x3cc594[_0x07f2('0xd')]:_0xee98d0[_0x07f2('0xb')]+_0xee98d0[_0x07f2('0xe')];var _0x2a8995;if(_0x58423c>=_0x30fac2){_0x58423c=_0x30fac2;_0x2a8995=0xc8;}else{_0x2a8995=0xce;}_0x97ee16[_0x07f2('0x9')](_0x2a8995);return _0x97ee16[_0x07f2('0xf')](_0x07f2('0x10'),_0x33b3b9+'-'+_0x58423c+'/'+_0x30fac2)[_0x07f2('0xa')](_0x3cc594);}return null;};}function saveUpdates(_0xcc365f){return function(_0x1fda3b){if(_0x1fda3b){return _0x1fda3b[_0x07f2('0x11')](_0xcc365f)[_0x07f2('0x12')](function(_0x3f8df8){return _0x3f8df8;});}return null;};}function removeEntity(_0x51cb6a){return function(_0xda2131){if(_0xda2131){return _0xda2131[_0x07f2('0x13')]()[_0x07f2('0x12')](function(){var _0x10125f=_0xda2131[_0x07f2('0x14')]({'plain':!![]});var _0x4bca24=_0x07f2('0x15');return db['UserProfileResource'][_0x07f2('0x13')]({'where':{'type':_0x4bca24,'resourceId':_0x10125f['id']}})[_0x07f2('0x12')](function(){return _0xda2131;});})[_0x07f2('0x12')](function(){var _0x1b2d36=new Redis(config[_0x07f2('0x5')]);_0x1b2d36[_0x07f2('0x16')](_0x07f2('0x17'),JSON['stringify']({'id':_0xda2131['id'],'deleted':!![]}));})[_0x07f2('0x12')](function(){_0x51cb6a[_0x07f2('0x9')](0xcc)[_0x07f2('0x18')]();});}};}function handleEntityNotFound(_0x17e1ad){return function(_0x190bba){if(!_0x190bba){_0x17e1ad[_0x07f2('0x19')](0x194);}return _0x190bba;};}function handleError(_0x5bb4d8,_0x1195f6){_0x1195f6=_0x1195f6||0x1f4;return function(_0x91058f){logger[_0x07f2('0x1a')](_0x91058f[_0x07f2('0x1b')]);if(_0x91058f[_0x07f2('0x1c')]){delete _0x91058f[_0x07f2('0x1c')];}_0x5bb4d8['status'](_0x1195f6)[_0x07f2('0x1d')](_0x91058f);};}exports[_0x07f2('0x1e')]=function(_0xaa52,_0x5668ec){var _0xa264d6={},_0xcae913={},_0x5c12c9={'count':0x0,'rows':[]};var _0x333db5=_[_0x07f2('0x1f')](db[_0x07f2('0x20')][_0x07f2('0x21')],function(_0x286d1c){return{'name':_0x286d1c[_0x07f2('0x22')],'type':_0x286d1c['type'][_0x07f2('0x23')]};});_0xcae913[_0x07f2('0x24')]=_[_0x07f2('0x1f')](_0x333db5,_0x07f2('0x1c'));_0xcae913['query']=_[_0x07f2('0x25')](_0xaa52[_0x07f2('0x26')]);_0xcae913[_0x07f2('0x27')]=_[_0x07f2('0x28')](_0xcae913[_0x07f2('0x24')],_0xcae913['query']);_0xa264d6[_0x07f2('0x29')]=_[_0x07f2('0x28')](_0xcae913[_0x07f2('0x24')],qs['fields'](_0xaa52['query'][_0x07f2('0x2a')]));_0xa264d6[_0x07f2('0x29')]=_0xa264d6[_0x07f2('0x29')][_0x07f2('0x2b')]?_0xa264d6[_0x07f2('0x29')]:_0xcae913['model'];if(!_0xaa52['query'][_0x07f2('0x2c')]('nolimit')){_0xa264d6[_0x07f2('0xe')]=qs[_0x07f2('0xe')](_0xaa52[_0x07f2('0x26')][_0x07f2('0xe')]);_0xa264d6[_0x07f2('0xb')]=qs[_0x07f2('0xb')](_0xaa52['query'][_0x07f2('0xb')]);}_0xa264d6[_0x07f2('0x2d')]=qs[_0x07f2('0x2e')](_0xaa52[_0x07f2('0x26')][_0x07f2('0x2e')]);_0xa264d6[_0x07f2('0x2f')]=qs[_0x07f2('0x27')](_[_0x07f2('0x30')](_0xaa52['query'],_0xcae913['filters']),_0x333db5);if(_0xaa52[_0x07f2('0x26')]['filter']){_0xa264d6['where']=_[_0x07f2('0x31')](_0xa264d6[_0x07f2('0x2f')],{'$or':_[_0x07f2('0x1f')](_0x333db5,function(_0x2d4700){if(_0x2d4700['type']!==_0x07f2('0x32')){var _0x25cc8b={};_0x25cc8b[_0x2d4700[_0x07f2('0x1c')]]={'$like':'%'+_0xaa52[_0x07f2('0x26')][_0x07f2('0x33')]+'%'};return _0x25cc8b;}})});}_0xa264d6=_['merge']({},_0xa264d6,_0xaa52['options']);var _0x73539f={'where':_0xa264d6['where']};return db['SquareProject']['count'](_0x73539f)[_0x07f2('0x12')](function(_0x5527e2){_0x5c12c9[_0x07f2('0xd')]=_0x5527e2;if(_0xaa52[_0x07f2('0x26')][_0x07f2('0x34')]){_0xa264d6[_0x07f2('0x35')]=[{'all':!![]}];}return db[_0x07f2('0x20')]['findAll'](_0xa264d6);})[_0x07f2('0x12')](function(_0x52d974){_0x5c12c9['rows']=_0x52d974;return _0x5c12c9;})[_0x07f2('0x12')](respondWithFilteredResult(_0x5668ec,_0xa264d6))['catch'](handleError(_0x5668ec,null));};exports[_0x07f2('0x36')]=function(_0x11670d,_0x24ae49){var _0x40cdee={'raw':![],'where':{'id':_0x11670d[_0x07f2('0x37')]['id']}},_0x549ab4={};_0x549ab4[_0x07f2('0x24')]=_[_0x07f2('0x25')](db[_0x07f2('0x20')][_0x07f2('0x21')]);_0x549ab4[_0x07f2('0x26')]=_['keys'](_0x11670d[_0x07f2('0x26')]);_0x549ab4[_0x07f2('0x27')]=_[_0x07f2('0x28')](_0x549ab4[_0x07f2('0x24')],_0x549ab4[_0x07f2('0x26')]);_0x40cdee[_0x07f2('0x29')]=_['intersection'](_0x549ab4['model'],qs[_0x07f2('0x2a')](_0x11670d['query']['fields']));_0x40cdee['attributes']=_0x40cdee[_0x07f2('0x29')][_0x07f2('0x2b')]?_0x40cdee[_0x07f2('0x29')]:_0x549ab4[_0x07f2('0x24')];if(_0x11670d[_0x07f2('0x26')][_0x07f2('0x34')]){_0x40cdee[_0x07f2('0x35')]=[{'all':!![]}];}_0x40cdee=_[_0x07f2('0x31')]({},_0x40cdee,_0x11670d[_0x07f2('0x38')]);return db[_0x07f2('0x20')][_0x07f2('0x39')](_0x40cdee)[_0x07f2('0x12')](handleEntityNotFound(_0x24ae49,null))[_0x07f2('0x12')](respondWithResult(_0x24ae49,null))[_0x07f2('0x3a')](handleError(_0x24ae49,null));};exports['create']=function(_0x23f524,_0x4b435c){return db[_0x07f2('0x20')]['create'](_0x23f524[_0x07f2('0x3b')],{})['then'](function(_0x3adf66){var _0x3eff96=_0x23f524['user'][_0x07f2('0x14')]({'plain':!![]});if(!_0x3eff96)throw new Error(_0x07f2('0x3c'));if(_0x3eff96[_0x07f2('0x3d')]===_0x07f2('0x3e')){var _0x3a96ef=_0x3adf66[_0x07f2('0x14')]({'plain':!![]});var _0x53d3c9=_0x07f2('0x15');return db[_0x07f2('0x3f')][_0x07f2('0x39')]({'where':{'name':_0x53d3c9,'userProfileId':_0x3eff96[_0x07f2('0x40')]},'raw':!![]})[_0x07f2('0x12')](function(_0x109a77){if(_0x109a77&&_0x109a77[_0x07f2('0x41')]===0x0){return db['UserProfileResource'][_0x07f2('0x42')]({'name':_0x3a96ef['name'],'resourceId':_0x3a96ef['id'],'type':_0x109a77[_0x07f2('0x1c')],'sectionId':_0x109a77['id']},{})[_0x07f2('0x12')](function(){return _0x3adf66;});}else{return _0x3adf66;}})['catch'](function(_0x395c81){logger[_0x07f2('0x1a')](_0x07f2('0x43'),_0x395c81);throw _0x395c81;});}return _0x3adf66;})[_0x07f2('0x12')](respondWithResult(_0x4b435c,0xc9))[_0x07f2('0x3a')](handleError(_0x4b435c,null));};exports['update']=function(_0x387120,_0x2ca7d1){if(_0x387120[_0x07f2('0x3b')]['id']){delete _0x387120['body']['id'];}return db[_0x07f2('0x20')][_0x07f2('0x39')]({'where':{'id':_0x387120[_0x07f2('0x37')]['id']}})[_0x07f2('0x12')](handleEntityNotFound(_0x2ca7d1,null))['then'](saveUpdates(_0x387120[_0x07f2('0x3b')],null))['then'](function(_0x2f3ea6){if(!_0x2f3ea6)return;var _0x3ce06a=_0x2f3ea6[_0x07f2('0x14')]({'plain':!![]});return _0x3ce06a;})['then'](function(_0x195755){var _0x2f9176=new Redis(config[_0x07f2('0x5')]);_0x2f9176['publish'](_0x07f2('0x17'),JSON[_0x07f2('0x44')](_[_0x07f2('0x30')](_0x195755,['id','name',_0x07f2('0x45')])));return _0x195755;})[_0x07f2('0x12')](respondWithResult(_0x2ca7d1,null))['catch'](handleError(_0x2ca7d1,null));};exports[_0x07f2('0x13')]=function(_0x4e066b,_0x5cbcd4){return db[_0x07f2('0x20')]['find']({'where':{'id':_0x4e066b[_0x07f2('0x37')]['id']}})[_0x07f2('0x12')](handleEntityNotFound(_0x5cbcd4,null))[_0x07f2('0x12')](removeEntity(_0x5cbcd4,null))[_0x07f2('0x3a')](handleError(_0x5cbcd4,null));};
\ No newline at end of file