Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index d684d80..5da4a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a75=['then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5d07bb,_0x271464){var _0x42960a=function(_0x2f0724){while(--_0x2f0724){_0x5d07bb['push'](_0x5d07bb['shift']());}};_0x42960a(++_0x271464);}(_0x0a75,0xcd));var _0x50a7=function(_0x1f1fe5,_0x132821){_0x1f1fe5=_0x1f1fe5-0x0;var _0x4693c2=_0x0a75[_0x1f1fe5];return _0x4693c2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x50a7('0x0'));var zipdir=require(_0x50a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50a7('0x2'));var moment=require(_0x50a7('0x3'));var BPromise=require(_0x50a7('0x4'));var Mustache=require(_0x50a7('0x5'));var util=require(_0x50a7('0x6'));var path=require(_0x50a7('0x7'));var sox=require(_0x50a7('0x8'));var csv=require('to-csv');var ejs=require(_0x50a7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50a7('0xa'));var crypto=require(_0x50a7('0xb'));var jsforce=require(_0x50a7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x50a7('0xd'));var querystring=require(_0x50a7('0xe'));var Papa=require(_0x50a7('0xf'));var Redis=require(_0x50a7('0x10'));var authService=require(_0x50a7('0x11'));var qs=require(_0x50a7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50a7('0x13'));var logger=require(_0x50a7('0x14'))('api');var utils=require(_0x50a7('0x15'));var config=require(_0x50a7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39d80c,_0x3e107c){_0x3e107c=_0x3e107c||0xcc;return function(_0x4439c4){if(_0x4439c4){return _0x39d80c[_0x50a7('0x17')](_0x3e107c);}return _0x39d80c[_0x50a7('0x18')](_0x3e107c)[_0x50a7('0x19')]();};}function respondWithResult(_0x4c66f0,_0x171048){_0x171048=_0x171048||0xc8;return function(_0x83677a){if(_0x83677a){return _0x4c66f0[_0x50a7('0x18')](_0x171048)[_0x50a7('0x1a')](_0x83677a);}};}function respondWithFilteredResult(_0x3b6f91,_0x5e5b7e){return function(_0x52fdb6){if(_0x52fdb6){var _0x22fc1c=_0x52fdb6[_0x50a7('0x1b')],_0x2fba50=_0x5e5b7e[_0x50a7('0x1c')],_0x100b74=_0x5e5b7e[_0x50a7('0x1c')]+_0x5e5b7e[_0x50a7('0x1d')],_0x7be5e0;if(_0x100b74>=_0x22fc1c){_0x100b74=_0x22fc1c;_0x7be5e0=0xc8;}else{_0x7be5e0=0xce;}_0x3b6f91['status'](_0x7be5e0);return _0x3b6f91[_0x50a7('0x1e')](_0x50a7('0x1f'),_0x2fba50+'-'+_0x100b74+'/'+_0x22fc1c)[_0x50a7('0x1a')](_0x52fdb6);}return null;};}function patchUpdates(_0x261ce3){return function(_0x58fef1){try{jsonpatch[_0x50a7('0x20')](_0x58fef1,_0x261ce3,!![]);}catch(_0x56cf3d){return BPromise[_0x50a7('0x21')](_0x56cf3d);}return _0x58fef1[_0x50a7('0x22')]();};}function saveUpdates(_0xa4e6dc,_0x5dede2){return function(_0x3203b1){if(_0x3203b1){return _0x3203b1['update'](_0xa4e6dc)[_0x50a7('0x23')](function(_0x287da8){return _0x287da8;});}return null;};}function removeEntity(_0x5b3e2a,_0x46b77c){return function(_0x475db5){if(_0x475db5){return _0x475db5['destroy']()[_0x50a7('0x23')](function(){_0x5b3e2a['status'](0xcc)[_0x50a7('0x19')]();});}};}function handleEntityNotFound(_0x3f713f,_0x47dcf7){return function(_0x305d77){if(!_0x305d77){_0x3f713f[_0x50a7('0x17')](0x194);}return _0x305d77;};}function handleError(_0x244344,_0x47bf09){_0x47bf09=_0x47bf09||0x1f4;return function(_0x361bd7){logger[_0x50a7('0x24')](_0x361bd7[_0x50a7('0x25')]);if(_0x361bd7['name']){delete _0x361bd7[_0x50a7('0x26')];}_0x244344['status'](_0x47bf09)[_0x50a7('0x27')](_0x361bd7);};}exports[_0x50a7('0x28')]=function(_0x2e9dbb,_0x56d649){var _0x1c870a={},_0x1b409e={},_0x46d986={'count':0x0,'rows':[]};var _0x3f6a66=_[_0x50a7('0x29')](db[_0x50a7('0x2a')][_0x50a7('0x2b')],function(_0x54d7ac){return{'name':_0x54d7ac[_0x50a7('0x2c')],'type':_0x54d7ac[_0x50a7('0x2d')][_0x50a7('0x2e')]};});_0x1b409e['model']=_[_0x50a7('0x29')](_0x3f6a66,_0x50a7('0x26'));_0x1b409e[_0x50a7('0x2f')]=_[_0x50a7('0x30')](_0x2e9dbb['query']);_0x1b409e[_0x50a7('0x31')]=_[_0x50a7('0x32')](_0x1b409e['model'],_0x1b409e[_0x50a7('0x2f')]);_0x1c870a[_0x50a7('0x33')]=_[_0x50a7('0x32')](_0x1b409e[_0x50a7('0x34')],qs[_0x50a7('0x35')](_0x2e9dbb[_0x50a7('0x2f')][_0x50a7('0x35')]));_0x1c870a[_0x50a7('0x33')]=_0x1c870a[_0x50a7('0x33')][_0x50a7('0x36')]?_0x1c870a[_0x50a7('0x33')]:_0x1b409e[_0x50a7('0x34')];if(!_0x2e9dbb[_0x50a7('0x2f')][_0x50a7('0x37')](_0x50a7('0x38'))){_0x1c870a['limit']=qs['limit'](_0x2e9dbb[_0x50a7('0x2f')]['limit']);_0x1c870a['offset']=qs[_0x50a7('0x1c')](_0x2e9dbb['query'][_0x50a7('0x1c')]);}_0x1c870a['order']=qs[_0x50a7('0x39')](_0x2e9dbb['query'][_0x50a7('0x39')]);_0x1c870a[_0x50a7('0x3a')]=qs[_0x50a7('0x31')](_[_0x50a7('0x3b')](_0x2e9dbb['query'],_0x1b409e[_0x50a7('0x31')]));if(_0x2e9dbb[_0x50a7('0x2f')][_0x50a7('0x3c')]){_0x1c870a[_0x50a7('0x3a')]=_[_0x50a7('0x3d')](_0x1c870a['where'],{'$or':_[_0x50a7('0x29')](_0x3f6a66,function(_0x25ca58){if(_0x25ca58[_0x50a7('0x2d')]!=='VIRTUAL'){var _0x2a29ab={};_0x2a29ab[_0x25ca58[_0x50a7('0x26')]]={'$like':'%'+_0x2e9dbb[_0x50a7('0x2f')][_0x50a7('0x3c')]+'%'};return _0x2a29ab;}})});}_0x1c870a=_['merge']({},_0x1c870a,_0x2e9dbb['options']);var _0x4302b1={'where':_0x1c870a[_0x50a7('0x3a')]};return db['JscriptySessionReport'][_0x50a7('0x1b')](_0x4302b1)[_0x50a7('0x23')](function(_0x999987){_0x46d986[_0x50a7('0x1b')]=_0x999987;if(_0x2e9dbb['query'][_0x50a7('0x3e')]){_0x1c870a[_0x50a7('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x50a7('0x40')](_0x1c870a);})['then'](function(_0x532487){_0x46d986[_0x50a7('0x41')]=_0x532487;return _0x46d986;})[_0x50a7('0x23')](respondWithFilteredResult(_0x56d649,_0x1c870a))[_0x50a7('0x42')](handleError(_0x56d649,null));};exports['show']=function(_0x28c760,_0x44b1f8){var _0x9b5393={'raw':!![],'where':{'id':_0x28c760[_0x50a7('0x43')]['id']}},_0x497cd7={};_0x497cd7['model']=_['keys'](db[_0x50a7('0x2a')][_0x50a7('0x2b')]);_0x497cd7[_0x50a7('0x2f')]=_[_0x50a7('0x30')](_0x28c760['query']);_0x497cd7[_0x50a7('0x31')]=_[_0x50a7('0x32')](_0x497cd7['model'],_0x497cd7[_0x50a7('0x2f')]);_0x9b5393[_0x50a7('0x33')]=_['intersection'](_0x497cd7['model'],qs['fields'](_0x28c760[_0x50a7('0x2f')][_0x50a7('0x35')]));_0x9b5393[_0x50a7('0x33')]=_0x9b5393['attributes'][_0x50a7('0x36')]?_0x9b5393[_0x50a7('0x33')]:_0x497cd7[_0x50a7('0x34')];if(_0x28c760[_0x50a7('0x2f')][_0x50a7('0x3e')]){_0x9b5393[_0x50a7('0x3f')]=[{'all':!![]}];}_0x9b5393=_[_0x50a7('0x3d')]({},_0x9b5393,_0x28c760[_0x50a7('0x44')]);return db[_0x50a7('0x2a')][_0x50a7('0x45')](_0x9b5393)[_0x50a7('0x23')](handleEntityNotFound(_0x44b1f8,null))[_0x50a7('0x23')](respondWithResult(_0x44b1f8,null))[_0x50a7('0x42')](handleError(_0x44b1f8,null));};exports[_0x50a7('0x46')]=function(_0x4f893b,_0x1590da){return db[_0x50a7('0x2a')][_0x50a7('0x46')](_0x4f893b[_0x50a7('0x47')],{})['then'](respondWithResult(_0x1590da,0xc9))[_0x50a7('0x42')](handleError(_0x1590da,null));};exports[_0x50a7('0x48')]=function(_0x2f17c8,_0x4beb69){if(_0x2f17c8['body']['id']){delete _0x2f17c8[_0x50a7('0x47')]['id'];}return db[_0x50a7('0x2a')]['find']({'where':{'id':_0x2f17c8[_0x50a7('0x43')]['id']}})[_0x50a7('0x23')](handleEntityNotFound(_0x4beb69,null))[_0x50a7('0x23')](saveUpdates(_0x2f17c8['body'],null))[_0x50a7('0x23')](respondWithResult(_0x4beb69,null))['catch'](handleError(_0x4beb69,null));};exports[_0x50a7('0x49')]=function(_0x1645e8,_0x21f862){return db[_0x50a7('0x2a')]['find']({'where':{'id':_0x1645e8[_0x50a7('0x43')]['id']}})[_0x50a7('0x23')](handleEntityNotFound(_0x21f862,null))['then'](removeEntity(_0x21f862,null))[_0x50a7('0x42')](handleError(_0x21f862,null));};exports[_0x50a7('0x4a')]=function(_0xc796a5,_0xef5bd2){return db[_0x50a7('0x2a')]['describe']()['then'](respondWithResult(_0xef5bd2,null))[_0x50a7('0x42')](handleError(_0xef5bd2,null));};exports[_0x50a7('0x4b')]=function(_0x3c63f8,_0x1ab5f7,_0x58f58d){var _0x34353c={'raw':!![],'where':{}};var _0x475058={};var _0x1dc9c0={'count':0x0,'rows':[]};return db[_0x50a7('0x2a')][_0x50a7('0x4c')]({'where':{'id':_0x3c63f8['params']['id']}})[_0x50a7('0x23')](handleEntityNotFound(_0x1ab5f7,null))[_0x50a7('0x23')](function(_0x2e19f6){if(_0x2e19f6){_0x475058[_0x50a7('0x34')]=_[_0x50a7('0x30')](db[_0x50a7('0x4d')]['rawAttributes']);_0x475058[_0x50a7('0x2f')]=_[_0x50a7('0x30')](_0x3c63f8[_0x50a7('0x2f')]);_0x475058[_0x50a7('0x31')]=_[_0x50a7('0x32')](_0x475058[_0x50a7('0x34')],_0x475058[_0x50a7('0x2f')]);_0x34353c['attributes']=_[_0x50a7('0x32')](_0x475058[_0x50a7('0x34')],qs['fields'](_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x35')]));_0x34353c[_0x50a7('0x33')]=_0x34353c[_0x50a7('0x33')][_0x50a7('0x36')]?_0x34353c[_0x50a7('0x33')]:_0x475058[_0x50a7('0x34')];if(!_0x3c63f8['query'][_0x50a7('0x37')](_0x50a7('0x38'))){_0x34353c[_0x50a7('0x1d')]=qs['limit'](_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x1d')]);_0x34353c['offset']=qs[_0x50a7('0x1c')](_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x1c')]);}_0x34353c[_0x50a7('0x4e')]=qs['sort'](_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x39')]);_0x34353c['where']=qs[_0x50a7('0x31')](_[_0x50a7('0x3b')](_0x3c63f8[_0x50a7('0x2f')],_0x475058[_0x50a7('0x31')]));_0x34353c[_0x50a7('0x3a')][_0x50a7('0x4f')]=_0x2e19f6['id'];if(_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x3c')]){_0x34353c[_0x50a7('0x3a')]=_[_0x50a7('0x3d')](_0x34353c[_0x50a7('0x3a')],{'$or':_[_0x50a7('0x29')](_0x34353c[_0x50a7('0x33')],function(_0x369f81){var _0x596fc2={};_0x596fc2[_0x369f81]={'$like':'%'+_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x3c')]+'%'};return _0x596fc2;})});}_0x34353c=_[_0x50a7('0x3d')]({},_0x34353c,_0x3c63f8['options']);return db[_0x50a7('0x4d')][_0x50a7('0x1b')]({'where':_0x34353c[_0x50a7('0x3a')]})[_0x50a7('0x23')](function(_0x2249d4){_0x1dc9c0[_0x50a7('0x1b')]=_0x2249d4;if(_0x3c63f8[_0x50a7('0x2f')][_0x50a7('0x3e')]){_0x34353c[_0x50a7('0x3f')]=[{'all':!![]}];}return db[_0x50a7('0x4d')][_0x50a7('0x40')](_0x34353c);})[_0x50a7('0x23')](function(_0x22d6bc){_0x1dc9c0[_0x50a7('0x41')]=_0x22d6bc;return _0x1dc9c0;});}})[_0x50a7('0x23')](respondWithFilteredResult(_0x1ab5f7,_0x34353c))[_0x50a7('0x42')](handleError(_0x1ab5f7,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