Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 5e4e96d..1936015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa985=['name','JscriptySessionReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','limit','order','where','merge','filter','includeAll','findAll','rows','catch','params','fields','include','options','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','sort','pick','SessionId','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0xf5ec57,_0x6b1180){var _0xaa0598=function(_0x2440c9){while(--_0x2440c9){_0xf5ec57['push'](_0xf5ec57['shift']());}};_0xaa0598(++_0x6b1180);}(_0xa985,0x105));var _0x5a98=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xa985[_0x599e60];return _0x468e19;};'use strict';var pdf=require(_0x5a98('0x0'));var emlformat=require(_0x5a98('0x1'));var rimraf=require(_0x5a98('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a98('0x3'));var rp=require(_0x5a98('0x4'));var moment=require('moment');var BPromise=require(_0x5a98('0x5'));var Mustache=require(_0x5a98('0x6'));var util=require(_0x5a98('0x7'));var path=require('path');var sox=require(_0x5a98('0x8'));var csv=require('to-csv');var ejs=require(_0x5a98('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5a98('0xa'));var crypto=require(_0x5a98('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a98('0xc'));var toCsv=require(_0x5a98('0xd'));var querystring=require(_0x5a98('0xe'));var Papa=require(_0x5a98('0xf'));var Redis=require('ioredis');var authService=require(_0x5a98('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5a98('0x11'));var hardwareService=require(_0x5a98('0x12'));var logger=require('../../config/logger')(_0x5a98('0x13'));var utils=require('../../config/utils');var config=require(_0x5a98('0x14'));var db=require(_0x5a98('0x15'))['db'];function respondWithStatusCode(_0x5db1ad,_0x3ffc5e){_0x3ffc5e=_0x3ffc5e||0xcc;return function(_0x2b1113){if(_0x2b1113){return _0x5db1ad[_0x5a98('0x16')](_0x3ffc5e);}return _0x5db1ad[_0x5a98('0x17')](_0x3ffc5e)[_0x5a98('0x18')]();};}function respondWithResult(_0xce6a8a,_0x3850d9){_0x3850d9=_0x3850d9||0xc8;return function(_0x5ae1f5){if(_0x5ae1f5){return _0xce6a8a['status'](_0x3850d9)['json'](_0x5ae1f5);}};}function respondWithFilteredResult(_0x4c3a3e,_0x4424aa){return function(_0x3a660f){if(_0x3a660f){var _0x5206e8=_0x3a660f[_0x5a98('0x19')],_0x2882b1=_0x4424aa['offset'],_0x2c8cf8=_0x4424aa[_0x5a98('0x1a')]+_0x4424aa['limit'],_0x44fe60;if(_0x2c8cf8>=_0x5206e8){_0x2c8cf8=_0x5206e8;_0x44fe60=0xc8;}else{_0x44fe60=0xce;}_0x4c3a3e[_0x5a98('0x17')](_0x44fe60);return _0x4c3a3e[_0x5a98('0x1b')](_0x5a98('0x1c'),_0x2882b1+'-'+_0x2c8cf8+'/'+_0x5206e8)['json'](_0x3a660f);}return null;};}function patchUpdates(_0x322a70){return function(_0x2eea9a){try{jsonpatch[_0x5a98('0x1d')](_0x2eea9a,_0x322a70,!![]);}catch(_0x244c70){return BPromise[_0x5a98('0x1e')](_0x244c70);}return _0x2eea9a[_0x5a98('0x1f')]();};}function saveUpdates(_0x5b4d0b,_0x1be507){return function(_0x926711){if(_0x926711){return _0x926711['update'](_0x5b4d0b)[_0x5a98('0x20')](function(_0x389d41){return _0x389d41;});}return null;};}function removeEntity(_0x287d70,_0x2a3ecf){return function(_0xbb7ad6){if(_0xbb7ad6){return _0xbb7ad6['destroy']()[_0x5a98('0x20')](function(){_0x287d70[_0x5a98('0x17')](0xcc)[_0x5a98('0x18')]();});}};}function handleEntityNotFound(_0x45d7a7,_0x28010a){return function(_0x4423a7){if(!_0x4423a7){_0x45d7a7[_0x5a98('0x16')](0x194);}return _0x4423a7;};}function handleError(_0x29e3de,_0x32f40e){_0x32f40e=_0x32f40e||0x1f4;return function(_0x13beeb){logger[_0x5a98('0x21')](_0x13beeb[_0x5a98('0x22')]);if(_0x13beeb['name']){delete _0x13beeb[_0x5a98('0x23')];}_0x29e3de[_0x5a98('0x17')](_0x32f40e)['send'](_0x13beeb);};}exports['index']=function(_0x1a43b8,_0x1ffaed){var _0x31a005={},_0x5c45ea={},_0x33534f={'count':0x0,'rows':[]};var _0x501dcb=_['map'](db[_0x5a98('0x24')][_0x5a98('0x25')],function(_0x869ab6){return{'name':_0x869ab6[_0x5a98('0x26')],'type':_0x869ab6['type'][_0x5a98('0x27')]};});_0x5c45ea[_0x5a98('0x28')]=_[_0x5a98('0x29')](_0x501dcb,_0x5a98('0x23'));_0x5c45ea[_0x5a98('0x2a')]=_[_0x5a98('0x2b')](_0x1a43b8[_0x5a98('0x2a')]);_0x5c45ea[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x5c45ea[_0x5a98('0x28')],_0x5c45ea[_0x5a98('0x2a')]);_0x31a005[_0x5a98('0x2e')]=_['intersection'](_0x5c45ea['model'],qs['fields'](_0x1a43b8[_0x5a98('0x2a')]['fields']));_0x31a005['attributes']=_0x31a005['attributes'][_0x5a98('0x2f')]?_0x31a005[_0x5a98('0x2e')]:_0x5c45ea[_0x5a98('0x28')];if(!_0x1a43b8[_0x5a98('0x2a')]['hasOwnProperty'](_0x5a98('0x30'))){_0x31a005[_0x5a98('0x31')]=qs['limit'](_0x1a43b8[_0x5a98('0x2a')]['limit']);_0x31a005[_0x5a98('0x1a')]=qs[_0x5a98('0x1a')](_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x1a')]);}_0x31a005[_0x5a98('0x32')]=qs['sort'](_0x1a43b8[_0x5a98('0x2a')]['sort']);_0x31a005[_0x5a98('0x33')]=qs[_0x5a98('0x2c')](_['pick'](_0x1a43b8[_0x5a98('0x2a')],_0x5c45ea[_0x5a98('0x2c')]),_0x501dcb);if(_0x1a43b8[_0x5a98('0x2a')]['filter']){_0x31a005[_0x5a98('0x33')]=_[_0x5a98('0x34')](_0x31a005[_0x5a98('0x33')],{'$or':_['map'](_0x501dcb,function(_0x49e20b){if(_0x49e20b['type']!=='VIRTUAL'){var _0xffead2={};_0xffead2[_0x49e20b[_0x5a98('0x23')]]={'$like':'%'+_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x35')]+'%'};return _0xffead2;}})});}_0x31a005=_['merge']({},_0x31a005,_0x1a43b8['options']);var _0x4edd8f={'where':_0x31a005[_0x5a98('0x33')]};return db['JscriptySessionReport'][_0x5a98('0x19')](_0x4edd8f)['then'](function(_0x2942aa){_0x33534f[_0x5a98('0x19')]=_0x2942aa;if(_0x1a43b8[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x31a005['include']=[{'all':!![]}];}return db[_0x5a98('0x24')][_0x5a98('0x37')](_0x31a005);})['then'](function(_0x4e3bcf){_0x33534f[_0x5a98('0x38')]=_0x4e3bcf;return _0x33534f;})[_0x5a98('0x20')](respondWithFilteredResult(_0x1ffaed,_0x31a005))[_0x5a98('0x39')](handleError(_0x1ffaed,null));};exports['show']=function(_0x38833b,_0x12bf4b){var _0x17303b={'raw':!![],'where':{'id':_0x38833b[_0x5a98('0x3a')]['id']}},_0x3f5f9d={};_0x3f5f9d[_0x5a98('0x28')]=_[_0x5a98('0x2b')](db[_0x5a98('0x24')]['rawAttributes']);_0x3f5f9d['query']=_[_0x5a98('0x2b')](_0x38833b[_0x5a98('0x2a')]);_0x3f5f9d[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x3f5f9d[_0x5a98('0x28')],_0x3f5f9d[_0x5a98('0x2a')]);_0x17303b[_0x5a98('0x2e')]=_[_0x5a98('0x2d')](_0x3f5f9d['model'],qs[_0x5a98('0x3b')](_0x38833b['query'][_0x5a98('0x3b')]));_0x17303b[_0x5a98('0x2e')]=_0x17303b[_0x5a98('0x2e')]['length']?_0x17303b[_0x5a98('0x2e')]:_0x3f5f9d['model'];if(_0x38833b[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x17303b[_0x5a98('0x3c')]=[{'all':!![]}];}_0x17303b=_[_0x5a98('0x34')]({},_0x17303b,_0x38833b[_0x5a98('0x3d')]);return db[_0x5a98('0x24')][_0x5a98('0x3e')](_0x17303b)[_0x5a98('0x20')](handleEntityNotFound(_0x12bf4b,null))[_0x5a98('0x20')](respondWithResult(_0x12bf4b,null))['catch'](handleError(_0x12bf4b,null));};exports[_0x5a98('0x3f')]=function(_0xbcf40e,_0x4981c7){return db[_0x5a98('0x24')][_0x5a98('0x3f')](_0xbcf40e[_0x5a98('0x40')],{})[_0x5a98('0x20')](respondWithResult(_0x4981c7,0xc9))[_0x5a98('0x39')](handleError(_0x4981c7,null));};exports['update']=function(_0x2609e1,_0x51c453){if(_0x2609e1[_0x5a98('0x40')]['id']){delete _0x2609e1[_0x5a98('0x40')]['id'];}return db['JscriptySessionReport'][_0x5a98('0x3e')]({'where':{'id':_0x2609e1['params']['id']}})['then'](handleEntityNotFound(_0x51c453,null))[_0x5a98('0x20')](saveUpdates(_0x2609e1[_0x5a98('0x40')],null))[_0x5a98('0x20')](respondWithResult(_0x51c453,null))['catch'](handleError(_0x51c453,null));};exports[_0x5a98('0x41')]=function(_0x3adba4,_0x5b0177){return db[_0x5a98('0x24')][_0x5a98('0x3e')]({'where':{'id':_0x3adba4['params']['id']}})['then'](handleEntityNotFound(_0x5b0177,null))[_0x5a98('0x20')](removeEntity(_0x5b0177,null))['catch'](handleError(_0x5b0177,null));};exports['describe']=function(_0x10deaa,_0x8861ae){return db[_0x5a98('0x24')][_0x5a98('0x42')]()[_0x5a98('0x20')](respondWithResult(_0x8861ae,null))['catch'](handleError(_0x8861ae,null));};exports[_0x5a98('0x43')]=function(_0x12bd6c,_0x35d9e9,_0xcd2423){var _0x5a2e03={'raw':!![],'where':{}};var _0x2b2736={};var _0x649fde={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x5a98('0x44')]({'where':{'id':_0x12bd6c['params']['id']}})[_0x5a98('0x20')](handleEntityNotFound(_0x35d9e9,null))[_0x5a98('0x20')](function(_0xcece02){if(_0xcece02){_0x2b2736[_0x5a98('0x28')]=_['keys'](db[_0x5a98('0x45')][_0x5a98('0x25')]);_0x2b2736['query']=_[_0x5a98('0x2b')](_0x12bd6c[_0x5a98('0x2a')]);_0x2b2736[_0x5a98('0x2c')]=_[_0x5a98('0x2d')](_0x2b2736[_0x5a98('0x28')],_0x2b2736[_0x5a98('0x2a')]);_0x5a2e03[_0x5a98('0x2e')]=_['intersection'](_0x2b2736[_0x5a98('0x28')],qs[_0x5a98('0x3b')](_0x12bd6c['query'][_0x5a98('0x3b')]));_0x5a2e03[_0x5a98('0x2e')]=_0x5a2e03['attributes'][_0x5a98('0x2f')]?_0x5a2e03[_0x5a98('0x2e')]:_0x2b2736[_0x5a98('0x28')];if(!_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x46')](_0x5a98('0x30'))){_0x5a2e03[_0x5a98('0x31')]=qs[_0x5a98('0x31')](_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x31')]);_0x5a2e03[_0x5a98('0x1a')]=qs[_0x5a98('0x1a')](_0x12bd6c[_0x5a98('0x2a')]['offset']);}_0x5a2e03['order']=qs[_0x5a98('0x47')](_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x47')]);_0x5a2e03[_0x5a98('0x33')]=qs['filters'](_[_0x5a98('0x48')](_0x12bd6c['query'],_0x2b2736[_0x5a98('0x2c')]));_0x5a2e03['where'][_0x5a98('0x49')]=_0xcece02['id'];if(_0x12bd6c['query'][_0x5a98('0x35')]){_0x5a2e03[_0x5a98('0x33')]=_['merge'](_0x5a2e03[_0x5a98('0x33')],{'$or':_[_0x5a98('0x29')](_0x5a2e03[_0x5a98('0x2e')],function(_0x1515d3){var _0x34536d={};_0x34536d[_0x1515d3]={'$like':'%'+_0x12bd6c[_0x5a98('0x2a')]['filter']+'%'};return _0x34536d;})});}_0x5a2e03=_['merge']({},_0x5a2e03,_0x12bd6c['options']);return db[_0x5a98('0x45')]['count']({'where':_0x5a2e03[_0x5a98('0x33')]})[_0x5a98('0x20')](function(_0x279c66){_0x649fde[_0x5a98('0x19')]=_0x279c66;if(_0x12bd6c[_0x5a98('0x2a')][_0x5a98('0x36')]){_0x5a2e03['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5a98('0x37')](_0x5a2e03);})[_0x5a98('0x20')](function(_0x16981b){_0x649fde[_0x5a98('0x38')]=_0x16981b;return _0x649fde;});}})['then'](respondWithFilteredResult(_0x35d9e9,_0x5a2e03))['catch'](handleError(_0x35d9e9,null));};
\ No newline at end of file
+var _0xb2c6=['status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','then','includeAll','show','params','keys','include','find','catch','create','body','describe','getQuestions','findOne','hasOwnProperty','order','filter','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3d1187,_0x2a8e79){var _0x3ceb4d=function(_0x54aa9b){while(--_0x54aa9b){_0x3d1187['push'](_0x3d1187['shift']());}};_0x3ceb4d(++_0x2a8e79);}(_0xb2c6,0x1a5));var _0x6b2c=function(_0x480fa6,_0xbe1ffc){_0x480fa6=_0x480fa6-0x0;var _0x3c61a1=_0xb2c6[_0x480fa6];return _0x3c61a1;};'use strict';var pdf=require(_0x6b2c('0x0'));var emlformat=require(_0x6b2c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6b2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b2c('0x3'));var moment=require(_0x6b2c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6b2c('0x5'));var util=require(_0x6b2c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6b2c('0x7'));var ejs=require(_0x6b2c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b2c('0x9'));var crypto=require(_0x6b2c('0xa'));var jsforce=require(_0x6b2c('0xb'));var deskjs=require(_0x6b2c('0xc'));var toCsv=require(_0x6b2c('0x7'));var querystring=require(_0x6b2c('0xd'));var Papa=require(_0x6b2c('0xe'));var Redis=require('ioredis');var authService=require(_0x6b2c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b2c('0x10'));var logger=require(_0x6b2c('0x11'))(_0x6b2c('0x12'));var utils=require(_0x6b2c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b2c('0x14'));var db=require(_0x6b2c('0x15'))['db'];function respondWithStatusCode(_0x41f178,_0x3aa3c2){_0x3aa3c2=_0x3aa3c2||0xcc;return function(_0x2c0f5a){if(_0x2c0f5a){return _0x41f178[_0x6b2c('0x16')](_0x3aa3c2);}return _0x41f178[_0x6b2c('0x17')](_0x3aa3c2)[_0x6b2c('0x18')]();};}function respondWithResult(_0x2c29db,_0x36981b){_0x36981b=_0x36981b||0xc8;return function(_0xd2b71){if(_0xd2b71){return _0x2c29db[_0x6b2c('0x17')](_0x36981b)[_0x6b2c('0x19')](_0xd2b71);}};}function respondWithFilteredResult(_0x57bdd3,_0x417090){return function(_0x143e4e){if(_0x143e4e){var _0x10b863=_0x143e4e[_0x6b2c('0x1a')],_0x3510bc=_0x417090['offset'],_0x495172=_0x417090[_0x6b2c('0x1b')]+_0x417090['limit'],_0x108477;if(_0x495172>=_0x10b863){_0x495172=_0x10b863;_0x108477=0xc8;}else{_0x108477=0xce;}_0x57bdd3[_0x6b2c('0x17')](_0x108477);return _0x57bdd3[_0x6b2c('0x1c')](_0x6b2c('0x1d'),_0x3510bc+'-'+_0x495172+'/'+_0x10b863)['json'](_0x143e4e);}return null;};}function patchUpdates(_0x57ffd9){return function(_0x5b2362){try{jsonpatch[_0x6b2c('0x1e')](_0x5b2362,_0x57ffd9,!![]);}catch(_0x2e0f75){return BPromise[_0x6b2c('0x1f')](_0x2e0f75);}return _0x5b2362[_0x6b2c('0x20')]();};}function saveUpdates(_0x2680e4,_0x3b1a5d){return function(_0x40c909){if(_0x40c909){return _0x40c909['update'](_0x2680e4)['then'](function(_0x1765e6){return _0x1765e6;});}return null;};}function removeEntity(_0xbf20a,_0x8f2747){return function(_0x15b622){if(_0x15b622){return _0x15b622[_0x6b2c('0x21')]()['then'](function(){_0xbf20a['status'](0xcc)[_0x6b2c('0x18')]();});}};}function handleEntityNotFound(_0x13d1f1,_0x32a18e){return function(_0x151500){if(!_0x151500){_0x13d1f1['sendStatus'](0x194);}return _0x151500;};}function handleError(_0x4594ec,_0x164136){_0x164136=_0x164136||0x1f4;return function(_0xfe7a0d){logger['error'](_0xfe7a0d['stack']);if(_0xfe7a0d[_0x6b2c('0x22')]){delete _0xfe7a0d['name'];}_0x4594ec[_0x6b2c('0x17')](_0x164136)[_0x6b2c('0x23')](_0xfe7a0d);};}exports[_0x6b2c('0x24')]=function(_0x2a40a9,_0x5e981f){var _0x32f3b6={},_0x2a9747={},_0x2c10ac={'count':0x0,'rows':[]};var _0x41895e=_[_0x6b2c('0x25')](db[_0x6b2c('0x26')][_0x6b2c('0x27')],function(_0x43c4f0){return{'name':_0x43c4f0[_0x6b2c('0x28')],'type':_0x43c4f0[_0x6b2c('0x29')][_0x6b2c('0x2a')]};});_0x2a9747[_0x6b2c('0x2b')]=_[_0x6b2c('0x25')](_0x41895e,_0x6b2c('0x22'));_0x2a9747[_0x6b2c('0x2c')]=_['keys'](_0x2a40a9[_0x6b2c('0x2c')]);_0x2a9747[_0x6b2c('0x2d')]=_[_0x6b2c('0x2e')](_0x2a9747[_0x6b2c('0x2b')],_0x2a9747['query']);_0x32f3b6['attributes']=_[_0x6b2c('0x2e')](_0x2a9747[_0x6b2c('0x2b')],qs['fields'](_0x2a40a9[_0x6b2c('0x2c')][_0x6b2c('0x2f')]));_0x32f3b6[_0x6b2c('0x30')]=_0x32f3b6['attributes'][_0x6b2c('0x31')]?_0x32f3b6[_0x6b2c('0x30')]:_0x2a9747[_0x6b2c('0x2b')];if(!_0x2a40a9[_0x6b2c('0x2c')]['hasOwnProperty'](_0x6b2c('0x32'))){_0x32f3b6[_0x6b2c('0x33')]=qs[_0x6b2c('0x33')](_0x2a40a9[_0x6b2c('0x2c')][_0x6b2c('0x33')]);_0x32f3b6[_0x6b2c('0x1b')]=qs[_0x6b2c('0x1b')](_0x2a40a9[_0x6b2c('0x2c')]['offset']);}_0x32f3b6['order']=qs[_0x6b2c('0x34')](_0x2a40a9[_0x6b2c('0x2c')][_0x6b2c('0x34')]);_0x32f3b6[_0x6b2c('0x35')]=qs[_0x6b2c('0x2d')](_[_0x6b2c('0x36')](_0x2a40a9[_0x6b2c('0x2c')],_0x2a9747[_0x6b2c('0x2d')]),_0x41895e);if(_0x2a40a9[_0x6b2c('0x2c')]['filter']){_0x32f3b6[_0x6b2c('0x35')]=_[_0x6b2c('0x37')](_0x32f3b6[_0x6b2c('0x35')],{'$or':_[_0x6b2c('0x25')](_0x41895e,function(_0xfe5bd4){if(_0xfe5bd4[_0x6b2c('0x29')]!==_0x6b2c('0x38')){var _0x533f81={};_0x533f81[_0xfe5bd4[_0x6b2c('0x22')]]={'$like':'%'+_0x2a40a9['query']['filter']+'%'};return _0x533f81;}})});}_0x32f3b6=_[_0x6b2c('0x37')]({},_0x32f3b6,_0x2a40a9[_0x6b2c('0x39')]);var _0x2e073d={'where':_0x32f3b6[_0x6b2c('0x35')]};return db[_0x6b2c('0x26')]['count'](_0x2e073d)[_0x6b2c('0x3a')](function(_0x292967){_0x2c10ac[_0x6b2c('0x1a')]=_0x292967;if(_0x2a40a9[_0x6b2c('0x2c')][_0x6b2c('0x3b')]){_0x32f3b6['include']=[{'all':!![]}];}return db[_0x6b2c('0x26')]['findAll'](_0x32f3b6);})[_0x6b2c('0x3a')](function(_0x55d564){_0x2c10ac['rows']=_0x55d564;return _0x2c10ac;})['then'](respondWithFilteredResult(_0x5e981f,_0x32f3b6))['catch'](handleError(_0x5e981f,null));};exports[_0x6b2c('0x3c')]=function(_0x2bd619,_0x22cff1){var _0x34bc06={'raw':!![],'where':{'id':_0x2bd619[_0x6b2c('0x3d')]['id']}},_0x3edeb8={};_0x3edeb8[_0x6b2c('0x2b')]=_[_0x6b2c('0x3e')](db['JscriptySessionReport'][_0x6b2c('0x27')]);_0x3edeb8[_0x6b2c('0x2c')]=_['keys'](_0x2bd619[_0x6b2c('0x2c')]);_0x3edeb8['filters']=_[_0x6b2c('0x2e')](_0x3edeb8[_0x6b2c('0x2b')],_0x3edeb8[_0x6b2c('0x2c')]);_0x34bc06[_0x6b2c('0x30')]=_[_0x6b2c('0x2e')](_0x3edeb8[_0x6b2c('0x2b')],qs[_0x6b2c('0x2f')](_0x2bd619[_0x6b2c('0x2c')][_0x6b2c('0x2f')]));_0x34bc06[_0x6b2c('0x30')]=_0x34bc06['attributes']['length']?_0x34bc06[_0x6b2c('0x30')]:_0x3edeb8[_0x6b2c('0x2b')];if(_0x2bd619[_0x6b2c('0x2c')]['includeAll']){_0x34bc06[_0x6b2c('0x3f')]=[{'all':!![]}];}_0x34bc06=_['merge']({},_0x34bc06,_0x2bd619[_0x6b2c('0x39')]);return db['JscriptySessionReport'][_0x6b2c('0x40')](_0x34bc06)[_0x6b2c('0x3a')](handleEntityNotFound(_0x22cff1,null))[_0x6b2c('0x3a')](respondWithResult(_0x22cff1,null))[_0x6b2c('0x41')](handleError(_0x22cff1,null));};exports[_0x6b2c('0x42')]=function(_0x45ecdb,_0x5ccd50){return db[_0x6b2c('0x26')]['create'](_0x45ecdb[_0x6b2c('0x43')],{})['then'](respondWithResult(_0x5ccd50,0xc9))[_0x6b2c('0x41')](handleError(_0x5ccd50,null));};exports['update']=function(_0x56c262,_0x3f0e60){if(_0x56c262[_0x6b2c('0x43')]['id']){delete _0x56c262[_0x6b2c('0x43')]['id'];}return db[_0x6b2c('0x26')]['find']({'where':{'id':_0x56c262[_0x6b2c('0x3d')]['id']}})[_0x6b2c('0x3a')](handleEntityNotFound(_0x3f0e60,null))['then'](saveUpdates(_0x56c262[_0x6b2c('0x43')],null))[_0x6b2c('0x3a')](respondWithResult(_0x3f0e60,null))[_0x6b2c('0x41')](handleError(_0x3f0e60,null));};exports['destroy']=function(_0x3c816b,_0x2d2f78){return db[_0x6b2c('0x26')][_0x6b2c('0x40')]({'where':{'id':_0x3c816b[_0x6b2c('0x3d')]['id']}})[_0x6b2c('0x3a')](handleEntityNotFound(_0x2d2f78,null))['then'](removeEntity(_0x2d2f78,null))[_0x6b2c('0x41')](handleError(_0x2d2f78,null));};exports[_0x6b2c('0x44')]=function(_0x186bb0,_0x31b21c){return db[_0x6b2c('0x26')][_0x6b2c('0x44')]()[_0x6b2c('0x3a')](respondWithResult(_0x31b21c,null))[_0x6b2c('0x41')](handleError(_0x31b21c,null));};exports[_0x6b2c('0x45')]=function(_0x5e567a,_0x29ee4c,_0x102f17){var _0x3df00c={'raw':!![],'where':{}};var _0x1af921={};var _0x43a949={'count':0x0,'rows':[]};return db[_0x6b2c('0x26')][_0x6b2c('0x46')]({'where':{'id':_0x5e567a[_0x6b2c('0x3d')]['id']}})[_0x6b2c('0x3a')](handleEntityNotFound(_0x29ee4c,null))['then'](function(_0x146ab2){if(_0x146ab2){_0x1af921[_0x6b2c('0x2b')]=_[_0x6b2c('0x3e')](db['JscriptyQuestionReport'][_0x6b2c('0x27')]);_0x1af921[_0x6b2c('0x2c')]=_[_0x6b2c('0x3e')](_0x5e567a[_0x6b2c('0x2c')]);_0x1af921['filters']=_[_0x6b2c('0x2e')](_0x1af921[_0x6b2c('0x2b')],_0x1af921[_0x6b2c('0x2c')]);_0x3df00c[_0x6b2c('0x30')]=_['intersection'](_0x1af921['model'],qs[_0x6b2c('0x2f')](_0x5e567a['query'][_0x6b2c('0x2f')]));_0x3df00c[_0x6b2c('0x30')]=_0x3df00c['attributes'][_0x6b2c('0x31')]?_0x3df00c[_0x6b2c('0x30')]:_0x1af921[_0x6b2c('0x2b')];if(!_0x5e567a[_0x6b2c('0x2c')][_0x6b2c('0x47')](_0x6b2c('0x32'))){_0x3df00c[_0x6b2c('0x33')]=qs[_0x6b2c('0x33')](_0x5e567a['query'][_0x6b2c('0x33')]);_0x3df00c[_0x6b2c('0x1b')]=qs[_0x6b2c('0x1b')](_0x5e567a['query'][_0x6b2c('0x1b')]);}_0x3df00c[_0x6b2c('0x48')]=qs[_0x6b2c('0x34')](_0x5e567a[_0x6b2c('0x2c')]['sort']);_0x3df00c['where']=qs[_0x6b2c('0x2d')](_[_0x6b2c('0x36')](_0x5e567a[_0x6b2c('0x2c')],_0x1af921[_0x6b2c('0x2d')]));_0x3df00c[_0x6b2c('0x35')]['SessionId']=_0x146ab2['id'];if(_0x5e567a[_0x6b2c('0x2c')][_0x6b2c('0x49')]){_0x3df00c['where']=_['merge'](_0x3df00c[_0x6b2c('0x35')],{'$or':_[_0x6b2c('0x25')](_0x3df00c['attributes'],function(_0x5a7cae){var _0x1fdab3={};_0x1fdab3[_0x5a7cae]={'$like':'%'+_0x5e567a[_0x6b2c('0x2c')][_0x6b2c('0x49')]+'%'};return _0x1fdab3;})});}_0x3df00c=_[_0x6b2c('0x37')]({},_0x3df00c,_0x5e567a[_0x6b2c('0x39')]);return db['JscriptyQuestionReport'][_0x6b2c('0x1a')]({'where':_0x3df00c[_0x6b2c('0x35')]})[_0x6b2c('0x3a')](function(_0xa4df7e){_0x43a949[_0x6b2c('0x1a')]=_0xa4df7e;if(_0x5e567a[_0x6b2c('0x2c')][_0x6b2c('0x3b')]){_0x3df00c[_0x6b2c('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x3df00c);})[_0x6b2c('0x3a')](function(_0x4cf5f2){_0x43a949['rows']=_0x4cf5f2;return _0x43a949;});}})[_0x6b2c('0x3a')](respondWithFilteredResult(_0x29ee4c,_0x3df00c))[_0x6b2c('0x41')](handleError(_0x29ee4c,null));};
\ No newline at end of file