Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / chatApplication / chatApplication.controller.js
index b196f8f..3e583f7 100644 (file)
@@ -1 +1 @@
-const a55_0x1d56=['status','intersection','../../mysqldb','update','send','attributes','catch','length','keys','merge','ChatApplication','sendStatus','body','findOne','api','model','filters','name','../../config/logger','query','stack','destroy','then','end','params','options'];(function(_0x4944bf,_0x1d56b1){const _0x38859a=function(_0x119f76){while(--_0x119f76){_0x4944bf['push'](_0x4944bf['shift']());}};_0x38859a(++_0x1d56b1);}(a55_0x1d56,0x183));const a55_0x3885=function(_0x4944bf,_0x1d56b1){_0x4944bf=_0x4944bf-0x0;let _0x38859a=a55_0x1d56[_0x4944bf];return _0x38859a;};const _0x19411f=a55_0x3885;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(_0x19411f('0x15'))(_0x19411f('0x11')),db=require(_0x19411f('0x5'))['db'];function respondWithResult(_0x119f76,_0x4f17e0){return _0x4f17e0=_0x4f17e0||0xc8,function(_0x5ef66c){const _0x2a1241=a55_0x3885;if(_0x5ef66c)return _0x119f76[_0x2a1241('0x3')](_0x4f17e0)['json'](_0x5ef66c);};}function saveUpdates(_0x29e3ea){return function(_0x219773){const _0x5050dc=a55_0x3885;if(_0x219773)return _0x219773[_0x5050dc('0x6')](_0x29e3ea)[_0x5050dc('0x19')](function(_0x53b536){return _0x53b536;});return null;};}function removeEntity(_0x1fbf24){return function(_0x4c1bfd){const _0x107281=a55_0x3885;if(_0x4c1bfd)return _0x4c1bfd[_0x107281('0x18')]()[_0x107281('0x19')](function(){const _0x43236c=_0x107281;_0x1fbf24[_0x43236c('0x3')](0xcc)[_0x43236c('0x0')]();});};}function handleEntityNotFound(_0x454c28){return function(_0x2e15ef){const _0x53fd3f=a55_0x3885;return!_0x2e15ef&&_0x454c28[_0x53fd3f('0xe')](0x194),_0x2e15ef;};}function handleError(_0x1312f8,_0x1cca6c){return _0x1cca6c=_0x1cca6c||0x1f4,function(_0x352709){const _0x1e7fe8=a55_0x3885;logger['error'](_0x352709[_0x1e7fe8('0x17')]),_0x352709[_0x1e7fe8('0x14')]&&delete _0x352709[_0x1e7fe8('0x14')],_0x1312f8[_0x1e7fe8('0x3')](_0x1cca6c)[_0x1e7fe8('0x7')](_0x352709);};}exports['show']=function(_0x3bffb2,_0x504fed){const _0x31e792=_0x19411f;let _0xce33cd={'raw':!![],'where':{'id':_0x3bffb2[_0x31e792('0x1')]['id']}};const _0x3f9268={};return _0x3f9268[_0x31e792('0x12')]=_['keys'](db['ChatApplication']['rawAttributes']),_0x3f9268[_0x31e792('0x16')]=_[_0x31e792('0xb')](_0x3bffb2[_0x31e792('0x16')]),_0x3f9268[_0x31e792('0x13')]=_[_0x31e792('0x4')](_0x3f9268[_0x31e792('0x12')],_0x3f9268[_0x31e792('0x16')]),_0xce33cd[_0x31e792('0x8')]=_[_0x31e792('0x4')](_0x3f9268[_0x31e792('0x12')],qs['fields'](_0x3bffb2[_0x31e792('0x16')]['fields'])),_0xce33cd['attributes']=_0xce33cd[_0x31e792('0x8')][_0x31e792('0xa')]?_0xce33cd[_0x31e792('0x8')]:_0x3f9268[_0x31e792('0x12')],_0x3bffb2[_0x31e792('0x16')]['includeAll']&&(_0xce33cd['include']=[{'all':!![]}]),_0xce33cd=_[_0x31e792('0xc')]({},_0xce33cd,_0x3bffb2[_0x31e792('0x2')]),db[_0x31e792('0xd')][_0x31e792('0x10')](_0xce33cd)[_0x31e792('0x19')](handleEntityNotFound(_0x504fed,null))[_0x31e792('0x19')](respondWithResult(_0x504fed,null))[_0x31e792('0x9')](handleError(_0x504fed,null));},exports[_0x19411f('0x6')]=function(_0x233240,_0x488b38){const _0x1f0345=_0x19411f;return _0x233240[_0x1f0345('0xf')]['id']&&delete _0x233240[_0x1f0345('0xf')]['id'],db[_0x1f0345('0xd')][_0x1f0345('0x10')]({'where':{'id':_0x233240[_0x1f0345('0x1')]['id']}})[_0x1f0345('0x19')](handleEntityNotFound(_0x488b38,null))['then'](saveUpdates(_0x233240[_0x1f0345('0xf')],null))[_0x1f0345('0x19')](respondWithResult(_0x488b38,null))[_0x1f0345('0x9')](handleError(_0x488b38,null));},exports[_0x19411f('0x18')]=function(_0x422660,_0x37e6d1){const _0x190ca6=_0x19411f;return db['ChatApplication']['findOne']({'where':{'id':_0x422660['params']['id']}})[_0x190ca6('0x19')](handleEntityNotFound(_0x37e6d1,null))['then'](removeEntity(_0x37e6d1,null))[_0x190ca6('0x9')](handleError(_0x37e6d1,null));};
\ No newline at end of file
+const a55_0x3340=['name','params','filters','stack','ChatApplication','catch','attributes','merge','lodash','../../config/logger','intersection','../../mysqldb','findOne','send','show','fields','api','../../components/parsers/qs','model','update','keys','destroy','sendStatus','then','status','include','query','length','body'];(function(_0x2cfae1,_0x33401f){const _0x71f40e=function(_0x25613e){while(--_0x25613e){_0x2cfae1['push'](_0x2cfae1['shift']());}};_0x71f40e(++_0x33401f);}(a55_0x3340,0x87));const a55_0x71f4=function(_0x2cfae1,_0x33401f){_0x2cfae1=_0x2cfae1-0x0;let _0x71f40e=a55_0x3340[_0x2cfae1];return _0x71f40e;};const _0xb820e5=a55_0x71f4;'use strict';const _=require(_0xb820e5('0x12')),qs=require(_0xb820e5('0x1b')),logger=require(_0xb820e5('0x13'))(_0xb820e5('0x1a')),db=require(_0xb820e5('0x15'))['db'];function respondWithResult(_0x25613e,_0x467485){return _0x467485=_0x467485||0xc8,function(_0x2ba46e){const _0x48908c=a55_0x71f4;if(_0x2ba46e)return _0x25613e[_0x48908c('0x5')](_0x467485)['json'](_0x2ba46e);};}function saveUpdates(_0x12d5a3){return function(_0x5ca8f6){const _0x26047a=a55_0x71f4;if(_0x5ca8f6)return _0x5ca8f6[_0x26047a('0x0')](_0x12d5a3)['then'](function(_0x5519ab){return _0x5519ab;});return null;};}function removeEntity(_0x387839){return function(_0x158101){const _0x5c3a96=a55_0x71f4;if(_0x158101)return _0x158101['destroy']()[_0x5c3a96('0x4')](function(){const _0x37f6a2=_0x5c3a96;_0x387839[_0x37f6a2('0x5')](0xcc)['end']();});};}function handleEntityNotFound(_0x5407e5){return function(_0x40faf7){const _0xecac8e=a55_0x71f4;return!_0x40faf7&&_0x5407e5[_0xecac8e('0x3')](0x194),_0x40faf7;};}function handleError(_0x4442fc,_0x31b9cc){return _0x31b9cc=_0x31b9cc||0x1f4,function(_0x5c4e71){const _0x235cbd=a55_0x71f4;logger['error'](_0x5c4e71[_0x235cbd('0xd')]),_0x5c4e71[_0x235cbd('0xa')]&&delete _0x5c4e71[_0x235cbd('0xa')],_0x4442fc[_0x235cbd('0x5')](_0x31b9cc)[_0x235cbd('0x17')](_0x5c4e71);};}exports[_0xb820e5('0x18')]=function(_0x657e1b,_0x3bddc8){const _0x315440=_0xb820e5;let _0x488e6a={'raw':!![],'where':{'id':_0x657e1b[_0x315440('0xb')]['id']}};const _0x55cca1={};return _0x55cca1[_0x315440('0x1c')]=_[_0x315440('0x1')](db[_0x315440('0xe')]['rawAttributes']),_0x55cca1[_0x315440('0x7')]=_[_0x315440('0x1')](_0x657e1b[_0x315440('0x7')]),_0x55cca1[_0x315440('0xc')]=_[_0x315440('0x14')](_0x55cca1['model'],_0x55cca1['query']),_0x488e6a[_0x315440('0x10')]=_[_0x315440('0x14')](_0x55cca1['model'],qs[_0x315440('0x19')](_0x657e1b[_0x315440('0x7')][_0x315440('0x19')])),_0x488e6a[_0x315440('0x10')]=_0x488e6a['attributes'][_0x315440('0x8')]?_0x488e6a[_0x315440('0x10')]:_0x55cca1[_0x315440('0x1c')],_0x657e1b[_0x315440('0x7')]['includeAll']&&(_0x488e6a[_0x315440('0x6')]=[{'all':!![]}]),_0x488e6a=_[_0x315440('0x11')]({},_0x488e6a,_0x657e1b['options']),db[_0x315440('0xe')]['findOne'](_0x488e6a)[_0x315440('0x4')](handleEntityNotFound(_0x3bddc8,null))['then'](respondWithResult(_0x3bddc8,null))[_0x315440('0xf')](handleError(_0x3bddc8,null));},exports[_0xb820e5('0x0')]=function(_0x44e3c3,_0x25f39f){const _0x2b6d4d=_0xb820e5;return _0x44e3c3[_0x2b6d4d('0x9')]['id']&&delete _0x44e3c3['body']['id'],db[_0x2b6d4d('0xe')][_0x2b6d4d('0x16')]({'where':{'id':_0x44e3c3['params']['id']}})['then'](handleEntityNotFound(_0x25f39f,null))[_0x2b6d4d('0x4')](saveUpdates(_0x44e3c3[_0x2b6d4d('0x9')],null))[_0x2b6d4d('0x4')](respondWithResult(_0x25f39f,null))[_0x2b6d4d('0xf')](handleError(_0x25f39f,null));},exports[_0xb820e5('0x2')]=function(_0x2920ff,_0x37488d){const _0x52a04e=_0xb820e5;return db['ChatApplication'][_0x52a04e('0x16')]({'where':{'id':_0x2920ff[_0x52a04e('0xb')]['id']}})['then'](handleEntityNotFound(_0x37488d,null))[_0x52a04e('0x4')](removeEntity(_0x37488d,null))['catch'](handleError(_0x37488d,null));};
\ No newline at end of file