Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.controller.js
index ffe0e92..63e1eb8 100644 (file)
@@ -1 +1 @@
-const a450_0x2e01=['options','merge','error','params','stack','map','create','fields','keys','lodash','catch','includeAll','limit','sendStatus','count','status','rows','offset','findAll','../../mysqldb','destroy','length','update','json','then','sequelize','filter','Content-Range','end','where','../../config/logger','body','attributes','nolimit','rawAttributes','order','like','name','intersection','pick','undefined','include','api','JscriptyAnswerReport','model','send','filters','query','findOne','sort','index'];(function(_0x58358,_0x58b965){const _0x2e01fa=function(_0x401557){while(--_0x401557){_0x58358['push'](_0x58358['shift']());}};_0x2e01fa(++_0x58b965);}(a450_0x2e01,0x18c));const a450_0x4015=function(_0x58358,_0x58b965){_0x58358=_0x58358-0xa7;let _0x2e01fa=a450_0x2e01[_0x58358];return _0x2e01fa;};const a450_0x40a790=a450_0x4015;'use strict';const _=require(a450_0x40a790(0xbc)),qs=require('../../components/parsers/qs'),logger=require(a450_0x40a790(0xd1))(a450_0x40a790(0xaa)),{db}=require(a450_0x40a790(0xc6)),{Op}=require(a450_0x40a790(0xcc));function respondWithResult(_0x321926,_0x752ad0){return _0x752ad0=_0x752ad0||0xc8,function(_0x28dd2d){const _0x46dfd4=a450_0x4015;if(_0x28dd2d)return _0x321926[_0x46dfd4(0xc2)](_0x752ad0)[_0x46dfd4(0xca)](_0x28dd2d);};}function respondWithFilteredResult(_0x385885,_0x1714b7){return function(_0x1a27b2){const _0x3170a0=a450_0x4015;if(_0x1a27b2){const _0x3c2726=_0x1a27b2[_0x3170a0(0xc1)],_0x4d785a=_0x1714b7[_0x3170a0(0xc4)];let _0x5ad9de=_0x1714b7[_0x3170a0(0xc4)]+_0x1714b7[_0x3170a0(0xbf)],_0x1a0703;return _0x5ad9de>=_0x3c2726?(_0x5ad9de=_0x3c2726,_0x1a0703=0xc8):_0x1a0703=0xce,_0x385885[_0x3170a0(0xc2)](_0x1a0703),_0x385885['set'](_0x3170a0(0xce),_0x4d785a+'-'+_0x5ad9de+'/'+_0x3c2726)[_0x3170a0(0xca)](_0x1a27b2);}return null;};}function saveUpdates(_0xfdbc56){return function(_0x80a6ac){const _0x8302c7=a450_0x4015;if(_0x80a6ac)return _0x80a6ac[_0x8302c7(0xc9)](_0xfdbc56)[_0x8302c7(0xcb)](function(_0x2700a0){return _0x2700a0;});return null;};}function removeEntity(_0x257449){return function(_0x5f151b){const _0x4bf719=a450_0x4015;if(_0x5f151b)return _0x5f151b['destroy']()[_0x4bf719(0xcb)](function(){const _0x157ef6=_0x4bf719;_0x257449[_0x157ef6(0xc2)](0xcc)[_0x157ef6(0xcf)]();});};}function handleEntityNotFound(_0x25fe3c){return function(_0x31f18b){const _0x1be9c6=a450_0x4015;return!_0x31f18b&&_0x25fe3c[_0x1be9c6(0xc0)](0x194),_0x31f18b;};}function handleError(_0x2d2be,_0x53c07c){return _0x53c07c=_0x53c07c||0x1f4,function(_0x433d3){const _0x155889=a450_0x4015;logger[_0x155889(0xb5)](_0x433d3[_0x155889(0xb7)]),_0x433d3[_0x155889(0xd8)]&&delete _0x433d3[_0x155889(0xd8)],_0x2d2be[_0x155889(0xc2)](_0x53c07c)[_0x155889(0xad)](_0x433d3);};}exports[a450_0x40a790(0xb2)]=function(_0x4713fc,_0x4d2e4f){const _0x1c5585=a450_0x40a790;let _0x22e3f1={};const _0x128e7={},_0x20bf26={'count':0x0,'rows':[]},_0x41135e=_[_0x1c5585(0xb8)](db[_0x1c5585(0xab)]['rawAttributes'],function(_0x31de47){return{'name':_0x31de47['fieldName'],'type':_0x31de47['type']['key']};});_0x128e7[_0x1c5585(0xac)]=_[_0x1c5585(0xb8)](_0x41135e,'name'),_0x128e7[_0x1c5585(0xaf)]=_[_0x1c5585(0xbb)](_0x4713fc[_0x1c5585(0xaf)]),_0x128e7[_0x1c5585(0xae)]=_['intersection'](_0x128e7[_0x1c5585(0xac)],_0x128e7[_0x1c5585(0xaf)]),_0x22e3f1['attributes']=_[_0x1c5585(0xd9)](_0x128e7['model'],qs[_0x1c5585(0xba)](_0x4713fc[_0x1c5585(0xaf)][_0x1c5585(0xba)])),_0x22e3f1[_0x1c5585(0xd3)]=_0x22e3f1['attributes'][_0x1c5585(0xc8)]?_0x22e3f1['attributes']:_0x128e7['model'];typeof _0x4713fc[_0x1c5585(0xaf)][_0x1c5585(0xd4)]===_0x1c5585(0xa8)&&(_0x22e3f1[_0x1c5585(0xbf)]=qs['limit'](_0x4713fc[_0x1c5585(0xaf)][_0x1c5585(0xbf)]),_0x22e3f1[_0x1c5585(0xc4)]=qs[_0x1c5585(0xc4)](_0x4713fc[_0x1c5585(0xaf)]['offset']));_0x22e3f1[_0x1c5585(0xd6)]=qs[_0x1c5585(0xb1)](_0x4713fc[_0x1c5585(0xaf)]['sort']),_0x22e3f1[_0x1c5585(0xd0)]=qs[_0x1c5585(0xae)](_[_0x1c5585(0xa7)](_0x4713fc[_0x1c5585(0xaf)],_0x128e7['filters']),_0x41135e);_0x4713fc[_0x1c5585(0xaf)]['filter']&&(_0x22e3f1[_0x1c5585(0xd0)]=_[_0x1c5585(0xb4)](_0x22e3f1['where'],{[Op['or']]:_[_0x1c5585(0xb8)](_0x41135e,function(_0x1ff9b9){const _0x2c52a1=_0x1c5585;if(_0x1ff9b9['type']!=='VIRTUAL'){const _0x3d09db={};return _0x3d09db[_0x1ff9b9[_0x2c52a1(0xd8)]]={[Op[_0x2c52a1(0xd7)]]:'%'+_0x4713fc[_0x2c52a1(0xaf)][_0x2c52a1(0xcd)]+'%'},_0x3d09db;}})}));_0x22e3f1=_[_0x1c5585(0xb4)]({},_0x22e3f1,_0x4713fc[_0x1c5585(0xb3)]);const _0x9fcede={'where':_0x22e3f1[_0x1c5585(0xd0)]};return db['JscriptyAnswerReport'][_0x1c5585(0xc1)](_0x9fcede)[_0x1c5585(0xcb)](function(_0x3368ee){const _0x2f16c1=_0x1c5585;return _0x20bf26['count']=_0x3368ee,_0x4713fc[_0x2f16c1(0xaf)][_0x2f16c1(0xbe)]&&(_0x22e3f1[_0x2f16c1(0xa9)]=[{'all':!![]}]),db['JscriptyAnswerReport'][_0x2f16c1(0xc5)](_0x22e3f1);})['then'](function(_0x46b961){const _0x24d302=_0x1c5585;return _0x20bf26[_0x24d302(0xc3)]=_0x46b961,_0x20bf26;})['then'](respondWithFilteredResult(_0x4d2e4f,_0x22e3f1))[_0x1c5585(0xbd)](handleError(_0x4d2e4f,null));},exports['show']=function(_0x537fbb,_0x5a4227){const _0x144aa3=a450_0x40a790;let _0x26e576={'raw':!![],'where':{'id':_0x537fbb[_0x144aa3(0xb6)]['id']}};const _0x2f902c={};return _0x2f902c[_0x144aa3(0xac)]=_[_0x144aa3(0xbb)](db['JscriptyAnswerReport'][_0x144aa3(0xd5)]),_0x2f902c[_0x144aa3(0xaf)]=_[_0x144aa3(0xbb)](_0x537fbb[_0x144aa3(0xaf)]),_0x2f902c['filters']=_['intersection'](_0x2f902c['model'],_0x2f902c[_0x144aa3(0xaf)]),_0x26e576['attributes']=_[_0x144aa3(0xd9)](_0x2f902c[_0x144aa3(0xac)],qs[_0x144aa3(0xba)](_0x537fbb[_0x144aa3(0xaf)][_0x144aa3(0xba)])),_0x26e576[_0x144aa3(0xd3)]=_0x26e576['attributes']['length']?_0x26e576['attributes']:_0x2f902c[_0x144aa3(0xac)],_0x537fbb['query']['includeAll']&&(_0x26e576[_0x144aa3(0xa9)]=[{'all':!![]}]),_0x26e576=_['merge']({},_0x26e576,_0x537fbb[_0x144aa3(0xb3)]),db[_0x144aa3(0xab)][_0x144aa3(0xb0)](_0x26e576)[_0x144aa3(0xcb)](handleEntityNotFound(_0x5a4227,null))[_0x144aa3(0xcb)](respondWithResult(_0x5a4227,null))['catch'](handleError(_0x5a4227,null));},exports[a450_0x40a790(0xb9)]=function(_0x65e5bb,_0x3cbea3){const _0xedf1b1=a450_0x40a790;return db[_0xedf1b1(0xab)][_0xedf1b1(0xb9)](_0x65e5bb[_0xedf1b1(0xd2)],{})[_0xedf1b1(0xcb)](respondWithResult(_0x3cbea3,0xc9))[_0xedf1b1(0xbd)](handleError(_0x3cbea3,null));},exports[a450_0x40a790(0xc9)]=function(_0x41d9a2,_0xdfe3ca){const _0x2c9dc9=a450_0x40a790;return _0x41d9a2['body']['id']&&delete _0x41d9a2[_0x2c9dc9(0xd2)]['id'],db[_0x2c9dc9(0xab)][_0x2c9dc9(0xb0)]({'where':{'id':_0x41d9a2[_0x2c9dc9(0xb6)]['id']}})['then'](handleEntityNotFound(_0xdfe3ca,null))[_0x2c9dc9(0xcb)](saveUpdates(_0x41d9a2[_0x2c9dc9(0xd2)],null))['then'](respondWithResult(_0xdfe3ca,null))[_0x2c9dc9(0xbd)](handleError(_0xdfe3ca,null));},exports[a450_0x40a790(0xc7)]=function(_0x385bb4,_0x1050da){const _0x28f674=a450_0x40a790;return db[_0x28f674(0xab)]['findOne']({'where':{'id':_0x385bb4['params']['id']}})[_0x28f674(0xcb)](handleEntityNotFound(_0x1050da,null))['then'](removeEntity(_0x1050da,null))['catch'](handleError(_0x1050da,null));},exports['describe']=function(_0x5cd600,_0x291a58){const _0x18970e=a450_0x40a790;return db[_0x18970e(0xab)]['describe']()['then'](respondWithResult(_0x291a58,null))[_0x18970e(0xbd)](handleError(_0x291a58,null));};
\ No newline at end of file
+const a450_0x45ad=['VIRTUAL','describe','merge','rawAttributes','fields','rows','status','options','findOne','create','attributes','../../components/parsers/qs','map','type','where','send','filter','length','name','fieldName','include','body','index','count','model','limit','update','lodash','sendStatus','findAll','filters','../../config/logger','catch','then','includeAll','undefined','offset','sequelize','query','stack','sort','keys','like','error','destroy','params','order','json','Content-Range','key','intersection','JscriptyAnswerReport'];(function(_0x448d41,_0x4acabf){const _0x45adfe=function(_0x1f8522){while(--_0x1f8522){_0x448d41['push'](_0x448d41['shift']());}};_0x45adfe(++_0x4acabf);}(a450_0x45ad,0x1e2));const a450_0x1f85=function(_0x448d41,_0x4acabf){_0x448d41=_0x448d41-0xfc;let _0x45adfe=a450_0x45ad[_0x448d41];return _0x45adfe;};const a450_0x4ec72a=a450_0x1f85;'use strict';const _=require(a450_0x4ec72a(0x109)),qs=require(a450_0x4ec72a(0x12d)),logger=require(a450_0x4ec72a(0x10d))('api'),{db}=require('../../mysqldb'),{Op}=require(a450_0x4ec72a(0x113));function respondWithResult(_0x5b97b2,_0x2420d7){return _0x2420d7=_0x2420d7||0xc8,function(_0x340533){const _0x20203e=a450_0x1f85;if(_0x340533)return _0x5b97b2[_0x20203e(0x128)](_0x2420d7)['json'](_0x340533);};}function respondWithFilteredResult(_0x59a864,_0x38c4ab){return function(_0x367bea){const _0x1a4ab8=a450_0x1f85;if(_0x367bea){const _0x30579f=_0x367bea[_0x1a4ab8(0x105)],_0x39bb65=_0x38c4ab[_0x1a4ab8(0x112)];let _0x4d182d=_0x38c4ab[_0x1a4ab8(0x112)]+_0x38c4ab['limit'],_0x5af4ef;return _0x4d182d>=_0x30579f?(_0x4d182d=_0x30579f,_0x5af4ef=0xc8):_0x5af4ef=0xce,_0x59a864[_0x1a4ab8(0x128)](_0x5af4ef),_0x59a864['set'](_0x1a4ab8(0x11e),_0x39bb65+'-'+_0x4d182d+'/'+_0x30579f)[_0x1a4ab8(0x11d)](_0x367bea);}return null;};}function saveUpdates(_0x18fe15){return function(_0x504abe){const _0x2bd8ce=a450_0x1f85;if(_0x504abe)return _0x504abe[_0x2bd8ce(0x108)](_0x18fe15)[_0x2bd8ce(0x10f)](function(_0x217d7e){return _0x217d7e;});return null;};}function removeEntity(_0x233ccb){return function(_0x250384){const _0x485bb1=a450_0x1f85;if(_0x250384)return _0x250384[_0x485bb1(0x11a)]()[_0x485bb1(0x10f)](function(){const _0x271fbc=_0x485bb1;_0x233ccb[_0x271fbc(0x128)](0xcc)['end']();});};}function handleEntityNotFound(_0x21bd15){return function(_0x269591){const _0x19e76b=a450_0x1f85;return!_0x269591&&_0x21bd15[_0x19e76b(0x10a)](0x194),_0x269591;};}function handleError(_0x3f2b43,_0x4eb1bb){return _0x4eb1bb=_0x4eb1bb||0x1f4,function(_0x47e2fe){const _0xc66886=a450_0x1f85;logger[_0xc66886(0x119)](_0x47e2fe[_0xc66886(0x115)]),_0x47e2fe['name']&&delete _0x47e2fe['name'],_0x3f2b43[_0xc66886(0x128)](_0x4eb1bb)[_0xc66886(0xfd)](_0x47e2fe);};}exports[a450_0x4ec72a(0x104)]=function(_0xe2e659,_0x4bc6ec){const _0x240e4a=a450_0x4ec72a;let _0x5d0381={};const _0x2f2c12={},_0x46eb97={'count':0x0,'rows':[]},_0x3e6894=_['map'](db[_0x240e4a(0x121)][_0x240e4a(0x125)],function(_0x338e5b){const _0x352b60=_0x240e4a;return{'name':_0x338e5b[_0x352b60(0x101)],'type':_0x338e5b[_0x352b60(0x12f)][_0x352b60(0x11f)]};});_0x2f2c12[_0x240e4a(0x106)]=_['map'](_0x3e6894,'name'),_0x2f2c12[_0x240e4a(0x114)]=_[_0x240e4a(0x117)](_0xe2e659[_0x240e4a(0x114)]),_0x2f2c12[_0x240e4a(0x10c)]=_[_0x240e4a(0x120)](_0x2f2c12['model'],_0x2f2c12['query']),_0x5d0381[_0x240e4a(0x12c)]=_[_0x240e4a(0x120)](_0x2f2c12[_0x240e4a(0x106)],qs[_0x240e4a(0x126)](_0xe2e659[_0x240e4a(0x114)][_0x240e4a(0x126)])),_0x5d0381[_0x240e4a(0x12c)]=_0x5d0381['attributes'][_0x240e4a(0xff)]?_0x5d0381[_0x240e4a(0x12c)]:_0x2f2c12[_0x240e4a(0x106)];typeof _0xe2e659['query']['nolimit']===_0x240e4a(0x111)&&(_0x5d0381[_0x240e4a(0x107)]=qs['limit'](_0xe2e659[_0x240e4a(0x114)][_0x240e4a(0x107)]),_0x5d0381[_0x240e4a(0x112)]=qs[_0x240e4a(0x112)](_0xe2e659[_0x240e4a(0x114)]['offset']));_0x5d0381[_0x240e4a(0x11c)]=qs[_0x240e4a(0x116)](_0xe2e659[_0x240e4a(0x114)]['sort']),_0x5d0381[_0x240e4a(0xfc)]=qs[_0x240e4a(0x10c)](_['pick'](_0xe2e659[_0x240e4a(0x114)],_0x2f2c12['filters']),_0x3e6894);_0xe2e659[_0x240e4a(0x114)][_0x240e4a(0xfe)]&&(_0x5d0381['where']=_['merge'](_0x5d0381[_0x240e4a(0xfc)],{[Op['or']]:_[_0x240e4a(0x12e)](_0x3e6894,function(_0x17d5d2){const _0x2cba98=_0x240e4a;if(_0x17d5d2['type']!==_0x2cba98(0x122)){const _0x2bc21b={};return _0x2bc21b[_0x17d5d2[_0x2cba98(0x100)]]={[Op[_0x2cba98(0x118)]]:'%'+_0xe2e659[_0x2cba98(0x114)][_0x2cba98(0xfe)]+'%'},_0x2bc21b;}})}));_0x5d0381=_[_0x240e4a(0x124)]({},_0x5d0381,_0xe2e659[_0x240e4a(0x129)]);const _0x55f9a9={'where':_0x5d0381[_0x240e4a(0xfc)]};return db[_0x240e4a(0x121)]['count'](_0x55f9a9)[_0x240e4a(0x10f)](function(_0x307a82){const _0x15a470=_0x240e4a;return _0x46eb97[_0x15a470(0x105)]=_0x307a82,_0xe2e659[_0x15a470(0x114)][_0x15a470(0x110)]&&(_0x5d0381[_0x15a470(0x102)]=[{'all':!![]}]),db['JscriptyAnswerReport'][_0x15a470(0x10b)](_0x5d0381);})[_0x240e4a(0x10f)](function(_0x35936f){const _0x28da8b=_0x240e4a;return _0x46eb97[_0x28da8b(0x127)]=_0x35936f,_0x46eb97;})[_0x240e4a(0x10f)](respondWithFilteredResult(_0x4bc6ec,_0x5d0381))[_0x240e4a(0x10e)](handleError(_0x4bc6ec,null));},exports['show']=function(_0x3102ad,_0x325fc1){const _0x1b9e5b=a450_0x4ec72a;let _0x267492={'raw':!![],'where':{'id':_0x3102ad['params']['id']}};const _0xe95bcf={};return _0xe95bcf[_0x1b9e5b(0x106)]=_[_0x1b9e5b(0x117)](db[_0x1b9e5b(0x121)][_0x1b9e5b(0x125)]),_0xe95bcf[_0x1b9e5b(0x114)]=_['keys'](_0x3102ad[_0x1b9e5b(0x114)]),_0xe95bcf[_0x1b9e5b(0x10c)]=_[_0x1b9e5b(0x120)](_0xe95bcf[_0x1b9e5b(0x106)],_0xe95bcf[_0x1b9e5b(0x114)]),_0x267492[_0x1b9e5b(0x12c)]=_[_0x1b9e5b(0x120)](_0xe95bcf[_0x1b9e5b(0x106)],qs[_0x1b9e5b(0x126)](_0x3102ad[_0x1b9e5b(0x114)][_0x1b9e5b(0x126)])),_0x267492[_0x1b9e5b(0x12c)]=_0x267492[_0x1b9e5b(0x12c)][_0x1b9e5b(0xff)]?_0x267492['attributes']:_0xe95bcf[_0x1b9e5b(0x106)],_0x3102ad[_0x1b9e5b(0x114)][_0x1b9e5b(0x110)]&&(_0x267492[_0x1b9e5b(0x102)]=[{'all':!![]}]),_0x267492=_['merge']({},_0x267492,_0x3102ad[_0x1b9e5b(0x129)]),db[_0x1b9e5b(0x121)][_0x1b9e5b(0x12a)](_0x267492)['then'](handleEntityNotFound(_0x325fc1,null))[_0x1b9e5b(0x10f)](respondWithResult(_0x325fc1,null))['catch'](handleError(_0x325fc1,null));},exports[a450_0x4ec72a(0x12b)]=function(_0x9536db,_0x4d4fa3){const _0x2786aa=a450_0x4ec72a;return db['JscriptyAnswerReport'][_0x2786aa(0x12b)](_0x9536db[_0x2786aa(0x103)],{})['then'](respondWithResult(_0x4d4fa3,0xc9))[_0x2786aa(0x10e)](handleError(_0x4d4fa3,null));},exports[a450_0x4ec72a(0x108)]=function(_0x301c72,_0x417a29){const _0x43c9dd=a450_0x4ec72a;return _0x301c72['body']['id']&&delete _0x301c72[_0x43c9dd(0x103)]['id'],db['JscriptyAnswerReport']['findOne']({'where':{'id':_0x301c72[_0x43c9dd(0x11b)]['id']}})[_0x43c9dd(0x10f)](handleEntityNotFound(_0x417a29,null))['then'](saveUpdates(_0x301c72[_0x43c9dd(0x103)],null))[_0x43c9dd(0x10f)](respondWithResult(_0x417a29,null))[_0x43c9dd(0x10e)](handleError(_0x417a29,null));},exports[a450_0x4ec72a(0x11a)]=function(_0x27e4e9,_0xeb018){const _0x4e6848=a450_0x4ec72a;return db[_0x4e6848(0x121)][_0x4e6848(0x12a)]({'where':{'id':_0x27e4e9['params']['id']}})['then'](handleEntityNotFound(_0xeb018,null))[_0x4e6848(0x10f)](removeEntity(_0xeb018,null))['catch'](handleError(_0xeb018,null));},exports[a450_0x4ec72a(0x123)]=function(_0x3e2903,_0x4545fe){const _0x2d8d13=a450_0x4ec72a;return db[_0x2d8d13(0x121)][_0x2d8d13(0x123)]()[_0x2d8d13(0x10f)](respondWithResult(_0x4545fe,null))['catch'](handleError(_0x4545fe,null));};
\ No newline at end of file