Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.controller.js
index 338ea26..0caac7e 100644 (file)
@@ -1 +1 @@
-'use strict';const a460_0x2fe9=['7NUOGSH','count','model','end','length','@utils/filter-attributes','key','@components/parsers/qs','send','filter','merge','name','pick','keys','175120Qbnyex','status','sort','intersection','catch','272543ytnULH','84653sIptZk','undefined','578338dpEgUr','map','8989rdHbJS','then','findAll','includeAll','15hvRJec','describe','where','set','options','params','attributes','41015JfksNt','lodash','JscriptyQuestionReport','error','fieldName','body','limit','fields','json','Content-Range','4KNJMuq','query','rawAttributes','include','findOne','create','@mysqldb','type','filters','offset','update','467826LqDLNU','stack','destroy','@config/logger'];const a460_0x20b7=function(_0x1654f6,_0x5e0e16){_0x1654f6=_0x1654f6-0x19d;let _0x2fe9e0=a460_0x2fe9[_0x1654f6];return _0x2fe9e0;};const a460_0x2a66fc=a460_0x20b7;(function(_0x23d1b2,_0x45df89){const _0x2fb5bb=a460_0x20b7;while(!![]){try{const _0x357bc1=parseInt(_0x2fb5bb(0x19e))+-parseInt(_0x2fb5bb(0x1b8))+parseInt(_0x2fb5bb(0x1c5))*parseInt(_0x2fb5bb(0x1be))+parseInt(_0x2fb5bb(0x1ba))*-parseInt(_0x2fb5bb(0x1a2))+-parseInt(_0x2fb5bb(0x1b5))+-parseInt(_0x2fb5bb(0x1cf))*-parseInt(_0x2fb5bb(0x1b6))+-parseInt(_0x2fb5bb(0x1b0));if(_0x357bc1===_0x45df89)break;else _0x23d1b2['push'](_0x23d1b2['shift']());}catch(_0x5703bd){_0x23d1b2['push'](_0x23d1b2['shift']());}}}(a460_0x2fe9,0x513c3));const _=require(a460_0x2a66fc(0x1c6)),qs=require(a460_0x2a66fc(0x1a9)),logger=require(a460_0x2a66fc(0x1a1))('api'),{db}=require(a460_0x2a66fc(0x1d5)),{filterAttributes}=require(a460_0x2a66fc(0x1a7));function respondWithResult(_0x1069a6,_0x1fc83f){return _0x1fc83f=_0x1fc83f||0xc8,function(_0x15c317){const _0x104378=a460_0x20b7;if(_0x15c317)return _0x1069a6[_0x104378(0x1b1)](_0x1fc83f)[_0x104378(0x1cd)](_0x15c317);};}function respondWithFilteredResult(_0x17201f,_0x4f5dd2){return function(_0x1cd4b7){const _0x998826=a460_0x20b7;if(_0x1cd4b7){const _0x4d82d1=_0x1cd4b7['count'],_0x34d50f=_0x4f5dd2[_0x998826(0x1d8)];let _0x2b9a33=_0x4f5dd2[_0x998826(0x1d8)]+_0x4f5dd2[_0x998826(0x1cb)],_0x5adea8;return _0x2b9a33>=_0x4d82d1?(_0x2b9a33=_0x4d82d1,_0x5adea8=0xc8):_0x5adea8=0xce,_0x17201f['status'](_0x5adea8),_0x17201f[_0x998826(0x1c1)](_0x998826(0x1ce),_0x34d50f+'-'+_0x2b9a33+'/'+_0x4d82d1)[_0x998826(0x1cd)](_0x1cd4b7);}return null;};}function saveUpdates(_0x1012a3){return function(_0x7fd721){const _0x13abb7=a460_0x20b7;if(_0x7fd721)return _0x7fd721[_0x13abb7(0x19d)](_0x1012a3)[_0x13abb7(0x1bb)](function(_0x5d0267){return _0x5d0267;});return null;};}function removeEntity(_0x33b985){return function(_0x434f0d){const _0x29bf88=a460_0x20b7;if(_0x434f0d)return _0x434f0d['destroy']()[_0x29bf88(0x1bb)](function(){const _0xf43a9c=_0x29bf88;_0x33b985[_0xf43a9c(0x1b1)](0xcc)[_0xf43a9c(0x1a5)]();});};}function handleEntityNotFound(_0x488363){return function(_0x52835e){return!_0x52835e&&_0x488363['sendStatus'](0x194),_0x52835e;};}function handleError(_0x44609f,_0x5795f9){return _0x5795f9=_0x5795f9||0x1f4,function(_0xfa0d90){const _0x3d5307=a460_0x20b7;logger[_0x3d5307(0x1c8)](_0xfa0d90[_0x3d5307(0x19f)]),_0xfa0d90[_0x3d5307(0x1ad)]&&delete _0xfa0d90[_0x3d5307(0x1ad)],_0x44609f[_0x3d5307(0x1b1)](_0x5795f9)[_0x3d5307(0x1aa)](_0xfa0d90);};}exports['index']=function(_0x4ca232,_0x4679b1){const _0x2006ba=a460_0x2a66fc;let _0x5a6e8c={};const _0x25d988={},_0x3c2175={'count':0x0,'rows':[]},_0x429312=_[_0x2006ba(0x1b9)](db[_0x2006ba(0x1c7)][_0x2006ba(0x1d1)],function(_0x5f1fab){const _0x14f55f=_0x2006ba;return{'name':_0x5f1fab[_0x14f55f(0x1c9)],'type':_0x5f1fab[_0x14f55f(0x1d6)][_0x14f55f(0x1a8)]};});_0x25d988[_0x2006ba(0x1a4)]=_[_0x2006ba(0x1b9)](_0x429312,'name'),_0x25d988[_0x2006ba(0x1d0)]=_[_0x2006ba(0x1af)](_0x4ca232['query']),_0x25d988[_0x2006ba(0x1d7)]=_[_0x2006ba(0x1b3)](_0x25d988[_0x2006ba(0x1a4)],_0x25d988[_0x2006ba(0x1d0)]),_0x5a6e8c[_0x2006ba(0x1c4)]=_[_0x2006ba(0x1b3)](_0x25d988[_0x2006ba(0x1a4)],qs[_0x2006ba(0x1cc)](_0x4ca232[_0x2006ba(0x1d0)][_0x2006ba(0x1cc)])),_0x5a6e8c[_0x2006ba(0x1c4)]=_0x5a6e8c[_0x2006ba(0x1c4)][_0x2006ba(0x1a6)]?_0x5a6e8c[_0x2006ba(0x1c4)]:_0x25d988['model'];typeof _0x4ca232[_0x2006ba(0x1d0)]['nolimit']===_0x2006ba(0x1b7)&&(_0x5a6e8c[_0x2006ba(0x1cb)]=qs[_0x2006ba(0x1cb)](_0x4ca232['query'][_0x2006ba(0x1cb)]),_0x5a6e8c[_0x2006ba(0x1d8)]=qs[_0x2006ba(0x1d8)](_0x4ca232[_0x2006ba(0x1d0)][_0x2006ba(0x1d8)]));_0x5a6e8c['order']=qs[_0x2006ba(0x1b2)](_0x4ca232[_0x2006ba(0x1d0)][_0x2006ba(0x1b2)]),_0x5a6e8c[_0x2006ba(0x1c0)]=qs[_0x2006ba(0x1d7)](_[_0x2006ba(0x1ae)](_0x4ca232['query'],_0x25d988[_0x2006ba(0x1d7)]),_0x429312),_0x5a6e8c=filterAttributes(_0x5a6e8c,_0x4ca232[_0x2006ba(0x1d0)][_0x2006ba(0x1ab)],_0x429312,_0x4ca232[_0x2006ba(0x1c2)]);const _0x31aaa5={'where':_0x5a6e8c['where']};return db[_0x2006ba(0x1c7)]['count'](_0x31aaa5)[_0x2006ba(0x1bb)](function(_0x5aea62){const _0x39cf32=_0x2006ba;return _0x3c2175[_0x39cf32(0x1a3)]=_0x5aea62,_0x4ca232['query'][_0x39cf32(0x1bd)]&&(_0x5a6e8c[_0x39cf32(0x1d2)]=[{'all':!![]}]),db[_0x39cf32(0x1c7)][_0x39cf32(0x1bc)](_0x5a6e8c);})[_0x2006ba(0x1bb)](function(_0x5ab9ee){return _0x3c2175['rows']=_0x5ab9ee,_0x3c2175;})[_0x2006ba(0x1bb)](respondWithFilteredResult(_0x4679b1,_0x5a6e8c))['catch'](handleError(_0x4679b1,null));},exports['show']=function(_0xdfe869,_0x26e354){const _0x23dcdf=a460_0x2a66fc;let _0x399ba7={'raw':!![],'where':{'id':_0xdfe869[_0x23dcdf(0x1c3)]['id']}};const _0x55df7b={};return _0x55df7b[_0x23dcdf(0x1a4)]=_[_0x23dcdf(0x1af)](db[_0x23dcdf(0x1c7)]['rawAttributes']),_0x55df7b[_0x23dcdf(0x1d0)]=_['keys'](_0xdfe869[_0x23dcdf(0x1d0)]),_0x55df7b[_0x23dcdf(0x1d7)]=_[_0x23dcdf(0x1b3)](_0x55df7b[_0x23dcdf(0x1a4)],_0x55df7b['query']),_0x399ba7['attributes']=_[_0x23dcdf(0x1b3)](_0x55df7b['model'],qs[_0x23dcdf(0x1cc)](_0xdfe869[_0x23dcdf(0x1d0)][_0x23dcdf(0x1cc)])),_0x399ba7[_0x23dcdf(0x1c4)]=_0x399ba7[_0x23dcdf(0x1c4)][_0x23dcdf(0x1a6)]?_0x399ba7[_0x23dcdf(0x1c4)]:_0x55df7b['model'],_0xdfe869[_0x23dcdf(0x1d0)][_0x23dcdf(0x1bd)]&&(_0x399ba7[_0x23dcdf(0x1d2)]=[{'all':!![]}]),_0x399ba7=_[_0x23dcdf(0x1ac)]({},_0x399ba7,_0xdfe869[_0x23dcdf(0x1c2)]),db['JscriptyQuestionReport'][_0x23dcdf(0x1d3)](_0x399ba7)[_0x23dcdf(0x1bb)](handleEntityNotFound(_0x26e354,null))[_0x23dcdf(0x1bb)](respondWithResult(_0x26e354,null))['catch'](handleError(_0x26e354,null));},exports[a460_0x2a66fc(0x1d4)]=function(_0x5c4d4a,_0x57f247){const _0x235401=a460_0x2a66fc;return db[_0x235401(0x1c7)][_0x235401(0x1d4)](_0x5c4d4a['body'],{})[_0x235401(0x1bb)](respondWithResult(_0x57f247,0xc9))[_0x235401(0x1b4)](handleError(_0x57f247,null));},exports[a460_0x2a66fc(0x19d)]=function(_0x464a6b,_0x35ac47){const _0x7758da=a460_0x2a66fc;return _0x464a6b[_0x7758da(0x1ca)]['id']&&delete _0x464a6b[_0x7758da(0x1ca)]['id'],db[_0x7758da(0x1c7)][_0x7758da(0x1d3)]({'where':{'id':_0x464a6b[_0x7758da(0x1c3)]['id']}})[_0x7758da(0x1bb)](handleEntityNotFound(_0x35ac47,null))[_0x7758da(0x1bb)](saveUpdates(_0x464a6b[_0x7758da(0x1ca)],null))[_0x7758da(0x1bb)](respondWithResult(_0x35ac47,null))[_0x7758da(0x1b4)](handleError(_0x35ac47,null));},exports[a460_0x2a66fc(0x1a0)]=function(_0x5227cd,_0x16886f){const _0x49d9c7=a460_0x2a66fc;return db[_0x49d9c7(0x1c7)][_0x49d9c7(0x1d3)]({'where':{'id':_0x5227cd[_0x49d9c7(0x1c3)]['id']}})['then'](handleEntityNotFound(_0x16886f,null))['then'](removeEntity(_0x16886f,null))['catch'](handleError(_0x16886f,null));},exports[a460_0x2a66fc(0x1bf)]=function(_0x175903,_0x2bb86f){const _0x2ea63a=a460_0x2a66fc;return db['JscriptyQuestionReport'][_0x2ea63a(0x1bf)]()['then'](respondWithResult(_0x2bb86f,null))[_0x2ea63a(0x1b4)](handleError(_0x2bb86f,null));};
\ No newline at end of file
+'use strict';const a460_0x3a25=['key','limit','@components/parsers/qs','nolimit','count','destroy','1HOHxJv','json','335983fmZLLs','body','show','sort','filters','then','query','undefined','623210GHzKDs','fields','describe','includeAll','model','send','@config/logger','Content-Range','findOne','create','include','lodash','JscriptyQuestionReport','1365515QjmbJI','where','1nlcDdU','rows','intersection','type','catch','rawAttributes','163931kpZGGE','190881ARrFXw','error','name','461myLvRg','end','set','1432IkFTwg','params','keys','order','length','@utils/filter-attributes','attributes','offset','api','577sLpkoN','options','sendStatus','status','merge','update','map','1867hQzhCX'];const a460_0x308f=function(_0x518eef,_0x38d5dd){_0x518eef=_0x518eef-0x17d;let _0x3a2546=a460_0x3a25[_0x518eef];return _0x3a2546;};const a460_0x511d30=a460_0x308f;(function(_0x52c27c,_0x29a5e5){const _0x127f5a=a460_0x308f;while(!![]){try{const _0x1f6d11=-parseInt(_0x127f5a(0x1aa))*parseInt(_0x127f5a(0x18b))+-parseInt(_0x127f5a(0x1ab))+-parseInt(_0x127f5a(0x1b1))*parseInt(_0x127f5a(0x17d))+parseInt(_0x127f5a(0x1ae))*parseInt(_0x127f5a(0x184))+parseInt(_0x127f5a(0x18d))+-parseInt(_0x127f5a(0x195))+-parseInt(_0x127f5a(0x1a4))*-parseInt(_0x127f5a(0x1a2));if(_0x1f6d11===_0x29a5e5)break;else _0x52c27c['push'](_0x52c27c['shift']());}catch(_0x2f743e){_0x52c27c['push'](_0x52c27c['shift']());}}}(a460_0x3a25,0xb908b));const _=require(a460_0x511d30(0x1a0)),qs=require(a460_0x511d30(0x187)),logger=require(a460_0x511d30(0x19b))(a460_0x511d30(0x1b9)),{db}=require('@mysqldb'),{filterAttributes}=require(a460_0x511d30(0x1b6));function respondWithResult(_0x4c7680,_0x11dd93){return _0x11dd93=_0x11dd93||0xc8,function(_0x23ff99){const _0x358c4f=a460_0x308f;if(_0x23ff99)return _0x4c7680['status'](_0x11dd93)[_0x358c4f(0x18c)](_0x23ff99);};}function respondWithFilteredResult(_0x19a89b,_0x38d5c0){return function(_0x5d6e69){const _0x522072=a460_0x308f;if(_0x5d6e69){const _0x4e2a1e=_0x5d6e69['count'],_0x20c5d6=_0x38d5c0[_0x522072(0x1b8)];let _0x3c07e0=_0x38d5c0[_0x522072(0x1b8)]+_0x38d5c0[_0x522072(0x186)],_0x413a2d;return _0x3c07e0>=_0x4e2a1e?(_0x3c07e0=_0x4e2a1e,_0x413a2d=0xc8):_0x413a2d=0xce,_0x19a89b[_0x522072(0x180)](_0x413a2d),_0x19a89b[_0x522072(0x1b0)](_0x522072(0x19c),_0x20c5d6+'-'+_0x3c07e0+'/'+_0x4e2a1e)[_0x522072(0x18c)](_0x5d6e69);}return null;};}function saveUpdates(_0x296c2f){return function(_0x560600){const _0x4c38e3=a460_0x308f;if(_0x560600)return _0x560600[_0x4c38e3(0x182)](_0x296c2f)[_0x4c38e3(0x192)](function(_0xc3268a){return _0xc3268a;});return null;};}function removeEntity(_0x3bf82c){return function(_0x5a7c5c){const _0x38fe42=a460_0x308f;if(_0x5a7c5c)return _0x5a7c5c[_0x38fe42(0x18a)]()[_0x38fe42(0x192)](function(){const _0x293d17=_0x38fe42;_0x3bf82c[_0x293d17(0x180)](0xcc)[_0x293d17(0x1af)]();});};}function handleEntityNotFound(_0x48540a){return function(_0xffb0b){const _0x6d8ac7=a460_0x308f;return!_0xffb0b&&_0x48540a[_0x6d8ac7(0x17f)](0x194),_0xffb0b;};}function handleError(_0x578713,_0x324404){return _0x324404=_0x324404||0x1f4,function(_0x2561ed){const _0x2c0c32=a460_0x308f;logger[_0x2c0c32(0x1ac)](_0x2561ed['stack']),_0x2561ed[_0x2c0c32(0x1ad)]&&delete _0x2561ed[_0x2c0c32(0x1ad)],_0x578713[_0x2c0c32(0x180)](_0x324404)[_0x2c0c32(0x19a)](_0x2561ed);};}exports['index']=function(_0x36585f,_0x48f348){const _0x1288f1=a460_0x511d30;let _0x6354e8={};const _0x48a526={},_0x1037e0={'count':0x0,'rows':[]},_0x180d6b=_['map'](db[_0x1288f1(0x1a1)][_0x1288f1(0x1a9)],function(_0x55e3e1){const _0x554335=_0x1288f1;return{'name':_0x55e3e1['fieldName'],'type':_0x55e3e1[_0x554335(0x1a7)][_0x554335(0x185)]};});_0x48a526[_0x1288f1(0x199)]=_[_0x1288f1(0x183)](_0x180d6b,_0x1288f1(0x1ad)),_0x48a526[_0x1288f1(0x193)]=_[_0x1288f1(0x1b3)](_0x36585f[_0x1288f1(0x193)]),_0x48a526[_0x1288f1(0x191)]=_[_0x1288f1(0x1a6)](_0x48a526[_0x1288f1(0x199)],_0x48a526[_0x1288f1(0x193)]),_0x6354e8['attributes']=_[_0x1288f1(0x1a6)](_0x48a526['model'],qs[_0x1288f1(0x196)](_0x36585f[_0x1288f1(0x193)][_0x1288f1(0x196)])),_0x6354e8[_0x1288f1(0x1b7)]=_0x6354e8[_0x1288f1(0x1b7)]['length']?_0x6354e8[_0x1288f1(0x1b7)]:_0x48a526[_0x1288f1(0x199)];typeof _0x36585f[_0x1288f1(0x193)][_0x1288f1(0x188)]===_0x1288f1(0x194)&&(_0x6354e8[_0x1288f1(0x186)]=qs[_0x1288f1(0x186)](_0x36585f[_0x1288f1(0x193)][_0x1288f1(0x186)]),_0x6354e8[_0x1288f1(0x1b8)]=qs[_0x1288f1(0x1b8)](_0x36585f['query'][_0x1288f1(0x1b8)]));_0x6354e8[_0x1288f1(0x1b4)]=qs[_0x1288f1(0x190)](_0x36585f[_0x1288f1(0x193)][_0x1288f1(0x190)]),_0x6354e8[_0x1288f1(0x1a3)]=qs['filters'](_['pick'](_0x36585f['query'],_0x48a526[_0x1288f1(0x191)]),_0x180d6b),_0x6354e8=filterAttributes(_0x6354e8,_0x36585f[_0x1288f1(0x193)]['filter'],_0x180d6b,_0x36585f[_0x1288f1(0x17e)]);const _0x4d232a={'where':_0x6354e8[_0x1288f1(0x1a3)]};return db['JscriptyQuestionReport'][_0x1288f1(0x189)](_0x4d232a)[_0x1288f1(0x192)](function(_0x14c686){const _0x1c0747=_0x1288f1;return _0x1037e0[_0x1c0747(0x189)]=_0x14c686,_0x36585f[_0x1c0747(0x193)]['includeAll']&&(_0x6354e8['include']=[{'all':!![]}]),db['JscriptyQuestionReport']['findAll'](_0x6354e8);})[_0x1288f1(0x192)](function(_0x473ac6){const _0x4b9e5e=_0x1288f1;return _0x1037e0[_0x4b9e5e(0x1a5)]=_0x473ac6,_0x1037e0;})[_0x1288f1(0x192)](respondWithFilteredResult(_0x48f348,_0x6354e8))[_0x1288f1(0x1a8)](handleError(_0x48f348,null));},exports[a460_0x511d30(0x18f)]=function(_0x172a69,_0x4b5981){const _0x2756b5=a460_0x511d30;let _0x5de8d9={'raw':!![],'where':{'id':_0x172a69[_0x2756b5(0x1b2)]['id']}};const _0x1e1dbe={};return _0x1e1dbe[_0x2756b5(0x199)]=_[_0x2756b5(0x1b3)](db[_0x2756b5(0x1a1)]['rawAttributes']),_0x1e1dbe[_0x2756b5(0x193)]=_[_0x2756b5(0x1b3)](_0x172a69[_0x2756b5(0x193)]),_0x1e1dbe['filters']=_[_0x2756b5(0x1a6)](_0x1e1dbe[_0x2756b5(0x199)],_0x1e1dbe[_0x2756b5(0x193)]),_0x5de8d9[_0x2756b5(0x1b7)]=_[_0x2756b5(0x1a6)](_0x1e1dbe[_0x2756b5(0x199)],qs['fields'](_0x172a69[_0x2756b5(0x193)][_0x2756b5(0x196)])),_0x5de8d9[_0x2756b5(0x1b7)]=_0x5de8d9['attributes'][_0x2756b5(0x1b5)]?_0x5de8d9[_0x2756b5(0x1b7)]:_0x1e1dbe[_0x2756b5(0x199)],_0x172a69[_0x2756b5(0x193)][_0x2756b5(0x198)]&&(_0x5de8d9[_0x2756b5(0x19f)]=[{'all':!![]}]),_0x5de8d9=_[_0x2756b5(0x181)]({},_0x5de8d9,_0x172a69['options']),db['JscriptyQuestionReport'][_0x2756b5(0x19d)](_0x5de8d9)[_0x2756b5(0x192)](handleEntityNotFound(_0x4b5981,null))[_0x2756b5(0x192)](respondWithResult(_0x4b5981,null))[_0x2756b5(0x1a8)](handleError(_0x4b5981,null));},exports[a460_0x511d30(0x19e)]=function(_0x2a4191,_0x3d9812){const _0x2388c5=a460_0x511d30;return db['JscriptyQuestionReport']['create'](_0x2a4191['body'],{})[_0x2388c5(0x192)](respondWithResult(_0x3d9812,0xc9))[_0x2388c5(0x1a8)](handleError(_0x3d9812,null));},exports[a460_0x511d30(0x182)]=function(_0x123118,_0x9f3f1e){const _0x571fdc=a460_0x511d30;return _0x123118[_0x571fdc(0x18e)]['id']&&delete _0x123118['body']['id'],db[_0x571fdc(0x1a1)][_0x571fdc(0x19d)]({'where':{'id':_0x123118[_0x571fdc(0x1b2)]['id']}})[_0x571fdc(0x192)](handleEntityNotFound(_0x9f3f1e,null))[_0x571fdc(0x192)](saveUpdates(_0x123118[_0x571fdc(0x18e)],null))[_0x571fdc(0x192)](respondWithResult(_0x9f3f1e,null))['catch'](handleError(_0x9f3f1e,null));},exports[a460_0x511d30(0x18a)]=function(_0x48560e,_0x32126a){const _0xd6ad8e=a460_0x511d30;return db['JscriptyQuestionReport'][_0xd6ad8e(0x19d)]({'where':{'id':_0x48560e[_0xd6ad8e(0x1b2)]['id']}})[_0xd6ad8e(0x192)](handleEntityNotFound(_0x32126a,null))['then'](removeEntity(_0x32126a,null))[_0xd6ad8e(0x1a8)](handleError(_0x32126a,null));},exports[a460_0x511d30(0x197)]=function(_0xefe92a,_0x5eb047){const _0x13c844=a460_0x511d30;return db[_0x13c844(0x1a1)][_0x13c844(0x197)]()[_0x13c844(0x192)](respondWithResult(_0x5eb047,null))[_0x13c844(0x1a8)](handleError(_0x5eb047,null));};
\ No newline at end of file