Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index ecadab0..7218ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf913=['catch','show','params','rawAttributes','includeAll','include','options','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','JscriptySessionReport','rows'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf913,0xb1));var _0x3f91=function(_0x443d9d,_0x5ec425){_0x443d9d=_0x443d9d-0x0;var _0x3e99dc=_0xf913[_0x443d9d];return _0x3e99dc;};'use strict';var emlformat=require(_0x3f91('0x0'));var rimraf=require(_0x3f91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f91('0x2'));var rp=require(_0x3f91('0x3'));var moment=require(_0x3f91('0x4'));var BPromise=require(_0x3f91('0x5'));var Mustache=require(_0x3f91('0x6'));var util=require(_0x3f91('0x7'));var path=require(_0x3f91('0x8'));var sox=require('sox');var csv=require(_0x3f91('0x9'));var ejs=require(_0x3f91('0xa'));var fs=require('fs');var fs_extra=require(_0x3f91('0xb'));var _=require(_0x3f91('0xc'));var squel=require(_0x3f91('0xd'));var crypto=require(_0x3f91('0xe'));var jsforce=require(_0x3f91('0xf'));var deskjs=require(_0x3f91('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3f91('0x11'));var Papa=require(_0x3f91('0x12'));var Redis=require(_0x3f91('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3f91('0x14'));var as=require(_0x3f91('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f91('0x16'))(_0x3f91('0x17'));var utils=require(_0x3f91('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3f91('0x19'));var db=require(_0x3f91('0x1a'))['db'];function respondWithStatusCode(_0x59c692,_0x55c5e5){_0x55c5e5=_0x55c5e5||0xcc;return function(_0x114dcf){if(_0x114dcf){return _0x59c692['sendStatus'](_0x55c5e5);}return _0x59c692[_0x3f91('0x1b')](_0x55c5e5)['end']();};}function respondWithResult(_0x535320,_0x56124c){_0x56124c=_0x56124c||0xc8;return function(_0xcbb8e8){if(_0xcbb8e8){return _0x535320[_0x3f91('0x1b')](_0x56124c)[_0x3f91('0x1c')](_0xcbb8e8);}};}function respondWithFilteredResult(_0x1c4f7f,_0xcb7425){return function(_0x582881){if(_0x582881){var _0x3601a7=typeof _0xcb7425[_0x3f91('0x1d')]===_0x3f91('0x1e')&&typeof _0xcb7425[_0x3f91('0x1f')]===_0x3f91('0x1e');var _0x28a2ce=_0x582881[_0x3f91('0x20')];var _0x30758f=_0x3601a7?0x0:_0xcb7425[_0x3f91('0x1d')];var _0x2cb4ea=_0x3601a7?_0x582881['count']:_0xcb7425[_0x3f91('0x1d')]+_0xcb7425[_0x3f91('0x1f')];var _0x406749;if(_0x2cb4ea>=_0x28a2ce){_0x2cb4ea=_0x28a2ce;_0x406749=0xc8;}else{_0x406749=0xce;}_0x1c4f7f[_0x3f91('0x1b')](_0x406749);return _0x1c4f7f['set']('Content-Range',_0x30758f+'-'+_0x2cb4ea+'/'+_0x28a2ce)[_0x3f91('0x1c')](_0x582881);}return null;};}function patchUpdates(_0x59f53e){return function(_0x361b7d){try{jsonpatch[_0x3f91('0x21')](_0x361b7d,_0x59f53e,!![]);}catch(_0x414fe4){return BPromise[_0x3f91('0x22')](_0x414fe4);}return _0x361b7d[_0x3f91('0x23')]();};}function saveUpdates(_0x2a7ca3,_0x5c73dc){return function(_0x262403){if(_0x262403){return _0x262403['update'](_0x2a7ca3)[_0x3f91('0x24')](function(_0x434109){return _0x434109;});}return null;};}function removeEntity(_0x5a353b,_0x1d10a3){return function(_0x5878d3){if(_0x5878d3){return _0x5878d3[_0x3f91('0x25')]()['then'](function(){_0x5a353b['status'](0xcc)[_0x3f91('0x26')]();});}};}function handleEntityNotFound(_0x3d42ee,_0x5707ac){return function(_0x370e16){if(!_0x370e16){_0x3d42ee['sendStatus'](0x194);}return _0x370e16;};}function handleError(_0x48ba09,_0x2f2285){_0x2f2285=_0x2f2285||0x1f4;return function(_0x33e189){logger[_0x3f91('0x27')](_0x33e189[_0x3f91('0x28')]);if(_0x33e189[_0x3f91('0x29')]){delete _0x33e189[_0x3f91('0x29')];}_0x48ba09[_0x3f91('0x1b')](_0x2f2285)[_0x3f91('0x2a')](_0x33e189);};}exports[_0x3f91('0x2b')]=function(_0x4a06ab,_0x3fa48f){var _0x413f2e={},_0x370d80={},_0x31a81a={'count':0x0,'rows':[]};var _0x59af4f=_[_0x3f91('0x2c')](db['JscriptySessionReport']['rawAttributes'],function(_0x24b83e){return{'name':_0x24b83e['fieldName'],'type':_0x24b83e['type']['key']};});_0x370d80[_0x3f91('0x2d')]=_[_0x3f91('0x2c')](_0x59af4f,_0x3f91('0x29'));_0x370d80[_0x3f91('0x2e')]=_[_0x3f91('0x2f')](_0x4a06ab[_0x3f91('0x2e')]);_0x370d80[_0x3f91('0x30')]=_[_0x3f91('0x31')](_0x370d80[_0x3f91('0x2d')],_0x370d80[_0x3f91('0x2e')]);_0x413f2e[_0x3f91('0x32')]=_[_0x3f91('0x31')](_0x370d80[_0x3f91('0x2d')],qs[_0x3f91('0x33')](_0x4a06ab[_0x3f91('0x2e')][_0x3f91('0x33')]));_0x413f2e['attributes']=_0x413f2e[_0x3f91('0x32')][_0x3f91('0x34')]?_0x413f2e[_0x3f91('0x32')]:_0x370d80['model'];if(!_0x4a06ab['query']['hasOwnProperty'](_0x3f91('0x35'))){_0x413f2e[_0x3f91('0x1f')]=qs[_0x3f91('0x1f')](_0x4a06ab[_0x3f91('0x2e')]['limit']);_0x413f2e[_0x3f91('0x1d')]=qs['offset'](_0x4a06ab['query'][_0x3f91('0x1d')]);}_0x413f2e[_0x3f91('0x36')]=qs[_0x3f91('0x37')](_0x4a06ab[_0x3f91('0x2e')][_0x3f91('0x37')]);_0x413f2e[_0x3f91('0x38')]=qs[_0x3f91('0x30')](_['pick'](_0x4a06ab[_0x3f91('0x2e')],_0x370d80[_0x3f91('0x30')]),_0x59af4f);if(_0x4a06ab[_0x3f91('0x2e')][_0x3f91('0x39')]){_0x413f2e[_0x3f91('0x38')]=_[_0x3f91('0x3a')](_0x413f2e[_0x3f91('0x38')],{'$or':_[_0x3f91('0x2c')](_0x59af4f,function(_0x26c9dd){if(_0x26c9dd[_0x3f91('0x3b')]!==_0x3f91('0x3c')){var _0xd1536={};_0xd1536[_0x26c9dd['name']]={'$like':'%'+_0x4a06ab[_0x3f91('0x2e')][_0x3f91('0x39')]+'%'};return _0xd1536;}})});}_0x413f2e=_[_0x3f91('0x3a')]({},_0x413f2e,_0x4a06ab['options']);var _0x1956ed={'where':_0x413f2e[_0x3f91('0x38')]};return db['JscriptySessionReport'][_0x3f91('0x20')](_0x1956ed)[_0x3f91('0x24')](function(_0x5969f1){_0x31a81a[_0x3f91('0x20')]=_0x5969f1;if(_0x4a06ab[_0x3f91('0x2e')]['includeAll']){_0x413f2e['include']=[{'all':!![]}];}return db[_0x3f91('0x3d')]['findAll'](_0x413f2e);})[_0x3f91('0x24')](function(_0x119959){_0x31a81a[_0x3f91('0x3e')]=_0x119959;return _0x31a81a;})[_0x3f91('0x24')](respondWithFilteredResult(_0x3fa48f,_0x413f2e))[_0x3f91('0x3f')](handleError(_0x3fa48f,null));};exports[_0x3f91('0x40')]=function(_0x353b46,_0x5ed420){var _0x148e94={'raw':!![],'where':{'id':_0x353b46[_0x3f91('0x41')]['id']}},_0xfdd8={};_0xfdd8['model']=_[_0x3f91('0x2f')](db[_0x3f91('0x3d')][_0x3f91('0x42')]);_0xfdd8[_0x3f91('0x2e')]=_[_0x3f91('0x2f')](_0x353b46['query']);_0xfdd8['filters']=_[_0x3f91('0x31')](_0xfdd8[_0x3f91('0x2d')],_0xfdd8[_0x3f91('0x2e')]);_0x148e94[_0x3f91('0x32')]=_[_0x3f91('0x31')](_0xfdd8[_0x3f91('0x2d')],qs[_0x3f91('0x33')](_0x353b46[_0x3f91('0x2e')][_0x3f91('0x33')]));_0x148e94[_0x3f91('0x32')]=_0x148e94['attributes'][_0x3f91('0x34')]?_0x148e94['attributes']:_0xfdd8['model'];if(_0x353b46['query'][_0x3f91('0x43')]){_0x148e94[_0x3f91('0x44')]=[{'all':!![]}];}_0x148e94=_[_0x3f91('0x3a')]({},_0x148e94,_0x353b46[_0x3f91('0x45')]);return db['JscriptySessionReport'][_0x3f91('0x46')](_0x148e94)['then'](handleEntityNotFound(_0x5ed420,null))[_0x3f91('0x24')](respondWithResult(_0x5ed420,null))['catch'](handleError(_0x5ed420,null));};exports[_0x3f91('0x47')]=function(_0x4c52b9,_0x36014b){return db['JscriptySessionReport'][_0x3f91('0x47')](_0x4c52b9[_0x3f91('0x48')],{})[_0x3f91('0x24')](respondWithResult(_0x36014b,0xc9))[_0x3f91('0x3f')](handleError(_0x36014b,null));};exports[_0x3f91('0x49')]=function(_0x22a3a8,_0x18918e){if(_0x22a3a8[_0x3f91('0x48')]['id']){delete _0x22a3a8[_0x3f91('0x48')]['id'];}return db['JscriptySessionReport'][_0x3f91('0x46')]({'where':{'id':_0x22a3a8[_0x3f91('0x41')]['id']}})[_0x3f91('0x24')](handleEntityNotFound(_0x18918e,null))[_0x3f91('0x24')](saveUpdates(_0x22a3a8['body'],null))[_0x3f91('0x24')](respondWithResult(_0x18918e,null))[_0x3f91('0x3f')](handleError(_0x18918e,null));};exports[_0x3f91('0x25')]=function(_0x5b4704,_0x1380e1){return db[_0x3f91('0x3d')][_0x3f91('0x46')]({'where':{'id':_0x5b4704[_0x3f91('0x41')]['id']}})[_0x3f91('0x24')](handleEntityNotFound(_0x1380e1,null))[_0x3f91('0x24')](removeEntity(_0x1380e1,null))[_0x3f91('0x3f')](handleError(_0x1380e1,null));};exports[_0x3f91('0x4a')]=function(_0x11927d,_0x5ee443){return db[_0x3f91('0x3d')]['describe']()[_0x3f91('0x24')](respondWithResult(_0x5ee443,null))[_0x3f91('0x3f')](handleError(_0x5ee443,null));};exports[_0x3f91('0x4b')]=function(_0x3dcb5f,_0x4bed1f,_0x4eac5f){var _0x7d2a4b={'raw':!![],'where':{}};var _0x5ed80f={};var _0x385170={'count':0x0,'rows':[]};return db[_0x3f91('0x3d')][_0x3f91('0x4c')]({'where':{'id':_0x3dcb5f[_0x3f91('0x41')]['id']}})[_0x3f91('0x24')](handleEntityNotFound(_0x4bed1f,null))[_0x3f91('0x24')](function(_0x25a545){if(_0x25a545){_0x5ed80f[_0x3f91('0x2d')]=_[_0x3f91('0x2f')](db[_0x3f91('0x4d')]['rawAttributes']);_0x5ed80f[_0x3f91('0x2e')]=_[_0x3f91('0x2f')](_0x3dcb5f[_0x3f91('0x2e')]);_0x5ed80f[_0x3f91('0x30')]=_[_0x3f91('0x31')](_0x5ed80f[_0x3f91('0x2d')],_0x5ed80f[_0x3f91('0x2e')]);_0x7d2a4b[_0x3f91('0x32')]=_[_0x3f91('0x31')](_0x5ed80f[_0x3f91('0x2d')],qs[_0x3f91('0x33')](_0x3dcb5f[_0x3f91('0x2e')][_0x3f91('0x33')]));_0x7d2a4b['attributes']=_0x7d2a4b[_0x3f91('0x32')][_0x3f91('0x34')]?_0x7d2a4b[_0x3f91('0x32')]:_0x5ed80f['model'];if(!_0x3dcb5f[_0x3f91('0x2e')][_0x3f91('0x4e')]('nolimit')){_0x7d2a4b[_0x3f91('0x1f')]=qs[_0x3f91('0x1f')](_0x3dcb5f['query'][_0x3f91('0x1f')]);_0x7d2a4b['offset']=qs[_0x3f91('0x1d')](_0x3dcb5f[_0x3f91('0x2e')][_0x3f91('0x1d')]);}_0x7d2a4b[_0x3f91('0x36')]=qs[_0x3f91('0x37')](_0x3dcb5f[_0x3f91('0x2e')][_0x3f91('0x37')]);_0x7d2a4b[_0x3f91('0x38')]=qs[_0x3f91('0x30')](_['pick'](_0x3dcb5f[_0x3f91('0x2e')],_0x5ed80f[_0x3f91('0x30')]));_0x7d2a4b['where']['SessionId']=_0x25a545['id'];if(_0x3dcb5f[_0x3f91('0x2e')]['filter']){_0x7d2a4b[_0x3f91('0x38')]=_[_0x3f91('0x3a')](_0x7d2a4b[_0x3f91('0x38')],{'$or':_[_0x3f91('0x2c')](_0x7d2a4b[_0x3f91('0x32')],function(_0x104bdd){var _0x3d633d={};_0x3d633d[_0x104bdd]={'$like':'%'+_0x3dcb5f[_0x3f91('0x2e')][_0x3f91('0x39')]+'%'};return _0x3d633d;})});}_0x7d2a4b=_['merge']({},_0x7d2a4b,_0x3dcb5f[_0x3f91('0x45')]);return db['JscriptyQuestionReport'][_0x3f91('0x20')]({'where':_0x7d2a4b[_0x3f91('0x38')]})[_0x3f91('0x24')](function(_0x385943){_0x385170[_0x3f91('0x20')]=_0x385943;if(_0x3dcb5f['query'][_0x3f91('0x43')]){_0x7d2a4b[_0x3f91('0x44')]=[{'all':!![]}];}return db[_0x3f91('0x4d')][_0x3f91('0x4f')](_0x7d2a4b);})[_0x3f91('0x24')](function(_0xcf181a){_0x385170[_0x3f91('0x3e')]=_0xcf181a;return _0x385170;});}})[_0x3f91('0x24')](respondWithFilteredResult(_0x4bed1f,_0x7d2a4b))[_0x3f91('0x3f')](handleError(_0x4bed1f,null));};
\ No newline at end of file
+var _0x529a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','describe','getQuestions','findOne','params','SessionId','JscriptyQuestionReport','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x431d2b,_0x7a3416){var _0x7e3d8e=function(_0x3e969b){while(--_0x3e969b){_0x431d2b['push'](_0x431d2b['shift']());}};_0x7e3d8e(++_0x7a3416);}(_0x529a,0x18c));var _0xa529=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x529a[_0x56740a];return _0x257144;};'use strict';var emlformat=require(_0xa529('0x0'));var rimraf=require(_0xa529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa529('0x2'));var rp=require('request-promise');var moment=require(_0xa529('0x3'));var BPromise=require(_0xa529('0x4'));var Mustache=require(_0xa529('0x5'));var util=require(_0xa529('0x6'));var path=require(_0xa529('0x7'));var sox=require(_0xa529('0x8'));var csv=require('to-csv');var ejs=require(_0xa529('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa529('0xa'));var squel=require(_0xa529('0xb'));var crypto=require(_0xa529('0xc'));var jsforce=require(_0xa529('0xd'));var deskjs=require(_0xa529('0xe'));var toCsv=require(_0xa529('0xf'));var querystring=require('querystring');var Papa=require(_0xa529('0x10'));var Redis=require(_0xa529('0x11'));var authService=require(_0xa529('0x12'));var qs=require(_0xa529('0x13'));var as=require(_0xa529('0x14'));var hardwareService=require(_0xa529('0x15'));var logger=require(_0xa529('0x16'))(_0xa529('0x17'));var utils=require(_0xa529('0x18'));var config=require(_0xa529('0x19'));var licenseUtil=require(_0xa529('0x1a'));var db=require(_0xa529('0x1b'))['db'];function respondWithStatusCode(_0x53d918,_0x2cbc5a){_0x2cbc5a=_0x2cbc5a||0xcc;return function(_0x27081c){if(_0x27081c){return _0x53d918[_0xa529('0x1c')](_0x2cbc5a);}return _0x53d918[_0xa529('0x1d')](_0x2cbc5a)['end']();};}function respondWithResult(_0x25e217,_0x2e3514){_0x2e3514=_0x2e3514||0xc8;return function(_0x22a108){if(_0x22a108){return _0x25e217[_0xa529('0x1d')](_0x2e3514)[_0xa529('0x1e')](_0x22a108);}};}function respondWithFilteredResult(_0x5e8b19,_0x1a9e81){return function(_0x5e1289){if(_0x5e1289){var _0x8dc0b4=typeof _0x1a9e81['offset']===_0xa529('0x1f')&&typeof _0x1a9e81[_0xa529('0x20')]===_0xa529('0x1f');var _0xfe0707=_0x5e1289['count'];var _0xf97b0f=_0x8dc0b4?0x0:_0x1a9e81['offset'];var _0x3a7670=_0x8dc0b4?_0x5e1289[_0xa529('0x21')]:_0x1a9e81[_0xa529('0x22')]+_0x1a9e81['limit'];var _0xf2639e;if(_0x3a7670>=_0xfe0707){_0x3a7670=_0xfe0707;_0xf2639e=0xc8;}else{_0xf2639e=0xce;}_0x5e8b19[_0xa529('0x1d')](_0xf2639e);return _0x5e8b19[_0xa529('0x23')](_0xa529('0x24'),_0xf97b0f+'-'+_0x3a7670+'/'+_0xfe0707)['json'](_0x5e1289);}return null;};}function patchUpdates(_0x439eec){return function(_0x39834e){try{jsonpatch[_0xa529('0x25')](_0x39834e,_0x439eec,!![]);}catch(_0x2a5358){return BPromise[_0xa529('0x26')](_0x2a5358);}return _0x39834e['save']();};}function saveUpdates(_0x3c2d99,_0x2b1acb){return function(_0x1ff3ae){if(_0x1ff3ae){return _0x1ff3ae[_0xa529('0x27')](_0x3c2d99)['then'](function(_0x3fc02a){return _0x3fc02a;});}return null;};}function removeEntity(_0x4637ed,_0x12b65b){return function(_0x2bbdf9){if(_0x2bbdf9){return _0x2bbdf9['destroy']()[_0xa529('0x28')](function(){_0x4637ed[_0xa529('0x1d')](0xcc)[_0xa529('0x29')]();});}};}function handleEntityNotFound(_0x29ee78,_0x5586ba){return function(_0x50b829){if(!_0x50b829){_0x29ee78['sendStatus'](0x194);}return _0x50b829;};}function handleError(_0x59a5f0,_0x33cd01){_0x33cd01=_0x33cd01||0x1f4;return function(_0x43422f){logger[_0xa529('0x2a')](_0x43422f[_0xa529('0x2b')]);if(_0x43422f['name']){delete _0x43422f[_0xa529('0x2c')];}_0x59a5f0['status'](_0x33cd01)['send'](_0x43422f);};}exports[_0xa529('0x2d')]=function(_0xd0e857,_0x47f0f1){var _0x534ff1={},_0x1d5e44={},_0x29b407={'count':0x0,'rows':[]};var _0x216686=_[_0xa529('0x2e')](db[_0xa529('0x2f')][_0xa529('0x30')],function(_0x1abb64){return{'name':_0x1abb64['fieldName'],'type':_0x1abb64['type']['key']};});_0x1d5e44[_0xa529('0x31')]=_['map'](_0x216686,'name');_0x1d5e44[_0xa529('0x32')]=_[_0xa529('0x33')](_0xd0e857[_0xa529('0x32')]);_0x1d5e44[_0xa529('0x34')]=_[_0xa529('0x35')](_0x1d5e44[_0xa529('0x31')],_0x1d5e44[_0xa529('0x32')]);_0x534ff1[_0xa529('0x36')]=_[_0xa529('0x35')](_0x1d5e44[_0xa529('0x31')],qs[_0xa529('0x37')](_0xd0e857[_0xa529('0x32')][_0xa529('0x37')]));_0x534ff1['attributes']=_0x534ff1[_0xa529('0x36')][_0xa529('0x38')]?_0x534ff1[_0xa529('0x36')]:_0x1d5e44[_0xa529('0x31')];if(!_0xd0e857[_0xa529('0x32')][_0xa529('0x39')](_0xa529('0x3a'))){_0x534ff1[_0xa529('0x20')]=qs[_0xa529('0x20')](_0xd0e857['query'][_0xa529('0x20')]);_0x534ff1[_0xa529('0x22')]=qs[_0xa529('0x22')](_0xd0e857[_0xa529('0x32')]['offset']);}_0x534ff1[_0xa529('0x3b')]=qs[_0xa529('0x3c')](_0xd0e857[_0xa529('0x32')][_0xa529('0x3c')]);_0x534ff1[_0xa529('0x3d')]=qs[_0xa529('0x34')](_[_0xa529('0x3e')](_0xd0e857['query'],_0x1d5e44['filters']),_0x216686);if(_0xd0e857['query'][_0xa529('0x3f')]){_0x534ff1[_0xa529('0x3d')]=_[_0xa529('0x40')](_0x534ff1[_0xa529('0x3d')],{'$or':_['map'](_0x216686,function(_0x557395){if(_0x557395[_0xa529('0x41')]!=='VIRTUAL'){var _0x27e8e5={};_0x27e8e5[_0x557395[_0xa529('0x2c')]]={'$like':'%'+_0xd0e857['query']['filter']+'%'};return _0x27e8e5;}})});}_0x534ff1=_['merge']({},_0x534ff1,_0xd0e857[_0xa529('0x42')]);var _0x480e6a={'where':_0x534ff1['where']};return db['JscriptySessionReport'][_0xa529('0x21')](_0x480e6a)[_0xa529('0x28')](function(_0x2bea44){_0x29b407['count']=_0x2bea44;if(_0xd0e857[_0xa529('0x32')][_0xa529('0x43')]){_0x534ff1[_0xa529('0x44')]=[{'all':!![]}];}return db[_0xa529('0x2f')][_0xa529('0x45')](_0x534ff1);})[_0xa529('0x28')](function(_0x296c8c){_0x29b407[_0xa529('0x46')]=_0x296c8c;return _0x29b407;})[_0xa529('0x28')](respondWithFilteredResult(_0x47f0f1,_0x534ff1))[_0xa529('0x47')](handleError(_0x47f0f1,null));};exports[_0xa529('0x48')]=function(_0xb9c02c,_0x507f15){var _0x105053={'raw':!![],'where':{'id':_0xb9c02c['params']['id']}},_0x336d1f={};_0x336d1f[_0xa529('0x31')]=_[_0xa529('0x33')](db[_0xa529('0x2f')][_0xa529('0x30')]);_0x336d1f[_0xa529('0x32')]=_[_0xa529('0x33')](_0xb9c02c['query']);_0x336d1f[_0xa529('0x34')]=_[_0xa529('0x35')](_0x336d1f[_0xa529('0x31')],_0x336d1f[_0xa529('0x32')]);_0x105053[_0xa529('0x36')]=_[_0xa529('0x35')](_0x336d1f['model'],qs[_0xa529('0x37')](_0xb9c02c[_0xa529('0x32')][_0xa529('0x37')]));_0x105053[_0xa529('0x36')]=_0x105053[_0xa529('0x36')][_0xa529('0x38')]?_0x105053[_0xa529('0x36')]:_0x336d1f[_0xa529('0x31')];if(_0xb9c02c[_0xa529('0x32')][_0xa529('0x43')]){_0x105053[_0xa529('0x44')]=[{'all':!![]}];}_0x105053=_[_0xa529('0x40')]({},_0x105053,_0xb9c02c[_0xa529('0x42')]);return db[_0xa529('0x2f')][_0xa529('0x49')](_0x105053)[_0xa529('0x28')](handleEntityNotFound(_0x507f15,null))[_0xa529('0x28')](respondWithResult(_0x507f15,null))[_0xa529('0x47')](handleError(_0x507f15,null));};exports[_0xa529('0x4a')]=function(_0x5cb907,_0x3073ac){return db[_0xa529('0x2f')][_0xa529('0x4a')](_0x5cb907[_0xa529('0x4b')],{})[_0xa529('0x28')](respondWithResult(_0x3073ac,0xc9))[_0xa529('0x47')](handleError(_0x3073ac,null));};exports[_0xa529('0x27')]=function(_0x19f471,_0x1e21c3){if(_0x19f471[_0xa529('0x4b')]['id']){delete _0x19f471[_0xa529('0x4b')]['id'];}return db[_0xa529('0x2f')][_0xa529('0x49')]({'where':{'id':_0x19f471['params']['id']}})['then'](handleEntityNotFound(_0x1e21c3,null))[_0xa529('0x28')](saveUpdates(_0x19f471[_0xa529('0x4b')],null))[_0xa529('0x28')](respondWithResult(_0x1e21c3,null))[_0xa529('0x47')](handleError(_0x1e21c3,null));};exports[_0xa529('0x4c')]=function(_0x558c38,_0xf1e993){return db[_0xa529('0x2f')]['find']({'where':{'id':_0x558c38['params']['id']}})[_0xa529('0x28')](handleEntityNotFound(_0xf1e993,null))[_0xa529('0x28')](removeEntity(_0xf1e993,null))['catch'](handleError(_0xf1e993,null));};exports[_0xa529('0x4d')]=function(_0xdcc58f,_0x5c028b){return db[_0xa529('0x2f')][_0xa529('0x4d')]()[_0xa529('0x28')](respondWithResult(_0x5c028b,null))['catch'](handleError(_0x5c028b,null));};exports[_0xa529('0x4e')]=function(_0x38165b,_0x1453b0,_0x358f3c){var _0x334783={'raw':!![],'where':{}};var _0x56634d={};var _0xf021be={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xa529('0x4f')]({'where':{'id':_0x38165b[_0xa529('0x50')]['id']}})[_0xa529('0x28')](handleEntityNotFound(_0x1453b0,null))[_0xa529('0x28')](function(_0x25e8d7){if(_0x25e8d7){_0x56634d[_0xa529('0x31')]=_[_0xa529('0x33')](db['JscriptyQuestionReport'][_0xa529('0x30')]);_0x56634d[_0xa529('0x32')]=_[_0xa529('0x33')](_0x38165b[_0xa529('0x32')]);_0x56634d[_0xa529('0x34')]=_[_0xa529('0x35')](_0x56634d[_0xa529('0x31')],_0x56634d['query']);_0x334783[_0xa529('0x36')]=_[_0xa529('0x35')](_0x56634d[_0xa529('0x31')],qs[_0xa529('0x37')](_0x38165b[_0xa529('0x32')][_0xa529('0x37')]));_0x334783[_0xa529('0x36')]=_0x334783['attributes'][_0xa529('0x38')]?_0x334783[_0xa529('0x36')]:_0x56634d['model'];if(!_0x38165b[_0xa529('0x32')]['hasOwnProperty']('nolimit')){_0x334783[_0xa529('0x20')]=qs[_0xa529('0x20')](_0x38165b['query'][_0xa529('0x20')]);_0x334783[_0xa529('0x22')]=qs[_0xa529('0x22')](_0x38165b[_0xa529('0x32')][_0xa529('0x22')]);}_0x334783['order']=qs['sort'](_0x38165b['query'][_0xa529('0x3c')]);_0x334783['where']=qs[_0xa529('0x34')](_[_0xa529('0x3e')](_0x38165b['query'],_0x56634d[_0xa529('0x34')]));_0x334783[_0xa529('0x3d')][_0xa529('0x51')]=_0x25e8d7['id'];if(_0x38165b[_0xa529('0x32')][_0xa529('0x3f')]){_0x334783['where']=_[_0xa529('0x40')](_0x334783[_0xa529('0x3d')],{'$or':_[_0xa529('0x2e')](_0x334783[_0xa529('0x36')],function(_0x36c680){var _0x2cb836={};_0x2cb836[_0x36c680]={'$like':'%'+_0x38165b[_0xa529('0x32')][_0xa529('0x3f')]+'%'};return _0x2cb836;})});}_0x334783=_[_0xa529('0x40')]({},_0x334783,_0x38165b[_0xa529('0x42')]);return db[_0xa529('0x52')][_0xa529('0x21')]({'where':_0x334783[_0xa529('0x3d')]})[_0xa529('0x28')](function(_0x2b687b){_0xf021be['count']=_0x2b687b;if(_0x38165b[_0xa529('0x32')]['includeAll']){_0x334783['include']=[{'all':!![]}];}return db[_0xa529('0x52')][_0xa529('0x45')](_0x334783);})[_0xa529('0x28')](function(_0x5c4722){_0xf021be[_0xa529('0x46')]=_0x5c4722;return _0xf021be;});}})['then'](respondWithFilteredResult(_0x1453b0,_0x334783))[_0xa529('0x47')](handleError(_0x1453b0,null));};
\ No newline at end of file