Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.controller.js
index fe23e62..35238df 100644 (file)
@@ -1 +1 @@
-const a460_0x2ebc=['stack','rows','filters','where','sort','describe','api','sequelize','keys','fieldName','status','nolimit','show','error','offset','name','map','query','length','include','count','update','filter','options','merge','like','rawAttributes','fields','catch','create','then','undefined','json','findOne','type','model','key','lodash','JscriptyQuestionReport','body','attributes','intersection','set','sendStatus','params','includeAll','destroy','index','../../components/parsers/qs','pick','order','Content-Range','limit'];(function(_0x2df9b2,_0x140876){const _0x2ebcc9=function(_0x180376){while(--_0x180376){_0x2df9b2['push'](_0x2df9b2['shift']());}};_0x2ebcc9(++_0x140876);}(a460_0x2ebc,0x1e2));const a460_0x1803=function(_0x2df9b2,_0x140876){_0x2df9b2=_0x2df9b2-0x1ec;let _0x2ebcc9=a460_0x2ebc[_0x2df9b2];return _0x2ebcc9;};const a460_0x1b38fb=a460_0x1803;'use strict';const _=require(a460_0x1b38fb(0x20c)),qs=require(a460_0x1b38fb(0x217)),logger=require('../../config/logger')(a460_0x1b38fb(0x1ed)),{db}=require('../../mysqldb'),{Op}=require(a460_0x1b38fb(0x1ee));function respondWithResult(_0x120afc,_0x68ee64){return _0x68ee64=_0x68ee64||0xc8,function(_0x4b8b2a){const _0x9a6b51=a460_0x1803;if(_0x4b8b2a)return _0x120afc[_0x9a6b51(0x1f1)](_0x68ee64)[_0x9a6b51(0x207)](_0x4b8b2a);};}function respondWithFilteredResult(_0x3f3d19,_0x472498){return function(_0x419cb3){const _0x270a45=a460_0x1803;if(_0x419cb3){const _0x3954c0=_0x419cb3[_0x270a45(0x1fb)],_0x311908=_0x472498[_0x270a45(0x1f5)];let _0x476f07=_0x472498[_0x270a45(0x1f5)]+_0x472498[_0x270a45(0x21b)],_0x25b08f;return _0x476f07>=_0x3954c0?(_0x476f07=_0x3954c0,_0x25b08f=0xc8):_0x25b08f=0xce,_0x3f3d19['status'](_0x25b08f),_0x3f3d19[_0x270a45(0x211)](_0x270a45(0x21a),_0x311908+'-'+_0x476f07+'/'+_0x3954c0)[_0x270a45(0x207)](_0x419cb3);}return null;};}function saveUpdates(_0x4ea749){return function(_0x392ed3){const _0x16fcd6=a460_0x1803;if(_0x392ed3)return _0x392ed3['update'](_0x4ea749)[_0x16fcd6(0x205)](function(_0x364a2c){return _0x364a2c;});return null;};}function removeEntity(_0x3d572c){return function(_0x259d10){const _0x32c2a9=a460_0x1803;if(_0x259d10)return _0x259d10[_0x32c2a9(0x215)]()[_0x32c2a9(0x205)](function(){const _0x1e1dc8=_0x32c2a9;_0x3d572c[_0x1e1dc8(0x1f1)](0xcc)['end']();});};}function handleEntityNotFound(_0x117391){return function(_0x32a8ef){const _0x4f9d25=a460_0x1803;return!_0x32a8ef&&_0x117391[_0x4f9d25(0x212)](0x194),_0x32a8ef;};}function handleError(_0x444d38,_0x4df661){return _0x4df661=_0x4df661||0x1f4,function(_0xeae01a){const _0x3a7163=a460_0x1803;logger[_0x3a7163(0x1f4)](_0xeae01a[_0x3a7163(0x21c)]),_0xeae01a['name']&&delete _0xeae01a[_0x3a7163(0x1f6)],_0x444d38[_0x3a7163(0x1f1)](_0x4df661)['send'](_0xeae01a);};}exports[a460_0x1b38fb(0x216)]=function(_0x1d057a,_0x1360ff){const _0x56956a=a460_0x1b38fb;let _0x256dab={};const _0x3fa216={},_0x4da21b={'count':0x0,'rows':[]},_0x5b442b=_[_0x56956a(0x1f7)](db[_0x56956a(0x20d)][_0x56956a(0x201)],function(_0x51d34a){const _0x478b1f=_0x56956a;return{'name':_0x51d34a[_0x478b1f(0x1f0)],'type':_0x51d34a[_0x478b1f(0x209)][_0x478b1f(0x20b)]};});_0x3fa216[_0x56956a(0x20a)]=_['map'](_0x5b442b,_0x56956a(0x1f6)),_0x3fa216[_0x56956a(0x1f8)]=_[_0x56956a(0x1ef)](_0x1d057a[_0x56956a(0x1f8)]),_0x3fa216[_0x56956a(0x21e)]=_[_0x56956a(0x210)](_0x3fa216[_0x56956a(0x20a)],_0x3fa216[_0x56956a(0x1f8)]),_0x256dab[_0x56956a(0x20f)]=_['intersection'](_0x3fa216[_0x56956a(0x20a)],qs[_0x56956a(0x202)](_0x1d057a[_0x56956a(0x1f8)][_0x56956a(0x202)])),_0x256dab[_0x56956a(0x20f)]=_0x256dab[_0x56956a(0x20f)]['length']?_0x256dab[_0x56956a(0x20f)]:_0x3fa216[_0x56956a(0x20a)];typeof _0x1d057a[_0x56956a(0x1f8)][_0x56956a(0x1f2)]===_0x56956a(0x206)&&(_0x256dab['limit']=qs['limit'](_0x1d057a[_0x56956a(0x1f8)][_0x56956a(0x21b)]),_0x256dab[_0x56956a(0x1f5)]=qs[_0x56956a(0x1f5)](_0x1d057a['query'][_0x56956a(0x1f5)]));_0x256dab[_0x56956a(0x219)]=qs['sort'](_0x1d057a['query'][_0x56956a(0x220)]),_0x256dab[_0x56956a(0x21f)]=qs['filters'](_[_0x56956a(0x218)](_0x1d057a[_0x56956a(0x1f8)],_0x3fa216['filters']),_0x5b442b);_0x1d057a['query'][_0x56956a(0x1fd)]&&(_0x256dab[_0x56956a(0x21f)]=_['merge'](_0x256dab[_0x56956a(0x21f)],{[Op['or']]:_['map'](_0x5b442b,function(_0x58ee95){const _0x245088=_0x56956a;if(_0x58ee95['type']!=='VIRTUAL'){const _0x5baaef={};return _0x5baaef[_0x58ee95[_0x245088(0x1f6)]]={[Op[_0x245088(0x200)]]:'%'+_0x1d057a['query'][_0x245088(0x1fd)]+'%'},_0x5baaef;}})}));_0x256dab=_[_0x56956a(0x1ff)]({},_0x256dab,_0x1d057a['options']);const _0x398579={'where':_0x256dab['where']};return db[_0x56956a(0x20d)][_0x56956a(0x1fb)](_0x398579)[_0x56956a(0x205)](function(_0x2bb96a){const _0x5d2731=_0x56956a;return _0x4da21b[_0x5d2731(0x1fb)]=_0x2bb96a,_0x1d057a[_0x5d2731(0x1f8)][_0x5d2731(0x214)]&&(_0x256dab[_0x5d2731(0x1fa)]=[{'all':!![]}]),db[_0x5d2731(0x20d)]['findAll'](_0x256dab);})[_0x56956a(0x205)](function(_0x4f57ba){const _0x3ef8bf=_0x56956a;return _0x4da21b[_0x3ef8bf(0x21d)]=_0x4f57ba,_0x4da21b;})[_0x56956a(0x205)](respondWithFilteredResult(_0x1360ff,_0x256dab))[_0x56956a(0x203)](handleError(_0x1360ff,null));},exports[a460_0x1b38fb(0x1f3)]=function(_0x393b1f,_0x18c12e){const _0x315daf=a460_0x1b38fb;let _0x509a19={'raw':!![],'where':{'id':_0x393b1f[_0x315daf(0x213)]['id']}};const _0x5931b9={};return _0x5931b9['model']=_[_0x315daf(0x1ef)](db[_0x315daf(0x20d)][_0x315daf(0x201)]),_0x5931b9['query']=_[_0x315daf(0x1ef)](_0x393b1f[_0x315daf(0x1f8)]),_0x5931b9[_0x315daf(0x21e)]=_[_0x315daf(0x210)](_0x5931b9['model'],_0x5931b9[_0x315daf(0x1f8)]),_0x509a19[_0x315daf(0x20f)]=_[_0x315daf(0x210)](_0x5931b9[_0x315daf(0x20a)],qs[_0x315daf(0x202)](_0x393b1f[_0x315daf(0x1f8)][_0x315daf(0x202)])),_0x509a19[_0x315daf(0x20f)]=_0x509a19[_0x315daf(0x20f)][_0x315daf(0x1f9)]?_0x509a19[_0x315daf(0x20f)]:_0x5931b9['model'],_0x393b1f[_0x315daf(0x1f8)][_0x315daf(0x214)]&&(_0x509a19[_0x315daf(0x1fa)]=[{'all':!![]}]),_0x509a19=_[_0x315daf(0x1ff)]({},_0x509a19,_0x393b1f[_0x315daf(0x1fe)]),db[_0x315daf(0x20d)][_0x315daf(0x208)](_0x509a19)[_0x315daf(0x205)](handleEntityNotFound(_0x18c12e,null))['then'](respondWithResult(_0x18c12e,null))[_0x315daf(0x203)](handleError(_0x18c12e,null));},exports['create']=function(_0x2f3480,_0x314a3e){const _0x4b620b=a460_0x1b38fb;return db[_0x4b620b(0x20d)][_0x4b620b(0x204)](_0x2f3480[_0x4b620b(0x20e)],{})[_0x4b620b(0x205)](respondWithResult(_0x314a3e,0xc9))[_0x4b620b(0x203)](handleError(_0x314a3e,null));},exports[a460_0x1b38fb(0x1fc)]=function(_0xbf815e,_0x29b355){const _0x597d0a=a460_0x1b38fb;return _0xbf815e['body']['id']&&delete _0xbf815e[_0x597d0a(0x20e)]['id'],db['JscriptyQuestionReport'][_0x597d0a(0x208)]({'where':{'id':_0xbf815e[_0x597d0a(0x213)]['id']}})[_0x597d0a(0x205)](handleEntityNotFound(_0x29b355,null))[_0x597d0a(0x205)](saveUpdates(_0xbf815e[_0x597d0a(0x20e)],null))[_0x597d0a(0x205)](respondWithResult(_0x29b355,null))['catch'](handleError(_0x29b355,null));},exports['destroy']=function(_0x57413c,_0x5a5a14){const _0x520ae8=a460_0x1b38fb;return db['JscriptyQuestionReport'][_0x520ae8(0x208)]({'where':{'id':_0x57413c['params']['id']}})[_0x520ae8(0x205)](handleEntityNotFound(_0x5a5a14,null))[_0x520ae8(0x205)](removeEntity(_0x5a5a14,null))[_0x520ae8(0x203)](handleError(_0x5a5a14,null));},exports[a460_0x1b38fb(0x1ec)]=function(_0x17c12a,_0x53eef1){const _0x3205b4=a460_0x1b38fb;return db[_0x3205b4(0x20d)][_0x3205b4(0x1ec)]()['then'](respondWithResult(_0x53eef1,null))['catch'](handleError(_0x53eef1,null));};
\ No newline at end of file
+const a460_0x9fd6=['update','sequelize','attributes','index','../../components/parsers/qs','destroy','../../mysqldb','pick','map','offset','fieldName','error','catch','filters','sendStatus','filter','name','body','intersection','merge','describe','rawAttributes','findAll','params','keys','count','sort','findOne','limit','lodash','JscriptyQuestionReport','end','then','where','nolimit','order','show','query','set','length','includeAll','rows','model','status','VIRTUAL','json','like','options','send','type','include','create','../../config/logger','fields'];(function(_0x14d28a,_0x328b7d){const _0x9fd65f=function(_0x2f6ae8){while(--_0x2f6ae8){_0x14d28a['push'](_0x14d28a['shift']());}};_0x9fd65f(++_0x328b7d);}(a460_0x9fd6,0x197));const a460_0x2f6a=function(_0x14d28a,_0x328b7d){_0x14d28a=_0x14d28a-0xf3;let _0x9fd65f=a460_0x9fd6[_0x14d28a];return _0x9fd65f;};const a460_0x1f1241=a460_0x2f6a;'use strict';const _=require(a460_0x1f1241(0xf3)),qs=require(a460_0x1f1241(0x110)),logger=require(a460_0x1f1241(0x10a))('api'),{db}=require(a460_0x1f1241(0x112)),{Op}=require(a460_0x1f1241(0x10d));function respondWithResult(_0x16b722,_0x511ccc){return _0x511ccc=_0x511ccc||0xc8,function(_0x1d809e){if(_0x1d809e)return _0x16b722['status'](_0x511ccc)['json'](_0x1d809e);};}function respondWithFilteredResult(_0x1ee49b,_0x306d04){return function(_0x183721){const _0xfcf314=a460_0x2f6a;if(_0x183721){const _0x54b0b4=_0x183721[_0xfcf314(0x125)],_0x2fee82=_0x306d04[_0xfcf314(0x115)];let _0x3371ae=_0x306d04[_0xfcf314(0x115)]+_0x306d04[_0xfcf314(0x128)],_0x3dac4e;return _0x3371ae>=_0x54b0b4?(_0x3371ae=_0x54b0b4,_0x3dac4e=0xc8):_0x3dac4e=0xce,_0x1ee49b[_0xfcf314(0x101)](_0x3dac4e),_0x1ee49b[_0xfcf314(0xfc)]('Content-Range',_0x2fee82+'-'+_0x3371ae+'/'+_0x54b0b4)[_0xfcf314(0x103)](_0x183721);}return null;};}function saveUpdates(_0x1a8ddc){return function(_0x497a5f){const _0x5c796a=a460_0x2f6a;if(_0x497a5f)return _0x497a5f['update'](_0x1a8ddc)[_0x5c796a(0xf6)](function(_0x184e48){return _0x184e48;});return null;};}function removeEntity(_0x374a84){return function(_0x3e21d4){const _0x2130fc=a460_0x2f6a;if(_0x3e21d4)return _0x3e21d4[_0x2130fc(0x111)]()['then'](function(){const _0x109726=_0x2130fc;_0x374a84[_0x109726(0x101)](0xcc)[_0x109726(0xf5)]();});};}function handleEntityNotFound(_0x4084ef){return function(_0x1452fd){const _0x5a4905=a460_0x2f6a;return!_0x1452fd&&_0x4084ef[_0x5a4905(0x11a)](0x194),_0x1452fd;};}function handleError(_0x3499a5,_0x21489f){return _0x21489f=_0x21489f||0x1f4,function(_0x17888e){const _0xa20e21=a460_0x2f6a;logger[_0xa20e21(0x117)](_0x17888e['stack']),_0x17888e[_0xa20e21(0x11c)]&&delete _0x17888e['name'],_0x3499a5['status'](_0x21489f)[_0xa20e21(0x106)](_0x17888e);};}exports[a460_0x1f1241(0x10f)]=function(_0x2eaecc,_0x2ad7ed){const _0x5953a8=a460_0x1f1241;let _0x569c41={};const _0x124bd0={},_0x59ad76={'count':0x0,'rows':[]},_0x1f64da=_[_0x5953a8(0x114)](db[_0x5953a8(0xf4)][_0x5953a8(0x121)],function(_0x3cabd0){const _0x3cc7b2=_0x5953a8;return{'name':_0x3cabd0[_0x3cc7b2(0x116)],'type':_0x3cabd0[_0x3cc7b2(0x107)]['key']};});_0x124bd0[_0x5953a8(0x100)]=_[_0x5953a8(0x114)](_0x1f64da,_0x5953a8(0x11c)),_0x124bd0[_0x5953a8(0xfb)]=_['keys'](_0x2eaecc[_0x5953a8(0xfb)]),_0x124bd0[_0x5953a8(0x119)]=_[_0x5953a8(0x11e)](_0x124bd0[_0x5953a8(0x100)],_0x124bd0[_0x5953a8(0xfb)]),_0x569c41[_0x5953a8(0x10e)]=_[_0x5953a8(0x11e)](_0x124bd0['model'],qs['fields'](_0x2eaecc['query'][_0x5953a8(0x10b)])),_0x569c41[_0x5953a8(0x10e)]=_0x569c41['attributes']['length']?_0x569c41['attributes']:_0x124bd0[_0x5953a8(0x100)];typeof _0x2eaecc[_0x5953a8(0xfb)][_0x5953a8(0xf8)]==='undefined'&&(_0x569c41[_0x5953a8(0x128)]=qs['limit'](_0x2eaecc[_0x5953a8(0xfb)][_0x5953a8(0x128)]),_0x569c41['offset']=qs[_0x5953a8(0x115)](_0x2eaecc[_0x5953a8(0xfb)][_0x5953a8(0x115)]));_0x569c41[_0x5953a8(0xf9)]=qs[_0x5953a8(0x126)](_0x2eaecc[_0x5953a8(0xfb)]['sort']),_0x569c41['where']=qs[_0x5953a8(0x119)](_[_0x5953a8(0x113)](_0x2eaecc[_0x5953a8(0xfb)],_0x124bd0[_0x5953a8(0x119)]),_0x1f64da);_0x2eaecc['query'][_0x5953a8(0x11b)]&&(_0x569c41['where']=_[_0x5953a8(0x11f)](_0x569c41['where'],{[Op['or']]:_['map'](_0x1f64da,function(_0x4bb0ee){const _0x3f0dce=_0x5953a8;if(_0x4bb0ee[_0x3f0dce(0x107)]!==_0x3f0dce(0x102)){const _0x15fa77={};return _0x15fa77[_0x4bb0ee[_0x3f0dce(0x11c)]]={[Op[_0x3f0dce(0x104)]]:'%'+_0x2eaecc[_0x3f0dce(0xfb)][_0x3f0dce(0x11b)]+'%'},_0x15fa77;}})}));_0x569c41=_[_0x5953a8(0x11f)]({},_0x569c41,_0x2eaecc[_0x5953a8(0x105)]);const _0x42f1cc={'where':_0x569c41[_0x5953a8(0xf7)]};return db['JscriptyQuestionReport'][_0x5953a8(0x125)](_0x42f1cc)['then'](function(_0x4e3305){const _0x5e50ef=_0x5953a8;return _0x59ad76[_0x5e50ef(0x125)]=_0x4e3305,_0x2eaecc[_0x5e50ef(0xfb)]['includeAll']&&(_0x569c41[_0x5e50ef(0x108)]=[{'all':!![]}]),db[_0x5e50ef(0xf4)][_0x5e50ef(0x122)](_0x569c41);})[_0x5953a8(0xf6)](function(_0x219cf3){const _0x313df2=_0x5953a8;return _0x59ad76[_0x313df2(0xff)]=_0x219cf3,_0x59ad76;})[_0x5953a8(0xf6)](respondWithFilteredResult(_0x2ad7ed,_0x569c41))[_0x5953a8(0x118)](handleError(_0x2ad7ed,null));},exports[a460_0x1f1241(0xfa)]=function(_0x5231a5,_0x1c8d0c){const _0x31dc97=a460_0x1f1241;let _0x53ffc4={'raw':!![],'where':{'id':_0x5231a5[_0x31dc97(0x123)]['id']}};const _0x354e78={};return _0x354e78['model']=_[_0x31dc97(0x124)](db[_0x31dc97(0xf4)][_0x31dc97(0x121)]),_0x354e78[_0x31dc97(0xfb)]=_[_0x31dc97(0x124)](_0x5231a5[_0x31dc97(0xfb)]),_0x354e78[_0x31dc97(0x119)]=_[_0x31dc97(0x11e)](_0x354e78['model'],_0x354e78[_0x31dc97(0xfb)]),_0x53ffc4[_0x31dc97(0x10e)]=_[_0x31dc97(0x11e)](_0x354e78[_0x31dc97(0x100)],qs[_0x31dc97(0x10b)](_0x5231a5['query']['fields'])),_0x53ffc4[_0x31dc97(0x10e)]=_0x53ffc4[_0x31dc97(0x10e)][_0x31dc97(0xfd)]?_0x53ffc4['attributes']:_0x354e78['model'],_0x5231a5[_0x31dc97(0xfb)][_0x31dc97(0xfe)]&&(_0x53ffc4[_0x31dc97(0x108)]=[{'all':!![]}]),_0x53ffc4=_[_0x31dc97(0x11f)]({},_0x53ffc4,_0x5231a5[_0x31dc97(0x105)]),db['JscriptyQuestionReport'][_0x31dc97(0x127)](_0x53ffc4)['then'](handleEntityNotFound(_0x1c8d0c,null))['then'](respondWithResult(_0x1c8d0c,null))[_0x31dc97(0x118)](handleError(_0x1c8d0c,null));},exports[a460_0x1f1241(0x109)]=function(_0x7a0f19,_0x4cea6a){const _0xc5e17f=a460_0x1f1241;return db['JscriptyQuestionReport'][_0xc5e17f(0x109)](_0x7a0f19[_0xc5e17f(0x11d)],{})[_0xc5e17f(0xf6)](respondWithResult(_0x4cea6a,0xc9))[_0xc5e17f(0x118)](handleError(_0x4cea6a,null));},exports[a460_0x1f1241(0x10c)]=function(_0x442a5a,_0x34aca3){const _0x25e1da=a460_0x1f1241;return _0x442a5a[_0x25e1da(0x11d)]['id']&&delete _0x442a5a[_0x25e1da(0x11d)]['id'],db[_0x25e1da(0xf4)]['findOne']({'where':{'id':_0x442a5a['params']['id']}})[_0x25e1da(0xf6)](handleEntityNotFound(_0x34aca3,null))[_0x25e1da(0xf6)](saveUpdates(_0x442a5a[_0x25e1da(0x11d)],null))[_0x25e1da(0xf6)](respondWithResult(_0x34aca3,null))['catch'](handleError(_0x34aca3,null));},exports['destroy']=function(_0x371f62,_0x32d03f){const _0x328d36=a460_0x1f1241;return db[_0x328d36(0xf4)][_0x328d36(0x127)]({'where':{'id':_0x371f62[_0x328d36(0x123)]['id']}})[_0x328d36(0xf6)](handleEntityNotFound(_0x32d03f,null))['then'](removeEntity(_0x32d03f,null))[_0x328d36(0x118)](handleError(_0x32d03f,null));},exports[a460_0x1f1241(0x120)]=function(_0x2c0b37,_0x1c8bbc){const _0x42487a=a460_0x1f1241;return db[_0x42487a(0xf4)][_0x42487a(0x120)]()['then'](respondWithResult(_0x1c8bbc,null))['catch'](handleError(_0x1c8bbc,null));};
\ No newline at end of file