Built motion from commit 9b156c94.|2.6.22
[motion2.git] / server / api / squareProject / squareProject.controller.js
index d72e5f7..1297460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f23=['set','Content-Range','json','update','then','destroy','get','UserProfileResource','publish','agi','stringify','end','error','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','keys','filters','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','include','rows','catch','intersection','fields','includeAll','create','user','role','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','body','params','production','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','offset','undefined','count','status'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1f23,0x185));var _0x31f2=function(_0x1ae0d5,_0x5d9a7b){_0x1ae0d5=_0x1ae0d5-0x0;var _0x48e447=_0x1f23[_0x1ae0d5];return _0x48e447;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x31f2('0x0'));var logger=require(_0x31f2('0x1'))(_0x31f2('0x2'));var config=require('../../config/environment');var db=require(_0x31f2('0x3'))['db'];config[_0x31f2('0x4')]=_[_0x31f2('0x5')](config[_0x31f2('0x4')],{'host':_0x31f2('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31f2('0x4')]));require(_0x31f2('0x7'))[_0x31f2('0x8')](socket);function respondWithResult(_0x3752bb,_0x25884a){_0x25884a=_0x25884a||0xc8;return function(_0x596260){if(_0x596260){return _0x3752bb['status'](_0x25884a)['json'](_0x596260);}};}function respondWithFilteredResult(_0x52a0e0,_0x2738aa){return function(_0x176e5e){if(_0x176e5e){var _0x178d3f=typeof _0x2738aa[_0x31f2('0x9')]==='undefined'&&typeof _0x2738aa['limit']===_0x31f2('0xa');var _0x201f82=_0x176e5e[_0x31f2('0xb')];var _0x2df98e=_0x178d3f?0x0:_0x2738aa['offset'];var _0x5ae681=_0x178d3f?_0x176e5e['count']:_0x2738aa['offset']+_0x2738aa['limit'];var _0x2727a3;if(_0x5ae681>=_0x201f82){_0x5ae681=_0x201f82;_0x2727a3=0xc8;}else{_0x2727a3=0xce;}_0x52a0e0[_0x31f2('0xc')](_0x2727a3);return _0x52a0e0[_0x31f2('0xd')](_0x31f2('0xe'),_0x2df98e+'-'+_0x5ae681+'/'+_0x201f82)[_0x31f2('0xf')](_0x176e5e);}return null;};}function saveUpdates(_0x3c236e){return function(_0x11577f){if(_0x11577f){return _0x11577f[_0x31f2('0x10')](_0x3c236e)[_0x31f2('0x11')](function(_0x41f936){return _0x41f936;});}return null;};}function removeEntity(_0x3ca92c){return function(_0x58502c){if(_0x58502c){return _0x58502c[_0x31f2('0x12')]()['then'](function(){var _0x11dcf2=_0x58502c[_0x31f2('0x13')]({'plain':!![]});var _0x5b788f='SquareProjects';return db[_0x31f2('0x14')][_0x31f2('0x12')]({'where':{'type':_0x5b788f,'resourceId':_0x11dcf2['id']}})[_0x31f2('0x11')](function(){return _0x58502c;});})[_0x31f2('0x11')](function(){var _0x2e5175=new Redis(config[_0x31f2('0x4')]);_0x2e5175[_0x31f2('0x15')](_0x31f2('0x16'),JSON[_0x31f2('0x17')]({'id':_0x58502c['id'],'deleted':!![]}));})[_0x31f2('0x11')](function(){_0x3ca92c['status'](0xcc)[_0x31f2('0x18')]();});}};}function handleEntityNotFound(_0x73bdb0){return function(_0x3780b6){if(!_0x3780b6){_0x73bdb0['sendStatus'](0x194);}return _0x3780b6;};}function handleError(_0x58838f,_0x1dfb58){_0x1dfb58=_0x1dfb58||0x1f4;return function(_0x37fcb3){logger[_0x31f2('0x19')](_0x37fcb3['stack']);if(_0x37fcb3[_0x31f2('0x1a')]){delete _0x37fcb3[_0x31f2('0x1a')];}_0x58838f[_0x31f2('0xc')](_0x1dfb58)[_0x31f2('0x1b')](_0x37fcb3);};}exports[_0x31f2('0x1c')]=function(_0x119bb8,_0x396aed){var _0x1242c4={},_0xec67d={},_0x3e6de3={'count':0x0,'rows':[]};var _0x1a8f56=_[_0x31f2('0x1d')](db[_0x31f2('0x1e')][_0x31f2('0x1f')],function(_0x1fedab){return{'name':_0x1fedab[_0x31f2('0x20')],'type':_0x1fedab[_0x31f2('0x21')][_0x31f2('0x22')]};});_0xec67d['model']=_[_0x31f2('0x1d')](_0x1a8f56,_0x31f2('0x1a'));_0xec67d[_0x31f2('0x23')]=_[_0x31f2('0x24')](_0x119bb8[_0x31f2('0x23')]);_0xec67d[_0x31f2('0x25')]=_['intersection'](_0xec67d['model'],_0xec67d['query']);_0x1242c4[_0x31f2('0x26')]=_['intersection'](_0xec67d['model'],qs['fields'](_0x119bb8[_0x31f2('0x23')]['fields']));_0x1242c4[_0x31f2('0x26')]=_0x1242c4['attributes'][_0x31f2('0x27')]?_0x1242c4[_0x31f2('0x26')]:_0xec67d[_0x31f2('0x28')];if(!_0x119bb8['query'][_0x31f2('0x29')](_0x31f2('0x2a'))){_0x1242c4[_0x31f2('0x2b')]=qs[_0x31f2('0x2b')](_0x119bb8['query'][_0x31f2('0x2b')]);_0x1242c4[_0x31f2('0x9')]=qs[_0x31f2('0x9')](_0x119bb8[_0x31f2('0x23')][_0x31f2('0x9')]);}_0x1242c4[_0x31f2('0x2c')]=qs[_0x31f2('0x2d')](_0x119bb8[_0x31f2('0x23')][_0x31f2('0x2d')]);_0x1242c4[_0x31f2('0x2e')]=qs['filters'](_['pick'](_0x119bb8['query'],_0xec67d['filters']),_0x1a8f56);if(_0x119bb8[_0x31f2('0x23')][_0x31f2('0x2f')]){_0x1242c4[_0x31f2('0x2e')]=_['merge'](_0x1242c4['where'],{'$or':_[_0x31f2('0x1d')](_0x1a8f56,function(_0x233e81){if(_0x233e81['type']!==_0x31f2('0x30')){var _0x33ef1c={};_0x33ef1c[_0x233e81[_0x31f2('0x1a')]]={'$like':'%'+_0x119bb8[_0x31f2('0x23')][_0x31f2('0x2f')]+'%'};return _0x33ef1c;}})});}_0x1242c4=_[_0x31f2('0x31')]({},_0x1242c4,_0x119bb8['options']);var _0x4b838b={'where':_0x1242c4[_0x31f2('0x2e')]};return db[_0x31f2('0x1e')]['count'](_0x4b838b)[_0x31f2('0x11')](function(_0x1b856b){_0x3e6de3[_0x31f2('0xb')]=_0x1b856b;if(_0x119bb8['query']['includeAll']){_0x1242c4[_0x31f2('0x32')]=[{'all':!![]}];}return db[_0x31f2('0x1e')]['findAll'](_0x1242c4);})['then'](function(_0x5cf5c1){_0x3e6de3[_0x31f2('0x33')]=_0x5cf5c1;return _0x3e6de3;})[_0x31f2('0x11')](respondWithFilteredResult(_0x396aed,_0x1242c4))[_0x31f2('0x34')](handleError(_0x396aed,null));};exports['show']=function(_0x14132d,_0x2dcac7){var _0x18a64f={'raw':![],'where':{'id':_0x14132d['params']['id']}},_0x4c35cb={};_0x4c35cb[_0x31f2('0x28')]=_['keys'](db[_0x31f2('0x1e')]['rawAttributes']);_0x4c35cb['query']=_['keys'](_0x14132d['query']);_0x4c35cb['filters']=_['intersection'](_0x4c35cb[_0x31f2('0x28')],_0x4c35cb[_0x31f2('0x23')]);_0x18a64f[_0x31f2('0x26')]=_[_0x31f2('0x35')](_0x4c35cb[_0x31f2('0x28')],qs[_0x31f2('0x36')](_0x14132d[_0x31f2('0x23')][_0x31f2('0x36')]));_0x18a64f[_0x31f2('0x26')]=_0x18a64f['attributes'][_0x31f2('0x27')]?_0x18a64f['attributes']:_0x4c35cb[_0x31f2('0x28')];if(_0x14132d['query'][_0x31f2('0x37')]){_0x18a64f[_0x31f2('0x32')]=[{'all':!![]}];}_0x18a64f=_['merge']({},_0x18a64f,_0x14132d['options']);return db[_0x31f2('0x1e')]['find'](_0x18a64f)[_0x31f2('0x11')](handleEntityNotFound(_0x2dcac7,null))[_0x31f2('0x11')](respondWithResult(_0x2dcac7,null))[_0x31f2('0x34')](handleError(_0x2dcac7,null));};exports['create']=function(_0x4475ba,_0x2a9eba){return db[_0x31f2('0x1e')][_0x31f2('0x38')](_0x4475ba['body'],{})['then'](function(_0x5025a6){var _0x2d8bab=_0x4475ba[_0x31f2('0x39')]['get']({'plain':!![]});if(!_0x2d8bab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d8bab[_0x31f2('0x3a')]===_0x31f2('0x39')){var _0x263347=_0x5025a6[_0x31f2('0x13')]({'plain':!![]});var _0x560c75=_0x31f2('0x3b');return db[_0x31f2('0x3c')][_0x31f2('0x3d')]({'where':{'name':_0x560c75,'userProfileId':_0x2d8bab[_0x31f2('0x3e')]},'raw':!![]})[_0x31f2('0x11')](function(_0x2be459){if(_0x2be459&&_0x2be459[_0x31f2('0x3f')]===0x0){return db[_0x31f2('0x14')]['create']({'name':_0x263347[_0x31f2('0x1a')],'resourceId':_0x263347['id'],'type':_0x2be459[_0x31f2('0x1a')],'sectionId':_0x2be459['id']},{})['then'](function(){return _0x5025a6;});}else{return _0x5025a6;}})[_0x31f2('0x34')](function(_0x374e53){logger[_0x31f2('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x374e53);throw _0x374e53;});}return _0x5025a6;})[_0x31f2('0x11')](respondWithResult(_0x2a9eba,0xc9))[_0x31f2('0x34')](handleError(_0x2a9eba,null));};exports['update']=function(_0x13b4f2,_0x35068e){if(_0x13b4f2['body']['id']){delete _0x13b4f2[_0x31f2('0x40')]['id'];}return db['SquareProject'][_0x31f2('0x3d')]({'where':{'id':_0x13b4f2[_0x31f2('0x41')]['id']}})[_0x31f2('0x11')](handleEntityNotFound(_0x35068e,null))[_0x31f2('0x11')](saveUpdates(_0x13b4f2['body'],null))['then'](function(_0x47caaa){if(!_0x47caaa)return;var _0xe69d21=_0x47caaa[_0x31f2('0x13')]({'plain':!![]});return _0xe69d21;})[_0x31f2('0x11')](function(_0x3b4bc3){var _0x14a05e=new Redis(config[_0x31f2('0x4')]);_0x14a05e['publish']('agi',JSON[_0x31f2('0x17')](_['pick'](_0x3b4bc3,['id',_0x31f2('0x1a'),_0x31f2('0x42')])));return _0x3b4bc3;})['then'](respondWithResult(_0x35068e,null))['catch'](handleError(_0x35068e,null));};exports[_0x31f2('0x12')]=function(_0x352b0b,_0x4f6d69){return db[_0x31f2('0x1e')][_0x31f2('0x3d')]({'where':{'id':_0x352b0b[_0x31f2('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f6d69,null))[_0x31f2('0x11')](removeEntity(_0x4f6d69,null))[_0x31f2('0x34')](handleError(_0x4f6d69,null));};
\ No newline at end of file
+var _0xbabc=['params','keys','find','create','body','user','role','get','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','limit','count','set','Content-Range','json','update','then','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','stack','name','send','map','SquareProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4726b1,_0xa03991){var _0x3c2877=function(_0x5c92be){while(--_0x5c92be){_0x4726b1['push'](_0x4726b1['shift']());}};_0x3c2877(++_0xa03991);}(_0xbabc,0x1ef));var _0xcbab=function(_0x47b180,_0x1b8704){_0x47b180=_0x47b180-0x0;var _0x1b99eb=_0xbabc[_0x47b180];return _0x1b99eb;};'use strict';var _=require(_0xcbab('0x0'));var Redis=require(_0xcbab('0x1'));var qs=require(_0xcbab('0x2'));var logger=require(_0xcbab('0x3'))('api');var config=require(_0xcbab('0x4'));var db=require(_0xcbab('0x5'))['db'];config[_0xcbab('0x6')]=_['defaults'](config[_0xcbab('0x6')],{'host':_0xcbab('0x7'),'port':0x18eb});var socket=require(_0xcbab('0x8'))(new Redis(config[_0xcbab('0x6')]));require(_0xcbab('0x9'))[_0xcbab('0xa')](socket);function respondWithResult(_0x3c89f1,_0x987de5){_0x987de5=_0x987de5||0xc8;return function(_0x23e9b1){if(_0x23e9b1){return _0x3c89f1[_0xcbab('0xb')](_0x987de5)['json'](_0x23e9b1);}};}function respondWithFilteredResult(_0x4952a6,_0x128a48){return function(_0x45d720){if(_0x45d720){var _0x3c8968=typeof _0x128a48[_0xcbab('0xc')]==='undefined'&&typeof _0x128a48[_0xcbab('0xd')]==='undefined';var _0x6fab38=_0x45d720[_0xcbab('0xe')];var _0xc8e2d4=_0x3c8968?0x0:_0x128a48['offset'];var _0x3f643a=_0x3c8968?_0x45d720['count']:_0x128a48[_0xcbab('0xc')]+_0x128a48[_0xcbab('0xd')];var _0x1e159f;if(_0x3f643a>=_0x6fab38){_0x3f643a=_0x6fab38;_0x1e159f=0xc8;}else{_0x1e159f=0xce;}_0x4952a6['status'](_0x1e159f);return _0x4952a6[_0xcbab('0xf')](_0xcbab('0x10'),_0xc8e2d4+'-'+_0x3f643a+'/'+_0x6fab38)[_0xcbab('0x11')](_0x45d720);}return null;};}function saveUpdates(_0x41906a){return function(_0x557288){if(_0x557288){return _0x557288[_0xcbab('0x12')](_0x41906a)['then'](function(_0x73e6dc){return _0x73e6dc;});}return null;};}function removeEntity(_0x58aaf5){return function(_0x84e0e6){if(_0x84e0e6){return _0x84e0e6['destroy']()[_0xcbab('0x13')](function(){var _0x3040c7=_0x84e0e6['get']({'plain':!![]});var _0x17253a=_0xcbab('0x14');return db[_0xcbab('0x15')][_0xcbab('0x16')]({'where':{'type':_0x17253a,'resourceId':_0x3040c7['id']}})[_0xcbab('0x13')](function(){return _0x84e0e6;});})[_0xcbab('0x13')](function(){var _0xaeeed2=new Redis(config[_0xcbab('0x6')]);_0xaeeed2[_0xcbab('0x17')](_0xcbab('0x18'),JSON[_0xcbab('0x19')]({'id':_0x84e0e6['id'],'deleted':!![]}));})[_0xcbab('0x13')](function(){_0x58aaf5[_0xcbab('0xb')](0xcc)[_0xcbab('0x1a')]();});}};}function handleEntityNotFound(_0x44bbfe){return function(_0x560771){if(!_0x560771){_0x44bbfe[_0xcbab('0x1b')](0x194);}return _0x560771;};}function handleError(_0x279fc0,_0x3883e4){_0x3883e4=_0x3883e4||0x1f4;return function(_0x478acd){logger['error'](_0x478acd[_0xcbab('0x1c')]);if(_0x478acd['name']){delete _0x478acd[_0xcbab('0x1d')];}_0x279fc0[_0xcbab('0xb')](_0x3883e4)[_0xcbab('0x1e')](_0x478acd);};}exports['index']=function(_0x591d84,_0x2c4589){var _0x3e9eca={},_0x4f0c60={},_0x187fc3={'count':0x0,'rows':[]};var _0x342de5=_[_0xcbab('0x1f')](db[_0xcbab('0x20')]['rawAttributes'],function(_0x3cb94b){return{'name':_0x3cb94b[_0xcbab('0x21')],'type':_0x3cb94b[_0xcbab('0x22')][_0xcbab('0x23')]};});_0x4f0c60[_0xcbab('0x24')]=_[_0xcbab('0x1f')](_0x342de5,'name');_0x4f0c60['query']=_['keys'](_0x591d84[_0xcbab('0x25')]);_0x4f0c60[_0xcbab('0x26')]=_[_0xcbab('0x27')](_0x4f0c60[_0xcbab('0x24')],_0x4f0c60[_0xcbab('0x25')]);_0x3e9eca[_0xcbab('0x28')]=_[_0xcbab('0x27')](_0x4f0c60[_0xcbab('0x24')],qs[_0xcbab('0x29')](_0x591d84['query']['fields']));_0x3e9eca[_0xcbab('0x28')]=_0x3e9eca[_0xcbab('0x28')][_0xcbab('0x2a')]?_0x3e9eca[_0xcbab('0x28')]:_0x4f0c60[_0xcbab('0x24')];if(!_0x591d84[_0xcbab('0x25')][_0xcbab('0x2b')](_0xcbab('0x2c'))){_0x3e9eca[_0xcbab('0xd')]=qs[_0xcbab('0xd')](_0x591d84[_0xcbab('0x25')]['limit']);_0x3e9eca[_0xcbab('0xc')]=qs[_0xcbab('0xc')](_0x591d84[_0xcbab('0x25')][_0xcbab('0xc')]);}_0x3e9eca[_0xcbab('0x2d')]=qs['sort'](_0x591d84[_0xcbab('0x25')][_0xcbab('0x2e')]);_0x3e9eca['where']=qs[_0xcbab('0x26')](_[_0xcbab('0x2f')](_0x591d84[_0xcbab('0x25')],_0x4f0c60[_0xcbab('0x26')]),_0x342de5);if(_0x591d84[_0xcbab('0x25')][_0xcbab('0x30')]){_0x3e9eca[_0xcbab('0x31')]=_[_0xcbab('0x32')](_0x3e9eca[_0xcbab('0x31')],{'$or':_['map'](_0x342de5,function(_0x4f0cdf){if(_0x4f0cdf[_0xcbab('0x22')]!==_0xcbab('0x33')){var _0x4baf0d={};_0x4baf0d[_0x4f0cdf[_0xcbab('0x1d')]]={'$like':'%'+_0x591d84['query']['filter']+'%'};return _0x4baf0d;}})});}_0x3e9eca=_[_0xcbab('0x32')]({},_0x3e9eca,_0x591d84[_0xcbab('0x34')]);var _0x3db635={'where':_0x3e9eca[_0xcbab('0x31')]};return db[_0xcbab('0x20')][_0xcbab('0xe')](_0x3db635)['then'](function(_0x1964b1){_0x187fc3[_0xcbab('0xe')]=_0x1964b1;if(_0x591d84[_0xcbab('0x25')][_0xcbab('0x35')]){_0x3e9eca[_0xcbab('0x36')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x3e9eca);})[_0xcbab('0x13')](function(_0x4d99be){_0x187fc3[_0xcbab('0x37')]=_0x4d99be;return _0x187fc3;})[_0xcbab('0x13')](respondWithFilteredResult(_0x2c4589,_0x3e9eca))[_0xcbab('0x38')](handleError(_0x2c4589,null));};exports['show']=function(_0x52db13,_0x339ab1){var _0x2c961f={'raw':![],'where':{'id':_0x52db13[_0xcbab('0x39')]['id']}},_0x3f990a={};_0x3f990a[_0xcbab('0x24')]=_[_0xcbab('0x3a')](db['SquareProject']['rawAttributes']);_0x3f990a[_0xcbab('0x25')]=_[_0xcbab('0x3a')](_0x52db13[_0xcbab('0x25')]);_0x3f990a[_0xcbab('0x26')]=_[_0xcbab('0x27')](_0x3f990a[_0xcbab('0x24')],_0x3f990a[_0xcbab('0x25')]);_0x2c961f['attributes']=_['intersection'](_0x3f990a[_0xcbab('0x24')],qs[_0xcbab('0x29')](_0x52db13['query'][_0xcbab('0x29')]));_0x2c961f['attributes']=_0x2c961f['attributes']['length']?_0x2c961f[_0xcbab('0x28')]:_0x3f990a[_0xcbab('0x24')];if(_0x52db13[_0xcbab('0x25')][_0xcbab('0x35')]){_0x2c961f[_0xcbab('0x36')]=[{'all':!![]}];}_0x2c961f=_[_0xcbab('0x32')]({},_0x2c961f,_0x52db13['options']);return db[_0xcbab('0x20')][_0xcbab('0x3b')](_0x2c961f)[_0xcbab('0x13')](handleEntityNotFound(_0x339ab1,null))['then'](respondWithResult(_0x339ab1,null))[_0xcbab('0x38')](handleError(_0x339ab1,null));};exports[_0xcbab('0x3c')]=function(_0x501b1c,_0x18a9bb){return db[_0xcbab('0x20')]['create'](_0x501b1c[_0xcbab('0x3d')],{})[_0xcbab('0x13')](function(_0x4df47d){var _0x37f868=_0x501b1c[_0xcbab('0x3e')]['get']({'plain':!![]});if(!_0x37f868)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37f868[_0xcbab('0x3f')]==='user'){var _0x4f5caa=_0x4df47d[_0xcbab('0x40')]({'plain':!![]});var _0xa11e5a=_0xcbab('0x14');return db['UserProfileSection'][_0xcbab('0x3b')]({'where':{'name':_0xa11e5a,'userProfileId':_0x37f868['userProfileId']},'raw':!![]})[_0xcbab('0x13')](function(_0x22dbd0){if(_0x22dbd0&&_0x22dbd0[_0xcbab('0x41')]===0x0){return db['UserProfileResource'][_0xcbab('0x3c')]({'name':_0x4f5caa[_0xcbab('0x1d')],'resourceId':_0x4f5caa['id'],'type':_0x22dbd0[_0xcbab('0x1d')],'sectionId':_0x22dbd0['id']},{})[_0xcbab('0x13')](function(){return _0x4df47d;});}else{return _0x4df47d;}})['catch'](function(_0x257601){logger[_0xcbab('0x42')](_0xcbab('0x43'),_0x257601);throw _0x257601;});}return _0x4df47d;})['then'](respondWithResult(_0x18a9bb,0xc9))[_0xcbab('0x38')](handleError(_0x18a9bb,null));};exports[_0xcbab('0x12')]=function(_0x485cde,_0x2f833){if(_0x485cde[_0xcbab('0x3d')]['id']){delete _0x485cde[_0xcbab('0x3d')]['id'];}return db[_0xcbab('0x20')][_0xcbab('0x3b')]({'where':{'id':_0x485cde[_0xcbab('0x39')]['id']}})[_0xcbab('0x13')](handleEntityNotFound(_0x2f833,null))[_0xcbab('0x13')](saveUpdates(_0x485cde[_0xcbab('0x3d')],null))[_0xcbab('0x13')](function(_0x591c20){if(!_0x591c20)return;var _0x2e435f=_0x591c20['get']({'plain':!![]});return _0x2e435f;})[_0xcbab('0x13')](function(_0xa4685a){var _0x3c6aa6=new Redis(config['redis']);_0x3c6aa6['publish'](_0xcbab('0x18'),JSON[_0xcbab('0x19')](_[_0xcbab('0x2f')](_0xa4685a,['id','name',_0xcbab('0x44')])));return _0xa4685a;})['then'](respondWithResult(_0x2f833,null))[_0xcbab('0x38')](handleError(_0x2f833,null));};exports[_0xcbab('0x16')]=function(_0x4d81d1,_0x572ce4){return db['SquareProject']['find']({'where':{'id':_0x4d81d1[_0xcbab('0x39')]['id']}})[_0xcbab('0x13')](handleEntityNotFound(_0x572ce4,null))['then'](removeEntity(_0x572ce4,null))[_0xcbab('0x38')](handleError(_0x572ce4,null));};
\ No newline at end of file