Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 894d8e3..40b2e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c83=['map','JscriptySessionReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','body','describe','getQuestions','findOne','hasOwnProperty','nolimit','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2c83,0x124));var _0x32c8=function(_0x5331d6,_0x226b55){_0x5331d6=_0x5331d6-0x0;var _0x4fce9a=_0x2c83[_0x5331d6];return _0x4fce9a;};'use strict';var emlformat=require(_0x32c8('0x0'));var rimraf=require(_0x32c8('0x1'));var zipdir=require(_0x32c8('0x2'));var jsonpatch=require(_0x32c8('0x3'));var rp=require(_0x32c8('0x4'));var moment=require('moment');var BPromise=require(_0x32c8('0x5'));var Mustache=require(_0x32c8('0x6'));var util=require(_0x32c8('0x7'));var path=require(_0x32c8('0x8'));var sox=require(_0x32c8('0x9'));var csv=require(_0x32c8('0xa'));var ejs=require(_0x32c8('0xb'));var fs=require('fs');var fs_extra=require(_0x32c8('0xc'));var _=require(_0x32c8('0xd'));var squel=require('squel');var crypto=require(_0x32c8('0xe'));var jsforce=require(_0x32c8('0xf'));var deskjs=require(_0x32c8('0x10'));var toCsv=require(_0x32c8('0xa'));var querystring=require(_0x32c8('0x11'));var Papa=require(_0x32c8('0x12'));var Redis=require(_0x32c8('0x13'));var authService=require(_0x32c8('0x14'));var qs=require(_0x32c8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32c8('0x16'));var logger=require(_0x32c8('0x17'))(_0x32c8('0x18'));var utils=require(_0x32c8('0x19'));var config=require(_0x32c8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x32c8('0x1b'))['db'];function respondWithStatusCode(_0x353078,_0x1b4d1e){_0x1b4d1e=_0x1b4d1e||0xcc;return function(_0x166f15){if(_0x166f15){return _0x353078[_0x32c8('0x1c')](_0x1b4d1e);}return _0x353078[_0x32c8('0x1d')](_0x1b4d1e)[_0x32c8('0x1e')]();};}function respondWithResult(_0x49d268,_0x17b149){_0x17b149=_0x17b149||0xc8;return function(_0x3cdaa6){if(_0x3cdaa6){return _0x49d268['status'](_0x17b149)[_0x32c8('0x1f')](_0x3cdaa6);}};}function respondWithFilteredResult(_0x33c481,_0x49d1d0){return function(_0x33c2f7){if(_0x33c2f7){var _0x1288cc=typeof _0x49d1d0[_0x32c8('0x20')]===_0x32c8('0x21')&&typeof _0x49d1d0[_0x32c8('0x22')]===_0x32c8('0x21');var _0x3623ff=_0x33c2f7[_0x32c8('0x23')];var _0x5db91f=_0x1288cc?0x0:_0x49d1d0['offset'];var _0x556b3d=_0x1288cc?_0x33c2f7[_0x32c8('0x23')]:_0x49d1d0['offset']+_0x49d1d0['limit'];var _0x162264;if(_0x556b3d>=_0x3623ff){_0x556b3d=_0x3623ff;_0x162264=0xc8;}else{_0x162264=0xce;}_0x33c481[_0x32c8('0x1d')](_0x162264);return _0x33c481[_0x32c8('0x24')](_0x32c8('0x25'),_0x5db91f+'-'+_0x556b3d+'/'+_0x3623ff)[_0x32c8('0x1f')](_0x33c2f7);}return null;};}function patchUpdates(_0x3544bf){return function(_0x42935a){try{jsonpatch[_0x32c8('0x26')](_0x42935a,_0x3544bf,!![]);}catch(_0x3ef90d){return BPromise[_0x32c8('0x27')](_0x3ef90d);}return _0x42935a['save']();};}function saveUpdates(_0x3d186f,_0x58b2e3){return function(_0x2d5667){if(_0x2d5667){return _0x2d5667[_0x32c8('0x28')](_0x3d186f)[_0x32c8('0x29')](function(_0x35a7e1){return _0x35a7e1;});}return null;};}function removeEntity(_0x1459c2,_0x5ee5a1){return function(_0xcd8da5){if(_0xcd8da5){return _0xcd8da5[_0x32c8('0x2a')]()[_0x32c8('0x29')](function(){_0x1459c2[_0x32c8('0x1d')](0xcc)[_0x32c8('0x1e')]();});}};}function handleEntityNotFound(_0x18926b,_0xa43351){return function(_0x59459e){if(!_0x59459e){_0x18926b[_0x32c8('0x1c')](0x194);}return _0x59459e;};}function handleError(_0x2b00b,_0x57d6bb){_0x57d6bb=_0x57d6bb||0x1f4;return function(_0x3c96f2){logger[_0x32c8('0x2b')](_0x3c96f2[_0x32c8('0x2c')]);if(_0x3c96f2['name']){delete _0x3c96f2[_0x32c8('0x2d')];}_0x2b00b[_0x32c8('0x1d')](_0x57d6bb)[_0x32c8('0x2e')](_0x3c96f2);};}exports[_0x32c8('0x2f')]=function(_0x3c5a50,_0x240027){var _0xd2e182={},_0x3cea16={},_0x249ce9={'count':0x0,'rows':[]};var _0x3ed98f=_[_0x32c8('0x30')](db[_0x32c8('0x31')][_0x32c8('0x32')],function(_0x59bb39){return{'name':_0x59bb39['fieldName'],'type':_0x59bb39['type'][_0x32c8('0x33')]};});_0x3cea16[_0x32c8('0x34')]=_[_0x32c8('0x30')](_0x3ed98f,'name');_0x3cea16[_0x32c8('0x35')]=_[_0x32c8('0x36')](_0x3c5a50[_0x32c8('0x35')]);_0x3cea16[_0x32c8('0x37')]=_[_0x32c8('0x38')](_0x3cea16[_0x32c8('0x34')],_0x3cea16[_0x32c8('0x35')]);_0xd2e182[_0x32c8('0x39')]=_['intersection'](_0x3cea16[_0x32c8('0x34')],qs['fields'](_0x3c5a50['query'][_0x32c8('0x3a')]));_0xd2e182['attributes']=_0xd2e182[_0x32c8('0x39')][_0x32c8('0x3b')]?_0xd2e182[_0x32c8('0x39')]:_0x3cea16[_0x32c8('0x34')];if(!_0x3c5a50[_0x32c8('0x35')]['hasOwnProperty']('nolimit')){_0xd2e182[_0x32c8('0x22')]=qs[_0x32c8('0x22')](_0x3c5a50[_0x32c8('0x35')]['limit']);_0xd2e182['offset']=qs['offset'](_0x3c5a50[_0x32c8('0x35')][_0x32c8('0x20')]);}_0xd2e182[_0x32c8('0x3c')]=qs[_0x32c8('0x3d')](_0x3c5a50[_0x32c8('0x35')]['sort']);_0xd2e182[_0x32c8('0x3e')]=qs[_0x32c8('0x37')](_[_0x32c8('0x3f')](_0x3c5a50[_0x32c8('0x35')],_0x3cea16[_0x32c8('0x37')]),_0x3ed98f);if(_0x3c5a50[_0x32c8('0x35')][_0x32c8('0x40')]){_0xd2e182[_0x32c8('0x3e')]=_['merge'](_0xd2e182[_0x32c8('0x3e')],{'$or':_['map'](_0x3ed98f,function(_0x45dc58){if(_0x45dc58[_0x32c8('0x41')]!==_0x32c8('0x42')){var _0x5d0067={};_0x5d0067[_0x45dc58[_0x32c8('0x2d')]]={'$like':'%'+_0x3c5a50[_0x32c8('0x35')][_0x32c8('0x40')]+'%'};return _0x5d0067;}})});}_0xd2e182=_[_0x32c8('0x43')]({},_0xd2e182,_0x3c5a50['options']);var _0x470cd9={'where':_0xd2e182[_0x32c8('0x3e')]};return db['JscriptySessionReport'][_0x32c8('0x23')](_0x470cd9)['then'](function(_0x41811c){_0x249ce9[_0x32c8('0x23')]=_0x41811c;if(_0x3c5a50[_0x32c8('0x35')][_0x32c8('0x44')]){_0xd2e182['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x32c8('0x45')](_0xd2e182);})[_0x32c8('0x29')](function(_0x2f106d){_0x249ce9[_0x32c8('0x46')]=_0x2f106d;return _0x249ce9;})[_0x32c8('0x29')](respondWithFilteredResult(_0x240027,_0xd2e182))[_0x32c8('0x47')](handleError(_0x240027,null));};exports[_0x32c8('0x48')]=function(_0x2a7c90,_0x59cf0f){var _0x1afe62={'raw':!![],'where':{'id':_0x2a7c90[_0x32c8('0x49')]['id']}},_0x27bcf5={};_0x27bcf5[_0x32c8('0x34')]=_[_0x32c8('0x36')](db[_0x32c8('0x31')][_0x32c8('0x32')]);_0x27bcf5['query']=_[_0x32c8('0x36')](_0x2a7c90[_0x32c8('0x35')]);_0x27bcf5['filters']=_[_0x32c8('0x38')](_0x27bcf5[_0x32c8('0x34')],_0x27bcf5[_0x32c8('0x35')]);_0x1afe62[_0x32c8('0x39')]=_[_0x32c8('0x38')](_0x27bcf5['model'],qs[_0x32c8('0x3a')](_0x2a7c90[_0x32c8('0x35')][_0x32c8('0x3a')]));_0x1afe62[_0x32c8('0x39')]=_0x1afe62['attributes'][_0x32c8('0x3b')]?_0x1afe62[_0x32c8('0x39')]:_0x27bcf5[_0x32c8('0x34')];if(_0x2a7c90[_0x32c8('0x35')]['includeAll']){_0x1afe62[_0x32c8('0x4a')]=[{'all':!![]}];}_0x1afe62=_[_0x32c8('0x43')]({},_0x1afe62,_0x2a7c90[_0x32c8('0x4b')]);return db[_0x32c8('0x31')][_0x32c8('0x4c')](_0x1afe62)['then'](handleEntityNotFound(_0x59cf0f,null))[_0x32c8('0x29')](respondWithResult(_0x59cf0f,null))[_0x32c8('0x47')](handleError(_0x59cf0f,null));};exports['create']=function(_0x7f5122,_0x34eaa3){return db[_0x32c8('0x31')]['create'](_0x7f5122[_0x32c8('0x4d')],{})[_0x32c8('0x29')](respondWithResult(_0x34eaa3,0xc9))[_0x32c8('0x47')](handleError(_0x34eaa3,null));};exports[_0x32c8('0x28')]=function(_0x40ded5,_0x3fd7b4){if(_0x40ded5['body']['id']){delete _0x40ded5[_0x32c8('0x4d')]['id'];}return db['JscriptySessionReport'][_0x32c8('0x4c')]({'where':{'id':_0x40ded5[_0x32c8('0x49')]['id']}})['then'](handleEntityNotFound(_0x3fd7b4,null))[_0x32c8('0x29')](saveUpdates(_0x40ded5['body'],null))[_0x32c8('0x29')](respondWithResult(_0x3fd7b4,null))[_0x32c8('0x47')](handleError(_0x3fd7b4,null));};exports[_0x32c8('0x2a')]=function(_0x1220c3,_0xf0f916){return db[_0x32c8('0x31')]['find']({'where':{'id':_0x1220c3[_0x32c8('0x49')]['id']}})[_0x32c8('0x29')](handleEntityNotFound(_0xf0f916,null))[_0x32c8('0x29')](removeEntity(_0xf0f916,null))[_0x32c8('0x47')](handleError(_0xf0f916,null));};exports[_0x32c8('0x4e')]=function(_0x4a2f98,_0x3f2cd8){return db[_0x32c8('0x31')][_0x32c8('0x4e')]()[_0x32c8('0x29')](respondWithResult(_0x3f2cd8,null))['catch'](handleError(_0x3f2cd8,null));};exports[_0x32c8('0x4f')]=function(_0x8a11b1,_0x1519c2,_0x3a6e79){var _0x3e7844={'raw':!![],'where':{}};var _0x14ae6f={};var _0x51fb79={'count':0x0,'rows':[]};return db[_0x32c8('0x31')][_0x32c8('0x50')]({'where':{'id':_0x8a11b1[_0x32c8('0x49')]['id']}})[_0x32c8('0x29')](handleEntityNotFound(_0x1519c2,null))[_0x32c8('0x29')](function(_0x21aec0){if(_0x21aec0){_0x14ae6f[_0x32c8('0x34')]=_[_0x32c8('0x36')](db['JscriptyQuestionReport']['rawAttributes']);_0x14ae6f[_0x32c8('0x35')]=_['keys'](_0x8a11b1[_0x32c8('0x35')]);_0x14ae6f[_0x32c8('0x37')]=_[_0x32c8('0x38')](_0x14ae6f[_0x32c8('0x34')],_0x14ae6f['query']);_0x3e7844['attributes']=_[_0x32c8('0x38')](_0x14ae6f[_0x32c8('0x34')],qs['fields'](_0x8a11b1[_0x32c8('0x35')]['fields']));_0x3e7844[_0x32c8('0x39')]=_0x3e7844[_0x32c8('0x39')]['length']?_0x3e7844[_0x32c8('0x39')]:_0x14ae6f[_0x32c8('0x34')];if(!_0x8a11b1[_0x32c8('0x35')][_0x32c8('0x51')](_0x32c8('0x52'))){_0x3e7844[_0x32c8('0x22')]=qs[_0x32c8('0x22')](_0x8a11b1[_0x32c8('0x35')]['limit']);_0x3e7844[_0x32c8('0x20')]=qs[_0x32c8('0x20')](_0x8a11b1[_0x32c8('0x35')][_0x32c8('0x20')]);}_0x3e7844['order']=qs[_0x32c8('0x3d')](_0x8a11b1[_0x32c8('0x35')][_0x32c8('0x3d')]);_0x3e7844[_0x32c8('0x3e')]=qs[_0x32c8('0x37')](_[_0x32c8('0x3f')](_0x8a11b1[_0x32c8('0x35')],_0x14ae6f['filters']));_0x3e7844['where'][_0x32c8('0x53')]=_0x21aec0['id'];if(_0x8a11b1[_0x32c8('0x35')][_0x32c8('0x40')]){_0x3e7844[_0x32c8('0x3e')]=_[_0x32c8('0x43')](_0x3e7844[_0x32c8('0x3e')],{'$or':_['map'](_0x3e7844[_0x32c8('0x39')],function(_0x351745){var _0x455d1a={};_0x455d1a[_0x351745]={'$like':'%'+_0x8a11b1[_0x32c8('0x35')]['filter']+'%'};return _0x455d1a;})});}_0x3e7844=_[_0x32c8('0x43')]({},_0x3e7844,_0x8a11b1['options']);return db[_0x32c8('0x54')]['count']({'where':_0x3e7844[_0x32c8('0x3e')]})[_0x32c8('0x29')](function(_0x5c0113){_0x51fb79[_0x32c8('0x23')]=_0x5c0113;if(_0x8a11b1[_0x32c8('0x35')][_0x32c8('0x44')]){_0x3e7844[_0x32c8('0x4a')]=[{'all':!![]}];}return db[_0x32c8('0x54')][_0x32c8('0x45')](_0x3e7844);})[_0x32c8('0x29')](function(_0x523afc){_0x51fb79[_0x32c8('0x46')]=_0x523afc;return _0x51fb79;});}})[_0x32c8('0x29')](respondWithFilteredResult(_0x1519c2,_0x3e7844))[_0x32c8('0x47')](handleError(_0x1519c2,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