Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 22034db..efa6231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['ScreenRecording','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','keys','find','create','catch','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','map'];(function(_0x1d453f,_0x5793a9){var _0x50996a=function(_0x59bdf3){while(--_0x59bdf3){_0x1d453f['push'](_0x1d453f['shift']());}};_0x50996a(++_0x5793a9);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0xf2ca[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x3c1ae6,_0xe929b5){return function(_0xff396f){if(!_0xff396f){_0x3c1ae6[_0xaf2c('0x18')](0x194);}return _0xff396f;};}function handleError(_0x4a8dd8,_0x29f8b0){_0x29f8b0=_0x29f8b0||0x1f4;return function(_0x2051be){logger[_0xaf2c('0x24')](_0x2051be[_0xaf2c('0x25')]);if(_0x2051be['name']){delete _0x2051be[_0xaf2c('0x26')];}_0x4a8dd8['status'](_0x29f8b0)[_0xaf2c('0x27')](_0x2051be);};}exports[_0xaf2c('0x28')]=function(_0x15466b,_0x5d685a){var _0x2747bb={},_0x2ea490={},_0x3baee2={'count':0x0,'rows':[]};var _0x4a96d2=_[_0xaf2c('0x29')](db[_0xaf2c('0x2a')][_0xaf2c('0x2b')],function(_0x19364e){return{'name':_0x19364e['fieldName'],'type':_0x19364e[_0xaf2c('0x2c')][_0xaf2c('0x2d')]};});_0x2ea490[_0xaf2c('0x2e')]=_['differenceBy'](_['map'](_0x4a96d2,_0xaf2c('0x26')),['format']);_0x2ea490[_0xaf2c('0x2f')]=_['keys'](_0x15466b[_0xaf2c('0x2f')]);_0x2ea490[_0xaf2c('0x30')]=_['intersection'](_0x2ea490[_0xaf2c('0x2e')],_0x2ea490[_0xaf2c('0x2f')]);_0x2747bb['attributes']=_[_0xaf2c('0x31')](_0x2ea490[_0xaf2c('0x2e')],qs[_0xaf2c('0x32')](_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x32')]));_0x2747bb[_0xaf2c('0x33')]=_0x2747bb['attributes'][_0xaf2c('0x34')]?_0x2747bb['attributes']:_0x2ea490[_0xaf2c('0x2e')];if(!_0x15466b['query'][_0xaf2c('0x35')]('nolimit')){_0x2747bb[_0xaf2c('0x1e')]=qs['limit'](_0x15466b[_0xaf2c('0x2f')]['limit']);_0x2747bb[_0xaf2c('0x1c')]=qs[_0xaf2c('0x1c')](_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x1c')]);}_0x2747bb[_0xaf2c('0x36')]=qs['sort'](_0x15466b['query'][_0xaf2c('0x37')]);_0x2747bb[_0xaf2c('0x38')]=qs[_0xaf2c('0x30')](_[_0xaf2c('0x39')](_0x15466b[_0xaf2c('0x2f')],_0x2ea490[_0xaf2c('0x30')]),_0x4a96d2);if(_0x15466b['query'][_0xaf2c('0x3a')]){_0x2747bb[_0xaf2c('0x38')]=_['merge'](_0x2747bb[_0xaf2c('0x38')],{'$or':_[_0xaf2c('0x29')](_0x4a96d2,function(_0x25bebd){if(_0x25bebd[_0xaf2c('0x2c')]!==_0xaf2c('0x3b')){var _0x1e8eaf={};_0x1e8eaf[_0x25bebd[_0xaf2c('0x26')]]={'$like':'%'+_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x3a')]+'%'};return _0x1e8eaf;}})});}_0x2747bb=_[_0xaf2c('0x3c')]({},_0x2747bb,_0x15466b[_0xaf2c('0x3d')]);var _0x43f606={'where':_0x2747bb[_0xaf2c('0x38')]};return db['ScreenRecording']['count'](_0x43f606)['then'](function(_0x189809){_0x3baee2[_0xaf2c('0x3e')]=_0x189809;if(_0x15466b[_0xaf2c('0x2f')][_0xaf2c('0x3f')]){_0x2747bb[_0xaf2c('0x40')]=[{'all':!![]}];}return db[_0xaf2c('0x2a')]['findAll'](_0x2747bb);})[_0xaf2c('0x23')](function(_0x78632a){_0x3baee2[_0xaf2c('0x41')]=_0x78632a;return _0x3baee2;})['then'](respondWithFilteredResult(_0x5d685a,_0x2747bb))['catch'](handleError(_0x5d685a,null));};exports[_0xaf2c('0x42')]=function(_0x4f8440,_0x181787){var _0x25ba26={'raw':![],'where':{'id':_0x4f8440[_0xaf2c('0x43')]['id']}},_0x20fb99={};_0x20fb99['model']=_[_0xaf2c('0x44')](db['ScreenRecording'][_0xaf2c('0x2b')]);_0x20fb99[_0xaf2c('0x2f')]=_['keys'](_0x4f8440[_0xaf2c('0x2f')]);_0x20fb99['filters']=_[_0xaf2c('0x31')](_0x20fb99[_0xaf2c('0x2e')],_0x20fb99[_0xaf2c('0x2f')]);_0x25ba26[_0xaf2c('0x33')]=_[_0xaf2c('0x31')](_0x20fb99[_0xaf2c('0x2e')],qs[_0xaf2c('0x32')](_0x4f8440[_0xaf2c('0x2f')][_0xaf2c('0x32')]));_0x25ba26['attributes']=_0x25ba26['attributes'][_0xaf2c('0x34')]?_0x25ba26['attributes']:_0x20fb99['model'];if(_0x4f8440['query'][_0xaf2c('0x3f')]){_0x25ba26[_0xaf2c('0x40')]=[{'all':!![]}];}_0x25ba26=_[_0xaf2c('0x3c')]({},_0x25ba26,_0x4f8440[_0xaf2c('0x3d')]);return db['ScreenRecording'][_0xaf2c('0x45')](_0x25ba26)['then'](handleEntityNotFound(_0x181787,null))[_0xaf2c('0x23')](respondWithResult(_0x181787,null))['catch'](handleError(_0x181787,null));};exports[_0xaf2c('0x46')]=function(_0x133e8c,_0x2d01b7){return db[_0xaf2c('0x2a')][_0xaf2c('0x46')](_0x133e8c['body'],{})[_0xaf2c('0x23')](respondWithResult(_0x2d01b7,0xc9))[_0xaf2c('0x47')](handleError(_0x2d01b7,null));};exports['update']=function(_0x4e8efd,_0x367b30){if(_0x4e8efd['body']['id']){delete _0x4e8efd[_0xaf2c('0x48')]['id'];}delete _0x4e8efd[_0xaf2c('0x48')][_0xaf2c('0x49')];delete _0x4e8efd[_0xaf2c('0x48')][_0xaf2c('0x4a')];delete _0x4e8efd[_0xaf2c('0x48')][_0xaf2c('0x4b')];delete _0x4e8efd[_0xaf2c('0x48')][_0xaf2c('0x4c')];return db[_0xaf2c('0x2a')][_0xaf2c('0x45')]({'where':{'id':_0x4e8efd['params']['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x367b30,null))[_0xaf2c('0x23')](saveUpdates(_0x4e8efd['body'],null))['then'](respondWithResult(_0x367b30,null))['catch'](handleError(_0x367b30,null));};exports[_0xaf2c('0x4d')]=function(_0x1f6907,_0x551061){return db[_0xaf2c('0x2a')][_0xaf2c('0x4d')]()[_0xaf2c('0x23')](respondWithResult(_0x551061,null))[_0xaf2c('0x47')](handleError(_0x551061,null));};exports[_0xaf2c('0x4e')]=function(_0x170e67,_0x22b1fc,_0x490b95){var _0x2df52e=require(_0xaf2c('0x4f'));var _0x5771e5=![];var _0x245797={};if(_0x170e67[_0xaf2c('0x2f')][_0xaf2c('0x2c')]&&_0x170e67[_0xaf2c('0x2f')][_0xaf2c('0x2c')]===_0xaf2c('0x50')){_0x245797[_0xaf2c('0x50')]=_0x170e67[_0xaf2c('0x43')]['id'];}else{_0x245797['id']=_0x170e67[_0xaf2c('0x43')]['id'];}return db[_0xaf2c('0x2a')][_0xaf2c('0x45')]({'where':_0x245797,'attributes':['id',_0xaf2c('0x4c')],'raw':!![]})[_0xaf2c('0x23')](handleEntityNotFound(_0x22b1fc,null))[_0xaf2c('0x23')](function(_0x297a22){if(_0x297a22){var _0x2d6677=path[_0xaf2c('0x51')](config[_0xaf2c('0x52')],_0xaf2c('0x53'),_0x297a22[_0xaf2c('0x4c')]);var _0x5321c3=util[_0xaf2c('0x54')](_0xaf2c('0x55'),_0x2d6677);if(fs[_0xaf2c('0x56')](_0x5321c3)){_0x5771e5=!![];return _0x2df52e['decryptFile'](_0x5321c3,_0x2d6677,config[_0xaf2c('0x57')]['recording'])[_0xaf2c('0x23')](function(){return _0x297a22;});}return _0x297a22;}})[_0xaf2c('0x23')](function(_0xb3ad9){if(_0xb3ad9){var _0x45918b=path[_0xaf2c('0x51')](config[_0xaf2c('0x52')],_0xaf2c('0x53'),_0xb3ad9[_0xaf2c('0x4c')]);if(!fs[_0xaf2c('0x56')](_0x45918b)){throw new db['Sequelize'][(_0xaf2c('0x58'))](_0xaf2c('0x59'));}if(_0xb3ad9[_0xaf2c('0x5a')]){return _0x22b1fc[_0xaf2c('0x4e')](_0x45918b,_0xb3ad9[_0xaf2c('0x5a')]+path['extname'](_0x45918b),function(){if(_0x5771e5){fs[_0xaf2c('0x5b')](_0x45918b);}});}else{return _0x22b1fc[_0xaf2c('0x4e')](_0x45918b,function(_0x506000){if(_0x5771e5){fs[_0xaf2c('0x5b')](_0x45918b);}});}}})[_0xaf2c('0x47')](function(_0x4b7070){if(_0x4b7070['message']===_0xaf2c('0x59')){_0x22b1fc[_0xaf2c('0x19')](0x194)[_0xaf2c('0x27')](_0xaf2c('0x5c'));}else{return handleError(_0x22b1fc,null);}});};exports['destroy']=function(_0x36b6f0,_0x3f48f1){return db['ScreenRecording'][_0xaf2c('0x45')]({'where':{'id':_0x36b6f0['params']['id']}})[_0xaf2c('0x23')](function(_0xe6a251){if(_[_0xaf2c('0x5d')](_0xe6a251)){throw new ReferenceError(_0xaf2c('0x5e'));}return _0xe6a251;})[_0xaf2c('0x23')](function(_0x348f7e){var _0x1c9639=path[_0xaf2c('0x51')](config[_0xaf2c('0x52')],_0xaf2c('0x53'),_0x348f7e['value']);logger[_0xaf2c('0x5f')](_0xaf2c('0x60'),_0x1c9639);if(!_[_0xaf2c('0x5d')](_0x348f7e[_0xaf2c('0x4c')])&&fs[_0xaf2c('0x56')](_0x1c9639)){logger['info'](_0xaf2c('0x61')+_0x1c9639+_0xaf2c('0x62'));fs[_0xaf2c('0x63')](_0x1c9639);}_0x1c9639=_0x1c9639+_0xaf2c('0x64');if(!_[_0xaf2c('0x5d')](_0x348f7e['value'])&&fs['existsSync'](_0x1c9639)){logger[_0xaf2c('0x5f')](_0xaf2c('0x61')+_0x1c9639+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xaf2c('0x63')](_0x1c9639);}return _0x348f7e;})[_0xaf2c('0x23')](function(_0x2e189b){if(!_0x2e189b)throw new InternalError();return _0x2e189b['destroy']();})[_0xaf2c('0x23')](function(){_0x3f48f1[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();})[_0xaf2c('0x47')](handleError(_0x3f48f1,null));};
\ No newline at end of file
+var _0x81bd=['Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','duration','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','secrets','recording','join','server/files/screen_recordings'];(function(_0x29f665,_0x28b5df){var _0x4624f8=function(_0x252541){while(--_0x252541){_0x29f665['push'](_0x29f665['shift']());}};_0x4624f8(++_0x28b5df);}(_0x81bd,0x7c));var _0xd81b=function(_0x2c341e,_0x414d11){_0x2c341e=_0x2c341e-0x0;var _0x43c1e8=_0x81bd[_0x2c341e];return _0x43c1e8;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2ccedf,_0x1bf351){return function(_0x596389){if(!_0x596389){_0x2ccedf[_0xd81b('0x1b')](0x194);}return _0x596389;};}function handleError(_0x99dbc9,_0xe3637a){_0xe3637a=_0xe3637a||0x1f4;return function(_0x31b9fd){logger[_0xd81b('0x2a')](_0x31b9fd[_0xd81b('0x2b')]);if(_0x31b9fd[_0xd81b('0x2c')]){delete _0x31b9fd[_0xd81b('0x2c')];}_0x99dbc9[_0xd81b('0x1d')](_0xe3637a)['send'](_0x31b9fd);};}exports[_0xd81b('0x2d')]=function(_0x4e2eff,_0x5c8aee){var _0xb9ff9f={},_0x260310={},_0x5141e6={'count':0x0,'rows':[]};var _0x481454=_[_0xd81b('0x2e')](db[_0xd81b('0x2f')][_0xd81b('0x30')],function(_0x289f54){return{'name':_0x289f54[_0xd81b('0x31')],'type':_0x289f54[_0xd81b('0x32')]['key']};});_0x260310[_0xd81b('0x33')]=_[_0xd81b('0x34')](_['map'](_0x481454,'name'),[_0xd81b('0x35')]);_0x260310[_0xd81b('0x36')]=_['keys'](_0x4e2eff['query']);_0x260310['filters']=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],_0x260310[_0xd81b('0x36')]);_0xb9ff9f[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x4e2eff['query'][_0xd81b('0x39')]));_0xb9ff9f['attributes']=_0xb9ff9f[_0xd81b('0x38')][_0xd81b('0x3a')]?_0xb9ff9f[_0xd81b('0x38')]:_0x260310[_0xd81b('0x33')];if(!_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x3b')](_0xd81b('0x3c'))){_0xb9ff9f[_0xd81b('0x20')]=qs[_0xd81b('0x20')](_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x20')]);_0xb9ff9f[_0xd81b('0x22')]=qs[_0xd81b('0x22')](_0x4e2eff['query']['offset']);}_0xb9ff9f[_0xd81b('0x3d')]=qs[_0xd81b('0x3e')](_0x4e2eff[_0xd81b('0x36')]['sort']);_0xb9ff9f[_0xd81b('0x3f')]=qs[_0xd81b('0x40')](_['pick'](_0x4e2eff[_0xd81b('0x36')],_0x260310[_0xd81b('0x40')]),_0x481454);if(_0x4e2eff['query'][_0xd81b('0x41')]){_0xb9ff9f['where']=_[_0xd81b('0x42')](_0xb9ff9f[_0xd81b('0x3f')],{'$or':_[_0xd81b('0x2e')](_0x481454,function(_0x3f6deb){if(_0x3f6deb['type']!==_0xd81b('0x43')){var _0x3444d4={};_0x3444d4[_0x3f6deb[_0xd81b('0x2c')]]={'$like':'%'+_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x41')]+'%'};return _0x3444d4;}})});}_0xb9ff9f=_[_0xd81b('0x42')]({},_0xb9ff9f,_0x4e2eff[_0xd81b('0x44')]);var _0x532ada={'where':_0xb9ff9f[_0xd81b('0x3f')]};return db[_0xd81b('0x2f')][_0xd81b('0x21')](_0x532ada)['then'](function(_0x3bea7d){_0x5141e6[_0xd81b('0x21')]=_0x3bea7d;if(_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x45')]){_0xb9ff9f[_0xd81b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd81b('0x47')](_0xb9ff9f);})[_0xd81b('0x28')](function(_0x448e24){_0x5141e6[_0xd81b('0x48')]=_0x448e24;return _0x5141e6;})[_0xd81b('0x28')](respondWithFilteredResult(_0x5c8aee,_0xb9ff9f))[_0xd81b('0x49')](handleError(_0x5c8aee,null));};exports[_0xd81b('0x4a')]=function(_0x486f0d,_0x4405a8){var _0x3ba339={'raw':![],'where':{'id':_0x486f0d['params']['id']}},_0x1e3690={};_0x1e3690[_0xd81b('0x33')]=_[_0xd81b('0x4b')](db[_0xd81b('0x2f')][_0xd81b('0x30')]);_0x1e3690[_0xd81b('0x36')]=_[_0xd81b('0x4b')](_0x486f0d[_0xd81b('0x36')]);_0x1e3690[_0xd81b('0x40')]=_['intersection'](_0x1e3690['model'],_0x1e3690[_0xd81b('0x36')]);_0x3ba339[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x1e3690[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x486f0d[_0xd81b('0x36')][_0xd81b('0x39')]));_0x3ba339[_0xd81b('0x38')]=_0x3ba339[_0xd81b('0x38')][_0xd81b('0x3a')]?_0x3ba339[_0xd81b('0x38')]:_0x1e3690[_0xd81b('0x33')];if(_0x486f0d['query'][_0xd81b('0x45')]){_0x3ba339[_0xd81b('0x46')]=[{'all':!![]}];}_0x3ba339=_[_0xd81b('0x42')]({},_0x3ba339,_0x486f0d[_0xd81b('0x44')]);return db[_0xd81b('0x2f')][_0xd81b('0x4c')](_0x3ba339)[_0xd81b('0x28')](handleEntityNotFound(_0x4405a8,null))[_0xd81b('0x28')](respondWithResult(_0x4405a8,null))[_0xd81b('0x49')](handleError(_0x4405a8,null));};exports['create']=function(_0xf401e0,_0x2368dd){return db[_0xd81b('0x2f')][_0xd81b('0x4d')](_0xf401e0['body'],{})[_0xd81b('0x28')](respondWithResult(_0x2368dd,0xc9))[_0xd81b('0x49')](handleError(_0x2368dd,null));};exports[_0xd81b('0x27')]=function(_0xe874b6,_0x2699e6){if(_0xe874b6[_0xd81b('0x4e')]['id']){delete _0xe874b6[_0xd81b('0x4e')]['id'];}delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x4f')];delete _0xe874b6['body']['createdAt'];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x50')];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x51')];return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0xe874b6[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2699e6,null))['then'](saveUpdates(_0xe874b6[_0xd81b('0x4e')],null))[_0xd81b('0x28')](respondWithResult(_0x2699e6,null))[_0xd81b('0x49')](handleError(_0x2699e6,null));};exports[_0xd81b('0x53')]=function(_0x4651d3,_0x59b13b){return db[_0xd81b('0x2f')][_0xd81b('0x53')]()['then'](respondWithResult(_0x59b13b,null))[_0xd81b('0x49')](handleError(_0x59b13b,null));};exports[_0xd81b('0x54')]=function(_0x100319,_0x3b7ed7,_0x21cd71){var _0xa366c8=require(_0xd81b('0x55'));var _0x22f588=![];var _0x3ed626={};if(_0x100319[_0xd81b('0x36')][_0xd81b('0x32')]&&_0x100319['query'][_0xd81b('0x32')]==='uniqueid'){_0x3ed626[_0xd81b('0x56')]=_0x100319[_0xd81b('0x52')]['id'];}else{_0x3ed626['id']=_0x100319[_0xd81b('0x52')]['id'];}return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':_0x3ed626,'attributes':['id',_0xd81b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7ed7,null))[_0xd81b('0x28')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=path['join'](config[_0xd81b('0x57')],'server/files/screen_recordings',_0xe0c9c6[_0xd81b('0x51')]);var _0x51f066=util[_0xd81b('0x35')](_0xd81b('0x58'),_0x51f5a1);if(fs[_0xd81b('0x59')](_0x51f066)){_0x22f588=!![];return _0xa366c8['decryptFile'](_0x51f066,_0x51f5a1,config[_0xd81b('0x5a')][_0xd81b('0x5b')])['then'](function(){return _0xe0c9c6;});}return _0xe0c9c6;}})[_0xd81b('0x28')](function(_0x108aaf){if(_0x108aaf){var _0x5951ec=path[_0xd81b('0x5c')](config['root'],_0xd81b('0x5d'),_0x108aaf[_0xd81b('0x51')]);if(!fs[_0xd81b('0x59')](_0x5951ec)){throw new db[(_0xd81b('0x5e'))][(_0xd81b('0x5f'))](_0xd81b('0x60'));}if(_0x108aaf[_0xd81b('0x61')]){return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,_0x108aaf[_0xd81b('0x61')]+path[_0xd81b('0x62')](_0x5951ec),function(){if(_0x22f588){fs['unlink'](_0x5951ec);}});}else{return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,function(_0x434434){if(_0x22f588){fs[_0xd81b('0x63')](_0x5951ec);}});}}})[_0xd81b('0x49')](function(_0x1bdf37){if(_0x1bdf37[_0xd81b('0x64')]===_0xd81b('0x60')){_0x3b7ed7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3b7ed7,null);}});};exports[_0xd81b('0x29')]=function(_0x12b0bf,_0x37507e){return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0x12b0bf[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](function(_0x5afecf){if(_[_0xd81b('0x65')](_0x5afecf)){throw new ReferenceError(_0xd81b('0x66'));}return _0x5afecf;})[_0xd81b('0x28')](function(_0x2090e9){var _0x41719b=path[_0xd81b('0x5c')](config[_0xd81b('0x57')],'server/files/screen_recordings',_0x2090e9[_0xd81b('0x51')]);logger[_0xd81b('0x67')](_0xd81b('0x68'),_0x41719b);if(!_[_0xd81b('0x65')](_0x2090e9[_0xd81b('0x51')])&&fs[_0xd81b('0x59')](_0x41719b)){logger[_0xd81b('0x67')](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}_0x41719b=_0x41719b+_0xd81b('0x6c');if(!_[_0xd81b('0x65')](_0x2090e9['value'])&&fs[_0xd81b('0x59')](_0x41719b)){logger['info'](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}return _0x2090e9;})[_0xd81b('0x28')](function(_0xb94a69){if(!_0xb94a69)throw new InternalError();return _0xb94a69[_0xd81b('0x29')]();})[_0xd81b('0x28')](function(){_0x37507e[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();})[_0xd81b('0x49')](handleError(_0x37507e,null));};
\ No newline at end of file