Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / memberReport / memberReport.controller.js
index 2624a73..8525a6b 100644 (file)
@@ -1 +1 @@
-const a539_0x1feb=['../../components/parsers/qs','findOne','set','update','filters','body','rows','keys','length','name','error','like','count','map','include','status','fields','type','json','options','model','merge','sequelize','catch','undefined','then','describe','Content-Range','offset','fieldName','MemberReport','show','rawAttributes','pick','params','destroy','../../mysqldb','index','where','includeAll','attributes','nolimit','query','../../config/logger','intersection','sendStatus','limit','sort','filter','key','send'];(function(_0x3457bb,_0x4ecac7){const _0x1feb10=function(_0x4f9281){while(--_0x4f9281){_0x3457bb['push'](_0x3457bb['shift']());}};_0x1feb10(++_0x4ecac7);}(a539_0x1feb,0x1df));const a539_0x4f92=function(_0x3457bb,_0x4ecac7){_0x3457bb=_0x3457bb-0x1c4;let _0x1feb10=a539_0x1feb[_0x3457bb];return _0x1feb10;};const a539_0x53f929=a539_0x4f92;'use strict';const _=require('lodash'),qs=require(a539_0x53f929(0x1e3)),logger=require(a539_0x53f929(0x1db))('api'),{db}=require(a539_0x53f929(0x1d4)),{Op}=require(a539_0x53f929(0x1c6));function respondWithResult(_0x162729,_0x2af143){return _0x2af143=_0x2af143||0xc8,function(_0x5487d8){const _0x4bea8c=a539_0x4f92;if(_0x5487d8)return _0x162729['status'](_0x2af143)[_0x4bea8c(0x1f5)](_0x5487d8);};}function respondWithFilteredResult(_0x2fbbbc,_0x41b4a6){return function(_0x48b1a5){const _0x39d718=a539_0x4f92;if(_0x48b1a5){const _0x130ccf=_0x48b1a5['count'],_0x23d361=_0x41b4a6[_0x39d718(0x1cc)];let _0x48f9df=_0x41b4a6[_0x39d718(0x1cc)]+_0x41b4a6['limit'],_0x4de65c;return _0x48f9df>=_0x130ccf?(_0x48f9df=_0x130ccf,_0x4de65c=0xc8):_0x4de65c=0xce,_0x2fbbbc[_0x39d718(0x1f2)](_0x4de65c),_0x2fbbbc[_0x39d718(0x1e5)](_0x39d718(0x1cb),_0x23d361+'-'+_0x48f9df+'/'+_0x130ccf)[_0x39d718(0x1f5)](_0x48b1a5);}return null;};}function saveUpdates(_0xcd9546){return function(_0xfd2b3d){const _0x43c78c=a539_0x4f92;if(_0xfd2b3d)return _0xfd2b3d[_0x43c78c(0x1e6)](_0xcd9546)[_0x43c78c(0x1c9)](function(_0x5a8a58){return _0x5a8a58;});return null;};}function removeEntity(_0x530c73){return function(_0x373480){if(_0x373480)return _0x373480['destroy']()['then'](function(){const _0x50c8ac=a539_0x4f92;_0x530c73[_0x50c8ac(0x1f2)](0xcc)['end']();});};}function handleEntityNotFound(_0x309991){return function(_0x5cbe4c){const _0x48e1ed=a539_0x4f92;return!_0x5cbe4c&&_0x309991[_0x48e1ed(0x1dd)](0x194),_0x5cbe4c;};}function handleError(_0x11d449,_0x4c6119){return _0x4c6119=_0x4c6119||0x1f4,function(_0x5ce452){const _0x4711ce=a539_0x4f92;logger[_0x4711ce(0x1ed)](_0x5ce452['stack']),_0x5ce452[_0x4711ce(0x1ec)]&&delete _0x5ce452[_0x4711ce(0x1ec)],_0x11d449[_0x4711ce(0x1f2)](_0x4c6119)[_0x4711ce(0x1e2)](_0x5ce452);};}exports[a539_0x53f929(0x1d5)]=function(_0x25c948,_0x4297e4){const _0x35d123=a539_0x53f929;let _0x12268f={};const _0x1a2efe={},_0x1035e3={'count':0x0,'rows':[]},_0x48528d=_[_0x35d123(0x1f0)](db[_0x35d123(0x1ce)][_0x35d123(0x1d0)],function(_0x5bd2ca){const _0x58e05e=_0x35d123;return{'name':_0x5bd2ca[_0x58e05e(0x1cd)],'type':_0x5bd2ca[_0x58e05e(0x1f4)][_0x58e05e(0x1e1)]};});_0x1a2efe['model']=_[_0x35d123(0x1f0)](_0x48528d,_0x35d123(0x1ec)),_0x1a2efe['query']=_[_0x35d123(0x1ea)](_0x25c948[_0x35d123(0x1da)]),_0x1a2efe[_0x35d123(0x1e7)]=_['intersection'](_0x1a2efe['model'],_0x1a2efe[_0x35d123(0x1da)]),_0x12268f[_0x35d123(0x1d8)]=_[_0x35d123(0x1dc)](_0x1a2efe[_0x35d123(0x1c4)],qs[_0x35d123(0x1f3)](_0x25c948[_0x35d123(0x1da)]['fields'])),_0x12268f[_0x35d123(0x1d8)]=_0x12268f[_0x35d123(0x1d8)]['length']?_0x12268f[_0x35d123(0x1d8)]:_0x1a2efe[_0x35d123(0x1c4)];typeof _0x25c948[_0x35d123(0x1da)][_0x35d123(0x1d9)]===_0x35d123(0x1c8)&&(_0x12268f[_0x35d123(0x1de)]=qs[_0x35d123(0x1de)](_0x25c948[_0x35d123(0x1da)][_0x35d123(0x1de)]),_0x12268f[_0x35d123(0x1cc)]=qs[_0x35d123(0x1cc)](_0x25c948['query'][_0x35d123(0x1cc)]));_0x12268f['order']=qs['sort'](_0x25c948[_0x35d123(0x1da)][_0x35d123(0x1df)]),_0x12268f[_0x35d123(0x1d6)]=qs[_0x35d123(0x1e7)](_[_0x35d123(0x1d1)](_0x25c948['query'],_0x1a2efe[_0x35d123(0x1e7)]),_0x48528d);_0x25c948[_0x35d123(0x1da)][_0x35d123(0x1e0)]&&(_0x12268f['where']=_[_0x35d123(0x1c5)](_0x12268f[_0x35d123(0x1d6)],{[Op['or']]:_[_0x35d123(0x1f0)](_0x48528d,function(_0x24b61e){const _0x22d95e=_0x35d123;if(_0x24b61e[_0x22d95e(0x1f4)]!=='VIRTUAL'){const _0x8c32fb={};return _0x8c32fb[_0x24b61e[_0x22d95e(0x1ec)]]={[Op[_0x22d95e(0x1ee)]]:'%'+_0x25c948[_0x22d95e(0x1da)]['filter']+'%'},_0x8c32fb;}})}));_0x12268f=_[_0x35d123(0x1c5)]({},_0x12268f,_0x25c948['options']);const _0x11609f={'where':_0x12268f['where']};return db[_0x35d123(0x1ce)][_0x35d123(0x1ef)](_0x11609f)['then'](function(_0x4cd188){const _0x432f38=_0x35d123;return _0x1035e3[_0x432f38(0x1ef)]=_0x4cd188,_0x25c948[_0x432f38(0x1da)][_0x432f38(0x1d7)]&&(_0x12268f[_0x432f38(0x1f1)]=[{'all':!![]}]),db[_0x432f38(0x1ce)]['findAll'](_0x12268f);})[_0x35d123(0x1c9)](function(_0x2153be){const _0x432ca1=_0x35d123;return _0x1035e3[_0x432ca1(0x1e9)]=_0x2153be,_0x1035e3;})[_0x35d123(0x1c9)](respondWithFilteredResult(_0x4297e4,_0x12268f))['catch'](handleError(_0x4297e4,null));},exports[a539_0x53f929(0x1cf)]=function(_0x4a7ca7,_0x4298d1){const _0x2453c3=a539_0x53f929;let _0x23b17d={'raw':!![],'where':{'id':_0x4a7ca7[_0x2453c3(0x1d2)]['id']}};const _0x3d3a65={};return _0x3d3a65[_0x2453c3(0x1c4)]=_[_0x2453c3(0x1ea)](db[_0x2453c3(0x1ce)][_0x2453c3(0x1d0)]),_0x3d3a65[_0x2453c3(0x1da)]=_[_0x2453c3(0x1ea)](_0x4a7ca7[_0x2453c3(0x1da)]),_0x3d3a65[_0x2453c3(0x1e7)]=_[_0x2453c3(0x1dc)](_0x3d3a65[_0x2453c3(0x1c4)],_0x3d3a65['query']),_0x23b17d[_0x2453c3(0x1d8)]=_[_0x2453c3(0x1dc)](_0x3d3a65['model'],qs[_0x2453c3(0x1f3)](_0x4a7ca7[_0x2453c3(0x1da)]['fields'])),_0x23b17d[_0x2453c3(0x1d8)]=_0x23b17d['attributes'][_0x2453c3(0x1eb)]?_0x23b17d['attributes']:_0x3d3a65[_0x2453c3(0x1c4)],_0x4a7ca7[_0x2453c3(0x1da)][_0x2453c3(0x1d7)]&&(_0x23b17d[_0x2453c3(0x1f1)]=[{'all':!![]}]),_0x23b17d=_[_0x2453c3(0x1c5)]({},_0x23b17d,_0x4a7ca7[_0x2453c3(0x1f6)]),db['MemberReport'][_0x2453c3(0x1e4)](_0x23b17d)[_0x2453c3(0x1c9)](handleEntityNotFound(_0x4298d1,null))[_0x2453c3(0x1c9)](respondWithResult(_0x4298d1,null))[_0x2453c3(0x1c7)](handleError(_0x4298d1,null));},exports['create']=function(_0x4c1340,_0x3275cd){const _0x3ad927=a539_0x53f929;return db[_0x3ad927(0x1ce)]['create'](_0x4c1340[_0x3ad927(0x1e8)],{})[_0x3ad927(0x1c9)](respondWithResult(_0x3275cd,0xc9))[_0x3ad927(0x1c7)](handleError(_0x3275cd,null));},exports[a539_0x53f929(0x1e6)]=function(_0x10f660,_0x4f38bd){const _0x2bdb56=a539_0x53f929;return _0x10f660[_0x2bdb56(0x1e8)]['id']&&delete _0x10f660[_0x2bdb56(0x1e8)]['id'],db[_0x2bdb56(0x1ce)][_0x2bdb56(0x1e4)]({'where':{'id':_0x10f660['params']['id']}})[_0x2bdb56(0x1c9)](handleEntityNotFound(_0x4f38bd,null))[_0x2bdb56(0x1c9)](saveUpdates(_0x10f660['body'],null))['then'](respondWithResult(_0x4f38bd,null))[_0x2bdb56(0x1c7)](handleError(_0x4f38bd,null));},exports[a539_0x53f929(0x1d3)]=function(_0x45ebc1,_0x384655){const _0x43ce4e=a539_0x53f929;return db[_0x43ce4e(0x1ce)][_0x43ce4e(0x1e4)]({'where':{'id':_0x45ebc1['params']['id']}})['then'](handleEntityNotFound(_0x384655,null))[_0x43ce4e(0x1c9)](removeEntity(_0x384655,null))['catch'](handleError(_0x384655,null));},exports[a539_0x53f929(0x1ca)]=function(_0x23b1d6,_0x111f3a){const _0x1b5955=a539_0x53f929;return db[_0x1b5955(0x1ce)]['describe']()['then'](respondWithResult(_0x111f3a,null))[_0x1b5955(0x1c7)](handleError(_0x111f3a,null));};
\ No newline at end of file
+'use strict';const a539_0x3372=['catch','sort','@config/logger','describe','@mysqldb','includeAll','attributes','show','932045DDKcKR','key','filter','3251PbZupX','limit','pick','nolimit','findAll','offset','1GKkeQA','create','Content-Range','destroy','index','65rodltY','rawAttributes','rows','MemberReport','status','706301DWaAXx','1rqncpX','end','order','where','815006yXbLnX','fields','error','query','body','type','keys','sendStatus','intersection','findOne','name','fieldName','filters','params','model','map','update','@utils/filter-attributes','777365TSphxs','json','count','lodash','undefined','353333xBIHPV','options','length','then','1726660cUrOui','include'];const a539_0x1dd2=function(_0x52a3a7,_0x11f8eb){_0x52a3a7=_0x52a3a7-0x1da;let _0x33725a=a539_0x3372[_0x52a3a7];return _0x33725a;};const a539_0x491d41=a539_0x1dd2;(function(_0x4c3a49,_0x90c4b1){const _0x2b8878=a539_0x1dd2;while(!![]){try{const _0x5d81aa=parseInt(_0x2b8878(0x1df))+-parseInt(_0x2b8878(0x200))*parseInt(_0x2b8878(0x201))+-parseInt(_0x2b8878(0x205))+-parseInt(_0x2b8878(0x1f0))*parseInt(_0x2b8878(0x1fb))+parseInt(_0x2b8878(0x1ed))+-parseInt(_0x2b8878(0x1f6))*parseInt(_0x2b8878(0x1da))+parseInt(_0x2b8878(0x1e3));if(_0x5d81aa===_0x90c4b1)break;else _0x4c3a49['push'](_0x4c3a49['shift']());}catch(_0x8cb7f4){_0x4c3a49['push'](_0x4c3a49['shift']());}}}(a539_0x3372,0x7a923));const _=require(a539_0x491d41(0x1dd)),qs=require('@components/parsers/qs'),logger=require(a539_0x491d41(0x1e7))('api'),{db}=require(a539_0x491d41(0x1e9)),{filterAttributes}=require(a539_0x491d41(0x216));function respondWithResult(_0x1d5181,_0x2b80d5){return _0x2b80d5=_0x2b80d5||0xc8,function(_0x179de9){const _0x42fc71=a539_0x1dd2;if(_0x179de9)return _0x1d5181[_0x42fc71(0x1ff)](_0x2b80d5)[_0x42fc71(0x1db)](_0x179de9);};}function respondWithFilteredResult(_0x1899bb,_0x2ceac9){return function(_0x2e7550){const _0x523df5=a539_0x1dd2;if(_0x2e7550){const _0x327c78=_0x2e7550[_0x523df5(0x1dc)],_0x371d3c=_0x2ceac9['offset'];let _0x3192f8=_0x2ceac9[_0x523df5(0x1f5)]+_0x2ceac9[_0x523df5(0x1f1)],_0x2c41af;return _0x3192f8>=_0x327c78?(_0x3192f8=_0x327c78,_0x2c41af=0xc8):_0x2c41af=0xce,_0x1899bb[_0x523df5(0x1ff)](_0x2c41af),_0x1899bb['set'](_0x523df5(0x1f8),_0x371d3c+'-'+_0x3192f8+'/'+_0x327c78)[_0x523df5(0x1db)](_0x2e7550);}return null;};}function saveUpdates(_0x2f2850){return function(_0x51fd23){const _0x4229d3=a539_0x1dd2;if(_0x51fd23)return _0x51fd23[_0x4229d3(0x215)](_0x2f2850)[_0x4229d3(0x1e2)](function(_0x43d132){return _0x43d132;});return null;};}function removeEntity(_0x3a7b3a){return function(_0x4c5b58){const _0x5af01e=a539_0x1dd2;if(_0x4c5b58)return _0x4c5b58[_0x5af01e(0x1f9)]()[_0x5af01e(0x1e2)](function(){const _0x3f5177=_0x5af01e;_0x3a7b3a[_0x3f5177(0x1ff)](0xcc)[_0x3f5177(0x202)]();});};}function handleEntityNotFound(_0x3582a2){return function(_0x524ed7){const _0x6c96ef=a539_0x1dd2;return!_0x524ed7&&_0x3582a2[_0x6c96ef(0x20c)](0x194),_0x524ed7;};}function handleError(_0x316cae,_0x32019d){return _0x32019d=_0x32019d||0x1f4,function(_0x14d3c6){const _0x233f5e=a539_0x1dd2;logger[_0x233f5e(0x207)](_0x14d3c6['stack']),_0x14d3c6[_0x233f5e(0x20f)]&&delete _0x14d3c6[_0x233f5e(0x20f)],_0x316cae['status'](_0x32019d)['send'](_0x14d3c6);};}exports[a539_0x491d41(0x1fa)]=function(_0x1e97b9,_0x5e4715){const _0x4eb47d=a539_0x491d41;let _0xf6fca6={};const _0x501887={},_0x43d128={'count':0x0,'rows':[]},_0x1776de=_[_0x4eb47d(0x214)](db['MemberReport'][_0x4eb47d(0x1fc)],function(_0x4bb5db){const _0x425917=_0x4eb47d;return{'name':_0x4bb5db[_0x425917(0x210)],'type':_0x4bb5db[_0x425917(0x20a)][_0x425917(0x1ee)]};});_0x501887[_0x4eb47d(0x213)]=_[_0x4eb47d(0x214)](_0x1776de,'name'),_0x501887[_0x4eb47d(0x208)]=_[_0x4eb47d(0x20b)](_0x1e97b9[_0x4eb47d(0x208)]),_0x501887['filters']=_[_0x4eb47d(0x20d)](_0x501887[_0x4eb47d(0x213)],_0x501887['query']),_0xf6fca6[_0x4eb47d(0x1eb)]=_[_0x4eb47d(0x20d)](_0x501887[_0x4eb47d(0x213)],qs[_0x4eb47d(0x206)](_0x1e97b9[_0x4eb47d(0x208)][_0x4eb47d(0x206)])),_0xf6fca6['attributes']=_0xf6fca6[_0x4eb47d(0x1eb)][_0x4eb47d(0x1e1)]?_0xf6fca6[_0x4eb47d(0x1eb)]:_0x501887[_0x4eb47d(0x213)];typeof _0x1e97b9[_0x4eb47d(0x208)][_0x4eb47d(0x1f3)]===_0x4eb47d(0x1de)&&(_0xf6fca6[_0x4eb47d(0x1f1)]=qs[_0x4eb47d(0x1f1)](_0x1e97b9[_0x4eb47d(0x208)][_0x4eb47d(0x1f1)]),_0xf6fca6[_0x4eb47d(0x1f5)]=qs['offset'](_0x1e97b9['query']['offset']));_0xf6fca6[_0x4eb47d(0x203)]=qs[_0x4eb47d(0x1e6)](_0x1e97b9['query']['sort']),_0xf6fca6[_0x4eb47d(0x204)]=qs[_0x4eb47d(0x211)](_[_0x4eb47d(0x1f2)](_0x1e97b9[_0x4eb47d(0x208)],_0x501887['filters']),_0x1776de),_0xf6fca6=filterAttributes(_0xf6fca6,_0x1e97b9[_0x4eb47d(0x208)][_0x4eb47d(0x1ef)],_0x1776de,_0x1e97b9[_0x4eb47d(0x1e0)]);const _0x1add60={'where':_0xf6fca6[_0x4eb47d(0x204)]};return db['MemberReport'][_0x4eb47d(0x1dc)](_0x1add60)[_0x4eb47d(0x1e2)](function(_0x53f7c8){const _0x2b003f=_0x4eb47d;return _0x43d128['count']=_0x53f7c8,_0x1e97b9[_0x2b003f(0x208)][_0x2b003f(0x1ea)]&&(_0xf6fca6[_0x2b003f(0x1e4)]=[{'all':!![]}]),db['MemberReport'][_0x2b003f(0x1f4)](_0xf6fca6);})[_0x4eb47d(0x1e2)](function(_0x571223){const _0x52c3a0=_0x4eb47d;return _0x43d128[_0x52c3a0(0x1fd)]=_0x571223,_0x43d128;})[_0x4eb47d(0x1e2)](respondWithFilteredResult(_0x5e4715,_0xf6fca6))[_0x4eb47d(0x1e5)](handleError(_0x5e4715,null));},exports[a539_0x491d41(0x1ec)]=function(_0x557591,_0x461d0d){const _0x20aa21=a539_0x491d41;let _0xa84c12={'raw':!![],'where':{'id':_0x557591[_0x20aa21(0x212)]['id']}};const _0x2fe805={};return _0x2fe805['model']=_[_0x20aa21(0x20b)](db[_0x20aa21(0x1fe)][_0x20aa21(0x1fc)]),_0x2fe805[_0x20aa21(0x208)]=_['keys'](_0x557591[_0x20aa21(0x208)]),_0x2fe805[_0x20aa21(0x211)]=_[_0x20aa21(0x20d)](_0x2fe805[_0x20aa21(0x213)],_0x2fe805[_0x20aa21(0x208)]),_0xa84c12['attributes']=_['intersection'](_0x2fe805[_0x20aa21(0x213)],qs[_0x20aa21(0x206)](_0x557591['query']['fields'])),_0xa84c12[_0x20aa21(0x1eb)]=_0xa84c12[_0x20aa21(0x1eb)][_0x20aa21(0x1e1)]?_0xa84c12[_0x20aa21(0x1eb)]:_0x2fe805[_0x20aa21(0x213)],_0x557591[_0x20aa21(0x208)]['includeAll']&&(_0xa84c12[_0x20aa21(0x1e4)]=[{'all':!![]}]),_0xa84c12=_['merge']({},_0xa84c12,_0x557591[_0x20aa21(0x1e0)]),db['MemberReport'][_0x20aa21(0x20e)](_0xa84c12)['then'](handleEntityNotFound(_0x461d0d,null))[_0x20aa21(0x1e2)](respondWithResult(_0x461d0d,null))[_0x20aa21(0x1e5)](handleError(_0x461d0d,null));},exports[a539_0x491d41(0x1f7)]=function(_0x745875,_0x9e9674){const _0x4b8503=a539_0x491d41;return db[_0x4b8503(0x1fe)][_0x4b8503(0x1f7)](_0x745875['body'],{})[_0x4b8503(0x1e2)](respondWithResult(_0x9e9674,0xc9))[_0x4b8503(0x1e5)](handleError(_0x9e9674,null));},exports[a539_0x491d41(0x215)]=function(_0xe6d789,_0x4cde0f){const _0x2bbc67=a539_0x491d41;return _0xe6d789[_0x2bbc67(0x209)]['id']&&delete _0xe6d789[_0x2bbc67(0x209)]['id'],db[_0x2bbc67(0x1fe)][_0x2bbc67(0x20e)]({'where':{'id':_0xe6d789[_0x2bbc67(0x212)]['id']}})[_0x2bbc67(0x1e2)](handleEntityNotFound(_0x4cde0f,null))['then'](saveUpdates(_0xe6d789[_0x2bbc67(0x209)],null))['then'](respondWithResult(_0x4cde0f,null))[_0x2bbc67(0x1e5)](handleError(_0x4cde0f,null));},exports[a539_0x491d41(0x1f9)]=function(_0x22312d,_0x56e2f5){const _0x2272b6=a539_0x491d41;return db[_0x2272b6(0x1fe)][_0x2272b6(0x20e)]({'where':{'id':_0x22312d['params']['id']}})[_0x2272b6(0x1e2)](handleEntityNotFound(_0x56e2f5,null))['then'](removeEntity(_0x56e2f5,null))[_0x2272b6(0x1e5)](handleError(_0x56e2f5,null));},exports[a539_0x491d41(0x1e8)]=function(_0x41ff0d,_0x30fc79){const _0x4b179a=a539_0x491d41;return db[_0x4b179a(0x1fe)][_0x4b179a(0x1e8)]()[_0x4b179a(0x1e2)](respondWithResult(_0x30fc79,null))['catch'](handleError(_0x30fc79,null));};
\ No newline at end of file