Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 5e9dd4a..5da4a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fd8=['update','destroy','then','error','name','send','index','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','JscriptySessionReport','rows','catch','show','params','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','sort','SessionId','include','findAll','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','apply','reject','save'];(function(_0x441657,_0x6dc13e){var _0x3764f7=function(_0x2f4db4){while(--_0x2f4db4){_0x441657['push'](_0x441657['shift']());}};_0x3764f7(++_0x6dc13e);}(_0x1fd8,0x1ad));var _0x81fd=function(_0x10a0be,_0x5f3a78){_0x10a0be=_0x10a0be-0x0;var _0x42e726=_0x1fd8[_0x10a0be];return _0x42e726;};'use strict';var pdf=require(_0x81fd('0x0'));var emlformat=require(_0x81fd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x81fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81fd('0x3'));var moment=require('moment');var BPromise=require(_0x81fd('0x4'));var Mustache=require(_0x81fd('0x5'));var util=require(_0x81fd('0x6'));var path=require(_0x81fd('0x7'));var sox=require(_0x81fd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x81fd('0x9'));var squel=require(_0x81fd('0xa'));var crypto=require(_0x81fd('0xb'));var jsforce=require(_0x81fd('0xc'));var deskjs=require(_0x81fd('0xd'));var toCsv=require(_0x81fd('0xe'));var querystring=require('querystring');var Papa=require(_0x81fd('0xf'));var Redis=require(_0x81fd('0x10'));var authService=require(_0x81fd('0x11'));var qs=require(_0x81fd('0x12'));var as=require(_0x81fd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81fd('0x14'))(_0x81fd('0x15'));var utils=require('../../config/utils');var config=require(_0x81fd('0x16'));var db=require(_0x81fd('0x17'))['db'];function respondWithStatusCode(_0x303df0,_0x1505ee){_0x1505ee=_0x1505ee||0xcc;return function(_0x4bc18b){if(_0x4bc18b){return _0x303df0[_0x81fd('0x18')](_0x1505ee);}return _0x303df0['status'](_0x1505ee)['end']();};}function respondWithResult(_0x57426c,_0x7a86df){_0x7a86df=_0x7a86df||0xc8;return function(_0x3dc6e4){if(_0x3dc6e4){return _0x57426c[_0x81fd('0x19')](_0x7a86df)['json'](_0x3dc6e4);}};}function respondWithFilteredResult(_0x17c59f,_0x1a9894){return function(_0x5402d1){if(_0x5402d1){var _0x454984=_0x5402d1[_0x81fd('0x1a')],_0x117c82=_0x1a9894[_0x81fd('0x1b')],_0x5eb2eb=_0x1a9894[_0x81fd('0x1b')]+_0x1a9894['limit'],_0x4d475e;if(_0x5eb2eb>=_0x454984){_0x5eb2eb=_0x454984;_0x4d475e=0xc8;}else{_0x4d475e=0xce;}_0x17c59f[_0x81fd('0x19')](_0x4d475e);return _0x17c59f[_0x81fd('0x1c')](_0x81fd('0x1d'),_0x117c82+'-'+_0x5eb2eb+'/'+_0x454984)['json'](_0x5402d1);}return null;};}function patchUpdates(_0x579e1e){return function(_0x3b6fb6){try{jsonpatch[_0x81fd('0x1e')](_0x3b6fb6,_0x579e1e,!![]);}catch(_0x214a42){return BPromise[_0x81fd('0x1f')](_0x214a42);}return _0x3b6fb6[_0x81fd('0x20')]();};}function saveUpdates(_0x4bde57,_0x44afb5){return function(_0x501a2e){if(_0x501a2e){return _0x501a2e[_0x81fd('0x21')](_0x4bde57)['then'](function(_0x8e2716){return _0x8e2716;});}return null;};}function removeEntity(_0x15b3b8,_0x21679c){return function(_0x14d327){if(_0x14d327){return _0x14d327[_0x81fd('0x22')]()[_0x81fd('0x23')](function(){_0x15b3b8[_0x81fd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd94b,_0x746275){return function(_0x2e035a){if(!_0x2e035a){_0x4bd94b[_0x81fd('0x18')](0x194);}return _0x2e035a;};}function handleError(_0xd0ae29,_0x4c1131){_0x4c1131=_0x4c1131||0x1f4;return function(_0x5ea62e){logger[_0x81fd('0x24')](_0x5ea62e['stack']);if(_0x5ea62e[_0x81fd('0x25')]){delete _0x5ea62e[_0x81fd('0x25')];}_0xd0ae29[_0x81fd('0x19')](_0x4c1131)[_0x81fd('0x26')](_0x5ea62e);};}exports[_0x81fd('0x27')]=function(_0x5d2c09,_0x724efd){var _0x398602={},_0x5dc895={},_0x11977a={'count':0x0,'rows':[]};var _0x4e67c0=_['map'](db['JscriptySessionReport'][_0x81fd('0x28')],function(_0xf868c4){return{'name':_0xf868c4['fieldName'],'type':_0xf868c4['type']['key']};});_0x5dc895[_0x81fd('0x29')]=_[_0x81fd('0x2a')](_0x4e67c0,_0x81fd('0x25'));_0x5dc895[_0x81fd('0x2b')]=_[_0x81fd('0x2c')](_0x5d2c09[_0x81fd('0x2b')]);_0x5dc895['filters']=_[_0x81fd('0x2d')](_0x5dc895[_0x81fd('0x29')],_0x5dc895['query']);_0x398602[_0x81fd('0x2e')]=_['intersection'](_0x5dc895[_0x81fd('0x29')],qs[_0x81fd('0x2f')](_0x5d2c09[_0x81fd('0x2b')]['fields']));_0x398602[_0x81fd('0x2e')]=_0x398602['attributes'][_0x81fd('0x30')]?_0x398602['attributes']:_0x5dc895[_0x81fd('0x29')];if(!_0x5d2c09[_0x81fd('0x2b')][_0x81fd('0x31')](_0x81fd('0x32'))){_0x398602['limit']=qs[_0x81fd('0x33')](_0x5d2c09['query'][_0x81fd('0x33')]);_0x398602[_0x81fd('0x1b')]=qs['offset'](_0x5d2c09[_0x81fd('0x2b')][_0x81fd('0x1b')]);}_0x398602[_0x81fd('0x34')]=qs['sort'](_0x5d2c09[_0x81fd('0x2b')]['sort']);_0x398602[_0x81fd('0x35')]=qs[_0x81fd('0x36')](_[_0x81fd('0x37')](_0x5d2c09['query'],_0x5dc895[_0x81fd('0x36')]));if(_0x5d2c09[_0x81fd('0x2b')][_0x81fd('0x38')]){_0x398602[_0x81fd('0x35')]=_[_0x81fd('0x39')](_0x398602[_0x81fd('0x35')],{'$or':_[_0x81fd('0x2a')](_0x4e67c0,function(_0x4f47c3){if(_0x4f47c3['type']!==_0x81fd('0x3a')){var _0x50d80f={};_0x50d80f[_0x4f47c3[_0x81fd('0x25')]]={'$like':'%'+_0x5d2c09[_0x81fd('0x2b')][_0x81fd('0x38')]+'%'};return _0x50d80f;}})});}_0x398602=_[_0x81fd('0x39')]({},_0x398602,_0x5d2c09['options']);var _0x367455={'where':_0x398602['where']};return db['JscriptySessionReport'][_0x81fd('0x1a')](_0x367455)['then'](function(_0x293ab8){_0x11977a[_0x81fd('0x1a')]=_0x293ab8;if(_0x5d2c09[_0x81fd('0x2b')][_0x81fd('0x3b')]){_0x398602['include']=[{'all':!![]}];}return db[_0x81fd('0x3c')]['findAll'](_0x398602);})[_0x81fd('0x23')](function(_0x2321cc){_0x11977a[_0x81fd('0x3d')]=_0x2321cc;return _0x11977a;})[_0x81fd('0x23')](respondWithFilteredResult(_0x724efd,_0x398602))[_0x81fd('0x3e')](handleError(_0x724efd,null));};exports[_0x81fd('0x3f')]=function(_0x40d1f8,_0x1de093){var _0x2f4861={'raw':!![],'where':{'id':_0x40d1f8[_0x81fd('0x40')]['id']}},_0x2a12e0={};_0x2a12e0[_0x81fd('0x29')]=_[_0x81fd('0x2c')](db[_0x81fd('0x3c')][_0x81fd('0x28')]);_0x2a12e0[_0x81fd('0x2b')]=_[_0x81fd('0x2c')](_0x40d1f8[_0x81fd('0x2b')]);_0x2a12e0[_0x81fd('0x36')]=_[_0x81fd('0x2d')](_0x2a12e0['model'],_0x2a12e0[_0x81fd('0x2b')]);_0x2f4861[_0x81fd('0x2e')]=_[_0x81fd('0x2d')](_0x2a12e0[_0x81fd('0x29')],qs[_0x81fd('0x2f')](_0x40d1f8[_0x81fd('0x2b')]['fields']));_0x2f4861[_0x81fd('0x2e')]=_0x2f4861[_0x81fd('0x2e')][_0x81fd('0x30')]?_0x2f4861[_0x81fd('0x2e')]:_0x2a12e0[_0x81fd('0x29')];if(_0x40d1f8['query'][_0x81fd('0x3b')]){_0x2f4861['include']=[{'all':!![]}];}_0x2f4861=_[_0x81fd('0x39')]({},_0x2f4861,_0x40d1f8[_0x81fd('0x41')]);return db[_0x81fd('0x3c')][_0x81fd('0x42')](_0x2f4861)[_0x81fd('0x23')](handleEntityNotFound(_0x1de093,null))['then'](respondWithResult(_0x1de093,null))['catch'](handleError(_0x1de093,null));};exports[_0x81fd('0x43')]=function(_0x3bc640,_0x39eba2){return db[_0x81fd('0x3c')]['create'](_0x3bc640[_0x81fd('0x44')],{})['then'](respondWithResult(_0x39eba2,0xc9))[_0x81fd('0x3e')](handleError(_0x39eba2,null));};exports[_0x81fd('0x21')]=function(_0x39b596,_0x2f13b6){if(_0x39b596[_0x81fd('0x44')]['id']){delete _0x39b596[_0x81fd('0x44')]['id'];}return db['JscriptySessionReport'][_0x81fd('0x42')]({'where':{'id':_0x39b596[_0x81fd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f13b6,null))['then'](saveUpdates(_0x39b596[_0x81fd('0x44')],null))[_0x81fd('0x23')](respondWithResult(_0x2f13b6,null))[_0x81fd('0x3e')](handleError(_0x2f13b6,null));};exports[_0x81fd('0x22')]=function(_0x322cbe,_0x3534d4){return db['JscriptySessionReport'][_0x81fd('0x42')]({'where':{'id':_0x322cbe[_0x81fd('0x40')]['id']}})['then'](handleEntityNotFound(_0x3534d4,null))[_0x81fd('0x23')](removeEntity(_0x3534d4,null))[_0x81fd('0x3e')](handleError(_0x3534d4,null));};exports[_0x81fd('0x45')]=function(_0x40b620,_0x35a078){return db[_0x81fd('0x3c')][_0x81fd('0x45')]()[_0x81fd('0x23')](respondWithResult(_0x35a078,null))[_0x81fd('0x3e')](handleError(_0x35a078,null));};exports[_0x81fd('0x46')]=function(_0xb70f16,_0xdfe98c,_0x3414ce){var _0x44dc4b={'raw':!![],'where':{}};var _0x4b0058={};var _0x5011cc={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x81fd('0x47')]({'where':{'id':_0xb70f16['params']['id']}})[_0x81fd('0x23')](handleEntityNotFound(_0xdfe98c,null))['then'](function(_0x1f1238){if(_0x1f1238){_0x4b0058[_0x81fd('0x29')]=_[_0x81fd('0x2c')](db[_0x81fd('0x48')][_0x81fd('0x28')]);_0x4b0058[_0x81fd('0x2b')]=_[_0x81fd('0x2c')](_0xb70f16[_0x81fd('0x2b')]);_0x4b0058[_0x81fd('0x36')]=_['intersection'](_0x4b0058[_0x81fd('0x29')],_0x4b0058[_0x81fd('0x2b')]);_0x44dc4b[_0x81fd('0x2e')]=_[_0x81fd('0x2d')](_0x4b0058[_0x81fd('0x29')],qs[_0x81fd('0x2f')](_0xb70f16[_0x81fd('0x2b')][_0x81fd('0x2f')]));_0x44dc4b[_0x81fd('0x2e')]=_0x44dc4b[_0x81fd('0x2e')][_0x81fd('0x30')]?_0x44dc4b[_0x81fd('0x2e')]:_0x4b0058[_0x81fd('0x29')];if(!_0xb70f16[_0x81fd('0x2b')]['hasOwnProperty'](_0x81fd('0x32'))){_0x44dc4b[_0x81fd('0x33')]=qs[_0x81fd('0x33')](_0xb70f16[_0x81fd('0x2b')][_0x81fd('0x33')]);_0x44dc4b[_0x81fd('0x1b')]=qs[_0x81fd('0x1b')](_0xb70f16[_0x81fd('0x2b')][_0x81fd('0x1b')]);}_0x44dc4b['order']=qs[_0x81fd('0x49')](_0xb70f16['query'][_0x81fd('0x49')]);_0x44dc4b['where']=qs['filters'](_[_0x81fd('0x37')](_0xb70f16[_0x81fd('0x2b')],_0x4b0058[_0x81fd('0x36')]));_0x44dc4b[_0x81fd('0x35')][_0x81fd('0x4a')]=_0x1f1238['id'];if(_0xb70f16['query'][_0x81fd('0x38')]){_0x44dc4b[_0x81fd('0x35')]=_['merge'](_0x44dc4b[_0x81fd('0x35')],{'$or':_[_0x81fd('0x2a')](_0x44dc4b[_0x81fd('0x2e')],function(_0x4c6c7c){var _0x54aca5={};_0x54aca5[_0x4c6c7c]={'$like':'%'+_0xb70f16[_0x81fd('0x2b')][_0x81fd('0x38')]+'%'};return _0x54aca5;})});}_0x44dc4b=_[_0x81fd('0x39')]({},_0x44dc4b,_0xb70f16[_0x81fd('0x41')]);return db[_0x81fd('0x48')][_0x81fd('0x1a')]({'where':_0x44dc4b[_0x81fd('0x35')]})[_0x81fd('0x23')](function(_0x38ed81){_0x5011cc[_0x81fd('0x1a')]=_0x38ed81;if(_0xb70f16[_0x81fd('0x2b')][_0x81fd('0x3b')]){_0x44dc4b[_0x81fd('0x4b')]=[{'all':!![]}];}return db[_0x81fd('0x48')][_0x81fd('0x4c')](_0x44dc4b);})[_0x81fd('0x23')](function(_0x40fa6d){_0x5011cc[_0x81fd('0x3d')]=_0x40fa6d;return _0x5011cc;});}})[_0x81fd('0x23')](respondWithFilteredResult(_0xdfe98c,_0x44dc4b))[_0x81fd('0x3e')](handleError(_0xdfe98c,null));};
\ No newline at end of file
+var _0xf664=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','destroy','find','describe','getQuestions','findOne','JscriptyQuestionReport','findAll','rows','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4e625f,_0x3781df){var _0xc986a3=function(_0xb49874){while(--_0xb49874){_0x4e625f['push'](_0x4e625f['shift']());}};_0xc986a3(++_0x3781df);}(_0xf664,0x68));var _0x4f66=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xf664[_0x2f45ea];return _0x485a84;};'use strict';var pdf=require(_0x4f66('0x0'));var emlformat=require(_0x4f66('0x1'));var rimraf=require(_0x4f66('0x2'));var zipdir=require(_0x4f66('0x3'));var jsonpatch=require(_0x4f66('0x4'));var rp=require(_0x4f66('0x5'));var moment=require(_0x4f66('0x6'));var BPromise=require(_0x4f66('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f66('0x8'));var sox=require(_0x4f66('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f66('0xa'));var squel=require(_0x4f66('0xb'));var crypto=require(_0x4f66('0xc'));var jsforce=require(_0x4f66('0xd'));var deskjs=require(_0x4f66('0xe'));var toCsv=require(_0x4f66('0xf'));var querystring=require(_0x4f66('0x10'));var Papa=require(_0x4f66('0x11'));var Redis=require('ioredis');var authService=require(_0x4f66('0x12'));var qs=require(_0x4f66('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f66('0x14'));var logger=require(_0x4f66('0x15'))('api');var utils=require(_0x4f66('0x16'));var config=require('../../config/environment');var db=require(_0x4f66('0x17'))['db'];function respondWithStatusCode(_0x3d67a9,_0x1d3e24){_0x1d3e24=_0x1d3e24||0xcc;return function(_0x53c576){if(_0x53c576){return _0x3d67a9[_0x4f66('0x18')](_0x1d3e24);}return _0x3d67a9[_0x4f66('0x19')](_0x1d3e24)[_0x4f66('0x1a')]();};}function respondWithResult(_0x506de1,_0x1793c9){_0x1793c9=_0x1793c9||0xc8;return function(_0x56a331){if(_0x56a331){return _0x506de1[_0x4f66('0x19')](_0x1793c9)[_0x4f66('0x1b')](_0x56a331);}};}function respondWithFilteredResult(_0x6bb40c,_0x195bf0){return function(_0xa84fa3){if(_0xa84fa3){var _0x2754ec=_0xa84fa3[_0x4f66('0x1c')],_0x7cf064=_0x195bf0[_0x4f66('0x1d')],_0x2663ff=_0x195bf0[_0x4f66('0x1d')]+_0x195bf0[_0x4f66('0x1e')],_0x27a7bd;if(_0x2663ff>=_0x2754ec){_0x2663ff=_0x2754ec;_0x27a7bd=0xc8;}else{_0x27a7bd=0xce;}_0x6bb40c[_0x4f66('0x19')](_0x27a7bd);return _0x6bb40c['set'](_0x4f66('0x1f'),_0x7cf064+'-'+_0x2663ff+'/'+_0x2754ec)[_0x4f66('0x1b')](_0xa84fa3);}return null;};}function patchUpdates(_0x2e7713){return function(_0x239f47){try{jsonpatch[_0x4f66('0x20')](_0x239f47,_0x2e7713,!![]);}catch(_0x50ad26){return BPromise[_0x4f66('0x21')](_0x50ad26);}return _0x239f47[_0x4f66('0x22')]();};}function saveUpdates(_0x59dc7a,_0x5bdaca){return function(_0x21286e){if(_0x21286e){return _0x21286e[_0x4f66('0x23')](_0x59dc7a)[_0x4f66('0x24')](function(_0x1eba82){return _0x1eba82;});}return null;};}function removeEntity(_0x5e2bea,_0x458b9d){return function(_0x19c876){if(_0x19c876){return _0x19c876['destroy']()[_0x4f66('0x24')](function(){_0x5e2bea[_0x4f66('0x19')](0xcc)[_0x4f66('0x1a')]();});}};}function handleEntityNotFound(_0x5b3952,_0x2ba4aa){return function(_0x13e7e8){if(!_0x13e7e8){_0x5b3952[_0x4f66('0x18')](0x194);}return _0x13e7e8;};}function handleError(_0x207f41,_0x254196){_0x254196=_0x254196||0x1f4;return function(_0x50ad5f){logger[_0x4f66('0x25')](_0x50ad5f['stack']);if(_0x50ad5f[_0x4f66('0x26')]){delete _0x50ad5f[_0x4f66('0x26')];}_0x207f41[_0x4f66('0x19')](_0x254196)[_0x4f66('0x27')](_0x50ad5f);};}exports[_0x4f66('0x28')]=function(_0xb0b5bf,_0x48e494){var _0x24cb60={},_0x342dc0={},_0x313a24={'count':0x0,'rows':[]};var _0x2179e=_[_0x4f66('0x29')](db[_0x4f66('0x2a')][_0x4f66('0x2b')],function(_0x3315c8){return{'name':_0x3315c8[_0x4f66('0x2c')],'type':_0x3315c8[_0x4f66('0x2d')][_0x4f66('0x2e')]};});_0x342dc0[_0x4f66('0x2f')]=_[_0x4f66('0x29')](_0x2179e,_0x4f66('0x26'));_0x342dc0[_0x4f66('0x30')]=_[_0x4f66('0x31')](_0xb0b5bf['query']);_0x342dc0[_0x4f66('0x32')]=_[_0x4f66('0x33')](_0x342dc0['model'],_0x342dc0[_0x4f66('0x30')]);_0x24cb60[_0x4f66('0x34')]=_['intersection'](_0x342dc0[_0x4f66('0x2f')],qs[_0x4f66('0x35')](_0xb0b5bf[_0x4f66('0x30')]['fields']));_0x24cb60[_0x4f66('0x34')]=_0x24cb60[_0x4f66('0x34')][_0x4f66('0x36')]?_0x24cb60[_0x4f66('0x34')]:_0x342dc0[_0x4f66('0x2f')];if(!_0xb0b5bf[_0x4f66('0x30')][_0x4f66('0x37')](_0x4f66('0x38'))){_0x24cb60[_0x4f66('0x1e')]=qs[_0x4f66('0x1e')](_0xb0b5bf[_0x4f66('0x30')][_0x4f66('0x1e')]);_0x24cb60['offset']=qs[_0x4f66('0x1d')](_0xb0b5bf[_0x4f66('0x30')]['offset']);}_0x24cb60['order']=qs[_0x4f66('0x39')](_0xb0b5bf['query'][_0x4f66('0x39')]);_0x24cb60[_0x4f66('0x3a')]=qs[_0x4f66('0x32')](_[_0x4f66('0x3b')](_0xb0b5bf[_0x4f66('0x30')],_0x342dc0['filters']),_0x2179e);if(_0xb0b5bf[_0x4f66('0x30')][_0x4f66('0x3c')]){_0x24cb60[_0x4f66('0x3a')]=_[_0x4f66('0x3d')](_0x24cb60['where'],{'$or':_[_0x4f66('0x29')](_0x2179e,function(_0x58fa2e){if(_0x58fa2e['type']!==_0x4f66('0x3e')){var _0x46ccb3={};_0x46ccb3[_0x58fa2e['name']]={'$like':'%'+_0xb0b5bf[_0x4f66('0x30')]['filter']+'%'};return _0x46ccb3;}})});}_0x24cb60=_[_0x4f66('0x3d')]({},_0x24cb60,_0xb0b5bf[_0x4f66('0x3f')]);var _0x106f99={'where':_0x24cb60['where']};return db[_0x4f66('0x2a')]['count'](_0x106f99)[_0x4f66('0x24')](function(_0x547b06){_0x313a24[_0x4f66('0x1c')]=_0x547b06;if(_0xb0b5bf[_0x4f66('0x30')][_0x4f66('0x40')]){_0x24cb60[_0x4f66('0x41')]=[{'all':!![]}];}return db[_0x4f66('0x2a')]['findAll'](_0x24cb60);})[_0x4f66('0x24')](function(_0x228776){_0x313a24['rows']=_0x228776;return _0x313a24;})['then'](respondWithFilteredResult(_0x48e494,_0x24cb60))[_0x4f66('0x42')](handleError(_0x48e494,null));};exports[_0x4f66('0x43')]=function(_0x2d26d8,_0x3cbbe8){var _0x43cf6a={'raw':!![],'where':{'id':_0x2d26d8[_0x4f66('0x44')]['id']}},_0x50828f={};_0x50828f[_0x4f66('0x2f')]=_[_0x4f66('0x31')](db[_0x4f66('0x2a')][_0x4f66('0x2b')]);_0x50828f[_0x4f66('0x30')]=_[_0x4f66('0x31')](_0x2d26d8[_0x4f66('0x30')]);_0x50828f[_0x4f66('0x32')]=_[_0x4f66('0x33')](_0x50828f['model'],_0x50828f[_0x4f66('0x30')]);_0x43cf6a[_0x4f66('0x34')]=_[_0x4f66('0x33')](_0x50828f[_0x4f66('0x2f')],qs['fields'](_0x2d26d8[_0x4f66('0x30')]['fields']));_0x43cf6a['attributes']=_0x43cf6a[_0x4f66('0x34')]['length']?_0x43cf6a[_0x4f66('0x34')]:_0x50828f[_0x4f66('0x2f')];if(_0x2d26d8['query']['includeAll']){_0x43cf6a[_0x4f66('0x41')]=[{'all':!![]}];}_0x43cf6a=_[_0x4f66('0x3d')]({},_0x43cf6a,_0x2d26d8[_0x4f66('0x3f')]);return db[_0x4f66('0x2a')]['find'](_0x43cf6a)[_0x4f66('0x24')](handleEntityNotFound(_0x3cbbe8,null))[_0x4f66('0x24')](respondWithResult(_0x3cbbe8,null))[_0x4f66('0x42')](handleError(_0x3cbbe8,null));};exports[_0x4f66('0x45')]=function(_0x31ef4d,_0x2f7b90){return db['JscriptySessionReport'][_0x4f66('0x45')](_0x31ef4d[_0x4f66('0x46')],{})[_0x4f66('0x24')](respondWithResult(_0x2f7b90,0xc9))['catch'](handleError(_0x2f7b90,null));};exports[_0x4f66('0x23')]=function(_0x1f8a9e,_0x2c271a){if(_0x1f8a9e['body']['id']){delete _0x1f8a9e[_0x4f66('0x46')]['id'];}return db[_0x4f66('0x2a')]['find']({'where':{'id':_0x1f8a9e[_0x4f66('0x44')]['id']}})[_0x4f66('0x24')](handleEntityNotFound(_0x2c271a,null))[_0x4f66('0x24')](saveUpdates(_0x1f8a9e[_0x4f66('0x46')],null))[_0x4f66('0x24')](respondWithResult(_0x2c271a,null))[_0x4f66('0x42')](handleError(_0x2c271a,null));};exports[_0x4f66('0x47')]=function(_0x5b5f1a,_0x192809){return db['JscriptySessionReport'][_0x4f66('0x48')]({'where':{'id':_0x5b5f1a[_0x4f66('0x44')]['id']}})[_0x4f66('0x24')](handleEntityNotFound(_0x192809,null))[_0x4f66('0x24')](removeEntity(_0x192809,null))[_0x4f66('0x42')](handleError(_0x192809,null));};exports[_0x4f66('0x49')]=function(_0x442646,_0x3dcbba){return db['JscriptySessionReport'][_0x4f66('0x49')]()[_0x4f66('0x24')](respondWithResult(_0x3dcbba,null))[_0x4f66('0x42')](handleError(_0x3dcbba,null));};exports[_0x4f66('0x4a')]=function(_0x2e8f6f,_0x30c88a,_0x523f57){var _0x176e66={'raw':!![],'where':{}};var _0x36bbf7={};var _0x432722={'count':0x0,'rows':[]};return db[_0x4f66('0x2a')][_0x4f66('0x4b')]({'where':{'id':_0x2e8f6f[_0x4f66('0x44')]['id']}})[_0x4f66('0x24')](handleEntityNotFound(_0x30c88a,null))['then'](function(_0x18efe8){if(_0x18efe8){_0x36bbf7[_0x4f66('0x2f')]=_[_0x4f66('0x31')](db[_0x4f66('0x4c')][_0x4f66('0x2b')]);_0x36bbf7[_0x4f66('0x30')]=_['keys'](_0x2e8f6f['query']);_0x36bbf7[_0x4f66('0x32')]=_[_0x4f66('0x33')](_0x36bbf7[_0x4f66('0x2f')],_0x36bbf7[_0x4f66('0x30')]);_0x176e66[_0x4f66('0x34')]=_[_0x4f66('0x33')](_0x36bbf7[_0x4f66('0x2f')],qs[_0x4f66('0x35')](_0x2e8f6f[_0x4f66('0x30')][_0x4f66('0x35')]));_0x176e66[_0x4f66('0x34')]=_0x176e66[_0x4f66('0x34')][_0x4f66('0x36')]?_0x176e66[_0x4f66('0x34')]:_0x36bbf7['model'];if(!_0x2e8f6f['query'][_0x4f66('0x37')](_0x4f66('0x38'))){_0x176e66['limit']=qs[_0x4f66('0x1e')](_0x2e8f6f['query']['limit']);_0x176e66[_0x4f66('0x1d')]=qs[_0x4f66('0x1d')](_0x2e8f6f['query'][_0x4f66('0x1d')]);}_0x176e66['order']=qs[_0x4f66('0x39')](_0x2e8f6f[_0x4f66('0x30')][_0x4f66('0x39')]);_0x176e66[_0x4f66('0x3a')]=qs[_0x4f66('0x32')](_[_0x4f66('0x3b')](_0x2e8f6f[_0x4f66('0x30')],_0x36bbf7[_0x4f66('0x32')]));_0x176e66[_0x4f66('0x3a')]['SessionId']=_0x18efe8['id'];if(_0x2e8f6f['query'][_0x4f66('0x3c')]){_0x176e66[_0x4f66('0x3a')]=_[_0x4f66('0x3d')](_0x176e66[_0x4f66('0x3a')],{'$or':_[_0x4f66('0x29')](_0x176e66[_0x4f66('0x34')],function(_0x38e838){var _0x2ce21e={};_0x2ce21e[_0x38e838]={'$like':'%'+_0x2e8f6f[_0x4f66('0x30')][_0x4f66('0x3c')]+'%'};return _0x2ce21e;})});}_0x176e66=_['merge']({},_0x176e66,_0x2e8f6f[_0x4f66('0x3f')]);return db[_0x4f66('0x4c')]['count']({'where':_0x176e66[_0x4f66('0x3a')]})[_0x4f66('0x24')](function(_0x132ff8){_0x432722['count']=_0x132ff8;if(_0x2e8f6f[_0x4f66('0x30')][_0x4f66('0x40')]){_0x176e66['include']=[{'all':!![]}];}return db[_0x4f66('0x4c')][_0x4f66('0x4d')](_0x176e66);})[_0x4f66('0x24')](function(_0x27c083){_0x432722[_0x4f66('0x4e')]=_0x27c083;return _0x432722;});}})[_0x4f66('0x24')](respondWithFilteredResult(_0x30c88a,_0x176e66))['catch'](handleError(_0x30c88a,null));};
\ No newline at end of file