Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 5e4e96d..5da4a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa985=['name','JscriptySessionReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','limit','order','where','merge','filter','includeAll','findAll','rows','catch','params','fields','include','options','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','sort','pick','SessionId','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0xf5ec57,_0x6b1180){var _0xaa0598=function(_0x2440c9){while(--_0x2440c9){_0xf5ec57['push'](_0xf5ec57['shift']());}};_0xaa0598(++_0x6b1180);}(_0xa985,0x105));var _0x5a98=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xa985[_0x599e60];return _0x468e19;};'use strict';var pdf=require(_0x5a98('0x0'));var emlformat=require(_0x5a98('0x1'));var rimraf=require(_0x5a98('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a98('0x3'));var rp=require(_0x5a98('0x4'));var moment=require('moment');var BPromise=require(_0x5a98('0x5'));var Mustache=require(_0x5a98('0x6'));var util=require(_0x5a98('0x7'));var path=require('path');var sox=require(_0x5a98('0x8'));var csv=require('to-csv');var ejs=require(_0x5a98('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5a98('0xa'));var crypto=require(_0x5a98('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a98('0xc'));var toCsv=require(_0x5a98('0xd'));var querystring=require(_0x5a98('0xe'));var Papa=require(_0x5a98('0xf'));var Redis=require('ioredis');var authService=require(_0x5a98('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5a98('0x11'));var hardwareService=require(_0x5a98('0x12'));var logger=require('../../config/logger')(_0x5a98('0x13'));var utils=require('../../config/utils');var config=require(_0x5a98('0x14'));var db=require(_0x5a98('0x15'))['db'];function respondWithStatusCode(_0x5db1ad,_0x3ffc5e){_0x3ffc5e=_0x3ffc5e||0xcc;return function(_0x2b1113){if(_0x2b1113){return _0x5db1ad[_0x5a98('0x16')](_0x3ffc5e);}return _0x5db1ad[_0x5a98('0x17')](_0x3ffc5e)[_0x5a98('0x18')]();};}function respondWithResult(_0xce6a8a,_0x3850d9){_0x3850d9=_0x3850d9||0xc8;return function(_0x5ae1f5){if(_0x5ae1f5){return _0xce6a8a['status'](_0x3850d9)['json'](_0x5ae1f5);}};}function respondWithFilteredResult(_0x4c3a3e,_0x4424aa){return function(_0x3a660f){if(_0x3a660f){var _0x5206e8=_0x3a660f[_0x5a98('0x19')],_0x2882b1=_0x4424aa['offset'],_0x2c8cf8=_0x4424aa[_0x5a98('0x1a')]+_0x4424aa['limit'],_0x44fe60;if(_0x2c8cf8>=_0x5206e8){_0x2c8cf8=_0x5206e8;_0x44fe60=0xc8;}else{_0x44fe60=0xce;}_0x4c3a3e[_0x5a98('0x17')](_0x44fe60);return _0x4c3a3e[_0x5a98('0x1b')](_0x5a98('0x1c'),_0x2882b1+'-'+_0x2c8cf8+'/'+_0x5206e8)['json'](_0x3a660f);}return null;};}function patchUpdates(_0x322a70){return function(_0x2eea9a){try{jsonpatch[_0x5a98('0x1d')](_0x2eea9a,_0x322a70,!![]);}catch(_0x244c70){return BPromise[_0x5a98('0x1e')](_0x244c70);}return _0x2eea9a[_0x5a98('0x1f')]();};}function saveUpdates(_0x5b4d0b,_0x1be507){return function(_0x926711){if(_0x926711){return _0x926711['update'](_0x5b4d0b)[_0x5a98('0x20')](function(_0x389d41){return _0x389d41;});}return null;};}function removeEntity(_0x287d70,_0x2a3ecf){return function(_0xbb7ad6){if(_0xbb7ad6){return _0xbb7ad6['destroy']()[_0x5a98('0x20')](function(){_0x287d70[_0x5a98('0x17')](0xcc)[_0x5a98('0x18')]();});}};}function handleEntityNotFound(_0x45d7a7,_0x28010a){return function(_0x4423a7){if(!_0x4423a7){_0x45d7a7[_0x5a98('0x16')](0x194);}return _0x4423a7;};}function handleError(_0x29e3de,_0x32f40e){_0x32f40e=_0x32f40e||0x1f4;return function(_0x13beeb){logger[_0x5a98('0x21')](_0x13beeb[_0x5a98('0x22')]);if(_0x13beeb['name']){delete _0x13beeb[_0x5a98('0x23')];}_0x29e3de[_0x5a98('0x17')](_0x32f40e)['send'](_0x13beeb);};}exports['index']=function(_0x1a43b8,_0x1ffaed){var _0x31a005={},_0x5c45ea={},_0x33534f={'count':0x0,'rows':[]};var _0x501dcb=_['map'](db[_0x5a98('0x24')][_0x5a98('0x25')],function(_0x869ab6){return{'name':_0x869ab6[_0x5a98('0x26')],'type':_0x869ab6['type'][_0x5a98('0x27')]};});_0x5c45ea[_0x5a98('0x28')]=_[_0x5a98('0x29')](_0x501dcb,_0x5a98('0x23'));_0x5c45ea[_0x5a98('0x2a')]=_[_0x5a98('0x2b')](_0x1a43b8[_0x5a98('0x2a')]);_0x5c45ea[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x5c45ea[_0x5a98('0x28')],_0x5c45ea[_0x5a98('0x2a')]);_0x31a005[_0x5a98('0x2e')]=_['intersection'](_0x5c45ea['model'],qs['fields'](_0x1a43b8[_0x5a98('0x2a')]['fields']));_0x31a005['attributes']=_0x31a005['attributes'][_0x5a98('0x2f')]?_0x31a005[_0x5a98('0x2e')]:_0x5c45ea[_0x5a98('0x28')];if(!_0x1a43b8[_0x5a98('0x2a')]['hasOwnProperty'](_0x5a98('0x30'))){_0x31a005[_0x5a98('0x31')]=qs['limit'](_0x1a43b8[_0x5a98('0x2a')]['limit']);_0x31a005[_0x5a98('0x1a')]=qs[_0x5a98('0x1a')](_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x1a')]);}_0x31a005[_0x5a98('0x32')]=qs['sort'](_0x1a43b8[_0x5a98('0x2a')]['sort']);_0x31a005[_0x5a98('0x33')]=qs[_0x5a98('0x2c')](_['pick'](_0x1a43b8[_0x5a98('0x2a')],_0x5c45ea[_0x5a98('0x2c')]),_0x501dcb);if(_0x1a43b8[_0x5a98('0x2a')]['filter']){_0x31a005[_0x5a98('0x33')]=_[_0x5a98('0x34')](_0x31a005[_0x5a98('0x33')],{'$or':_['map'](_0x501dcb,function(_0x49e20b){if(_0x49e20b['type']!=='VIRTUAL'){var _0xffead2={};_0xffead2[_0x49e20b[_0x5a98('0x23')]]={'$like':'%'+_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x35')]+'%'};return _0xffead2;}})});}_0x31a005=_['merge']({},_0x31a005,_0x1a43b8['options']);var _0x4edd8f={'where':_0x31a005[_0x5a98('0x33')]};return db['JscriptySessionReport'][_0x5a98('0x19')](_0x4edd8f)['then'](function(_0x2942aa){_0x33534f[_0x5a98('0x19')]=_0x2942aa;if(_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x31a005['include']=[{'all':!![]}];}return db[_0x5a98('0x24')][_0x5a98('0x37')](_0x31a005);})['then'](function(_0x4e3bcf){_0x33534f[_0x5a98('0x38')]=_0x4e3bcf;return _0x33534f;})[_0x5a98('0x20')](respondWithFilteredResult(_0x1ffaed,_0x31a005))[_0x5a98('0x39')](handleError(_0x1ffaed,null));};exports['show']=function(_0x38833b,_0x12bf4b){var _0x17303b={'raw':!![],'where':{'id':_0x38833b[_0x5a98('0x3a')]['id']}},_0x3f5f9d={};_0x3f5f9d[_0x5a98('0x28')]=_[_0x5a98('0x2b')](db[_0x5a98('0x24')]['rawAttributes']);_0x3f5f9d['query']=_[_0x5a98('0x2b')](_0x38833b[_0x5a98('0x2a')]);_0x3f5f9d[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x3f5f9d[_0x5a98('0x28')],_0x3f5f9d[_0x5a98('0x2a')]);_0x17303b[_0x5a98('0x2e')]=_[_0x5a98('0x2d')](_0x3f5f9d['model'],qs[_0x5a98('0x3b')](_0x38833b['query'][_0x5a98('0x3b')]));_0x17303b[_0x5a98('0x2e')]=_0x17303b[_0x5a98('0x2e')]['length']?_0x17303b[_0x5a98('0x2e')]:_0x3f5f9d['model'];if(_0x38833b[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x17303b[_0x5a98('0x3c')]=[{'all':!![]}];}_0x17303b=_[_0x5a98('0x34')]({},_0x17303b,_0x38833b[_0x5a98('0x3d')]);return db[_0x5a98('0x24')][_0x5a98('0x3e')](_0x17303b)[_0x5a98('0x20')](handleEntityNotFound(_0x12bf4b,null))[_0x5a98('0x20')](respondWithResult(_0x12bf4b,null))['catch'](handleError(_0x12bf4b,null));};exports[_0x5a98('0x3f')]=function(_0xbcf40e,_0x4981c7){return db[_0x5a98('0x24')][_0x5a98('0x3f')](_0xbcf40e[_0x5a98('0x40')],{})[_0x5a98('0x20')](respondWithResult(_0x4981c7,0xc9))[_0x5a98('0x39')](handleError(_0x4981c7,null));};exports['update']=function(_0x2609e1,_0x51c453){if(_0x2609e1[_0x5a98('0x40')]['id']){delete _0x2609e1[_0x5a98('0x40')]['id'];}return db['JscriptySessionReport'][_0x5a98('0x3e')]({'where':{'id':_0x2609e1['params']['id']}})['then'](handleEntityNotFound(_0x51c453,null))[_0x5a98('0x20')](saveUpdates(_0x2609e1[_0x5a98('0x40')],null))[_0x5a98('0x20')](respondWithResult(_0x51c453,null))['catch'](handleError(_0x51c453,null));};exports[_0x5a98('0x41')]=function(_0x3adba4,_0x5b0177){return db[_0x5a98('0x24')][_0x5a98('0x3e')]({'where':{'id':_0x3adba4['params']['id']}})['then'](handleEntityNotFound(_0x5b0177,null))[_0x5a98('0x20')](removeEntity(_0x5b0177,null))['catch'](handleError(_0x5b0177,null));};exports['describe']=function(_0x10deaa,_0x8861ae){return db[_0x5a98('0x24')][_0x5a98('0x42')]()[_0x5a98('0x20')](respondWithResult(_0x8861ae,null))['catch'](handleError(_0x8861ae,null));};exports[_0x5a98('0x43')]=function(_0x12bd6c,_0x35d9e9,_0xcd2423){var _0x5a2e03={'raw':!![],'where':{}};var _0x2b2736={};var _0x649fde={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x5a98('0x44')]({'where':{'id':_0x12bd6c['params']['id']}})[_0x5a98('0x20')](handleEntityNotFound(_0x35d9e9,null))[_0x5a98('0x20')](function(_0xcece02){if(_0xcece02){_0x2b2736[_0x5a98('0x28')]=_['keys'](db[_0x5a98('0x45')][_0x5a98('0x25')]);_0x2b2736['query']=_[_0x5a98('0x2b')](_0x12bd6c[_0x5a98('0x2a')]);_0x2b2736[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x2b2736[_0x5a98('0x28')],_0x2b2736[_0x5a98('0x2a')]);_0x5a2e03[_0x5a98('0x2e')]=_['intersection'](_0x2b2736[_0x5a98('0x28')],qs[_0x5a98('0x3b')](_0x12bd6c['query'][_0x5a98('0x3b')]));_0x5a2e03[_0x5a98('0x2e')]=_0x5a2e03['attributes'][_0x5a98('0x2f')]?_0x5a2e03[_0x5a98('0x2e')]:_0x2b2736[_0x5a98('0x28')];if(!_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x46')](_0x5a98('0x30'))){_0x5a2e03[_0x5a98('0x31')]=qs[_0x5a98('0x31')](_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x31')]);_0x5a2e03[_0x5a98('0x1a')]=qs[_0x5a98('0x1a')](_0x12bd6c[_0x5a98('0x2a')]['offset']);}_0x5a2e03['order']=qs[_0x5a98('0x47')](_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x47')]);_0x5a2e03[_0x5a98('0x33')]=qs['filters'](_[_0x5a98('0x48')](_0x12bd6c['query'],_0x2b2736[_0x5a98('0x2c')]));_0x5a2e03['where'][_0x5a98('0x49')]=_0xcece02['id'];if(_0x12bd6c['query'][_0x5a98('0x35')]){_0x5a2e03[_0x5a98('0x33')]=_['merge'](_0x5a2e03[_0x5a98('0x33')],{'$or':_[_0x5a98('0x29')](_0x5a2e03[_0x5a98('0x2e')],function(_0x1515d3){var _0x34536d={};_0x34536d[_0x1515d3]={'$like':'%'+_0x12bd6c[_0x5a98('0x2a')]['filter']+'%'};return _0x34536d;})});}_0x5a2e03=_['merge']({},_0x5a2e03,_0x12bd6c['options']);return db[_0x5a98('0x45')]['count']({'where':_0x5a2e03[_0x5a98('0x33')]})[_0x5a98('0x20')](function(_0x279c66){_0x649fde[_0x5a98('0x19')]=_0x279c66;if(_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x5a2e03['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5a98('0x37')](_0x5a2e03);})[_0x5a98('0x20')](function(_0x16981b){_0x649fde[_0x5a98('0x38')]=_0x16981b;return _0x649fde;});}})['then'](respondWithFilteredResult(_0x35d9e9,_0x5a2e03))['catch'](handleError(_0x35d9e9,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