Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / userProfileSection / userProfileSection.controller.js
index 654f60d..44ad8d1 100644 (file)
@@ -1 +1 @@
-const a812_0x1db0=['rawAttributes','map','json','../../config/logger','model','params','destroy','set','length','UserProfileSection','findOne','Content-Range','fields','index','limit','offset','order','rows','body','query','undefined','../../components/parsers/qs','error','VIRTUAL','keys','update','include','sendStatus','then','name','catch','end','options','intersection','../../mysqldb','api','filters','includeAll','attributes','status','count','show','merge','key','filter','describe','create','stack','where','sort'];(function(_0xc6d1ce,_0x5487a0){const _0x1db08e=function(_0x2fd949){while(--_0x2fd949){_0xc6d1ce['push'](_0xc6d1ce['shift']());}};_0x1db08e(++_0x5487a0);}(a812_0x1db0,0xce));const a812_0x2fd9=function(_0xc6d1ce,_0x5487a0){_0xc6d1ce=_0xc6d1ce-0x1d7;let _0x1db08e=a812_0x1db0[_0xc6d1ce];return _0x1db08e;};const a812_0xb05799=a812_0x2fd9;'use strict';const _=require('lodash'),qs=require(a812_0xb05799(0x1e6)),logger=require(a812_0xb05799(0x206))(a812_0xb05799(0x1f4)),{db}=require(a812_0xb05799(0x1f3)),{Op}=require('sequelize');function respondWithResult(_0xd123ed,_0x231422){return _0x231422=_0x231422||0xc8,function(_0x6314d){const _0x395b70=a812_0x2fd9;if(_0x6314d)return _0xd123ed[_0x395b70(0x1f8)](_0x231422)[_0x395b70(0x205)](_0x6314d);};}function respondWithFilteredResult(_0x5ee9c3,_0x4ebe85){return function(_0x582a7c){const _0x200735=a812_0x2fd9;if(_0x582a7c){const _0x53036e=_0x582a7c[_0x200735(0x1f9)],_0x3ba8d5=_0x4ebe85[_0x200735(0x1e0)];let _0x4d88eb=_0x4ebe85[_0x200735(0x1e0)]+_0x4ebe85[_0x200735(0x1df)],_0x105562;return _0x4d88eb>=_0x53036e?(_0x4d88eb=_0x53036e,_0x105562=0xc8):_0x105562=0xce,_0x5ee9c3[_0x200735(0x1f8)](_0x105562),_0x5ee9c3[_0x200735(0x1d8)](_0x200735(0x1dc),_0x3ba8d5+'-'+_0x4d88eb+'/'+_0x53036e)[_0x200735(0x205)](_0x582a7c);}return null;};}function saveUpdates(_0x2c58c1){return function(_0x40861e){const _0x67a1c5=a812_0x2fd9;if(_0x40861e)return _0x40861e['update'](_0x2c58c1)[_0x67a1c5(0x1ed)](function(_0x424029){return _0x424029;});return null;};}function removeEntity(_0x316c00){return function(_0x4d3102){const _0x1fcd88=a812_0x2fd9;if(_0x4d3102)return _0x4d3102[_0x1fcd88(0x1d7)]()[_0x1fcd88(0x1ed)](function(){const _0x5be482=_0x1fcd88;_0x316c00[_0x5be482(0x1f8)](0xcc)[_0x5be482(0x1f0)]();});};}function handleEntityNotFound(_0x12fa83){return function(_0x45b37c){const _0x17c8f9=a812_0x2fd9;return!_0x45b37c&&_0x12fa83[_0x17c8f9(0x1ec)](0x194),_0x45b37c;};}function handleError(_0x46ffb4,_0x28f84c){return _0x28f84c=_0x28f84c||0x1f4,function(_0x1b0d97){const _0x125c2a=a812_0x2fd9;logger[_0x125c2a(0x1e7)](_0x1b0d97[_0x125c2a(0x200)]),_0x1b0d97[_0x125c2a(0x1ee)]&&delete _0x1b0d97[_0x125c2a(0x1ee)],_0x46ffb4[_0x125c2a(0x1f8)](_0x28f84c)['send'](_0x1b0d97);};}exports[a812_0xb05799(0x1de)]=function(_0x4bcaa1,_0x31e428){const _0x200b42=a812_0xb05799;let _0x117ff2={};const _0x65f489={},_0x3af469={'count':0x0,'rows':[]},_0x26180e=_[_0x200b42(0x204)](db[_0x200b42(0x1da)][_0x200b42(0x203)],function(_0x47c3d7){const _0x8f21d3=_0x200b42;return{'name':_0x47c3d7['fieldName'],'type':_0x47c3d7['type'][_0x8f21d3(0x1fc)]};});_0x65f489['model']=_['map'](_0x26180e,_0x200b42(0x1ee)),_0x65f489['query']=_[_0x200b42(0x1e9)](_0x4bcaa1[_0x200b42(0x1e4)]),_0x65f489[_0x200b42(0x1f5)]=_[_0x200b42(0x1f2)](_0x65f489[_0x200b42(0x207)],_0x65f489[_0x200b42(0x1e4)]),_0x117ff2[_0x200b42(0x1f7)]=_['intersection'](_0x65f489[_0x200b42(0x207)],qs[_0x200b42(0x1dd)](_0x4bcaa1[_0x200b42(0x1e4)][_0x200b42(0x1dd)])),_0x117ff2['attributes']=_0x117ff2['attributes'][_0x200b42(0x1d9)]?_0x117ff2[_0x200b42(0x1f7)]:_0x65f489[_0x200b42(0x207)];typeof _0x4bcaa1[_0x200b42(0x1e4)]['nolimit']===_0x200b42(0x1e5)&&(_0x117ff2[_0x200b42(0x1df)]=qs['limit'](_0x4bcaa1['query'][_0x200b42(0x1df)]),_0x117ff2[_0x200b42(0x1e0)]=qs[_0x200b42(0x1e0)](_0x4bcaa1[_0x200b42(0x1e4)][_0x200b42(0x1e0)]));_0x117ff2[_0x200b42(0x1e1)]=qs[_0x200b42(0x202)](_0x4bcaa1[_0x200b42(0x1e4)][_0x200b42(0x202)]),_0x117ff2[_0x200b42(0x201)]=qs[_0x200b42(0x1f5)](_['pick'](_0x4bcaa1[_0x200b42(0x1e4)],_0x65f489[_0x200b42(0x1f5)]),_0x26180e);_0x4bcaa1['query'][_0x200b42(0x1fd)]&&(_0x117ff2[_0x200b42(0x201)]=_[_0x200b42(0x1fb)](_0x117ff2[_0x200b42(0x201)],{[Op['or']]:_['map'](_0x26180e,function(_0x85b927){const _0x2a17df=_0x200b42;if(_0x85b927['type']!==_0x2a17df(0x1e8)){const _0x31d1d9={};return _0x31d1d9[_0x85b927['name']]={[Op['like']]:'%'+_0x4bcaa1[_0x2a17df(0x1e4)][_0x2a17df(0x1fd)]+'%'},_0x31d1d9;}})}));_0x117ff2=_[_0x200b42(0x1fb)]({},_0x117ff2,_0x4bcaa1['options']);const _0x438c32={'where':_0x117ff2['where']};return db[_0x200b42(0x1da)][_0x200b42(0x1f9)](_0x438c32)[_0x200b42(0x1ed)](function(_0x529ea4){const _0x366764=_0x200b42;return _0x3af469[_0x366764(0x1f9)]=_0x529ea4,_0x4bcaa1[_0x366764(0x1e4)][_0x366764(0x1f6)]&&(_0x117ff2[_0x366764(0x1eb)]=[{'all':!![]}]),db[_0x366764(0x1da)]['findAll'](_0x117ff2);})['then'](function(_0x3550a5){const _0x3191f8=_0x200b42;return _0x3af469[_0x3191f8(0x1e2)]=_0x3550a5,_0x3af469;})[_0x200b42(0x1ed)](respondWithFilteredResult(_0x31e428,_0x117ff2))[_0x200b42(0x1ef)](handleError(_0x31e428,null));},exports[a812_0xb05799(0x1fa)]=function(_0x2235ae,_0x14dcbe){const _0x26c215=a812_0xb05799;let _0x1853a4={'raw':![],'where':{'id':_0x2235ae['params']['id']}};const _0x78a993={};return _0x78a993[_0x26c215(0x207)]=_['keys'](db[_0x26c215(0x1da)][_0x26c215(0x203)]),_0x78a993[_0x26c215(0x1e4)]=_[_0x26c215(0x1e9)](_0x2235ae[_0x26c215(0x1e4)]),_0x78a993['filters']=_[_0x26c215(0x1f2)](_0x78a993[_0x26c215(0x207)],_0x78a993[_0x26c215(0x1e4)]),_0x1853a4[_0x26c215(0x1f7)]=_[_0x26c215(0x1f2)](_0x78a993[_0x26c215(0x207)],qs['fields'](_0x2235ae[_0x26c215(0x1e4)]['fields'])),_0x1853a4['attributes']=_0x1853a4['attributes']['length']?_0x1853a4[_0x26c215(0x1f7)]:_0x78a993[_0x26c215(0x207)],_0x2235ae[_0x26c215(0x1e4)][_0x26c215(0x1f6)]&&(_0x1853a4['include']=[{'all':!![]}]),_0x1853a4=_['merge']({},_0x1853a4,_0x2235ae[_0x26c215(0x1f1)]),db['UserProfileSection']['findOne'](_0x1853a4)[_0x26c215(0x1ed)](handleEntityNotFound(_0x14dcbe,null))['then'](respondWithResult(_0x14dcbe,null))['catch'](handleError(_0x14dcbe,null));},exports[a812_0xb05799(0x1ff)]=function(_0x3ccd86,_0x5c8b83){const _0x281240=a812_0xb05799;return db[_0x281240(0x1da)][_0x281240(0x1ff)](_0x3ccd86[_0x281240(0x1e3)],{})['then'](respondWithResult(_0x5c8b83,0xc9))['catch'](handleError(_0x5c8b83,null));},exports[a812_0xb05799(0x1ea)]=function(_0x464f90,_0x22ee6a){const _0x46d8a4=a812_0xb05799;return _0x464f90[_0x46d8a4(0x1e3)]['id']&&delete _0x464f90[_0x46d8a4(0x1e3)]['id'],db[_0x46d8a4(0x1da)][_0x46d8a4(0x1db)]({'where':{'id':_0x464f90[_0x46d8a4(0x208)]['id']}})['then'](handleEntityNotFound(_0x22ee6a,null))[_0x46d8a4(0x1ed)](saveUpdates(_0x464f90[_0x46d8a4(0x1e3)],null))[_0x46d8a4(0x1ed)](respondWithResult(_0x22ee6a,null))['catch'](handleError(_0x22ee6a,null));},exports[a812_0xb05799(0x1d7)]=function(_0x82feab,_0x18ff27){const _0x39521b=a812_0xb05799;return db[_0x39521b(0x1da)][_0x39521b(0x1db)]({'where':{'id':_0x82feab[_0x39521b(0x208)]['id']}})['then'](handleEntityNotFound(_0x18ff27,null))[_0x39521b(0x1ed)](removeEntity(_0x18ff27,null))[_0x39521b(0x1ef)](handleError(_0x18ff27,null));},exports[a812_0xb05799(0x1fe)]=function(_0x122b61,_0x4eb79a){const _0x5aa8d5=a812_0xb05799;return db['UserProfileSection'][_0x5aa8d5(0x1fe)]()['then'](respondWithResult(_0x4eb79a,null))[_0x5aa8d5(0x1ef)](handleError(_0x4eb79a,null));};
\ No newline at end of file
+const a812_0x531c=['key','undefined','offset','sendStatus','name','then','findOne','model','catch','status','set','map','Content-Range','UserProfileSection','body','type','rawAttributes','attributes','../../config/logger','query','intersection','nolimit','fieldName','include','describe','filters','count','stack','destroy','includeAll','error','create','index','where','params','findAll','sequelize','VIRTUAL','options','json','send','fields','update','length','pick','sort','merge','api','keys','limit','end','../../mysqldb'];(function(_0x9e4d27,_0x532324){const _0x531c16=function(_0x8e51d4){while(--_0x8e51d4){_0x9e4d27['push'](_0x9e4d27['shift']());}};_0x531c16(++_0x532324);}(a812_0x531c,0x12c));const a812_0x8e51=function(_0x9e4d27,_0x532324){_0x9e4d27=_0x9e4d27-0x153;let _0x531c16=a812_0x531c[_0x9e4d27];return _0x531c16;};const a812_0x249bf3=a812_0x8e51;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(a812_0x249bf3(0x171))(a812_0x249bf3(0x15a)),{db}=require(a812_0x249bf3(0x15e)),{Op}=require(a812_0x249bf3(0x183));function respondWithResult(_0x4001e,_0x2a0334){return _0x2a0334=_0x2a0334||0xc8,function(_0x22805b){const _0x1b797a=a812_0x8e51;if(_0x22805b)return _0x4001e[_0x1b797a(0x168)](_0x2a0334)[_0x1b797a(0x186)](_0x22805b);};}function respondWithFilteredResult(_0x21207d,_0xcc5e11){return function(_0x5bb6b1){const _0x5803d3=a812_0x8e51;if(_0x5bb6b1){const _0x36900d=_0x5bb6b1['count'],_0x2b7325=_0xcc5e11[_0x5803d3(0x161)];let _0x310401=_0xcc5e11['offset']+_0xcc5e11[_0x5803d3(0x15c)],_0x283d3e;return _0x310401>=_0x36900d?(_0x310401=_0x36900d,_0x283d3e=0xc8):_0x283d3e=0xce,_0x21207d[_0x5803d3(0x168)](_0x283d3e),_0x21207d[_0x5803d3(0x169)](_0x5803d3(0x16b),_0x2b7325+'-'+_0x310401+'/'+_0x36900d)['json'](_0x5bb6b1);}return null;};}function saveUpdates(_0x59d684){return function(_0x4fb61e){const _0x180020=a812_0x8e51;if(_0x4fb61e)return _0x4fb61e[_0x180020(0x155)](_0x59d684)[_0x180020(0x164)](function(_0x2b47ab){return _0x2b47ab;});return null;};}function removeEntity(_0x5a0e3d){return function(_0x30d184){const _0x47c6a9=a812_0x8e51;if(_0x30d184)return _0x30d184[_0x47c6a9(0x17b)]()['then'](function(){const _0x493665=_0x47c6a9;_0x5a0e3d['status'](0xcc)[_0x493665(0x15d)]();});};}function handleEntityNotFound(_0x57ea70){return function(_0x4633e0){const _0x15a8f2=a812_0x8e51;return!_0x4633e0&&_0x57ea70[_0x15a8f2(0x162)](0x194),_0x4633e0;};}function handleError(_0x54dc49,_0x3a394e){return _0x3a394e=_0x3a394e||0x1f4,function(_0x55bb2f){const _0x53f5b7=a812_0x8e51;logger[_0x53f5b7(0x17d)](_0x55bb2f[_0x53f5b7(0x17a)]),_0x55bb2f[_0x53f5b7(0x163)]&&delete _0x55bb2f[_0x53f5b7(0x163)],_0x54dc49[_0x53f5b7(0x168)](_0x3a394e)[_0x53f5b7(0x153)](_0x55bb2f);};}exports[a812_0x249bf3(0x17f)]=function(_0x3ca233,_0xa35347){const _0x5a043b=a812_0x249bf3;let _0x4d2ddc={};const _0x5e5cda={},_0x230453={'count':0x0,'rows':[]},_0x378b4f=_[_0x5a043b(0x16a)](db[_0x5a043b(0x16c)][_0x5a043b(0x16f)],function(_0x103ccb){const _0x12b6d6=_0x5a043b;return{'name':_0x103ccb[_0x12b6d6(0x175)],'type':_0x103ccb[_0x12b6d6(0x16e)][_0x12b6d6(0x15f)]};});_0x5e5cda['model']=_[_0x5a043b(0x16a)](_0x378b4f,_0x5a043b(0x163)),_0x5e5cda['query']=_[_0x5a043b(0x15b)](_0x3ca233[_0x5a043b(0x172)]),_0x5e5cda['filters']=_[_0x5a043b(0x173)](_0x5e5cda[_0x5a043b(0x166)],_0x5e5cda['query']),_0x4d2ddc[_0x5a043b(0x170)]=_[_0x5a043b(0x173)](_0x5e5cda['model'],qs[_0x5a043b(0x154)](_0x3ca233[_0x5a043b(0x172)][_0x5a043b(0x154)])),_0x4d2ddc[_0x5a043b(0x170)]=_0x4d2ddc[_0x5a043b(0x170)][_0x5a043b(0x156)]?_0x4d2ddc[_0x5a043b(0x170)]:_0x5e5cda['model'];typeof _0x3ca233[_0x5a043b(0x172)][_0x5a043b(0x174)]===_0x5a043b(0x160)&&(_0x4d2ddc['limit']=qs[_0x5a043b(0x15c)](_0x3ca233[_0x5a043b(0x172)][_0x5a043b(0x15c)]),_0x4d2ddc['offset']=qs[_0x5a043b(0x161)](_0x3ca233[_0x5a043b(0x172)][_0x5a043b(0x161)]));_0x4d2ddc['order']=qs[_0x5a043b(0x158)](_0x3ca233['query'][_0x5a043b(0x158)]),_0x4d2ddc[_0x5a043b(0x180)]=qs[_0x5a043b(0x178)](_[_0x5a043b(0x157)](_0x3ca233['query'],_0x5e5cda[_0x5a043b(0x178)]),_0x378b4f);_0x3ca233[_0x5a043b(0x172)]['filter']&&(_0x4d2ddc[_0x5a043b(0x180)]=_[_0x5a043b(0x159)](_0x4d2ddc[_0x5a043b(0x180)],{[Op['or']]:_['map'](_0x378b4f,function(_0x1e0d44){const _0x26c13a=_0x5a043b;if(_0x1e0d44['type']!==_0x26c13a(0x184)){const _0x32ad7a={};return _0x32ad7a[_0x1e0d44[_0x26c13a(0x163)]]={[Op['like']]:'%'+_0x3ca233[_0x26c13a(0x172)]['filter']+'%'},_0x32ad7a;}})}));_0x4d2ddc=_[_0x5a043b(0x159)]({},_0x4d2ddc,_0x3ca233[_0x5a043b(0x185)]);const _0x1d5eb1={'where':_0x4d2ddc[_0x5a043b(0x180)]};return db['UserProfileSection'][_0x5a043b(0x179)](_0x1d5eb1)[_0x5a043b(0x164)](function(_0x243e9d){const _0x1f417b=_0x5a043b;return _0x230453[_0x1f417b(0x179)]=_0x243e9d,_0x3ca233['query'][_0x1f417b(0x17c)]&&(_0x4d2ddc[_0x1f417b(0x176)]=[{'all':!![]}]),db[_0x1f417b(0x16c)][_0x1f417b(0x182)](_0x4d2ddc);})[_0x5a043b(0x164)](function(_0xfda75c){return _0x230453['rows']=_0xfda75c,_0x230453;})[_0x5a043b(0x164)](respondWithFilteredResult(_0xa35347,_0x4d2ddc))['catch'](handleError(_0xa35347,null));},exports['show']=function(_0x341d66,_0xa93eb1){const _0x5af6e8=a812_0x249bf3;let _0x388062={'raw':![],'where':{'id':_0x341d66[_0x5af6e8(0x181)]['id']}};const _0x233e5c={};return _0x233e5c[_0x5af6e8(0x166)]=_['keys'](db[_0x5af6e8(0x16c)][_0x5af6e8(0x16f)]),_0x233e5c['query']=_['keys'](_0x341d66['query']),_0x233e5c['filters']=_['intersection'](_0x233e5c[_0x5af6e8(0x166)],_0x233e5c[_0x5af6e8(0x172)]),_0x388062[_0x5af6e8(0x170)]=_[_0x5af6e8(0x173)](_0x233e5c[_0x5af6e8(0x166)],qs['fields'](_0x341d66['query']['fields'])),_0x388062[_0x5af6e8(0x170)]=_0x388062[_0x5af6e8(0x170)][_0x5af6e8(0x156)]?_0x388062[_0x5af6e8(0x170)]:_0x233e5c[_0x5af6e8(0x166)],_0x341d66[_0x5af6e8(0x172)][_0x5af6e8(0x17c)]&&(_0x388062[_0x5af6e8(0x176)]=[{'all':!![]}]),_0x388062=_[_0x5af6e8(0x159)]({},_0x388062,_0x341d66[_0x5af6e8(0x185)]),db[_0x5af6e8(0x16c)][_0x5af6e8(0x165)](_0x388062)[_0x5af6e8(0x164)](handleEntityNotFound(_0xa93eb1,null))[_0x5af6e8(0x164)](respondWithResult(_0xa93eb1,null))[_0x5af6e8(0x167)](handleError(_0xa93eb1,null));},exports['create']=function(_0x377911,_0x2cb265){const _0x594725=a812_0x249bf3;return db[_0x594725(0x16c)][_0x594725(0x17e)](_0x377911['body'],{})[_0x594725(0x164)](respondWithResult(_0x2cb265,0xc9))[_0x594725(0x167)](handleError(_0x2cb265,null));},exports['update']=function(_0x1f1c94,_0x501fae){const _0x252bab=a812_0x249bf3;return _0x1f1c94[_0x252bab(0x16d)]['id']&&delete _0x1f1c94[_0x252bab(0x16d)]['id'],db['UserProfileSection'][_0x252bab(0x165)]({'where':{'id':_0x1f1c94[_0x252bab(0x181)]['id']}})[_0x252bab(0x164)](handleEntityNotFound(_0x501fae,null))[_0x252bab(0x164)](saveUpdates(_0x1f1c94['body'],null))['then'](respondWithResult(_0x501fae,null))[_0x252bab(0x167)](handleError(_0x501fae,null));},exports[a812_0x249bf3(0x17b)]=function(_0x10e0f2,_0xdd2843){const _0x2a4793=a812_0x249bf3;return db[_0x2a4793(0x16c)][_0x2a4793(0x165)]({'where':{'id':_0x10e0f2[_0x2a4793(0x181)]['id']}})[_0x2a4793(0x164)](handleEntityNotFound(_0xdd2843,null))[_0x2a4793(0x164)](removeEntity(_0xdd2843,null))['catch'](handleError(_0xdd2843,null));},exports[a812_0x249bf3(0x177)]=function(_0x105532,_0x570f60){const _0x5b65a=a812_0x249bf3;return db[_0x5b65a(0x16c)][_0x5b65a(0x177)]()[_0x5b65a(0x164)](respondWithResult(_0x570f60,null))[_0x5b65a(0x167)](handleError(_0x570f60,null));};
\ No newline at end of file