Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / userProfileResource / userProfileResource.controller.js
index 48e3f32..9008ee0 100644 (file)
@@ -1 +1 @@
-const a674_0x2001=['body','fieldName','show','query','sequelize','intersection','map','sort','send','length','Content-Range','like','nolimit','set','options','../../mysqldb','count','include','includeAll','filter','model','error','stack','offset','UserProfileResource','create','fields','name','params','rawAttributes','catch','end','update','lodash','api','describe','where','keys','destroy','merge','limit','undefined','type','key','then','json','../../components/parsers/qs','attributes','filters','../../config/logger','VIRTUAL','sendStatus','status','order','rows','findOne'];(function(_0x56e2a7,_0x200109){const _0x4bf8f3=function(_0x3f165a){while(--_0x3f165a){_0x56e2a7['push'](_0x56e2a7['shift']());}};_0x4bf8f3(++_0x200109);}(a674_0x2001,0xca));const a674_0x4bf8=function(_0x56e2a7,_0x200109){_0x56e2a7=_0x56e2a7-0x0;let _0x4bf8f3=a674_0x2001[_0x56e2a7];return _0x4bf8f3;};const _0x1f0d68=a674_0x4bf8;'use strict';const _=require(_0x1f0d68('0x37')),qs=require(_0x1f0d68('0xc')),logger=require(_0x1f0d68('0xf'))(_0x1f0d68('0x0')),db=require(_0x1f0d68('0x25'))['db'],{Op}=require(_0x1f0d68('0x1a'));function respondWithResult(_0x3f165a,_0x4052ba){return _0x4052ba=_0x4052ba||0xc8,function(_0x391749){const _0x4185a4=a674_0x4bf8;if(_0x391749)return _0x3f165a['status'](_0x4052ba)[_0x4185a4('0xb')](_0x391749);};}function respondWithFilteredResult(_0x466894,_0x5a6767){return function(_0x183d53){const _0x6a3d47=a674_0x4bf8;if(_0x183d53){const _0x34aca5=_0x183d53[_0x6a3d47('0x26')],_0x2ff187=_0x5a6767[_0x6a3d47('0x2d')];let _0x33dbc4=_0x5a6767['offset']+_0x5a6767['limit'],_0x5662ea;return _0x33dbc4>=_0x34aca5?(_0x33dbc4=_0x34aca5,_0x5662ea=0xc8):_0x5662ea=0xce,_0x466894['status'](_0x5662ea),_0x466894[_0x6a3d47('0x23')](_0x6a3d47('0x20'),_0x2ff187+'-'+_0x33dbc4+'/'+_0x34aca5)[_0x6a3d47('0xb')](_0x183d53);}return null;};}function saveUpdates(_0x20c5c0){return function(_0x51bd58){const _0x5d179e=a674_0x4bf8;if(_0x51bd58)return _0x51bd58[_0x5d179e('0x36')](_0x20c5c0)[_0x5d179e('0xa')](function(_0x1795b1){return _0x1795b1;});return null;};}function removeEntity(_0x373604){return function(_0x34cdd6){const _0x3aa6c5=a674_0x4bf8;if(_0x34cdd6)return _0x34cdd6[_0x3aa6c5('0x4')]()[_0x3aa6c5('0xa')](function(){const _0x3f9961=_0x3aa6c5;_0x373604[_0x3f9961('0x12')](0xcc)[_0x3f9961('0x35')]();});};}function handleEntityNotFound(_0xdb21d8){return function(_0x16a7f9){const _0x40f4a5=a674_0x4bf8;return!_0x16a7f9&&_0xdb21d8[_0x40f4a5('0x11')](0x194),_0x16a7f9;};}function handleError(_0x20ddaa,_0x5c0052){return _0x5c0052=_0x5c0052||0x1f4,function(_0xe049b7){const _0x4b20da=a674_0x4bf8;logger[_0x4b20da('0x2b')](_0xe049b7[_0x4b20da('0x2c')]),_0xe049b7['name']&&delete _0xe049b7[_0x4b20da('0x31')],_0x20ddaa[_0x4b20da('0x12')](_0x5c0052)[_0x4b20da('0x1e')](_0xe049b7);};}exports['index']=function(_0x245797,_0x28dec5){const _0x36c048=_0x1f0d68;let _0x2fa2c8={};const _0x4bf9b1={},_0x1da6b0={'count':0x0,'rows':[]},_0x154d37=_[_0x36c048('0x1c')](db['UserProfileResource'][_0x36c048('0x33')],function(_0x4eb778){const _0x1e0cac=_0x36c048;return{'name':_0x4eb778[_0x1e0cac('0x17')],'type':_0x4eb778[_0x1e0cac('0x8')][_0x1e0cac('0x9')]};});_0x4bf9b1[_0x36c048('0x2a')]=_[_0x36c048('0x1c')](_0x154d37,'name'),_0x4bf9b1[_0x36c048('0x19')]=_[_0x36c048('0x3')](_0x245797[_0x36c048('0x19')]),_0x4bf9b1[_0x36c048('0xe')]=_[_0x36c048('0x1b')](_0x4bf9b1[_0x36c048('0x2a')],_0x4bf9b1[_0x36c048('0x19')]),_0x2fa2c8['attributes']=_[_0x36c048('0x1b')](_0x4bf9b1[_0x36c048('0x2a')],qs[_0x36c048('0x30')](_0x245797[_0x36c048('0x19')][_0x36c048('0x30')])),_0x2fa2c8[_0x36c048('0xd')]=_0x2fa2c8[_0x36c048('0xd')]['length']?_0x2fa2c8[_0x36c048('0xd')]:_0x4bf9b1['model'];typeof _0x245797[_0x36c048('0x19')][_0x36c048('0x22')]===_0x36c048('0x7')&&(_0x2fa2c8[_0x36c048('0x6')]=qs[_0x36c048('0x6')](_0x245797[_0x36c048('0x19')][_0x36c048('0x6')]),_0x2fa2c8[_0x36c048('0x2d')]=qs[_0x36c048('0x2d')](_0x245797[_0x36c048('0x19')][_0x36c048('0x2d')]));_0x2fa2c8[_0x36c048('0x13')]=qs[_0x36c048('0x1d')](_0x245797[_0x36c048('0x19')][_0x36c048('0x1d')]),_0x2fa2c8[_0x36c048('0x2')]=qs[_0x36c048('0xe')](_['pick'](_0x245797[_0x36c048('0x19')],_0x4bf9b1[_0x36c048('0xe')]),_0x154d37);_0x245797[_0x36c048('0x19')][_0x36c048('0x29')]&&(_0x2fa2c8['where']=_[_0x36c048('0x5')](_0x2fa2c8[_0x36c048('0x2')],{[Op['or']]:_[_0x36c048('0x1c')](_0x154d37,function(_0x42fc57){const _0x166edb=_0x36c048;if(_0x42fc57['type']!==_0x166edb('0x10')){const _0x2a0af7={};return _0x2a0af7[_0x42fc57[_0x166edb('0x31')]]={[Op[_0x166edb('0x21')]]:'%'+_0x245797['query'][_0x166edb('0x29')]+'%'},_0x2a0af7;}})}));_0x2fa2c8=_[_0x36c048('0x5')]({},_0x2fa2c8,_0x245797['options']);const _0x72e517={'where':_0x2fa2c8[_0x36c048('0x2')]};return db[_0x36c048('0x2e')]['count'](_0x72e517)['then'](function(_0x1498c5){const _0x1f54c0=_0x36c048;return _0x1da6b0[_0x1f54c0('0x26')]=_0x1498c5,_0x245797[_0x1f54c0('0x19')][_0x1f54c0('0x28')]&&(_0x2fa2c8[_0x1f54c0('0x27')]=[{'all':!![]}]),db[_0x1f54c0('0x2e')]['findAll'](_0x2fa2c8);})[_0x36c048('0xa')](function(_0xd4ff2c){const _0x546303=_0x36c048;return _0x1da6b0[_0x546303('0x14')]=_0xd4ff2c,_0x1da6b0;})[_0x36c048('0xa')](respondWithFilteredResult(_0x28dec5,_0x2fa2c8))[_0x36c048('0x34')](handleError(_0x28dec5,null));},exports[_0x1f0d68('0x18')]=function(_0x35a855,_0x4b2027){const _0x41c60f=_0x1f0d68;let _0x4be454={'raw':![],'where':{'id':_0x35a855[_0x41c60f('0x32')]['id']}};const _0x49cc6e={};return _0x49cc6e[_0x41c60f('0x2a')]=_['keys'](db[_0x41c60f('0x2e')][_0x41c60f('0x33')]),_0x49cc6e[_0x41c60f('0x19')]=_[_0x41c60f('0x3')](_0x35a855[_0x41c60f('0x19')]),_0x49cc6e['filters']=_['intersection'](_0x49cc6e[_0x41c60f('0x2a')],_0x49cc6e[_0x41c60f('0x19')]),_0x4be454[_0x41c60f('0xd')]=_['intersection'](_0x49cc6e[_0x41c60f('0x2a')],qs[_0x41c60f('0x30')](_0x35a855['query']['fields'])),_0x4be454[_0x41c60f('0xd')]=_0x4be454[_0x41c60f('0xd')][_0x41c60f('0x1f')]?_0x4be454[_0x41c60f('0xd')]:_0x49cc6e[_0x41c60f('0x2a')],_0x35a855[_0x41c60f('0x19')][_0x41c60f('0x28')]&&(_0x4be454['include']=[{'all':!![]}]),_0x4be454=_[_0x41c60f('0x5')]({},_0x4be454,_0x35a855[_0x41c60f('0x24')]),db[_0x41c60f('0x2e')][_0x41c60f('0x15')](_0x4be454)['then'](handleEntityNotFound(_0x4b2027,null))[_0x41c60f('0xa')](respondWithResult(_0x4b2027,null))[_0x41c60f('0x34')](handleError(_0x4b2027,null));},exports[_0x1f0d68('0x2f')]=function(_0x122cbe,_0x59d646){const _0x9cac2d=_0x1f0d68;return db[_0x9cac2d('0x2e')][_0x9cac2d('0x2f')](_0x122cbe['body'],{})[_0x9cac2d('0xa')](respondWithResult(_0x59d646,0xc9))['catch'](handleError(_0x59d646,null));},exports[_0x1f0d68('0x36')]=function(_0x92fc1b,_0x741aff){const _0x3e06ee=_0x1f0d68;return _0x92fc1b['body']['id']&&delete _0x92fc1b[_0x3e06ee('0x16')]['id'],db['UserProfileResource']['findOne']({'where':{'id':_0x92fc1b[_0x3e06ee('0x32')]['id']}})[_0x3e06ee('0xa')](handleEntityNotFound(_0x741aff,null))['then'](saveUpdates(_0x92fc1b[_0x3e06ee('0x16')],null))[_0x3e06ee('0xa')](respondWithResult(_0x741aff,null))[_0x3e06ee('0x34')](handleError(_0x741aff,null));},exports[_0x1f0d68('0x4')]=function(_0x46feaa,_0x4a59cf){const _0x2f3d1f=_0x1f0d68;return db[_0x2f3d1f('0x2e')][_0x2f3d1f('0x15')]({'where':{'id':_0x46feaa[_0x2f3d1f('0x32')]['id']}})[_0x2f3d1f('0xa')](handleEntityNotFound(_0x4a59cf,null))[_0x2f3d1f('0xa')](removeEntity(_0x4a59cf,null))[_0x2f3d1f('0x34')](handleError(_0x4a59cf,null));},exports['describe']=function(_0x134ac4,_0x591968){const _0x2f89c8=_0x1f0d68;return db['UserProfileResource'][_0x2f89c8('0x1')]()[_0x2f89c8('0xa')](respondWithResult(_0x591968,null))[_0x2f89c8('0x34')](handleError(_0x591968,null));};
\ No newline at end of file
+const a674_0x1dc8=['destroy','update','fieldName','undefined','then','filters','end','intersection','query','describe','VIRTUAL','../../mysqldb','includeAll','merge','findAll','map','key','nolimit','send','like','status','attributes','offset','pick','findOne','name','stack','length','where','filter','create','include','params','sendStatus','count','catch','options','model','index','rawAttributes','body','sort','keys','error','fields','json','UserProfileResource','limit','set','../../components/parsers/qs','lodash'];(function(_0x57f6fd,_0x1dc80f){const _0x11e3da=function(_0x3ced16){while(--_0x3ced16){_0x57f6fd['push'](_0x57f6fd['shift']());}};_0x11e3da(++_0x1dc80f);}(a674_0x1dc8,0x1e8));const a674_0x11e3=function(_0x57f6fd,_0x1dc80f){_0x57f6fd=_0x57f6fd-0x0;let _0x11e3da=a674_0x1dc8[_0x57f6fd];return _0x11e3da;};const _0x245ebd=a674_0x11e3;'use strict';const _=require(_0x245ebd('0x15')),qs=require(_0x245ebd('0x14')),logger=require('../../config/logger')('api'),db=require(_0x245ebd('0x21'))['db'],{Op}=require('sequelize');function respondWithResult(_0x3ced16,_0x55c9fa){return _0x55c9fa=_0x55c9fa||0xc8,function(_0x23ec7f){const _0x117930=a674_0x11e3;if(_0x23ec7f)return _0x3ced16[_0x117930('0x2a')](_0x55c9fa)[_0x117930('0x10')](_0x23ec7f);};}function respondWithFilteredResult(_0x2d9470,_0x95492){return function(_0x18daf4){const _0x1f06a6=a674_0x11e3;if(_0x18daf4){const _0xd973bc=_0x18daf4[_0x1f06a6('0x5')],_0x67e37f=_0x95492[_0x1f06a6('0x2c')];let _0x58528a=_0x95492[_0x1f06a6('0x2c')]+_0x95492['limit'],_0x4892cb;return _0x58528a>=_0xd973bc?(_0x58528a=_0xd973bc,_0x4892cb=0xc8):_0x4892cb=0xce,_0x2d9470[_0x1f06a6('0x2a')](_0x4892cb),_0x2d9470[_0x1f06a6('0x13')]('Content-Range',_0x67e37f+'-'+_0x58528a+'/'+_0xd973bc)[_0x1f06a6('0x10')](_0x18daf4);}return null;};}function saveUpdates(_0x16c3fc){return function(_0xddd850){const _0x28d184=a674_0x11e3;if(_0xddd850)return _0xddd850[_0x28d184('0x17')](_0x16c3fc)[_0x28d184('0x1a')](function(_0x3b2a8e){return _0x3b2a8e;});return null;};}function removeEntity(_0x55b239){return function(_0x1aad49){const _0x1e1f87=a674_0x11e3;if(_0x1aad49)return _0x1aad49[_0x1e1f87('0x16')]()[_0x1e1f87('0x1a')](function(){const _0x2e4c16=_0x1e1f87;_0x55b239[_0x2e4c16('0x2a')](0xcc)[_0x2e4c16('0x1c')]();});};}function handleEntityNotFound(_0x552211){return function(_0x44bd45){const _0x10eda8=a674_0x11e3;return!_0x44bd45&&_0x552211[_0x10eda8('0x4')](0x194),_0x44bd45;};}function handleError(_0x595f44,_0x26a452){return _0x26a452=_0x26a452||0x1f4,function(_0x148af6){const _0x48862f=a674_0x11e3;logger[_0x48862f('0xe')](_0x148af6[_0x48862f('0x30')]),_0x148af6['name']&&delete _0x148af6[_0x48862f('0x2f')],_0x595f44['status'](_0x26a452)[_0x48862f('0x28')](_0x148af6);};}exports[_0x245ebd('0x9')]=function(_0xa082c8,_0x49ccb5){const _0x178559=_0x245ebd;let _0x2f9958={};const _0x141ae0={},_0x286367={'count':0x0,'rows':[]},_0xfada7d=_[_0x178559('0x25')](db[_0x178559('0x11')][_0x178559('0xa')],function(_0x15bd46){const _0x50ac26=_0x178559;return{'name':_0x15bd46[_0x50ac26('0x18')],'type':_0x15bd46['type'][_0x50ac26('0x26')]};});_0x141ae0[_0x178559('0x8')]=_[_0x178559('0x25')](_0xfada7d,_0x178559('0x2f')),_0x141ae0['query']=_[_0x178559('0xd')](_0xa082c8['query']),_0x141ae0[_0x178559('0x1b')]=_['intersection'](_0x141ae0['model'],_0x141ae0[_0x178559('0x1e')]),_0x2f9958['attributes']=_[_0x178559('0x1d')](_0x141ae0['model'],qs[_0x178559('0xf')](_0xa082c8[_0x178559('0x1e')][_0x178559('0xf')])),_0x2f9958[_0x178559('0x2b')]=_0x2f9958[_0x178559('0x2b')][_0x178559('0x31')]?_0x2f9958[_0x178559('0x2b')]:_0x141ae0[_0x178559('0x8')];typeof _0xa082c8[_0x178559('0x1e')][_0x178559('0x27')]===_0x178559('0x19')&&(_0x2f9958[_0x178559('0x12')]=qs[_0x178559('0x12')](_0xa082c8[_0x178559('0x1e')][_0x178559('0x12')]),_0x2f9958['offset']=qs[_0x178559('0x2c')](_0xa082c8[_0x178559('0x1e')][_0x178559('0x2c')]));_0x2f9958['order']=qs[_0x178559('0xc')](_0xa082c8[_0x178559('0x1e')][_0x178559('0xc')]),_0x2f9958[_0x178559('0x32')]=qs[_0x178559('0x1b')](_[_0x178559('0x2d')](_0xa082c8[_0x178559('0x1e')],_0x141ae0['filters']),_0xfada7d);_0xa082c8[_0x178559('0x1e')]['filter']&&(_0x2f9958[_0x178559('0x32')]=_['merge'](_0x2f9958[_0x178559('0x32')],{[Op['or']]:_[_0x178559('0x25')](_0xfada7d,function(_0x2823ec){const _0x5e6b9a=_0x178559;if(_0x2823ec['type']!==_0x5e6b9a('0x20')){const _0x73fe91={};return _0x73fe91[_0x2823ec[_0x5e6b9a('0x2f')]]={[Op[_0x5e6b9a('0x29')]]:'%'+_0xa082c8[_0x5e6b9a('0x1e')][_0x5e6b9a('0x0')]+'%'},_0x73fe91;}})}));_0x2f9958=_[_0x178559('0x23')]({},_0x2f9958,_0xa082c8[_0x178559('0x7')]);const _0x299c9c={'where':_0x2f9958[_0x178559('0x32')]};return db[_0x178559('0x11')]['count'](_0x299c9c)['then'](function(_0x31de3c){const _0x1834f6=_0x178559;return _0x286367['count']=_0x31de3c,_0xa082c8[_0x1834f6('0x1e')][_0x1834f6('0x22')]&&(_0x2f9958[_0x1834f6('0x2')]=[{'all':!![]}]),db[_0x1834f6('0x11')][_0x1834f6('0x24')](_0x2f9958);})[_0x178559('0x1a')](function(_0xa0cd96){return _0x286367['rows']=_0xa0cd96,_0x286367;})[_0x178559('0x1a')](respondWithFilteredResult(_0x49ccb5,_0x2f9958))[_0x178559('0x6')](handleError(_0x49ccb5,null));},exports['show']=function(_0x5b9624,_0x433be0){const _0x1b0a3f=_0x245ebd;let _0x1a4138={'raw':![],'where':{'id':_0x5b9624[_0x1b0a3f('0x3')]['id']}};const _0x3798d0={};return _0x3798d0['model']=_[_0x1b0a3f('0xd')](db[_0x1b0a3f('0x11')][_0x1b0a3f('0xa')]),_0x3798d0['query']=_[_0x1b0a3f('0xd')](_0x5b9624[_0x1b0a3f('0x1e')]),_0x3798d0[_0x1b0a3f('0x1b')]=_[_0x1b0a3f('0x1d')](_0x3798d0[_0x1b0a3f('0x8')],_0x3798d0['query']),_0x1a4138[_0x1b0a3f('0x2b')]=_['intersection'](_0x3798d0[_0x1b0a3f('0x8')],qs[_0x1b0a3f('0xf')](_0x5b9624[_0x1b0a3f('0x1e')][_0x1b0a3f('0xf')])),_0x1a4138[_0x1b0a3f('0x2b')]=_0x1a4138[_0x1b0a3f('0x2b')][_0x1b0a3f('0x31')]?_0x1a4138[_0x1b0a3f('0x2b')]:_0x3798d0[_0x1b0a3f('0x8')],_0x5b9624[_0x1b0a3f('0x1e')]['includeAll']&&(_0x1a4138[_0x1b0a3f('0x2')]=[{'all':!![]}]),_0x1a4138=_[_0x1b0a3f('0x23')]({},_0x1a4138,_0x5b9624[_0x1b0a3f('0x7')]),db[_0x1b0a3f('0x11')][_0x1b0a3f('0x2e')](_0x1a4138)['then'](handleEntityNotFound(_0x433be0,null))[_0x1b0a3f('0x1a')](respondWithResult(_0x433be0,null))[_0x1b0a3f('0x6')](handleError(_0x433be0,null));},exports[_0x245ebd('0x1')]=function(_0x3aaa41,_0x589a10){const _0x3d401c=_0x245ebd;return db[_0x3d401c('0x11')][_0x3d401c('0x1')](_0x3aaa41[_0x3d401c('0xb')],{})[_0x3d401c('0x1a')](respondWithResult(_0x589a10,0xc9))['catch'](handleError(_0x589a10,null));},exports['update']=function(_0x56d6fd,_0x4dcee4){const _0x433c79=_0x245ebd;return _0x56d6fd['body']['id']&&delete _0x56d6fd['body']['id'],db[_0x433c79('0x11')]['findOne']({'where':{'id':_0x56d6fd[_0x433c79('0x3')]['id']}})[_0x433c79('0x1a')](handleEntityNotFound(_0x4dcee4,null))['then'](saveUpdates(_0x56d6fd['body'],null))[_0x433c79('0x1a')](respondWithResult(_0x4dcee4,null))[_0x433c79('0x6')](handleError(_0x4dcee4,null));},exports[_0x245ebd('0x16')]=function(_0x25ded9,_0x102235){const _0xa8406=_0x245ebd;return db[_0xa8406('0x11')][_0xa8406('0x2e')]({'where':{'id':_0x25ded9[_0xa8406('0x3')]['id']}})[_0xa8406('0x1a')](handleEntityNotFound(_0x102235,null))['then'](removeEntity(_0x102235,null))[_0xa8406('0x6')](handleError(_0x102235,null));},exports[_0x245ebd('0x1f')]=function(_0x5d885c,_0x2e0c8a){const _0x58cc1e=_0x245ebd;return db['UserProfileResource']['describe']()[_0x58cc1e('0x1a')](respondWithResult(_0x2e0c8a,null))['catch'](handleError(_0x2e0c8a,null));};
\ No newline at end of file