Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 5dfc96a..7351d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe427=['JscriptySessionReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','length','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options'];(function(_0x197c0c,_0x52a261){var _0x2f10b2=function(_0x269b4f){while(--_0x269b4f){_0x197c0c['push'](_0x197c0c['shift']());}};_0x2f10b2(++_0x52a261);}(_0xe427,0x1b0));var _0x7e42=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0xe427[_0x1eb82d];return _0x2c9502;};'use strict';var emlformat=require(_0x7e42('0x0'));var rimraf=require(_0x7e42('0x1'));var zipdir=require(_0x7e42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e42('0x3'));var moment=require(_0x7e42('0x4'));var BPromise=require(_0x7e42('0x5'));var Mustache=require(_0x7e42('0x6'));var util=require(_0x7e42('0x7'));var path=require(_0x7e42('0x8'));var sox=require(_0x7e42('0x9'));var csv=require(_0x7e42('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e42('0xb'));var _=require(_0x7e42('0xc'));var squel=require(_0x7e42('0xd'));var crypto=require('crypto');var jsforce=require(_0x7e42('0xe'));var deskjs=require(_0x7e42('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7e42('0x10'));var Papa=require(_0x7e42('0x11'));var Redis=require(_0x7e42('0x12'));var authService=require(_0x7e42('0x13'));var qs=require(_0x7e42('0x14'));var as=require(_0x7e42('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7e42('0x16'));var utils=require(_0x7e42('0x17'));var config=require(_0x7e42('0x18'));var licenseUtil=require(_0x7e42('0x19'));var db=require(_0x7e42('0x1a'))['db'];function respondWithStatusCode(_0x13721c,_0x2769d7){_0x2769d7=_0x2769d7||0xcc;return function(_0x532593){if(_0x532593){return _0x13721c['sendStatus'](_0x2769d7);}return _0x13721c[_0x7e42('0x1b')](_0x2769d7)['end']();};}function respondWithResult(_0x5987d1,_0x54c08f){_0x54c08f=_0x54c08f||0xc8;return function(_0x3cdc5d){if(_0x3cdc5d){return _0x5987d1['status'](_0x54c08f)[_0x7e42('0x1c')](_0x3cdc5d);}};}function respondWithFilteredResult(_0x539f20,_0x4287b0){return function(_0x168d9b){if(_0x168d9b){var _0x12bd3c=typeof _0x4287b0[_0x7e42('0x1d')]===_0x7e42('0x1e')&&typeof _0x4287b0[_0x7e42('0x1f')]===_0x7e42('0x1e');var _0x37c385=_0x168d9b[_0x7e42('0x20')];var _0x529207=_0x12bd3c?0x0:_0x4287b0[_0x7e42('0x1d')];var _0x233d1c=_0x12bd3c?_0x168d9b[_0x7e42('0x20')]:_0x4287b0[_0x7e42('0x1d')]+_0x4287b0[_0x7e42('0x1f')];var _0x58bcfb;if(_0x233d1c>=_0x37c385){_0x233d1c=_0x37c385;_0x58bcfb=0xc8;}else{_0x58bcfb=0xce;}_0x539f20[_0x7e42('0x1b')](_0x58bcfb);return _0x539f20[_0x7e42('0x21')](_0x7e42('0x22'),_0x529207+'-'+_0x233d1c+'/'+_0x37c385)['json'](_0x168d9b);}return null;};}function patchUpdates(_0x2d6c9d){return function(_0x45bb9f){try{jsonpatch[_0x7e42('0x23')](_0x45bb9f,_0x2d6c9d,!![]);}catch(_0x140620){return BPromise[_0x7e42('0x24')](_0x140620);}return _0x45bb9f[_0x7e42('0x25')]();};}function saveUpdates(_0x40d688,_0x1a70a1){return function(_0x5af027){if(_0x5af027){return _0x5af027[_0x7e42('0x26')](_0x40d688)[_0x7e42('0x27')](function(_0x2e2889){return _0x2e2889;});}return null;};}function removeEntity(_0x561760,_0x5c2d62){return function(_0x592fde){if(_0x592fde){return _0x592fde[_0x7e42('0x28')]()['then'](function(){_0x561760[_0x7e42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418f36,_0x46eb7f){return function(_0x4c8009){if(!_0x4c8009){_0x418f36[_0x7e42('0x29')](0x194);}return _0x4c8009;};}function handleError(_0xc186c4,_0x417de4){_0x417de4=_0x417de4||0x1f4;return function(_0x272e37){logger['error'](_0x272e37['stack']);if(_0x272e37[_0x7e42('0x2a')]){delete _0x272e37[_0x7e42('0x2a')];}_0xc186c4[_0x7e42('0x1b')](_0x417de4)[_0x7e42('0x2b')](_0x272e37);};}exports[_0x7e42('0x2c')]=function(_0x254748,_0x30e557){var _0x35482a={},_0x3eac5b={},_0x5320ed={'count':0x0,'rows':[]};var _0x4afc52=_[_0x7e42('0x2d')](db['JscriptySessionReport'][_0x7e42('0x2e')],function(_0x56623f){return{'name':_0x56623f[_0x7e42('0x2f')],'type':_0x56623f['type'][_0x7e42('0x30')]};});_0x3eac5b[_0x7e42('0x31')]=_[_0x7e42('0x2d')](_0x4afc52,_0x7e42('0x2a'));_0x3eac5b[_0x7e42('0x32')]=_[_0x7e42('0x33')](_0x254748['query']);_0x3eac5b[_0x7e42('0x34')]=_[_0x7e42('0x35')](_0x3eac5b[_0x7e42('0x31')],_0x3eac5b['query']);_0x35482a[_0x7e42('0x36')]=_[_0x7e42('0x35')](_0x3eac5b[_0x7e42('0x31')],qs[_0x7e42('0x37')](_0x254748['query'][_0x7e42('0x37')]));_0x35482a[_0x7e42('0x36')]=_0x35482a['attributes']['length']?_0x35482a[_0x7e42('0x36')]:_0x3eac5b[_0x7e42('0x31')];if(!_0x254748['query']['hasOwnProperty'](_0x7e42('0x38'))){_0x35482a[_0x7e42('0x1f')]=qs[_0x7e42('0x1f')](_0x254748[_0x7e42('0x32')][_0x7e42('0x1f')]);_0x35482a[_0x7e42('0x1d')]=qs[_0x7e42('0x1d')](_0x254748['query'][_0x7e42('0x1d')]);}_0x35482a[_0x7e42('0x39')]=qs[_0x7e42('0x3a')](_0x254748[_0x7e42('0x32')][_0x7e42('0x3a')]);_0x35482a[_0x7e42('0x3b')]=qs[_0x7e42('0x34')](_[_0x7e42('0x3c')](_0x254748[_0x7e42('0x32')],_0x3eac5b['filters']),_0x4afc52);if(_0x254748['query']['filter']){_0x35482a[_0x7e42('0x3b')]=_['merge'](_0x35482a[_0x7e42('0x3b')],{'$or':_['map'](_0x4afc52,function(_0x247895){if(_0x247895[_0x7e42('0x3d')]!==_0x7e42('0x3e')){var _0x26f3bb={};_0x26f3bb[_0x247895['name']]={'$like':'%'+_0x254748[_0x7e42('0x32')][_0x7e42('0x3f')]+'%'};return _0x26f3bb;}})});}_0x35482a=_[_0x7e42('0x40')]({},_0x35482a,_0x254748[_0x7e42('0x41')]);var _0x91e027={'where':_0x35482a[_0x7e42('0x3b')]};return db[_0x7e42('0x42')][_0x7e42('0x20')](_0x91e027)[_0x7e42('0x27')](function(_0x39edc0){_0x5320ed[_0x7e42('0x20')]=_0x39edc0;if(_0x254748[_0x7e42('0x32')][_0x7e42('0x43')]){_0x35482a[_0x7e42('0x44')]=[{'all':!![]}];}return db[_0x7e42('0x42')][_0x7e42('0x45')](_0x35482a);})[_0x7e42('0x27')](function(_0x2f1f9a){_0x5320ed[_0x7e42('0x46')]=_0x2f1f9a;return _0x5320ed;})[_0x7e42('0x27')](respondWithFilteredResult(_0x30e557,_0x35482a))[_0x7e42('0x47')](handleError(_0x30e557,null));};exports[_0x7e42('0x48')]=function(_0xf0dc8e,_0x479e50){var _0x11956c={'raw':!![],'where':{'id':_0xf0dc8e[_0x7e42('0x49')]['id']}},_0x144f90={};_0x144f90[_0x7e42('0x31')]=_[_0x7e42('0x33')](db['JscriptySessionReport']['rawAttributes']);_0x144f90[_0x7e42('0x32')]=_['keys'](_0xf0dc8e['query']);_0x144f90[_0x7e42('0x34')]=_[_0x7e42('0x35')](_0x144f90[_0x7e42('0x31')],_0x144f90['query']);_0x11956c[_0x7e42('0x36')]=_[_0x7e42('0x35')](_0x144f90[_0x7e42('0x31')],qs[_0x7e42('0x37')](_0xf0dc8e[_0x7e42('0x32')][_0x7e42('0x37')]));_0x11956c[_0x7e42('0x36')]=_0x11956c[_0x7e42('0x36')]['length']?_0x11956c[_0x7e42('0x36')]:_0x144f90[_0x7e42('0x31')];if(_0xf0dc8e[_0x7e42('0x32')][_0x7e42('0x43')]){_0x11956c[_0x7e42('0x44')]=[{'all':!![]}];}_0x11956c=_[_0x7e42('0x40')]({},_0x11956c,_0xf0dc8e[_0x7e42('0x41')]);return db[_0x7e42('0x42')]['find'](_0x11956c)['then'](handleEntityNotFound(_0x479e50,null))[_0x7e42('0x27')](respondWithResult(_0x479e50,null))[_0x7e42('0x47')](handleError(_0x479e50,null));};exports[_0x7e42('0x4a')]=function(_0x4c44e5,_0x3ff4ab){return db['JscriptySessionReport'][_0x7e42('0x4a')](_0x4c44e5[_0x7e42('0x4b')],{})[_0x7e42('0x27')](respondWithResult(_0x3ff4ab,0xc9))[_0x7e42('0x47')](handleError(_0x3ff4ab,null));};exports[_0x7e42('0x26')]=function(_0x594c6a,_0x270851){if(_0x594c6a[_0x7e42('0x4b')]['id']){delete _0x594c6a[_0x7e42('0x4b')]['id'];}return db['JscriptySessionReport'][_0x7e42('0x4c')]({'where':{'id':_0x594c6a[_0x7e42('0x49')]['id']}})['then'](handleEntityNotFound(_0x270851,null))[_0x7e42('0x27')](saveUpdates(_0x594c6a['body'],null))['then'](respondWithResult(_0x270851,null))[_0x7e42('0x47')](handleError(_0x270851,null));};exports['destroy']=function(_0x516cb5,_0x536677){return db[_0x7e42('0x42')][_0x7e42('0x4c')]({'where':{'id':_0x516cb5[_0x7e42('0x49')]['id']}})[_0x7e42('0x27')](handleEntityNotFound(_0x536677,null))[_0x7e42('0x27')](removeEntity(_0x536677,null))[_0x7e42('0x47')](handleError(_0x536677,null));};exports[_0x7e42('0x4d')]=function(_0x56700f,_0x586520){return db['JscriptySessionReport'][_0x7e42('0x4d')]()[_0x7e42('0x27')](respondWithResult(_0x586520,null))['catch'](handleError(_0x586520,null));};exports[_0x7e42('0x4e')]=function(_0x5b76f0,_0x1085c3,_0x1270ad){var _0x3a68f9={'raw':!![],'where':{}};var _0x2bcd75={};var _0xcbfc28={'count':0x0,'rows':[]};return db[_0x7e42('0x42')][_0x7e42('0x4f')]({'where':{'id':_0x5b76f0[_0x7e42('0x49')]['id']}})[_0x7e42('0x27')](handleEntityNotFound(_0x1085c3,null))[_0x7e42('0x27')](function(_0x16380c){if(_0x16380c){_0x2bcd75[_0x7e42('0x31')]=_[_0x7e42('0x33')](db[_0x7e42('0x50')][_0x7e42('0x2e')]);_0x2bcd75[_0x7e42('0x32')]=_['keys'](_0x5b76f0['query']);_0x2bcd75[_0x7e42('0x34')]=_[_0x7e42('0x35')](_0x2bcd75[_0x7e42('0x31')],_0x2bcd75['query']);_0x3a68f9[_0x7e42('0x36')]=_[_0x7e42('0x35')](_0x2bcd75[_0x7e42('0x31')],qs[_0x7e42('0x37')](_0x5b76f0[_0x7e42('0x32')][_0x7e42('0x37')]));_0x3a68f9[_0x7e42('0x36')]=_0x3a68f9['attributes'][_0x7e42('0x51')]?_0x3a68f9[_0x7e42('0x36')]:_0x2bcd75[_0x7e42('0x31')];if(!_0x5b76f0['query'][_0x7e42('0x52')]('nolimit')){_0x3a68f9[_0x7e42('0x1f')]=qs[_0x7e42('0x1f')](_0x5b76f0[_0x7e42('0x32')]['limit']);_0x3a68f9[_0x7e42('0x1d')]=qs['offset'](_0x5b76f0[_0x7e42('0x32')][_0x7e42('0x1d')]);}_0x3a68f9['order']=qs[_0x7e42('0x3a')](_0x5b76f0[_0x7e42('0x32')][_0x7e42('0x3a')]);_0x3a68f9[_0x7e42('0x3b')]=qs[_0x7e42('0x34')](_[_0x7e42('0x3c')](_0x5b76f0[_0x7e42('0x32')],_0x2bcd75['filters']));_0x3a68f9[_0x7e42('0x3b')]['SessionId']=_0x16380c['id'];if(_0x5b76f0[_0x7e42('0x32')][_0x7e42('0x3f')]){_0x3a68f9[_0x7e42('0x3b')]=_['merge'](_0x3a68f9[_0x7e42('0x3b')],{'$or':_['map'](_0x3a68f9[_0x7e42('0x36')],function(_0x5540b8){var _0xe2c4e2={};_0xe2c4e2[_0x5540b8]={'$like':'%'+_0x5b76f0[_0x7e42('0x32')]['filter']+'%'};return _0xe2c4e2;})});}_0x3a68f9=_['merge']({},_0x3a68f9,_0x5b76f0[_0x7e42('0x41')]);return db['JscriptyQuestionReport'][_0x7e42('0x20')]({'where':_0x3a68f9['where']})[_0x7e42('0x27')](function(_0x3221fb){_0xcbfc28['count']=_0x3221fb;if(_0x5b76f0[_0x7e42('0x32')][_0x7e42('0x43')]){_0x3a68f9[_0x7e42('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7e42('0x45')](_0x3a68f9);})[_0x7e42('0x27')](function(_0x31d6bf){_0xcbfc28[_0x7e42('0x46')]=_0x31d6bf;return _0xcbfc28;});}})[_0x7e42('0x27')](respondWithFilteredResult(_0x1085c3,_0x3a68f9))[_0x7e42('0x47')](handleError(_0x1085c3,null));};
\ No newline at end of file
+var _0x6952=['VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','fields','length','options','find','create','body','describe','findOne','nolimit','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','apply','save','update','then','destroy','error','stack','name','JscriptySessionReport','type','key','model','map','query','attributes','intersection','limit','order','sort','where','filters','pick','filter','merge'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x6952,0x13c));var _0x2695=function(_0x429d62,_0x5d7e69){_0x429d62=_0x429d62-0x0;var _0x46002f=_0x6952[_0x429d62];return _0x46002f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2695('0x0'));var zipdir=require(_0x2695('0x1'));var jsonpatch=require(_0x2695('0x2'));var rp=require(_0x2695('0x3'));var moment=require(_0x2695('0x4'));var BPromise=require(_0x2695('0x5'));var Mustache=require('mustache');var util=require(_0x2695('0x6'));var path=require(_0x2695('0x7'));var sox=require(_0x2695('0x8'));var csv=require(_0x2695('0x9'));var ejs=require(_0x2695('0xa'));var fs=require('fs');var fs_extra=require(_0x2695('0xb'));var _=require(_0x2695('0xc'));var squel=require('squel');var crypto=require(_0x2695('0xd'));var jsforce=require(_0x2695('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2695('0xf'));var Redis=require(_0x2695('0x10'));var authService=require(_0x2695('0x11'));var qs=require(_0x2695('0x12'));var as=require(_0x2695('0x13'));var hardwareService=require(_0x2695('0x14'));var logger=require('../../config/logger')(_0x2695('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2695('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aef63,_0x940827){_0x940827=_0x940827||0xcc;return function(_0x230e10){if(_0x230e10){return _0x4aef63[_0x2695('0x17')](_0x940827);}return _0x4aef63['status'](_0x940827)[_0x2695('0x18')]();};}function respondWithResult(_0x276e19,_0x1e9112){_0x1e9112=_0x1e9112||0xc8;return function(_0x3b3eb5){if(_0x3b3eb5){return _0x276e19[_0x2695('0x19')](_0x1e9112)[_0x2695('0x1a')](_0x3b3eb5);}};}function respondWithFilteredResult(_0x3e9257,_0x4e0482){return function(_0x48db31){if(_0x48db31){var _0xa9576=typeof _0x4e0482[_0x2695('0x1b')]==='undefined'&&typeof _0x4e0482['limit']===_0x2695('0x1c');var _0x723ce5=_0x48db31[_0x2695('0x1d')];var _0x5a0633=_0xa9576?0x0:_0x4e0482['offset'];var _0x639488=_0xa9576?_0x48db31['count']:_0x4e0482[_0x2695('0x1b')]+_0x4e0482['limit'];var _0x699a0f;if(_0x639488>=_0x723ce5){_0x639488=_0x723ce5;_0x699a0f=0xc8;}else{_0x699a0f=0xce;}_0x3e9257['status'](_0x699a0f);return _0x3e9257['set']('Content-Range',_0x5a0633+'-'+_0x639488+'/'+_0x723ce5)[_0x2695('0x1a')](_0x48db31);}return null;};}function patchUpdates(_0x5e8bb0){return function(_0x2aa062){try{jsonpatch[_0x2695('0x1e')](_0x2aa062,_0x5e8bb0,!![]);}catch(_0x3205c8){return BPromise['reject'](_0x3205c8);}return _0x2aa062[_0x2695('0x1f')]();};}function saveUpdates(_0x5c5826,_0x33885f){return function(_0x1aec26){if(_0x1aec26){return _0x1aec26[_0x2695('0x20')](_0x5c5826)[_0x2695('0x21')](function(_0x12338c){return _0x12338c;});}return null;};}function removeEntity(_0x6f7cc8,_0x358536){return function(_0x182465){if(_0x182465){return _0x182465[_0x2695('0x22')]()[_0x2695('0x21')](function(){_0x6f7cc8[_0x2695('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548ec9,_0x7ea421){return function(_0x55eeef){if(!_0x55eeef){_0x548ec9[_0x2695('0x17')](0x194);}return _0x55eeef;};}function handleError(_0x5921e6,_0x3972c3){_0x3972c3=_0x3972c3||0x1f4;return function(_0x16a897){logger[_0x2695('0x23')](_0x16a897[_0x2695('0x24')]);if(_0x16a897[_0x2695('0x25')]){delete _0x16a897['name'];}_0x5921e6['status'](_0x3972c3)['send'](_0x16a897);};}exports['index']=function(_0x5832e9,_0x5dbd3d){var _0x2b3f13={},_0x436a23={},_0x2081d2={'count':0x0,'rows':[]};var _0xf03fe3=_['map'](db[_0x2695('0x26')]['rawAttributes'],function(_0x2ea08d){return{'name':_0x2ea08d['fieldName'],'type':_0x2ea08d[_0x2695('0x27')][_0x2695('0x28')]};});_0x436a23[_0x2695('0x29')]=_[_0x2695('0x2a')](_0xf03fe3,_0x2695('0x25'));_0x436a23['query']=_['keys'](_0x5832e9['query']);_0x436a23['filters']=_['intersection'](_0x436a23[_0x2695('0x29')],_0x436a23[_0x2695('0x2b')]);_0x2b3f13[_0x2695('0x2c')]=_[_0x2695('0x2d')](_0x436a23['model'],qs['fields'](_0x5832e9[_0x2695('0x2b')]['fields']));_0x2b3f13[_0x2695('0x2c')]=_0x2b3f13[_0x2695('0x2c')]['length']?_0x2b3f13[_0x2695('0x2c')]:_0x436a23[_0x2695('0x29')];if(!_0x5832e9[_0x2695('0x2b')]['hasOwnProperty']('nolimit')){_0x2b3f13['limit']=qs['limit'](_0x5832e9[_0x2695('0x2b')][_0x2695('0x2e')]);_0x2b3f13[_0x2695('0x1b')]=qs[_0x2695('0x1b')](_0x5832e9[_0x2695('0x2b')]['offset']);}_0x2b3f13[_0x2695('0x2f')]=qs[_0x2695('0x30')](_0x5832e9['query']['sort']);_0x2b3f13[_0x2695('0x31')]=qs[_0x2695('0x32')](_[_0x2695('0x33')](_0x5832e9[_0x2695('0x2b')],_0x436a23['filters']),_0xf03fe3);if(_0x5832e9[_0x2695('0x2b')][_0x2695('0x34')]){_0x2b3f13[_0x2695('0x31')]=_[_0x2695('0x35')](_0x2b3f13[_0x2695('0x31')],{'$or':_[_0x2695('0x2a')](_0xf03fe3,function(_0x512dbd){if(_0x512dbd[_0x2695('0x27')]!==_0x2695('0x36')){var _0x3e5389={};_0x3e5389[_0x512dbd[_0x2695('0x25')]]={'$like':'%'+_0x5832e9[_0x2695('0x2b')]['filter']+'%'};return _0x3e5389;}})});}_0x2b3f13=_['merge']({},_0x2b3f13,_0x5832e9['options']);var _0x33c9ad={'where':_0x2b3f13[_0x2695('0x31')]};return db[_0x2695('0x26')][_0x2695('0x1d')](_0x33c9ad)[_0x2695('0x21')](function(_0x472689){_0x2081d2[_0x2695('0x1d')]=_0x472689;if(_0x5832e9['query'][_0x2695('0x37')]){_0x2b3f13[_0x2695('0x38')]=[{'all':!![]}];}return db[_0x2695('0x26')][_0x2695('0x39')](_0x2b3f13);})[_0x2695('0x21')](function(_0x243525){_0x2081d2[_0x2695('0x3a')]=_0x243525;return _0x2081d2;})[_0x2695('0x21')](respondWithFilteredResult(_0x5dbd3d,_0x2b3f13))[_0x2695('0x3b')](handleError(_0x5dbd3d,null));};exports[_0x2695('0x3c')]=function(_0x2487d8,_0xca5464){var _0x4feaf5={'raw':!![],'where':{'id':_0x2487d8[_0x2695('0x3d')]['id']}},_0x2ac89f={};_0x2ac89f[_0x2695('0x29')]=_['keys'](db['JscriptySessionReport'][_0x2695('0x3e')]);_0x2ac89f['query']=_[_0x2695('0x3f')](_0x2487d8[_0x2695('0x2b')]);_0x2ac89f['filters']=_[_0x2695('0x2d')](_0x2ac89f[_0x2695('0x29')],_0x2ac89f[_0x2695('0x2b')]);_0x4feaf5[_0x2695('0x2c')]=_[_0x2695('0x2d')](_0x2ac89f['model'],qs[_0x2695('0x40')](_0x2487d8[_0x2695('0x2b')][_0x2695('0x40')]));_0x4feaf5[_0x2695('0x2c')]=_0x4feaf5[_0x2695('0x2c')][_0x2695('0x41')]?_0x4feaf5[_0x2695('0x2c')]:_0x2ac89f[_0x2695('0x29')];if(_0x2487d8[_0x2695('0x2b')]['includeAll']){_0x4feaf5[_0x2695('0x38')]=[{'all':!![]}];}_0x4feaf5=_['merge']({},_0x4feaf5,_0x2487d8[_0x2695('0x42')]);return db['JscriptySessionReport'][_0x2695('0x43')](_0x4feaf5)[_0x2695('0x21')](handleEntityNotFound(_0xca5464,null))[_0x2695('0x21')](respondWithResult(_0xca5464,null))['catch'](handleError(_0xca5464,null));};exports[_0x2695('0x44')]=function(_0x13cf37,_0x292661){return db['JscriptySessionReport']['create'](_0x13cf37['body'],{})[_0x2695('0x21')](respondWithResult(_0x292661,0xc9))[_0x2695('0x3b')](handleError(_0x292661,null));};exports[_0x2695('0x20')]=function(_0x941c69,_0x42e329){if(_0x941c69[_0x2695('0x45')]['id']){delete _0x941c69[_0x2695('0x45')]['id'];}return db['JscriptySessionReport'][_0x2695('0x43')]({'where':{'id':_0x941c69[_0x2695('0x3d')]['id']}})[_0x2695('0x21')](handleEntityNotFound(_0x42e329,null))[_0x2695('0x21')](saveUpdates(_0x941c69[_0x2695('0x45')],null))[_0x2695('0x21')](respondWithResult(_0x42e329,null))['catch'](handleError(_0x42e329,null));};exports[_0x2695('0x22')]=function(_0xcf7403,_0x153f9f){return db['JscriptySessionReport']['find']({'where':{'id':_0xcf7403[_0x2695('0x3d')]['id']}})[_0x2695('0x21')](handleEntityNotFound(_0x153f9f,null))[_0x2695('0x21')](removeEntity(_0x153f9f,null))[_0x2695('0x3b')](handleError(_0x153f9f,null));};exports[_0x2695('0x46')]=function(_0xe79d5d,_0x451288){return db[_0x2695('0x26')][_0x2695('0x46')]()[_0x2695('0x21')](respondWithResult(_0x451288,null))['catch'](handleError(_0x451288,null));};exports['getQuestions']=function(_0x3cc619,_0x496a4d,_0x1d07ca){var _0x402d3f={'raw':!![],'where':{}};var _0x558782={};var _0x2b822f={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x2695('0x47')]({'where':{'id':_0x3cc619[_0x2695('0x3d')]['id']}})[_0x2695('0x21')](handleEntityNotFound(_0x496a4d,null))[_0x2695('0x21')](function(_0x386cdb){if(_0x386cdb){_0x558782[_0x2695('0x29')]=_['keys'](db['JscriptyQuestionReport'][_0x2695('0x3e')]);_0x558782[_0x2695('0x2b')]=_[_0x2695('0x3f')](_0x3cc619[_0x2695('0x2b')]);_0x558782[_0x2695('0x32')]=_[_0x2695('0x2d')](_0x558782['model'],_0x558782['query']);_0x402d3f['attributes']=_[_0x2695('0x2d')](_0x558782[_0x2695('0x29')],qs['fields'](_0x3cc619[_0x2695('0x2b')]['fields']));_0x402d3f[_0x2695('0x2c')]=_0x402d3f['attributes'][_0x2695('0x41')]?_0x402d3f[_0x2695('0x2c')]:_0x558782['model'];if(!_0x3cc619[_0x2695('0x2b')]['hasOwnProperty'](_0x2695('0x48'))){_0x402d3f[_0x2695('0x2e')]=qs[_0x2695('0x2e')](_0x3cc619['query'][_0x2695('0x2e')]);_0x402d3f[_0x2695('0x1b')]=qs[_0x2695('0x1b')](_0x3cc619[_0x2695('0x2b')][_0x2695('0x1b')]);}_0x402d3f[_0x2695('0x2f')]=qs['sort'](_0x3cc619[_0x2695('0x2b')][_0x2695('0x30')]);_0x402d3f['where']=qs['filters'](_[_0x2695('0x33')](_0x3cc619[_0x2695('0x2b')],_0x558782[_0x2695('0x32')]));_0x402d3f['where']['SessionId']=_0x386cdb['id'];if(_0x3cc619[_0x2695('0x2b')][_0x2695('0x34')]){_0x402d3f[_0x2695('0x31')]=_[_0x2695('0x35')](_0x402d3f[_0x2695('0x31')],{'$or':_[_0x2695('0x2a')](_0x402d3f[_0x2695('0x2c')],function(_0x12fa54){var _0x248fa5={};_0x248fa5[_0x12fa54]={'$like':'%'+_0x3cc619[_0x2695('0x2b')][_0x2695('0x34')]+'%'};return _0x248fa5;})});}_0x402d3f=_[_0x2695('0x35')]({},_0x402d3f,_0x3cc619['options']);return db[_0x2695('0x49')][_0x2695('0x1d')]({'where':_0x402d3f['where']})[_0x2695('0x21')](function(_0x5a852e){_0x2b822f[_0x2695('0x1d')]=_0x5a852e;if(_0x3cc619[_0x2695('0x2b')][_0x2695('0x37')]){_0x402d3f['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x2695('0x39')](_0x402d3f);})['then'](function(_0x1386a3){_0x2b822f['rows']=_0x1386a3;return _0x2b822f;});}})[_0x2695('0x21')](respondWithFilteredResult(_0x496a4d,_0x402d3f))[_0x2695('0x3b')](handleError(_0x496a4d,null));};
\ No newline at end of file