Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index 97ae9b7..96ea8f8 100644 (file)
@@ -1 +1 @@
-const a91_0x54c6=['../../mysqldb','model','catch','error','sendStatus','json','include','status','lodash','then','merge','body','show','update','ChatProactiveAction','keys','query','send','attributes','rawAttributes','end','fields','filters','findOne','create','name','../../config/logger','options','params','includeAll','length'];(function(_0x346629,_0x54c631){const _0x5735ea=function(_0x3105ce){while(--_0x3105ce){_0x346629['push'](_0x346629['shift']());}};_0x5735ea(++_0x54c631);}(a91_0x54c6,0x137));const a91_0x5735=function(_0x346629,_0x54c631){_0x346629=_0x346629-0x0;let _0x5735ea=a91_0x54c6[_0x346629];return _0x5735ea;};const _0x137793=a91_0x5735;'use strict';const _=require(_0x137793('0x7')),qs=require('../../components/parsers/qs'),logger=require(_0x137793('0x19'))('api'),db=require(_0x137793('0x1e'))['db'];function respondWithResult(_0x3105ce,_0x2380df){return _0x2380df=_0x2380df||0xc8,function(_0x4c198f){const _0x4d1070=a91_0x5735;if(_0x4c198f)return _0x3105ce[_0x4d1070('0x6')](_0x2380df)[_0x4d1070('0x4')](_0x4c198f);};}function saveUpdates(_0x2f2fea){return function(_0x3af400){const _0x4b084c=a91_0x5735;if(_0x3af400)return _0x3af400[_0x4b084c('0xc')](_0x2f2fea)[_0x4b084c('0x8')](function(_0x35a42c){return _0x35a42c;});return null;};}function removeEntity(_0x404cfe){return function(_0x5ef57e){const _0xc19948=a91_0x5735;if(_0x5ef57e)return _0x5ef57e['destroy']()[_0xc19948('0x8')](function(){const _0x30c0a8=_0xc19948;_0x404cfe[_0x30c0a8('0x6')](0xcc)[_0x30c0a8('0x13')]();});};}function handleEntityNotFound(_0x135f71){return function(_0x1a90c8){const _0x4bdac2=a91_0x5735;return!_0x1a90c8&&_0x135f71[_0x4bdac2('0x3')](0x194),_0x1a90c8;};}function handleError(_0x4ed2c7,_0x165cfd){return _0x165cfd=_0x165cfd||0x1f4,function(_0x138932){const _0x4097bf=a91_0x5735;logger[_0x4097bf('0x2')](_0x138932['stack']),_0x138932['name']&&delete _0x138932[_0x4097bf('0x18')],_0x4ed2c7[_0x4097bf('0x6')](_0x165cfd)[_0x4097bf('0x10')](_0x138932);};}exports[_0x137793('0xb')]=function(_0x48bf08,_0x17f890){const _0x5b3ad7=_0x137793;let _0x2123af={'raw':!![],'where':{'id':_0x48bf08[_0x5b3ad7('0x1b')]['id']}};const _0x417838={};return _0x417838[_0x5b3ad7('0x0')]=_[_0x5b3ad7('0xe')](db[_0x5b3ad7('0xd')][_0x5b3ad7('0x12')]),_0x417838[_0x5b3ad7('0xf')]=_[_0x5b3ad7('0xe')](_0x48bf08['query']),_0x417838[_0x5b3ad7('0x15')]=_['intersection'](_0x417838[_0x5b3ad7('0x0')],_0x417838['query']),_0x2123af['attributes']=_['intersection'](_0x417838[_0x5b3ad7('0x0')],qs[_0x5b3ad7('0x14')](_0x48bf08[_0x5b3ad7('0xf')]['fields'])),_0x2123af['attributes']=_0x2123af[_0x5b3ad7('0x11')][_0x5b3ad7('0x1d')]?_0x2123af[_0x5b3ad7('0x11')]:_0x417838[_0x5b3ad7('0x0')],_0x48bf08['query'][_0x5b3ad7('0x1c')]&&(_0x2123af[_0x5b3ad7('0x5')]=[{'all':!![]}]),_0x2123af=_[_0x5b3ad7('0x9')]({},_0x2123af,_0x48bf08[_0x5b3ad7('0x1a')]),db[_0x5b3ad7('0xd')][_0x5b3ad7('0x16')](_0x2123af)['then'](handleEntityNotFound(_0x17f890,null))['then'](respondWithResult(_0x17f890,null))[_0x5b3ad7('0x1')](handleError(_0x17f890,null));},exports[_0x137793('0x17')]=function(_0x507c4a,_0x373719){const _0x471d6f=_0x137793;return db[_0x471d6f('0xd')]['create'](_0x507c4a['body'],{})[_0x471d6f('0x8')](respondWithResult(_0x373719,0xc9))[_0x471d6f('0x1')](handleError(_0x373719,null));},exports[_0x137793('0xc')]=function(_0x5e0998,_0x283f4b){const _0x121a76=_0x137793;return _0x5e0998[_0x121a76('0xa')]['id']&&delete _0x5e0998['body']['id'],db[_0x121a76('0xd')]['findOne']({'where':{'id':_0x5e0998[_0x121a76('0x1b')]['id']}})['then'](handleEntityNotFound(_0x283f4b,null))[_0x121a76('0x8')](saveUpdates(_0x5e0998['body'],null))[_0x121a76('0x8')](respondWithResult(_0x283f4b,null))[_0x121a76('0x1')](handleError(_0x283f4b,null));},exports['destroy']=function(_0x14dfd8,_0x3b766f){const _0x2a7b01=_0x137793;return db[_0x2a7b01('0xd')]['findOne']({'where':{'id':_0x14dfd8['params']['id']}})[_0x2a7b01('0x8')](handleEntityNotFound(_0x3b766f,null))[_0x2a7b01('0x8')](removeEntity(_0x3b766f,null))[_0x2a7b01('0x1')](handleError(_0x3b766f,null));};
\ No newline at end of file
+const a91_0x479c=['lodash','sendStatus','error','attributes','intersection','fields','merge','end','update','send','include','destroy','stack','../../components/parsers/qs','../../config/logger','body','params','catch','json','../../mysqldb','show','name','keys','includeAll','length','query','filters','ChatProactiveAction','status','then','model','findOne'];(function(_0x4b602a,_0x479c31){const _0x26e097=function(_0x3acbdf){while(--_0x3acbdf){_0x4b602a['push'](_0x4b602a['shift']());}};_0x26e097(++_0x479c31);}(a91_0x479c,0x18c));const a91_0x26e0=function(_0x4b602a,_0x479c31){_0x4b602a=_0x4b602a-0x0;let _0x26e097=a91_0x479c[_0x4b602a];return _0x26e097;};const _0x26bb5f=a91_0x26e0;'use strict';const _=require(_0x26bb5f('0x14')),qs=require(_0x26bb5f('0x1')),logger=require(_0x26bb5f('0x2'))('api'),db=require(_0x26bb5f('0x7'))['db'];function respondWithResult(_0x3acbdf,_0x2b4718){return _0x2b4718=_0x2b4718||0xc8,function(_0x105338){const _0x12e6c8=a91_0x26e0;if(_0x105338)return _0x3acbdf['status'](_0x2b4718)[_0x12e6c8('0x6')](_0x105338);};}function saveUpdates(_0x2004e6){return function(_0x3b5383){if(_0x3b5383)return _0x3b5383['update'](_0x2004e6)['then'](function(_0x30cdc4){return _0x30cdc4;});return null;};}function removeEntity(_0x4fb483){return function(_0x2257ba){const _0x4f040b=a91_0x26e0;if(_0x2257ba)return _0x2257ba[_0x4f040b('0x1f')]()[_0x4f040b('0x11')](function(){const _0x1dcc37=_0x4f040b;_0x4fb483[_0x1dcc37('0x10')](0xcc)[_0x1dcc37('0x1b')]();});};}function handleEntityNotFound(_0xf716e7){return function(_0x2e73dc){const _0xa893f9=a91_0x26e0;return!_0x2e73dc&&_0xf716e7[_0xa893f9('0x15')](0x194),_0x2e73dc;};}function handleError(_0x73bc3c,_0x156fdb){return _0x156fdb=_0x156fdb||0x1f4,function(_0x1bf233){const _0x58210c=a91_0x26e0;logger[_0x58210c('0x16')](_0x1bf233[_0x58210c('0x0')]),_0x1bf233['name']&&delete _0x1bf233[_0x58210c('0x9')],_0x73bc3c[_0x58210c('0x10')](_0x156fdb)[_0x58210c('0x1d')](_0x1bf233);};}exports[_0x26bb5f('0x8')]=function(_0x484d6f,_0x2c4d13){const _0x152e98=_0x26bb5f;let _0x2defe2={'raw':!![],'where':{'id':_0x484d6f[_0x152e98('0x4')]['id']}};const _0x3d515e={};return _0x3d515e[_0x152e98('0x12')]=_[_0x152e98('0xa')](db[_0x152e98('0xf')]['rawAttributes']),_0x3d515e[_0x152e98('0xd')]=_[_0x152e98('0xa')](_0x484d6f['query']),_0x3d515e[_0x152e98('0xe')]=_[_0x152e98('0x18')](_0x3d515e['model'],_0x3d515e[_0x152e98('0xd')]),_0x2defe2[_0x152e98('0x17')]=_[_0x152e98('0x18')](_0x3d515e[_0x152e98('0x12')],qs[_0x152e98('0x19')](_0x484d6f[_0x152e98('0xd')]['fields'])),_0x2defe2[_0x152e98('0x17')]=_0x2defe2[_0x152e98('0x17')][_0x152e98('0xc')]?_0x2defe2['attributes']:_0x3d515e[_0x152e98('0x12')],_0x484d6f[_0x152e98('0xd')][_0x152e98('0xb')]&&(_0x2defe2[_0x152e98('0x1e')]=[{'all':!![]}]),_0x2defe2=_[_0x152e98('0x1a')]({},_0x2defe2,_0x484d6f['options']),db[_0x152e98('0xf')][_0x152e98('0x13')](_0x2defe2)[_0x152e98('0x11')](handleEntityNotFound(_0x2c4d13,null))['then'](respondWithResult(_0x2c4d13,null))[_0x152e98('0x5')](handleError(_0x2c4d13,null));},exports['create']=function(_0x5651c6,_0x288da3){const _0x57a67c=_0x26bb5f;return db[_0x57a67c('0xf')]['create'](_0x5651c6[_0x57a67c('0x3')],{})[_0x57a67c('0x11')](respondWithResult(_0x288da3,0xc9))[_0x57a67c('0x5')](handleError(_0x288da3,null));},exports[_0x26bb5f('0x1c')]=function(_0x488a5e,_0x535d2e){const _0x34a8d7=_0x26bb5f;return _0x488a5e[_0x34a8d7('0x3')]['id']&&delete _0x488a5e[_0x34a8d7('0x3')]['id'],db[_0x34a8d7('0xf')][_0x34a8d7('0x13')]({'where':{'id':_0x488a5e[_0x34a8d7('0x4')]['id']}})[_0x34a8d7('0x11')](handleEntityNotFound(_0x535d2e,null))[_0x34a8d7('0x11')](saveUpdates(_0x488a5e['body'],null))[_0x34a8d7('0x11')](respondWithResult(_0x535d2e,null))[_0x34a8d7('0x5')](handleError(_0x535d2e,null));},exports[_0x26bb5f('0x1f')]=function(_0x2e2c83,_0x44bfb8){const _0x1ab4ef=_0x26bb5f;return db[_0x1ab4ef('0xf')]['findOne']({'where':{'id':_0x2e2c83[_0x1ab4ef('0x4')]['id']}})[_0x1ab4ef('0x11')](handleEntityNotFound(_0x44bfb8,null))[_0x1ab4ef('0x11')](removeEntity(_0x44bfb8,null))[_0x1ab4ef('0x5')](handleError(_0x44bfb8,null));};
\ No newline at end of file