Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index f3e108b..a2aa5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2c9=['intersection','options','find','catch','create','body','update','params','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','SessionId','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','end','error','stack','name','send','map','JscriptySessionReport','fieldName','type','key','model','query','keys','attributes','fields','length','order','sort','filters','pick','filter','merge','where','includeAll','include','rows','then','show','rawAttributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf2c9,0xf7));var _0x9f2c=function(_0x5b82e9,_0x382fe1){_0x5b82e9=_0x5b82e9-0x0;var _0x204239=_0xf2c9[_0x5b82e9];return _0x204239;};'use strict';var pdf=require(_0x9f2c('0x0'));var emlformat=require(_0x9f2c('0x1'));var rimraf=require(_0x9f2c('0x2'));var zipdir=require(_0x9f2c('0x3'));var jsonpatch=require(_0x9f2c('0x4'));var rp=require('request-promise');var moment=require(_0x9f2c('0x5'));var BPromise=require(_0x9f2c('0x6'));var Mustache=require(_0x9f2c('0x7'));var util=require(_0x9f2c('0x8'));var path=require(_0x9f2c('0x9'));var sox=require(_0x9f2c('0xa'));var csv=require(_0x9f2c('0xb'));var ejs=require(_0x9f2c('0xc'));var fs=require('fs');var _=require(_0x9f2c('0xd'));var squel=require(_0x9f2c('0xe'));var crypto=require(_0x9f2c('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f2c('0xb'));var querystring=require('querystring');var Papa=require(_0x9f2c('0x10'));var Redis=require(_0x9f2c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f2c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f2c('0x13'));var logger=require(_0x9f2c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd933,_0x1e31e3){_0x1e31e3=_0x1e31e3||0xcc;return function(_0x46d723){if(_0x46d723){return _0x5dd933[_0x9f2c('0x15')](_0x1e31e3);}return _0x5dd933[_0x9f2c('0x16')](_0x1e31e3)['end']();};}function respondWithResult(_0x29a1d6,_0x1f0ed5){_0x1f0ed5=_0x1f0ed5||0xc8;return function(_0x27122e){if(_0x27122e){return _0x29a1d6[_0x9f2c('0x16')](_0x1f0ed5)[_0x9f2c('0x17')](_0x27122e);}};}function respondWithFilteredResult(_0x23c229,_0x5ec2cb){return function(_0x2de5d5){if(_0x2de5d5){var _0x2ccc73=_0x2de5d5[_0x9f2c('0x18')],_0x386b00=_0x5ec2cb['offset'],_0x265c7d=_0x5ec2cb[_0x9f2c('0x19')]+_0x5ec2cb[_0x9f2c('0x1a')],_0x326239;if(_0x265c7d>=_0x2ccc73){_0x265c7d=_0x2ccc73;_0x326239=0xc8;}else{_0x326239=0xce;}_0x23c229[_0x9f2c('0x16')](_0x326239);return _0x23c229[_0x9f2c('0x1b')](_0x9f2c('0x1c'),_0x386b00+'-'+_0x265c7d+'/'+_0x2ccc73)[_0x9f2c('0x17')](_0x2de5d5);}return null;};}function patchUpdates(_0x353bb2){return function(_0x1ff6dd){try{jsonpatch[_0x9f2c('0x1d')](_0x1ff6dd,_0x353bb2,!![]);}catch(_0x51e427){return BPromise[_0x9f2c('0x1e')](_0x51e427);}return _0x1ff6dd[_0x9f2c('0x1f')]();};}function saveUpdates(_0x2de552,_0x424adb){return function(_0x4ca8e4){if(_0x4ca8e4){return _0x4ca8e4['update'](_0x2de552)['then'](function(_0x5041e5){return _0x5041e5;});}return null;};}function removeEntity(_0x19a915,_0x598daa){return function(_0x4d741d){if(_0x4d741d){return _0x4d741d['destroy']()['then'](function(){_0x19a915[_0x9f2c('0x16')](0xcc)[_0x9f2c('0x20')]();});}};}function handleEntityNotFound(_0x5ca76b,_0x139604){return function(_0x2d956b){if(!_0x2d956b){_0x5ca76b[_0x9f2c('0x15')](0x194);}return _0x2d956b;};}function handleError(_0x1abec7,_0x5516be){_0x5516be=_0x5516be||0x1f4;return function(_0x28c12b){logger[_0x9f2c('0x21')](_0x28c12b[_0x9f2c('0x22')]);if(_0x28c12b['name']){delete _0x28c12b[_0x9f2c('0x23')];}_0x1abec7[_0x9f2c('0x16')](_0x5516be)[_0x9f2c('0x24')](_0x28c12b);};}exports['index']=function(_0x5b5763,_0x48b877){var _0x4275d7={},_0x2950ee={},_0x29740b={'count':0x0,'rows':[]};var _0x1facf1=_[_0x9f2c('0x25')](db[_0x9f2c('0x26')]['rawAttributes'],function(_0x444a65){return{'name':_0x444a65[_0x9f2c('0x27')],'type':_0x444a65[_0x9f2c('0x28')][_0x9f2c('0x29')]};});_0x2950ee[_0x9f2c('0x2a')]=_['map'](_0x1facf1,_0x9f2c('0x23'));_0x2950ee[_0x9f2c('0x2b')]=_[_0x9f2c('0x2c')](_0x5b5763[_0x9f2c('0x2b')]);_0x2950ee['filters']=_['intersection'](_0x2950ee[_0x9f2c('0x2a')],_0x2950ee[_0x9f2c('0x2b')]);_0x4275d7[_0x9f2c('0x2d')]=_['intersection'](_0x2950ee['model'],qs[_0x9f2c('0x2e')](_0x5b5763[_0x9f2c('0x2b')]['fields']));_0x4275d7[_0x9f2c('0x2d')]=_0x4275d7[_0x9f2c('0x2d')][_0x9f2c('0x2f')]?_0x4275d7['attributes']:_0x2950ee[_0x9f2c('0x2a')];if(!_0x5b5763[_0x9f2c('0x2b')]['hasOwnProperty']('nolimit')){_0x4275d7[_0x9f2c('0x1a')]=qs[_0x9f2c('0x1a')](_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x1a')]);_0x4275d7[_0x9f2c('0x19')]=qs[_0x9f2c('0x19')](_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x19')]);}_0x4275d7[_0x9f2c('0x30')]=qs[_0x9f2c('0x31')](_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x31')]);_0x4275d7['where']=qs[_0x9f2c('0x32')](_[_0x9f2c('0x33')](_0x5b5763[_0x9f2c('0x2b')],_0x2950ee[_0x9f2c('0x32')]),_0x1facf1);if(_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x34')]){_0x4275d7['where']=_['merge'](_0x4275d7['where'],{'$or':_[_0x9f2c('0x25')](_0x1facf1,function(_0x43b28a){if(_0x43b28a[_0x9f2c('0x28')]!=='VIRTUAL'){var _0x1882f9={};_0x1882f9[_0x43b28a['name']]={'$like':'%'+_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x34')]+'%'};return _0x1882f9;}})});}_0x4275d7=_[_0x9f2c('0x35')]({},_0x4275d7,_0x5b5763['options']);var _0x321ac3={'where':_0x4275d7[_0x9f2c('0x36')]};return db[_0x9f2c('0x26')][_0x9f2c('0x18')](_0x321ac3)['then'](function(_0x5055e5){_0x29740b[_0x9f2c('0x18')]=_0x5055e5;if(_0x5b5763[_0x9f2c('0x2b')][_0x9f2c('0x37')]){_0x4275d7[_0x9f2c('0x38')]=[{'all':!![]}];}return db[_0x9f2c('0x26')]['findAll'](_0x4275d7);})['then'](function(_0xd95ced){_0x29740b[_0x9f2c('0x39')]=_0xd95ced;return _0x29740b;})[_0x9f2c('0x3a')](respondWithFilteredResult(_0x48b877,_0x4275d7))['catch'](handleError(_0x48b877,null));};exports[_0x9f2c('0x3b')]=function(_0x2eaa4c,_0x3ade1d){var _0x14e698={'raw':!![],'where':{'id':_0x2eaa4c['params']['id']}},_0x530104={};_0x530104[_0x9f2c('0x2a')]=_['keys'](db[_0x9f2c('0x26')][_0x9f2c('0x3c')]);_0x530104['query']=_[_0x9f2c('0x2c')](_0x2eaa4c[_0x9f2c('0x2b')]);_0x530104[_0x9f2c('0x32')]=_[_0x9f2c('0x3d')](_0x530104[_0x9f2c('0x2a')],_0x530104[_0x9f2c('0x2b')]);_0x14e698[_0x9f2c('0x2d')]=_[_0x9f2c('0x3d')](_0x530104[_0x9f2c('0x2a')],qs[_0x9f2c('0x2e')](_0x2eaa4c['query'][_0x9f2c('0x2e')]));_0x14e698['attributes']=_0x14e698[_0x9f2c('0x2d')]['length']?_0x14e698[_0x9f2c('0x2d')]:_0x530104[_0x9f2c('0x2a')];if(_0x2eaa4c['query'][_0x9f2c('0x37')]){_0x14e698[_0x9f2c('0x38')]=[{'all':!![]}];}_0x14e698=_[_0x9f2c('0x35')]({},_0x14e698,_0x2eaa4c[_0x9f2c('0x3e')]);return db[_0x9f2c('0x26')][_0x9f2c('0x3f')](_0x14e698)['then'](handleEntityNotFound(_0x3ade1d,null))['then'](respondWithResult(_0x3ade1d,null))[_0x9f2c('0x40')](handleError(_0x3ade1d,null));};exports[_0x9f2c('0x41')]=function(_0x3e4bdc,_0x2d9fc2){return db[_0x9f2c('0x26')][_0x9f2c('0x41')](_0x3e4bdc[_0x9f2c('0x42')],{})[_0x9f2c('0x3a')](respondWithResult(_0x2d9fc2,0xc9))[_0x9f2c('0x40')](handleError(_0x2d9fc2,null));};exports[_0x9f2c('0x43')]=function(_0x133e6f,_0x5a7a37){if(_0x133e6f[_0x9f2c('0x42')]['id']){delete _0x133e6f[_0x9f2c('0x42')]['id'];}return db[_0x9f2c('0x26')]['find']({'where':{'id':_0x133e6f[_0x9f2c('0x44')]['id']}})[_0x9f2c('0x3a')](handleEntityNotFound(_0x5a7a37,null))[_0x9f2c('0x3a')](saveUpdates(_0x133e6f[_0x9f2c('0x42')],null))[_0x9f2c('0x3a')](respondWithResult(_0x5a7a37,null))[_0x9f2c('0x40')](handleError(_0x5a7a37,null));};exports['destroy']=function(_0x5e38cc,_0x355605){return db[_0x9f2c('0x26')][_0x9f2c('0x3f')]({'where':{'id':_0x5e38cc[_0x9f2c('0x44')]['id']}})['then'](handleEntityNotFound(_0x355605,null))[_0x9f2c('0x3a')](removeEntity(_0x355605,null))[_0x9f2c('0x40')](handleError(_0x355605,null));};exports[_0x9f2c('0x45')]=function(_0x5edba1,_0x16d001){return db['JscriptySessionReport'][_0x9f2c('0x45')]()[_0x9f2c('0x3a')](respondWithResult(_0x16d001,null))[_0x9f2c('0x40')](handleError(_0x16d001,null));};exports[_0x9f2c('0x46')]=function(_0x43f4b2,_0x1af779,_0x3da0f2){var _0x2d313f={'raw':!![],'where':{}};var _0x378612={};var _0x4bbd86={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x9f2c('0x47')]({'where':{'id':_0x43f4b2[_0x9f2c('0x44')]['id']}})[_0x9f2c('0x3a')](handleEntityNotFound(_0x1af779,null))[_0x9f2c('0x3a')](function(_0x2fe5b4){if(_0x2fe5b4){_0x378612[_0x9f2c('0x2a')]=_[_0x9f2c('0x2c')](db[_0x9f2c('0x48')][_0x9f2c('0x3c')]);_0x378612[_0x9f2c('0x2b')]=_[_0x9f2c('0x2c')](_0x43f4b2[_0x9f2c('0x2b')]);_0x378612[_0x9f2c('0x32')]=_[_0x9f2c('0x3d')](_0x378612[_0x9f2c('0x2a')],_0x378612['query']);_0x2d313f[_0x9f2c('0x2d')]=_[_0x9f2c('0x3d')](_0x378612[_0x9f2c('0x2a')],qs['fields'](_0x43f4b2[_0x9f2c('0x2b')][_0x9f2c('0x2e')]));_0x2d313f[_0x9f2c('0x2d')]=_0x2d313f[_0x9f2c('0x2d')][_0x9f2c('0x2f')]?_0x2d313f[_0x9f2c('0x2d')]:_0x378612[_0x9f2c('0x2a')];if(!_0x43f4b2['query'][_0x9f2c('0x49')](_0x9f2c('0x4a'))){_0x2d313f['limit']=qs['limit'](_0x43f4b2[_0x9f2c('0x2b')][_0x9f2c('0x1a')]);_0x2d313f[_0x9f2c('0x19')]=qs['offset'](_0x43f4b2[_0x9f2c('0x2b')][_0x9f2c('0x19')]);}_0x2d313f[_0x9f2c('0x30')]=qs[_0x9f2c('0x31')](_0x43f4b2[_0x9f2c('0x2b')]['sort']);_0x2d313f['where']=qs[_0x9f2c('0x32')](_[_0x9f2c('0x33')](_0x43f4b2['query'],_0x378612[_0x9f2c('0x32')]));_0x2d313f[_0x9f2c('0x36')][_0x9f2c('0x4b')]=_0x2fe5b4['id'];if(_0x43f4b2['query'][_0x9f2c('0x34')]){_0x2d313f[_0x9f2c('0x36')]=_['merge'](_0x2d313f[_0x9f2c('0x36')],{'$or':_[_0x9f2c('0x25')](_0x2d313f[_0x9f2c('0x2d')],function(_0x2acf50){var _0x524710={};_0x524710[_0x2acf50]={'$like':'%'+_0x43f4b2[_0x9f2c('0x2b')][_0x9f2c('0x34')]+'%'};return _0x524710;})});}_0x2d313f=_['merge']({},_0x2d313f,_0x43f4b2['options']);return db[_0x9f2c('0x48')]['count']({'where':_0x2d313f[_0x9f2c('0x36')]})[_0x9f2c('0x3a')](function(_0x3357c2){_0x4bbd86[_0x9f2c('0x18')]=_0x3357c2;if(_0x43f4b2['query'][_0x9f2c('0x37')]){_0x2d313f[_0x9f2c('0x38')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x9f2c('0x4c')](_0x2d313f);})['then'](function(_0xed90a4){_0x4bbd86[_0x9f2c('0x39')]=_0xed90a4;return _0x4bbd86;});}})['then'](respondWithFilteredResult(_0x1af779,_0x2d313f))[_0x9f2c('0x40')](handleError(_0x1af779,null));};
\ No newline at end of file
+var _0xd514=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xd514,0x148));var _0x4d51=function(_0x626673,_0x30e375){_0x626673=_0x626673-0x0;var _0x4a6d1d=_0xd514[_0x626673];return _0x4a6d1d;};'use strict';var pdf=require(_0x4d51('0x0'));var emlformat=require(_0x4d51('0x1'));var rimraf=require(_0x4d51('0x2'));var zipdir=require(_0x4d51('0x3'));var jsonpatch=require(_0x4d51('0x4'));var rp=require('request-promise');var moment=require(_0x4d51('0x5'));var BPromise=require(_0x4d51('0x6'));var Mustache=require(_0x4d51('0x7'));var util=require(_0x4d51('0x8'));var path=require('path');var sox=require(_0x4d51('0x9'));var csv=require(_0x4d51('0xa'));var ejs=require(_0x4d51('0xb'));var fs=require('fs');var _=require(_0x4d51('0xc'));var squel=require(_0x4d51('0xd'));var crypto=require(_0x4d51('0xe'));var jsforce=require(_0x4d51('0xf'));var deskjs=require(_0x4d51('0x10'));var toCsv=require(_0x4d51('0xa'));var querystring=require('querystring');var Papa=require(_0x4d51('0x11'));var Redis=require(_0x4d51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4d51('0x13'));var as=require(_0x4d51('0x14'));var hardwareService=require(_0x4d51('0x15'));var logger=require(_0x4d51('0x16'))(_0x4d51('0x17'));var utils=require(_0x4d51('0x18'));var config=require(_0x4d51('0x19'));var db=require(_0x4d51('0x1a'))['db'];function respondWithStatusCode(_0x48a1de,_0xb11df6){_0xb11df6=_0xb11df6||0xcc;return function(_0x3a9b2e){if(_0x3a9b2e){return _0x48a1de[_0x4d51('0x1b')](_0xb11df6);}return _0x48a1de[_0x4d51('0x1c')](_0xb11df6)['end']();};}function respondWithResult(_0x299935,_0x14ff6f){_0x14ff6f=_0x14ff6f||0xc8;return function(_0x1fed9e){if(_0x1fed9e){return _0x299935[_0x4d51('0x1c')](_0x14ff6f)[_0x4d51('0x1d')](_0x1fed9e);}};}function respondWithFilteredResult(_0x3a4cd6,_0x322702){return function(_0x4ef477){if(_0x4ef477){var _0x499b02=_0x4ef477[_0x4d51('0x1e')],_0x135875=_0x322702['offset'],_0x3d6cfa=_0x322702[_0x4d51('0x1f')]+_0x322702[_0x4d51('0x20')],_0x5486b3;if(_0x3d6cfa>=_0x499b02){_0x3d6cfa=_0x499b02;_0x5486b3=0xc8;}else{_0x5486b3=0xce;}_0x3a4cd6[_0x4d51('0x1c')](_0x5486b3);return _0x3a4cd6[_0x4d51('0x21')](_0x4d51('0x22'),_0x135875+'-'+_0x3d6cfa+'/'+_0x499b02)[_0x4d51('0x1d')](_0x4ef477);}return null;};}function patchUpdates(_0x86b050){return function(_0x2f4352){try{jsonpatch[_0x4d51('0x23')](_0x2f4352,_0x86b050,!![]);}catch(_0x95aa17){return BPromise['reject'](_0x95aa17);}return _0x2f4352[_0x4d51('0x24')]();};}function saveUpdates(_0x1acd32,_0x354b13){return function(_0x5d63cb){if(_0x5d63cb){return _0x5d63cb[_0x4d51('0x25')](_0x1acd32)['then'](function(_0x49332c){return _0x49332c;});}return null;};}function removeEntity(_0x5ccfad,_0x1a3075){return function(_0x31fdd3){if(_0x31fdd3){return _0x31fdd3['destroy']()[_0x4d51('0x26')](function(){_0x5ccfad[_0x4d51('0x1c')](0xcc)[_0x4d51('0x27')]();});}};}function handleEntityNotFound(_0x1ae77f,_0x10a859){return function(_0x46a1ce){if(!_0x46a1ce){_0x1ae77f[_0x4d51('0x1b')](0x194);}return _0x46a1ce;};}function handleError(_0x6dbb20,_0x49735f){_0x49735f=_0x49735f||0x1f4;return function(_0x52fd65){logger[_0x4d51('0x28')](_0x52fd65[_0x4d51('0x29')]);if(_0x52fd65['name']){delete _0x52fd65[_0x4d51('0x2a')];}_0x6dbb20['status'](_0x49735f)[_0x4d51('0x2b')](_0x52fd65);};}exports['index']=function(_0x47387d,_0xfbeff){var _0xb18c3c={},_0x193dfd={},_0x49ec62={'count':0x0,'rows':[]};var _0x46417a=_[_0x4d51('0x2c')](db[_0x4d51('0x2d')][_0x4d51('0x2e')],function(_0x189158){return{'name':_0x189158[_0x4d51('0x2f')],'type':_0x189158[_0x4d51('0x30')][_0x4d51('0x31')]};});_0x193dfd[_0x4d51('0x32')]=_[_0x4d51('0x2c')](_0x46417a,_0x4d51('0x2a'));_0x193dfd[_0x4d51('0x33')]=_[_0x4d51('0x34')](_0x47387d[_0x4d51('0x33')]);_0x193dfd['filters']=_[_0x4d51('0x35')](_0x193dfd[_0x4d51('0x32')],_0x193dfd['query']);_0xb18c3c[_0x4d51('0x36')]=_[_0x4d51('0x35')](_0x193dfd[_0x4d51('0x32')],qs[_0x4d51('0x37')](_0x47387d[_0x4d51('0x33')]['fields']));_0xb18c3c[_0x4d51('0x36')]=_0xb18c3c['attributes'][_0x4d51('0x38')]?_0xb18c3c[_0x4d51('0x36')]:_0x193dfd[_0x4d51('0x32')];if(!_0x47387d[_0x4d51('0x33')][_0x4d51('0x39')](_0x4d51('0x3a'))){_0xb18c3c[_0x4d51('0x20')]=qs[_0x4d51('0x20')](_0x47387d[_0x4d51('0x33')][_0x4d51('0x20')]);_0xb18c3c[_0x4d51('0x1f')]=qs[_0x4d51('0x1f')](_0x47387d[_0x4d51('0x33')]['offset']);}_0xb18c3c[_0x4d51('0x3b')]=qs[_0x4d51('0x3c')](_0x47387d[_0x4d51('0x33')][_0x4d51('0x3c')]);_0xb18c3c[_0x4d51('0x3d')]=qs[_0x4d51('0x3e')](_[_0x4d51('0x3f')](_0x47387d[_0x4d51('0x33')],_0x193dfd[_0x4d51('0x3e')]),_0x46417a);if(_0x47387d[_0x4d51('0x33')][_0x4d51('0x40')]){_0xb18c3c[_0x4d51('0x3d')]=_[_0x4d51('0x41')](_0xb18c3c[_0x4d51('0x3d')],{'$or':_[_0x4d51('0x2c')](_0x46417a,function(_0x20cf47){if(_0x20cf47[_0x4d51('0x30')]!==_0x4d51('0x42')){var _0x242fe8={};_0x242fe8[_0x20cf47[_0x4d51('0x2a')]]={'$like':'%'+_0x47387d['query'][_0x4d51('0x40')]+'%'};return _0x242fe8;}})});}_0xb18c3c=_['merge']({},_0xb18c3c,_0x47387d[_0x4d51('0x43')]);var _0x29de5d={'where':_0xb18c3c[_0x4d51('0x3d')]};return db[_0x4d51('0x2d')][_0x4d51('0x1e')](_0x29de5d)[_0x4d51('0x26')](function(_0x2c3870){_0x49ec62['count']=_0x2c3870;if(_0x47387d[_0x4d51('0x33')][_0x4d51('0x44')]){_0xb18c3c[_0x4d51('0x45')]=[{'all':!![]}];}return db[_0x4d51('0x2d')]['findAll'](_0xb18c3c);})[_0x4d51('0x26')](function(_0x5552f2){_0x49ec62[_0x4d51('0x46')]=_0x5552f2;return _0x49ec62;})[_0x4d51('0x26')](respondWithFilteredResult(_0xfbeff,_0xb18c3c))['catch'](handleError(_0xfbeff,null));};exports[_0x4d51('0x47')]=function(_0x15cf43,_0x2b2b0f){var _0x50a315={'raw':!![],'where':{'id':_0x15cf43[_0x4d51('0x48')]['id']}},_0x4e0c42={};_0x4e0c42[_0x4d51('0x32')]=_[_0x4d51('0x34')](db[_0x4d51('0x2d')][_0x4d51('0x2e')]);_0x4e0c42[_0x4d51('0x33')]=_[_0x4d51('0x34')](_0x15cf43['query']);_0x4e0c42[_0x4d51('0x3e')]=_[_0x4d51('0x35')](_0x4e0c42[_0x4d51('0x32')],_0x4e0c42[_0x4d51('0x33')]);_0x50a315[_0x4d51('0x36')]=_['intersection'](_0x4e0c42[_0x4d51('0x32')],qs[_0x4d51('0x37')](_0x15cf43[_0x4d51('0x33')]['fields']));_0x50a315['attributes']=_0x50a315['attributes'][_0x4d51('0x38')]?_0x50a315[_0x4d51('0x36')]:_0x4e0c42['model'];if(_0x15cf43[_0x4d51('0x33')]['includeAll']){_0x50a315['include']=[{'all':!![]}];}_0x50a315=_[_0x4d51('0x41')]({},_0x50a315,_0x15cf43[_0x4d51('0x43')]);return db['JscriptySessionReport'][_0x4d51('0x49')](_0x50a315)[_0x4d51('0x26')](handleEntityNotFound(_0x2b2b0f,null))[_0x4d51('0x26')](respondWithResult(_0x2b2b0f,null))[_0x4d51('0x4a')](handleError(_0x2b2b0f,null));};exports[_0x4d51('0x4b')]=function(_0x1c7abf,_0x26415f){return db[_0x4d51('0x2d')][_0x4d51('0x4b')](_0x1c7abf[_0x4d51('0x4c')],{})[_0x4d51('0x26')](respondWithResult(_0x26415f,0xc9))[_0x4d51('0x4a')](handleError(_0x26415f,null));};exports[_0x4d51('0x25')]=function(_0x82d60,_0x15c5b2){if(_0x82d60[_0x4d51('0x4c')]['id']){delete _0x82d60[_0x4d51('0x4c')]['id'];}return db[_0x4d51('0x2d')]['find']({'where':{'id':_0x82d60[_0x4d51('0x48')]['id']}})[_0x4d51('0x26')](handleEntityNotFound(_0x15c5b2,null))[_0x4d51('0x26')](saveUpdates(_0x82d60['body'],null))[_0x4d51('0x26')](respondWithResult(_0x15c5b2,null))['catch'](handleError(_0x15c5b2,null));};exports[_0x4d51('0x4d')]=function(_0x518063,_0xc46adb){return db['JscriptySessionReport']['find']({'where':{'id':_0x518063[_0x4d51('0x48')]['id']}})['then'](handleEntityNotFound(_0xc46adb,null))[_0x4d51('0x26')](removeEntity(_0xc46adb,null))[_0x4d51('0x4a')](handleError(_0xc46adb,null));};exports[_0x4d51('0x4e')]=function(_0x123d06,_0xab7bc5){return db[_0x4d51('0x2d')][_0x4d51('0x4e')]()[_0x4d51('0x26')](respondWithResult(_0xab7bc5,null))[_0x4d51('0x4a')](handleError(_0xab7bc5,null));};exports[_0x4d51('0x4f')]=function(_0x245d9b,_0x6556d4,_0xea2109){var _0x3379e6={'raw':!![],'where':{}};var _0x59173b={};var _0x58958c={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4d51('0x50')]({'where':{'id':_0x245d9b[_0x4d51('0x48')]['id']}})[_0x4d51('0x26')](handleEntityNotFound(_0x6556d4,null))[_0x4d51('0x26')](function(_0x387a01){if(_0x387a01){_0x59173b[_0x4d51('0x32')]=_['keys'](db['JscriptyQuestionReport'][_0x4d51('0x2e')]);_0x59173b['query']=_[_0x4d51('0x34')](_0x245d9b[_0x4d51('0x33')]);_0x59173b[_0x4d51('0x3e')]=_[_0x4d51('0x35')](_0x59173b['model'],_0x59173b[_0x4d51('0x33')]);_0x3379e6[_0x4d51('0x36')]=_[_0x4d51('0x35')](_0x59173b['model'],qs[_0x4d51('0x37')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x37')]));_0x3379e6[_0x4d51('0x36')]=_0x3379e6[_0x4d51('0x36')][_0x4d51('0x38')]?_0x3379e6[_0x4d51('0x36')]:_0x59173b[_0x4d51('0x32')];if(!_0x245d9b[_0x4d51('0x33')][_0x4d51('0x39')](_0x4d51('0x3a'))){_0x3379e6[_0x4d51('0x20')]=qs[_0x4d51('0x20')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x20')]);_0x3379e6[_0x4d51('0x1f')]=qs[_0x4d51('0x1f')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x1f')]);}_0x3379e6[_0x4d51('0x3b')]=qs['sort'](_0x245d9b[_0x4d51('0x33')]['sort']);_0x3379e6[_0x4d51('0x3d')]=qs[_0x4d51('0x3e')](_[_0x4d51('0x3f')](_0x245d9b[_0x4d51('0x33')],_0x59173b[_0x4d51('0x3e')]));_0x3379e6['where'][_0x4d51('0x51')]=_0x387a01['id'];if(_0x245d9b[_0x4d51('0x33')][_0x4d51('0x40')]){_0x3379e6[_0x4d51('0x3d')]=_[_0x4d51('0x41')](_0x3379e6[_0x4d51('0x3d')],{'$or':_[_0x4d51('0x2c')](_0x3379e6[_0x4d51('0x36')],function(_0xf1f81f){var _0x5de4eb={};_0x5de4eb[_0xf1f81f]={'$like':'%'+_0x245d9b[_0x4d51('0x33')][_0x4d51('0x40')]+'%'};return _0x5de4eb;})});}_0x3379e6=_[_0x4d51('0x41')]({},_0x3379e6,_0x245d9b[_0x4d51('0x43')]);return db[_0x4d51('0x52')]['count']({'where':_0x3379e6[_0x4d51('0x3d')]})[_0x4d51('0x26')](function(_0x176513){_0x58958c[_0x4d51('0x1e')]=_0x176513;if(_0x245d9b[_0x4d51('0x33')][_0x4d51('0x44')]){_0x3379e6[_0x4d51('0x45')]=[{'all':!![]}];}return db[_0x4d51('0x52')][_0x4d51('0x53')](_0x3379e6);})['then'](function(_0x10e79f){_0x58958c['rows']=_0x10e79f;return _0x58958c;});}})[_0x4d51('0x26')](respondWithFilteredResult(_0x6556d4,_0x3379e6))[_0x4d51('0x4a')](handleError(_0x6556d4,null));};
\ No newline at end of file