Built motion from commit 8dca541896b0ff92bb88a36cc13f4f385b593b4b. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index 04c446c..36b003b 100644 (file)
@@ -1 +1 @@
-const a91_0x2bda=['fields','body','api','json','findOne','merge','update','end','keys','destroy','includeAll','attributes','then','query','include','stack','model','send','params','ChatProactiveAction','options','catch','../../config/logger','filters','../../components/parsers/qs','sendStatus','../../mysqldb','intersection','status','length'];(function(_0x54f70e,_0x2bda8c){const _0x55249e=function(_0x3d35a4){while(--_0x3d35a4){_0x54f70e['push'](_0x54f70e['shift']());}};_0x55249e(++_0x2bda8c);}(a91_0x2bda,0x180));const a91_0x5524=function(_0x54f70e,_0x2bda8c){_0x54f70e=_0x54f70e-0x0;let _0x55249e=a91_0x2bda[_0x54f70e];return _0x55249e;};const _0x4577b6=a91_0x5524;'use strict';const _=require('lodash'),qs=require(_0x4577b6('0x0')),logger=require(_0x4577b6('0x1c'))(_0x4577b6('0x8')),db=require(_0x4577b6('0x2'))['db'];function respondWithResult(_0x3d35a4,_0x273fa4){return _0x273fa4=_0x273fa4||0xc8,function(_0x46a06d){const _0x45c17b=a91_0x5524;if(_0x46a06d)return _0x3d35a4[_0x45c17b('0x4')](_0x273fa4)[_0x45c17b('0x9')](_0x46a06d);};}function saveUpdates(_0x2d61fb){return function(_0x5a6f6e){if(_0x5a6f6e)return _0x5a6f6e['update'](_0x2d61fb)['then'](function(_0x359e8c){return _0x359e8c;});return null;};}function removeEntity(_0x30a04b){return function(_0x5d7621){const _0x1e164f=a91_0x5524;if(_0x5d7621)return _0x5d7621[_0x1e164f('0xf')]()['then'](function(){const _0x1b4132=_0x1e164f;_0x30a04b['status'](0xcc)[_0x1b4132('0xd')]();});};}function handleEntityNotFound(_0x2bfd35){return function(_0x4a5343){const _0x4c29b9=a91_0x5524;return!_0x4a5343&&_0x2bfd35[_0x4c29b9('0x1')](0x194),_0x4a5343;};}function handleError(_0x58df8f,_0xb54201){return _0xb54201=_0xb54201||0x1f4,function(_0x4ca084){const _0x3fcea1=a91_0x5524;logger['error'](_0x4ca084[_0x3fcea1('0x15')]),_0x4ca084['name']&&delete _0x4ca084['name'],_0x58df8f['status'](_0xb54201)[_0x3fcea1('0x17')](_0x4ca084);};}exports['show']=function(_0x4967af,_0x3b2fae){const _0x251c6e=_0x4577b6;let _0x4b014a={'raw':!![],'where':{'id':_0x4967af[_0x251c6e('0x18')]['id']}};const _0x231af7={};return _0x231af7[_0x251c6e('0x16')]=_[_0x251c6e('0xe')](db[_0x251c6e('0x19')]['rawAttributes']),_0x231af7[_0x251c6e('0x13')]=_[_0x251c6e('0xe')](_0x4967af[_0x251c6e('0x13')]),_0x231af7[_0x251c6e('0x1d')]=_[_0x251c6e('0x3')](_0x231af7['model'],_0x231af7[_0x251c6e('0x13')]),_0x4b014a[_0x251c6e('0x11')]=_[_0x251c6e('0x3')](_0x231af7[_0x251c6e('0x16')],qs[_0x251c6e('0x6')](_0x4967af[_0x251c6e('0x13')]['fields'])),_0x4b014a[_0x251c6e('0x11')]=_0x4b014a[_0x251c6e('0x11')][_0x251c6e('0x5')]?_0x4b014a[_0x251c6e('0x11')]:_0x231af7[_0x251c6e('0x16')],_0x4967af[_0x251c6e('0x13')][_0x251c6e('0x10')]&&(_0x4b014a[_0x251c6e('0x14')]=[{'all':!![]}]),_0x4b014a=_[_0x251c6e('0xb')]({},_0x4b014a,_0x4967af[_0x251c6e('0x1a')]),db['ChatProactiveAction'][_0x251c6e('0xa')](_0x4b014a)[_0x251c6e('0x12')](handleEntityNotFound(_0x3b2fae,null))[_0x251c6e('0x12')](respondWithResult(_0x3b2fae,null))[_0x251c6e('0x1b')](handleError(_0x3b2fae,null));},exports['create']=function(_0x1544da,_0x369681){const _0x5d731e=_0x4577b6;return db[_0x5d731e('0x19')]['create'](_0x1544da[_0x5d731e('0x7')],{})[_0x5d731e('0x12')](respondWithResult(_0x369681,0xc9))[_0x5d731e('0x1b')](handleError(_0x369681,null));},exports[_0x4577b6('0xc')]=function(_0x51b481,_0x19b6f5){const _0x3bf9f9=_0x4577b6;return _0x51b481[_0x3bf9f9('0x7')]['id']&&delete _0x51b481['body']['id'],db[_0x3bf9f9('0x19')][_0x3bf9f9('0xa')]({'where':{'id':_0x51b481[_0x3bf9f9('0x18')]['id']}})[_0x3bf9f9('0x12')](handleEntityNotFound(_0x19b6f5,null))[_0x3bf9f9('0x12')](saveUpdates(_0x51b481['body'],null))['then'](respondWithResult(_0x19b6f5,null))[_0x3bf9f9('0x1b')](handleError(_0x19b6f5,null));},exports[_0x4577b6('0xf')]=function(_0x1a8425,_0x36c3f6){const _0x47161f=_0x4577b6;return db[_0x47161f('0x19')][_0x47161f('0xa')]({'where':{'id':_0x1a8425['params']['id']}})[_0x47161f('0x12')](handleEntityNotFound(_0x36c3f6,null))[_0x47161f('0x12')](removeEntity(_0x36c3f6,null))['catch'](handleError(_0x36c3f6,null));};
\ No newline at end of file
+const a91_0x39d1=['status','name','filters','../../mysqldb','../../config/logger','body','include','length','model','sendStatus','show','keys','findOne','intersection','query','update','options','destroy','error','../../components/parsers/qs','catch','params','create','ChatProactiveAction','api','attributes','includeAll','merge','lodash','then','fields','json'];(function(_0x509011,_0x39d1e0){const _0x33b34a=function(_0x30de8c){while(--_0x30de8c){_0x509011['push'](_0x509011['shift']());}};_0x33b34a(++_0x39d1e0);}(a91_0x39d1,0x16b));const a91_0x33b3=function(_0x509011,_0x39d1e0){_0x509011=_0x509011-0x0;let _0x33b34a=a91_0x39d1[_0x509011];return _0x33b34a;};const _0x520013=a91_0x33b3;'use strict';const _=require(_0x520013('0x11')),qs=require(_0x520013('0x8')),logger=require(_0x520013('0x19'))(_0x520013('0xd')),db=require(_0x520013('0x18'))['db'];function respondWithResult(_0x30de8c,_0x3292e9){return _0x3292e9=_0x3292e9||0xc8,function(_0xfcaba7){const _0xe7adee=a91_0x33b3;if(_0xfcaba7)return _0x30de8c['status'](_0x3292e9)[_0xe7adee('0x14')](_0xfcaba7);};}function saveUpdates(_0x53a0c5){return function(_0xc3f0c6){const _0x3cc919=a91_0x33b3;if(_0xc3f0c6)return _0xc3f0c6[_0x3cc919('0x4')](_0x53a0c5)[_0x3cc919('0x12')](function(_0x5bee66){return _0x5bee66;});return null;};}function removeEntity(_0x153832){return function(_0x18014f){const _0x44e774=a91_0x33b3;if(_0x18014f)return _0x18014f[_0x44e774('0x6')]()[_0x44e774('0x12')](function(){const _0x2685f4=_0x44e774;_0x153832[_0x2685f4('0x15')](0xcc)['end']();});};}function handleEntityNotFound(_0x148250){return function(_0x256039){const _0x23a5a4=a91_0x33b3;return!_0x256039&&_0x148250[_0x23a5a4('0x1e')](0x194),_0x256039;};}function handleError(_0x5c79cc,_0x165c9d){return _0x165c9d=_0x165c9d||0x1f4,function(_0x5191ec){const _0x1c2619=a91_0x33b3;logger[_0x1c2619('0x7')](_0x5191ec['stack']),_0x5191ec[_0x1c2619('0x16')]&&delete _0x5191ec[_0x1c2619('0x16')],_0x5c79cc[_0x1c2619('0x15')](_0x165c9d)['send'](_0x5191ec);};}exports[_0x520013('0x1f')]=function(_0x148783,_0x4d8210){const _0x6223c3=_0x520013;let _0x3fba50={'raw':!![],'where':{'id':_0x148783[_0x6223c3('0xa')]['id']}};const _0xf518be={};return _0xf518be['model']=_['keys'](db[_0x6223c3('0xc')]['rawAttributes']),_0xf518be['query']=_[_0x6223c3('0x0')](_0x148783[_0x6223c3('0x3')]),_0xf518be[_0x6223c3('0x17')]=_[_0x6223c3('0x2')](_0xf518be[_0x6223c3('0x1d')],_0xf518be[_0x6223c3('0x3')]),_0x3fba50[_0x6223c3('0xe')]=_[_0x6223c3('0x2')](_0xf518be[_0x6223c3('0x1d')],qs[_0x6223c3('0x13')](_0x148783[_0x6223c3('0x3')][_0x6223c3('0x13')])),_0x3fba50[_0x6223c3('0xe')]=_0x3fba50[_0x6223c3('0xe')][_0x6223c3('0x1c')]?_0x3fba50[_0x6223c3('0xe')]:_0xf518be[_0x6223c3('0x1d')],_0x148783[_0x6223c3('0x3')][_0x6223c3('0xf')]&&(_0x3fba50[_0x6223c3('0x1b')]=[{'all':!![]}]),_0x3fba50=_[_0x6223c3('0x10')]({},_0x3fba50,_0x148783[_0x6223c3('0x5')]),db[_0x6223c3('0xc')]['findOne'](_0x3fba50)[_0x6223c3('0x12')](handleEntityNotFound(_0x4d8210,null))['then'](respondWithResult(_0x4d8210,null))[_0x6223c3('0x9')](handleError(_0x4d8210,null));},exports[_0x520013('0xb')]=function(_0x23324a,_0x2bccae){const _0x3847a2=_0x520013;return db[_0x3847a2('0xc')][_0x3847a2('0xb')](_0x23324a[_0x3847a2('0x1a')],{})[_0x3847a2('0x12')](respondWithResult(_0x2bccae,0xc9))[_0x3847a2('0x9')](handleError(_0x2bccae,null));},exports[_0x520013('0x4')]=function(_0x47f662,_0x3eefc7){const _0x2fdc38=_0x520013;return _0x47f662[_0x2fdc38('0x1a')]['id']&&delete _0x47f662[_0x2fdc38('0x1a')]['id'],db[_0x2fdc38('0xc')][_0x2fdc38('0x1')]({'where':{'id':_0x47f662[_0x2fdc38('0xa')]['id']}})[_0x2fdc38('0x12')](handleEntityNotFound(_0x3eefc7,null))['then'](saveUpdates(_0x47f662[_0x2fdc38('0x1a')],null))['then'](respondWithResult(_0x3eefc7,null))['catch'](handleError(_0x3eefc7,null));},exports[_0x520013('0x6')]=function(_0x5d9549,_0x5a7ff1){const _0x28bcbe=_0x520013;return db[_0x28bcbe('0xc')][_0x28bcbe('0x1')]({'where':{'id':_0x5d9549['params']['id']}})[_0x28bcbe('0x12')](handleEntityNotFound(_0x5a7ff1,null))[_0x28bcbe('0x12')](removeEntity(_0x5a7ff1,null))[_0x28bcbe('0x9')](handleError(_0x5a7ff1,null));};
\ No newline at end of file