Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.controller.js
index c9d035d..6d881b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf17f=['order','SessionId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','findOne','JscriptyQuestionReport'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0xf17f,0x13a));var _0xff17=function(_0xe22ceb,_0x27dc83){_0xe22ceb=_0xe22ceb-0x0;var _0x45bb58=_0xf17f[_0xe22ceb];return _0x45bb58;};'use strict';var pdf=require(_0xff17('0x0'));var emlformat=require(_0xff17('0x1'));var rimraf=require(_0xff17('0x2'));var zipdir=require(_0xff17('0x3'));var jsonpatch=require(_0xff17('0x4'));var rp=require('request-promise');var moment=require(_0xff17('0x5'));var BPromise=require(_0xff17('0x6'));var Mustache=require(_0xff17('0x7'));var util=require('util');var path=require(_0xff17('0x8'));var sox=require(_0xff17('0x9'));var csv=require('to-csv');var ejs=require(_0xff17('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xff17('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff17('0xc'));var toCsv=require(_0xff17('0xd'));var querystring=require(_0xff17('0xe'));var Papa=require(_0xff17('0xf'));var Redis=require(_0xff17('0x10'));var authService=require(_0xff17('0x11'));var qs=require(_0xff17('0x12'));var as=require(_0xff17('0x13'));var hardwareService=require(_0xff17('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xff17('0x15'));var db=require(_0xff17('0x16'))['db'];function respondWithStatusCode(_0x4d87b4,_0x448b4b){_0x448b4b=_0x448b4b||0xcc;return function(_0x299666){if(_0x299666){return _0x4d87b4[_0xff17('0x17')](_0x448b4b);}return _0x4d87b4[_0xff17('0x18')](_0x448b4b)[_0xff17('0x19')]();};}function respondWithResult(_0x52df78,_0x346251){_0x346251=_0x346251||0xc8;return function(_0x3bb02c){if(_0x3bb02c){return _0x52df78[_0xff17('0x18')](_0x346251)[_0xff17('0x1a')](_0x3bb02c);}};}function respondWithFilteredResult(_0x14f0d2,_0x5281f3){return function(_0x55d0a7){if(_0x55d0a7){var _0x45692c=_0x55d0a7[_0xff17('0x1b')],_0x3eb0d7=_0x5281f3[_0xff17('0x1c')],_0x4e20ff=_0x5281f3['offset']+_0x5281f3[_0xff17('0x1d')],_0x17835d;if(_0x4e20ff>=_0x45692c){_0x4e20ff=_0x45692c;_0x17835d=0xc8;}else{_0x17835d=0xce;}_0x14f0d2[_0xff17('0x18')](_0x17835d);return _0x14f0d2[_0xff17('0x1e')](_0xff17('0x1f'),_0x3eb0d7+'-'+_0x4e20ff+'/'+_0x45692c)[_0xff17('0x1a')](_0x55d0a7);}return null;};}function patchUpdates(_0x4a9158){return function(_0x4d27e9){try{jsonpatch[_0xff17('0x20')](_0x4d27e9,_0x4a9158,!![]);}catch(_0x73e821){return BPromise[_0xff17('0x21')](_0x73e821);}return _0x4d27e9[_0xff17('0x22')]();};}function saveUpdates(_0x3aafaa,_0xc7407f){return function(_0x292e89){if(_0x292e89){return _0x292e89[_0xff17('0x23')](_0x3aafaa)[_0xff17('0x24')](function(_0x2dba3b){return _0x2dba3b;});}return null;};}function removeEntity(_0x204c59,_0x31ea67){return function(_0x42bd54){if(_0x42bd54){return _0x42bd54['destroy']()[_0xff17('0x24')](function(){_0x204c59[_0xff17('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0794,_0x5d908a){return function(_0x5be4da){if(!_0x5be4da){_0x3e0794['sendStatus'](0x194);}return _0x5be4da;};}function handleError(_0x12ba32,_0x1f4540){_0x1f4540=_0x1f4540||0x1f4;return function(_0x27edb8){logger[_0xff17('0x25')](_0x27edb8[_0xff17('0x26')]);if(_0x27edb8[_0xff17('0x27')]){delete _0x27edb8[_0xff17('0x27')];}_0x12ba32['status'](_0x1f4540)[_0xff17('0x28')](_0x27edb8);};}exports[_0xff17('0x29')]=function(_0x299a92,_0x264750){var _0x15bd1b={},_0x135f78={},_0x37b1f3={'count':0x0,'rows':[]};var _0x48d953=_[_0xff17('0x2a')](db[_0xff17('0x2b')][_0xff17('0x2c')],function(_0x4f36ac){return{'name':_0x4f36ac['fieldName'],'type':_0x4f36ac[_0xff17('0x2d')][_0xff17('0x2e')]};});_0x135f78[_0xff17('0x2f')]=_[_0xff17('0x2a')](_0x48d953,'name');_0x135f78[_0xff17('0x30')]=_[_0xff17('0x31')](_0x299a92[_0xff17('0x30')]);_0x135f78[_0xff17('0x32')]=_['intersection'](_0x135f78[_0xff17('0x2f')],_0x135f78[_0xff17('0x30')]);_0x15bd1b['attributes']=_[_0xff17('0x33')](_0x135f78[_0xff17('0x2f')],qs[_0xff17('0x34')](_0x299a92['query'][_0xff17('0x34')]));_0x15bd1b[_0xff17('0x35')]=_0x15bd1b[_0xff17('0x35')][_0xff17('0x36')]?_0x15bd1b[_0xff17('0x35')]:_0x135f78[_0xff17('0x2f')];if(!_0x299a92[_0xff17('0x30')][_0xff17('0x37')](_0xff17('0x38'))){_0x15bd1b[_0xff17('0x1d')]=qs[_0xff17('0x1d')](_0x299a92['query'][_0xff17('0x1d')]);_0x15bd1b['offset']=qs[_0xff17('0x1c')](_0x299a92[_0xff17('0x30')][_0xff17('0x1c')]);}_0x15bd1b['order']=qs[_0xff17('0x39')](_0x299a92[_0xff17('0x30')]['sort']);_0x15bd1b[_0xff17('0x3a')]=qs[_0xff17('0x32')](_['pick'](_0x299a92[_0xff17('0x30')],_0x135f78[_0xff17('0x32')]));if(_0x299a92['query'][_0xff17('0x3b')]){_0x15bd1b[_0xff17('0x3a')]=_[_0xff17('0x3c')](_0x15bd1b['where'],{'$or':_[_0xff17('0x2a')](_0x48d953,function(_0x31f765){if(_0x31f765[_0xff17('0x2d')]!==_0xff17('0x3d')){var _0x4a386a={};_0x4a386a[_0x31f765[_0xff17('0x27')]]={'$like':'%'+_0x299a92[_0xff17('0x30')]['filter']+'%'};return _0x4a386a;}})});}_0x15bd1b=_[_0xff17('0x3c')]({},_0x15bd1b,_0x299a92[_0xff17('0x3e')]);var _0xa69602={'where':_0x15bd1b[_0xff17('0x3a')]};return db[_0xff17('0x2b')][_0xff17('0x1b')](_0xa69602)[_0xff17('0x24')](function(_0x2d035e){_0x37b1f3[_0xff17('0x1b')]=_0x2d035e;if(_0x299a92[_0xff17('0x30')][_0xff17('0x3f')]){_0x15bd1b[_0xff17('0x40')]=[{'all':!![]}];}return db[_0xff17('0x2b')][_0xff17('0x41')](_0x15bd1b);})[_0xff17('0x24')](function(_0x4a1f7d){_0x37b1f3[_0xff17('0x42')]=_0x4a1f7d;return _0x37b1f3;})[_0xff17('0x24')](respondWithFilteredResult(_0x264750,_0x15bd1b))[_0xff17('0x43')](handleError(_0x264750,null));};exports[_0xff17('0x44')]=function(_0x309cbd,_0x188862){var _0x53ed23={'raw':!![],'where':{'id':_0x309cbd[_0xff17('0x45')]['id']}},_0x2167f1={};_0x2167f1['model']=_[_0xff17('0x31')](db[_0xff17('0x2b')][_0xff17('0x2c')]);_0x2167f1['query']=_[_0xff17('0x31')](_0x309cbd['query']);_0x2167f1[_0xff17('0x32')]=_[_0xff17('0x33')](_0x2167f1[_0xff17('0x2f')],_0x2167f1[_0xff17('0x30')]);_0x53ed23[_0xff17('0x35')]=_[_0xff17('0x33')](_0x2167f1[_0xff17('0x2f')],qs[_0xff17('0x34')](_0x309cbd[_0xff17('0x30')][_0xff17('0x34')]));_0x53ed23[_0xff17('0x35')]=_0x53ed23[_0xff17('0x35')]['length']?_0x53ed23[_0xff17('0x35')]:_0x2167f1[_0xff17('0x2f')];if(_0x309cbd['query'][_0xff17('0x3f')]){_0x53ed23['include']=[{'all':!![]}];}_0x53ed23=_[_0xff17('0x3c')]({},_0x53ed23,_0x309cbd[_0xff17('0x3e')]);return db[_0xff17('0x2b')][_0xff17('0x46')](_0x53ed23)[_0xff17('0x24')](handleEntityNotFound(_0x188862,null))[_0xff17('0x24')](respondWithResult(_0x188862,null))[_0xff17('0x43')](handleError(_0x188862,null));};exports[_0xff17('0x47')]=function(_0x5cfa66,_0x1f5bf1){return db['JscriptySessionReport'][_0xff17('0x47')](_0x5cfa66[_0xff17('0x48')],{})[_0xff17('0x24')](respondWithResult(_0x1f5bf1,0xc9))[_0xff17('0x43')](handleError(_0x1f5bf1,null));};exports[_0xff17('0x23')]=function(_0x45219f,_0x46eaff){if(_0x45219f[_0xff17('0x48')]['id']){delete _0x45219f[_0xff17('0x48')]['id'];}return db[_0xff17('0x2b')][_0xff17('0x46')]({'where':{'id':_0x45219f[_0xff17('0x45')]['id']}})[_0xff17('0x24')](handleEntityNotFound(_0x46eaff,null))[_0xff17('0x24')](saveUpdates(_0x45219f[_0xff17('0x48')],null))[_0xff17('0x24')](respondWithResult(_0x46eaff,null))[_0xff17('0x43')](handleError(_0x46eaff,null));};exports['destroy']=function(_0x4793c6,_0xb2ae2f){return db[_0xff17('0x2b')][_0xff17('0x46')]({'where':{'id':_0x4793c6[_0xff17('0x45')]['id']}})['then'](handleEntityNotFound(_0xb2ae2f,null))[_0xff17('0x24')](removeEntity(_0xb2ae2f,null))['catch'](handleError(_0xb2ae2f,null));};exports['describe']=function(_0x5dc2f3,_0x45b05a){return db['JscriptySessionReport'][_0xff17('0x49')]()[_0xff17('0x24')](respondWithResult(_0x45b05a,null))[_0xff17('0x43')](handleError(_0x45b05a,null));};exports['getQuestions']=function(_0x55fa70,_0x2411bb,_0x19f07e){var _0x33a4e7={'raw':!![],'where':{}};var _0x11c525={};var _0x108513={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xff17('0x4a')]({'where':{'id':_0x55fa70['params']['id']}})[_0xff17('0x24')](handleEntityNotFound(_0x2411bb,null))['then'](function(_0xe1ad4){if(_0xe1ad4){_0x11c525[_0xff17('0x2f')]=_[_0xff17('0x31')](db[_0xff17('0x4b')][_0xff17('0x2c')]);_0x11c525[_0xff17('0x30')]=_['keys'](_0x55fa70['query']);_0x11c525['filters']=_[_0xff17('0x33')](_0x11c525[_0xff17('0x2f')],_0x11c525['query']);_0x33a4e7['attributes']=_[_0xff17('0x33')](_0x11c525['model'],qs['fields'](_0x55fa70[_0xff17('0x30')][_0xff17('0x34')]));_0x33a4e7[_0xff17('0x35')]=_0x33a4e7[_0xff17('0x35')][_0xff17('0x36')]?_0x33a4e7[_0xff17('0x35')]:_0x11c525[_0xff17('0x2f')];if(!_0x55fa70['query'][_0xff17('0x37')](_0xff17('0x38'))){_0x33a4e7['limit']=qs[_0xff17('0x1d')](_0x55fa70[_0xff17('0x30')][_0xff17('0x1d')]);_0x33a4e7[_0xff17('0x1c')]=qs[_0xff17('0x1c')](_0x55fa70['query'][_0xff17('0x1c')]);}_0x33a4e7[_0xff17('0x4c')]=qs['sort'](_0x55fa70['query'][_0xff17('0x39')]);_0x33a4e7[_0xff17('0x3a')]=qs[_0xff17('0x32')](_['pick'](_0x55fa70[_0xff17('0x30')],_0x11c525[_0xff17('0x32')]));_0x33a4e7[_0xff17('0x3a')][_0xff17('0x4d')]=_0xe1ad4['id'];if(_0x55fa70['query'][_0xff17('0x3b')]){_0x33a4e7[_0xff17('0x3a')]=_[_0xff17('0x3c')](_0x33a4e7['where'],{'$or':_['map'](_0x33a4e7['attributes'],function(_0x57b2f5){var _0x4f2673={};_0x4f2673[_0x57b2f5]={'$like':'%'+_0x55fa70[_0xff17('0x30')][_0xff17('0x3b')]+'%'};return _0x4f2673;})});}_0x33a4e7=_[_0xff17('0x3c')]({},_0x33a4e7,_0x55fa70[_0xff17('0x3e')]);return db['JscriptyQuestionReport'][_0xff17('0x1b')]({'where':_0x33a4e7['where']})[_0xff17('0x24')](function(_0x71cbf){_0x108513[_0xff17('0x1b')]=_0x71cbf;if(_0x55fa70[_0xff17('0x30')]['includeAll']){_0x33a4e7[_0xff17('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xff17('0x41')](_0x33a4e7);})[_0xff17('0x24')](function(_0x457bc7){_0x108513[_0xff17('0x42')]=_0x457bc7;return _0x108513;});}})[_0xff17('0x24')](respondWithFilteredResult(_0x2411bb,_0x33a4e7))[_0xff17('0x43')](handleError(_0x2411bb,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