Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index 8faf787..6d881b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf88=['offset','limit','apply','reject','save','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','options','JscriptySessionReport','findAll','catch','show','params','includeAll','include','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','order','SessionId','merge','rows','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xdf88,0x7b));var _0x8df8=function(_0x515965,_0x1863c8){_0x515965=_0x515965-0x0;var _0x8352ad=_0xdf88[_0x515965];return _0x8352ad;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8df8('0x0'));var jsonpatch=require(_0x8df8('0x1'));var rp=require('request-promise');var moment=require(_0x8df8('0x2'));var BPromise=require(_0x8df8('0x3'));var Mustache=require(_0x8df8('0x4'));var util=require(_0x8df8('0x5'));var path=require('path');var sox=require(_0x8df8('0x6'));var csv=require(_0x8df8('0x7'));var ejs=require(_0x8df8('0x8'));var fs=require('fs');var _=require(_0x8df8('0x9'));var squel=require(_0x8df8('0xa'));var crypto=require('crypto');var jsforce=require(_0x8df8('0xb'));var deskjs=require(_0x8df8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8df8('0xd'));var Papa=require(_0x8df8('0xe'));var Redis=require(_0x8df8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8df8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8df8('0x11'));var utils=require(_0x8df8('0x12'));var config=require(_0x8df8('0x13'));var db=require(_0x8df8('0x14'))['db'];function respondWithStatusCode(_0x5aa41f,_0x47583c){_0x47583c=_0x47583c||0xcc;return function(_0x58528f){if(_0x58528f){return _0x5aa41f['sendStatus'](_0x47583c);}return _0x5aa41f[_0x8df8('0x15')](_0x47583c)[_0x8df8('0x16')]();};}function respondWithResult(_0x118b3b,_0x4c50be){_0x4c50be=_0x4c50be||0xc8;return function(_0x45d59b){if(_0x45d59b){return _0x118b3b[_0x8df8('0x15')](_0x4c50be)[_0x8df8('0x17')](_0x45d59b);}};}function respondWithFilteredResult(_0x3d7719,_0x3257d9){return function(_0x387e90){if(_0x387e90){var _0x406699=_0x387e90[_0x8df8('0x18')],_0x2b9a72=_0x3257d9[_0x8df8('0x19')],_0x1c11cd=_0x3257d9[_0x8df8('0x19')]+_0x3257d9[_0x8df8('0x1a')],_0xb4ddf7;if(_0x1c11cd>=_0x406699){_0x1c11cd=_0x406699;_0xb4ddf7=0xc8;}else{_0xb4ddf7=0xce;}_0x3d7719[_0x8df8('0x15')](_0xb4ddf7);return _0x3d7719['set']('Content-Range',_0x2b9a72+'-'+_0x1c11cd+'/'+_0x406699)['json'](_0x387e90);}return null;};}function patchUpdates(_0xe89826){return function(_0x344450){try{jsonpatch[_0x8df8('0x1b')](_0x344450,_0xe89826,!![]);}catch(_0x19285f){return BPromise[_0x8df8('0x1c')](_0x19285f);}return _0x344450[_0x8df8('0x1d')]();};}function saveUpdates(_0x2ccafb,_0xfcf619){return function(_0xf09eba){if(_0xf09eba){return _0xf09eba['update'](_0x2ccafb)[_0x8df8('0x1e')](function(_0x3d4f81){return _0x3d4f81;});}return null;};}function removeEntity(_0x3efa69,_0x148e1c){return function(_0x2b67e4){if(_0x2b67e4){return _0x2b67e4['destroy']()[_0x8df8('0x1e')](function(){_0x3efa69[_0x8df8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52822e,_0x5c2f43){return function(_0x1feb88){if(!_0x1feb88){_0x52822e[_0x8df8('0x1f')](0x194);}return _0x1feb88;};}function handleError(_0x44482a,_0x336e46){_0x336e46=_0x336e46||0x1f4;return function(_0x4b81fd){logger['error'](_0x4b81fd[_0x8df8('0x20')]);if(_0x4b81fd[_0x8df8('0x21')]){delete _0x4b81fd[_0x8df8('0x21')];}_0x44482a[_0x8df8('0x15')](_0x336e46)[_0x8df8('0x22')](_0x4b81fd);};}exports[_0x8df8('0x23')]=function(_0x5a01fb,_0x548ac6){var _0x3df583={},_0x13e37f={},_0x546e8e={'count':0x0,'rows':[]};var _0x1fe6b6=_[_0x8df8('0x24')](db['JscriptySessionReport'][_0x8df8('0x25')],function(_0x56ec0f){return{'name':_0x56ec0f[_0x8df8('0x26')],'type':_0x56ec0f[_0x8df8('0x27')]['key']};});_0x13e37f['model']=_[_0x8df8('0x24')](_0x1fe6b6,_0x8df8('0x21'));_0x13e37f[_0x8df8('0x28')]=_[_0x8df8('0x29')](_0x5a01fb[_0x8df8('0x28')]);_0x13e37f[_0x8df8('0x2a')]=_[_0x8df8('0x2b')](_0x13e37f[_0x8df8('0x2c')],_0x13e37f[_0x8df8('0x28')]);_0x3df583['attributes']=_['intersection'](_0x13e37f[_0x8df8('0x2c')],qs[_0x8df8('0x2d')](_0x5a01fb[_0x8df8('0x28')]['fields']));_0x3df583[_0x8df8('0x2e')]=_0x3df583[_0x8df8('0x2e')][_0x8df8('0x2f')]?_0x3df583['attributes']:_0x13e37f[_0x8df8('0x2c')];if(!_0x5a01fb['query'][_0x8df8('0x30')]('nolimit')){_0x3df583[_0x8df8('0x1a')]=qs['limit'](_0x5a01fb[_0x8df8('0x28')][_0x8df8('0x1a')]);_0x3df583['offset']=qs[_0x8df8('0x19')](_0x5a01fb[_0x8df8('0x28')]['offset']);}_0x3df583['order']=qs[_0x8df8('0x31')](_0x5a01fb['query']['sort']);_0x3df583[_0x8df8('0x32')]=qs['filters'](_['pick'](_0x5a01fb[_0x8df8('0x28')],_0x13e37f[_0x8df8('0x2a')]));if(_0x5a01fb['query'][_0x8df8('0x33')]){_0x3df583[_0x8df8('0x32')]=_['merge'](_0x3df583[_0x8df8('0x32')],{'$or':_[_0x8df8('0x24')](_0x1fe6b6,function(_0x5f4b97){if(_0x5f4b97[_0x8df8('0x27')]!==_0x8df8('0x34')){var _0x43c315={};_0x43c315[_0x5f4b97[_0x8df8('0x21')]]={'$like':'%'+_0x5a01fb[_0x8df8('0x28')][_0x8df8('0x33')]+'%'};return _0x43c315;}})});}_0x3df583=_['merge']({},_0x3df583,_0x5a01fb[_0x8df8('0x35')]);var _0x43e9ef={'where':_0x3df583['where']};return db[_0x8df8('0x36')][_0x8df8('0x18')](_0x43e9ef)[_0x8df8('0x1e')](function(_0x1b4df1){_0x546e8e[_0x8df8('0x18')]=_0x1b4df1;if(_0x5a01fb[_0x8df8('0x28')]['includeAll']){_0x3df583['include']=[{'all':!![]}];}return db[_0x8df8('0x36')][_0x8df8('0x37')](_0x3df583);})['then'](function(_0x231dc2){_0x546e8e['rows']=_0x231dc2;return _0x546e8e;})[_0x8df8('0x1e')](respondWithFilteredResult(_0x548ac6,_0x3df583))[_0x8df8('0x38')](handleError(_0x548ac6,null));};exports[_0x8df8('0x39')]=function(_0x1d8ae4,_0xcbc566){var _0x3ab060={'raw':!![],'where':{'id':_0x1d8ae4[_0x8df8('0x3a')]['id']}},_0x498fae={};_0x498fae['model']=_[_0x8df8('0x29')](db[_0x8df8('0x36')][_0x8df8('0x25')]);_0x498fae[_0x8df8('0x28')]=_[_0x8df8('0x29')](_0x1d8ae4[_0x8df8('0x28')]);_0x498fae[_0x8df8('0x2a')]=_[_0x8df8('0x2b')](_0x498fae[_0x8df8('0x2c')],_0x498fae[_0x8df8('0x28')]);_0x3ab060['attributes']=_[_0x8df8('0x2b')](_0x498fae['model'],qs[_0x8df8('0x2d')](_0x1d8ae4[_0x8df8('0x28')][_0x8df8('0x2d')]));_0x3ab060[_0x8df8('0x2e')]=_0x3ab060[_0x8df8('0x2e')][_0x8df8('0x2f')]?_0x3ab060[_0x8df8('0x2e')]:_0x498fae[_0x8df8('0x2c')];if(_0x1d8ae4[_0x8df8('0x28')][_0x8df8('0x3b')]){_0x3ab060[_0x8df8('0x3c')]=[{'all':!![]}];}_0x3ab060=_['merge']({},_0x3ab060,_0x1d8ae4[_0x8df8('0x35')]);return db['JscriptySessionReport'][_0x8df8('0x3d')](_0x3ab060)[_0x8df8('0x1e')](handleEntityNotFound(_0xcbc566,null))[_0x8df8('0x1e')](respondWithResult(_0xcbc566,null))['catch'](handleError(_0xcbc566,null));};exports[_0x8df8('0x3e')]=function(_0x494785,_0x573e30){return db[_0x8df8('0x36')][_0x8df8('0x3e')](_0x494785[_0x8df8('0x3f')],{})[_0x8df8('0x1e')](respondWithResult(_0x573e30,0xc9))[_0x8df8('0x38')](handleError(_0x573e30,null));};exports[_0x8df8('0x40')]=function(_0x334159,_0x386ff5){if(_0x334159['body']['id']){delete _0x334159['body']['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x334159[_0x8df8('0x3a')]['id']}})[_0x8df8('0x1e')](handleEntityNotFound(_0x386ff5,null))[_0x8df8('0x1e')](saveUpdates(_0x334159[_0x8df8('0x3f')],null))[_0x8df8('0x1e')](respondWithResult(_0x386ff5,null))[_0x8df8('0x38')](handleError(_0x386ff5,null));};exports['destroy']=function(_0x2d8587,_0x2315e1){return db[_0x8df8('0x36')][_0x8df8('0x3d')]({'where':{'id':_0x2d8587[_0x8df8('0x3a')]['id']}})[_0x8df8('0x1e')](handleEntityNotFound(_0x2315e1,null))[_0x8df8('0x1e')](removeEntity(_0x2315e1,null))[_0x8df8('0x38')](handleError(_0x2315e1,null));};exports[_0x8df8('0x41')]=function(_0x2ab230,_0x20367e){return db['JscriptySessionReport'][_0x8df8('0x41')]()[_0x8df8('0x1e')](respondWithResult(_0x20367e,null))[_0x8df8('0x38')](handleError(_0x20367e,null));};exports[_0x8df8('0x42')]=function(_0x883fc2,_0xc1e4f8,_0xfa3e67){var _0x38c12b={'raw':!![],'where':{}};var _0x4bbff1={};var _0x23d143={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x8df8('0x43')]({'where':{'id':_0x883fc2[_0x8df8('0x3a')]['id']}})[_0x8df8('0x1e')](handleEntityNotFound(_0xc1e4f8,null))[_0x8df8('0x1e')](function(_0x491f0d){if(_0x491f0d){_0x4bbff1[_0x8df8('0x2c')]=_['keys'](db[_0x8df8('0x44')][_0x8df8('0x25')]);_0x4bbff1['query']=_[_0x8df8('0x29')](_0x883fc2[_0x8df8('0x28')]);_0x4bbff1['filters']=_['intersection'](_0x4bbff1[_0x8df8('0x2c')],_0x4bbff1[_0x8df8('0x28')]);_0x38c12b[_0x8df8('0x2e')]=_['intersection'](_0x4bbff1[_0x8df8('0x2c')],qs['fields'](_0x883fc2[_0x8df8('0x28')][_0x8df8('0x2d')]));_0x38c12b[_0x8df8('0x2e')]=_0x38c12b['attributes'][_0x8df8('0x2f')]?_0x38c12b[_0x8df8('0x2e')]:_0x4bbff1[_0x8df8('0x2c')];if(!_0x883fc2[_0x8df8('0x28')]['hasOwnProperty'](_0x8df8('0x45'))){_0x38c12b[_0x8df8('0x1a')]=qs['limit'](_0x883fc2[_0x8df8('0x28')]['limit']);_0x38c12b['offset']=qs[_0x8df8('0x19')](_0x883fc2[_0x8df8('0x28')]['offset']);}_0x38c12b[_0x8df8('0x46')]=qs['sort'](_0x883fc2['query'][_0x8df8('0x31')]);_0x38c12b['where']=qs[_0x8df8('0x2a')](_['pick'](_0x883fc2[_0x8df8('0x28')],_0x4bbff1[_0x8df8('0x2a')]));_0x38c12b[_0x8df8('0x32')][_0x8df8('0x47')]=_0x491f0d['id'];if(_0x883fc2[_0x8df8('0x28')][_0x8df8('0x33')]){_0x38c12b['where']=_[_0x8df8('0x48')](_0x38c12b[_0x8df8('0x32')],{'$or':_['map'](_0x38c12b['attributes'],function(_0x5e9a75){var _0x57f5a4={};_0x57f5a4[_0x5e9a75]={'$like':'%'+_0x883fc2[_0x8df8('0x28')]['filter']+'%'};return _0x57f5a4;})});}_0x38c12b=_['merge']({},_0x38c12b,_0x883fc2[_0x8df8('0x35')]);return db['JscriptyQuestionReport'][_0x8df8('0x18')]({'where':_0x38c12b[_0x8df8('0x32')]})[_0x8df8('0x1e')](function(_0x2b08d0){_0x23d143['count']=_0x2b08d0;if(_0x883fc2[_0x8df8('0x28')][_0x8df8('0x3b')]){_0x38c12b['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8df8('0x37')](_0x38c12b);})['then'](function(_0x5953e2){_0x23d143[_0x8df8('0x49')]=_0x5953e2;return _0x23d143;});}})[_0x8df8('0x1e')](respondWithFilteredResult(_0xc1e4f8,_0x38c12b))['catch'](handleError(_0xc1e4f8,null));};
\ No newline at end of file
+var _0xa2dc=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','options','JscriptySessionReport','includeAll','include','catch','show','params','find','create','body','destroy','getQuestions','findOne','JscriptyQuestionReport','findAll','rows','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x571825,_0x41b7a0){var _0x8c32e7=function(_0x1db730){while(--_0x1db730){_0x571825['push'](_0x571825['shift']());}};_0x8c32e7(++_0x41b7a0);}(_0xa2dc,0x14a));var _0xca2d=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0xa2dc[_0x27d958];return _0x53e63e;};'use strict';var pdf=require(_0xca2d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xca2d('0x1'));var zipdir=require(_0xca2d('0x2'));var jsonpatch=require(_0xca2d('0x3'));var rp=require(_0xca2d('0x4'));var moment=require(_0xca2d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xca2d('0x6'));var util=require(_0xca2d('0x7'));var path=require(_0xca2d('0x8'));var sox=require(_0xca2d('0x9'));var csv=require(_0xca2d('0xa'));var ejs=require(_0xca2d('0xb'));var fs=require('fs');var _=require(_0xca2d('0xc'));var squel=require(_0xca2d('0xd'));var crypto=require(_0xca2d('0xe'));var jsforce=require(_0xca2d('0xf'));var deskjs=require(_0xca2d('0x10'));var toCsv=require(_0xca2d('0xa'));var querystring=require(_0xca2d('0x11'));var Papa=require(_0xca2d('0x12'));var Redis=require('ioredis');var authService=require(_0xca2d('0x13'));var qs=require(_0xca2d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca2d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xca2d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xca2d('0x17'))['db'];function respondWithStatusCode(_0x4ee272,_0x52b49a){_0x52b49a=_0x52b49a||0xcc;return function(_0x5e5652){if(_0x5e5652){return _0x4ee272[_0xca2d('0x18')](_0x52b49a);}return _0x4ee272[_0xca2d('0x19')](_0x52b49a)[_0xca2d('0x1a')]();};}function respondWithResult(_0x1e1932,_0x4a6e0c){_0x4a6e0c=_0x4a6e0c||0xc8;return function(_0x512d8){if(_0x512d8){return _0x1e1932[_0xca2d('0x19')](_0x4a6e0c)['json'](_0x512d8);}};}function respondWithFilteredResult(_0x34d079,_0x535cdf){return function(_0x52b9a9){if(_0x52b9a9){var _0x5b5c75=_0x52b9a9[_0xca2d('0x1b')],_0x36cd44=_0x535cdf[_0xca2d('0x1c')],_0x44e8ea=_0x535cdf['offset']+_0x535cdf['limit'],_0x35bd94;if(_0x44e8ea>=_0x5b5c75){_0x44e8ea=_0x5b5c75;_0x35bd94=0xc8;}else{_0x35bd94=0xce;}_0x34d079['status'](_0x35bd94);return _0x34d079['set'](_0xca2d('0x1d'),_0x36cd44+'-'+_0x44e8ea+'/'+_0x5b5c75)[_0xca2d('0x1e')](_0x52b9a9);}return null;};}function patchUpdates(_0x5dd1f6){return function(_0x405bae){try{jsonpatch['apply'](_0x405bae,_0x5dd1f6,!![]);}catch(_0x451f48){return BPromise['reject'](_0x451f48);}return _0x405bae[_0xca2d('0x1f')]();};}function saveUpdates(_0x4a7cf8,_0x5da4bb){return function(_0x5ca94f){if(_0x5ca94f){return _0x5ca94f[_0xca2d('0x20')](_0x4a7cf8)['then'](function(_0x3faa7b){return _0x3faa7b;});}return null;};}function removeEntity(_0x4a0527,_0x4434bf){return function(_0x15aabb){if(_0x15aabb){return _0x15aabb['destroy']()[_0xca2d('0x21')](function(){_0x4a0527[_0xca2d('0x19')](0xcc)[_0xca2d('0x1a')]();});}};}function handleEntityNotFound(_0x4dead6,_0x7a3ecb){return function(_0x1f7c37){if(!_0x1f7c37){_0x4dead6[_0xca2d('0x18')](0x194);}return _0x1f7c37;};}function handleError(_0x1e892a,_0xd0d66a){_0xd0d66a=_0xd0d66a||0x1f4;return function(_0x531492){logger['error'](_0x531492[_0xca2d('0x22')]);if(_0x531492[_0xca2d('0x23')]){delete _0x531492['name'];}_0x1e892a[_0xca2d('0x19')](_0xd0d66a)[_0xca2d('0x24')](_0x531492);};}exports[_0xca2d('0x25')]=function(_0x508205,_0x2a9082){var _0x4c5e9a={},_0x550cfc={},_0xa7e3c6={'count':0x0,'rows':[]};var _0x97a215=_[_0xca2d('0x26')](db['JscriptySessionReport'][_0xca2d('0x27')],function(_0x43bf2f){return{'name':_0x43bf2f[_0xca2d('0x28')],'type':_0x43bf2f[_0xca2d('0x29')][_0xca2d('0x2a')]};});_0x550cfc[_0xca2d('0x2b')]=_[_0xca2d('0x26')](_0x97a215,_0xca2d('0x23'));_0x550cfc[_0xca2d('0x2c')]=_[_0xca2d('0x2d')](_0x508205[_0xca2d('0x2c')]);_0x550cfc['filters']=_[_0xca2d('0x2e')](_0x550cfc[_0xca2d('0x2b')],_0x550cfc['query']);_0x4c5e9a[_0xca2d('0x2f')]=_['intersection'](_0x550cfc[_0xca2d('0x2b')],qs[_0xca2d('0x30')](_0x508205[_0xca2d('0x2c')][_0xca2d('0x30')]));_0x4c5e9a[_0xca2d('0x2f')]=_0x4c5e9a[_0xca2d('0x2f')][_0xca2d('0x31')]?_0x4c5e9a[_0xca2d('0x2f')]:_0x550cfc[_0xca2d('0x2b')];if(!_0x508205[_0xca2d('0x2c')][_0xca2d('0x32')](_0xca2d('0x33'))){_0x4c5e9a[_0xca2d('0x34')]=qs['limit'](_0x508205[_0xca2d('0x2c')][_0xca2d('0x34')]);_0x4c5e9a[_0xca2d('0x1c')]=qs[_0xca2d('0x1c')](_0x508205[_0xca2d('0x2c')][_0xca2d('0x1c')]);}_0x4c5e9a[_0xca2d('0x35')]=qs[_0xca2d('0x36')](_0x508205[_0xca2d('0x2c')]['sort']);_0x4c5e9a[_0xca2d('0x37')]=qs['filters'](_[_0xca2d('0x38')](_0x508205[_0xca2d('0x2c')],_0x550cfc[_0xca2d('0x39')]),_0x97a215);if(_0x508205[_0xca2d('0x2c')][_0xca2d('0x3a')]){_0x4c5e9a['where']=_['merge'](_0x4c5e9a[_0xca2d('0x37')],{'$or':_[_0xca2d('0x26')](_0x97a215,function(_0x55dc21){if(_0x55dc21['type']!=='VIRTUAL'){var _0x35cec7={};_0x35cec7[_0x55dc21[_0xca2d('0x23')]]={'$like':'%'+_0x508205['query'][_0xca2d('0x3a')]+'%'};return _0x35cec7;}})});}_0x4c5e9a=_[_0xca2d('0x3b')]({},_0x4c5e9a,_0x508205[_0xca2d('0x3c')]);var _0x57db4c={'where':_0x4c5e9a[_0xca2d('0x37')]};return db[_0xca2d('0x3d')][_0xca2d('0x1b')](_0x57db4c)['then'](function(_0x2fcb12){_0xa7e3c6[_0xca2d('0x1b')]=_0x2fcb12;if(_0x508205[_0xca2d('0x2c')][_0xca2d('0x3e')]){_0x4c5e9a[_0xca2d('0x3f')]=[{'all':!![]}];}return db[_0xca2d('0x3d')]['findAll'](_0x4c5e9a);})[_0xca2d('0x21')](function(_0x1d20ce){_0xa7e3c6['rows']=_0x1d20ce;return _0xa7e3c6;})[_0xca2d('0x21')](respondWithFilteredResult(_0x2a9082,_0x4c5e9a))[_0xca2d('0x40')](handleError(_0x2a9082,null));};exports[_0xca2d('0x41')]=function(_0xbb73bb,_0x230bb8){var _0x22850a={'raw':!![],'where':{'id':_0xbb73bb[_0xca2d('0x42')]['id']}},_0x3498cf={};_0x3498cf[_0xca2d('0x2b')]=_[_0xca2d('0x2d')](db[_0xca2d('0x3d')][_0xca2d('0x27')]);_0x3498cf[_0xca2d('0x2c')]=_[_0xca2d('0x2d')](_0xbb73bb['query']);_0x3498cf[_0xca2d('0x39')]=_['intersection'](_0x3498cf[_0xca2d('0x2b')],_0x3498cf[_0xca2d('0x2c')]);_0x22850a[_0xca2d('0x2f')]=_[_0xca2d('0x2e')](_0x3498cf[_0xca2d('0x2b')],qs[_0xca2d('0x30')](_0xbb73bb[_0xca2d('0x2c')][_0xca2d('0x30')]));_0x22850a[_0xca2d('0x2f')]=_0x22850a[_0xca2d('0x2f')][_0xca2d('0x31')]?_0x22850a[_0xca2d('0x2f')]:_0x3498cf[_0xca2d('0x2b')];if(_0xbb73bb[_0xca2d('0x2c')][_0xca2d('0x3e')]){_0x22850a['include']=[{'all':!![]}];}_0x22850a=_[_0xca2d('0x3b')]({},_0x22850a,_0xbb73bb[_0xca2d('0x3c')]);return db[_0xca2d('0x3d')][_0xca2d('0x43')](_0x22850a)[_0xca2d('0x21')](handleEntityNotFound(_0x230bb8,null))[_0xca2d('0x21')](respondWithResult(_0x230bb8,null))[_0xca2d('0x40')](handleError(_0x230bb8,null));};exports[_0xca2d('0x44')]=function(_0x211fe4,_0x9e4ea7){return db[_0xca2d('0x3d')][_0xca2d('0x44')](_0x211fe4[_0xca2d('0x45')],{})['then'](respondWithResult(_0x9e4ea7,0xc9))[_0xca2d('0x40')](handleError(_0x9e4ea7,null));};exports[_0xca2d('0x20')]=function(_0x4a5486,_0x3c3b69){if(_0x4a5486[_0xca2d('0x45')]['id']){delete _0x4a5486[_0xca2d('0x45')]['id'];}return db[_0xca2d('0x3d')]['find']({'where':{'id':_0x4a5486[_0xca2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c3b69,null))[_0xca2d('0x21')](saveUpdates(_0x4a5486['body'],null))[_0xca2d('0x21')](respondWithResult(_0x3c3b69,null))[_0xca2d('0x40')](handleError(_0x3c3b69,null));};exports[_0xca2d('0x46')]=function(_0x52ea4d,_0x1217ec){return db[_0xca2d('0x3d')][_0xca2d('0x43')]({'where':{'id':_0x52ea4d['params']['id']}})[_0xca2d('0x21')](handleEntityNotFound(_0x1217ec,null))[_0xca2d('0x21')](removeEntity(_0x1217ec,null))[_0xca2d('0x40')](handleError(_0x1217ec,null));};exports['describe']=function(_0x20139c,_0x37e137){return db[_0xca2d('0x3d')]['describe']()[_0xca2d('0x21')](respondWithResult(_0x37e137,null))['catch'](handleError(_0x37e137,null));};exports[_0xca2d('0x47')]=function(_0x2f4fc3,_0x34f843,_0x43b58d){var _0x266e99={'raw':!![],'where':{}};var _0xab3933={};var _0x2f437c={'count':0x0,'rows':[]};return db[_0xca2d('0x3d')][_0xca2d('0x48')]({'where':{'id':_0x2f4fc3[_0xca2d('0x42')]['id']}})[_0xca2d('0x21')](handleEntityNotFound(_0x34f843,null))['then'](function(_0x529420){if(_0x529420){_0xab3933[_0xca2d('0x2b')]=_[_0xca2d('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0xab3933[_0xca2d('0x2c')]=_['keys'](_0x2f4fc3[_0xca2d('0x2c')]);_0xab3933['filters']=_[_0xca2d('0x2e')](_0xab3933[_0xca2d('0x2b')],_0xab3933[_0xca2d('0x2c')]);_0x266e99[_0xca2d('0x2f')]=_[_0xca2d('0x2e')](_0xab3933[_0xca2d('0x2b')],qs[_0xca2d('0x30')](_0x2f4fc3['query']['fields']));_0x266e99['attributes']=_0x266e99[_0xca2d('0x2f')][_0xca2d('0x31')]?_0x266e99[_0xca2d('0x2f')]:_0xab3933[_0xca2d('0x2b')];if(!_0x2f4fc3[_0xca2d('0x2c')][_0xca2d('0x32')]('nolimit')){_0x266e99[_0xca2d('0x34')]=qs[_0xca2d('0x34')](_0x2f4fc3[_0xca2d('0x2c')][_0xca2d('0x34')]);_0x266e99['offset']=qs['offset'](_0x2f4fc3[_0xca2d('0x2c')][_0xca2d('0x1c')]);}_0x266e99['order']=qs[_0xca2d('0x36')](_0x2f4fc3[_0xca2d('0x2c')][_0xca2d('0x36')]);_0x266e99[_0xca2d('0x37')]=qs[_0xca2d('0x39')](_['pick'](_0x2f4fc3[_0xca2d('0x2c')],_0xab3933[_0xca2d('0x39')]));_0x266e99[_0xca2d('0x37')]['SessionId']=_0x529420['id'];if(_0x2f4fc3['query'][_0xca2d('0x3a')]){_0x266e99['where']=_[_0xca2d('0x3b')](_0x266e99[_0xca2d('0x37')],{'$or':_[_0xca2d('0x26')](_0x266e99[_0xca2d('0x2f')],function(_0x2f748a){var _0x4b33f0={};_0x4b33f0[_0x2f748a]={'$like':'%'+_0x2f4fc3[_0xca2d('0x2c')][_0xca2d('0x3a')]+'%'};return _0x4b33f0;})});}_0x266e99=_[_0xca2d('0x3b')]({},_0x266e99,_0x2f4fc3['options']);return db['JscriptyQuestionReport']['count']({'where':_0x266e99[_0xca2d('0x37')]})['then'](function(_0x4ffb1d){_0x2f437c[_0xca2d('0x1b')]=_0x4ffb1d;if(_0x2f4fc3['query'][_0xca2d('0x3e')]){_0x266e99[_0xca2d('0x3f')]=[{'all':!![]}];}return db[_0xca2d('0x49')][_0xca2d('0x4a')](_0x266e99);})[_0xca2d('0x21')](function(_0x5d97ee){_0x2f437c[_0xca2d('0x4b')]=_0x5d97ee;return _0x2f437c;});}})[_0xca2d('0x21')](respondWithFilteredResult(_0x34f843,_0x266e99))['catch'](handleError(_0x34f843,null));};
\ No newline at end of file