Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 8b29d6b..5787a51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc6c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','sendStatus','error','stack','name','send','map','JscriptySessionReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','find','create','body','destroy','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','SessionId','include','rimraf','fast-json-patch','request-promise'];(function(_0x3bc2c6,_0x984b45){var _0x4c4b8d=function(_0x1e00e9){while(--_0x1e00e9){_0x3bc2c6['push'](_0x3bc2c6['shift']());}};_0x4c4b8d(++_0x984b45);}(_0xfc6c,0xea));var _0xcfc6=function(_0x1678bd,_0x356447){_0x1678bd=_0x1678bd-0x0;var _0x52200c=_0xfc6c[_0x1678bd];return _0x52200c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfc6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfc6('0x1'));var rp=require(_0xcfc6('0x2'));var moment=require(_0xcfc6('0x3'));var BPromise=require(_0xcfc6('0x4'));var Mustache=require(_0xcfc6('0x5'));var util=require(_0xcfc6('0x6'));var path=require(_0xcfc6('0x7'));var sox=require(_0xcfc6('0x8'));var csv=require(_0xcfc6('0x9'));var ejs=require(_0xcfc6('0xa'));var fs=require('fs');var fs_extra=require(_0xcfc6('0xb'));var _=require(_0xcfc6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcfc6('0xd'));var deskjs=require(_0xcfc6('0xe'));var toCsv=require(_0xcfc6('0x9'));var querystring=require(_0xcfc6('0xf'));var Papa=require(_0xcfc6('0x10'));var Redis=require(_0xcfc6('0x11'));var authService=require(_0xcfc6('0x12'));var qs=require(_0xcfc6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfc6('0x14'));var logger=require(_0xcfc6('0x15'))('api');var utils=require(_0xcfc6('0x16'));var config=require(_0xcfc6('0x17'));var licenseUtil=require(_0xcfc6('0x18'));var db=require(_0xcfc6('0x19'))['db'];function respondWithStatusCode(_0x243d6f,_0x202477){_0x202477=_0x202477||0xcc;return function(_0x5cba6b){if(_0x5cba6b){return _0x243d6f['sendStatus'](_0x202477);}return _0x243d6f[_0xcfc6('0x1a')](_0x202477)[_0xcfc6('0x1b')]();};}function respondWithResult(_0xf307c,_0x68891d){_0x68891d=_0x68891d||0xc8;return function(_0x31773c){if(_0x31773c){return _0xf307c['status'](_0x68891d)[_0xcfc6('0x1c')](_0x31773c);}};}function respondWithFilteredResult(_0x346a33,_0x438102){return function(_0x1e67cf){if(_0x1e67cf){var _0x5768dd=typeof _0x438102[_0xcfc6('0x1d')]===_0xcfc6('0x1e')&&typeof _0x438102[_0xcfc6('0x1f')]===_0xcfc6('0x1e');var _0x227ccc=_0x1e67cf['count'];var _0x5abae5=_0x5768dd?0x0:_0x438102[_0xcfc6('0x1d')];var _0x5e4554=_0x5768dd?_0x1e67cf[_0xcfc6('0x20')]:_0x438102[_0xcfc6('0x1d')]+_0x438102[_0xcfc6('0x1f')];var _0x36cdf9;if(_0x5e4554>=_0x227ccc){_0x5e4554=_0x227ccc;_0x36cdf9=0xc8;}else{_0x36cdf9=0xce;}_0x346a33[_0xcfc6('0x1a')](_0x36cdf9);return _0x346a33['set'](_0xcfc6('0x21'),_0x5abae5+'-'+_0x5e4554+'/'+_0x227ccc)[_0xcfc6('0x1c')](_0x1e67cf);}return null;};}function patchUpdates(_0x39f93a){return function(_0x4f3867){try{jsonpatch['apply'](_0x4f3867,_0x39f93a,!![]);}catch(_0x460e72){return BPromise['reject'](_0x460e72);}return _0x4f3867[_0xcfc6('0x22')]();};}function saveUpdates(_0x79738f,_0x558029){return function(_0x242bbc){if(_0x242bbc){return _0x242bbc[_0xcfc6('0x23')](_0x79738f)[_0xcfc6('0x24')](function(_0x4b1218){return _0x4b1218;});}return null;};}function removeEntity(_0x4cfea3,_0x43ee23){return function(_0x4eaf90){if(_0x4eaf90){return _0x4eaf90['destroy']()[_0xcfc6('0x24')](function(){_0x4cfea3[_0xcfc6('0x1a')](0xcc)[_0xcfc6('0x1b')]();});}};}function handleEntityNotFound(_0x293880,_0x2589c8){return function(_0x32ea1d){if(!_0x32ea1d){_0x293880[_0xcfc6('0x25')](0x194);}return _0x32ea1d;};}function handleError(_0x5df2d6,_0x2ecdf4){_0x2ecdf4=_0x2ecdf4||0x1f4;return function(_0x2e90d7){logger[_0xcfc6('0x26')](_0x2e90d7[_0xcfc6('0x27')]);if(_0x2e90d7[_0xcfc6('0x28')]){delete _0x2e90d7[_0xcfc6('0x28')];}_0x5df2d6[_0xcfc6('0x1a')](_0x2ecdf4)[_0xcfc6('0x29')](_0x2e90d7);};}exports['index']=function(_0x3be77c,_0x146ccc){var _0xc2cf2b={},_0x1b4209={},_0x28b223={'count':0x0,'rows':[]};var _0x30f202=_[_0xcfc6('0x2a')](db[_0xcfc6('0x2b')][_0xcfc6('0x2c')],function(_0x72d06f){return{'name':_0x72d06f['fieldName'],'type':_0x72d06f[_0xcfc6('0x2d')][_0xcfc6('0x2e')]};});_0x1b4209[_0xcfc6('0x2f')]=_[_0xcfc6('0x2a')](_0x30f202,_0xcfc6('0x28'));_0x1b4209[_0xcfc6('0x30')]=_['keys'](_0x3be77c[_0xcfc6('0x30')]);_0x1b4209[_0xcfc6('0x31')]=_['intersection'](_0x1b4209[_0xcfc6('0x2f')],_0x1b4209['query']);_0xc2cf2b['attributes']=_[_0xcfc6('0x32')](_0x1b4209['model'],qs[_0xcfc6('0x33')](_0x3be77c['query'][_0xcfc6('0x33')]));_0xc2cf2b[_0xcfc6('0x34')]=_0xc2cf2b[_0xcfc6('0x34')][_0xcfc6('0x35')]?_0xc2cf2b[_0xcfc6('0x34')]:_0x1b4209[_0xcfc6('0x2f')];if(!_0x3be77c[_0xcfc6('0x30')]['hasOwnProperty'](_0xcfc6('0x36'))){_0xc2cf2b[_0xcfc6('0x1f')]=qs[_0xcfc6('0x1f')](_0x3be77c[_0xcfc6('0x30')][_0xcfc6('0x1f')]);_0xc2cf2b[_0xcfc6('0x1d')]=qs[_0xcfc6('0x1d')](_0x3be77c[_0xcfc6('0x30')]['offset']);}_0xc2cf2b[_0xcfc6('0x37')]=qs[_0xcfc6('0x38')](_0x3be77c[_0xcfc6('0x30')][_0xcfc6('0x38')]);_0xc2cf2b['where']=qs[_0xcfc6('0x31')](_[_0xcfc6('0x39')](_0x3be77c[_0xcfc6('0x30')],_0x1b4209[_0xcfc6('0x31')]),_0x30f202);if(_0x3be77c[_0xcfc6('0x30')][_0xcfc6('0x3a')]){_0xc2cf2b[_0xcfc6('0x3b')]=_[_0xcfc6('0x3c')](_0xc2cf2b['where'],{'$or':_[_0xcfc6('0x2a')](_0x30f202,function(_0x17be60){if(_0x17be60[_0xcfc6('0x2d')]!==_0xcfc6('0x3d')){var _0x123043={};_0x123043[_0x17be60['name']]={'$like':'%'+_0x3be77c[_0xcfc6('0x30')][_0xcfc6('0x3a')]+'%'};return _0x123043;}})});}_0xc2cf2b=_[_0xcfc6('0x3c')]({},_0xc2cf2b,_0x3be77c[_0xcfc6('0x3e')]);var _0x40d6d5={'where':_0xc2cf2b['where']};return db[_0xcfc6('0x2b')][_0xcfc6('0x20')](_0x40d6d5)[_0xcfc6('0x24')](function(_0x3872e8){_0x28b223[_0xcfc6('0x20')]=_0x3872e8;if(_0x3be77c[_0xcfc6('0x30')][_0xcfc6('0x3f')]){_0xc2cf2b['include']=[{'all':!![]}];}return db[_0xcfc6('0x2b')][_0xcfc6('0x40')](_0xc2cf2b);})[_0xcfc6('0x24')](function(_0x59463c){_0x28b223[_0xcfc6('0x41')]=_0x59463c;return _0x28b223;})[_0xcfc6('0x24')](respondWithFilteredResult(_0x146ccc,_0xc2cf2b))[_0xcfc6('0x42')](handleError(_0x146ccc,null));};exports['show']=function(_0xb00247,_0x45bfe6){var _0x18b817={'raw':!![],'where':{'id':_0xb00247[_0xcfc6('0x43')]['id']}},_0x3f6d61={};_0x3f6d61[_0xcfc6('0x2f')]=_[_0xcfc6('0x44')](db[_0xcfc6('0x2b')][_0xcfc6('0x2c')]);_0x3f6d61[_0xcfc6('0x30')]=_[_0xcfc6('0x44')](_0xb00247[_0xcfc6('0x30')]);_0x3f6d61['filters']=_[_0xcfc6('0x32')](_0x3f6d61['model'],_0x3f6d61[_0xcfc6('0x30')]);_0x18b817[_0xcfc6('0x34')]=_[_0xcfc6('0x32')](_0x3f6d61[_0xcfc6('0x2f')],qs[_0xcfc6('0x33')](_0xb00247[_0xcfc6('0x30')][_0xcfc6('0x33')]));_0x18b817[_0xcfc6('0x34')]=_0x18b817[_0xcfc6('0x34')]['length']?_0x18b817[_0xcfc6('0x34')]:_0x3f6d61[_0xcfc6('0x2f')];if(_0xb00247[_0xcfc6('0x30')][_0xcfc6('0x3f')]){_0x18b817['include']=[{'all':!![]}];}_0x18b817=_[_0xcfc6('0x3c')]({},_0x18b817,_0xb00247[_0xcfc6('0x3e')]);return db[_0xcfc6('0x2b')][_0xcfc6('0x45')](_0x18b817)[_0xcfc6('0x24')](handleEntityNotFound(_0x45bfe6,null))['then'](respondWithResult(_0x45bfe6,null))[_0xcfc6('0x42')](handleError(_0x45bfe6,null));};exports[_0xcfc6('0x46')]=function(_0x379a3e,_0x3e42b3){return db[_0xcfc6('0x2b')]['create'](_0x379a3e[_0xcfc6('0x47')],{})['then'](respondWithResult(_0x3e42b3,0xc9))[_0xcfc6('0x42')](handleError(_0x3e42b3,null));};exports['update']=function(_0x2a6e05,_0x274b20){if(_0x2a6e05['body']['id']){delete _0x2a6e05[_0xcfc6('0x47')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x2a6e05['params']['id']}})[_0xcfc6('0x24')](handleEntityNotFound(_0x274b20,null))['then'](saveUpdates(_0x2a6e05[_0xcfc6('0x47')],null))[_0xcfc6('0x24')](respondWithResult(_0x274b20,null))[_0xcfc6('0x42')](handleError(_0x274b20,null));};exports[_0xcfc6('0x48')]=function(_0x2dd4f8,_0x67ec56){return db[_0xcfc6('0x2b')][_0xcfc6('0x45')]({'where':{'id':_0x2dd4f8[_0xcfc6('0x43')]['id']}})[_0xcfc6('0x24')](handleEntityNotFound(_0x67ec56,null))['then'](removeEntity(_0x67ec56,null))[_0xcfc6('0x42')](handleError(_0x67ec56,null));};exports[_0xcfc6('0x49')]=function(_0x3fceea,_0x532e49){return db[_0xcfc6('0x2b')][_0xcfc6('0x49')]()[_0xcfc6('0x24')](respondWithResult(_0x532e49,null))[_0xcfc6('0x42')](handleError(_0x532e49,null));};exports[_0xcfc6('0x4a')]=function(_0x11963f,_0x3ab339,_0x4571f7){var _0x566c4a={'raw':!![],'where':{}};var _0x4d5b04={};var _0x266b50={'count':0x0,'rows':[]};return db[_0xcfc6('0x2b')]['findOne']({'where':{'id':_0x11963f['params']['id']}})[_0xcfc6('0x24')](handleEntityNotFound(_0x3ab339,null))[_0xcfc6('0x24')](function(_0xbaa4a0){if(_0xbaa4a0){_0x4d5b04[_0xcfc6('0x2f')]=_[_0xcfc6('0x44')](db[_0xcfc6('0x4b')][_0xcfc6('0x2c')]);_0x4d5b04[_0xcfc6('0x30')]=_[_0xcfc6('0x44')](_0x11963f[_0xcfc6('0x30')]);_0x4d5b04[_0xcfc6('0x31')]=_[_0xcfc6('0x32')](_0x4d5b04[_0xcfc6('0x2f')],_0x4d5b04[_0xcfc6('0x30')]);_0x566c4a['attributes']=_[_0xcfc6('0x32')](_0x4d5b04['model'],qs[_0xcfc6('0x33')](_0x11963f[_0xcfc6('0x30')]['fields']));_0x566c4a[_0xcfc6('0x34')]=_0x566c4a[_0xcfc6('0x34')][_0xcfc6('0x35')]?_0x566c4a[_0xcfc6('0x34')]:_0x4d5b04[_0xcfc6('0x2f')];if(!_0x11963f[_0xcfc6('0x30')][_0xcfc6('0x4c')](_0xcfc6('0x36'))){_0x566c4a[_0xcfc6('0x1f')]=qs[_0xcfc6('0x1f')](_0x11963f[_0xcfc6('0x30')]['limit']);_0x566c4a[_0xcfc6('0x1d')]=qs['offset'](_0x11963f['query'][_0xcfc6('0x1d')]);}_0x566c4a[_0xcfc6('0x37')]=qs['sort'](_0x11963f[_0xcfc6('0x30')][_0xcfc6('0x38')]);_0x566c4a[_0xcfc6('0x3b')]=qs[_0xcfc6('0x31')](_['pick'](_0x11963f['query'],_0x4d5b04['filters']));_0x566c4a[_0xcfc6('0x3b')][_0xcfc6('0x4d')]=_0xbaa4a0['id'];if(_0x11963f[_0xcfc6('0x30')][_0xcfc6('0x3a')]){_0x566c4a['where']=_[_0xcfc6('0x3c')](_0x566c4a[_0xcfc6('0x3b')],{'$or':_['map'](_0x566c4a[_0xcfc6('0x34')],function(_0x28660c){var _0x389e8a={};_0x389e8a[_0x28660c]={'$like':'%'+_0x11963f[_0xcfc6('0x30')]['filter']+'%'};return _0x389e8a;})});}_0x566c4a=_[_0xcfc6('0x3c')]({},_0x566c4a,_0x11963f['options']);return db[_0xcfc6('0x4b')][_0xcfc6('0x20')]({'where':_0x566c4a[_0xcfc6('0x3b')]})[_0xcfc6('0x24')](function(_0x5eb5d5){_0x266b50[_0xcfc6('0x20')]=_0x5eb5d5;if(_0x11963f['query']['includeAll']){_0x566c4a[_0xcfc6('0x4e')]=[{'all':!![]}];}return db[_0xcfc6('0x4b')]['findAll'](_0x566c4a);})['then'](function(_0x4fefdd){_0x266b50['rows']=_0x4fefdd;return _0x266b50;});}})[_0xcfc6('0x24')](respondWithFilteredResult(_0x3ab339,_0x566c4a))['catch'](handleError(_0x3ab339,null));};
\ No newline at end of file
+var _0x85de=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','show','create','body','find','params','findOne','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x5a3e50,_0x5c9170){var _0x1a713c=function(_0x51b118){while(--_0x51b118){_0x5a3e50['push'](_0x5a3e50['shift']());}};_0x1a713c(++_0x5c9170);}(_0x85de,0xee));var _0xe85d=function(_0xcd88b0,_0x409ce7){_0xcd88b0=_0xcd88b0-0x0;var _0x22cce5=_0x85de[_0xcd88b0];return _0x22cce5;};'use strict';var emlformat=require(_0xe85d('0x0'));var rimraf=require(_0xe85d('0x1'));var zipdir=require(_0xe85d('0x2'));var jsonpatch=require(_0xe85d('0x3'));var rp=require(_0xe85d('0x4'));var moment=require('moment');var BPromise=require(_0xe85d('0x5'));var Mustache=require(_0xe85d('0x6'));var util=require(_0xe85d('0x7'));var path=require(_0xe85d('0x8'));var sox=require(_0xe85d('0x9'));var csv=require(_0xe85d('0xa'));var ejs=require(_0xe85d('0xb'));var fs=require('fs');var fs_extra=require(_0xe85d('0xc'));var _=require('lodash');var squel=require(_0xe85d('0xd'));var crypto=require(_0xe85d('0xe'));var jsforce=require(_0xe85d('0xf'));var deskjs=require(_0xe85d('0x10'));var toCsv=require(_0xe85d('0xa'));var querystring=require(_0xe85d('0x11'));var Papa=require(_0xe85d('0x12'));var Redis=require(_0xe85d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe85d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe85d('0x15'))(_0xe85d('0x16'));var utils=require(_0xe85d('0x17'));var config=require(_0xe85d('0x18'));var licenseUtil=require(_0xe85d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x349f7a,_0xd10bf8){_0xd10bf8=_0xd10bf8||0xcc;return function(_0x53c2e9){if(_0x53c2e9){return _0x349f7a[_0xe85d('0x1a')](_0xd10bf8);}return _0x349f7a[_0xe85d('0x1b')](_0xd10bf8)[_0xe85d('0x1c')]();};}function respondWithResult(_0x3fca0e,_0x5432c0){_0x5432c0=_0x5432c0||0xc8;return function(_0x59c771){if(_0x59c771){return _0x3fca0e[_0xe85d('0x1b')](_0x5432c0)[_0xe85d('0x1d')](_0x59c771);}};}function respondWithFilteredResult(_0x4e1837,_0x3f87bc){return function(_0x21fda3){if(_0x21fda3){var _0x5a6947=typeof _0x3f87bc['offset']===_0xe85d('0x1e')&&typeof _0x3f87bc['limit']===_0xe85d('0x1e');var _0x80b5c4=_0x21fda3[_0xe85d('0x1f')];var _0x45f1cb=_0x5a6947?0x0:_0x3f87bc['offset'];var _0x4e7846=_0x5a6947?_0x21fda3[_0xe85d('0x1f')]:_0x3f87bc[_0xe85d('0x20')]+_0x3f87bc[_0xe85d('0x21')];var _0x27ac0c;if(_0x4e7846>=_0x80b5c4){_0x4e7846=_0x80b5c4;_0x27ac0c=0xc8;}else{_0x27ac0c=0xce;}_0x4e1837[_0xe85d('0x1b')](_0x27ac0c);return _0x4e1837[_0xe85d('0x22')](_0xe85d('0x23'),_0x45f1cb+'-'+_0x4e7846+'/'+_0x80b5c4)[_0xe85d('0x1d')](_0x21fda3);}return null;};}function patchUpdates(_0x7a6730){return function(_0x208410){try{jsonpatch[_0xe85d('0x24')](_0x208410,_0x7a6730,!![]);}catch(_0x31fee2){return BPromise[_0xe85d('0x25')](_0x31fee2);}return _0x208410['save']();};}function saveUpdates(_0x4cda2e,_0x242d7e){return function(_0x990c3){if(_0x990c3){return _0x990c3[_0xe85d('0x26')](_0x4cda2e)['then'](function(_0x6ad60c){return _0x6ad60c;});}return null;};}function removeEntity(_0x43d4f7,_0x560113){return function(_0x5b4ea1){if(_0x5b4ea1){return _0x5b4ea1[_0xe85d('0x27')]()[_0xe85d('0x28')](function(){_0x43d4f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1b80,_0x2cba13){return function(_0x1405b5){if(!_0x1405b5){_0x3d1b80[_0xe85d('0x1a')](0x194);}return _0x1405b5;};}function handleError(_0x296ea9,_0x752fb6){_0x752fb6=_0x752fb6||0x1f4;return function(_0x48d312){logger[_0xe85d('0x29')](_0x48d312[_0xe85d('0x2a')]);if(_0x48d312[_0xe85d('0x2b')]){delete _0x48d312[_0xe85d('0x2b')];}_0x296ea9[_0xe85d('0x1b')](_0x752fb6)[_0xe85d('0x2c')](_0x48d312);};}exports[_0xe85d('0x2d')]=function(_0x54f7e0,_0xec9f9b){var _0x32da04={},_0x33cbae={},_0x28cca8={'count':0x0,'rows':[]};var _0x51edaa=_[_0xe85d('0x2e')](db['JscriptySessionReport'][_0xe85d('0x2f')],function(_0x21acd2){return{'name':_0x21acd2[_0xe85d('0x30')],'type':_0x21acd2[_0xe85d('0x31')][_0xe85d('0x32')]};});_0x33cbae[_0xe85d('0x33')]=_[_0xe85d('0x2e')](_0x51edaa,'name');_0x33cbae[_0xe85d('0x34')]=_[_0xe85d('0x35')](_0x54f7e0['query']);_0x33cbae['filters']=_[_0xe85d('0x36')](_0x33cbae[_0xe85d('0x33')],_0x33cbae[_0xe85d('0x34')]);_0x32da04[_0xe85d('0x37')]=_[_0xe85d('0x36')](_0x33cbae[_0xe85d('0x33')],qs[_0xe85d('0x38')](_0x54f7e0[_0xe85d('0x34')]['fields']));_0x32da04['attributes']=_0x32da04[_0xe85d('0x37')][_0xe85d('0x39')]?_0x32da04[_0xe85d('0x37')]:_0x33cbae[_0xe85d('0x33')];if(!_0x54f7e0[_0xe85d('0x34')]['hasOwnProperty'](_0xe85d('0x3a'))){_0x32da04[_0xe85d('0x21')]=qs[_0xe85d('0x21')](_0x54f7e0[_0xe85d('0x34')][_0xe85d('0x21')]);_0x32da04[_0xe85d('0x20')]=qs[_0xe85d('0x20')](_0x54f7e0[_0xe85d('0x34')]['offset']);}_0x32da04[_0xe85d('0x3b')]=qs[_0xe85d('0x3c')](_0x54f7e0[_0xe85d('0x34')][_0xe85d('0x3c')]);_0x32da04['where']=qs[_0xe85d('0x3d')](_[_0xe85d('0x3e')](_0x54f7e0[_0xe85d('0x34')],_0x33cbae[_0xe85d('0x3d')]),_0x51edaa);if(_0x54f7e0[_0xe85d('0x34')][_0xe85d('0x3f')]){_0x32da04[_0xe85d('0x40')]=_[_0xe85d('0x41')](_0x32da04[_0xe85d('0x40')],{'$or':_[_0xe85d('0x2e')](_0x51edaa,function(_0x2ed2b5){if(_0x2ed2b5[_0xe85d('0x31')]!==_0xe85d('0x42')){var _0x172327={};_0x172327[_0x2ed2b5[_0xe85d('0x2b')]]={'$like':'%'+_0x54f7e0[_0xe85d('0x34')][_0xe85d('0x3f')]+'%'};return _0x172327;}})});}_0x32da04=_[_0xe85d('0x41')]({},_0x32da04,_0x54f7e0[_0xe85d('0x43')]);var _0xb2e41e={'where':_0x32da04[_0xe85d('0x40')]};return db[_0xe85d('0x44')][_0xe85d('0x1f')](_0xb2e41e)['then'](function(_0x3bc878){_0x28cca8[_0xe85d('0x1f')]=_0x3bc878;if(_0x54f7e0[_0xe85d('0x34')][_0xe85d('0x45')]){_0x32da04[_0xe85d('0x46')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe85d('0x47')](_0x32da04);})[_0xe85d('0x28')](function(_0x5cf8a3){_0x28cca8[_0xe85d('0x48')]=_0x5cf8a3;return _0x28cca8;})[_0xe85d('0x28')](respondWithFilteredResult(_0xec9f9b,_0x32da04))[_0xe85d('0x49')](handleError(_0xec9f9b,null));};exports[_0xe85d('0x4a')]=function(_0x4f215a,_0x10f37a){var _0xd0f038={'raw':!![],'where':{'id':_0x4f215a['params']['id']}},_0x2f5eca={};_0x2f5eca[_0xe85d('0x33')]=_[_0xe85d('0x35')](db[_0xe85d('0x44')][_0xe85d('0x2f')]);_0x2f5eca['query']=_[_0xe85d('0x35')](_0x4f215a[_0xe85d('0x34')]);_0x2f5eca[_0xe85d('0x3d')]=_['intersection'](_0x2f5eca[_0xe85d('0x33')],_0x2f5eca['query']);_0xd0f038[_0xe85d('0x37')]=_[_0xe85d('0x36')](_0x2f5eca[_0xe85d('0x33')],qs[_0xe85d('0x38')](_0x4f215a[_0xe85d('0x34')][_0xe85d('0x38')]));_0xd0f038[_0xe85d('0x37')]=_0xd0f038[_0xe85d('0x37')]['length']?_0xd0f038[_0xe85d('0x37')]:_0x2f5eca[_0xe85d('0x33')];if(_0x4f215a[_0xe85d('0x34')]['includeAll']){_0xd0f038[_0xe85d('0x46')]=[{'all':!![]}];}_0xd0f038=_['merge']({},_0xd0f038,_0x4f215a[_0xe85d('0x43')]);return db[_0xe85d('0x44')]['find'](_0xd0f038)['then'](handleEntityNotFound(_0x10f37a,null))[_0xe85d('0x28')](respondWithResult(_0x10f37a,null))[_0xe85d('0x49')](handleError(_0x10f37a,null));};exports['create']=function(_0x4ea172,_0x38f857){return db[_0xe85d('0x44')][_0xe85d('0x4b')](_0x4ea172['body'],{})[_0xe85d('0x28')](respondWithResult(_0x38f857,0xc9))[_0xe85d('0x49')](handleError(_0x38f857,null));};exports[_0xe85d('0x26')]=function(_0x122a1e,_0xfd6b14){if(_0x122a1e['body']['id']){delete _0x122a1e[_0xe85d('0x4c')]['id'];}return db[_0xe85d('0x44')][_0xe85d('0x4d')]({'where':{'id':_0x122a1e[_0xe85d('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfd6b14,null))['then'](saveUpdates(_0x122a1e[_0xe85d('0x4c')],null))[_0xe85d('0x28')](respondWithResult(_0xfd6b14,null))[_0xe85d('0x49')](handleError(_0xfd6b14,null));};exports[_0xe85d('0x27')]=function(_0x426620,_0xf22da3){return db[_0xe85d('0x44')]['find']({'where':{'id':_0x426620[_0xe85d('0x4e')]['id']}})[_0xe85d('0x28')](handleEntityNotFound(_0xf22da3,null))['then'](removeEntity(_0xf22da3,null))[_0xe85d('0x49')](handleError(_0xf22da3,null));};exports['describe']=function(_0x1aa50f,_0x5f23e5){return db['JscriptySessionReport']['describe']()[_0xe85d('0x28')](respondWithResult(_0x5f23e5,null))[_0xe85d('0x49')](handleError(_0x5f23e5,null));};exports['getQuestions']=function(_0x12e684,_0x46d75b,_0x55e28c){var _0x1ad846={'raw':!![],'where':{}};var _0x2e56c4={};var _0x2d861a={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xe85d('0x4f')]({'where':{'id':_0x12e684[_0xe85d('0x4e')]['id']}})[_0xe85d('0x28')](handleEntityNotFound(_0x46d75b,null))['then'](function(_0x120afc){if(_0x120afc){_0x2e56c4['model']=_[_0xe85d('0x35')](db['JscriptyQuestionReport'][_0xe85d('0x2f')]);_0x2e56c4[_0xe85d('0x34')]=_['keys'](_0x12e684[_0xe85d('0x34')]);_0x2e56c4[_0xe85d('0x3d')]=_[_0xe85d('0x36')](_0x2e56c4[_0xe85d('0x33')],_0x2e56c4[_0xe85d('0x34')]);_0x1ad846['attributes']=_[_0xe85d('0x36')](_0x2e56c4[_0xe85d('0x33')],qs[_0xe85d('0x38')](_0x12e684[_0xe85d('0x34')][_0xe85d('0x38')]));_0x1ad846[_0xe85d('0x37')]=_0x1ad846['attributes'][_0xe85d('0x39')]?_0x1ad846[_0xe85d('0x37')]:_0x2e56c4[_0xe85d('0x33')];if(!_0x12e684[_0xe85d('0x34')]['hasOwnProperty'](_0xe85d('0x3a'))){_0x1ad846['limit']=qs[_0xe85d('0x21')](_0x12e684[_0xe85d('0x34')][_0xe85d('0x21')]);_0x1ad846[_0xe85d('0x20')]=qs[_0xe85d('0x20')](_0x12e684[_0xe85d('0x34')][_0xe85d('0x20')]);}_0x1ad846['order']=qs[_0xe85d('0x3c')](_0x12e684[_0xe85d('0x34')]['sort']);_0x1ad846['where']=qs[_0xe85d('0x3d')](_[_0xe85d('0x3e')](_0x12e684[_0xe85d('0x34')],_0x2e56c4[_0xe85d('0x3d')]));_0x1ad846[_0xe85d('0x40')][_0xe85d('0x50')]=_0x120afc['id'];if(_0x12e684[_0xe85d('0x34')][_0xe85d('0x3f')]){_0x1ad846['where']=_['merge'](_0x1ad846['where'],{'$or':_[_0xe85d('0x2e')](_0x1ad846['attributes'],function(_0x251e0d){var _0x109aba={};_0x109aba[_0x251e0d]={'$like':'%'+_0x12e684[_0xe85d('0x34')][_0xe85d('0x3f')]+'%'};return _0x109aba;})});}_0x1ad846=_[_0xe85d('0x41')]({},_0x1ad846,_0x12e684[_0xe85d('0x43')]);return db[_0xe85d('0x51')][_0xe85d('0x1f')]({'where':_0x1ad846[_0xe85d('0x40')]})[_0xe85d('0x28')](function(_0x46744a){_0x2d861a['count']=_0x46744a;if(_0x12e684['query'][_0xe85d('0x45')]){_0x1ad846[_0xe85d('0x46')]=[{'all':!![]}];}return db[_0xe85d('0x51')]['findAll'](_0x1ad846);})[_0xe85d('0x28')](function(_0x45276f){_0x2d861a[_0xe85d('0x48')]=_0x45276f;return _0x2d861a;});}})['then'](respondWithFilteredResult(_0x46d75b,_0x1ad846))['catch'](handleError(_0x46d75b,null));};
\ No newline at end of file