Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / chatProactiveAction / chatProactiveAction.controller.js
index 029c1a1..51c64fd 100644 (file)
@@ -1 +1 @@
-const a109_0x5b9b=['destroy','../../config/logger','status','query','create','end','attributes','include','intersection','show','includeAll','fields','merge','findOne','length','error','update','keys','then','body','ChatProactiveAction','model','catch','lodash','stack','params','name','filters','json','sendStatus','options'];(function(_0x3a798c,_0x4d5824){const _0x5b9b8c=function(_0x408649){while(--_0x408649){_0x3a798c['push'](_0x3a798c['shift']());}};_0x5b9b8c(++_0x4d5824);}(a109_0x5b9b,0x138));const a109_0x4086=function(_0x3a798c,_0x4d5824){_0x3a798c=_0x3a798c-0x18f;let _0x5b9b8c=a109_0x5b9b[_0x3a798c];return _0x5b9b8c;};const a109_0x56e9ad=a109_0x4086;'use strict';const _=require(a109_0x56e9ad(0x1a4)),qs=require('../../components/parsers/qs'),logger=require(a109_0x56e9ad(0x1ad))('api'),{db}=require('../../mysqldb');function respondWithResult(_0x5ad5d6,_0x15f107){return _0x15f107=_0x15f107||0xc8,function(_0x1d08dc){const _0x1cebf4=a109_0x4086;if(_0x1d08dc)return _0x5ad5d6[_0x1cebf4(0x18f)](_0x15f107)[_0x1cebf4(0x1a9)](_0x1d08dc);};}function saveUpdates(_0x38163e){return function(_0x379150){if(_0x379150)return _0x379150['update'](_0x38163e)['then'](function(_0x205a7c){return _0x205a7c;});return null;};}function removeEntity(_0x5732be){return function(_0x35a99e){if(_0x35a99e)return _0x35a99e['destroy']()['then'](function(){const _0xc22612=a109_0x4086;_0x5732be['status'](0xcc)[_0xc22612(0x192)]();});};}function handleEntityNotFound(_0x16da37){return function(_0x3981fb){const _0x481ac6=a109_0x4086;return!_0x3981fb&&_0x16da37[_0x481ac6(0x1aa)](0x194),_0x3981fb;};}function handleError(_0x3bb83f,_0x58280b){return _0x58280b=_0x58280b||0x1f4,function(_0x5e881a){const _0xace9d4=a109_0x4086;logger[_0xace9d4(0x19c)](_0x5e881a[_0xace9d4(0x1a5)]),_0x5e881a[_0xace9d4(0x1a7)]&&delete _0x5e881a[_0xace9d4(0x1a7)],_0x3bb83f[_0xace9d4(0x18f)](_0x58280b)['send'](_0x5e881a);};}exports[a109_0x56e9ad(0x196)]=function(_0x591b8a,_0x3aa83e){const _0x2baf2f=a109_0x56e9ad;let _0xe18c35={'raw':!![],'where':{'id':_0x591b8a[_0x2baf2f(0x1a6)]['id']}};const _0x552713={};return _0x552713['model']=_[_0x2baf2f(0x19e)](db['ChatProactiveAction']['rawAttributes']),_0x552713[_0x2baf2f(0x190)]=_[_0x2baf2f(0x19e)](_0x591b8a[_0x2baf2f(0x190)]),_0x552713[_0x2baf2f(0x1a8)]=_[_0x2baf2f(0x195)](_0x552713[_0x2baf2f(0x1a2)],_0x552713['query']),_0xe18c35[_0x2baf2f(0x193)]=_[_0x2baf2f(0x195)](_0x552713[_0x2baf2f(0x1a2)],qs[_0x2baf2f(0x198)](_0x591b8a[_0x2baf2f(0x190)][_0x2baf2f(0x198)])),_0xe18c35[_0x2baf2f(0x193)]=_0xe18c35[_0x2baf2f(0x193)][_0x2baf2f(0x19b)]?_0xe18c35[_0x2baf2f(0x193)]:_0x552713['model'],_0x591b8a['query'][_0x2baf2f(0x197)]&&(_0xe18c35[_0x2baf2f(0x194)]=[{'all':!![]}]),_0xe18c35=_[_0x2baf2f(0x199)]({},_0xe18c35,_0x591b8a[_0x2baf2f(0x1ab)]),db[_0x2baf2f(0x1a1)][_0x2baf2f(0x19a)](_0xe18c35)[_0x2baf2f(0x19f)](handleEntityNotFound(_0x3aa83e,null))[_0x2baf2f(0x19f)](respondWithResult(_0x3aa83e,null))[_0x2baf2f(0x1a3)](handleError(_0x3aa83e,null));},exports[a109_0x56e9ad(0x191)]=function(_0xc04bb5,_0x303aec){const _0x15273e=a109_0x56e9ad;return db[_0x15273e(0x1a1)]['create'](_0xc04bb5[_0x15273e(0x1a0)],{})[_0x15273e(0x19f)](respondWithResult(_0x303aec,0xc9))[_0x15273e(0x1a3)](handleError(_0x303aec,null));},exports[a109_0x56e9ad(0x19d)]=function(_0x57fb9a,_0xc730b6){const _0x39c641=a109_0x56e9ad;return _0x57fb9a[_0x39c641(0x1a0)]['id']&&delete _0x57fb9a[_0x39c641(0x1a0)]['id'],db['ChatProactiveAction'][_0x39c641(0x19a)]({'where':{'id':_0x57fb9a['params']['id']}})[_0x39c641(0x19f)](handleEntityNotFound(_0xc730b6,null))['then'](saveUpdates(_0x57fb9a[_0x39c641(0x1a0)],null))['then'](respondWithResult(_0xc730b6,null))[_0x39c641(0x1a3)](handleError(_0xc730b6,null));},exports[a109_0x56e9ad(0x1ac)]=function(_0x401f14,_0x402924){const _0x1990c7=a109_0x56e9ad;return db[_0x1990c7(0x1a1)][_0x1990c7(0x19a)]({'where':{'id':_0x401f14[_0x1990c7(0x1a6)]['id']}})['then'](handleEntityNotFound(_0x402924,null))['then'](removeEntity(_0x402924,null))[_0x1990c7(0x1a3)](handleError(_0x402924,null));};
\ No newline at end of file
+'use strict';const a109_0x129f=['catch','327818BHkiye','@components/parsers/qs','name','update','fields','send','630500NFxxnH','merge','query','model','filters','20432TOTsza','findOne','531568jKwNtC','@config/logger','161xYXsaI','create','keys','then','status','includeAll','1nSsKfh','api','7nulrvB','end','destroy','161829USuIDY','ChatProactiveAction','@mysqldb','sendStatus','include','attributes','intersection','options','params','lodash','body','show','1131239DddySR','1THuOqs','1238023JfJRaf','error','stack'];const a109_0x5d22=function(_0x142cec,_0x4b2f6b){_0x142cec=_0x142cec-0x13a;let _0x129f28=a109_0x129f[_0x142cec];return _0x129f28;};const a109_0x4ff4fd=a109_0x5d22;(function(_0x38413c,_0xcb46af){const _0x1c7bf3=a109_0x5d22;while(!![]){try{const _0x1746fa=parseInt(_0x1c7bf3(0x148))*parseInt(_0x1c7bf3(0x159))+parseInt(_0x1c7bf3(0x165))+parseInt(_0x1c7bf3(0x15b))*parseInt(_0x1c7bf3(0x15a))+-parseInt(_0x1c7bf3(0x14d))*-parseInt(_0x1c7bf3(0x14a))+parseInt(_0x1c7bf3(0x15f))+-parseInt(_0x1c7bf3(0x140))+parseInt(_0x1c7bf3(0x142))*-parseInt(_0x1c7bf3(0x13e));if(_0x1746fa===_0xcb46af)break;else _0x38413c['push'](_0x38413c['shift']());}catch(_0x342fb1){_0x38413c['push'](_0x38413c['shift']());}}}(a109_0x129f,0x9c11f));const _=require(a109_0x4ff4fd(0x156)),qs=require(a109_0x4ff4fd(0x160)),logger=require(a109_0x4ff4fd(0x141))(a109_0x4ff4fd(0x149)),{db}=require(a109_0x4ff4fd(0x14f));function respondWithResult(_0xa2736e,_0x5e0b9f){return _0x5e0b9f=_0x5e0b9f||0xc8,function(_0x14b09d){const _0x3042cf=a109_0x5d22;if(_0x14b09d)return _0xa2736e[_0x3042cf(0x146)](_0x5e0b9f)['json'](_0x14b09d);};}function saveUpdates(_0x42a88f){return function(_0x186678){const _0x5e8f48=a109_0x5d22;if(_0x186678)return _0x186678[_0x5e8f48(0x162)](_0x42a88f)['then'](function(_0x48ce22){return _0x48ce22;});return null;};}function removeEntity(_0x1b3ebe){return function(_0x5893a5){const _0x12fafc=a109_0x5d22;if(_0x5893a5)return _0x5893a5[_0x12fafc(0x14c)]()[_0x12fafc(0x145)](function(){const _0x4d924d=_0x12fafc;_0x1b3ebe[_0x4d924d(0x146)](0xcc)[_0x4d924d(0x14b)]();});};}function handleEntityNotFound(_0x3413c2){return function(_0x1d6993){const _0x516d65=a109_0x5d22;return!_0x1d6993&&_0x3413c2[_0x516d65(0x150)](0x194),_0x1d6993;};}function handleError(_0x4df218,_0x52c92f){return _0x52c92f=_0x52c92f||0x1f4,function(_0x4d2ff3){const _0x5e2f4a=a109_0x5d22;logger[_0x5e2f4a(0x15c)](_0x4d2ff3[_0x5e2f4a(0x15d)]),_0x4d2ff3[_0x5e2f4a(0x161)]&&delete _0x4d2ff3[_0x5e2f4a(0x161)],_0x4df218[_0x5e2f4a(0x146)](_0x52c92f)[_0x5e2f4a(0x164)](_0x4d2ff3);};}exports[a109_0x4ff4fd(0x158)]=function(_0x32f909,_0x457766){const _0x456047=a109_0x4ff4fd;let _0x87757={'raw':!![],'where':{'id':_0x32f909[_0x456047(0x155)]['id']}};const _0x2d0fe0={};return _0x2d0fe0['model']=_['keys'](db['ChatProactiveAction']['rawAttributes']),_0x2d0fe0[_0x456047(0x13b)]=_[_0x456047(0x144)](_0x32f909[_0x456047(0x13b)]),_0x2d0fe0[_0x456047(0x13d)]=_['intersection'](_0x2d0fe0[_0x456047(0x13c)],_0x2d0fe0[_0x456047(0x13b)]),_0x87757[_0x456047(0x152)]=_[_0x456047(0x153)](_0x2d0fe0[_0x456047(0x13c)],qs[_0x456047(0x163)](_0x32f909['query'][_0x456047(0x163)])),_0x87757[_0x456047(0x152)]=_0x87757[_0x456047(0x152)]['length']?_0x87757[_0x456047(0x152)]:_0x2d0fe0['model'],_0x32f909[_0x456047(0x13b)][_0x456047(0x147)]&&(_0x87757[_0x456047(0x151)]=[{'all':!![]}]),_0x87757=_[_0x456047(0x13a)]({},_0x87757,_0x32f909[_0x456047(0x154)]),db[_0x456047(0x14e)][_0x456047(0x13f)](_0x87757)['then'](handleEntityNotFound(_0x457766,null))[_0x456047(0x145)](respondWithResult(_0x457766,null))[_0x456047(0x15e)](handleError(_0x457766,null));},exports[a109_0x4ff4fd(0x143)]=function(_0xa5f1de,_0x21be4c){const _0x2c2d05=a109_0x4ff4fd;return db[_0x2c2d05(0x14e)][_0x2c2d05(0x143)](_0xa5f1de['body'],{})[_0x2c2d05(0x145)](respondWithResult(_0x21be4c,0xc9))[_0x2c2d05(0x15e)](handleError(_0x21be4c,null));},exports[a109_0x4ff4fd(0x162)]=function(_0x5a51e2,_0x461865){const _0x4d0270=a109_0x4ff4fd;return _0x5a51e2[_0x4d0270(0x157)]['id']&&delete _0x5a51e2[_0x4d0270(0x157)]['id'],db['ChatProactiveAction'][_0x4d0270(0x13f)]({'where':{'id':_0x5a51e2[_0x4d0270(0x155)]['id']}})[_0x4d0270(0x145)](handleEntityNotFound(_0x461865,null))[_0x4d0270(0x145)](saveUpdates(_0x5a51e2[_0x4d0270(0x157)],null))[_0x4d0270(0x145)](respondWithResult(_0x461865,null))[_0x4d0270(0x15e)](handleError(_0x461865,null));},exports[a109_0x4ff4fd(0x14c)]=function(_0x42e53d,_0x26e410){const _0x299eab=a109_0x4ff4fd;return db['ChatProactiveAction'][_0x299eab(0x13f)]({'where':{'id':_0x42e53d['params']['id']}})[_0x299eab(0x145)](handleEntityNotFound(_0x26e410,null))[_0x299eab(0x145)](removeEntity(_0x26e410,null))['catch'](handleError(_0x26e410,null));};
\ No newline at end of file