Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / api / squareProject / squareProject.controller.js
index 57af528..169fb02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f22=['publish','agi','stringify','end','sendStatus','error','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','role','user','find','userProfileId','UserProfileResource','production','destroy','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','status','json','undefined','limit','count','offset','set','update','then','get','SquareProjects'];(function(_0x25612b,_0x5dc946){var _0x433eb3=function(_0x22d7a5){while(--_0x22d7a5){_0x25612b['push'](_0x25612b['shift']());}};_0x433eb3(++_0x5dc946);}(_0x8f22,0x73));var _0x28f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f22[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x28f2('0x0'));var Redis=require(_0x28f2('0x1'));var qs=require(_0x28f2('0x2'));var logger=require(_0x28f2('0x3'))(_0x28f2('0x4'));var config=require('../../config/environment');var db=require(_0x28f2('0x5'))['db'];config[_0x28f2('0x6')]=_[_0x28f2('0x7')](config[_0x28f2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x28f2('0x8'))(new Redis(config[_0x28f2('0x6')]));require('./squareProject.socket')[_0x28f2('0x9')](socket);function respondWithResult(_0x25063c,_0x33d1a6){_0x33d1a6=_0x33d1a6||0xc8;return function(_0x4fa9f3){if(_0x4fa9f3){return _0x25063c[_0x28f2('0xa')](_0x33d1a6)[_0x28f2('0xb')](_0x4fa9f3);}};}function respondWithFilteredResult(_0x20274e,_0x10d5ec){return function(_0x5f1126){if(_0x5f1126){var _0x4e14c3=typeof _0x10d5ec['offset']===_0x28f2('0xc')&&typeof _0x10d5ec[_0x28f2('0xd')]===_0x28f2('0xc');var _0x3dc78c=_0x5f1126[_0x28f2('0xe')];var _0x311b42=_0x4e14c3?0x0:_0x10d5ec[_0x28f2('0xf')];var _0x1b1918=_0x4e14c3?_0x5f1126['count']:_0x10d5ec[_0x28f2('0xf')]+_0x10d5ec[_0x28f2('0xd')];var _0xa9629e;if(_0x1b1918>=_0x3dc78c){_0x1b1918=_0x3dc78c;_0xa9629e=0xc8;}else{_0xa9629e=0xce;}_0x20274e['status'](_0xa9629e);return _0x20274e[_0x28f2('0x10')]('Content-Range',_0x311b42+'-'+_0x1b1918+'/'+_0x3dc78c)[_0x28f2('0xb')](_0x5f1126);}return null;};}function saveUpdates(_0x51f888){return function(_0x55693a){if(_0x55693a){return _0x55693a[_0x28f2('0x11')](_0x51f888)['then'](function(_0x4616a2){return _0x4616a2;});}return null;};}function removeEntity(_0x575061){return function(_0x42a250){if(_0x42a250){return _0x42a250['destroy']()[_0x28f2('0x12')](function(){var _0x3b90fb=_0x42a250[_0x28f2('0x13')]({'plain':!![]});var _0x2b7b79=_0x28f2('0x14');return db['UserProfileResource']['destroy']({'where':{'type':_0x2b7b79,'resourceId':_0x3b90fb['id']}})[_0x28f2('0x12')](function(){return _0x42a250;});})[_0x28f2('0x12')](function(){var _0x4fb2f7=new Redis(config[_0x28f2('0x6')]);_0x4fb2f7[_0x28f2('0x15')](_0x28f2('0x16'),JSON[_0x28f2('0x17')]({'id':_0x42a250['id'],'deleted':!![]}));})[_0x28f2('0x12')](function(){_0x575061['status'](0xcc)[_0x28f2('0x18')]();});}};}function handleEntityNotFound(_0x537d43){return function(_0x4d64c5){if(!_0x4d64c5){_0x537d43[_0x28f2('0x19')](0x194);}return _0x4d64c5;};}function handleError(_0x37560b,_0x170567){_0x170567=_0x170567||0x1f4;return function(_0x20dc85){logger[_0x28f2('0x1a')](_0x20dc85['stack']);if(_0x20dc85['name']){delete _0x20dc85[_0x28f2('0x1b')];}_0x37560b[_0x28f2('0xa')](_0x170567)[_0x28f2('0x1c')](_0x20dc85);};}exports['index']=function(_0x5a83ac,_0x498577){var _0x1e624f={},_0x5382b4={},_0x1249df={'count':0x0,'rows':[]};var _0x12bd35=_[_0x28f2('0x1d')](db[_0x28f2('0x1e')][_0x28f2('0x1f')],function(_0x14d4d2){return{'name':_0x14d4d2[_0x28f2('0x20')],'type':_0x14d4d2[_0x28f2('0x21')][_0x28f2('0x22')]};});_0x5382b4[_0x28f2('0x23')]=_[_0x28f2('0x1d')](_0x12bd35,'name');_0x5382b4[_0x28f2('0x24')]=_[_0x28f2('0x25')](_0x5a83ac['query']);_0x5382b4[_0x28f2('0x26')]=_[_0x28f2('0x27')](_0x5382b4[_0x28f2('0x23')],_0x5382b4[_0x28f2('0x24')]);_0x1e624f[_0x28f2('0x28')]=_[_0x28f2('0x27')](_0x5382b4[_0x28f2('0x23')],qs[_0x28f2('0x29')](_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x29')]));_0x1e624f['attributes']=_0x1e624f[_0x28f2('0x28')][_0x28f2('0x2a')]?_0x1e624f[_0x28f2('0x28')]:_0x5382b4[_0x28f2('0x23')];if(!_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x2b')](_0x28f2('0x2c'))){_0x1e624f[_0x28f2('0xd')]=qs[_0x28f2('0xd')](_0x5a83ac['query']['limit']);_0x1e624f['offset']=qs[_0x28f2('0xf')](_0x5a83ac[_0x28f2('0x24')]['offset']);}_0x1e624f[_0x28f2('0x2d')]=qs['sort'](_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x2e')]);_0x1e624f[_0x28f2('0x2f')]=qs[_0x28f2('0x26')](_[_0x28f2('0x30')](_0x5a83ac[_0x28f2('0x24')],_0x5382b4[_0x28f2('0x26')]),_0x12bd35);if(_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x31')]){_0x1e624f[_0x28f2('0x2f')]=_[_0x28f2('0x32')](_0x1e624f['where'],{'$or':_[_0x28f2('0x1d')](_0x12bd35,function(_0x54ca99){if(_0x54ca99[_0x28f2('0x21')]!==_0x28f2('0x33')){var _0x143d75={};_0x143d75[_0x54ca99[_0x28f2('0x1b')]]={'$like':'%'+_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x31')]+'%'};return _0x143d75;}})});}_0x1e624f=_[_0x28f2('0x32')]({},_0x1e624f,_0x5a83ac[_0x28f2('0x34')]);var _0x4238a8={'where':_0x1e624f[_0x28f2('0x2f')]};return db['SquareProject'][_0x28f2('0xe')](_0x4238a8)[_0x28f2('0x12')](function(_0x3d3ab8){_0x1249df[_0x28f2('0xe')]=_0x3d3ab8;if(_0x5a83ac[_0x28f2('0x24')][_0x28f2('0x35')]){_0x1e624f[_0x28f2('0x36')]=[{'all':!![]}];}return db[_0x28f2('0x1e')]['findAll'](_0x1e624f);})[_0x28f2('0x12')](function(_0x3a5fd0){_0x1249df[_0x28f2('0x37')]=_0x3a5fd0;return _0x1249df;})[_0x28f2('0x12')](respondWithFilteredResult(_0x498577,_0x1e624f))[_0x28f2('0x38')](handleError(_0x498577,null));};exports[_0x28f2('0x39')]=function(_0x41736a,_0x55287b){var _0x31bd5d={'raw':![],'where':{'id':_0x41736a[_0x28f2('0x3a')]['id']}},_0x24c092={};_0x24c092[_0x28f2('0x23')]=_['keys'](db[_0x28f2('0x1e')][_0x28f2('0x1f')]);_0x24c092[_0x28f2('0x24')]=_[_0x28f2('0x25')](_0x41736a[_0x28f2('0x24')]);_0x24c092[_0x28f2('0x26')]=_[_0x28f2('0x27')](_0x24c092['model'],_0x24c092[_0x28f2('0x24')]);_0x31bd5d[_0x28f2('0x28')]=_[_0x28f2('0x27')](_0x24c092['model'],qs[_0x28f2('0x29')](_0x41736a[_0x28f2('0x24')]['fields']));_0x31bd5d[_0x28f2('0x28')]=_0x31bd5d[_0x28f2('0x28')][_0x28f2('0x2a')]?_0x31bd5d[_0x28f2('0x28')]:_0x24c092[_0x28f2('0x23')];if(_0x41736a[_0x28f2('0x24')][_0x28f2('0x35')]){_0x31bd5d[_0x28f2('0x36')]=[{'all':!![]}];}_0x31bd5d=_[_0x28f2('0x32')]({},_0x31bd5d,_0x41736a[_0x28f2('0x34')]);return db[_0x28f2('0x1e')]['find'](_0x31bd5d)[_0x28f2('0x12')](handleEntityNotFound(_0x55287b,null))[_0x28f2('0x12')](respondWithResult(_0x55287b,null))[_0x28f2('0x38')](handleError(_0x55287b,null));};exports[_0x28f2('0x3b')]=function(_0x1a6dd7,_0x2308f1){return db[_0x28f2('0x1e')][_0x28f2('0x3b')](_0x1a6dd7[_0x28f2('0x3c')],{})[_0x28f2('0x12')](function(_0x1eba53){var _0x2907a7=_0x1a6dd7['user']['get']({'plain':!![]});if(!_0x2907a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2907a7[_0x28f2('0x3d')]===_0x28f2('0x3e')){var _0xf8ad2d=_0x1eba53[_0x28f2('0x13')]({'plain':!![]});var _0x23aa86='SquareProjects';return db['UserProfileSection'][_0x28f2('0x3f')]({'where':{'name':_0x23aa86,'userProfileId':_0x2907a7[_0x28f2('0x40')]},'raw':!![]})[_0x28f2('0x12')](function(_0x547a7c){if(_0x547a7c&&_0x547a7c['autoAssociation']===0x0){return db[_0x28f2('0x41')]['create']({'name':_0xf8ad2d[_0x28f2('0x1b')],'resourceId':_0xf8ad2d['id'],'type':_0x547a7c[_0x28f2('0x1b')],'sectionId':_0x547a7c['id']},{})[_0x28f2('0x12')](function(){return _0x1eba53;});}else{return _0x1eba53;}})[_0x28f2('0x38')](function(_0x52c302){logger[_0x28f2('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52c302);throw _0x52c302;});}return _0x1eba53;})[_0x28f2('0x12')](respondWithResult(_0x2308f1,0xc9))['catch'](handleError(_0x2308f1,null));};exports[_0x28f2('0x11')]=function(_0xc3e78d,_0x666798){if(_0xc3e78d[_0x28f2('0x3c')]['id']){delete _0xc3e78d[_0x28f2('0x3c')]['id'];}return db[_0x28f2('0x1e')]['find']({'where':{'id':_0xc3e78d[_0x28f2('0x3a')]['id']}})[_0x28f2('0x12')](handleEntityNotFound(_0x666798,null))['then'](saveUpdates(_0xc3e78d[_0x28f2('0x3c')],null))[_0x28f2('0x12')](function(_0x49266a){if(!_0x49266a)return;var _0x33bdc8=_0x49266a['get']({'plain':!![]});return _0x33bdc8;})[_0x28f2('0x12')](function(_0x54ac61){var _0x5bdc03=new Redis(config[_0x28f2('0x6')]);_0x5bdc03[_0x28f2('0x15')](_0x28f2('0x16'),JSON['stringify'](_[_0x28f2('0x30')](_0x54ac61,['id',_0x28f2('0x1b'),_0x28f2('0x42')])));return _0x54ac61;})[_0x28f2('0x12')](respondWithResult(_0x666798,null))[_0x28f2('0x38')](handleError(_0x666798,null));};exports[_0x28f2('0x43')]=function(_0x572b89,_0x3ca150){return db[_0x28f2('0x1e')][_0x28f2('0x3f')]({'where':{'id':_0x572b89[_0x28f2('0x3a')]['id']}})[_0x28f2('0x12')](handleEntityNotFound(_0x3ca150,null))[_0x28f2('0x12')](removeEntity(_0x3ca150,null))[_0x28f2('0x38')](handleError(_0x3ca150,null));};
\ No newline at end of file
+var _0x2334=['catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','production','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','limit','undefined','Content-Range','update','then','destroy','get','SquareProjects','publish','stringify','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','show','SquareProject','find'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2334,0xd4));var _0x4233=function(_0x49fa22,_0x3a8ccb){_0x49fa22=_0x49fa22-0x0;var _0x4af7a1=_0x2334[_0x49fa22];return _0x4af7a1;};'use strict';var _=require('lodash');var Redis=require(_0x4233('0x0'));var qs=require(_0x4233('0x1'));var logger=require(_0x4233('0x2'))('api');var config=require(_0x4233('0x3'));var db=require('../../mysqldb')['db'];config[_0x4233('0x4')]=_[_0x4233('0x5')](config[_0x4233('0x4')],{'host':_0x4233('0x6'),'port':0x18eb});var socket=require(_0x4233('0x7'))(new Redis(config[_0x4233('0x4')]));require(_0x4233('0x8'))[_0x4233('0x9')](socket);function respondWithResult(_0x4fc562,_0x206e36){_0x206e36=_0x206e36||0xc8;return function(_0x10193a){if(_0x10193a){return _0x4fc562[_0x4233('0xa')](_0x206e36)[_0x4233('0xb')](_0x10193a);}};}function respondWithFilteredResult(_0x5eeda5,_0xc1c898){return function(_0x1b2f5f){if(_0x1b2f5f){var _0x2c16a1=typeof _0xc1c898[_0x4233('0xc')]==='undefined'&&typeof _0xc1c898[_0x4233('0xd')]===_0x4233('0xe');var _0x5eeece=_0x1b2f5f['count'];var _0x272913=_0x2c16a1?0x0:_0xc1c898[_0x4233('0xc')];var _0x21a9e7=_0x2c16a1?_0x1b2f5f['count']:_0xc1c898[_0x4233('0xc')]+_0xc1c898[_0x4233('0xd')];var _0x5c3543;if(_0x21a9e7>=_0x5eeece){_0x21a9e7=_0x5eeece;_0x5c3543=0xc8;}else{_0x5c3543=0xce;}_0x5eeda5['status'](_0x5c3543);return _0x5eeda5['set'](_0x4233('0xf'),_0x272913+'-'+_0x21a9e7+'/'+_0x5eeece)[_0x4233('0xb')](_0x1b2f5f);}return null;};}function saveUpdates(_0x43aede){return function(_0x245331){if(_0x245331){return _0x245331[_0x4233('0x10')](_0x43aede)[_0x4233('0x11')](function(_0x28daed){return _0x28daed;});}return null;};}function removeEntity(_0xdcd8fd){return function(_0x33cdc3){if(_0x33cdc3){return _0x33cdc3[_0x4233('0x12')]()['then'](function(){var _0x598049=_0x33cdc3[_0x4233('0x13')]({'plain':!![]});var _0x25b9e8=_0x4233('0x14');return db['UserProfileResource']['destroy']({'where':{'type':_0x25b9e8,'resourceId':_0x598049['id']}})[_0x4233('0x11')](function(){return _0x33cdc3;});})[_0x4233('0x11')](function(){var _0x126053=new Redis(config[_0x4233('0x4')]);_0x126053[_0x4233('0x15')]('agi',JSON[_0x4233('0x16')]({'id':_0x33cdc3['id'],'deleted':!![]}));})[_0x4233('0x11')](function(){_0xdcd8fd[_0x4233('0xa')](0xcc)[_0x4233('0x17')]();});}};}function handleEntityNotFound(_0x98dd95){return function(_0x27388b){if(!_0x27388b){_0x98dd95[_0x4233('0x18')](0x194);}return _0x27388b;};}function handleError(_0x428265,_0x29b049){_0x29b049=_0x29b049||0x1f4;return function(_0x74bbeb){logger[_0x4233('0x19')](_0x74bbeb[_0x4233('0x1a')]);if(_0x74bbeb['name']){delete _0x74bbeb[_0x4233('0x1b')];}_0x428265[_0x4233('0xa')](_0x29b049)[_0x4233('0x1c')](_0x74bbeb);};}exports[_0x4233('0x1d')]=function(_0x13f111,_0x22f559){var _0x1a5e94={},_0x2ef7cb={},_0x412a77={'count':0x0,'rows':[]};var _0x2c78cf=_[_0x4233('0x1e')](db['SquareProject'][_0x4233('0x1f')],function(_0x68e8a5){return{'name':_0x68e8a5[_0x4233('0x20')],'type':_0x68e8a5[_0x4233('0x21')]['key']};});_0x2ef7cb['model']=_[_0x4233('0x1e')](_0x2c78cf,_0x4233('0x1b'));_0x2ef7cb[_0x4233('0x22')]=_[_0x4233('0x23')](_0x13f111['query']);_0x2ef7cb[_0x4233('0x24')]=_['intersection'](_0x2ef7cb[_0x4233('0x25')],_0x2ef7cb[_0x4233('0x22')]);_0x1a5e94[_0x4233('0x26')]=_[_0x4233('0x27')](_0x2ef7cb[_0x4233('0x25')],qs[_0x4233('0x28')](_0x13f111[_0x4233('0x22')][_0x4233('0x28')]));_0x1a5e94[_0x4233('0x26')]=_0x1a5e94[_0x4233('0x26')][_0x4233('0x29')]?_0x1a5e94[_0x4233('0x26')]:_0x2ef7cb[_0x4233('0x25')];if(!_0x13f111[_0x4233('0x22')][_0x4233('0x2a')](_0x4233('0x2b'))){_0x1a5e94[_0x4233('0xd')]=qs[_0x4233('0xd')](_0x13f111[_0x4233('0x22')][_0x4233('0xd')]);_0x1a5e94[_0x4233('0xc')]=qs[_0x4233('0xc')](_0x13f111[_0x4233('0x22')]['offset']);}_0x1a5e94['order']=qs['sort'](_0x13f111['query']['sort']);_0x1a5e94[_0x4233('0x2c')]=qs[_0x4233('0x24')](_[_0x4233('0x2d')](_0x13f111[_0x4233('0x22')],_0x2ef7cb[_0x4233('0x24')]),_0x2c78cf);if(_0x13f111[_0x4233('0x22')][_0x4233('0x2e')]){_0x1a5e94['where']=_[_0x4233('0x2f')](_0x1a5e94['where'],{'$or':_['map'](_0x2c78cf,function(_0x53d0f4){if(_0x53d0f4[_0x4233('0x21')]!==_0x4233('0x30')){var _0x599dd1={};_0x599dd1[_0x53d0f4[_0x4233('0x1b')]]={'$like':'%'+_0x13f111[_0x4233('0x22')][_0x4233('0x2e')]+'%'};return _0x599dd1;}})});}_0x1a5e94=_['merge']({},_0x1a5e94,_0x13f111[_0x4233('0x31')]);var _0x32234e={'where':_0x1a5e94['where']};return db['SquareProject'][_0x4233('0x32')](_0x32234e)[_0x4233('0x11')](function(_0x328a6b){_0x412a77[_0x4233('0x32')]=_0x328a6b;if(_0x13f111[_0x4233('0x22')][_0x4233('0x33')]){_0x1a5e94[_0x4233('0x34')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x1a5e94);})['then'](function(_0x316b4f){_0x412a77['rows']=_0x316b4f;return _0x412a77;})[_0x4233('0x11')](respondWithFilteredResult(_0x22f559,_0x1a5e94))['catch'](handleError(_0x22f559,null));};exports[_0x4233('0x35')]=function(_0x27f403,_0x4e8b62){var _0x40c4ad={'raw':![],'where':{'id':_0x27f403['params']['id']}},_0x2034db={};_0x2034db[_0x4233('0x25')]=_[_0x4233('0x23')](db[_0x4233('0x36')]['rawAttributes']);_0x2034db['query']=_[_0x4233('0x23')](_0x27f403[_0x4233('0x22')]);_0x2034db['filters']=_['intersection'](_0x2034db['model'],_0x2034db['query']);_0x40c4ad[_0x4233('0x26')]=_[_0x4233('0x27')](_0x2034db[_0x4233('0x25')],qs[_0x4233('0x28')](_0x27f403['query']['fields']));_0x40c4ad['attributes']=_0x40c4ad[_0x4233('0x26')][_0x4233('0x29')]?_0x40c4ad[_0x4233('0x26')]:_0x2034db[_0x4233('0x25')];if(_0x27f403['query'][_0x4233('0x33')]){_0x40c4ad[_0x4233('0x34')]=[{'all':!![]}];}_0x40c4ad=_[_0x4233('0x2f')]({},_0x40c4ad,_0x27f403[_0x4233('0x31')]);return db[_0x4233('0x36')][_0x4233('0x37')](_0x40c4ad)[_0x4233('0x11')](handleEntityNotFound(_0x4e8b62,null))[_0x4233('0x11')](respondWithResult(_0x4e8b62,null))[_0x4233('0x38')](handleError(_0x4e8b62,null));};exports['create']=function(_0x135991,_0x394db3){return db['SquareProject']['create'](_0x135991[_0x4233('0x39')],{})[_0x4233('0x11')](function(_0x108fc3){var _0x26c2fb=_0x135991[_0x4233('0x3a')][_0x4233('0x13')]({'plain':!![]});if(!_0x26c2fb)throw new Error(_0x4233('0x3b'));if(_0x26c2fb[_0x4233('0x3c')]===_0x4233('0x3a')){var _0x2ecc5b=_0x108fc3['get']({'plain':!![]});var _0x5b45e1=_0x4233('0x14');return db['UserProfileSection'][_0x4233('0x37')]({'where':{'name':_0x5b45e1,'userProfileId':_0x26c2fb[_0x4233('0x3d')]},'raw':!![]})['then'](function(_0x2eb983){if(_0x2eb983&&_0x2eb983[_0x4233('0x3e')]===0x0){return db[_0x4233('0x3f')]['create']({'name':_0x2ecc5b[_0x4233('0x1b')],'resourceId':_0x2ecc5b['id'],'type':_0x2eb983[_0x4233('0x1b')],'sectionId':_0x2eb983['id']},{})[_0x4233('0x11')](function(){return _0x108fc3;});}else{return _0x108fc3;}})[_0x4233('0x38')](function(_0x3b5aaa){logger[_0x4233('0x19')](_0x4233('0x40'),_0x3b5aaa);throw _0x3b5aaa;});}return _0x108fc3;})[_0x4233('0x11')](respondWithResult(_0x394db3,0xc9))[_0x4233('0x38')](handleError(_0x394db3,null));};exports[_0x4233('0x10')]=function(_0x5c66bd,_0x205525){if(_0x5c66bd[_0x4233('0x39')]['id']){delete _0x5c66bd[_0x4233('0x39')]['id'];}return db['SquareProject'][_0x4233('0x37')]({'where':{'id':_0x5c66bd[_0x4233('0x41')]['id']}})[_0x4233('0x11')](handleEntityNotFound(_0x205525,null))[_0x4233('0x11')](saveUpdates(_0x5c66bd['body'],null))[_0x4233('0x11')](function(_0x168145){if(!_0x168145)return;var _0x4f90cc=_0x168145[_0x4233('0x13')]({'plain':!![]});return _0x4f90cc;})['then'](function(_0x5d118f){var _0x3da905=new Redis(config[_0x4233('0x4')]);_0x3da905[_0x4233('0x15')]('agi',JSON['stringify'](_[_0x4233('0x2d')](_0x5d118f,['id',_0x4233('0x1b'),_0x4233('0x42')])));return _0x5d118f;})[_0x4233('0x11')](respondWithResult(_0x205525,null))['catch'](handleError(_0x205525,null));};exports[_0x4233('0x12')]=function(_0x4a16a8,_0x1d6764){return db['SquareProject'][_0x4233('0x37')]({'where':{'id':_0x4a16a8['params']['id']}})[_0x4233('0x11')](handleEntityNotFound(_0x1d6764,null))['then'](removeEntity(_0x1d6764,null))['catch'](handleError(_0x1d6764,null));};
\ No newline at end of file