Built motion from commit 56b8093a.|2.6.29
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index a1b9706..8455d49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f4=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body','find','describe','getQuestions','filter','JscriptyQuestionReport','findAll','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x597fc6,_0x32f069){var _0x121bba=function(_0x8da8e2){while(--_0x8da8e2){_0x597fc6['push'](_0x597fc6['shift']());}};_0x121bba(++_0x32f069);}(_0x68f4,0x87));var _0x468f=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x68f4[_0x5951e8];return _0x20a1f5;};'use strict';var emlformat=require(_0x468f('0x0'));var rimraf=require(_0x468f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x468f('0x2'));var rp=require(_0x468f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x468f('0x4'));var util=require(_0x468f('0x5'));var path=require(_0x468f('0x6'));var sox=require(_0x468f('0x7'));var csv=require(_0x468f('0x8'));var ejs=require(_0x468f('0x9'));var fs=require('fs');var fs_extra=require(_0x468f('0xa'));var _=require(_0x468f('0xb'));var squel=require(_0x468f('0xc'));var crypto=require(_0x468f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x468f('0x8'));var querystring=require(_0x468f('0xe'));var Papa=require('papaparse');var Redis=require(_0x468f('0xf'));var authService=require(_0x468f('0x10'));var qs=require(_0x468f('0x11'));var as=require(_0x468f('0x12'));var hardwareService=require(_0x468f('0x13'));var logger=require('../../config/logger')(_0x468f('0x14'));var utils=require(_0x468f('0x15'));var config=require(_0x468f('0x16'));var licenseUtil=require(_0x468f('0x17'));var db=require(_0x468f('0x18'))['db'];function respondWithStatusCode(_0x295b64,_0x99afe7){_0x99afe7=_0x99afe7||0xcc;return function(_0x52acea){if(_0x52acea){return _0x295b64[_0x468f('0x19')](_0x99afe7);}return _0x295b64[_0x468f('0x1a')](_0x99afe7)[_0x468f('0x1b')]();};}function respondWithResult(_0xe5e9bf,_0x3ceedd){_0x3ceedd=_0x3ceedd||0xc8;return function(_0x104dbf){if(_0x104dbf){return _0xe5e9bf[_0x468f('0x1a')](_0x3ceedd)[_0x468f('0x1c')](_0x104dbf);}};}function respondWithFilteredResult(_0x3e0557,_0x85b846){return function(_0x3d5d90){if(_0x3d5d90){var _0x38b354=typeof _0x85b846[_0x468f('0x1d')]===_0x468f('0x1e')&&typeof _0x85b846[_0x468f('0x1f')]===_0x468f('0x1e');var _0x112589=_0x3d5d90[_0x468f('0x20')];var _0x43d6ff=_0x38b354?0x0:_0x85b846[_0x468f('0x1d')];var _0x5693bc=_0x38b354?_0x3d5d90[_0x468f('0x20')]:_0x85b846[_0x468f('0x1d')]+_0x85b846[_0x468f('0x1f')];var _0x17cf00;if(_0x5693bc>=_0x112589){_0x5693bc=_0x112589;_0x17cf00=0xc8;}else{_0x17cf00=0xce;}_0x3e0557[_0x468f('0x1a')](_0x17cf00);return _0x3e0557[_0x468f('0x21')](_0x468f('0x22'),_0x43d6ff+'-'+_0x5693bc+'/'+_0x112589)[_0x468f('0x1c')](_0x3d5d90);}return null;};}function patchUpdates(_0x9fbc23){return function(_0x3a8e72){try{jsonpatch[_0x468f('0x23')](_0x3a8e72,_0x9fbc23,!![]);}catch(_0x2112e4){return BPromise['reject'](_0x2112e4);}return _0x3a8e72['save']();};}function saveUpdates(_0x96f3e9,_0x5d3c22){return function(_0x4ac7c0){if(_0x4ac7c0){return _0x4ac7c0[_0x468f('0x24')](_0x96f3e9)[_0x468f('0x25')](function(_0x1d8f35){return _0x1d8f35;});}return null;};}function removeEntity(_0x4f6795,_0x300d23){return function(_0x451751){if(_0x451751){return _0x451751[_0x468f('0x26')]()[_0x468f('0x25')](function(){_0x4f6795[_0x468f('0x1a')](0xcc)[_0x468f('0x1b')]();});}};}function handleEntityNotFound(_0x5c02b9,_0x39d90a){return function(_0x22ccd4){if(!_0x22ccd4){_0x5c02b9['sendStatus'](0x194);}return _0x22ccd4;};}function handleError(_0x26db10,_0x5b50f3){_0x5b50f3=_0x5b50f3||0x1f4;return function(_0x149c9d){logger[_0x468f('0x27')](_0x149c9d[_0x468f('0x28')]);if(_0x149c9d[_0x468f('0x29')]){delete _0x149c9d['name'];}_0x26db10[_0x468f('0x1a')](_0x5b50f3)[_0x468f('0x2a')](_0x149c9d);};}exports[_0x468f('0x2b')]=function(_0x1b0955,_0x1d4213){var _0xc67b28={},_0x4a76d4={},_0x40260e={'count':0x0,'rows':[]};var _0x19f3c9=_['map'](db[_0x468f('0x2c')][_0x468f('0x2d')],function(_0x42295b){return{'name':_0x42295b['fieldName'],'type':_0x42295b[_0x468f('0x2e')][_0x468f('0x2f')]};});_0x4a76d4['model']=_[_0x468f('0x30')](_0x19f3c9,_0x468f('0x29'));_0x4a76d4[_0x468f('0x31')]=_[_0x468f('0x32')](_0x1b0955[_0x468f('0x31')]);_0x4a76d4[_0x468f('0x33')]=_[_0x468f('0x34')](_0x4a76d4[_0x468f('0x35')],_0x4a76d4[_0x468f('0x31')]);_0xc67b28[_0x468f('0x36')]=_['intersection'](_0x4a76d4[_0x468f('0x35')],qs[_0x468f('0x37')](_0x1b0955[_0x468f('0x31')][_0x468f('0x37')]));_0xc67b28['attributes']=_0xc67b28[_0x468f('0x36')]['length']?_0xc67b28['attributes']:_0x4a76d4['model'];if(!_0x1b0955[_0x468f('0x31')][_0x468f('0x38')](_0x468f('0x39'))){_0xc67b28['limit']=qs[_0x468f('0x1f')](_0x1b0955[_0x468f('0x31')][_0x468f('0x1f')]);_0xc67b28['offset']=qs[_0x468f('0x1d')](_0x1b0955[_0x468f('0x31')]['offset']);}_0xc67b28[_0x468f('0x3a')]=qs['sort'](_0x1b0955[_0x468f('0x31')][_0x468f('0x3b')]);_0xc67b28[_0x468f('0x3c')]=qs['filters'](_[_0x468f('0x3d')](_0x1b0955[_0x468f('0x31')],_0x4a76d4[_0x468f('0x33')]),_0x19f3c9);if(_0x1b0955[_0x468f('0x31')]['filter']){_0xc67b28['where']=_['merge'](_0xc67b28['where'],{'$or':_[_0x468f('0x30')](_0x19f3c9,function(_0x43ba0d){if(_0x43ba0d[_0x468f('0x2e')]!==_0x468f('0x3e')){var _0x11787={};_0x11787[_0x43ba0d[_0x468f('0x29')]]={'$like':'%'+_0x1b0955['query']['filter']+'%'};return _0x11787;}})});}_0xc67b28=_[_0x468f('0x3f')]({},_0xc67b28,_0x1b0955[_0x468f('0x40')]);var _0x1e876b={'where':_0xc67b28[_0x468f('0x3c')]};return db[_0x468f('0x2c')][_0x468f('0x20')](_0x1e876b)['then'](function(_0x369b4c){_0x40260e[_0x468f('0x20')]=_0x369b4c;if(_0x1b0955[_0x468f('0x31')][_0x468f('0x41')]){_0xc67b28[_0x468f('0x42')]=[{'all':!![]}];}return db[_0x468f('0x2c')]['findAll'](_0xc67b28);})['then'](function(_0x1f6acb){_0x40260e[_0x468f('0x43')]=_0x1f6acb;return _0x40260e;})['then'](respondWithFilteredResult(_0x1d4213,_0xc67b28))[_0x468f('0x44')](handleError(_0x1d4213,null));};exports[_0x468f('0x45')]=function(_0x1ec15f,_0x34f10c){var _0x391fd9={'raw':!![],'where':{'id':_0x1ec15f[_0x468f('0x46')]['id']}},_0x5a3b24={};_0x5a3b24[_0x468f('0x35')]=_[_0x468f('0x32')](db[_0x468f('0x2c')][_0x468f('0x2d')]);_0x5a3b24['query']=_['keys'](_0x1ec15f[_0x468f('0x31')]);_0x5a3b24[_0x468f('0x33')]=_['intersection'](_0x5a3b24[_0x468f('0x35')],_0x5a3b24['query']);_0x391fd9[_0x468f('0x36')]=_['intersection'](_0x5a3b24['model'],qs[_0x468f('0x37')](_0x1ec15f[_0x468f('0x31')][_0x468f('0x37')]));_0x391fd9[_0x468f('0x36')]=_0x391fd9[_0x468f('0x36')][_0x468f('0x47')]?_0x391fd9[_0x468f('0x36')]:_0x5a3b24[_0x468f('0x35')];if(_0x1ec15f['query'][_0x468f('0x41')]){_0x391fd9['include']=[{'all':!![]}];}_0x391fd9=_['merge']({},_0x391fd9,_0x1ec15f['options']);return db[_0x468f('0x2c')]['find'](_0x391fd9)['then'](handleEntityNotFound(_0x34f10c,null))[_0x468f('0x25')](respondWithResult(_0x34f10c,null))['catch'](handleError(_0x34f10c,null));};exports[_0x468f('0x48')]=function(_0x5aa8d9,_0x14bcd8){return db[_0x468f('0x2c')]['create'](_0x5aa8d9[_0x468f('0x49')],{})[_0x468f('0x25')](respondWithResult(_0x14bcd8,0xc9))[_0x468f('0x44')](handleError(_0x14bcd8,null));};exports[_0x468f('0x24')]=function(_0x2922e2,_0x57f4c8){if(_0x2922e2['body']['id']){delete _0x2922e2[_0x468f('0x49')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x2922e2[_0x468f('0x46')]['id']}})[_0x468f('0x25')](handleEntityNotFound(_0x57f4c8,null))['then'](saveUpdates(_0x2922e2[_0x468f('0x49')],null))['then'](respondWithResult(_0x57f4c8,null))[_0x468f('0x44')](handleError(_0x57f4c8,null));};exports[_0x468f('0x26')]=function(_0x51e5a4,_0x3308e5){return db[_0x468f('0x2c')][_0x468f('0x4a')]({'where':{'id':_0x51e5a4[_0x468f('0x46')]['id']}})[_0x468f('0x25')](handleEntityNotFound(_0x3308e5,null))['then'](removeEntity(_0x3308e5,null))[_0x468f('0x44')](handleError(_0x3308e5,null));};exports[_0x468f('0x4b')]=function(_0x213a2e,_0x819669){return db['JscriptySessionReport'][_0x468f('0x4b')]()['then'](respondWithResult(_0x819669,null))[_0x468f('0x44')](handleError(_0x819669,null));};exports[_0x468f('0x4c')]=function(_0x1b45e9,_0x60e4ec,_0x394f6d){var _0x27b485={'raw':!![],'where':{}};var _0xa655c2={};var _0x53dc96={'count':0x0,'rows':[]};return db[_0x468f('0x2c')]['findOne']({'where':{'id':_0x1b45e9[_0x468f('0x46')]['id']}})[_0x468f('0x25')](handleEntityNotFound(_0x60e4ec,null))[_0x468f('0x25')](function(_0x1d08af){if(_0x1d08af){_0xa655c2[_0x468f('0x35')]=_[_0x468f('0x32')](db['JscriptyQuestionReport']['rawAttributes']);_0xa655c2[_0x468f('0x31')]=_[_0x468f('0x32')](_0x1b45e9['query']);_0xa655c2['filters']=_[_0x468f('0x34')](_0xa655c2[_0x468f('0x35')],_0xa655c2[_0x468f('0x31')]);_0x27b485[_0x468f('0x36')]=_[_0x468f('0x34')](_0xa655c2['model'],qs['fields'](_0x1b45e9['query'][_0x468f('0x37')]));_0x27b485[_0x468f('0x36')]=_0x27b485[_0x468f('0x36')][_0x468f('0x47')]?_0x27b485[_0x468f('0x36')]:_0xa655c2[_0x468f('0x35')];if(!_0x1b45e9[_0x468f('0x31')][_0x468f('0x38')]('nolimit')){_0x27b485[_0x468f('0x1f')]=qs[_0x468f('0x1f')](_0x1b45e9[_0x468f('0x31')]['limit']);_0x27b485[_0x468f('0x1d')]=qs['offset'](_0x1b45e9[_0x468f('0x31')][_0x468f('0x1d')]);}_0x27b485['order']=qs[_0x468f('0x3b')](_0x1b45e9[_0x468f('0x31')][_0x468f('0x3b')]);_0x27b485[_0x468f('0x3c')]=qs['filters'](_['pick'](_0x1b45e9['query'],_0xa655c2['filters']));_0x27b485['where']['SessionId']=_0x1d08af['id'];if(_0x1b45e9['query'][_0x468f('0x4d')]){_0x27b485[_0x468f('0x3c')]=_['merge'](_0x27b485[_0x468f('0x3c')],{'$or':_['map'](_0x27b485[_0x468f('0x36')],function(_0x31b370){var _0x311558={};_0x311558[_0x31b370]={'$like':'%'+_0x1b45e9[_0x468f('0x31')][_0x468f('0x4d')]+'%'};return _0x311558;})});}_0x27b485=_[_0x468f('0x3f')]({},_0x27b485,_0x1b45e9['options']);return db['JscriptyQuestionReport'][_0x468f('0x20')]({'where':_0x27b485['where']})[_0x468f('0x25')](function(_0x8bc37d){_0x53dc96[_0x468f('0x20')]=_0x8bc37d;if(_0x1b45e9[_0x468f('0x31')]['includeAll']){_0x27b485[_0x468f('0x42')]=[{'all':!![]}];}return db[_0x468f('0x4e')][_0x468f('0x4f')](_0x27b485);})[_0x468f('0x25')](function(_0x155890){_0x53dc96['rows']=_0x155890;return _0x53dc96;});}})[_0x468f('0x25')](respondWithFilteredResult(_0x60e4ec,_0x27b485))['catch'](handleError(_0x60e4ec,null));};
\ No newline at end of file
+var _0x8093=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','keys','rawAttributes','length','find','create','body','params','describe','findOne','JscriptyQuestionReport','hasOwnProperty','order','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel'];(function(_0x5d880c,_0xf031dc){var _0xec7eff=function(_0x2d9515){while(--_0x2d9515){_0x5d880c['push'](_0x5d880c['shift']());}};_0xec7eff(++_0xf031dc);}(_0x8093,0x8f));var _0x3809=function(_0x50e51a,_0x39e949){_0x50e51a=_0x50e51a-0x0;var _0xe02402=_0x8093[_0x50e51a];return _0xe02402;};'use strict';var emlformat=require(_0x3809('0x0'));var rimraf=require(_0x3809('0x1'));var zipdir=require(_0x3809('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3809('0x3'));var moment=require(_0x3809('0x4'));var BPromise=require(_0x3809('0x5'));var Mustache=require(_0x3809('0x6'));var util=require(_0x3809('0x7'));var path=require('path');var sox=require(_0x3809('0x8'));var csv=require(_0x3809('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3809('0xa'));var _=require(_0x3809('0xb'));var squel=require(_0x3809('0xc'));var crypto=require(_0x3809('0xd'));var jsforce=require(_0x3809('0xe'));var deskjs=require(_0x3809('0xf'));var toCsv=require(_0x3809('0x9'));var querystring=require(_0x3809('0x10'));var Papa=require(_0x3809('0x11'));var Redis=require(_0x3809('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3809('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3809('0x14'));var licenseUtil=require(_0x3809('0x15'));var db=require(_0x3809('0x16'))['db'];function respondWithStatusCode(_0x444960,_0x47dff6){_0x47dff6=_0x47dff6||0xcc;return function(_0x3c0ecf){if(_0x3c0ecf){return _0x444960['sendStatus'](_0x47dff6);}return _0x444960[_0x3809('0x17')](_0x47dff6)[_0x3809('0x18')]();};}function respondWithResult(_0xa0ebb7,_0x109d29){_0x109d29=_0x109d29||0xc8;return function(_0x53a653){if(_0x53a653){return _0xa0ebb7[_0x3809('0x17')](_0x109d29)['json'](_0x53a653);}};}function respondWithFilteredResult(_0x4c86be,_0x31d70f){return function(_0x7325b1){if(_0x7325b1){var _0x5ebb4a=typeof _0x31d70f[_0x3809('0x19')]===_0x3809('0x1a')&&typeof _0x31d70f[_0x3809('0x1b')]===_0x3809('0x1a');var _0x3b847b=_0x7325b1[_0x3809('0x1c')];var _0x19049c=_0x5ebb4a?0x0:_0x31d70f[_0x3809('0x19')];var _0x514cf2=_0x5ebb4a?_0x7325b1['count']:_0x31d70f['offset']+_0x31d70f['limit'];var _0x1c1316;if(_0x514cf2>=_0x3b847b){_0x514cf2=_0x3b847b;_0x1c1316=0xc8;}else{_0x1c1316=0xce;}_0x4c86be[_0x3809('0x17')](_0x1c1316);return _0x4c86be[_0x3809('0x1d')]('Content-Range',_0x19049c+'-'+_0x514cf2+'/'+_0x3b847b)[_0x3809('0x1e')](_0x7325b1);}return null;};}function patchUpdates(_0x462886){return function(_0x1600e9){try{jsonpatch[_0x3809('0x1f')](_0x1600e9,_0x462886,!![]);}catch(_0x58cf5f){return BPromise['reject'](_0x58cf5f);}return _0x1600e9[_0x3809('0x20')]();};}function saveUpdates(_0x33db6c,_0x1cf21f){return function(_0x2a08d7){if(_0x2a08d7){return _0x2a08d7[_0x3809('0x21')](_0x33db6c)[_0x3809('0x22')](function(_0xc43b47){return _0xc43b47;});}return null;};}function removeEntity(_0x2a114e,_0x25946b){return function(_0x108d27){if(_0x108d27){return _0x108d27[_0x3809('0x23')]()[_0x3809('0x22')](function(){_0x2a114e[_0x3809('0x17')](0xcc)[_0x3809('0x18')]();});}};}function handleEntityNotFound(_0x11bfa2,_0x412863){return function(_0x171b84){if(!_0x171b84){_0x11bfa2[_0x3809('0x24')](0x194);}return _0x171b84;};}function handleError(_0x22fa68,_0x6fd1d3){_0x6fd1d3=_0x6fd1d3||0x1f4;return function(_0x520482){logger[_0x3809('0x25')](_0x520482['stack']);if(_0x520482['name']){delete _0x520482[_0x3809('0x26')];}_0x22fa68[_0x3809('0x17')](_0x6fd1d3)[_0x3809('0x27')](_0x520482);};}exports[_0x3809('0x28')]=function(_0x5d7d4d,_0x3e610f){var _0x4472f5={},_0x5dcce1={},_0x5e096d={'count':0x0,'rows':[]};var _0x5f23f2=_[_0x3809('0x29')](db['JscriptySessionReport']['rawAttributes'],function(_0x4db108){return{'name':_0x4db108[_0x3809('0x2a')],'type':_0x4db108[_0x3809('0x2b')][_0x3809('0x2c')]};});_0x5dcce1[_0x3809('0x2d')]=_[_0x3809('0x29')](_0x5f23f2,_0x3809('0x26'));_0x5dcce1[_0x3809('0x2e')]=_['keys'](_0x5d7d4d[_0x3809('0x2e')]);_0x5dcce1[_0x3809('0x2f')]=_[_0x3809('0x30')](_0x5dcce1[_0x3809('0x2d')],_0x5dcce1['query']);_0x4472f5[_0x3809('0x31')]=_['intersection'](_0x5dcce1[_0x3809('0x2d')],qs[_0x3809('0x32')](_0x5d7d4d[_0x3809('0x2e')][_0x3809('0x32')]));_0x4472f5['attributes']=_0x4472f5[_0x3809('0x31')]['length']?_0x4472f5[_0x3809('0x31')]:_0x5dcce1[_0x3809('0x2d')];if(!_0x5d7d4d[_0x3809('0x2e')]['hasOwnProperty'](_0x3809('0x33'))){_0x4472f5[_0x3809('0x1b')]=qs[_0x3809('0x1b')](_0x5d7d4d[_0x3809('0x2e')]['limit']);_0x4472f5['offset']=qs[_0x3809('0x19')](_0x5d7d4d[_0x3809('0x2e')][_0x3809('0x19')]);}_0x4472f5['order']=qs[_0x3809('0x34')](_0x5d7d4d['query'][_0x3809('0x34')]);_0x4472f5[_0x3809('0x35')]=qs[_0x3809('0x2f')](_[_0x3809('0x36')](_0x5d7d4d['query'],_0x5dcce1[_0x3809('0x2f')]),_0x5f23f2);if(_0x5d7d4d[_0x3809('0x2e')]['filter']){_0x4472f5['where']=_[_0x3809('0x37')](_0x4472f5['where'],{'$or':_['map'](_0x5f23f2,function(_0x558491){if(_0x558491[_0x3809('0x2b')]!==_0x3809('0x38')){var _0x3b8cd7={};_0x3b8cd7[_0x558491[_0x3809('0x26')]]={'$like':'%'+_0x5d7d4d[_0x3809('0x2e')][_0x3809('0x39')]+'%'};return _0x3b8cd7;}})});}_0x4472f5=_[_0x3809('0x37')]({},_0x4472f5,_0x5d7d4d[_0x3809('0x3a')]);var _0x5894a0={'where':_0x4472f5[_0x3809('0x35')]};return db[_0x3809('0x3b')][_0x3809('0x1c')](_0x5894a0)[_0x3809('0x22')](function(_0x12cefd){_0x5e096d[_0x3809('0x1c')]=_0x12cefd;if(_0x5d7d4d['query'][_0x3809('0x3c')]){_0x4472f5[_0x3809('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3809('0x3e')](_0x4472f5);})[_0x3809('0x22')](function(_0x5649fa){_0x5e096d[_0x3809('0x3f')]=_0x5649fa;return _0x5e096d;})[_0x3809('0x22')](respondWithFilteredResult(_0x3e610f,_0x4472f5))[_0x3809('0x40')](handleError(_0x3e610f,null));};exports['show']=function(_0x4e3519,_0x5e8786){var _0x5068f8={'raw':!![],'where':{'id':_0x4e3519['params']['id']}},_0x158202={};_0x158202[_0x3809('0x2d')]=_[_0x3809('0x41')](db[_0x3809('0x3b')][_0x3809('0x42')]);_0x158202[_0x3809('0x2e')]=_[_0x3809('0x41')](_0x4e3519['query']);_0x158202[_0x3809('0x2f')]=_[_0x3809('0x30')](_0x158202['model'],_0x158202[_0x3809('0x2e')]);_0x5068f8[_0x3809('0x31')]=_[_0x3809('0x30')](_0x158202[_0x3809('0x2d')],qs[_0x3809('0x32')](_0x4e3519[_0x3809('0x2e')][_0x3809('0x32')]));_0x5068f8[_0x3809('0x31')]=_0x5068f8[_0x3809('0x31')][_0x3809('0x43')]?_0x5068f8[_0x3809('0x31')]:_0x158202[_0x3809('0x2d')];if(_0x4e3519[_0x3809('0x2e')]['includeAll']){_0x5068f8[_0x3809('0x3d')]=[{'all':!![]}];}_0x5068f8=_[_0x3809('0x37')]({},_0x5068f8,_0x4e3519[_0x3809('0x3a')]);return db['JscriptySessionReport'][_0x3809('0x44')](_0x5068f8)['then'](handleEntityNotFound(_0x5e8786,null))[_0x3809('0x22')](respondWithResult(_0x5e8786,null))[_0x3809('0x40')](handleError(_0x5e8786,null));};exports[_0x3809('0x45')]=function(_0x40bf70,_0x2341bf){return db[_0x3809('0x3b')][_0x3809('0x45')](_0x40bf70[_0x3809('0x46')],{})['then'](respondWithResult(_0x2341bf,0xc9))[_0x3809('0x40')](handleError(_0x2341bf,null));};exports[_0x3809('0x21')]=function(_0x33664c,_0xa10454){if(_0x33664c[_0x3809('0x46')]['id']){delete _0x33664c[_0x3809('0x46')]['id'];}return db[_0x3809('0x3b')][_0x3809('0x44')]({'where':{'id':_0x33664c['params']['id']}})[_0x3809('0x22')](handleEntityNotFound(_0xa10454,null))['then'](saveUpdates(_0x33664c[_0x3809('0x46')],null))[_0x3809('0x22')](respondWithResult(_0xa10454,null))[_0x3809('0x40')](handleError(_0xa10454,null));};exports[_0x3809('0x23')]=function(_0x418b52,_0x259432){return db['JscriptySessionReport']['find']({'where':{'id':_0x418b52[_0x3809('0x47')]['id']}})[_0x3809('0x22')](handleEntityNotFound(_0x259432,null))[_0x3809('0x22')](removeEntity(_0x259432,null))['catch'](handleError(_0x259432,null));};exports['describe']=function(_0x4e7898,_0x32d067){return db[_0x3809('0x3b')][_0x3809('0x48')]()[_0x3809('0x22')](respondWithResult(_0x32d067,null))[_0x3809('0x40')](handleError(_0x32d067,null));};exports['getQuestions']=function(_0x211b17,_0x3cb2eb,_0x5f3a76){var _0x30a692={'raw':!![],'where':{}};var _0x33d4ce={};var _0x526001={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3809('0x49')]({'where':{'id':_0x211b17['params']['id']}})[_0x3809('0x22')](handleEntityNotFound(_0x3cb2eb,null))[_0x3809('0x22')](function(_0x178d7a){if(_0x178d7a){_0x33d4ce[_0x3809('0x2d')]=_['keys'](db[_0x3809('0x4a')]['rawAttributes']);_0x33d4ce['query']=_[_0x3809('0x41')](_0x211b17[_0x3809('0x2e')]);_0x33d4ce[_0x3809('0x2f')]=_['intersection'](_0x33d4ce[_0x3809('0x2d')],_0x33d4ce[_0x3809('0x2e')]);_0x30a692[_0x3809('0x31')]=_['intersection'](_0x33d4ce[_0x3809('0x2d')],qs[_0x3809('0x32')](_0x211b17[_0x3809('0x2e')][_0x3809('0x32')]));_0x30a692[_0x3809('0x31')]=_0x30a692[_0x3809('0x31')][_0x3809('0x43')]?_0x30a692[_0x3809('0x31')]:_0x33d4ce[_0x3809('0x2d')];if(!_0x211b17[_0x3809('0x2e')][_0x3809('0x4b')]('nolimit')){_0x30a692[_0x3809('0x1b')]=qs[_0x3809('0x1b')](_0x211b17['query'][_0x3809('0x1b')]);_0x30a692[_0x3809('0x19')]=qs[_0x3809('0x19')](_0x211b17[_0x3809('0x2e')][_0x3809('0x19')]);}_0x30a692[_0x3809('0x4c')]=qs[_0x3809('0x34')](_0x211b17[_0x3809('0x2e')][_0x3809('0x34')]);_0x30a692[_0x3809('0x35')]=qs['filters'](_[_0x3809('0x36')](_0x211b17[_0x3809('0x2e')],_0x33d4ce['filters']));_0x30a692['where'][_0x3809('0x4d')]=_0x178d7a['id'];if(_0x211b17[_0x3809('0x2e')][_0x3809('0x39')]){_0x30a692['where']=_[_0x3809('0x37')](_0x30a692['where'],{'$or':_[_0x3809('0x29')](_0x30a692[_0x3809('0x31')],function(_0x2f9b54){var _0x46266f={};_0x46266f[_0x2f9b54]={'$like':'%'+_0x211b17[_0x3809('0x2e')]['filter']+'%'};return _0x46266f;})});}_0x30a692=_[_0x3809('0x37')]({},_0x30a692,_0x211b17[_0x3809('0x3a')]);return db[_0x3809('0x4a')]['count']({'where':_0x30a692[_0x3809('0x35')]})[_0x3809('0x22')](function(_0x5b39e9){_0x526001[_0x3809('0x1c')]=_0x5b39e9;if(_0x211b17[_0x3809('0x2e')]['includeAll']){_0x30a692[_0x3809('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3809('0x3e')](_0x30a692);})[_0x3809('0x22')](function(_0x13bfff){_0x526001['rows']=_0x13bfff;return _0x526001;});}})[_0x3809('0x22')](respondWithFilteredResult(_0x3cb2eb,_0x30a692))[_0x3809('0x40')](handleError(_0x3cb2eb,null));};
\ No newline at end of file