Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / userProfileSection / userProfileSection.controller.js
index cb36480..8cf0f55 100644 (file)
@@ -1 +1 @@
-const a678_0x1334=['show','../../mysqldb','rawAttributes','end','sort','destroy','intersection','update','stack','query','pick','like','create','sequelize','filter','fields','includeAll','nolimit','count','key','then','UserProfileSection','map','catch','body','findAll','merge','../../components/parsers/qs','offset','Content-Range','sendStatus','include','limit','params','send','options','findOne','json','where','describe','type','model','index','status','filters','length','api','../../config/logger','VIRTUAL','attributes','order','name','keys'];(function(_0x3dfa2e,_0x13344b){const _0x2db7f4=function(_0x30b269){while(--_0x30b269){_0x3dfa2e['push'](_0x3dfa2e['shift']());}};_0x2db7f4(++_0x13344b);}(a678_0x1334,0x1ce));const a678_0x2db7=function(_0x3dfa2e,_0x13344b){_0x3dfa2e=_0x3dfa2e-0x0;let _0x2db7f4=a678_0x1334[_0x3dfa2e];return _0x2db7f4;};const _0x5c3288=a678_0x2db7;'use strict';const _=require('lodash'),qs=require(_0x5c3288('0x2a')),logger=require(_0x5c3288('0x9'))(_0x5c3288('0x8')),db=require(_0x5c3288('0x10'))['db'],{Op}=require(_0x5c3288('0x1c'));function respondWithResult(_0x30b269,_0x50d1d6){return _0x50d1d6=_0x50d1d6||0xc8,function(_0x4e0b9a){const _0x3db980=a678_0x2db7;if(_0x4e0b9a)return _0x30b269[_0x3db980('0x5')](_0x50d1d6)[_0x3db980('0x34')](_0x4e0b9a);};}function respondWithFilteredResult(_0x331068,_0x4d7b1a){return function(_0x19eaba){const _0x3194c2=a678_0x2db7;if(_0x19eaba){const _0x100f8c=_0x19eaba[_0x3194c2('0x21')],_0x57bd58=_0x4d7b1a[_0x3194c2('0x2b')];let _0x42e3ef=_0x4d7b1a['offset']+_0x4d7b1a[_0x3194c2('0x2f')],_0x185822;return _0x42e3ef>=_0x100f8c?(_0x42e3ef=_0x100f8c,_0x185822=0xc8):_0x185822=0xce,_0x331068[_0x3194c2('0x5')](_0x185822),_0x331068['set'](_0x3194c2('0x2c'),_0x57bd58+'-'+_0x42e3ef+'/'+_0x100f8c)[_0x3194c2('0x34')](_0x19eaba);}return null;};}function saveUpdates(_0x3de4e1){return function(_0x4a84f3){const _0x124162=a678_0x2db7;if(_0x4a84f3)return _0x4a84f3['update'](_0x3de4e1)[_0x124162('0x23')](function(_0x29d84c){return _0x29d84c;});return null;};}function removeEntity(_0x23409a){return function(_0x7c70d5){const _0x5de97d=a678_0x2db7;if(_0x7c70d5)return _0x7c70d5[_0x5de97d('0x14')]()[_0x5de97d('0x23')](function(){const _0x4cc21a=_0x5de97d;_0x23409a[_0x4cc21a('0x5')](0xcc)[_0x4cc21a('0x12')]();});};}function handleEntityNotFound(_0x41991c){return function(_0x3bc346){const _0x3156bc=a678_0x2db7;return!_0x3bc346&&_0x41991c[_0x3156bc('0x2d')](0x194),_0x3bc346;};}function handleError(_0xbc703d,_0x40c22a){return _0x40c22a=_0x40c22a||0x1f4,function(_0x30f127){const _0x2179e8=a678_0x2db7;logger['error'](_0x30f127[_0x2179e8('0x17')]),_0x30f127[_0x2179e8('0xd')]&&delete _0x30f127[_0x2179e8('0xd')],_0xbc703d[_0x2179e8('0x5')](_0x40c22a)[_0x2179e8('0x31')](_0x30f127);};}exports[_0x5c3288('0x4')]=function(_0x25169a,_0x3f42a0){const _0x365b33=_0x5c3288;let _0x25bae9={};const _0x38e243={},_0x2698ed={'count':0x0,'rows':[]},_0x2d229f=_[_0x365b33('0x25')](db['UserProfileSection'][_0x365b33('0x11')],function(_0x3055e5){const _0x4b05c2=_0x365b33;return{'name':_0x3055e5['fieldName'],'type':_0x3055e5[_0x4b05c2('0x2')][_0x4b05c2('0x22')]};});_0x38e243[_0x365b33('0x3')]=_[_0x365b33('0x25')](_0x2d229f,_0x365b33('0xd')),_0x38e243['query']=_['keys'](_0x25169a[_0x365b33('0x18')]),_0x38e243[_0x365b33('0x6')]=_[_0x365b33('0x15')](_0x38e243[_0x365b33('0x3')],_0x38e243[_0x365b33('0x18')]),_0x25bae9['attributes']=_[_0x365b33('0x15')](_0x38e243[_0x365b33('0x3')],qs[_0x365b33('0x1e')](_0x25169a['query']['fields'])),_0x25bae9['attributes']=_0x25bae9['attributes'][_0x365b33('0x7')]?_0x25bae9['attributes']:_0x38e243[_0x365b33('0x3')];typeof _0x25169a[_0x365b33('0x18')][_0x365b33('0x20')]==='undefined'&&(_0x25bae9[_0x365b33('0x2f')]=qs[_0x365b33('0x2f')](_0x25169a[_0x365b33('0x18')][_0x365b33('0x2f')]),_0x25bae9[_0x365b33('0x2b')]=qs[_0x365b33('0x2b')](_0x25169a[_0x365b33('0x18')]['offset']));_0x25bae9[_0x365b33('0xc')]=qs[_0x365b33('0x13')](_0x25169a[_0x365b33('0x18')][_0x365b33('0x13')]),_0x25bae9['where']=qs[_0x365b33('0x6')](_[_0x365b33('0x19')](_0x25169a[_0x365b33('0x18')],_0x38e243['filters']),_0x2d229f);_0x25169a['query'][_0x365b33('0x1d')]&&(_0x25bae9[_0x365b33('0x0')]=_[_0x365b33('0x29')](_0x25bae9[_0x365b33('0x0')],{[Op['or']]:_[_0x365b33('0x25')](_0x2d229f,function(_0xb1fafd){const _0x2360d7=_0x365b33;if(_0xb1fafd['type']!==_0x2360d7('0xa')){const _0x2da650={};return _0x2da650[_0xb1fafd['name']]={[Op[_0x2360d7('0x1a')]]:'%'+_0x25169a[_0x2360d7('0x18')][_0x2360d7('0x1d')]+'%'},_0x2da650;}})}));_0x25bae9=_[_0x365b33('0x29')]({},_0x25bae9,_0x25169a['options']);const _0x2b4885={'where':_0x25bae9[_0x365b33('0x0')]};return db[_0x365b33('0x24')][_0x365b33('0x21')](_0x2b4885)[_0x365b33('0x23')](function(_0x7ff599){const _0xc05b56=_0x365b33;return _0x2698ed[_0xc05b56('0x21')]=_0x7ff599,_0x25169a[_0xc05b56('0x18')][_0xc05b56('0x1f')]&&(_0x25bae9[_0xc05b56('0x2e')]=[{'all':!![]}]),db[_0xc05b56('0x24')][_0xc05b56('0x28')](_0x25bae9);})[_0x365b33('0x23')](function(_0x135001){return _0x2698ed['rows']=_0x135001,_0x2698ed;})[_0x365b33('0x23')](respondWithFilteredResult(_0x3f42a0,_0x25bae9))['catch'](handleError(_0x3f42a0,null));},exports[_0x5c3288('0xf')]=function(_0x47fa0,_0xa18354){const _0x52521a=_0x5c3288;let _0x58b53d={'raw':![],'where':{'id':_0x47fa0[_0x52521a('0x30')]['id']}};const _0xebdb00={};return _0xebdb00['model']=_[_0x52521a('0xe')](db[_0x52521a('0x24')]['rawAttributes']),_0xebdb00['query']=_[_0x52521a('0xe')](_0x47fa0[_0x52521a('0x18')]),_0xebdb00[_0x52521a('0x6')]=_[_0x52521a('0x15')](_0xebdb00['model'],_0xebdb00['query']),_0x58b53d[_0x52521a('0xb')]=_[_0x52521a('0x15')](_0xebdb00[_0x52521a('0x3')],qs['fields'](_0x47fa0['query'][_0x52521a('0x1e')])),_0x58b53d['attributes']=_0x58b53d[_0x52521a('0xb')]['length']?_0x58b53d['attributes']:_0xebdb00[_0x52521a('0x3')],_0x47fa0[_0x52521a('0x18')][_0x52521a('0x1f')]&&(_0x58b53d[_0x52521a('0x2e')]=[{'all':!![]}]),_0x58b53d=_[_0x52521a('0x29')]({},_0x58b53d,_0x47fa0[_0x52521a('0x32')]),db['UserProfileSection']['findOne'](_0x58b53d)[_0x52521a('0x23')](handleEntityNotFound(_0xa18354,null))[_0x52521a('0x23')](respondWithResult(_0xa18354,null))[_0x52521a('0x26')](handleError(_0xa18354,null));},exports['create']=function(_0x16b634,_0x4843d8){const _0x1f8480=_0x5c3288;return db['UserProfileSection'][_0x1f8480('0x1b')](_0x16b634[_0x1f8480('0x27')],{})[_0x1f8480('0x23')](respondWithResult(_0x4843d8,0xc9))[_0x1f8480('0x26')](handleError(_0x4843d8,null));},exports[_0x5c3288('0x16')]=function(_0x11987b,_0x2edcd6){const _0x1c91ae=_0x5c3288;return _0x11987b[_0x1c91ae('0x27')]['id']&&delete _0x11987b[_0x1c91ae('0x27')]['id'],db[_0x1c91ae('0x24')][_0x1c91ae('0x33')]({'where':{'id':_0x11987b[_0x1c91ae('0x30')]['id']}})[_0x1c91ae('0x23')](handleEntityNotFound(_0x2edcd6,null))[_0x1c91ae('0x23')](saveUpdates(_0x11987b[_0x1c91ae('0x27')],null))[_0x1c91ae('0x23')](respondWithResult(_0x2edcd6,null))[_0x1c91ae('0x26')](handleError(_0x2edcd6,null));},exports[_0x5c3288('0x14')]=function(_0x210748,_0x300879){const _0x57dddd=_0x5c3288;return db['UserProfileSection']['findOne']({'where':{'id':_0x210748[_0x57dddd('0x30')]['id']}})[_0x57dddd('0x23')](handleEntityNotFound(_0x300879,null))[_0x57dddd('0x23')](removeEntity(_0x300879,null))[_0x57dddd('0x26')](handleError(_0x300879,null));},exports[_0x5c3288('0x1')]=function(_0x1e71be,_0x4f1abf){const _0x29d280=_0x5c3288;return db['UserProfileSection']['describe']()['then'](respondWithResult(_0x4f1abf,null))[_0x29d280('0x26')](handleError(_0x4f1abf,null));};
\ No newline at end of file
+const a678_0x5f5c=['filters','UserProfileSection','../../mysqldb','send','Content-Range','lodash','sequelize','attributes','fieldName','body','../../config/logger','name','map','pick','where','order','limit','rawAttributes','query','model','catch','intersection','include','count','end','options','stack','show','offset','params','findAll','describe','update','destroy','type','merge','create','status','undefined','then','index','fields','set','length','keys','json','like','findOne','sort','sendStatus'];(function(_0x175d3b,_0x5f5c13){const _0x781b5=function(_0x1feeae){while(--_0x1feeae){_0x175d3b['push'](_0x175d3b['shift']());}};_0x781b5(++_0x5f5c13);}(a678_0x5f5c,0x1d0));const a678_0x781b=function(_0x175d3b,_0x5f5c13){_0x175d3b=_0x175d3b-0x0;let _0x781b5=a678_0x5f5c[_0x175d3b];return _0x781b5;};const _0x124be0=a678_0x781b;'use strict';const _=require(_0x124be0('0x29')),qs=require('../../components/parsers/qs'),logger=require(_0x124be0('0x2e'))('api'),db=require(_0x124be0('0x26'))['db'],{Op}=require(_0x124be0('0x2a'));function respondWithResult(_0x1feeae,_0x14212f){return _0x14212f=_0x14212f||0xc8,function(_0x5aefa9){if(_0x5aefa9)return _0x1feeae['status'](_0x14212f)['json'](_0x5aefa9);};}function respondWithFilteredResult(_0x233e1f,_0x3c7f5b){return function(_0x322e70){const _0x1af12c=a678_0x781b;if(_0x322e70){const _0x50d662=_0x322e70[_0x1af12c('0x9')],_0x36ade5=_0x3c7f5b[_0x1af12c('0xe')];let _0x33f9f4=_0x3c7f5b[_0x1af12c('0xe')]+_0x3c7f5b['limit'],_0x2cb321;return _0x33f9f4>=_0x50d662?(_0x33f9f4=_0x50d662,_0x2cb321=0xc8):_0x2cb321=0xce,_0x233e1f[_0x1af12c('0x17')](_0x2cb321),_0x233e1f[_0x1af12c('0x1c')](_0x1af12c('0x28'),_0x36ade5+'-'+_0x33f9f4+'/'+_0x50d662)[_0x1af12c('0x1f')](_0x322e70);}return null;};}function saveUpdates(_0x30d4b4){return function(_0x396d43){const _0x110ee0=a678_0x781b;if(_0x396d43)return _0x396d43[_0x110ee0('0x12')](_0x30d4b4)[_0x110ee0('0x19')](function(_0x506c0f){return _0x506c0f;});return null;};}function removeEntity(_0x326315){return function(_0x4ceeaf){const _0x33fb2f=a678_0x781b;if(_0x4ceeaf)return _0x4ceeaf[_0x33fb2f('0x13')]()[_0x33fb2f('0x19')](function(){const _0x1ed272=_0x33fb2f;_0x326315['status'](0xcc)[_0x1ed272('0xa')]();});};}function handleEntityNotFound(_0x38c3c0){return function(_0x32706){const _0x4f030c=a678_0x781b;return!_0x32706&&_0x38c3c0[_0x4f030c('0x23')](0x194),_0x32706;};}function handleError(_0x5ef28f,_0x28b4e6){return _0x28b4e6=_0x28b4e6||0x1f4,function(_0x3126d9){const _0x17c2a5=a678_0x781b;logger['error'](_0x3126d9[_0x17c2a5('0xc')]),_0x3126d9[_0x17c2a5('0x2f')]&&delete _0x3126d9[_0x17c2a5('0x2f')],_0x5ef28f[_0x17c2a5('0x17')](_0x28b4e6)[_0x17c2a5('0x27')](_0x3126d9);};}exports[_0x124be0('0x1a')]=function(_0x3a60b6,_0x9845d0){const _0x47ce43=_0x124be0;let _0x5ddcbb={};const _0x129c65={},_0x3fa069={'count':0x0,'rows':[]},_0x20c1fb=_[_0x47ce43('0x30')](db['UserProfileSection'][_0x47ce43('0x3')],function(_0x196386){const _0x1df855=_0x47ce43;return{'name':_0x196386[_0x1df855('0x2c')],'type':_0x196386['type']['key']};});_0x129c65[_0x47ce43('0x5')]=_[_0x47ce43('0x30')](_0x20c1fb,'name'),_0x129c65[_0x47ce43('0x4')]=_[_0x47ce43('0x1e')](_0x3a60b6[_0x47ce43('0x4')]),_0x129c65['filters']=_[_0x47ce43('0x7')](_0x129c65[_0x47ce43('0x5')],_0x129c65['query']),_0x5ddcbb[_0x47ce43('0x2b')]=_[_0x47ce43('0x7')](_0x129c65[_0x47ce43('0x5')],qs[_0x47ce43('0x1b')](_0x3a60b6[_0x47ce43('0x4')][_0x47ce43('0x1b')])),_0x5ddcbb[_0x47ce43('0x2b')]=_0x5ddcbb[_0x47ce43('0x2b')][_0x47ce43('0x1d')]?_0x5ddcbb[_0x47ce43('0x2b')]:_0x129c65[_0x47ce43('0x5')];typeof _0x3a60b6[_0x47ce43('0x4')]['nolimit']===_0x47ce43('0x18')&&(_0x5ddcbb['limit']=qs[_0x47ce43('0x2')](_0x3a60b6[_0x47ce43('0x4')][_0x47ce43('0x2')]),_0x5ddcbb[_0x47ce43('0xe')]=qs[_0x47ce43('0xe')](_0x3a60b6[_0x47ce43('0x4')]['offset']));_0x5ddcbb[_0x47ce43('0x1')]=qs[_0x47ce43('0x22')](_0x3a60b6['query'][_0x47ce43('0x22')]),_0x5ddcbb['where']=qs[_0x47ce43('0x24')](_[_0x47ce43('0x31')](_0x3a60b6[_0x47ce43('0x4')],_0x129c65[_0x47ce43('0x24')]),_0x20c1fb);_0x3a60b6['query']['filter']&&(_0x5ddcbb[_0x47ce43('0x0')]=_[_0x47ce43('0x15')](_0x5ddcbb[_0x47ce43('0x0')],{[Op['or']]:_[_0x47ce43('0x30')](_0x20c1fb,function(_0x12dee4){const _0x9de07e=_0x47ce43;if(_0x12dee4[_0x9de07e('0x14')]!=='VIRTUAL'){const _0x55637e={};return _0x55637e[_0x12dee4[_0x9de07e('0x2f')]]={[Op[_0x9de07e('0x20')]]:'%'+_0x3a60b6[_0x9de07e('0x4')]['filter']+'%'},_0x55637e;}})}));_0x5ddcbb=_[_0x47ce43('0x15')]({},_0x5ddcbb,_0x3a60b6[_0x47ce43('0xb')]);const _0x68e67b={'where':_0x5ddcbb['where']};return db['UserProfileSection'][_0x47ce43('0x9')](_0x68e67b)[_0x47ce43('0x19')](function(_0x109c1b){const _0xda7cfc=_0x47ce43;return _0x3fa069[_0xda7cfc('0x9')]=_0x109c1b,_0x3a60b6[_0xda7cfc('0x4')]['includeAll']&&(_0x5ddcbb[_0xda7cfc('0x8')]=[{'all':!![]}]),db['UserProfileSection'][_0xda7cfc('0x10')](_0x5ddcbb);})[_0x47ce43('0x19')](function(_0x8e8b10){return _0x3fa069['rows']=_0x8e8b10,_0x3fa069;})[_0x47ce43('0x19')](respondWithFilteredResult(_0x9845d0,_0x5ddcbb))[_0x47ce43('0x6')](handleError(_0x9845d0,null));},exports[_0x124be0('0xd')]=function(_0x1fb50f,_0x59c8c0){const _0x12be54=_0x124be0;let _0x1bba24={'raw':![],'where':{'id':_0x1fb50f[_0x12be54('0xf')]['id']}};const _0xc5827e={};return _0xc5827e[_0x12be54('0x5')]=_['keys'](db['UserProfileSection'][_0x12be54('0x3')]),_0xc5827e[_0x12be54('0x4')]=_[_0x12be54('0x1e')](_0x1fb50f[_0x12be54('0x4')]),_0xc5827e[_0x12be54('0x24')]=_[_0x12be54('0x7')](_0xc5827e[_0x12be54('0x5')],_0xc5827e[_0x12be54('0x4')]),_0x1bba24['attributes']=_['intersection'](_0xc5827e[_0x12be54('0x5')],qs[_0x12be54('0x1b')](_0x1fb50f[_0x12be54('0x4')]['fields'])),_0x1bba24[_0x12be54('0x2b')]=_0x1bba24[_0x12be54('0x2b')][_0x12be54('0x1d')]?_0x1bba24[_0x12be54('0x2b')]:_0xc5827e[_0x12be54('0x5')],_0x1fb50f[_0x12be54('0x4')]['includeAll']&&(_0x1bba24['include']=[{'all':!![]}]),_0x1bba24=_[_0x12be54('0x15')]({},_0x1bba24,_0x1fb50f[_0x12be54('0xb')]),db['UserProfileSection'][_0x12be54('0x21')](_0x1bba24)[_0x12be54('0x19')](handleEntityNotFound(_0x59c8c0,null))[_0x12be54('0x19')](respondWithResult(_0x59c8c0,null))['catch'](handleError(_0x59c8c0,null));},exports[_0x124be0('0x16')]=function(_0xad6d90,_0x5dac25){const _0x512b7c=_0x124be0;return db[_0x512b7c('0x25')][_0x512b7c('0x16')](_0xad6d90[_0x512b7c('0x2d')],{})[_0x512b7c('0x19')](respondWithResult(_0x5dac25,0xc9))[_0x512b7c('0x6')](handleError(_0x5dac25,null));},exports[_0x124be0('0x12')]=function(_0x2194a6,_0x211b4a){const _0x26dab5=_0x124be0;return _0x2194a6[_0x26dab5('0x2d')]['id']&&delete _0x2194a6[_0x26dab5('0x2d')]['id'],db[_0x26dab5('0x25')][_0x26dab5('0x21')]({'where':{'id':_0x2194a6['params']['id']}})['then'](handleEntityNotFound(_0x211b4a,null))[_0x26dab5('0x19')](saveUpdates(_0x2194a6['body'],null))[_0x26dab5('0x19')](respondWithResult(_0x211b4a,null))['catch'](handleError(_0x211b4a,null));},exports['destroy']=function(_0x40803f,_0x405cd9){const _0x117ce0=_0x124be0;return db[_0x117ce0('0x25')][_0x117ce0('0x21')]({'where':{'id':_0x40803f[_0x117ce0('0xf')]['id']}})[_0x117ce0('0x19')](handleEntityNotFound(_0x405cd9,null))[_0x117ce0('0x19')](removeEntity(_0x405cd9,null))['catch'](handleError(_0x405cd9,null));},exports[_0x124be0('0x11')]=function(_0xebb7a6,_0x15d5dc){const _0x299ee6=_0x124be0;return db[_0x299ee6('0x25')][_0x299ee6('0x11')]()[_0x299ee6('0x19')](respondWithResult(_0x15d5dc,null))[_0x299ee6('0x6')](handleError(_0x15d5dc,null));};
\ No newline at end of file