Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / squareMessage / squareMessage.controller.js
index 06969c9..c706191 100644 (file)
@@ -1 +1 @@
-const a588_0x199c=['fields','sort','show','catch','intersection','create','../../mysqldb','order','rows','api','stack','VIRTUAL','offset','attributes','includeAll','lodash','sequelize','status','length','filters','body','count','params','../../config/logger','where','SquareMessage','index','include','undefined','type','set','name','nolimit','destroy','model','json','key','rawAttributes','update','../../components/parsers/qs','findOne','keys','fieldName','query','like','error','pick','filter','send','map','then','limit'];(function(_0x5ddea5,_0x199c55){const _0x478b38=function(_0x12389e){while(--_0x12389e){_0x5ddea5['push'](_0x5ddea5['shift']());}};_0x478b38(++_0x199c55);}(a588_0x199c,0xbe));const a588_0x478b=function(_0x5ddea5,_0x199c55){_0x5ddea5=_0x5ddea5-0x0;let _0x478b38=a588_0x199c[_0x5ddea5];return _0x478b38;};const _0x118ec2=a588_0x478b;'use strict';const _=require(_0x118ec2('0x21')),qs=require(_0x118ec2('0x5')),logger=require(_0x118ec2('0x29'))(_0x118ec2('0x1b')),db=require(_0x118ec2('0x18'))['db'],{Op}=require(_0x118ec2('0x22'));function respondWithResult(_0x12389e,_0x1d391a){return _0x1d391a=_0x1d391a||0xc8,function(_0x10580b){const _0xcb3e38=a588_0x478b;if(_0x10580b)return _0x12389e[_0xcb3e38('0x23')](_0x1d391a)['json'](_0x10580b);};}function respondWithFilteredResult(_0xf7b95c,_0xa22bf7){return function(_0x142d02){const _0x3a1e61=a588_0x478b;if(_0x142d02){const _0x45fb91=_0x142d02[_0x3a1e61('0x27')],_0x1f599f=_0xa22bf7[_0x3a1e61('0x1e')];let _0x334b2b=_0xa22bf7[_0x3a1e61('0x1e')]+_0xa22bf7[_0x3a1e61('0x11')],_0x14ba3f;return _0x334b2b>=_0x45fb91?(_0x334b2b=_0x45fb91,_0x14ba3f=0xc8):_0x14ba3f=0xce,_0xf7b95c[_0x3a1e61('0x23')](_0x14ba3f),_0xf7b95c[_0x3a1e61('0x30')]('Content-Range',_0x1f599f+'-'+_0x334b2b+'/'+_0x45fb91)[_0x3a1e61('0x1')](_0x142d02);}return null;};}function saveUpdates(_0x9a54dd){return function(_0xa5254){const _0x1f093c=a588_0x478b;if(_0xa5254)return _0xa5254[_0x1f093c('0x4')](_0x9a54dd)['then'](function(_0x15a78c){return _0x15a78c;});return null;};}function removeEntity(_0x5667c7){return function(_0xc6726d){const _0x5e21f2=a588_0x478b;if(_0xc6726d)return _0xc6726d[_0x5e21f2('0x33')]()[_0x5e21f2('0x10')](function(){const _0x4ee6be=_0x5e21f2;_0x5667c7[_0x4ee6be('0x23')](0xcc)['end']();});};}function handleEntityNotFound(_0x3d2d5e){return function(_0x13f617){return!_0x13f617&&_0x3d2d5e['sendStatus'](0x194),_0x13f617;};}function handleError(_0x59da6a,_0x410a1f){return _0x410a1f=_0x410a1f||0x1f4,function(_0x47d69c){const _0x296514=a588_0x478b;logger[_0x296514('0xb')](_0x47d69c[_0x296514('0x1c')]),_0x47d69c[_0x296514('0x31')]&&delete _0x47d69c[_0x296514('0x31')],_0x59da6a['status'](_0x410a1f)[_0x296514('0xe')](_0x47d69c);};}exports[_0x118ec2('0x2c')]=function(_0x352f52,_0x4ee3c2){const _0x180097=_0x118ec2;let _0x5091c9={};const _0x25a844={},_0x56c676={'count':0x0,'rows':[]},_0x397825=_[_0x180097('0xf')](db['SquareMessage'][_0x180097('0x3')],function(_0x3c92b8){const _0x520f69=_0x180097;return{'name':_0x3c92b8[_0x520f69('0x8')],'type':_0x3c92b8[_0x520f69('0x2f')][_0x520f69('0x2')]};});_0x25a844[_0x180097('0x0')]=_[_0x180097('0xf')](_0x397825,_0x180097('0x31')),_0x25a844['query']=_[_0x180097('0x7')](_0x352f52[_0x180097('0x9')]),_0x25a844[_0x180097('0x25')]=_[_0x180097('0x16')](_0x25a844[_0x180097('0x0')],_0x25a844[_0x180097('0x9')]),_0x5091c9[_0x180097('0x1f')]=_['intersection'](_0x25a844[_0x180097('0x0')],qs[_0x180097('0x12')](_0x352f52[_0x180097('0x9')][_0x180097('0x12')])),_0x5091c9[_0x180097('0x1f')]=_0x5091c9[_0x180097('0x1f')][_0x180097('0x24')]?_0x5091c9[_0x180097('0x1f')]:_0x25a844[_0x180097('0x0')];typeof _0x352f52[_0x180097('0x9')][_0x180097('0x32')]===_0x180097('0x2e')&&(_0x5091c9[_0x180097('0x11')]=qs[_0x180097('0x11')](_0x352f52[_0x180097('0x9')][_0x180097('0x11')]),_0x5091c9[_0x180097('0x1e')]=qs[_0x180097('0x1e')](_0x352f52[_0x180097('0x9')][_0x180097('0x1e')]));_0x5091c9[_0x180097('0x19')]=qs[_0x180097('0x13')](_0x352f52[_0x180097('0x9')][_0x180097('0x13')]),_0x5091c9[_0x180097('0x2a')]=qs[_0x180097('0x25')](_[_0x180097('0xc')](_0x352f52[_0x180097('0x9')],_0x25a844[_0x180097('0x25')]),_0x397825);_0x352f52[_0x180097('0x9')][_0x180097('0xd')]&&(_0x5091c9[_0x180097('0x2a')]=_['merge'](_0x5091c9[_0x180097('0x2a')],{[Op['or']]:_[_0x180097('0xf')](_0x397825,function(_0x48c40b){const _0x452ac4=_0x180097;if(_0x48c40b[_0x452ac4('0x2f')]!==_0x452ac4('0x1d')){const _0x59b803={};return _0x59b803[_0x48c40b[_0x452ac4('0x31')]]={[Op[_0x452ac4('0xa')]]:'%'+_0x352f52[_0x452ac4('0x9')]['filter']+'%'},_0x59b803;}})}));_0x5091c9=_['merge']({},_0x5091c9,_0x352f52['options']);const _0x58372d={'where':_0x5091c9[_0x180097('0x2a')]};return db[_0x180097('0x2b')]['count'](_0x58372d)[_0x180097('0x10')](function(_0x271b03){const _0x35f5b3=_0x180097;return _0x56c676[_0x35f5b3('0x27')]=_0x271b03,_0x352f52[_0x35f5b3('0x9')][_0x35f5b3('0x20')]&&(_0x5091c9[_0x35f5b3('0x2d')]=[{'all':!![]}]),db[_0x35f5b3('0x2b')]['findAll'](_0x5091c9);})['then'](function(_0x1d6432){const _0x491f91=_0x180097;return _0x56c676[_0x491f91('0x1a')]=_0x1d6432,_0x56c676;})[_0x180097('0x10')](respondWithFilteredResult(_0x4ee3c2,_0x5091c9))['catch'](handleError(_0x4ee3c2,null));},exports[_0x118ec2('0x14')]=function(_0x11940e,_0x26c564){const _0xc2233d=_0x118ec2;let _0x114307={'raw':!![],'where':{'id':_0x11940e[_0xc2233d('0x28')]['id']}};const _0x4902eb={};return _0x4902eb[_0xc2233d('0x0')]=_[_0xc2233d('0x7')](db[_0xc2233d('0x2b')]['rawAttributes']),_0x4902eb[_0xc2233d('0x9')]=_[_0xc2233d('0x7')](_0x11940e[_0xc2233d('0x9')]),_0x4902eb[_0xc2233d('0x25')]=_[_0xc2233d('0x16')](_0x4902eb[_0xc2233d('0x0')],_0x4902eb[_0xc2233d('0x9')]),_0x114307['attributes']=_[_0xc2233d('0x16')](_0x4902eb[_0xc2233d('0x0')],qs[_0xc2233d('0x12')](_0x11940e[_0xc2233d('0x9')]['fields'])),_0x114307[_0xc2233d('0x1f')]=_0x114307['attributes']['length']?_0x114307[_0xc2233d('0x1f')]:_0x4902eb['model'],_0x11940e[_0xc2233d('0x9')][_0xc2233d('0x20')]&&(_0x114307[_0xc2233d('0x2d')]=[{'all':!![]}]),_0x114307=_['merge']({},_0x114307,_0x11940e['options']),db[_0xc2233d('0x2b')][_0xc2233d('0x6')](_0x114307)['then'](handleEntityNotFound(_0x26c564,null))[_0xc2233d('0x10')](respondWithResult(_0x26c564,null))['catch'](handleError(_0x26c564,null));},exports[_0x118ec2('0x17')]=function(_0x4b696c,_0x539e2a){const _0x5dc596=_0x118ec2;return db[_0x5dc596('0x2b')][_0x5dc596('0x17')](_0x4b696c['body'],{})[_0x5dc596('0x10')](respondWithResult(_0x539e2a,0xc9))[_0x5dc596('0x15')](handleError(_0x539e2a,null));},exports['update']=function(_0x2e73c2,_0x11790){const _0x178b6e=_0x118ec2;return _0x2e73c2[_0x178b6e('0x26')]['id']&&delete _0x2e73c2[_0x178b6e('0x26')]['id'],db[_0x178b6e('0x2b')][_0x178b6e('0x6')]({'where':{'id':_0x2e73c2['params']['id']}})[_0x178b6e('0x10')](handleEntityNotFound(_0x11790,null))['then'](saveUpdates(_0x2e73c2[_0x178b6e('0x26')],null))['then'](respondWithResult(_0x11790,null))['catch'](handleError(_0x11790,null));},exports[_0x118ec2('0x33')]=function(_0x4a6c3f,_0x5b0c82){const _0xe9f045=_0x118ec2;return db[_0xe9f045('0x2b')][_0xe9f045('0x6')]({'where':{'id':_0x4a6c3f[_0xe9f045('0x28')]['id']}})[_0xe9f045('0x10')](handleEntityNotFound(_0x5b0c82,null))[_0xe9f045('0x10')](removeEntity(_0x5b0c82,null))[_0xe9f045('0x15')](handleError(_0x5b0c82,null));};
\ No newline at end of file
+const a588_0x3dc8=['map','limit','like','sequelize','show','api','order','query','send','include','keys','VIRTUAL','sendStatus','model','error','pick','params','offset','update','../../mysqldb','set','where','index','type','rows','findOne','count','lodash','length','destroy','../../components/parsers/qs','name','options','findAll','filter','nolimit','json','status','includeAll','fields','SquareMessage','then','catch','rawAttributes','attributes','stack','merge','intersection','end','body','filters'];(function(_0xcbf61,_0x3dc84e){const _0x5893be=function(_0x2b26de){while(--_0x2b26de){_0xcbf61['push'](_0xcbf61['shift']());}};_0x5893be(++_0x3dc84e);}(a588_0x3dc8,0xf7));const a588_0x5893=function(_0xcbf61,_0x3dc84e){_0xcbf61=_0xcbf61-0x0;let _0x5893be=a588_0x3dc8[_0xcbf61];return _0x5893be;};const _0x48303a=a588_0x5893;'use strict';const _=require(_0x48303a('0x23')),qs=require(_0x48303a('0x26')),logger=require('../../config/logger')(_0x48303a('0xd')),db=require(_0x48303a('0x1b'))['db'],{Op}=require(_0x48303a('0xb'));function respondWithResult(_0x2b26de,_0x439466){return _0x439466=_0x439466||0xc8,function(_0xd0911d){const _0x4d7446=a588_0x5893;if(_0xd0911d)return _0x2b26de[_0x4d7446('0x2d')](_0x439466)[_0x4d7446('0x2c')](_0xd0911d);};}function respondWithFilteredResult(_0x23f601,_0x21d74c){return function(_0xe806a6){const _0x19f886=a588_0x5893;if(_0xe806a6){const _0x1ec1f3=_0xe806a6[_0x19f886('0x22')],_0x110d28=_0x21d74c['offset'];let _0x517588=_0x21d74c[_0x19f886('0x19')]+_0x21d74c[_0x19f886('0x9')],_0x463d04;return _0x517588>=_0x1ec1f3?(_0x517588=_0x1ec1f3,_0x463d04=0xc8):_0x463d04=0xce,_0x23f601[_0x19f886('0x2d')](_0x463d04),_0x23f601[_0x19f886('0x1c')]('Content-Range',_0x110d28+'-'+_0x517588+'/'+_0x1ec1f3)[_0x19f886('0x2c')](_0xe806a6);}return null;};}function saveUpdates(_0x2b3b0e){return function(_0x7ed80e){const _0x4874b5=a588_0x5893;if(_0x7ed80e)return _0x7ed80e[_0x4874b5('0x1a')](_0x2b3b0e)['then'](function(_0x460714){return _0x460714;});return null;};}function removeEntity(_0x519bb6){return function(_0x5cc513){const _0x5ca426=a588_0x5893;if(_0x5cc513)return _0x5cc513[_0x5ca426('0x25')]()[_0x5ca426('0x31')](function(){const _0x5e5c67=_0x5ca426;_0x519bb6[_0x5e5c67('0x2d')](0xcc)[_0x5e5c67('0x5')]();});};}function handleEntityNotFound(_0x1e55ff){return function(_0x544f35){const _0x28e7b7=a588_0x5893;return!_0x544f35&&_0x1e55ff[_0x28e7b7('0x14')](0x194),_0x544f35;};}function handleError(_0x531a60,_0x59954b){return _0x59954b=_0x59954b||0x1f4,function(_0x24abe2){const _0xb7b4eb=a588_0x5893;logger[_0xb7b4eb('0x16')](_0x24abe2[_0xb7b4eb('0x2')]),_0x24abe2[_0xb7b4eb('0x27')]&&delete _0x24abe2['name'],_0x531a60[_0xb7b4eb('0x2d')](_0x59954b)[_0xb7b4eb('0x10')](_0x24abe2);};}exports[_0x48303a('0x1e')]=function(_0x34f1a8,_0x340c07){const _0x53f64d=_0x48303a;let _0x43733a={};const _0x55aa30={},_0x488697={'count':0x0,'rows':[]},_0x2b8f9f=_[_0x53f64d('0x8')](db[_0x53f64d('0x30')][_0x53f64d('0x0')],function(_0x127a66){const _0xed25df=_0x53f64d;return{'name':_0x127a66['fieldName'],'type':_0x127a66[_0xed25df('0x1f')]['key']};});_0x55aa30[_0x53f64d('0x15')]=_[_0x53f64d('0x8')](_0x2b8f9f,'name'),_0x55aa30[_0x53f64d('0xf')]=_[_0x53f64d('0x12')](_0x34f1a8['query']),_0x55aa30['filters']=_[_0x53f64d('0x4')](_0x55aa30[_0x53f64d('0x15')],_0x55aa30['query']),_0x43733a[_0x53f64d('0x1')]=_[_0x53f64d('0x4')](_0x55aa30[_0x53f64d('0x15')],qs[_0x53f64d('0x2f')](_0x34f1a8[_0x53f64d('0xf')]['fields'])),_0x43733a[_0x53f64d('0x1')]=_0x43733a[_0x53f64d('0x1')][_0x53f64d('0x24')]?_0x43733a['attributes']:_0x55aa30[_0x53f64d('0x15')];typeof _0x34f1a8['query'][_0x53f64d('0x2b')]==='undefined'&&(_0x43733a['limit']=qs[_0x53f64d('0x9')](_0x34f1a8[_0x53f64d('0xf')][_0x53f64d('0x9')]),_0x43733a['offset']=qs[_0x53f64d('0x19')](_0x34f1a8['query'][_0x53f64d('0x19')]));_0x43733a[_0x53f64d('0xe')]=qs['sort'](_0x34f1a8['query']['sort']),_0x43733a[_0x53f64d('0x1d')]=qs[_0x53f64d('0x7')](_[_0x53f64d('0x17')](_0x34f1a8[_0x53f64d('0xf')],_0x55aa30[_0x53f64d('0x7')]),_0x2b8f9f);_0x34f1a8[_0x53f64d('0xf')][_0x53f64d('0x2a')]&&(_0x43733a[_0x53f64d('0x1d')]=_[_0x53f64d('0x3')](_0x43733a[_0x53f64d('0x1d')],{[Op['or']]:_[_0x53f64d('0x8')](_0x2b8f9f,function(_0x3de3bf){const _0x4a8821=_0x53f64d;if(_0x3de3bf[_0x4a8821('0x1f')]!==_0x4a8821('0x13')){const _0x176d67={};return _0x176d67[_0x3de3bf[_0x4a8821('0x27')]]={[Op[_0x4a8821('0xa')]]:'%'+_0x34f1a8['query']['filter']+'%'},_0x176d67;}})}));_0x43733a=_[_0x53f64d('0x3')]({},_0x43733a,_0x34f1a8['options']);const _0x55b5f5={'where':_0x43733a['where']};return db[_0x53f64d('0x30')][_0x53f64d('0x22')](_0x55b5f5)[_0x53f64d('0x31')](function(_0x2f7d0f){const _0x4f0e46=_0x53f64d;return _0x488697[_0x4f0e46('0x22')]=_0x2f7d0f,_0x34f1a8['query'][_0x4f0e46('0x2e')]&&(_0x43733a[_0x4f0e46('0x11')]=[{'all':!![]}]),db[_0x4f0e46('0x30')][_0x4f0e46('0x29')](_0x43733a);})[_0x53f64d('0x31')](function(_0x5d445a){const _0x29eefa=_0x53f64d;return _0x488697[_0x29eefa('0x20')]=_0x5d445a,_0x488697;})['then'](respondWithFilteredResult(_0x340c07,_0x43733a))[_0x53f64d('0x32')](handleError(_0x340c07,null));},exports[_0x48303a('0xc')]=function(_0x5aa985,_0x1c5852){const _0x20bc50=_0x48303a;let _0x157434={'raw':!![],'where':{'id':_0x5aa985['params']['id']}};const _0x4300d8={};return _0x4300d8[_0x20bc50('0x15')]=_[_0x20bc50('0x12')](db[_0x20bc50('0x30')][_0x20bc50('0x0')]),_0x4300d8[_0x20bc50('0xf')]=_['keys'](_0x5aa985['query']),_0x4300d8['filters']=_['intersection'](_0x4300d8['model'],_0x4300d8[_0x20bc50('0xf')]),_0x157434[_0x20bc50('0x1')]=_['intersection'](_0x4300d8[_0x20bc50('0x15')],qs[_0x20bc50('0x2f')](_0x5aa985[_0x20bc50('0xf')][_0x20bc50('0x2f')])),_0x157434[_0x20bc50('0x1')]=_0x157434[_0x20bc50('0x1')][_0x20bc50('0x24')]?_0x157434[_0x20bc50('0x1')]:_0x4300d8[_0x20bc50('0x15')],_0x5aa985[_0x20bc50('0xf')][_0x20bc50('0x2e')]&&(_0x157434['include']=[{'all':!![]}]),_0x157434=_[_0x20bc50('0x3')]({},_0x157434,_0x5aa985[_0x20bc50('0x28')]),db[_0x20bc50('0x30')][_0x20bc50('0x21')](_0x157434)[_0x20bc50('0x31')](handleEntityNotFound(_0x1c5852,null))[_0x20bc50('0x31')](respondWithResult(_0x1c5852,null))[_0x20bc50('0x32')](handleError(_0x1c5852,null));},exports['create']=function(_0x2c2ed7,_0x499aef){const _0x1eb291=_0x48303a;return db['SquareMessage']['create'](_0x2c2ed7[_0x1eb291('0x6')],{})[_0x1eb291('0x31')](respondWithResult(_0x499aef,0xc9))[_0x1eb291('0x32')](handleError(_0x499aef,null));},exports[_0x48303a('0x1a')]=function(_0x4c385b,_0x347ddf){const _0x1b0e3e=_0x48303a;return _0x4c385b[_0x1b0e3e('0x6')]['id']&&delete _0x4c385b[_0x1b0e3e('0x6')]['id'],db['SquareMessage'][_0x1b0e3e('0x21')]({'where':{'id':_0x4c385b['params']['id']}})[_0x1b0e3e('0x31')](handleEntityNotFound(_0x347ddf,null))[_0x1b0e3e('0x31')](saveUpdates(_0x4c385b['body'],null))[_0x1b0e3e('0x31')](respondWithResult(_0x347ddf,null))[_0x1b0e3e('0x32')](handleError(_0x347ddf,null));},exports[_0x48303a('0x25')]=function(_0x2992fc,_0x49d589){const _0x16e876=_0x48303a;return db['SquareMessage'][_0x16e876('0x21')]({'where':{'id':_0x2992fc[_0x16e876('0x18')]['id']}})[_0x16e876('0x31')](handleEntityNotFound(_0x49d589,null))[_0x16e876('0x31')](removeEntity(_0x49d589,null))[_0x16e876('0x32')](handleError(_0x49d589,null));};
\ No newline at end of file