Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index 14cf2fe..45bd945 100644 (file)
@@ -1 +1 @@
-const a91_0x3fe4=['show','attributes','filters','catch','end','params','then','../../mysqldb','options','merge','sendStatus','update','../../components/parsers/qs','api','query','ChatProactiveAction','model','json','error','findOne','include','rawAttributes','intersection','send','name','lodash','includeAll','create','destroy','keys','status','body'];(function(_0x561aac,_0x3fe409){const _0x1b53d9=function(_0x1aeaba){while(--_0x1aeaba){_0x561aac['push'](_0x561aac['shift']());}};_0x1b53d9(++_0x3fe409);}(a91_0x3fe4,0x16f));const a91_0x1b53=function(_0x561aac,_0x3fe409){_0x561aac=_0x561aac-0x0;let _0x1b53d9=a91_0x3fe4[_0x561aac];return _0x1b53d9;};const _0x179e59=a91_0x1b53;'use strict';const _=require(_0x179e59('0xa')),qs=require(_0x179e59('0x1d')),logger=require('../../config/logger')(_0x179e59('0x1e')),db=require(_0x179e59('0x18'))['db'];function respondWithResult(_0x1aeaba,_0x4266f4){return _0x4266f4=_0x4266f4||0xc8,function(_0x31b173){const _0x1d6bc4=a91_0x1b53;if(_0x31b173)return _0x1aeaba[_0x1d6bc4('0xf')](_0x4266f4)[_0x1d6bc4('0x2')](_0x31b173);};}function saveUpdates(_0x47ff4b){return function(_0x54cc2e){const _0x44860f=a91_0x1b53;if(_0x54cc2e)return _0x54cc2e[_0x44860f('0x1c')](_0x47ff4b)[_0x44860f('0x17')](function(_0x33da82){return _0x33da82;});return null;};}function removeEntity(_0x817d3b){return function(_0x5542f5){const _0x573bd7=a91_0x1b53;if(_0x5542f5)return _0x5542f5[_0x573bd7('0xd')]()[_0x573bd7('0x17')](function(){const _0x410e25=_0x573bd7;_0x817d3b[_0x410e25('0xf')](0xcc)[_0x410e25('0x15')]();});};}function handleEntityNotFound(_0xbe76b9){return function(_0x1b78d5){const _0x3fb33b=a91_0x1b53;return!_0x1b78d5&&_0xbe76b9[_0x3fb33b('0x1b')](0x194),_0x1b78d5;};}function handleError(_0x5af863,_0x5e5c66){return _0x5e5c66=_0x5e5c66||0x1f4,function(_0x1aec7e){const _0x5d2459=a91_0x1b53;logger[_0x5d2459('0x3')](_0x1aec7e['stack']),_0x1aec7e[_0x5d2459('0x9')]&&delete _0x1aec7e[_0x5d2459('0x9')],_0x5af863['status'](_0x5e5c66)[_0x5d2459('0x8')](_0x1aec7e);};}exports[_0x179e59('0x11')]=function(_0xd08e52,_0xe9e269){const _0x185e28=_0x179e59;let _0x51c2c2={'raw':!![],'where':{'id':_0xd08e52['params']['id']}};const _0x55cb91={};return _0x55cb91[_0x185e28('0x1')]=_[_0x185e28('0xe')](db[_0x185e28('0x0')][_0x185e28('0x6')]),_0x55cb91[_0x185e28('0x1f')]=_['keys'](_0xd08e52[_0x185e28('0x1f')]),_0x55cb91[_0x185e28('0x13')]=_['intersection'](_0x55cb91['model'],_0x55cb91['query']),_0x51c2c2[_0x185e28('0x12')]=_[_0x185e28('0x7')](_0x55cb91['model'],qs['fields'](_0xd08e52['query']['fields'])),_0x51c2c2[_0x185e28('0x12')]=_0x51c2c2['attributes']['length']?_0x51c2c2[_0x185e28('0x12')]:_0x55cb91['model'],_0xd08e52[_0x185e28('0x1f')][_0x185e28('0xb')]&&(_0x51c2c2[_0x185e28('0x5')]=[{'all':!![]}]),_0x51c2c2=_[_0x185e28('0x1a')]({},_0x51c2c2,_0xd08e52[_0x185e28('0x19')]),db[_0x185e28('0x0')]['findOne'](_0x51c2c2)[_0x185e28('0x17')](handleEntityNotFound(_0xe9e269,null))[_0x185e28('0x17')](respondWithResult(_0xe9e269,null))['catch'](handleError(_0xe9e269,null));},exports['create']=function(_0x3f05e5,_0x5c212b){const _0x50182a=_0x179e59;return db[_0x50182a('0x0')][_0x50182a('0xc')](_0x3f05e5[_0x50182a('0x10')],{})['then'](respondWithResult(_0x5c212b,0xc9))['catch'](handleError(_0x5c212b,null));},exports[_0x179e59('0x1c')]=function(_0x3582a1,_0x556c9f){const _0x483a3d=_0x179e59;return _0x3582a1[_0x483a3d('0x10')]['id']&&delete _0x3582a1[_0x483a3d('0x10')]['id'],db[_0x483a3d('0x0')][_0x483a3d('0x4')]({'where':{'id':_0x3582a1[_0x483a3d('0x16')]['id']}})[_0x483a3d('0x17')](handleEntityNotFound(_0x556c9f,null))['then'](saveUpdates(_0x3582a1['body'],null))[_0x483a3d('0x17')](respondWithResult(_0x556c9f,null))['catch'](handleError(_0x556c9f,null));},exports[_0x179e59('0xd')]=function(_0x3627bd,_0x11e010){const _0x41e3eb=_0x179e59;return db[_0x41e3eb('0x0')][_0x41e3eb('0x4')]({'where':{'id':_0x3627bd['params']['id']}})[_0x41e3eb('0x17')](handleEntityNotFound(_0x11e010,null))[_0x41e3eb('0x17')](removeEntity(_0x11e010,null))[_0x41e3eb('0x14')](handleError(_0x11e010,null));};
\ No newline at end of file
+const a91_0x1d91=['../../components/parsers/qs','lodash','status','attributes','end','include','params','body','query','rawAttributes','send','length','keys','catch','../../config/logger','intersection','json','update','name','merge','sendStatus','../../mysqldb','api','show','destroy','filters','findOne','then','ChatProactiveAction','fields','model','error'];(function(_0x461ccb,_0x1d913c){const _0xf23ea2=function(_0xabb63c){while(--_0xabb63c){_0x461ccb['push'](_0x461ccb['shift']());}};_0xf23ea2(++_0x1d913c);}(a91_0x1d91,0x192));const a91_0xf23e=function(_0x461ccb,_0x1d913c){_0x461ccb=_0x461ccb-0x0;let _0xf23ea2=a91_0x1d91[_0x461ccb];return _0xf23ea2;};const _0x978322=a91_0xf23e;'use strict';const _=require(_0x978322('0xf')),qs=require(_0x978322('0xe')),logger=require(_0x978322('0x1c'))(_0x978322('0x4')),db=require(_0x978322('0x3'))['db'];function respondWithResult(_0xabb63c,_0x4ddcaa){return _0x4ddcaa=_0x4ddcaa||0xc8,function(_0x581496){const _0x4b0ea9=a91_0xf23e;if(_0x581496)return _0xabb63c['status'](_0x4ddcaa)[_0x4b0ea9('0x1e')](_0x581496);};}function saveUpdates(_0x4a5778){return function(_0x29dbcc){const _0x7b34f5=a91_0xf23e;if(_0x29dbcc)return _0x29dbcc[_0x7b34f5('0x1f')](_0x4a5778)[_0x7b34f5('0x9')](function(_0x1f44da){return _0x1f44da;});return null;};}function removeEntity(_0x1d459c){return function(_0x1d72eb){const _0x1ea728=a91_0xf23e;if(_0x1d72eb)return _0x1d72eb['destroy']()[_0x1ea728('0x9')](function(){const _0x43351c=_0x1ea728;_0x1d459c[_0x43351c('0x10')](0xcc)[_0x43351c('0x12')]();});};}function handleEntityNotFound(_0x2e89ed){return function(_0x4dee8c){const _0x1894a2=a91_0xf23e;return!_0x4dee8c&&_0x2e89ed[_0x1894a2('0x2')](0x194),_0x4dee8c;};}function handleError(_0xb79fb9,_0x414642){return _0x414642=_0x414642||0x1f4,function(_0x2b3a25){const _0x3dac93=a91_0xf23e;logger[_0x3dac93('0xd')](_0x2b3a25['stack']),_0x2b3a25['name']&&delete _0x2b3a25[_0x3dac93('0x0')],_0xb79fb9[_0x3dac93('0x10')](_0x414642)[_0x3dac93('0x18')](_0x2b3a25);};}exports[_0x978322('0x5')]=function(_0x4b8993,_0x3de5f8){const _0x5c2f6f=_0x978322;let _0x2b4559={'raw':!![],'where':{'id':_0x4b8993['params']['id']}};const _0x577995={};return _0x577995['model']=_[_0x5c2f6f('0x1a')](db[_0x5c2f6f('0xa')][_0x5c2f6f('0x17')]),_0x577995['query']=_['keys'](_0x4b8993[_0x5c2f6f('0x16')]),_0x577995[_0x5c2f6f('0x7')]=_[_0x5c2f6f('0x1d')](_0x577995[_0x5c2f6f('0xc')],_0x577995['query']),_0x2b4559[_0x5c2f6f('0x11')]=_[_0x5c2f6f('0x1d')](_0x577995[_0x5c2f6f('0xc')],qs[_0x5c2f6f('0xb')](_0x4b8993['query'][_0x5c2f6f('0xb')])),_0x2b4559[_0x5c2f6f('0x11')]=_0x2b4559[_0x5c2f6f('0x11')][_0x5c2f6f('0x19')]?_0x2b4559[_0x5c2f6f('0x11')]:_0x577995[_0x5c2f6f('0xc')],_0x4b8993[_0x5c2f6f('0x16')]['includeAll']&&(_0x2b4559[_0x5c2f6f('0x13')]=[{'all':!![]}]),_0x2b4559=_[_0x5c2f6f('0x1')]({},_0x2b4559,_0x4b8993['options']),db['ChatProactiveAction'][_0x5c2f6f('0x8')](_0x2b4559)[_0x5c2f6f('0x9')](handleEntityNotFound(_0x3de5f8,null))['then'](respondWithResult(_0x3de5f8,null))[_0x5c2f6f('0x1b')](handleError(_0x3de5f8,null));},exports['create']=function(_0xcf76fa,_0x589eb9){const _0x2ade49=_0x978322;return db['ChatProactiveAction']['create'](_0xcf76fa[_0x2ade49('0x15')],{})[_0x2ade49('0x9')](respondWithResult(_0x589eb9,0xc9))[_0x2ade49('0x1b')](handleError(_0x589eb9,null));},exports[_0x978322('0x1f')]=function(_0x2719aa,_0x4ba846){const _0x2fa0d4=_0x978322;return _0x2719aa[_0x2fa0d4('0x15')]['id']&&delete _0x2719aa['body']['id'],db[_0x2fa0d4('0xa')][_0x2fa0d4('0x8')]({'where':{'id':_0x2719aa[_0x2fa0d4('0x14')]['id']}})['then'](handleEntityNotFound(_0x4ba846,null))[_0x2fa0d4('0x9')](saveUpdates(_0x2719aa[_0x2fa0d4('0x15')],null))['then'](respondWithResult(_0x4ba846,null))[_0x2fa0d4('0x1b')](handleError(_0x4ba846,null));},exports[_0x978322('0x6')]=function(_0x4d367a,_0x141954){const _0x2c9c8e=_0x978322;return db['ChatProactiveAction'][_0x2c9c8e('0x8')]({'where':{'id':_0x4d367a[_0x2c9c8e('0x14')]['id']}})['then'](handleEntityNotFound(_0x141954,null))[_0x2c9c8e('0x9')](removeEntity(_0x141954,null))[_0x2c9c8e('0x1b')](handleError(_0x141954,null));};
\ No newline at end of file