Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 5dabb65..0dac998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x194f=['offset','undefined','limit','count','set','json','reject','save','update','then','stack','name','send','index','map','JscriptySessionReport','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x554e96,_0x2eea80){var _0x449d9c=function(_0x5536b5){while(--_0x5536b5){_0x554e96['push'](_0x554e96['shift']());}};_0x449d9c(++_0x2eea80);}(_0x194f,0x87));var _0xf194=function(_0x5c9ee8,_0x2629b8){_0x5c9ee8=_0x5c9ee8-0x0;var _0x2ab59d=_0x194f[_0x5c9ee8];return _0x2ab59d;};'use strict';var emlformat=require(_0xf194('0x0'));var rimraf=require(_0xf194('0x1'));var zipdir=require(_0xf194('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf194('0x3'));var moment=require(_0xf194('0x4'));var BPromise=require(_0xf194('0x5'));var Mustache=require(_0xf194('0x6'));var util=require(_0xf194('0x7'));var path=require('path');var sox=require(_0xf194('0x8'));var csv=require(_0xf194('0x9'));var ejs=require(_0xf194('0xa'));var fs=require('fs');var fs_extra=require(_0xf194('0xb'));var _=require(_0xf194('0xc'));var squel=require(_0xf194('0xd'));var crypto=require('crypto');var jsforce=require(_0xf194('0xe'));var deskjs=require(_0xf194('0xf'));var toCsv=require(_0xf194('0x9'));var querystring=require('querystring');var Papa=require(_0xf194('0x10'));var Redis=require(_0xf194('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf194('0x12'));var as=require(_0xf194('0x13'));var hardwareService=require(_0xf194('0x14'));var logger=require(_0xf194('0x15'))(_0xf194('0x16'));var utils=require(_0xf194('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf194('0x18'));var db=require(_0xf194('0x19'))['db'];function respondWithStatusCode(_0x11531f,_0x916098){_0x916098=_0x916098||0xcc;return function(_0x272e78){if(_0x272e78){return _0x11531f[_0xf194('0x1a')](_0x916098);}return _0x11531f[_0xf194('0x1b')](_0x916098)[_0xf194('0x1c')]();};}function respondWithResult(_0x328785,_0x90ca44){_0x90ca44=_0x90ca44||0xc8;return function(_0x20fa70){if(_0x20fa70){return _0x328785[_0xf194('0x1b')](_0x90ca44)['json'](_0x20fa70);}};}function respondWithFilteredResult(_0x3bffc6,_0x1b2043){return function(_0x1396c1){if(_0x1396c1){var _0x40b3d8=typeof _0x1b2043[_0xf194('0x1d')]===_0xf194('0x1e')&&typeof _0x1b2043[_0xf194('0x1f')]===_0xf194('0x1e');var _0x3ae0a8=_0x1396c1[_0xf194('0x20')];var _0x592b8b=_0x40b3d8?0x0:_0x1b2043[_0xf194('0x1d')];var _0x45ffe8=_0x40b3d8?_0x1396c1['count']:_0x1b2043[_0xf194('0x1d')]+_0x1b2043[_0xf194('0x1f')];var _0x3766c6;if(_0x45ffe8>=_0x3ae0a8){_0x45ffe8=_0x3ae0a8;_0x3766c6=0xc8;}else{_0x3766c6=0xce;}_0x3bffc6[_0xf194('0x1b')](_0x3766c6);return _0x3bffc6[_0xf194('0x21')]('Content-Range',_0x592b8b+'-'+_0x45ffe8+'/'+_0x3ae0a8)[_0xf194('0x22')](_0x1396c1);}return null;};}function patchUpdates(_0x43bd20){return function(_0x44628c){try{jsonpatch['apply'](_0x44628c,_0x43bd20,!![]);}catch(_0x34014a){return BPromise[_0xf194('0x23')](_0x34014a);}return _0x44628c[_0xf194('0x24')]();};}function saveUpdates(_0x581fa4,_0x100d54){return function(_0x2e3256){if(_0x2e3256){return _0x2e3256[_0xf194('0x25')](_0x581fa4)[_0xf194('0x26')](function(_0xcf29c5){return _0xcf29c5;});}return null;};}function removeEntity(_0x5a6fa9,_0x237641){return function(_0x1e4959){if(_0x1e4959){return _0x1e4959['destroy']()['then'](function(){_0x5a6fa9[_0xf194('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542efd,_0x481e24){return function(_0x51f796){if(!_0x51f796){_0x542efd[_0xf194('0x1a')](0x194);}return _0x51f796;};}function handleError(_0x5033d0,_0x53706f){_0x53706f=_0x53706f||0x1f4;return function(_0x3cad4e){logger['error'](_0x3cad4e[_0xf194('0x27')]);if(_0x3cad4e['name']){delete _0x3cad4e[_0xf194('0x28')];}_0x5033d0['status'](_0x53706f)[_0xf194('0x29')](_0x3cad4e);};}exports[_0xf194('0x2a')]=function(_0x13b62c,_0x4243f8){var _0x555586={},_0x5b29a8={},_0x308a4c={'count':0x0,'rows':[]};var _0x3b765e=_[_0xf194('0x2b')](db[_0xf194('0x2c')]['rawAttributes'],function(_0x102cb5){return{'name':_0x102cb5[_0xf194('0x2d')],'type':_0x102cb5['type'][_0xf194('0x2e')]};});_0x5b29a8[_0xf194('0x2f')]=_[_0xf194('0x2b')](_0x3b765e,_0xf194('0x28'));_0x5b29a8[_0xf194('0x30')]=_['keys'](_0x13b62c[_0xf194('0x30')]);_0x5b29a8[_0xf194('0x31')]=_[_0xf194('0x32')](_0x5b29a8['model'],_0x5b29a8[_0xf194('0x30')]);_0x555586['attributes']=_[_0xf194('0x32')](_0x5b29a8[_0xf194('0x2f')],qs[_0xf194('0x33')](_0x13b62c[_0xf194('0x30')][_0xf194('0x33')]));_0x555586[_0xf194('0x34')]=_0x555586[_0xf194('0x34')][_0xf194('0x35')]?_0x555586[_0xf194('0x34')]:_0x5b29a8[_0xf194('0x2f')];if(!_0x13b62c['query'][_0xf194('0x36')](_0xf194('0x37'))){_0x555586[_0xf194('0x1f')]=qs[_0xf194('0x1f')](_0x13b62c['query'][_0xf194('0x1f')]);_0x555586[_0xf194('0x1d')]=qs['offset'](_0x13b62c['query'][_0xf194('0x1d')]);}_0x555586[_0xf194('0x38')]=qs[_0xf194('0x39')](_0x13b62c[_0xf194('0x30')][_0xf194('0x39')]);_0x555586[_0xf194('0x3a')]=qs[_0xf194('0x31')](_[_0xf194('0x3b')](_0x13b62c['query'],_0x5b29a8[_0xf194('0x31')]),_0x3b765e);if(_0x13b62c[_0xf194('0x30')][_0xf194('0x3c')]){_0x555586[_0xf194('0x3a')]=_[_0xf194('0x3d')](_0x555586[_0xf194('0x3a')],{'$or':_['map'](_0x3b765e,function(_0x5b5032){if(_0x5b5032[_0xf194('0x3e')]!==_0xf194('0x3f')){var _0x426d66={};_0x426d66[_0x5b5032['name']]={'$like':'%'+_0x13b62c[_0xf194('0x30')][_0xf194('0x3c')]+'%'};return _0x426d66;}})});}_0x555586=_[_0xf194('0x3d')]({},_0x555586,_0x13b62c[_0xf194('0x40')]);var _0x15758f={'where':_0x555586[_0xf194('0x3a')]};return db[_0xf194('0x2c')]['count'](_0x15758f)[_0xf194('0x26')](function(_0x14e533){_0x308a4c[_0xf194('0x20')]=_0x14e533;if(_0x13b62c[_0xf194('0x30')][_0xf194('0x41')]){_0x555586[_0xf194('0x42')]=[{'all':!![]}];}return db[_0xf194('0x2c')][_0xf194('0x43')](_0x555586);})[_0xf194('0x26')](function(_0x5e3e4a){_0x308a4c['rows']=_0x5e3e4a;return _0x308a4c;})[_0xf194('0x26')](respondWithFilteredResult(_0x4243f8,_0x555586))[_0xf194('0x44')](handleError(_0x4243f8,null));};exports[_0xf194('0x45')]=function(_0xaccb9c,_0x38eadd){var _0xcdfc8b={'raw':!![],'where':{'id':_0xaccb9c[_0xf194('0x46')]['id']}},_0x2b4e9a={};_0x2b4e9a['model']=_[_0xf194('0x47')](db['JscriptySessionReport']['rawAttributes']);_0x2b4e9a['query']=_[_0xf194('0x47')](_0xaccb9c['query']);_0x2b4e9a[_0xf194('0x31')]=_[_0xf194('0x32')](_0x2b4e9a[_0xf194('0x2f')],_0x2b4e9a[_0xf194('0x30')]);_0xcdfc8b[_0xf194('0x34')]=_['intersection'](_0x2b4e9a[_0xf194('0x2f')],qs[_0xf194('0x33')](_0xaccb9c[_0xf194('0x30')][_0xf194('0x33')]));_0xcdfc8b[_0xf194('0x34')]=_0xcdfc8b[_0xf194('0x34')][_0xf194('0x35')]?_0xcdfc8b[_0xf194('0x34')]:_0x2b4e9a['model'];if(_0xaccb9c[_0xf194('0x30')][_0xf194('0x41')]){_0xcdfc8b[_0xf194('0x42')]=[{'all':!![]}];}_0xcdfc8b=_[_0xf194('0x3d')]({},_0xcdfc8b,_0xaccb9c[_0xf194('0x40')]);return db[_0xf194('0x2c')][_0xf194('0x48')](_0xcdfc8b)[_0xf194('0x26')](handleEntityNotFound(_0x38eadd,null))[_0xf194('0x26')](respondWithResult(_0x38eadd,null))[_0xf194('0x44')](handleError(_0x38eadd,null));};exports[_0xf194('0x49')]=function(_0x1fe1e6,_0x38b3d3){return db[_0xf194('0x2c')][_0xf194('0x49')](_0x1fe1e6[_0xf194('0x4a')],{})[_0xf194('0x26')](respondWithResult(_0x38b3d3,0xc9))[_0xf194('0x44')](handleError(_0x38b3d3,null));};exports[_0xf194('0x25')]=function(_0x2dc974,_0x2620a0){if(_0x2dc974[_0xf194('0x4a')]['id']){delete _0x2dc974[_0xf194('0x4a')]['id'];}return db[_0xf194('0x2c')][_0xf194('0x48')]({'where':{'id':_0x2dc974['params']['id']}})[_0xf194('0x26')](handleEntityNotFound(_0x2620a0,null))[_0xf194('0x26')](saveUpdates(_0x2dc974[_0xf194('0x4a')],null))[_0xf194('0x26')](respondWithResult(_0x2620a0,null))[_0xf194('0x44')](handleError(_0x2620a0,null));};exports[_0xf194('0x4b')]=function(_0x307d84,_0x3a7fa7){return db[_0xf194('0x2c')]['find']({'where':{'id':_0x307d84[_0xf194('0x46')]['id']}})[_0xf194('0x26')](handleEntityNotFound(_0x3a7fa7,null))[_0xf194('0x26')](removeEntity(_0x3a7fa7,null))[_0xf194('0x44')](handleError(_0x3a7fa7,null));};exports[_0xf194('0x4c')]=function(_0x3bfb3b,_0x24657a){return db[_0xf194('0x2c')][_0xf194('0x4c')]()['then'](respondWithResult(_0x24657a,null))[_0xf194('0x44')](handleError(_0x24657a,null));};exports[_0xf194('0x4d')]=function(_0x4ceef1,_0x59281f,_0x5241ba){var _0x2e4f7f={'raw':!![],'where':{}};var _0x348bf1={};var _0x344633={'count':0x0,'rows':[]};return db[_0xf194('0x2c')][_0xf194('0x4e')]({'where':{'id':_0x4ceef1[_0xf194('0x46')]['id']}})[_0xf194('0x26')](handleEntityNotFound(_0x59281f,null))[_0xf194('0x26')](function(_0x570d15){if(_0x570d15){_0x348bf1['model']=_['keys'](db[_0xf194('0x4f')][_0xf194('0x50')]);_0x348bf1[_0xf194('0x30')]=_[_0xf194('0x47')](_0x4ceef1[_0xf194('0x30')]);_0x348bf1['filters']=_[_0xf194('0x32')](_0x348bf1[_0xf194('0x2f')],_0x348bf1[_0xf194('0x30')]);_0x2e4f7f['attributes']=_[_0xf194('0x32')](_0x348bf1['model'],qs[_0xf194('0x33')](_0x4ceef1[_0xf194('0x30')][_0xf194('0x33')]));_0x2e4f7f['attributes']=_0x2e4f7f[_0xf194('0x34')]['length']?_0x2e4f7f[_0xf194('0x34')]:_0x348bf1[_0xf194('0x2f')];if(!_0x4ceef1[_0xf194('0x30')][_0xf194('0x36')](_0xf194('0x37'))){_0x2e4f7f[_0xf194('0x1f')]=qs['limit'](_0x4ceef1[_0xf194('0x30')][_0xf194('0x1f')]);_0x2e4f7f[_0xf194('0x1d')]=qs[_0xf194('0x1d')](_0x4ceef1['query'][_0xf194('0x1d')]);}_0x2e4f7f[_0xf194('0x38')]=qs[_0xf194('0x39')](_0x4ceef1[_0xf194('0x30')]['sort']);_0x2e4f7f['where']=qs[_0xf194('0x31')](_[_0xf194('0x3b')](_0x4ceef1[_0xf194('0x30')],_0x348bf1[_0xf194('0x31')]));_0x2e4f7f['where'][_0xf194('0x51')]=_0x570d15['id'];if(_0x4ceef1[_0xf194('0x30')][_0xf194('0x3c')]){_0x2e4f7f[_0xf194('0x3a')]=_[_0xf194('0x3d')](_0x2e4f7f['where'],{'$or':_[_0xf194('0x2b')](_0x2e4f7f[_0xf194('0x34')],function(_0x4c2ca2){var _0x7811f5={};_0x7811f5[_0x4c2ca2]={'$like':'%'+_0x4ceef1[_0xf194('0x30')]['filter']+'%'};return _0x7811f5;})});}_0x2e4f7f=_['merge']({},_0x2e4f7f,_0x4ceef1[_0xf194('0x40')]);return db[_0xf194('0x4f')]['count']({'where':_0x2e4f7f[_0xf194('0x3a')]})[_0xf194('0x26')](function(_0x295469){_0x344633[_0xf194('0x20')]=_0x295469;if(_0x4ceef1[_0xf194('0x30')][_0xf194('0x41')]){_0x2e4f7f[_0xf194('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf194('0x43')](_0x2e4f7f);})[_0xf194('0x26')](function(_0x3a284a){_0x344633['rows']=_0x3a284a;return _0x344633;});}})[_0xf194('0x26')](respondWithFilteredResult(_0x59281f,_0x2e4f7f))[_0xf194('0x44')](handleError(_0x59281f,null));};
\ No newline at end of file
+var _0x2035=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','zip-dir','mustache','util','path','sox'];(function(_0x994e65,_0x3c7807){var _0x1773d1=function(_0x15d7c2){while(--_0x15d7c2){_0x994e65['push'](_0x994e65['shift']());}};_0x1773d1(++_0x3c7807);}(_0x2035,0x137));var _0x5203=function(_0x59d945,_0x105bce){_0x59d945=_0x59d945-0x0;var _0x1d3cf1=_0x2035[_0x59d945];return _0x1d3cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5203('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5203('0x1'));var util=require(_0x5203('0x2'));var path=require(_0x5203('0x3'));var sox=require(_0x5203('0x4'));var csv=require(_0x5203('0x5'));var ejs=require(_0x5203('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5203('0x7'));var squel=require('squel');var crypto=require(_0x5203('0x8'));var jsforce=require(_0x5203('0x9'));var deskjs=require(_0x5203('0xa'));var toCsv=require(_0x5203('0x5'));var querystring=require(_0x5203('0xb'));var Papa=require(_0x5203('0xc'));var Redis=require(_0x5203('0xd'));var authService=require(_0x5203('0xe'));var qs=require(_0x5203('0xf'));var as=require(_0x5203('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5203('0x11'))('api');var utils=require(_0x5203('0x12'));var config=require(_0x5203('0x13'));var licenseUtil=require(_0x5203('0x14'));var db=require(_0x5203('0x15'))['db'];function respondWithStatusCode(_0x31c920,_0x241da2){_0x241da2=_0x241da2||0xcc;return function(_0x55dc8a){if(_0x55dc8a){return _0x31c920[_0x5203('0x16')](_0x241da2);}return _0x31c920[_0x5203('0x17')](_0x241da2)[_0x5203('0x18')]();};}function respondWithResult(_0x1dfca4,_0x27ef73){_0x27ef73=_0x27ef73||0xc8;return function(_0x2d7677){if(_0x2d7677){return _0x1dfca4[_0x5203('0x17')](_0x27ef73)[_0x5203('0x19')](_0x2d7677);}};}function respondWithFilteredResult(_0x3786a0,_0x41a5d8){return function(_0x14c236){if(_0x14c236){var _0x650443=typeof _0x41a5d8[_0x5203('0x1a')]==='undefined'&&typeof _0x41a5d8[_0x5203('0x1b')]===_0x5203('0x1c');var _0x343c91=_0x14c236['count'];var _0x1880bb=_0x650443?0x0:_0x41a5d8[_0x5203('0x1a')];var _0x3610ad=_0x650443?_0x14c236[_0x5203('0x1d')]:_0x41a5d8[_0x5203('0x1a')]+_0x41a5d8[_0x5203('0x1b')];var _0x438b42;if(_0x3610ad>=_0x343c91){_0x3610ad=_0x343c91;_0x438b42=0xc8;}else{_0x438b42=0xce;}_0x3786a0[_0x5203('0x17')](_0x438b42);return _0x3786a0[_0x5203('0x1e')](_0x5203('0x1f'),_0x1880bb+'-'+_0x3610ad+'/'+_0x343c91)[_0x5203('0x19')](_0x14c236);}return null;};}function patchUpdates(_0x1ecb30){return function(_0x3d79ce){try{jsonpatch[_0x5203('0x20')](_0x3d79ce,_0x1ecb30,!![]);}catch(_0x177440){return BPromise[_0x5203('0x21')](_0x177440);}return _0x3d79ce['save']();};}function saveUpdates(_0x3b5a55,_0x20f10b){return function(_0x58566f){if(_0x58566f){return _0x58566f['update'](_0x3b5a55)[_0x5203('0x22')](function(_0x51334e){return _0x51334e;});}return null;};}function removeEntity(_0x3618dc,_0x2b9edc){return function(_0x28cbb1){if(_0x28cbb1){return _0x28cbb1[_0x5203('0x23')]()[_0x5203('0x22')](function(){_0x3618dc[_0x5203('0x17')](0xcc)[_0x5203('0x18')]();});}};}function handleEntityNotFound(_0x32a0e9,_0x21ebe0){return function(_0x1f3bbc){if(!_0x1f3bbc){_0x32a0e9['sendStatus'](0x194);}return _0x1f3bbc;};}function handleError(_0x52bf45,_0x11e5c3){_0x11e5c3=_0x11e5c3||0x1f4;return function(_0x14f6f2){logger[_0x5203('0x24')](_0x14f6f2[_0x5203('0x25')]);if(_0x14f6f2['name']){delete _0x14f6f2[_0x5203('0x26')];}_0x52bf45[_0x5203('0x17')](_0x11e5c3)[_0x5203('0x27')](_0x14f6f2);};}exports[_0x5203('0x28')]=function(_0x2ad9f3,_0x492148){var _0x5d51e0={},_0xf360e9={},_0x341577={'count':0x0,'rows':[]};var _0x5051c0=_[_0x5203('0x29')](db[_0x5203('0x2a')][_0x5203('0x2b')],function(_0x479e03){return{'name':_0x479e03[_0x5203('0x2c')],'type':_0x479e03[_0x5203('0x2d')][_0x5203('0x2e')]};});_0xf360e9[_0x5203('0x2f')]=_['map'](_0x5051c0,_0x5203('0x26'));_0xf360e9['query']=_[_0x5203('0x30')](_0x2ad9f3['query']);_0xf360e9[_0x5203('0x31')]=_[_0x5203('0x32')](_0xf360e9[_0x5203('0x2f')],_0xf360e9[_0x5203('0x33')]);_0x5d51e0['attributes']=_[_0x5203('0x32')](_0xf360e9['model'],qs[_0x5203('0x34')](_0x2ad9f3[_0x5203('0x33')][_0x5203('0x34')]));_0x5d51e0[_0x5203('0x35')]=_0x5d51e0['attributes'][_0x5203('0x36')]?_0x5d51e0[_0x5203('0x35')]:_0xf360e9[_0x5203('0x2f')];if(!_0x2ad9f3[_0x5203('0x33')]['hasOwnProperty']('nolimit')){_0x5d51e0[_0x5203('0x1b')]=qs[_0x5203('0x1b')](_0x2ad9f3['query'][_0x5203('0x1b')]);_0x5d51e0['offset']=qs[_0x5203('0x1a')](_0x2ad9f3[_0x5203('0x33')][_0x5203('0x1a')]);}_0x5d51e0[_0x5203('0x37')]=qs[_0x5203('0x38')](_0x2ad9f3[_0x5203('0x33')]['sort']);_0x5d51e0[_0x5203('0x39')]=qs[_0x5203('0x31')](_[_0x5203('0x3a')](_0x2ad9f3[_0x5203('0x33')],_0xf360e9['filters']),_0x5051c0);if(_0x2ad9f3[_0x5203('0x33')][_0x5203('0x3b')]){_0x5d51e0[_0x5203('0x39')]=_['merge'](_0x5d51e0[_0x5203('0x39')],{'$or':_[_0x5203('0x29')](_0x5051c0,function(_0x3e104b){if(_0x3e104b['type']!==_0x5203('0x3c')){var _0x4d471c={};_0x4d471c[_0x3e104b['name']]={'$like':'%'+_0x2ad9f3[_0x5203('0x33')][_0x5203('0x3b')]+'%'};return _0x4d471c;}})});}_0x5d51e0=_[_0x5203('0x3d')]({},_0x5d51e0,_0x2ad9f3['options']);var _0xe2a82b={'where':_0x5d51e0[_0x5203('0x39')]};return db['JscriptySessionReport'][_0x5203('0x1d')](_0xe2a82b)[_0x5203('0x22')](function(_0x92de55){_0x341577[_0x5203('0x1d')]=_0x92de55;if(_0x2ad9f3[_0x5203('0x33')]['includeAll']){_0x5d51e0[_0x5203('0x3e')]=[{'all':!![]}];}return db[_0x5203('0x2a')][_0x5203('0x3f')](_0x5d51e0);})[_0x5203('0x22')](function(_0x2f684f){_0x341577[_0x5203('0x40')]=_0x2f684f;return _0x341577;})[_0x5203('0x22')](respondWithFilteredResult(_0x492148,_0x5d51e0))['catch'](handleError(_0x492148,null));};exports[_0x5203('0x41')]=function(_0x2d2a1b,_0x5cec57){var _0xdf3620={'raw':!![],'where':{'id':_0x2d2a1b[_0x5203('0x42')]['id']}},_0x22ead0={};_0x22ead0[_0x5203('0x2f')]=_[_0x5203('0x30')](db[_0x5203('0x2a')]['rawAttributes']);_0x22ead0[_0x5203('0x33')]=_['keys'](_0x2d2a1b['query']);_0x22ead0[_0x5203('0x31')]=_['intersection'](_0x22ead0[_0x5203('0x2f')],_0x22ead0['query']);_0xdf3620[_0x5203('0x35')]=_[_0x5203('0x32')](_0x22ead0[_0x5203('0x2f')],qs[_0x5203('0x34')](_0x2d2a1b['query']['fields']));_0xdf3620[_0x5203('0x35')]=_0xdf3620[_0x5203('0x35')][_0x5203('0x36')]?_0xdf3620[_0x5203('0x35')]:_0x22ead0[_0x5203('0x2f')];if(_0x2d2a1b[_0x5203('0x33')][_0x5203('0x43')]){_0xdf3620[_0x5203('0x3e')]=[{'all':!![]}];}_0xdf3620=_[_0x5203('0x3d')]({},_0xdf3620,_0x2d2a1b[_0x5203('0x44')]);return db[_0x5203('0x2a')][_0x5203('0x45')](_0xdf3620)[_0x5203('0x22')](handleEntityNotFound(_0x5cec57,null))['then'](respondWithResult(_0x5cec57,null))[_0x5203('0x46')](handleError(_0x5cec57,null));};exports[_0x5203('0x47')]=function(_0x36fed8,_0x3e4d10){return db['JscriptySessionReport']['create'](_0x36fed8[_0x5203('0x48')],{})[_0x5203('0x22')](respondWithResult(_0x3e4d10,0xc9))[_0x5203('0x46')](handleError(_0x3e4d10,null));};exports['update']=function(_0x9338df,_0x38739c){if(_0x9338df[_0x5203('0x48')]['id']){delete _0x9338df[_0x5203('0x48')]['id'];}return db['JscriptySessionReport'][_0x5203('0x45')]({'where':{'id':_0x9338df['params']['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x38739c,null))[_0x5203('0x22')](saveUpdates(_0x9338df[_0x5203('0x48')],null))[_0x5203('0x22')](respondWithResult(_0x38739c,null))['catch'](handleError(_0x38739c,null));};exports[_0x5203('0x23')]=function(_0x371a90,_0x246742){return db[_0x5203('0x2a')][_0x5203('0x45')]({'where':{'id':_0x371a90['params']['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x246742,null))[_0x5203('0x22')](removeEntity(_0x246742,null))[_0x5203('0x46')](handleError(_0x246742,null));};exports[_0x5203('0x49')]=function(_0x59d395,_0x22d99e){return db[_0x5203('0x2a')][_0x5203('0x49')]()[_0x5203('0x22')](respondWithResult(_0x22d99e,null))['catch'](handleError(_0x22d99e,null));};exports[_0x5203('0x4a')]=function(_0x258f7f,_0x3616f5,_0x5e44e4){var _0xe06f78={'raw':!![],'where':{}};var _0x7776b8={};var _0x471d8f={'count':0x0,'rows':[]};return db[_0x5203('0x2a')][_0x5203('0x4b')]({'where':{'id':_0x258f7f[_0x5203('0x42')]['id']}})[_0x5203('0x22')](handleEntityNotFound(_0x3616f5,null))[_0x5203('0x22')](function(_0x514861){if(_0x514861){_0x7776b8[_0x5203('0x2f')]=_[_0x5203('0x30')](db[_0x5203('0x4c')][_0x5203('0x2b')]);_0x7776b8[_0x5203('0x33')]=_[_0x5203('0x30')](_0x258f7f['query']);_0x7776b8[_0x5203('0x31')]=_['intersection'](_0x7776b8['model'],_0x7776b8['query']);_0xe06f78[_0x5203('0x35')]=_[_0x5203('0x32')](_0x7776b8[_0x5203('0x2f')],qs[_0x5203('0x34')](_0x258f7f[_0x5203('0x33')]['fields']));_0xe06f78['attributes']=_0xe06f78['attributes'][_0x5203('0x36')]?_0xe06f78[_0x5203('0x35')]:_0x7776b8[_0x5203('0x2f')];if(!_0x258f7f[_0x5203('0x33')]['hasOwnProperty'](_0x5203('0x4d'))){_0xe06f78[_0x5203('0x1b')]=qs[_0x5203('0x1b')](_0x258f7f[_0x5203('0x33')]['limit']);_0xe06f78[_0x5203('0x1a')]=qs[_0x5203('0x1a')](_0x258f7f['query'][_0x5203('0x1a')]);}_0xe06f78[_0x5203('0x37')]=qs['sort'](_0x258f7f[_0x5203('0x33')][_0x5203('0x38')]);_0xe06f78[_0x5203('0x39')]=qs['filters'](_[_0x5203('0x3a')](_0x258f7f[_0x5203('0x33')],_0x7776b8['filters']));_0xe06f78[_0x5203('0x39')][_0x5203('0x4e')]=_0x514861['id'];if(_0x258f7f['query'][_0x5203('0x3b')]){_0xe06f78[_0x5203('0x39')]=_['merge'](_0xe06f78[_0x5203('0x39')],{'$or':_['map'](_0xe06f78[_0x5203('0x35')],function(_0x316468){var _0x43ad1c={};_0x43ad1c[_0x316468]={'$like':'%'+_0x258f7f[_0x5203('0x33')][_0x5203('0x3b')]+'%'};return _0x43ad1c;})});}_0xe06f78=_[_0x5203('0x3d')]({},_0xe06f78,_0x258f7f[_0x5203('0x44')]);return db[_0x5203('0x4c')][_0x5203('0x1d')]({'where':_0xe06f78[_0x5203('0x39')]})[_0x5203('0x22')](function(_0x40742d){_0x471d8f[_0x5203('0x1d')]=_0x40742d;if(_0x258f7f[_0x5203('0x33')][_0x5203('0x43')]){_0xe06f78[_0x5203('0x3e')]=[{'all':!![]}];}return db[_0x5203('0x4c')][_0x5203('0x3f')](_0xe06f78);})[_0x5203('0x22')](function(_0x1731cc){_0x471d8f[_0x5203('0x40')]=_0x1731cc;return _0x471d8f;});}})[_0x5203('0x22')](respondWithFilteredResult(_0x3616f5,_0xe06f78))[_0x5203('0x46')](handleError(_0x3616f5,null));};
\ No newline at end of file