Built motion from commit d301b742.|2.6.29
[motion2.git] / server / api / squareProject / squareProject.controller.js
index cfd8876..ba8afa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7204=['json','update','then','destroy','get','SquareProjects','UserProfileResource','publish','stringify','end','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','agi','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x5a15b7,_0xec8aba){var _0x3dc727=function(_0x142c7e){while(--_0x142c7e){_0x5a15b7['push'](_0x5a15b7['shift']());}};_0x3dc727(++_0xec8aba);}(_0x7204,0x166));var _0x4720=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7204[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4720('0x0'));var Redis=require(_0x4720('0x1'));var qs=require(_0x4720('0x2'));var logger=require(_0x4720('0x3'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4720('0x4')](config[_0x4720('0x5')],{'host':_0x4720('0x6'),'port':0x18eb});var socket=require(_0x4720('0x7'))(new Redis(config['redis']));require(_0x4720('0x8'))[_0x4720('0x9')](socket);function respondWithResult(_0x5f2b8d,_0x2f1c89){_0x2f1c89=_0x2f1c89||0xc8;return function(_0x4bf426){if(_0x4bf426){return _0x5f2b8d[_0x4720('0xa')](_0x2f1c89)['json'](_0x4bf426);}};}function respondWithFilteredResult(_0x5d7b78,_0x13ebec){return function(_0x1f124c){if(_0x1f124c){var _0xf91ec4=typeof _0x13ebec[_0x4720('0xb')]===_0x4720('0xc')&&typeof _0x13ebec[_0x4720('0xd')]===_0x4720('0xc');var _0x3d04df=_0x1f124c[_0x4720('0xe')];var _0x143f18=_0xf91ec4?0x0:_0x13ebec[_0x4720('0xb')];var _0x331825=_0xf91ec4?_0x1f124c[_0x4720('0xe')]:_0x13ebec[_0x4720('0xb')]+_0x13ebec['limit'];var _0x4379a9;if(_0x331825>=_0x3d04df){_0x331825=_0x3d04df;_0x4379a9=0xc8;}else{_0x4379a9=0xce;}_0x5d7b78[_0x4720('0xa')](_0x4379a9);return _0x5d7b78[_0x4720('0xf')](_0x4720('0x10'),_0x143f18+'-'+_0x331825+'/'+_0x3d04df)[_0x4720('0x11')](_0x1f124c);}return null;};}function saveUpdates(_0x260be2){return function(_0xd1ec8){if(_0xd1ec8){return _0xd1ec8[_0x4720('0x12')](_0x260be2)[_0x4720('0x13')](function(_0xb78480){return _0xb78480;});}return null;};}function removeEntity(_0x3867ef){return function(_0x35c868){if(_0x35c868){return _0x35c868[_0x4720('0x14')]()['then'](function(){var _0x44cdd1=_0x35c868[_0x4720('0x15')]({'plain':!![]});var _0x64261=_0x4720('0x16');return db[_0x4720('0x17')][_0x4720('0x14')]({'where':{'type':_0x64261,'resourceId':_0x44cdd1['id']}})[_0x4720('0x13')](function(){return _0x35c868;});})[_0x4720('0x13')](function(){var _0x2dd8ff=new Redis(config[_0x4720('0x5')]);_0x2dd8ff[_0x4720('0x18')]('agi',JSON[_0x4720('0x19')]({'id':_0x35c868['id'],'deleted':!![]}));})[_0x4720('0x13')](function(){_0x3867ef['status'](0xcc)[_0x4720('0x1a')]();});}};}function handleEntityNotFound(_0x2b3708){return function(_0x4afa2c){if(!_0x4afa2c){_0x2b3708[_0x4720('0x1b')](0x194);}return _0x4afa2c;};}function handleError(_0x1587b7,_0x76a673){_0x76a673=_0x76a673||0x1f4;return function(_0x5d75f1){logger[_0x4720('0x1c')](_0x5d75f1[_0x4720('0x1d')]);if(_0x5d75f1[_0x4720('0x1e')]){delete _0x5d75f1[_0x4720('0x1e')];}_0x1587b7[_0x4720('0xa')](_0x76a673)[_0x4720('0x1f')](_0x5d75f1);};}exports[_0x4720('0x20')]=function(_0x1fc67d,_0x5eba5f){var _0x1dfc15={},_0x5bd34f={},_0x427913={'count':0x0,'rows':[]};var _0x2a316d=_[_0x4720('0x21')](db['SquareProject']['rawAttributes'],function(_0x13d174){return{'name':_0x13d174[_0x4720('0x22')],'type':_0x13d174[_0x4720('0x23')][_0x4720('0x24')]};});_0x5bd34f[_0x4720('0x25')]=_[_0x4720('0x21')](_0x2a316d,_0x4720('0x1e'));_0x5bd34f[_0x4720('0x26')]=_[_0x4720('0x27')](_0x1fc67d[_0x4720('0x26')]);_0x5bd34f[_0x4720('0x28')]=_['intersection'](_0x5bd34f[_0x4720('0x25')],_0x5bd34f[_0x4720('0x26')]);_0x1dfc15[_0x4720('0x29')]=_[_0x4720('0x2a')](_0x5bd34f['model'],qs[_0x4720('0x2b')](_0x1fc67d['query'][_0x4720('0x2b')]));_0x1dfc15[_0x4720('0x29')]=_0x1dfc15['attributes'][_0x4720('0x2c')]?_0x1dfc15['attributes']:_0x5bd34f[_0x4720('0x25')];if(!_0x1fc67d[_0x4720('0x26')][_0x4720('0x2d')](_0x4720('0x2e'))){_0x1dfc15[_0x4720('0xd')]=qs[_0x4720('0xd')](_0x1fc67d[_0x4720('0x26')][_0x4720('0xd')]);_0x1dfc15[_0x4720('0xb')]=qs[_0x4720('0xb')](_0x1fc67d[_0x4720('0x26')]['offset']);}_0x1dfc15[_0x4720('0x2f')]=qs[_0x4720('0x30')](_0x1fc67d['query'][_0x4720('0x30')]);_0x1dfc15[_0x4720('0x31')]=qs[_0x4720('0x28')](_[_0x4720('0x32')](_0x1fc67d['query'],_0x5bd34f['filters']),_0x2a316d);if(_0x1fc67d[_0x4720('0x26')][_0x4720('0x33')]){_0x1dfc15[_0x4720('0x31')]=_[_0x4720('0x34')](_0x1dfc15[_0x4720('0x31')],{'$or':_[_0x4720('0x21')](_0x2a316d,function(_0x1c0ce3){if(_0x1c0ce3[_0x4720('0x23')]!==_0x4720('0x35')){var _0x4efb06={};_0x4efb06[_0x1c0ce3['name']]={'$like':'%'+_0x1fc67d['query'][_0x4720('0x33')]+'%'};return _0x4efb06;}})});}_0x1dfc15=_[_0x4720('0x34')]({},_0x1dfc15,_0x1fc67d[_0x4720('0x36')]);var _0x4c9dca={'where':_0x1dfc15['where']};return db[_0x4720('0x37')][_0x4720('0xe')](_0x4c9dca)[_0x4720('0x13')](function(_0x5db95f){_0x427913[_0x4720('0xe')]=_0x5db95f;if(_0x1fc67d[_0x4720('0x26')][_0x4720('0x38')]){_0x1dfc15[_0x4720('0x39')]=[{'all':!![]}];}return db[_0x4720('0x37')][_0x4720('0x3a')](_0x1dfc15);})[_0x4720('0x13')](function(_0x3920b3){_0x427913[_0x4720('0x3b')]=_0x3920b3;return _0x427913;})[_0x4720('0x13')](respondWithFilteredResult(_0x5eba5f,_0x1dfc15))[_0x4720('0x3c')](handleError(_0x5eba5f,null));};exports[_0x4720('0x3d')]=function(_0x5949e8,_0x5204e2){var _0x3dffaf={'raw':![],'where':{'id':_0x5949e8[_0x4720('0x3e')]['id']}},_0x43aedd={};_0x43aedd[_0x4720('0x25')]=_[_0x4720('0x27')](db[_0x4720('0x37')][_0x4720('0x3f')]);_0x43aedd[_0x4720('0x26')]=_[_0x4720('0x27')](_0x5949e8[_0x4720('0x26')]);_0x43aedd[_0x4720('0x28')]=_['intersection'](_0x43aedd[_0x4720('0x25')],_0x43aedd[_0x4720('0x26')]);_0x3dffaf[_0x4720('0x29')]=_[_0x4720('0x2a')](_0x43aedd[_0x4720('0x25')],qs[_0x4720('0x2b')](_0x5949e8[_0x4720('0x26')][_0x4720('0x2b')]));_0x3dffaf[_0x4720('0x29')]=_0x3dffaf[_0x4720('0x29')][_0x4720('0x2c')]?_0x3dffaf['attributes']:_0x43aedd['model'];if(_0x5949e8[_0x4720('0x26')][_0x4720('0x38')]){_0x3dffaf[_0x4720('0x39')]=[{'all':!![]}];}_0x3dffaf=_['merge']({},_0x3dffaf,_0x5949e8[_0x4720('0x36')]);return db['SquareProject'][_0x4720('0x40')](_0x3dffaf)[_0x4720('0x13')](handleEntityNotFound(_0x5204e2,null))[_0x4720('0x13')](respondWithResult(_0x5204e2,null))[_0x4720('0x3c')](handleError(_0x5204e2,null));};exports[_0x4720('0x41')]=function(_0x2d6a6e,_0x226911){return db['SquareProject'][_0x4720('0x41')](_0x2d6a6e[_0x4720('0x42')],{})[_0x4720('0x13')](function(_0x4c327d){var _0x18b261=_0x2d6a6e['user']['get']({'plain':!![]});if(!_0x18b261)throw new Error(_0x4720('0x43'));if(_0x18b261[_0x4720('0x44')]==='user'){var _0x26aad9=_0x4c327d['get']({'plain':!![]});var _0x1ec276=_0x4720('0x16');return db[_0x4720('0x45')]['find']({'where':{'name':_0x1ec276,'userProfileId':_0x18b261[_0x4720('0x46')]},'raw':!![]})['then'](function(_0x344c99){if(_0x344c99&&_0x344c99[_0x4720('0x47')]===0x0){return db['UserProfileResource'][_0x4720('0x41')]({'name':_0x26aad9[_0x4720('0x1e')],'resourceId':_0x26aad9['id'],'type':_0x344c99[_0x4720('0x1e')],'sectionId':_0x344c99['id']},{})[_0x4720('0x13')](function(){return _0x4c327d;});}else{return _0x4c327d;}})[_0x4720('0x3c')](function(_0xe903bf){logger[_0x4720('0x1c')](_0x4720('0x48'),_0xe903bf);throw _0xe903bf;});}return _0x4c327d;})['then'](respondWithResult(_0x226911,0xc9))[_0x4720('0x3c')](handleError(_0x226911,null));};exports[_0x4720('0x12')]=function(_0x2e45c6,_0x1e8212){if(_0x2e45c6['body']['id']){delete _0x2e45c6[_0x4720('0x42')]['id'];}return db['SquareProject'][_0x4720('0x40')]({'where':{'id':_0x2e45c6[_0x4720('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1e8212,null))[_0x4720('0x13')](saveUpdates(_0x2e45c6['body'],null))[_0x4720('0x13')](function(_0x6387b0){if(!_0x6387b0)return;var _0xe9164d=_0x6387b0[_0x4720('0x15')]({'plain':!![]});return _0xe9164d;})[_0x4720('0x13')](function(_0x1be9a4){var _0x3a4194=new Redis(config[_0x4720('0x5')]);_0x3a4194[_0x4720('0x18')](_0x4720('0x49'),JSON['stringify'](_['pick'](_0x1be9a4,['id',_0x4720('0x1e'),_0x4720('0x4a')])));return _0x1be9a4;})[_0x4720('0x13')](respondWithResult(_0x1e8212,null))[_0x4720('0x3c')](handleError(_0x1e8212,null));};exports[_0x4720('0x14')]=function(_0x4db81e,_0x5e443e){return db[_0x4720('0x37')][_0x4720('0x40')]({'where':{'id':_0x4db81e[_0x4720('0x3e')]['id']}})[_0x4720('0x13')](handleEntityNotFound(_0x5e443e,null))[_0x4720('0x13')](removeEntity(_0x5e443e,null))[_0x4720('0x3c')](handleError(_0x5e443e,null));};
\ No newline at end of file
+var _0xfc9a=['../../mysqldb','defaults','localhost','socket.io-emitter','./squareProject.socket','status','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','sendStatus','error','stack','index','map','SquareProject','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','redis','agi','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0xd16466,_0x401512){var _0x5b4cf0=function(_0x3ca147){while(--_0x3ca147){_0xd16466['push'](_0xd16466['shift']());}};_0x5b4cf0(++_0x401512);}(_0xfc9a,0x87));var _0xafc9=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc9a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xafc9('0x0'));var Redis=require(_0xafc9('0x1'));var qs=require(_0xafc9('0x2'));var logger=require(_0xafc9('0x3'))(_0xafc9('0x4'));var config=require('../../config/environment');var db=require(_0xafc9('0x5'))['db'];config['redis']=_[_0xafc9('0x6')](config['redis'],{'host':_0xafc9('0x7'),'port':0x18eb});var socket=require(_0xafc9('0x8'))(new Redis(config['redis']));require(_0xafc9('0x9'))['register'](socket);function respondWithResult(_0x3a3552,_0x195754){_0x195754=_0x195754||0xc8;return function(_0x40d2be){if(_0x40d2be){return _0x3a3552[_0xafc9('0xa')](_0x195754)['json'](_0x40d2be);}};}function respondWithFilteredResult(_0x1118bb,_0x2abfbd){return function(_0x2dd2e8){if(_0x2dd2e8){var _0x929b3b=typeof _0x2abfbd[_0xafc9('0xb')]===_0xafc9('0xc')&&typeof _0x2abfbd['limit']===_0xafc9('0xc');var _0x114c9f=_0x2dd2e8[_0xafc9('0xd')];var _0xb5f9b9=_0x929b3b?0x0:_0x2abfbd[_0xafc9('0xb')];var _0x191caf=_0x929b3b?_0x2dd2e8[_0xafc9('0xd')]:_0x2abfbd[_0xafc9('0xb')]+_0x2abfbd[_0xafc9('0xe')];var _0x44e730;if(_0x191caf>=_0x114c9f){_0x191caf=_0x114c9f;_0x44e730=0xc8;}else{_0x44e730=0xce;}_0x1118bb['status'](_0x44e730);return _0x1118bb[_0xafc9('0xf')](_0xafc9('0x10'),_0xb5f9b9+'-'+_0x191caf+'/'+_0x114c9f)['json'](_0x2dd2e8);}return null;};}function saveUpdates(_0x3b5174){return function(_0x314b7c){if(_0x314b7c){return _0x314b7c[_0xafc9('0x11')](_0x3b5174)[_0xafc9('0x12')](function(_0x4e7632){return _0x4e7632;});}return null;};}function removeEntity(_0x44670e){return function(_0x2fb36a){if(_0x2fb36a){return _0x2fb36a[_0xafc9('0x13')]()[_0xafc9('0x12')](function(){var _0x241e0a=_0x2fb36a[_0xafc9('0x14')]({'plain':!![]});var _0x2979b3=_0xafc9('0x15');return db[_0xafc9('0x16')]['destroy']({'where':{'type':_0x2979b3,'resourceId':_0x241e0a['id']}})[_0xafc9('0x12')](function(){return _0x2fb36a;});})[_0xafc9('0x12')](function(){var _0x25bbbe=new Redis(config['redis']);_0x25bbbe[_0xafc9('0x17')]('agi',JSON['stringify']({'id':_0x2fb36a['id'],'deleted':!![]}));})['then'](function(){_0x44670e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x455ff1){return function(_0x24ceff){if(!_0x24ceff){_0x455ff1[_0xafc9('0x18')](0x194);}return _0x24ceff;};}function handleError(_0x4014f7,_0x4d6822){_0x4d6822=_0x4d6822||0x1f4;return function(_0x17941b){logger[_0xafc9('0x19')](_0x17941b[_0xafc9('0x1a')]);if(_0x17941b['name']){delete _0x17941b['name'];}_0x4014f7['status'](_0x4d6822)['send'](_0x17941b);};}exports[_0xafc9('0x1b')]=function(_0x14da11,_0xdfb293){var _0xa7362={},_0x242d8d={},_0xce90c7={'count':0x0,'rows':[]};var _0x2dea3a=_[_0xafc9('0x1c')](db[_0xafc9('0x1d')][_0xafc9('0x1e')],function(_0xe2ce78){return{'name':_0xe2ce78[_0xafc9('0x1f')],'type':_0xe2ce78[_0xafc9('0x20')][_0xafc9('0x21')]};});_0x242d8d['model']=_[_0xafc9('0x1c')](_0x2dea3a,_0xafc9('0x22'));_0x242d8d['query']=_[_0xafc9('0x23')](_0x14da11[_0xafc9('0x24')]);_0x242d8d[_0xafc9('0x25')]=_[_0xafc9('0x26')](_0x242d8d[_0xafc9('0x27')],_0x242d8d[_0xafc9('0x24')]);_0xa7362['attributes']=_['intersection'](_0x242d8d[_0xafc9('0x27')],qs[_0xafc9('0x28')](_0x14da11[_0xafc9('0x24')][_0xafc9('0x28')]));_0xa7362[_0xafc9('0x29')]=_0xa7362['attributes'][_0xafc9('0x2a')]?_0xa7362[_0xafc9('0x29')]:_0x242d8d['model'];if(!_0x14da11[_0xafc9('0x24')][_0xafc9('0x2b')](_0xafc9('0x2c'))){_0xa7362[_0xafc9('0xe')]=qs[_0xafc9('0xe')](_0x14da11[_0xafc9('0x24')][_0xafc9('0xe')]);_0xa7362[_0xafc9('0xb')]=qs[_0xafc9('0xb')](_0x14da11[_0xafc9('0x24')][_0xafc9('0xb')]);}_0xa7362[_0xafc9('0x2d')]=qs[_0xafc9('0x2e')](_0x14da11[_0xafc9('0x24')]['sort']);_0xa7362[_0xafc9('0x2f')]=qs[_0xafc9('0x25')](_[_0xafc9('0x30')](_0x14da11['query'],_0x242d8d[_0xafc9('0x25')]),_0x2dea3a);if(_0x14da11[_0xafc9('0x24')][_0xafc9('0x31')]){_0xa7362[_0xafc9('0x2f')]=_[_0xafc9('0x32')](_0xa7362[_0xafc9('0x2f')],{'$or':_[_0xafc9('0x1c')](_0x2dea3a,function(_0x17a8de){if(_0x17a8de[_0xafc9('0x20')]!=='VIRTUAL'){var _0x2e88d5={};_0x2e88d5[_0x17a8de[_0xafc9('0x22')]]={'$like':'%'+_0x14da11[_0xafc9('0x24')][_0xafc9('0x31')]+'%'};return _0x2e88d5;}})});}_0xa7362=_[_0xafc9('0x32')]({},_0xa7362,_0x14da11[_0xafc9('0x33')]);var _0xe7194d={'where':_0xa7362[_0xafc9('0x2f')]};return db[_0xafc9('0x1d')][_0xafc9('0xd')](_0xe7194d)[_0xafc9('0x12')](function(_0x4ffb71){_0xce90c7[_0xafc9('0xd')]=_0x4ffb71;if(_0x14da11[_0xafc9('0x24')]['includeAll']){_0xa7362[_0xafc9('0x34')]=[{'all':!![]}];}return db[_0xafc9('0x1d')]['findAll'](_0xa7362);})['then'](function(_0x447d5d){_0xce90c7[_0xafc9('0x35')]=_0x447d5d;return _0xce90c7;})[_0xafc9('0x12')](respondWithFilteredResult(_0xdfb293,_0xa7362))[_0xafc9('0x36')](handleError(_0xdfb293,null));};exports[_0xafc9('0x37')]=function(_0x12f8d4,_0x36bf3f){var _0xcd95cf={'raw':![],'where':{'id':_0x12f8d4[_0xafc9('0x38')]['id']}},_0x25731b={};_0x25731b[_0xafc9('0x27')]=_['keys'](db[_0xafc9('0x1d')][_0xafc9('0x1e')]);_0x25731b[_0xafc9('0x24')]=_[_0xafc9('0x23')](_0x12f8d4[_0xafc9('0x24')]);_0x25731b['filters']=_[_0xafc9('0x26')](_0x25731b[_0xafc9('0x27')],_0x25731b[_0xafc9('0x24')]);_0xcd95cf[_0xafc9('0x29')]=_[_0xafc9('0x26')](_0x25731b[_0xafc9('0x27')],qs[_0xafc9('0x28')](_0x12f8d4['query'][_0xafc9('0x28')]));_0xcd95cf[_0xafc9('0x29')]=_0xcd95cf[_0xafc9('0x29')][_0xafc9('0x2a')]?_0xcd95cf[_0xafc9('0x29')]:_0x25731b['model'];if(_0x12f8d4[_0xafc9('0x24')][_0xafc9('0x39')]){_0xcd95cf[_0xafc9('0x34')]=[{'all':!![]}];}_0xcd95cf=_[_0xafc9('0x32')]({},_0xcd95cf,_0x12f8d4[_0xafc9('0x33')]);return db['SquareProject'][_0xafc9('0x3a')](_0xcd95cf)['then'](handleEntityNotFound(_0x36bf3f,null))[_0xafc9('0x12')](respondWithResult(_0x36bf3f,null))[_0xafc9('0x36')](handleError(_0x36bf3f,null));};exports[_0xafc9('0x3b')]=function(_0x1f5161,_0x18c904){return db[_0xafc9('0x1d')][_0xafc9('0x3b')](_0x1f5161['body'],{})['then'](function(_0x2f95d3){var _0x84305c=_0x1f5161[_0xafc9('0x3c')]['get']({'plain':!![]});if(!_0x84305c)throw new Error(_0xafc9('0x3d'));if(_0x84305c[_0xafc9('0x3e')]===_0xafc9('0x3c')){var _0x5dce4c=_0x2f95d3[_0xafc9('0x14')]({'plain':!![]});var _0x151c90=_0xafc9('0x15');return db[_0xafc9('0x3f')][_0xafc9('0x3a')]({'where':{'name':_0x151c90,'userProfileId':_0x84305c['userProfileId']},'raw':!![]})[_0xafc9('0x12')](function(_0x3a2946){if(_0x3a2946&&_0x3a2946[_0xafc9('0x40')]===0x0){return db[_0xafc9('0x16')][_0xafc9('0x3b')]({'name':_0x5dce4c[_0xafc9('0x22')],'resourceId':_0x5dce4c['id'],'type':_0x3a2946[_0xafc9('0x22')],'sectionId':_0x3a2946['id']},{})[_0xafc9('0x12')](function(){return _0x2f95d3;});}else{return _0x2f95d3;}})[_0xafc9('0x36')](function(_0x2f8040){logger[_0xafc9('0x19')](_0xafc9('0x41'),_0x2f8040);throw _0x2f8040;});}return _0x2f95d3;})[_0xafc9('0x12')](respondWithResult(_0x18c904,0xc9))[_0xafc9('0x36')](handleError(_0x18c904,null));};exports[_0xafc9('0x11')]=function(_0x2b137,_0x4e3bd3){if(_0x2b137[_0xafc9('0x42')]['id']){delete _0x2b137[_0xafc9('0x42')]['id'];}return db[_0xafc9('0x1d')][_0xafc9('0x3a')]({'where':{'id':_0x2b137[_0xafc9('0x38')]['id']}})[_0xafc9('0x12')](handleEntityNotFound(_0x4e3bd3,null))[_0xafc9('0x12')](saveUpdates(_0x2b137[_0xafc9('0x42')],null))[_0xafc9('0x12')](function(_0x4799be){if(!_0x4799be)return;var _0x4ed3ba=_0x4799be[_0xafc9('0x14')]({'plain':!![]});return _0x4ed3ba;})[_0xafc9('0x12')](function(_0x4aba2e){var _0x38c396=new Redis(config[_0xafc9('0x43')]);_0x38c396['publish'](_0xafc9('0x44'),JSON[_0xafc9('0x45')](_[_0xafc9('0x30')](_0x4aba2e,['id','name','production'])));return _0x4aba2e;})[_0xafc9('0x12')](respondWithResult(_0x4e3bd3,null))[_0xafc9('0x36')](handleError(_0x4e3bd3,null));};exports[_0xafc9('0x13')]=function(_0x5bed5c,_0x2e1747){return db['SquareProject'][_0xafc9('0x3a')]({'where':{'id':_0x5bed5c['params']['id']}})['then'](handleEntityNotFound(_0x2e1747,null))[_0xafc9('0x12')](removeEntity(_0x2e1747,null))['catch'](handleError(_0x2e1747,null));};
\ No newline at end of file