Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index c3b296d..40b2e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04dd=['json','undefined','limit','count','offset','status','Content-Range','apply','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','JscriptySessionReport','include','findAll','rows','show','intersection','includeAll','options','find','create','catch','update','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x40c99a,_0x56f60e){var _0x3d1d0a=function(_0xc203fd){while(--_0xc203fd){_0x40c99a['push'](_0x40c99a['shift']());}};_0x3d1d0a(++_0x56f60e);}(_0x04dd,0x1db));var _0xd04d=function(_0x2881e2,_0x341293){_0x2881e2=_0x2881e2-0x0;var _0x5c1e1f=_0x04dd[_0x2881e2];return _0x5c1e1f;};'use strict';var emlformat=require(_0xd04d('0x0'));var rimraf=require(_0xd04d('0x1'));var zipdir=require(_0xd04d('0x2'));var jsonpatch=require(_0xd04d('0x3'));var rp=require('request-promise');var moment=require(_0xd04d('0x4'));var BPromise=require(_0xd04d('0x5'));var Mustache=require(_0xd04d('0x6'));var util=require(_0xd04d('0x7'));var path=require(_0xd04d('0x8'));var sox=require(_0xd04d('0x9'));var csv=require('to-csv');var ejs=require(_0xd04d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd04d('0xb'));var squel=require(_0xd04d('0xc'));var crypto=require(_0xd04d('0xd'));var jsforce=require(_0xd04d('0xe'));var deskjs=require(_0xd04d('0xf'));var toCsv=require(_0xd04d('0x10'));var querystring=require(_0xd04d('0x11'));var Papa=require('papaparse');var Redis=require(_0xd04d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd04d('0x13'));var as=require(_0xd04d('0x14'));var hardwareService=require(_0xd04d('0x15'));var logger=require(_0xd04d('0x16'))('api');var utils=require(_0xd04d('0x17'));var config=require(_0xd04d('0x18'));var licenseUtil=require(_0xd04d('0x19'));var db=require(_0xd04d('0x1a'))['db'];function respondWithStatusCode(_0x3d8501,_0x6159cf){_0x6159cf=_0x6159cf||0xcc;return function(_0x18f827){if(_0x18f827){return _0x3d8501[_0xd04d('0x1b')](_0x6159cf);}return _0x3d8501['status'](_0x6159cf)[_0xd04d('0x1c')]();};}function respondWithResult(_0x541654,_0x86f35c){_0x86f35c=_0x86f35c||0xc8;return function(_0x593f08){if(_0x593f08){return _0x541654['status'](_0x86f35c)[_0xd04d('0x1d')](_0x593f08);}};}function respondWithFilteredResult(_0x24a366,_0x4720fe){return function(_0x4624b8){if(_0x4624b8){var _0x4c1c4e=typeof _0x4720fe['offset']===_0xd04d('0x1e')&&typeof _0x4720fe[_0xd04d('0x1f')]==='undefined';var _0x501226=_0x4624b8['count'];var _0x5cbeca=_0x4c1c4e?0x0:_0x4720fe['offset'];var _0x5f3a26=_0x4c1c4e?_0x4624b8[_0xd04d('0x20')]:_0x4720fe[_0xd04d('0x21')]+_0x4720fe[_0xd04d('0x1f')];var _0x4d6d26;if(_0x5f3a26>=_0x501226){_0x5f3a26=_0x501226;_0x4d6d26=0xc8;}else{_0x4d6d26=0xce;}_0x24a366[_0xd04d('0x22')](_0x4d6d26);return _0x24a366['set'](_0xd04d('0x23'),_0x5cbeca+'-'+_0x5f3a26+'/'+_0x501226)['json'](_0x4624b8);}return null;};}function patchUpdates(_0x40fa23){return function(_0x115fd9){try{jsonpatch[_0xd04d('0x24')](_0x115fd9,_0x40fa23,!![]);}catch(_0x2e3306){return BPromise[_0xd04d('0x25')](_0x2e3306);}return _0x115fd9[_0xd04d('0x26')]();};}function saveUpdates(_0x412bc1,_0x47bae5){return function(_0x6a6de8){if(_0x6a6de8){return _0x6a6de8['update'](_0x412bc1)[_0xd04d('0x27')](function(_0x2e18ca){return _0x2e18ca;});}return null;};}function removeEntity(_0x422023,_0x575178){return function(_0x377294){if(_0x377294){return _0x377294['destroy']()[_0xd04d('0x27')](function(){_0x422023[_0xd04d('0x22')](0xcc)[_0xd04d('0x1c')]();});}};}function handleEntityNotFound(_0x20284f,_0x428de2){return function(_0x3e6e72){if(!_0x3e6e72){_0x20284f[_0xd04d('0x1b')](0x194);}return _0x3e6e72;};}function handleError(_0x45bd17,_0x2d764e){_0x2d764e=_0x2d764e||0x1f4;return function(_0x405605){logger[_0xd04d('0x28')](_0x405605[_0xd04d('0x29')]);if(_0x405605[_0xd04d('0x2a')]){delete _0x405605[_0xd04d('0x2a')];}_0x45bd17[_0xd04d('0x22')](_0x2d764e)['send'](_0x405605);};}exports[_0xd04d('0x2b')]=function(_0x1a98b1,_0x482063){var _0x449c5a={},_0x1a59a9={},_0x574979={'count':0x0,'rows':[]};var _0x576943=_[_0xd04d('0x2c')](db['JscriptySessionReport'][_0xd04d('0x2d')],function(_0x4a5215){return{'name':_0x4a5215[_0xd04d('0x2e')],'type':_0x4a5215[_0xd04d('0x2f')][_0xd04d('0x30')]};});_0x1a59a9[_0xd04d('0x31')]=_['map'](_0x576943,_0xd04d('0x2a'));_0x1a59a9['query']=_[_0xd04d('0x32')](_0x1a98b1[_0xd04d('0x33')]);_0x1a59a9[_0xd04d('0x34')]=_['intersection'](_0x1a59a9['model'],_0x1a59a9[_0xd04d('0x33')]);_0x449c5a[_0xd04d('0x35')]=_['intersection'](_0x1a59a9[_0xd04d('0x31')],qs[_0xd04d('0x36')](_0x1a98b1[_0xd04d('0x33')]['fields']));_0x449c5a[_0xd04d('0x35')]=_0x449c5a[_0xd04d('0x35')][_0xd04d('0x37')]?_0x449c5a[_0xd04d('0x35')]:_0x1a59a9[_0xd04d('0x31')];if(!_0x1a98b1[_0xd04d('0x33')][_0xd04d('0x38')](_0xd04d('0x39'))){_0x449c5a[_0xd04d('0x1f')]=qs['limit'](_0x1a98b1[_0xd04d('0x33')]['limit']);_0x449c5a[_0xd04d('0x21')]=qs['offset'](_0x1a98b1[_0xd04d('0x33')]['offset']);}_0x449c5a['order']=qs[_0xd04d('0x3a')](_0x1a98b1[_0xd04d('0x33')][_0xd04d('0x3a')]);_0x449c5a[_0xd04d('0x3b')]=qs[_0xd04d('0x34')](_[_0xd04d('0x3c')](_0x1a98b1[_0xd04d('0x33')],_0x1a59a9['filters']),_0x576943);if(_0x1a98b1[_0xd04d('0x33')][_0xd04d('0x3d')]){_0x449c5a[_0xd04d('0x3b')]=_['merge'](_0x449c5a[_0xd04d('0x3b')],{'$or':_[_0xd04d('0x2c')](_0x576943,function(_0x47d0d1){if(_0x47d0d1['type']!==_0xd04d('0x3e')){var _0x590de8={};_0x590de8[_0x47d0d1[_0xd04d('0x2a')]]={'$like':'%'+_0x1a98b1['query'][_0xd04d('0x3d')]+'%'};return _0x590de8;}})});}_0x449c5a=_[_0xd04d('0x3f')]({},_0x449c5a,_0x1a98b1['options']);var _0x177c38={'where':_0x449c5a[_0xd04d('0x3b')]};return db[_0xd04d('0x40')][_0xd04d('0x20')](_0x177c38)[_0xd04d('0x27')](function(_0x3ba382){_0x574979['count']=_0x3ba382;if(_0x1a98b1['query']['includeAll']){_0x449c5a[_0xd04d('0x41')]=[{'all':!![]}];}return db[_0xd04d('0x40')][_0xd04d('0x42')](_0x449c5a);})['then'](function(_0x4d1c23){_0x574979[_0xd04d('0x43')]=_0x4d1c23;return _0x574979;})[_0xd04d('0x27')](respondWithFilteredResult(_0x482063,_0x449c5a))['catch'](handleError(_0x482063,null));};exports[_0xd04d('0x44')]=function(_0x5d8f76,_0x45947a){var _0x3c6f43={'raw':!![],'where':{'id':_0x5d8f76['params']['id']}},_0x1cf1fd={};_0x1cf1fd['model']=_[_0xd04d('0x32')](db['JscriptySessionReport'][_0xd04d('0x2d')]);_0x1cf1fd['query']=_[_0xd04d('0x32')](_0x5d8f76[_0xd04d('0x33')]);_0x1cf1fd[_0xd04d('0x34')]=_[_0xd04d('0x45')](_0x1cf1fd['model'],_0x1cf1fd[_0xd04d('0x33')]);_0x3c6f43[_0xd04d('0x35')]=_[_0xd04d('0x45')](_0x1cf1fd[_0xd04d('0x31')],qs[_0xd04d('0x36')](_0x5d8f76['query'][_0xd04d('0x36')]));_0x3c6f43[_0xd04d('0x35')]=_0x3c6f43['attributes'][_0xd04d('0x37')]?_0x3c6f43[_0xd04d('0x35')]:_0x1cf1fd['model'];if(_0x5d8f76['query'][_0xd04d('0x46')]){_0x3c6f43[_0xd04d('0x41')]=[{'all':!![]}];}_0x3c6f43=_[_0xd04d('0x3f')]({},_0x3c6f43,_0x5d8f76[_0xd04d('0x47')]);return db[_0xd04d('0x40')][_0xd04d('0x48')](_0x3c6f43)[_0xd04d('0x27')](handleEntityNotFound(_0x45947a,null))['then'](respondWithResult(_0x45947a,null))['catch'](handleError(_0x45947a,null));};exports[_0xd04d('0x49')]=function(_0x58021f,_0x134af6){return db[_0xd04d('0x40')][_0xd04d('0x49')](_0x58021f['body'],{})[_0xd04d('0x27')](respondWithResult(_0x134af6,0xc9))[_0xd04d('0x4a')](handleError(_0x134af6,null));};exports[_0xd04d('0x4b')]=function(_0x2e54eb,_0x228c80){if(_0x2e54eb[_0xd04d('0x4c')]['id']){delete _0x2e54eb[_0xd04d('0x4c')]['id'];}return db[_0xd04d('0x40')][_0xd04d('0x48')]({'where':{'id':_0x2e54eb[_0xd04d('0x4d')]['id']}})[_0xd04d('0x27')](handleEntityNotFound(_0x228c80,null))['then'](saveUpdates(_0x2e54eb[_0xd04d('0x4c')],null))[_0xd04d('0x27')](respondWithResult(_0x228c80,null))['catch'](handleError(_0x228c80,null));};exports['destroy']=function(_0xf708be,_0x37306e){return db[_0xd04d('0x40')][_0xd04d('0x48')]({'where':{'id':_0xf708be[_0xd04d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37306e,null))[_0xd04d('0x27')](removeEntity(_0x37306e,null))[_0xd04d('0x4a')](handleError(_0x37306e,null));};exports[_0xd04d('0x4e')]=function(_0x4ff588,_0x547d05){return db[_0xd04d('0x40')][_0xd04d('0x4e')]()['then'](respondWithResult(_0x547d05,null))[_0xd04d('0x4a')](handleError(_0x547d05,null));};exports[_0xd04d('0x4f')]=function(_0x565360,_0x52ce26,_0x2d13ed){var _0x54cb36={'raw':!![],'where':{}};var _0x38d23a={};var _0x1b811e={'count':0x0,'rows':[]};return db[_0xd04d('0x40')][_0xd04d('0x50')]({'where':{'id':_0x565360[_0xd04d('0x4d')]['id']}})[_0xd04d('0x27')](handleEntityNotFound(_0x52ce26,null))[_0xd04d('0x27')](function(_0x34cbc2){if(_0x34cbc2){_0x38d23a[_0xd04d('0x31')]=_[_0xd04d('0x32')](db[_0xd04d('0x51')][_0xd04d('0x2d')]);_0x38d23a['query']=_[_0xd04d('0x32')](_0x565360['query']);_0x38d23a[_0xd04d('0x34')]=_[_0xd04d('0x45')](_0x38d23a[_0xd04d('0x31')],_0x38d23a[_0xd04d('0x33')]);_0x54cb36[_0xd04d('0x35')]=_['intersection'](_0x38d23a[_0xd04d('0x31')],qs[_0xd04d('0x36')](_0x565360[_0xd04d('0x33')][_0xd04d('0x36')]));_0x54cb36[_0xd04d('0x35')]=_0x54cb36['attributes']['length']?_0x54cb36['attributes']:_0x38d23a['model'];if(!_0x565360[_0xd04d('0x33')][_0xd04d('0x38')]('nolimit')){_0x54cb36[_0xd04d('0x1f')]=qs[_0xd04d('0x1f')](_0x565360[_0xd04d('0x33')][_0xd04d('0x1f')]);_0x54cb36[_0xd04d('0x21')]=qs['offset'](_0x565360[_0xd04d('0x33')]['offset']);}_0x54cb36[_0xd04d('0x52')]=qs[_0xd04d('0x3a')](_0x565360[_0xd04d('0x33')][_0xd04d('0x3a')]);_0x54cb36[_0xd04d('0x3b')]=qs[_0xd04d('0x34')](_['pick'](_0x565360['query'],_0x38d23a['filters']));_0x54cb36['where'][_0xd04d('0x53')]=_0x34cbc2['id'];if(_0x565360[_0xd04d('0x33')]['filter']){_0x54cb36[_0xd04d('0x3b')]=_[_0xd04d('0x3f')](_0x54cb36[_0xd04d('0x3b')],{'$or':_[_0xd04d('0x2c')](_0x54cb36[_0xd04d('0x35')],function(_0xb2dfe2){var _0xfafccc={};_0xfafccc[_0xb2dfe2]={'$like':'%'+_0x565360[_0xd04d('0x33')][_0xd04d('0x3d')]+'%'};return _0xfafccc;})});}_0x54cb36=_[_0xd04d('0x3f')]({},_0x54cb36,_0x565360[_0xd04d('0x47')]);return db['JscriptyQuestionReport'][_0xd04d('0x20')]({'where':_0x54cb36['where']})[_0xd04d('0x27')](function(_0x4adc23){_0x1b811e[_0xd04d('0x20')]=_0x4adc23;if(_0x565360[_0xd04d('0x33')]['includeAll']){_0x54cb36[_0xd04d('0x41')]=[{'all':!![]}];}return db[_0xd04d('0x51')][_0xd04d('0x42')](_0x54cb36);})[_0xd04d('0x27')](function(_0x6f4c65){_0x1b811e['rows']=_0x6f4c65;return _0x1b811e;});}})[_0xd04d('0x27')](respondWithFilteredResult(_0x52ce26,_0x54cb36))[_0xd04d('0x4a')](handleError(_0x52ce26,null));};
\ No newline at end of file
+var _0xf206=['to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','pick','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xf206,0x134));var _0x6f20=function(_0x4e7338,_0x50b42a){_0x4e7338=_0x4e7338-0x0;var _0x53b796=_0xf206[_0x4e7338];return _0x53b796;};'use strict';var emlformat=require(_0x6f20('0x0'));var rimraf=require(_0x6f20('0x1'));var zipdir=require(_0x6f20('0x2'));var jsonpatch=require(_0x6f20('0x3'));var rp=require(_0x6f20('0x4'));var moment=require('moment');var BPromise=require(_0x6f20('0x5'));var Mustache=require('mustache');var util=require(_0x6f20('0x6'));var path=require('path');var sox=require(_0x6f20('0x7'));var csv=require(_0x6f20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f20('0x9'));var squel=require(_0x6f20('0xa'));var crypto=require(_0x6f20('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f20('0x8'));var querystring=require('querystring');var Papa=require(_0x6f20('0xc'));var Redis=require(_0x6f20('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6f20('0xe'));var as=require(_0x6f20('0xf'));var hardwareService=require(_0x6f20('0x10'));var logger=require(_0x6f20('0x11'))(_0x6f20('0x12'));var utils=require(_0x6f20('0x13'));var config=require(_0x6f20('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f20('0x15'))['db'];function respondWithStatusCode(_0xab4169,_0x3e7ea0){_0x3e7ea0=_0x3e7ea0||0xcc;return function(_0x7c1733){if(_0x7c1733){return _0xab4169[_0x6f20('0x16')](_0x3e7ea0);}return _0xab4169['status'](_0x3e7ea0)[_0x6f20('0x17')]();};}function respondWithResult(_0xec3344,_0xc951b4){_0xc951b4=_0xc951b4||0xc8;return function(_0x3dac06){if(_0x3dac06){return _0xec3344[_0x6f20('0x18')](_0xc951b4)[_0x6f20('0x19')](_0x3dac06);}};}function respondWithFilteredResult(_0x366abf,_0x17aa72){return function(_0xf77822){if(_0xf77822){var _0x26a755=typeof _0x17aa72['offset']===_0x6f20('0x1a')&&typeof _0x17aa72[_0x6f20('0x1b')]===_0x6f20('0x1a');var _0x56c359=_0xf77822[_0x6f20('0x1c')];var _0x2939e5=_0x26a755?0x0:_0x17aa72[_0x6f20('0x1d')];var _0x45f3bd=_0x26a755?_0xf77822[_0x6f20('0x1c')]:_0x17aa72[_0x6f20('0x1d')]+_0x17aa72[_0x6f20('0x1b')];var _0x595201;if(_0x45f3bd>=_0x56c359){_0x45f3bd=_0x56c359;_0x595201=0xc8;}else{_0x595201=0xce;}_0x366abf[_0x6f20('0x18')](_0x595201);return _0x366abf[_0x6f20('0x1e')](_0x6f20('0x1f'),_0x2939e5+'-'+_0x45f3bd+'/'+_0x56c359)[_0x6f20('0x19')](_0xf77822);}return null;};}function patchUpdates(_0x5b23c6){return function(_0x131a3a){try{jsonpatch[_0x6f20('0x20')](_0x131a3a,_0x5b23c6,!![]);}catch(_0x5a5851){return BPromise[_0x6f20('0x21')](_0x5a5851);}return _0x131a3a[_0x6f20('0x22')]();};}function saveUpdates(_0xfd2872,_0x1a4010){return function(_0x160128){if(_0x160128){return _0x160128[_0x6f20('0x23')](_0xfd2872)[_0x6f20('0x24')](function(_0x52e185){return _0x52e185;});}return null;};}function removeEntity(_0x2d92d7,_0x428226){return function(_0xaa02c1){if(_0xaa02c1){return _0xaa02c1[_0x6f20('0x25')]()['then'](function(){_0x2d92d7['status'](0xcc)[_0x6f20('0x17')]();});}};}function handleEntityNotFound(_0x13cb2f,_0x6c080b){return function(_0x1d1270){if(!_0x1d1270){_0x13cb2f['sendStatus'](0x194);}return _0x1d1270;};}function handleError(_0x21ff42,_0x1d02d8){_0x1d02d8=_0x1d02d8||0x1f4;return function(_0x4d6c8b){logger['error'](_0x4d6c8b[_0x6f20('0x26')]);if(_0x4d6c8b['name']){delete _0x4d6c8b[_0x6f20('0x27')];}_0x21ff42[_0x6f20('0x18')](_0x1d02d8)[_0x6f20('0x28')](_0x4d6c8b);};}exports['index']=function(_0x17fe82,_0x5c058f){var _0x1ad56f={},_0x549ac0={},_0x5a8866={'count':0x0,'rows':[]};var _0x3410b3=_[_0x6f20('0x29')](db[_0x6f20('0x2a')][_0x6f20('0x2b')],function(_0x55861f){return{'name':_0x55861f[_0x6f20('0x2c')],'type':_0x55861f[_0x6f20('0x2d')]['key']};});_0x549ac0[_0x6f20('0x2e')]=_[_0x6f20('0x29')](_0x3410b3,_0x6f20('0x27'));_0x549ac0['query']=_[_0x6f20('0x2f')](_0x17fe82[_0x6f20('0x30')]);_0x549ac0[_0x6f20('0x31')]=_[_0x6f20('0x32')](_0x549ac0['model'],_0x549ac0[_0x6f20('0x30')]);_0x1ad56f['attributes']=_[_0x6f20('0x32')](_0x549ac0['model'],qs[_0x6f20('0x33')](_0x17fe82['query'][_0x6f20('0x33')]));_0x1ad56f['attributes']=_0x1ad56f[_0x6f20('0x34')]['length']?_0x1ad56f[_0x6f20('0x34')]:_0x549ac0[_0x6f20('0x2e')];if(!_0x17fe82[_0x6f20('0x30')]['hasOwnProperty'](_0x6f20('0x35'))){_0x1ad56f[_0x6f20('0x1b')]=qs[_0x6f20('0x1b')](_0x17fe82[_0x6f20('0x30')][_0x6f20('0x1b')]);_0x1ad56f[_0x6f20('0x1d')]=qs[_0x6f20('0x1d')](_0x17fe82[_0x6f20('0x30')][_0x6f20('0x1d')]);}_0x1ad56f[_0x6f20('0x36')]=qs['sort'](_0x17fe82[_0x6f20('0x30')][_0x6f20('0x37')]);_0x1ad56f[_0x6f20('0x38')]=qs[_0x6f20('0x31')](_['pick'](_0x17fe82[_0x6f20('0x30')],_0x549ac0[_0x6f20('0x31')]),_0x3410b3);if(_0x17fe82[_0x6f20('0x30')][_0x6f20('0x39')]){_0x1ad56f[_0x6f20('0x38')]=_[_0x6f20('0x3a')](_0x1ad56f[_0x6f20('0x38')],{'$or':_['map'](_0x3410b3,function(_0x3980df){if(_0x3980df['type']!==_0x6f20('0x3b')){var _0x3224b3={};_0x3224b3[_0x3980df['name']]={'$like':'%'+_0x17fe82[_0x6f20('0x30')][_0x6f20('0x39')]+'%'};return _0x3224b3;}})});}_0x1ad56f=_[_0x6f20('0x3a')]({},_0x1ad56f,_0x17fe82[_0x6f20('0x3c')]);var _0x4fa303={'where':_0x1ad56f['where']};return db[_0x6f20('0x2a')]['count'](_0x4fa303)[_0x6f20('0x24')](function(_0x1f0275){_0x5a8866[_0x6f20('0x1c')]=_0x1f0275;if(_0x17fe82[_0x6f20('0x30')][_0x6f20('0x3d')]){_0x1ad56f[_0x6f20('0x3e')]=[{'all':!![]}];}return db[_0x6f20('0x2a')][_0x6f20('0x3f')](_0x1ad56f);})[_0x6f20('0x24')](function(_0x88c4a5){_0x5a8866[_0x6f20('0x40')]=_0x88c4a5;return _0x5a8866;})['then'](respondWithFilteredResult(_0x5c058f,_0x1ad56f))[_0x6f20('0x41')](handleError(_0x5c058f,null));};exports[_0x6f20('0x42')]=function(_0x150b31,_0x29dbc1){var _0x508915={'raw':!![],'where':{'id':_0x150b31['params']['id']}},_0x3a1765={};_0x3a1765[_0x6f20('0x2e')]=_[_0x6f20('0x2f')](db[_0x6f20('0x2a')]['rawAttributes']);_0x3a1765[_0x6f20('0x30')]=_[_0x6f20('0x2f')](_0x150b31['query']);_0x3a1765[_0x6f20('0x31')]=_[_0x6f20('0x32')](_0x3a1765[_0x6f20('0x2e')],_0x3a1765['query']);_0x508915[_0x6f20('0x34')]=_[_0x6f20('0x32')](_0x3a1765[_0x6f20('0x2e')],qs[_0x6f20('0x33')](_0x150b31[_0x6f20('0x30')][_0x6f20('0x33')]));_0x508915[_0x6f20('0x34')]=_0x508915['attributes'][_0x6f20('0x43')]?_0x508915[_0x6f20('0x34')]:_0x3a1765[_0x6f20('0x2e')];if(_0x150b31[_0x6f20('0x30')][_0x6f20('0x3d')]){_0x508915['include']=[{'all':!![]}];}_0x508915=_[_0x6f20('0x3a')]({},_0x508915,_0x150b31['options']);return db[_0x6f20('0x2a')][_0x6f20('0x44')](_0x508915)[_0x6f20('0x24')](handleEntityNotFound(_0x29dbc1,null))[_0x6f20('0x24')](respondWithResult(_0x29dbc1,null))[_0x6f20('0x41')](handleError(_0x29dbc1,null));};exports[_0x6f20('0x45')]=function(_0x37f252,_0x1c3a9a){return db[_0x6f20('0x2a')][_0x6f20('0x45')](_0x37f252[_0x6f20('0x46')],{})[_0x6f20('0x24')](respondWithResult(_0x1c3a9a,0xc9))[_0x6f20('0x41')](handleError(_0x1c3a9a,null));};exports[_0x6f20('0x23')]=function(_0x1227e4,_0x1a1937){if(_0x1227e4['body']['id']){delete _0x1227e4[_0x6f20('0x46')]['id'];}return db[_0x6f20('0x2a')][_0x6f20('0x44')]({'where':{'id':_0x1227e4[_0x6f20('0x47')]['id']}})[_0x6f20('0x24')](handleEntityNotFound(_0x1a1937,null))[_0x6f20('0x24')](saveUpdates(_0x1227e4[_0x6f20('0x46')],null))[_0x6f20('0x24')](respondWithResult(_0x1a1937,null))[_0x6f20('0x41')](handleError(_0x1a1937,null));};exports[_0x6f20('0x25')]=function(_0x25594b,_0x39dc65){return db['JscriptySessionReport'][_0x6f20('0x44')]({'where':{'id':_0x25594b[_0x6f20('0x47')]['id']}})[_0x6f20('0x24')](handleEntityNotFound(_0x39dc65,null))[_0x6f20('0x24')](removeEntity(_0x39dc65,null))['catch'](handleError(_0x39dc65,null));};exports[_0x6f20('0x48')]=function(_0x1343df,_0x2ba9a4){return db[_0x6f20('0x2a')][_0x6f20('0x48')]()[_0x6f20('0x24')](respondWithResult(_0x2ba9a4,null))[_0x6f20('0x41')](handleError(_0x2ba9a4,null));};exports[_0x6f20('0x49')]=function(_0x55c741,_0x43721f,_0x17e2dd){var _0x1dca32={'raw':!![],'where':{}};var _0x3cc140={};var _0x1328a3={'count':0x0,'rows':[]};return db[_0x6f20('0x2a')][_0x6f20('0x4a')]({'where':{'id':_0x55c741['params']['id']}})[_0x6f20('0x24')](handleEntityNotFound(_0x43721f,null))['then'](function(_0x27a5ab){if(_0x27a5ab){_0x3cc140['model']=_[_0x6f20('0x2f')](db[_0x6f20('0x4b')][_0x6f20('0x2b')]);_0x3cc140[_0x6f20('0x30')]=_[_0x6f20('0x2f')](_0x55c741['query']);_0x3cc140['filters']=_[_0x6f20('0x32')](_0x3cc140[_0x6f20('0x2e')],_0x3cc140['query']);_0x1dca32[_0x6f20('0x34')]=_['intersection'](_0x3cc140[_0x6f20('0x2e')],qs[_0x6f20('0x33')](_0x55c741[_0x6f20('0x30')][_0x6f20('0x33')]));_0x1dca32[_0x6f20('0x34')]=_0x1dca32[_0x6f20('0x34')][_0x6f20('0x43')]?_0x1dca32[_0x6f20('0x34')]:_0x3cc140['model'];if(!_0x55c741[_0x6f20('0x30')][_0x6f20('0x4c')](_0x6f20('0x35'))){_0x1dca32[_0x6f20('0x1b')]=qs['limit'](_0x55c741[_0x6f20('0x30')][_0x6f20('0x1b')]);_0x1dca32[_0x6f20('0x1d')]=qs[_0x6f20('0x1d')](_0x55c741[_0x6f20('0x30')][_0x6f20('0x1d')]);}_0x1dca32['order']=qs['sort'](_0x55c741[_0x6f20('0x30')][_0x6f20('0x37')]);_0x1dca32[_0x6f20('0x38')]=qs[_0x6f20('0x31')](_[_0x6f20('0x4d')](_0x55c741['query'],_0x3cc140[_0x6f20('0x31')]));_0x1dca32[_0x6f20('0x38')][_0x6f20('0x4e')]=_0x27a5ab['id'];if(_0x55c741['query'][_0x6f20('0x39')]){_0x1dca32[_0x6f20('0x38')]=_[_0x6f20('0x3a')](_0x1dca32[_0x6f20('0x38')],{'$or':_[_0x6f20('0x29')](_0x1dca32[_0x6f20('0x34')],function(_0x34998e){var _0x4ca67b={};_0x4ca67b[_0x34998e]={'$like':'%'+_0x55c741[_0x6f20('0x30')][_0x6f20('0x39')]+'%'};return _0x4ca67b;})});}_0x1dca32=_[_0x6f20('0x3a')]({},_0x1dca32,_0x55c741[_0x6f20('0x3c')]);return db[_0x6f20('0x4b')][_0x6f20('0x1c')]({'where':_0x1dca32[_0x6f20('0x38')]})['then'](function(_0x392d91){_0x1328a3[_0x6f20('0x1c')]=_0x392d91;if(_0x55c741['query'][_0x6f20('0x3d')]){_0x1dca32[_0x6f20('0x3e')]=[{'all':!![]}];}return db[_0x6f20('0x4b')]['findAll'](_0x1dca32);})['then'](function(_0x196478){_0x1328a3[_0x6f20('0x40')]=_0x196478;return _0x1328a3;});}})[_0x6f20('0x24')](respondWithFilteredResult(_0x43721f,_0x1dca32))[_0x6f20('0x41')](handleError(_0x43721f,null));};
\ No newline at end of file