Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index 36b003b..8d72a20 100644 (file)
@@ -1 +1 @@
-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
+const a91_0x426e=['model','catch','lodash','ChatProactiveAction','send','fields','status','query','destroy','then','../../mysqldb','params','include','update','attributes','includeAll','json','api','filters','stack','length','body','create','keys','show','findOne','merge','../../components/parsers/qs','options','intersection'];(function(_0x28f3d2,_0x426e6c){const _0xb5782f=function(_0x464e71){while(--_0x464e71){_0x28f3d2['push'](_0x28f3d2['shift']());}};_0xb5782f(++_0x426e6c);}(a91_0x426e,0x1cc));const a91_0xb578=function(_0x28f3d2,_0x426e6c){_0x28f3d2=_0x28f3d2-0x0;let _0xb5782f=a91_0x426e[_0x28f3d2];return _0xb5782f;};const _0xd1606a=a91_0xb578;'use strict';const _=require(_0xd1606a('0x16')),qs=require(_0xd1606a('0x11')),logger=require('../../config/logger')(_0xd1606a('0x7')),db=require(_0xd1606a('0x0'))['db'];function respondWithResult(_0x464e71,_0x2fb416){return _0x2fb416=_0x2fb416||0xc8,function(_0x8cde27){const _0x56d6f6=a91_0xb578;if(_0x8cde27)return _0x464e71[_0x56d6f6('0x1a')](_0x2fb416)[_0x56d6f6('0x6')](_0x8cde27);};}function saveUpdates(_0xd719ba){return function(_0x1c7c8f){const _0xf88456=a91_0xb578;if(_0x1c7c8f)return _0x1c7c8f['update'](_0xd719ba)[_0xf88456('0x1d')](function(_0x1b76a6){return _0x1b76a6;});return null;};}function removeEntity(_0x110c26){return function(_0x109edf){const _0x5abedc=a91_0xb578;if(_0x109edf)return _0x109edf[_0x5abedc('0x1c')]()[_0x5abedc('0x1d')](function(){const _0x538b52=_0x5abedc;_0x110c26[_0x538b52('0x1a')](0xcc)['end']();});};}function handleEntityNotFound(_0xa79cbd){return function(_0x305aad){return!_0x305aad&&_0xa79cbd['sendStatus'](0x194),_0x305aad;};}function handleError(_0xb0e6e8,_0x2365b0){return _0x2365b0=_0x2365b0||0x1f4,function(_0x251cb1){const _0x137c2f=a91_0xb578;logger['error'](_0x251cb1[_0x137c2f('0x9')]),_0x251cb1['name']&&delete _0x251cb1['name'],_0xb0e6e8[_0x137c2f('0x1a')](_0x2365b0)[_0x137c2f('0x18')](_0x251cb1);};}exports[_0xd1606a('0xe')]=function(_0x15e765,_0x370e72){const _0x2021ac=_0xd1606a;let _0x343cbc={'raw':!![],'where':{'id':_0x15e765[_0x2021ac('0x1')]['id']}};const _0x34c0fd={};return _0x34c0fd[_0x2021ac('0x14')]=_[_0x2021ac('0xd')](db[_0x2021ac('0x17')]['rawAttributes']),_0x34c0fd['query']=_[_0x2021ac('0xd')](_0x15e765['query']),_0x34c0fd[_0x2021ac('0x8')]=_[_0x2021ac('0x13')](_0x34c0fd[_0x2021ac('0x14')],_0x34c0fd['query']),_0x343cbc[_0x2021ac('0x4')]=_[_0x2021ac('0x13')](_0x34c0fd[_0x2021ac('0x14')],qs['fields'](_0x15e765[_0x2021ac('0x1b')][_0x2021ac('0x19')])),_0x343cbc[_0x2021ac('0x4')]=_0x343cbc['attributes'][_0x2021ac('0xa')]?_0x343cbc[_0x2021ac('0x4')]:_0x34c0fd['model'],_0x15e765['query'][_0x2021ac('0x5')]&&(_0x343cbc[_0x2021ac('0x2')]=[{'all':!![]}]),_0x343cbc=_[_0x2021ac('0x10')]({},_0x343cbc,_0x15e765[_0x2021ac('0x12')]),db['ChatProactiveAction'][_0x2021ac('0xf')](_0x343cbc)[_0x2021ac('0x1d')](handleEntityNotFound(_0x370e72,null))['then'](respondWithResult(_0x370e72,null))[_0x2021ac('0x15')](handleError(_0x370e72,null));},exports[_0xd1606a('0xc')]=function(_0x3ce5cd,_0x7157e4){const _0x46a9ee=_0xd1606a;return db[_0x46a9ee('0x17')][_0x46a9ee('0xc')](_0x3ce5cd[_0x46a9ee('0xb')],{})[_0x46a9ee('0x1d')](respondWithResult(_0x7157e4,0xc9))[_0x46a9ee('0x15')](handleError(_0x7157e4,null));},exports[_0xd1606a('0x3')]=function(_0x2ea722,_0x35c93d){const _0x3369a3=_0xd1606a;return _0x2ea722[_0x3369a3('0xb')]['id']&&delete _0x2ea722[_0x3369a3('0xb')]['id'],db[_0x3369a3('0x17')][_0x3369a3('0xf')]({'where':{'id':_0x2ea722[_0x3369a3('0x1')]['id']}})[_0x3369a3('0x1d')](handleEntityNotFound(_0x35c93d,null))[_0x3369a3('0x1d')](saveUpdates(_0x2ea722[_0x3369a3('0xb')],null))['then'](respondWithResult(_0x35c93d,null))[_0x3369a3('0x15')](handleError(_0x35c93d,null));},exports[_0xd1606a('0x1c')]=function(_0x360dee,_0x1ad942){const _0x1c0170=_0xd1606a;return db[_0x1c0170('0x17')]['findOne']({'where':{'id':_0x360dee[_0x1c0170('0x1')]['id']}})['then'](handleEntityNotFound(_0x1ad942,null))[_0x1c0170('0x1d')](removeEntity(_0x1ad942,null))[_0x1c0170('0x15')](handleError(_0x1ad942,null));};
\ No newline at end of file