Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.controller.js
index ae0c4ef..9b4018a 100644 (file)
@@ -1 +1 @@
-const a374_0x3ba4=['destroy','sort','then','options','params','Content-Range','offset','keys','filters','lodash','include','catch','length','intersection','status','rows','index','../../components/parsers/qs','count','type','show','sequelize','body','filter','query','fields','update','describe','map','api','create','merge','send','key','sendStatus','rawAttributes','JscriptyAnswerReport','limit','nolimit','findOne','where','stack','includeAll','error','name','../../mysqldb','attributes','like','findAll','model'];(function(_0x50a6fd,_0x3ba416){const _0x3ab730=function(_0x423433){while(--_0x423433){_0x50a6fd['push'](_0x50a6fd['shift']());}};_0x3ab730(++_0x3ba416);}(a374_0x3ba4,0x1c6));const a374_0x3ab7=function(_0x50a6fd,_0x3ba416){_0x50a6fd=_0x50a6fd-0x0;let _0x3ab730=a374_0x3ba4[_0x50a6fd];return _0x3ab730;};const _0x6f89e6=a374_0x3ab7;'use strict';const _=require(_0x6f89e6('0x5')),qs=require(_0x6f89e6('0xd')),logger=require('../../config/logger')(_0x6f89e6('0x19')),db=require(_0x6f89e6('0x29'))['db'],{Op}=require(_0x6f89e6('0x11'));function respondWithResult(_0x423433,_0x3c1195){return _0x3c1195=_0x3c1195||0xc8,function(_0x20cd9d){if(_0x20cd9d)return _0x423433['status'](_0x3c1195)['json'](_0x20cd9d);};}function respondWithFilteredResult(_0x7d46b7,_0x51d6f1){return function(_0x49fd01){const _0x4efbfd=a374_0x3ab7;if(_0x49fd01){const _0x35ee68=_0x49fd01['count'],_0x49bffa=_0x51d6f1[_0x4efbfd('0x2')];let _0x1ae7f8=_0x51d6f1[_0x4efbfd('0x2')]+_0x51d6f1[_0x4efbfd('0x21')],_0x4300a2;return _0x1ae7f8>=_0x35ee68?(_0x1ae7f8=_0x35ee68,_0x4300a2=0xc8):_0x4300a2=0xce,_0x7d46b7[_0x4efbfd('0xa')](_0x4300a2),_0x7d46b7['set'](_0x4efbfd('0x1'),_0x49bffa+'-'+_0x1ae7f8+'/'+_0x35ee68)['json'](_0x49fd01);}return null;};}function saveUpdates(_0x1618d3){return function(_0x2b7c9a){const _0x175de4=a374_0x3ab7;if(_0x2b7c9a)return _0x2b7c9a['update'](_0x1618d3)[_0x175de4('0x30')](function(_0x1b9218){return _0x1b9218;});return null;};}function removeEntity(_0x327472){return function(_0x38879a){const _0x59441e=a374_0x3ab7;if(_0x38879a)return _0x38879a[_0x59441e('0x2e')]()['then'](function(){_0x327472['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x218f36){return function(_0x3384b7){const _0x51df1e=a374_0x3ab7;return!_0x3384b7&&_0x218f36[_0x51df1e('0x1e')](0x194),_0x3384b7;};}function handleError(_0xf0d2d,_0x439a45){return _0x439a45=_0x439a45||0x1f4,function(_0x271ad6){const _0x42818f=a374_0x3ab7;logger[_0x42818f('0x27')](_0x271ad6[_0x42818f('0x25')]),_0x271ad6[_0x42818f('0x28')]&&delete _0x271ad6[_0x42818f('0x28')],_0xf0d2d[_0x42818f('0xa')](_0x439a45)[_0x42818f('0x1c')](_0x271ad6);};}exports[_0x6f89e6('0xc')]=function(_0x5bd948,_0x3498ed){const _0x496c26=_0x6f89e6;let _0x1ed8d9={};const _0x2338c3={},_0x4c340f={'count':0x0,'rows':[]},_0x3cbce1=_[_0x496c26('0x18')](db['JscriptyAnswerReport'][_0x496c26('0x1f')],function(_0x4ff160){const _0x366d26=_0x496c26;return{'name':_0x4ff160['fieldName'],'type':_0x4ff160[_0x366d26('0xf')][_0x366d26('0x1d')]};});_0x2338c3[_0x496c26('0x2d')]=_[_0x496c26('0x18')](_0x3cbce1,_0x496c26('0x28')),_0x2338c3['query']=_[_0x496c26('0x3')](_0x5bd948[_0x496c26('0x14')]),_0x2338c3[_0x496c26('0x4')]=_[_0x496c26('0x9')](_0x2338c3['model'],_0x2338c3['query']),_0x1ed8d9[_0x496c26('0x2a')]=_[_0x496c26('0x9')](_0x2338c3[_0x496c26('0x2d')],qs[_0x496c26('0x15')](_0x5bd948['query'][_0x496c26('0x15')])),_0x1ed8d9[_0x496c26('0x2a')]=_0x1ed8d9['attributes'][_0x496c26('0x8')]?_0x1ed8d9['attributes']:_0x2338c3[_0x496c26('0x2d')];typeof _0x5bd948[_0x496c26('0x14')][_0x496c26('0x22')]==='undefined'&&(_0x1ed8d9[_0x496c26('0x21')]=qs['limit'](_0x5bd948[_0x496c26('0x14')][_0x496c26('0x21')]),_0x1ed8d9[_0x496c26('0x2')]=qs[_0x496c26('0x2')](_0x5bd948['query']['offset']));_0x1ed8d9['order']=qs[_0x496c26('0x2f')](_0x5bd948['query'][_0x496c26('0x2f')]),_0x1ed8d9[_0x496c26('0x24')]=qs['filters'](_['pick'](_0x5bd948[_0x496c26('0x14')],_0x2338c3[_0x496c26('0x4')]),_0x3cbce1);_0x5bd948[_0x496c26('0x14')][_0x496c26('0x13')]&&(_0x1ed8d9['where']=_[_0x496c26('0x1b')](_0x1ed8d9[_0x496c26('0x24')],{[Op['or']]:_[_0x496c26('0x18')](_0x3cbce1,function(_0x1aafd5){const _0x54d1f6=_0x496c26;if(_0x1aafd5[_0x54d1f6('0xf')]!=='VIRTUAL'){const _0x5419b4={};return _0x5419b4[_0x1aafd5[_0x54d1f6('0x28')]]={[Op[_0x54d1f6('0x2b')]]:'%'+_0x5bd948[_0x54d1f6('0x14')][_0x54d1f6('0x13')]+'%'},_0x5419b4;}})}));_0x1ed8d9=_[_0x496c26('0x1b')]({},_0x1ed8d9,_0x5bd948[_0x496c26('0x31')]);const _0x31201c={'where':_0x1ed8d9[_0x496c26('0x24')]};return db[_0x496c26('0x20')][_0x496c26('0xe')](_0x31201c)[_0x496c26('0x30')](function(_0x402767){const _0x2e7f48=_0x496c26;return _0x4c340f[_0x2e7f48('0xe')]=_0x402767,_0x5bd948['query']['includeAll']&&(_0x1ed8d9[_0x2e7f48('0x6')]=[{'all':!![]}]),db[_0x2e7f48('0x20')][_0x2e7f48('0x2c')](_0x1ed8d9);})[_0x496c26('0x30')](function(_0x34f186){const _0x12a418=_0x496c26;return _0x4c340f[_0x12a418('0xb')]=_0x34f186,_0x4c340f;})[_0x496c26('0x30')](respondWithFilteredResult(_0x3498ed,_0x1ed8d9))[_0x496c26('0x7')](handleError(_0x3498ed,null));},exports[_0x6f89e6('0x10')]=function(_0x3c42ec,_0x48cd5c){const _0x299c2d=_0x6f89e6;let _0x53a81b={'raw':!![],'where':{'id':_0x3c42ec[_0x299c2d('0x0')]['id']}};const _0x547a24={};return _0x547a24[_0x299c2d('0x2d')]=_[_0x299c2d('0x3')](db[_0x299c2d('0x20')]['rawAttributes']),_0x547a24[_0x299c2d('0x14')]=_[_0x299c2d('0x3')](_0x3c42ec['query']),_0x547a24['filters']=_[_0x299c2d('0x9')](_0x547a24['model'],_0x547a24[_0x299c2d('0x14')]),_0x53a81b[_0x299c2d('0x2a')]=_[_0x299c2d('0x9')](_0x547a24[_0x299c2d('0x2d')],qs['fields'](_0x3c42ec['query']['fields'])),_0x53a81b['attributes']=_0x53a81b[_0x299c2d('0x2a')]['length']?_0x53a81b[_0x299c2d('0x2a')]:_0x547a24[_0x299c2d('0x2d')],_0x3c42ec[_0x299c2d('0x14')][_0x299c2d('0x26')]&&(_0x53a81b[_0x299c2d('0x6')]=[{'all':!![]}]),_0x53a81b=_['merge']({},_0x53a81b,_0x3c42ec['options']),db['JscriptyAnswerReport'][_0x299c2d('0x23')](_0x53a81b)[_0x299c2d('0x30')](handleEntityNotFound(_0x48cd5c,null))[_0x299c2d('0x30')](respondWithResult(_0x48cd5c,null))[_0x299c2d('0x7')](handleError(_0x48cd5c,null));},exports[_0x6f89e6('0x1a')]=function(_0x1276a2,_0x3cb60b){const _0x551ff5=_0x6f89e6;return db[_0x551ff5('0x20')][_0x551ff5('0x1a')](_0x1276a2['body'],{})[_0x551ff5('0x30')](respondWithResult(_0x3cb60b,0xc9))['catch'](handleError(_0x3cb60b,null));},exports[_0x6f89e6('0x16')]=function(_0x273c14,_0x5555e6){const _0xb15215=_0x6f89e6;return _0x273c14[_0xb15215('0x12')]['id']&&delete _0x273c14['body']['id'],db[_0xb15215('0x20')][_0xb15215('0x23')]({'where':{'id':_0x273c14[_0xb15215('0x0')]['id']}})[_0xb15215('0x30')](handleEntityNotFound(_0x5555e6,null))['then'](saveUpdates(_0x273c14[_0xb15215('0x12')],null))[_0xb15215('0x30')](respondWithResult(_0x5555e6,null))[_0xb15215('0x7')](handleError(_0x5555e6,null));},exports[_0x6f89e6('0x2e')]=function(_0x876e3a,_0x4bde88){const _0x5e5dae=_0x6f89e6;return db[_0x5e5dae('0x20')]['findOne']({'where':{'id':_0x876e3a['params']['id']}})[_0x5e5dae('0x30')](handleEntityNotFound(_0x4bde88,null))['then'](removeEntity(_0x4bde88,null))[_0x5e5dae('0x7')](handleError(_0x4bde88,null));},exports['describe']=function(_0x1ceba9,_0x20ddb6){const _0x4d18f2=_0x6f89e6;return db['JscriptyAnswerReport'][_0x4d18f2('0x17')]()['then'](respondWithResult(_0x20ddb6,null))['catch'](handleError(_0x20ddb6,null));};
\ No newline at end of file
+const a374_0x5e82=['send','includeAll','destroy','../../components/parsers/qs','body','findOne','where','key','index','status','type','../../mysqldb','model','attributes','Content-Range','options','nolimit','create','include','query','count','sort','update','sendStatus','describe','fields','intersection','merge','rawAttributes','VIRTUAL','json','filters','sequelize','api','fieldName','limit','JscriptyAnswerReport','pick','like','offset','stack','keys','catch','error','map','findAll','filter','name','then','show'];(function(_0x1e336,_0x5e828a){const _0xed70c4=function(_0x1bb3fd){while(--_0x1bb3fd){_0x1e336['push'](_0x1e336['shift']());}};_0xed70c4(++_0x5e828a);}(a374_0x5e82,0x15a));const a374_0xed70=function(_0x1e336,_0x5e828a){_0x1e336=_0x1e336-0x0;let _0xed70c4=a374_0x5e82[_0x1e336];return _0xed70c4;};const _0x16f4ba=a374_0xed70;'use strict';const _=require('lodash'),qs=require(_0x16f4ba('0x7')),logger=require('../../config/logger')(_0x16f4ba('0x25')),db=require(_0x16f4ba('0xf'))['db'],{Op}=require(_0x16f4ba('0x24'));function respondWithResult(_0x1bb3fd,_0x4720a8){return _0x4720a8=_0x4720a8||0xc8,function(_0x16e71b){const _0x4af140=a374_0xed70;if(_0x16e71b)return _0x1bb3fd['status'](_0x4720a8)[_0x4af140('0x22')](_0x16e71b);};}function respondWithFilteredResult(_0x1e658e,_0x754e52){return function(_0x5ab9d2){const _0x2fc4d7=a374_0xed70;if(_0x5ab9d2){const _0x45625a=_0x5ab9d2[_0x2fc4d7('0x18')],_0x2fd688=_0x754e52[_0x2fc4d7('0x2b')];let _0x4a2ee9=_0x754e52[_0x2fc4d7('0x2b')]+_0x754e52['limit'],_0x3573ec;return _0x4a2ee9>=_0x45625a?(_0x4a2ee9=_0x45625a,_0x3573ec=0xc8):_0x3573ec=0xce,_0x1e658e['status'](_0x3573ec),_0x1e658e['set'](_0x2fc4d7('0x12'),_0x2fd688+'-'+_0x4a2ee9+'/'+_0x45625a)['json'](_0x5ab9d2);}return null;};}function saveUpdates(_0x5b0313){return function(_0x26ae78){const _0x491037=a374_0xed70;if(_0x26ae78)return _0x26ae78[_0x491037('0x1a')](_0x5b0313)['then'](function(_0x24b219){return _0x24b219;});return null;};}function removeEntity(_0x3c825e){return function(_0xc003a6){const _0x579e34=a374_0xed70;if(_0xc003a6)return _0xc003a6['destroy']()[_0x579e34('0x2')](function(){_0x3c825e['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x5cd1fe){return function(_0x196652){const _0x5603af=a374_0xed70;return!_0x196652&&_0x5cd1fe[_0x5603af('0x1b')](0x194),_0x196652;};}function handleError(_0x243157,_0x4908c6){return _0x4908c6=_0x4908c6||0x1f4,function(_0x47c9c9){const _0xb83e7a=a374_0xed70;logger[_0xb83e7a('0x2f')](_0x47c9c9[_0xb83e7a('0x2c')]),_0x47c9c9[_0xb83e7a('0x1')]&&delete _0x47c9c9[_0xb83e7a('0x1')],_0x243157[_0xb83e7a('0xd')](_0x4908c6)[_0xb83e7a('0x4')](_0x47c9c9);};}exports[_0x16f4ba('0xc')]=function(_0xe123c2,_0xc6e272){const _0x9e0023=_0x16f4ba;let _0x1afb05={};const _0x55a226={},_0x4380ef={'count':0x0,'rows':[]},_0x406b7b=_[_0x9e0023('0x30')](db['JscriptyAnswerReport'][_0x9e0023('0x20')],function(_0x481f0b){const _0x10c70c=_0x9e0023;return{'name':_0x481f0b[_0x10c70c('0x26')],'type':_0x481f0b[_0x10c70c('0xe')][_0x10c70c('0xb')]};});_0x55a226[_0x9e0023('0x10')]=_[_0x9e0023('0x30')](_0x406b7b,'name'),_0x55a226[_0x9e0023('0x17')]=_[_0x9e0023('0x2d')](_0xe123c2[_0x9e0023('0x17')]),_0x55a226[_0x9e0023('0x23')]=_[_0x9e0023('0x1e')](_0x55a226[_0x9e0023('0x10')],_0x55a226[_0x9e0023('0x17')]),_0x1afb05[_0x9e0023('0x11')]=_['intersection'](_0x55a226[_0x9e0023('0x10')],qs[_0x9e0023('0x1d')](_0xe123c2[_0x9e0023('0x17')]['fields'])),_0x1afb05[_0x9e0023('0x11')]=_0x1afb05['attributes']['length']?_0x1afb05[_0x9e0023('0x11')]:_0x55a226['model'];typeof _0xe123c2[_0x9e0023('0x17')][_0x9e0023('0x14')]==='undefined'&&(_0x1afb05[_0x9e0023('0x27')]=qs[_0x9e0023('0x27')](_0xe123c2[_0x9e0023('0x17')][_0x9e0023('0x27')]),_0x1afb05[_0x9e0023('0x2b')]=qs['offset'](_0xe123c2['query'][_0x9e0023('0x2b')]));_0x1afb05['order']=qs[_0x9e0023('0x19')](_0xe123c2[_0x9e0023('0x17')][_0x9e0023('0x19')]),_0x1afb05[_0x9e0023('0xa')]=qs[_0x9e0023('0x23')](_[_0x9e0023('0x29')](_0xe123c2[_0x9e0023('0x17')],_0x55a226['filters']),_0x406b7b);_0xe123c2[_0x9e0023('0x17')][_0x9e0023('0x0')]&&(_0x1afb05[_0x9e0023('0xa')]=_[_0x9e0023('0x1f')](_0x1afb05['where'],{[Op['or']]:_[_0x9e0023('0x30')](_0x406b7b,function(_0x4ceade){const _0x15524f=_0x9e0023;if(_0x4ceade[_0x15524f('0xe')]!==_0x15524f('0x21')){const _0x47ef80={};return _0x47ef80[_0x4ceade['name']]={[Op[_0x15524f('0x2a')]]:'%'+_0xe123c2['query']['filter']+'%'},_0x47ef80;}})}));_0x1afb05=_['merge']({},_0x1afb05,_0xe123c2[_0x9e0023('0x13')]);const _0x296d04={'where':_0x1afb05[_0x9e0023('0xa')]};return db[_0x9e0023('0x28')]['count'](_0x296d04)[_0x9e0023('0x2')](function(_0x134864){const _0x55d832=_0x9e0023;return _0x4380ef['count']=_0x134864,_0xe123c2[_0x55d832('0x17')]['includeAll']&&(_0x1afb05[_0x55d832('0x16')]=[{'all':!![]}]),db[_0x55d832('0x28')][_0x55d832('0x31')](_0x1afb05);})['then'](function(_0x55cced){return _0x4380ef['rows']=_0x55cced,_0x4380ef;})[_0x9e0023('0x2')](respondWithFilteredResult(_0xc6e272,_0x1afb05))[_0x9e0023('0x2e')](handleError(_0xc6e272,null));},exports[_0x16f4ba('0x3')]=function(_0x25abb9,_0x5e2fce){const _0x5911d4=_0x16f4ba;let _0x208506={'raw':!![],'where':{'id':_0x25abb9['params']['id']}};const _0x57ed78={};return _0x57ed78[_0x5911d4('0x10')]=_['keys'](db[_0x5911d4('0x28')][_0x5911d4('0x20')]),_0x57ed78['query']=_[_0x5911d4('0x2d')](_0x25abb9[_0x5911d4('0x17')]),_0x57ed78[_0x5911d4('0x23')]=_['intersection'](_0x57ed78[_0x5911d4('0x10')],_0x57ed78[_0x5911d4('0x17')]),_0x208506['attributes']=_[_0x5911d4('0x1e')](_0x57ed78[_0x5911d4('0x10')],qs[_0x5911d4('0x1d')](_0x25abb9[_0x5911d4('0x17')][_0x5911d4('0x1d')])),_0x208506[_0x5911d4('0x11')]=_0x208506[_0x5911d4('0x11')]['length']?_0x208506['attributes']:_0x57ed78[_0x5911d4('0x10')],_0x25abb9[_0x5911d4('0x17')][_0x5911d4('0x5')]&&(_0x208506[_0x5911d4('0x16')]=[{'all':!![]}]),_0x208506=_[_0x5911d4('0x1f')]({},_0x208506,_0x25abb9[_0x5911d4('0x13')]),db[_0x5911d4('0x28')][_0x5911d4('0x9')](_0x208506)[_0x5911d4('0x2')](handleEntityNotFound(_0x5e2fce,null))[_0x5911d4('0x2')](respondWithResult(_0x5e2fce,null))[_0x5911d4('0x2e')](handleError(_0x5e2fce,null));},exports[_0x16f4ba('0x15')]=function(_0x8391cf,_0x3b5159){const _0x2b8585=_0x16f4ba;return db[_0x2b8585('0x28')][_0x2b8585('0x15')](_0x8391cf[_0x2b8585('0x8')],{})[_0x2b8585('0x2')](respondWithResult(_0x3b5159,0xc9))[_0x2b8585('0x2e')](handleError(_0x3b5159,null));},exports[_0x16f4ba('0x1a')]=function(_0x5836cd,_0x1bd961){const _0x2c17dc=_0x16f4ba;return _0x5836cd[_0x2c17dc('0x8')]['id']&&delete _0x5836cd[_0x2c17dc('0x8')]['id'],db[_0x2c17dc('0x28')][_0x2c17dc('0x9')]({'where':{'id':_0x5836cd['params']['id']}})[_0x2c17dc('0x2')](handleEntityNotFound(_0x1bd961,null))[_0x2c17dc('0x2')](saveUpdates(_0x5836cd['body'],null))[_0x2c17dc('0x2')](respondWithResult(_0x1bd961,null))[_0x2c17dc('0x2e')](handleError(_0x1bd961,null));},exports[_0x16f4ba('0x6')]=function(_0x254cd7,_0x2c8afc){const _0x1eb383=_0x16f4ba;return db['JscriptyAnswerReport']['findOne']({'where':{'id':_0x254cd7['params']['id']}})[_0x1eb383('0x2')](handleEntityNotFound(_0x2c8afc,null))[_0x1eb383('0x2')](removeEntity(_0x2c8afc,null))['catch'](handleError(_0x2c8afc,null));},exports[_0x16f4ba('0x1c')]=function(_0x5541ed,_0x54c770){const _0x5120ae=_0x16f4ba;return db[_0x5120ae('0x28')]['describe']()[_0x5120ae('0x2')](respondWithResult(_0x54c770,null))[_0x5120ae('0x2e')](handleError(_0x54c770,null));};
\ No newline at end of file