Built motion from commit b51cdcb3f2cb46634587ce1d55ea1b8f32dacea6. Version 3.0.0...
[motion-next.git] / server / api / userProfileResource / userProfileResource.controller.js
index 554d2f8..e23acb8 100644 (file)
@@ -1 +1 @@
-const a674_0x58c6=['merge','model','stack','UserProfileResource','filters','query','error','undefined','Content-Range','describe','intersection','status','json','offset','rows','type','findOne','order','rawAttributes','count','fieldName','nolimit','sendStatus','../../mysqldb','attributes','includeAll','limit','map','options','sort','send','include','keys','params','key','show','where','like','sequelize','pick','index','../../config/logger','then','catch','findAll','update','create','length','fields','name','lodash','api','filter','body','destroy'];(function(_0x43f7af,_0x58c63a){const _0x17be3a=function(_0x103ede){while(--_0x103ede){_0x43f7af['push'](_0x43f7af['shift']());}};_0x17be3a(++_0x58c63a);}(a674_0x58c6,0x1e1));const a674_0x17be=function(_0x43f7af,_0x58c63a){_0x43f7af=_0x43f7af-0x0;let _0x17be3a=a674_0x58c6[_0x43f7af];return _0x17be3a;};const _0x115b30=a674_0x17be;'use strict';const _=require(_0x115b30('0x9')),qs=require('../../components/parsers/qs'),logger=require(_0x115b30('0x0'))(_0x115b30('0xa')),db=require(_0x115b30('0x25'))['db'],{Op}=require(_0x115b30('0x34'));function respondWithResult(_0x103ede,_0x35a3cb){return _0x35a3cb=_0x35a3cb||0xc8,function(_0x59bcf3){const _0x92492=a674_0x17be;if(_0x59bcf3)return _0x103ede[_0x92492('0x19')](_0x35a3cb)[_0x92492('0x1a')](_0x59bcf3);};}function respondWithFilteredResult(_0x3c2e76,_0x1abc07){return function(_0x2da62f){const _0x52dfe1=a674_0x17be;if(_0x2da62f){const _0x3d0456=_0x2da62f[_0x52dfe1('0x21')],_0x4a523a=_0x1abc07[_0x52dfe1('0x1b')];let _0x17a5a4=_0x1abc07[_0x52dfe1('0x1b')]+_0x1abc07[_0x52dfe1('0x28')],_0x5171a3;return _0x17a5a4>=_0x3d0456?(_0x17a5a4=_0x3d0456,_0x5171a3=0xc8):_0x5171a3=0xce,_0x3c2e76[_0x52dfe1('0x19')](_0x5171a3),_0x3c2e76['set'](_0x52dfe1('0x16'),_0x4a523a+'-'+_0x17a5a4+'/'+_0x3d0456)[_0x52dfe1('0x1a')](_0x2da62f);}return null;};}function saveUpdates(_0x462507){return function(_0xce984d){const _0xdd4455=a674_0x17be;if(_0xce984d)return _0xce984d[_0xdd4455('0x4')](_0x462507)['then'](function(_0x42b06){return _0x42b06;});return null;};}function removeEntity(_0x25d3d2){return function(_0x11f793){const _0x178ad5=a674_0x17be;if(_0x11f793)return _0x11f793[_0x178ad5('0xd')]()[_0x178ad5('0x1')](function(){const _0xe7b5fe=_0x178ad5;_0x25d3d2[_0xe7b5fe('0x19')](0xcc)['end']();});};}function handleEntityNotFound(_0x15461e){return function(_0x3f1103){const _0x3da107=a674_0x17be;return!_0x3f1103&&_0x15461e[_0x3da107('0x24')](0x194),_0x3f1103;};}function handleError(_0x4b8343,_0xc7bc0){return _0xc7bc0=_0xc7bc0||0x1f4,function(_0x245918){const _0xc7cd62=a674_0x17be;logger[_0xc7cd62('0x14')](_0x245918[_0xc7cd62('0x10')]),_0x245918[_0xc7cd62('0x8')]&&delete _0x245918[_0xc7cd62('0x8')],_0x4b8343[_0xc7cd62('0x19')](_0xc7bc0)[_0xc7cd62('0x2c')](_0x245918);};}exports[_0x115b30('0x36')]=function(_0x2b1740,_0x57819f){const _0x4eaf2d=_0x115b30;let _0x3d4454={};const _0x50e91b={},_0x2e68ef={'count':0x0,'rows':[]},_0x1088fd=_[_0x4eaf2d('0x29')](db['UserProfileResource'][_0x4eaf2d('0x20')],function(_0x5b7fdc){const _0x44eec5=_0x4eaf2d;return{'name':_0x5b7fdc[_0x44eec5('0x22')],'type':_0x5b7fdc[_0x44eec5('0x1d')][_0x44eec5('0x30')]};});_0x50e91b['model']=_[_0x4eaf2d('0x29')](_0x1088fd,'name'),_0x50e91b[_0x4eaf2d('0x13')]=_[_0x4eaf2d('0x2e')](_0x2b1740[_0x4eaf2d('0x13')]),_0x50e91b['filters']=_['intersection'](_0x50e91b['model'],_0x50e91b[_0x4eaf2d('0x13')]),_0x3d4454[_0x4eaf2d('0x26')]=_['intersection'](_0x50e91b[_0x4eaf2d('0xf')],qs[_0x4eaf2d('0x7')](_0x2b1740[_0x4eaf2d('0x13')]['fields'])),_0x3d4454[_0x4eaf2d('0x26')]=_0x3d4454[_0x4eaf2d('0x26')][_0x4eaf2d('0x6')]?_0x3d4454[_0x4eaf2d('0x26')]:_0x50e91b[_0x4eaf2d('0xf')];typeof _0x2b1740[_0x4eaf2d('0x13')][_0x4eaf2d('0x23')]===_0x4eaf2d('0x15')&&(_0x3d4454[_0x4eaf2d('0x28')]=qs['limit'](_0x2b1740[_0x4eaf2d('0x13')][_0x4eaf2d('0x28')]),_0x3d4454[_0x4eaf2d('0x1b')]=qs[_0x4eaf2d('0x1b')](_0x2b1740[_0x4eaf2d('0x13')]['offset']));_0x3d4454[_0x4eaf2d('0x1f')]=qs[_0x4eaf2d('0x2b')](_0x2b1740['query']['sort']),_0x3d4454[_0x4eaf2d('0x32')]=qs[_0x4eaf2d('0x12')](_[_0x4eaf2d('0x35')](_0x2b1740[_0x4eaf2d('0x13')],_0x50e91b[_0x4eaf2d('0x12')]),_0x1088fd);_0x2b1740[_0x4eaf2d('0x13')][_0x4eaf2d('0xb')]&&(_0x3d4454[_0x4eaf2d('0x32')]=_[_0x4eaf2d('0xe')](_0x3d4454['where'],{[Op['or']]:_[_0x4eaf2d('0x29')](_0x1088fd,function(_0x8bfd8c){const _0x4b6eb9=_0x4eaf2d;if(_0x8bfd8c[_0x4b6eb9('0x1d')]!=='VIRTUAL'){const _0x1f3b6a={};return _0x1f3b6a[_0x8bfd8c[_0x4b6eb9('0x8')]]={[Op[_0x4b6eb9('0x33')]]:'%'+_0x2b1740[_0x4b6eb9('0x13')][_0x4b6eb9('0xb')]+'%'},_0x1f3b6a;}})}));_0x3d4454=_[_0x4eaf2d('0xe')]({},_0x3d4454,_0x2b1740[_0x4eaf2d('0x2a')]);const _0x4a9414={'where':_0x3d4454[_0x4eaf2d('0x32')]};return db[_0x4eaf2d('0x11')][_0x4eaf2d('0x21')](_0x4a9414)[_0x4eaf2d('0x1')](function(_0x3692d3){const _0x3f95ef=_0x4eaf2d;return _0x2e68ef[_0x3f95ef('0x21')]=_0x3692d3,_0x2b1740[_0x3f95ef('0x13')][_0x3f95ef('0x27')]&&(_0x3d4454['include']=[{'all':!![]}]),db[_0x3f95ef('0x11')][_0x3f95ef('0x3')](_0x3d4454);})[_0x4eaf2d('0x1')](function(_0x4b02b1){const _0x598d87=_0x4eaf2d;return _0x2e68ef[_0x598d87('0x1c')]=_0x4b02b1,_0x2e68ef;})[_0x4eaf2d('0x1')](respondWithFilteredResult(_0x57819f,_0x3d4454))['catch'](handleError(_0x57819f,null));},exports[_0x115b30('0x31')]=function(_0x1cb3bd,_0xa8fa06){const _0x240324=_0x115b30;let _0x2ec662={'raw':![],'where':{'id':_0x1cb3bd[_0x240324('0x2f')]['id']}};const _0x54486d={};return _0x54486d[_0x240324('0xf')]=_[_0x240324('0x2e')](db[_0x240324('0x11')][_0x240324('0x20')]),_0x54486d[_0x240324('0x13')]=_[_0x240324('0x2e')](_0x1cb3bd[_0x240324('0x13')]),_0x54486d['filters']=_['intersection'](_0x54486d['model'],_0x54486d[_0x240324('0x13')]),_0x2ec662[_0x240324('0x26')]=_[_0x240324('0x18')](_0x54486d[_0x240324('0xf')],qs[_0x240324('0x7')](_0x1cb3bd[_0x240324('0x13')]['fields'])),_0x2ec662['attributes']=_0x2ec662[_0x240324('0x26')][_0x240324('0x6')]?_0x2ec662[_0x240324('0x26')]:_0x54486d[_0x240324('0xf')],_0x1cb3bd[_0x240324('0x13')][_0x240324('0x27')]&&(_0x2ec662[_0x240324('0x2d')]=[{'all':!![]}]),_0x2ec662=_[_0x240324('0xe')]({},_0x2ec662,_0x1cb3bd['options']),db[_0x240324('0x11')][_0x240324('0x1e')](_0x2ec662)[_0x240324('0x1')](handleEntityNotFound(_0xa8fa06,null))[_0x240324('0x1')](respondWithResult(_0xa8fa06,null))[_0x240324('0x2')](handleError(_0xa8fa06,null));},exports['create']=function(_0x17f5b1,_0x1a27d7){const _0x8ff0cc=_0x115b30;return db[_0x8ff0cc('0x11')][_0x8ff0cc('0x5')](_0x17f5b1[_0x8ff0cc('0xc')],{})[_0x8ff0cc('0x1')](respondWithResult(_0x1a27d7,0xc9))[_0x8ff0cc('0x2')](handleError(_0x1a27d7,null));},exports[_0x115b30('0x4')]=function(_0x3685ee,_0x2aa6a7){const _0x385b70=_0x115b30;return _0x3685ee[_0x385b70('0xc')]['id']&&delete _0x3685ee[_0x385b70('0xc')]['id'],db['UserProfileResource'][_0x385b70('0x1e')]({'where':{'id':_0x3685ee[_0x385b70('0x2f')]['id']}})[_0x385b70('0x1')](handleEntityNotFound(_0x2aa6a7,null))[_0x385b70('0x1')](saveUpdates(_0x3685ee[_0x385b70('0xc')],null))[_0x385b70('0x1')](respondWithResult(_0x2aa6a7,null))[_0x385b70('0x2')](handleError(_0x2aa6a7,null));},exports['destroy']=function(_0x8f34d1,_0x2dbea2){const _0x5c0048=_0x115b30;return db[_0x5c0048('0x11')][_0x5c0048('0x1e')]({'where':{'id':_0x8f34d1[_0x5c0048('0x2f')]['id']}})[_0x5c0048('0x1')](handleEntityNotFound(_0x2dbea2,null))['then'](removeEntity(_0x2dbea2,null))[_0x5c0048('0x2')](handleError(_0x2dbea2,null));},exports['describe']=function(_0xa46d7f,_0x4182e1){const _0x2152bf=_0x115b30;return db[_0x2152bf('0x11')][_0x2152bf('0x17')]()[_0x2152bf('0x1')](respondWithResult(_0x4182e1,null))[_0x2152bf('0x2')](handleError(_0x4182e1,null));};
\ No newline at end of file
+const a674_0xd887=['sort','lodash','model','like','offset','describe','set','end','show','rawAttributes','sendStatus','name','attributes','pick','include','../../components/parsers/qs','destroy','json','merge','count','keys','error','create','includeAll','../../mysqldb','filter','length','options','stack','findOne','query','VIRTUAL','params','fields','intersection','type','UserProfileResource','api','fieldName','update','map','limit','catch','where','status','body','send','then'];(function(_0x565a83,_0xd887be){const _0x52f22d=function(_0x3486e5){while(--_0x3486e5){_0x565a83['push'](_0x565a83['shift']());}};_0x52f22d(++_0xd887be);}(a674_0xd887,0xe3));const a674_0x52f2=function(_0x565a83,_0xd887be){_0x565a83=_0x565a83-0x0;let _0x52f22d=a674_0xd887[_0x565a83];return _0x52f22d;};const _0x47bf31=a674_0x52f2;'use strict';const _=require(_0x47bf31('0xe')),qs=require(_0x47bf31('0x1c')),logger=require('../../config/logger')(_0x47bf31('0x2')),db=require(_0x47bf31('0x25'))['db'],{Op}=require('sequelize');function respondWithResult(_0x3486e5,_0x3f3553){return _0x3f3553=_0x3f3553||0xc8,function(_0x4cbdc2){const _0x3071da=a674_0x52f2;if(_0x4cbdc2)return _0x3486e5[_0x3071da('0x9')](_0x3f3553)[_0x3071da('0x1e')](_0x4cbdc2);};}function respondWithFilteredResult(_0x6ad954,_0xd83c91){return function(_0x5187ca){const _0x13c9f4=a674_0x52f2;if(_0x5187ca){const _0x5e681e=_0x5187ca[_0x13c9f4('0x20')],_0x1413c2=_0xd83c91[_0x13c9f4('0x11')];let _0x112881=_0xd83c91[_0x13c9f4('0x11')]+_0xd83c91[_0x13c9f4('0x6')],_0x547799;return _0x112881>=_0x5e681e?(_0x112881=_0x5e681e,_0x547799=0xc8):_0x547799=0xce,_0x6ad954['status'](_0x547799),_0x6ad954[_0x13c9f4('0x13')]('Content-Range',_0x1413c2+'-'+_0x112881+'/'+_0x5e681e)[_0x13c9f4('0x1e')](_0x5187ca);}return null;};}function saveUpdates(_0x1a0faa){return function(_0x3603ce){const _0x4a5bee=a674_0x52f2;if(_0x3603ce)return _0x3603ce[_0x4a5bee('0x4')](_0x1a0faa)[_0x4a5bee('0xc')](function(_0x1adeb0){return _0x1adeb0;});return null;};}function removeEntity(_0x558e26){return function(_0x2c99b5){const _0x52df64=a674_0x52f2;if(_0x2c99b5)return _0x2c99b5[_0x52df64('0x1d')]()[_0x52df64('0xc')](function(){const _0x217811=_0x52df64;_0x558e26['status'](0xcc)[_0x217811('0x14')]();});};}function handleEntityNotFound(_0x7f48ae){return function(_0xd254c4){const _0x179bd9=a674_0x52f2;return!_0xd254c4&&_0x7f48ae[_0x179bd9('0x17')](0x194),_0xd254c4;};}function handleError(_0x3cb1ff,_0x21ec66){return _0x21ec66=_0x21ec66||0x1f4,function(_0x2a51bc){const _0x3f4d9c=a674_0x52f2;logger[_0x3f4d9c('0x22')](_0x2a51bc[_0x3f4d9c('0x29')]),_0x2a51bc[_0x3f4d9c('0x18')]&&delete _0x2a51bc[_0x3f4d9c('0x18')],_0x3cb1ff[_0x3f4d9c('0x9')](_0x21ec66)[_0x3f4d9c('0xb')](_0x2a51bc);};}exports['index']=function(_0x5b4562,_0x3a01c1){const _0x474098=_0x47bf31;let _0xb039f7={};const _0x2b52a7={},_0x572e1d={'count':0x0,'rows':[]},_0x164e47=_[_0x474098('0x5')](db[_0x474098('0x1')][_0x474098('0x16')],function(_0x301b35){const _0x3bd40a=_0x474098;return{'name':_0x301b35[_0x3bd40a('0x3')],'type':_0x301b35['type']['key']};});_0x2b52a7[_0x474098('0xf')]=_[_0x474098('0x5')](_0x164e47,_0x474098('0x18')),_0x2b52a7['query']=_[_0x474098('0x21')](_0x5b4562['query']),_0x2b52a7['filters']=_['intersection'](_0x2b52a7[_0x474098('0xf')],_0x2b52a7[_0x474098('0x2b')]),_0xb039f7[_0x474098('0x19')]=_[_0x474098('0x2f')](_0x2b52a7[_0x474098('0xf')],qs[_0x474098('0x2e')](_0x5b4562[_0x474098('0x2b')][_0x474098('0x2e')])),_0xb039f7[_0x474098('0x19')]=_0xb039f7[_0x474098('0x19')]['length']?_0xb039f7[_0x474098('0x19')]:_0x2b52a7['model'];typeof _0x5b4562['query']['nolimit']==='undefined'&&(_0xb039f7[_0x474098('0x6')]=qs[_0x474098('0x6')](_0x5b4562['query'][_0x474098('0x6')]),_0xb039f7[_0x474098('0x11')]=qs[_0x474098('0x11')](_0x5b4562['query'][_0x474098('0x11')]));_0xb039f7['order']=qs[_0x474098('0xd')](_0x5b4562[_0x474098('0x2b')][_0x474098('0xd')]),_0xb039f7[_0x474098('0x8')]=qs['filters'](_[_0x474098('0x1a')](_0x5b4562[_0x474098('0x2b')],_0x2b52a7['filters']),_0x164e47);_0x5b4562[_0x474098('0x2b')][_0x474098('0x26')]&&(_0xb039f7[_0x474098('0x8')]=_['merge'](_0xb039f7[_0x474098('0x8')],{[Op['or']]:_[_0x474098('0x5')](_0x164e47,function(_0x253804){const _0x40f6cb=_0x474098;if(_0x253804[_0x40f6cb('0x0')]!==_0x40f6cb('0x2c')){const _0x34cb3c={};return _0x34cb3c[_0x253804[_0x40f6cb('0x18')]]={[Op[_0x40f6cb('0x10')]]:'%'+_0x5b4562[_0x40f6cb('0x2b')]['filter']+'%'},_0x34cb3c;}})}));_0xb039f7=_[_0x474098('0x1f')]({},_0xb039f7,_0x5b4562[_0x474098('0x28')]);const _0x4f28d0={'where':_0xb039f7[_0x474098('0x8')]};return db[_0x474098('0x1')][_0x474098('0x20')](_0x4f28d0)[_0x474098('0xc')](function(_0x55e836){const _0xa05231=_0x474098;return _0x572e1d['count']=_0x55e836,_0x5b4562[_0xa05231('0x2b')][_0xa05231('0x24')]&&(_0xb039f7[_0xa05231('0x1b')]=[{'all':!![]}]),db[_0xa05231('0x1')]['findAll'](_0xb039f7);})[_0x474098('0xc')](function(_0x40544d){return _0x572e1d['rows']=_0x40544d,_0x572e1d;})['then'](respondWithFilteredResult(_0x3a01c1,_0xb039f7))[_0x474098('0x7')](handleError(_0x3a01c1,null));},exports[_0x47bf31('0x15')]=function(_0x480fe3,_0x41fc30){const _0x350bfd=_0x47bf31;let _0x464af7={'raw':![],'where':{'id':_0x480fe3['params']['id']}};const _0x353a47={};return _0x353a47[_0x350bfd('0xf')]=_[_0x350bfd('0x21')](db[_0x350bfd('0x1')][_0x350bfd('0x16')]),_0x353a47['query']=_[_0x350bfd('0x21')](_0x480fe3['query']),_0x353a47['filters']=_[_0x350bfd('0x2f')](_0x353a47[_0x350bfd('0xf')],_0x353a47[_0x350bfd('0x2b')]),_0x464af7[_0x350bfd('0x19')]=_[_0x350bfd('0x2f')](_0x353a47[_0x350bfd('0xf')],qs[_0x350bfd('0x2e')](_0x480fe3['query']['fields'])),_0x464af7[_0x350bfd('0x19')]=_0x464af7['attributes'][_0x350bfd('0x27')]?_0x464af7[_0x350bfd('0x19')]:_0x353a47[_0x350bfd('0xf')],_0x480fe3[_0x350bfd('0x2b')][_0x350bfd('0x24')]&&(_0x464af7[_0x350bfd('0x1b')]=[{'all':!![]}]),_0x464af7=_['merge']({},_0x464af7,_0x480fe3['options']),db[_0x350bfd('0x1')][_0x350bfd('0x2a')](_0x464af7)['then'](handleEntityNotFound(_0x41fc30,null))[_0x350bfd('0xc')](respondWithResult(_0x41fc30,null))['catch'](handleError(_0x41fc30,null));},exports[_0x47bf31('0x23')]=function(_0x3af938,_0x28225d){const _0x1b4464=_0x47bf31;return db[_0x1b4464('0x1')][_0x1b4464('0x23')](_0x3af938[_0x1b4464('0xa')],{})[_0x1b4464('0xc')](respondWithResult(_0x28225d,0xc9))[_0x1b4464('0x7')](handleError(_0x28225d,null));},exports[_0x47bf31('0x4')]=function(_0x2330f5,_0x21c267){const _0x685413=_0x47bf31;return _0x2330f5[_0x685413('0xa')]['id']&&delete _0x2330f5[_0x685413('0xa')]['id'],db['UserProfileResource'][_0x685413('0x2a')]({'where':{'id':_0x2330f5[_0x685413('0x2d')]['id']}})[_0x685413('0xc')](handleEntityNotFound(_0x21c267,null))[_0x685413('0xc')](saveUpdates(_0x2330f5[_0x685413('0xa')],null))['then'](respondWithResult(_0x21c267,null))['catch'](handleError(_0x21c267,null));},exports[_0x47bf31('0x1d')]=function(_0x127127,_0x45801c){const _0x151d2b=_0x47bf31;return db[_0x151d2b('0x1')][_0x151d2b('0x2a')]({'where':{'id':_0x127127['params']['id']}})['then'](handleEntityNotFound(_0x45801c,null))['then'](removeEntity(_0x45801c,null))[_0x151d2b('0x7')](handleError(_0x45801c,null));},exports[_0x47bf31('0x12')]=function(_0x29a82b,_0x457dbd){const _0x50f84e=_0x47bf31;return db['UserProfileResource'][_0x50f84e('0x12')]()[_0x50f84e('0xc')](respondWithResult(_0x457dbd,null))[_0x50f84e('0x7')](handleError(_0x457dbd,null));};
\ No newline at end of file