Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / screenRecording / screenRecording.controller.js
index d18197b..e07ccf3 100644 (file)
@@ -1 +1 @@
-const a640_0x3b7a=['fields','server/files/screen_recordings','sendStatus','destroy','unlink','catch','findAll','filters','util','attributes','create','type','existsSync','.cypher','uniqueid','error','then','duration','../../components/parsers/qs','stack','../../mysqldb','../../config/environment','cancellazione\x20fisica\x20documento\x20%s','download','intersection','update','where','describe','end','api','VIRTUAL','merge','isNil','query','filter','differenceBy','format','error-middleware/errors','unlinkSync','message','closedAt','count','createdAt','info','send','includeAll','recording','keys','findOne','Entity\x20not\x20found','join','rows','fieldName','ScreenRecording','rawAttributes','json','../../config/logger','like','params','File:\x20\x22','pick','limit','length','decryptFile','status','options','name','model','map','value','nolimit','sort','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','filename','offset','key','body','index','ScreenRecording\x20not\x20found','include','order','set','secrets','path','root'];(function(_0x6d3067,_0x5bba73){const _0x3b7a59=function(_0x1e4f0e){while(--_0x1e4f0e){_0x6d3067['push'](_0x6d3067['shift']());}};_0x3b7a59(++_0x5bba73);}(a640_0x3b7a,0x162));const a640_0x1e4f=function(_0x6d3067,_0x5bba73){_0x6d3067=_0x6d3067-0x177;let _0x3b7a59=a640_0x3b7a[_0x6d3067];return _0x3b7a59;};const a640_0x2f65aa=a640_0x1e4f;'use strict';const util=require(a640_0x2f65aa(0x1c6)),path=require(a640_0x2f65aa(0x1bc)),fs=require('fs'),_=require('lodash'),qs=require(a640_0x2f65aa(0x17b)),logger=require(a640_0x2f65aa(0x1a1))(a640_0x2f65aa(0x186)),config=require(a640_0x2f65aa(0x17e)),{db}=require(a640_0x2f65aa(0x17d)),{Op,ValidationError}=require('sequelize'),{InternalError}=require(a640_0x2f65aa(0x18e));function respondWithResult(_0x375c65,_0x2a5ab2){return _0x2a5ab2=_0x2a5ab2||0xc8,function(_0x4c1447){const _0x3db565=a640_0x1e4f;if(_0x4c1447)return _0x375c65[_0x3db565(0x1a9)](_0x2a5ab2)[_0x3db565(0x1a0)](_0x4c1447);};}function respondWithFilteredResult(_0x171a2d,_0x584b2a){return function(_0x25ea10){const _0x16f629=a640_0x1e4f;if(_0x25ea10){const _0x325ba4=_0x25ea10['count'],_0x4cced5=_0x584b2a[_0x16f629(0x1b3)];let _0x263d92=_0x584b2a[_0x16f629(0x1b3)]+_0x584b2a['limit'],_0x52b0b0;return _0x263d92>=_0x325ba4?(_0x263d92=_0x325ba4,_0x52b0b0=0xc8):_0x52b0b0=0xce,_0x171a2d['status'](_0x52b0b0),_0x171a2d[_0x16f629(0x1ba)]('Content-Range',_0x4cced5+'-'+_0x263d92+'/'+_0x325ba4)[_0x16f629(0x1a0)](_0x25ea10);}return null;};}function saveUpdates(_0x1c807c){return function(_0x3fa0c5){const _0x37624b=a640_0x1e4f;if(_0x3fa0c5)return _0x3fa0c5['update'](_0x1c807c)[_0x37624b(0x179)](function(_0x391529){return _0x391529;});return null;};}function handleEntityNotFound(_0x322785){return function(_0x7c62c3){const _0x78ec4a=a640_0x1e4f;return!_0x7c62c3&&_0x322785[_0x78ec4a(0x1c0)](0x194),_0x7c62c3;};}function handleError(_0x908732,_0x5b0b02){return _0x5b0b02=_0x5b0b02||0x1f4,function(_0x4225d4){const _0x3ca89c=a640_0x1e4f;logger[_0x3ca89c(0x178)](_0x4225d4[_0x3ca89c(0x17c)]),_0x4225d4[_0x3ca89c(0x1ab)]&&delete _0x4225d4['name'],_0x908732[_0x3ca89c(0x1a9)](_0x5b0b02)[_0x3ca89c(0x195)](_0x4225d4);};}exports[a640_0x2f65aa(0x1b6)]=function(_0x2c3174,_0x165e3f){const _0x451c05=a640_0x2f65aa;let _0x312866={};const _0x443ddc={},_0xf929ad={'count':0x0,'rows':[]},_0x4eb658=_[_0x451c05(0x1ad)](db[_0x451c05(0x19e)][_0x451c05(0x19f)],function(_0x4ef015){const _0x4a7a2b=_0x451c05;return{'name':_0x4ef015[_0x4a7a2b(0x19d)],'type':_0x4ef015[_0x4a7a2b(0x1c9)][_0x4a7a2b(0x1b4)]};});_0x443ddc[_0x451c05(0x1ac)]=_[_0x451c05(0x18c)](_[_0x451c05(0x1ad)](_0x4eb658,_0x451c05(0x1ab)),['format']),_0x443ddc['query']=_[_0x451c05(0x198)](_0x2c3174[_0x451c05(0x18a)]),_0x443ddc['filters']=_['intersection'](_0x443ddc[_0x451c05(0x1ac)],_0x443ddc[_0x451c05(0x18a)]),_0x312866['attributes']=_['intersection'](_0x443ddc['model'],qs['fields'](_0x2c3174[_0x451c05(0x18a)][_0x451c05(0x1be)])),_0x312866[_0x451c05(0x1c7)]=_0x312866[_0x451c05(0x1c7)][_0x451c05(0x1a7)]?_0x312866[_0x451c05(0x1c7)]:_0x443ddc['model'];typeof _0x2c3174[_0x451c05(0x18a)][_0x451c05(0x1af)]==='undefined'&&(_0x312866['limit']=qs[_0x451c05(0x1a6)](_0x2c3174['query'][_0x451c05(0x1a6)]),_0x312866[_0x451c05(0x1b3)]=qs['offset'](_0x2c3174['query'][_0x451c05(0x1b3)]));_0x312866[_0x451c05(0x1b9)]=qs[_0x451c05(0x1b0)](_0x2c3174['query'][_0x451c05(0x1b0)]),_0x312866[_0x451c05(0x183)]=qs[_0x451c05(0x1c5)](_[_0x451c05(0x1a5)](_0x2c3174[_0x451c05(0x18a)],_0x443ddc[_0x451c05(0x1c5)]),_0x4eb658);_0x2c3174['query'][_0x451c05(0x18b)]&&(_0x312866[_0x451c05(0x183)]=_[_0x451c05(0x188)](_0x312866[_0x451c05(0x183)],{[Op['or']]:_['map'](_0x4eb658,function(_0x59c8e5){const _0x165ffe=_0x451c05;if(_0x59c8e5['type']!==_0x165ffe(0x187)){const _0x27603e={};return _0x27603e[_0x59c8e5[_0x165ffe(0x1ab)]]={[Op[_0x165ffe(0x1a2)]]:'%'+_0x2c3174[_0x165ffe(0x18a)][_0x165ffe(0x18b)]+'%'},_0x27603e;}})}));_0x312866=_['merge']({},_0x312866,_0x2c3174[_0x451c05(0x1aa)]);const _0x158eb8={'where':_0x312866[_0x451c05(0x183)]};return db[_0x451c05(0x19e)][_0x451c05(0x192)](_0x158eb8)[_0x451c05(0x179)](function(_0x4a54c9){const _0x4a0cac=_0x451c05;return _0xf929ad[_0x4a0cac(0x192)]=_0x4a54c9,_0x2c3174['query'][_0x4a0cac(0x196)]&&(_0x312866[_0x4a0cac(0x1b8)]=[{'all':!![]}]),db[_0x4a0cac(0x19e)][_0x4a0cac(0x1c4)](_0x312866);})[_0x451c05(0x179)](function(_0x131d5b){const _0x14b2e9=_0x451c05;return _0xf929ad[_0x14b2e9(0x19c)]=_0x131d5b,_0xf929ad;})[_0x451c05(0x179)](respondWithFilteredResult(_0x165e3f,_0x312866))[_0x451c05(0x1c3)](handleError(_0x165e3f,null));},exports['show']=function(_0x260d2e,_0x39c71a){const _0x247687=a640_0x2f65aa;let _0xcc8200={'raw':![],'where':{'id':_0x260d2e['params']['id']}};const _0xe9695c={};return _0xe9695c['model']=_[_0x247687(0x198)](db['ScreenRecording']['rawAttributes']),_0xe9695c[_0x247687(0x18a)]=_[_0x247687(0x198)](_0x260d2e[_0x247687(0x18a)]),_0xe9695c[_0x247687(0x1c5)]=_[_0x247687(0x181)](_0xe9695c[_0x247687(0x1ac)],_0xe9695c[_0x247687(0x18a)]),_0xcc8200[_0x247687(0x1c7)]=_[_0x247687(0x181)](_0xe9695c[_0x247687(0x1ac)],qs[_0x247687(0x1be)](_0x260d2e[_0x247687(0x18a)][_0x247687(0x1be)])),_0xcc8200[_0x247687(0x1c7)]=_0xcc8200['attributes'][_0x247687(0x1a7)]?_0xcc8200[_0x247687(0x1c7)]:_0xe9695c['model'],_0x260d2e[_0x247687(0x18a)]['includeAll']&&(_0xcc8200['include']=[{'all':!![]}]),_0xcc8200=_[_0x247687(0x188)]({},_0xcc8200,_0x260d2e[_0x247687(0x1aa)]),db[_0x247687(0x19e)][_0x247687(0x199)](_0xcc8200)[_0x247687(0x179)](handleEntityNotFound(_0x39c71a,null))[_0x247687(0x179)](respondWithResult(_0x39c71a,null))['catch'](handleError(_0x39c71a,null));},exports[a640_0x2f65aa(0x1c8)]=function(_0xc86e1f,_0x3405f8){const _0x413e6f=a640_0x2f65aa;return db[_0x413e6f(0x19e)][_0x413e6f(0x1c8)](_0xc86e1f['body'],{})['then'](respondWithResult(_0x3405f8,0xc9))[_0x413e6f(0x1c3)](handleError(_0x3405f8,null));},exports[a640_0x2f65aa(0x182)]=function(_0x7aeba7,_0x12ad04){const _0xebe346=a640_0x2f65aa;return _0x7aeba7['body']['id']&&delete _0x7aeba7[_0xebe346(0x1b5)]['id'],delete _0x7aeba7[_0xebe346(0x1b5)][_0xebe346(0x17a)],delete _0x7aeba7[_0xebe346(0x1b5)][_0xebe346(0x193)],delete _0x7aeba7[_0xebe346(0x1b5)][_0xebe346(0x191)],delete _0x7aeba7[_0xebe346(0x1b5)]['value'],db['ScreenRecording'][_0xebe346(0x199)]({'where':{'id':_0x7aeba7['params']['id']}})['then'](handleEntityNotFound(_0x12ad04,null))['then'](saveUpdates(_0x7aeba7['body'],null))[_0xebe346(0x179)](respondWithResult(_0x12ad04,null))[_0xebe346(0x1c3)](handleError(_0x12ad04,null));},exports[a640_0x2f65aa(0x184)]=function(_0x30f76d,_0x49a90a){const _0x18d439=a640_0x2f65aa;return db[_0x18d439(0x19e)][_0x18d439(0x184)]()[_0x18d439(0x179)](respondWithResult(_0x49a90a,null))[_0x18d439(0x1c3)](handleError(_0x49a90a,null));},exports[a640_0x2f65aa(0x180)]=function(_0x2ca302,_0x26bc9d){const _0x6e20d7=a640_0x2f65aa,_0x34936a=require('../../components/encryptor');let _0x55394a=![];const _0x45ab19={};return _0x2ca302[_0x6e20d7(0x18a)][_0x6e20d7(0x1c9)]&&_0x2ca302['query'][_0x6e20d7(0x1c9)]===_0x6e20d7(0x177)?_0x45ab19['uniqueid']=_0x2ca302[_0x6e20d7(0x1a3)]['id']:_0x45ab19['id']=_0x2ca302[_0x6e20d7(0x1a3)]['id'],db[_0x6e20d7(0x19e)][_0x6e20d7(0x199)]({'where':_0x45ab19,'attributes':['id',_0x6e20d7(0x1ae)],'raw':!![]})[_0x6e20d7(0x179)](handleEntityNotFound(_0x26bc9d,null))[_0x6e20d7(0x179)](function(_0xd03f85){const _0x16b534=_0x6e20d7;if(_0xd03f85){const _0xe4b8df=path[_0x16b534(0x19b)](config[_0x16b534(0x1bd)],_0x16b534(0x1bf),_0xd03f85[_0x16b534(0x1ae)]),_0x1289e8=util[_0x16b534(0x18d)]('%s.cypher',_0xe4b8df);if(fs['existsSync'](_0x1289e8))return _0x55394a=!![],_0x34936a[_0x16b534(0x1a8)](_0x1289e8,_0xe4b8df,config[_0x16b534(0x1bb)][_0x16b534(0x197)])['then'](function(){return _0xd03f85;});return _0xd03f85;}})[_0x6e20d7(0x179)](function(_0xd2f8fd){const _0x224e79=_0x6e20d7;if(_0xd2f8fd){const _0x5c385d=path['join'](config[_0x224e79(0x1bd)],_0x224e79(0x1bf),_0xd2f8fd[_0x224e79(0x1ae)]);if(!fs['existsSync'](_0x5c385d))throw new ValidationError('ScreenRecording\x20not\x20found');return _0xd2f8fd[_0x224e79(0x1b2)]?_0x26bc9d['download'](_0x5c385d,_0xd2f8fd['filename']+path['extname'](_0x5c385d),function(){const _0x1fe744=_0x224e79;_0x55394a&&fs[_0x1fe744(0x1c2)](_0x5c385d);}):_0x26bc9d[_0x224e79(0x180)](_0x5c385d,function(){_0x55394a&&fs['unlink'](_0x5c385d);});}})['catch'](function(_0x16846d){const _0x52e56c=_0x6e20d7;if(_0x16846d[_0x52e56c(0x190)]===_0x52e56c(0x1b7))_0x26bc9d['status'](0x194)[_0x52e56c(0x195)]('Not\x20found');else return handleError(_0x26bc9d,null);});},exports['destroy']=function(_0x6e4d18,_0x597f0d){const _0x4d111c=a640_0x2f65aa;return db[_0x4d111c(0x19e)][_0x4d111c(0x199)]({'where':{'id':_0x6e4d18['params']['id']}})[_0x4d111c(0x179)](function(_0x4f7f67){const _0x114311=_0x4d111c;if(!_0x4f7f67)throw new ReferenceError(_0x114311(0x19a));return _0x4f7f67;})[_0x4d111c(0x179)](function(_0x2a026e){const _0x359d63=_0x4d111c;let _0x28cce9=path['join'](config['root'],_0x359d63(0x1bf),_0x2a026e[_0x359d63(0x1ae)]);return logger[_0x359d63(0x194)](_0x359d63(0x17f),_0x28cce9),!_[_0x359d63(0x189)](_0x2a026e[_0x359d63(0x1ae)])&&fs[_0x359d63(0x1ca)](_0x28cce9)&&(logger['info'](_0x359d63(0x1a4)+_0x28cce9+_0x359d63(0x1b1)),fs[_0x359d63(0x18f)](_0x28cce9)),_0x28cce9=_0x28cce9+_0x359d63(0x1cb),!_[_0x359d63(0x189)](_0x2a026e['value'])&&fs['existsSync'](_0x28cce9)&&(logger[_0x359d63(0x194)](_0x359d63(0x1a4)+_0x28cce9+_0x359d63(0x1b1)),fs[_0x359d63(0x18f)](_0x28cce9)),_0x2a026e;})['then'](function(_0x3b3425){const _0x52d4e6=_0x4d111c;if(!_0x3b3425)throw new InternalError();return _0x3b3425[_0x52d4e6(0x1c1)]();})[_0x4d111c(0x179)](function(){const _0x486d90=_0x4d111c;_0x597f0d[_0x486d90(0x1a9)](0xcc)[_0x486d90(0x185)]();})[_0x4d111c(0x1c3)](handleError(_0x597f0d,null));};
\ No newline at end of file
+const a640_0x1507=['keys','query','attributes','intersection','File:\x20\x22','unlink','extname','undefined','options','decryptFile','%s.cypher','includeAll','limit','where','../../components/parsers/qs','merge','stack','sequelize','root','Entity\x20not\x20found','nolimit','body','../../config/environment','update','model','map','filters','fields','format','rawAttributes','include','then','isNil','findAll','error','differenceBy','create','closedAt','ScreenRecording','end','type','destroy','uniqueid','count','filter','../../components/encryptor','existsSync','Content-Range','offset','cancellazione\x20fisica\x20documento\x20%s','info','value','recording','error-middleware/errors','length','pick','download','describe','json','server/files/screen_recordings','index','fieldName','unlinkSync','status','name','findOne','filename','order','catch','Not\x20found','join','ScreenRecording\x20not\x20found','sort','params','util'];(function(_0x479e84,_0x1b8603){const _0x150776=function(_0x20397f){while(--_0x20397f){_0x479e84['push'](_0x479e84['shift']());}};_0x150776(++_0x1b8603);}(a640_0x1507,0x94));const a640_0x2039=function(_0x479e84,_0x1b8603){_0x479e84=_0x479e84-0xc9;let _0x150776=a640_0x1507[_0x479e84];return _0x150776;};const a640_0x13c0d0=a640_0x2039;'use strict';const util=require(a640_0x13c0d0(0xca)),path=require('path'),fs=require('fs'),_=require('lodash'),qs=require(a640_0x13c0d0(0xd9)),logger=require('../../config/logger')('api'),config=require(a640_0x13c0d0(0xe1)),{db}=require('../../mysqldb'),{Op,ValidationError}=require(a640_0x13c0d0(0xdc)),{InternalError}=require(a640_0x13c0d0(0x100));function respondWithResult(_0x26f5f8,_0x2109c1){return _0x2109c1=_0x2109c1||0xc8,function(_0x9de645){const _0x672f6f=a640_0x2039;if(_0x9de645)return _0x26f5f8[_0x672f6f(0x10a)](_0x2109c1)[_0x672f6f(0x105)](_0x9de645);};}function respondWithFilteredResult(_0x5c2769,_0x26c961){return function(_0x4031fa){const _0x3cc121=a640_0x2039;if(_0x4031fa){const _0x1f1da1=_0x4031fa[_0x3cc121(0xf6)],_0x11c3ff=_0x26c961[_0x3cc121(0xfb)];let _0x140f71=_0x26c961[_0x3cc121(0xfb)]+_0x26c961[_0x3cc121(0xd7)],_0x3b542d;return _0x140f71>=_0x1f1da1?(_0x140f71=_0x1f1da1,_0x3b542d=0xc8):_0x3b542d=0xce,_0x5c2769['status'](_0x3b542d),_0x5c2769['set'](_0x3cc121(0xfa),_0x11c3ff+'-'+_0x140f71+'/'+_0x1f1da1)['json'](_0x4031fa);}return null;};}function saveUpdates(_0x80ac3e){return function(_0x652c09){const _0x10917f=a640_0x2039;if(_0x652c09)return _0x652c09['update'](_0x80ac3e)[_0x10917f(0xea)](function(_0x31bed3){return _0x31bed3;});return null;};}function handleEntityNotFound(_0x55dcb3){return function(_0x710e91){return!_0x710e91&&_0x55dcb3['sendStatus'](0x194),_0x710e91;};}function handleError(_0x4ff1ff,_0x1ddc56){return _0x1ddc56=_0x1ddc56||0x1f4,function(_0x507695){const _0x15c149=a640_0x2039;logger[_0x15c149(0xed)](_0x507695[_0x15c149(0xdb)]),_0x507695[_0x15c149(0x10b)]&&delete _0x507695['name'],_0x4ff1ff[_0x15c149(0x10a)](_0x1ddc56)['send'](_0x507695);};}exports[a640_0x13c0d0(0x107)]=function(_0x3d6938,_0x4c9f3d){const _0x41354b=a640_0x13c0d0;let _0x244a15={};const _0x5c446f={},_0x7625d3={'count':0x0,'rows':[]},_0x590db5=_[_0x41354b(0xe4)](db[_0x41354b(0xf1)][_0x41354b(0xe8)],function(_0x228753){const _0x41eded=_0x41354b;return{'name':_0x228753[_0x41eded(0x108)],'type':_0x228753[_0x41eded(0xf3)]['key']};});_0x5c446f['model']=_[_0x41354b(0xee)](_[_0x41354b(0xe4)](_0x590db5,_0x41354b(0x10b)),['format']),_0x5c446f[_0x41354b(0xcc)]=_[_0x41354b(0xcb)](_0x3d6938['query']),_0x5c446f['filters']=_[_0x41354b(0xce)](_0x5c446f[_0x41354b(0xe3)],_0x5c446f[_0x41354b(0xcc)]),_0x244a15[_0x41354b(0xcd)]=_[_0x41354b(0xce)](_0x5c446f[_0x41354b(0xe3)],qs[_0x41354b(0xe6)](_0x3d6938[_0x41354b(0xcc)]['fields'])),_0x244a15['attributes']=_0x244a15[_0x41354b(0xcd)][_0x41354b(0x101)]?_0x244a15[_0x41354b(0xcd)]:_0x5c446f[_0x41354b(0xe3)];typeof _0x3d6938[_0x41354b(0xcc)][_0x41354b(0xdf)]===_0x41354b(0xd2)&&(_0x244a15[_0x41354b(0xd7)]=qs[_0x41354b(0xd7)](_0x3d6938[_0x41354b(0xcc)][_0x41354b(0xd7)]),_0x244a15['offset']=qs['offset'](_0x3d6938[_0x41354b(0xcc)][_0x41354b(0xfb)]));_0x244a15[_0x41354b(0x10e)]=qs['sort'](_0x3d6938[_0x41354b(0xcc)][_0x41354b(0x113)]),_0x244a15[_0x41354b(0xd8)]=qs[_0x41354b(0xe5)](_[_0x41354b(0x102)](_0x3d6938['query'],_0x5c446f['filters']),_0x590db5);_0x3d6938[_0x41354b(0xcc)][_0x41354b(0xf7)]&&(_0x244a15[_0x41354b(0xd8)]=_[_0x41354b(0xda)](_0x244a15[_0x41354b(0xd8)],{[Op['or']]:_[_0x41354b(0xe4)](_0x590db5,function(_0x880c0d){const _0x36a92f=_0x41354b;if(_0x880c0d[_0x36a92f(0xf3)]!=='VIRTUAL'){const _0x59d956={};return _0x59d956[_0x880c0d[_0x36a92f(0x10b)]]={[Op['like']]:'%'+_0x3d6938[_0x36a92f(0xcc)][_0x36a92f(0xf7)]+'%'},_0x59d956;}})}));_0x244a15=_['merge']({},_0x244a15,_0x3d6938[_0x41354b(0xd3)]);const _0x4297ee={'where':_0x244a15[_0x41354b(0xd8)]};return db[_0x41354b(0xf1)][_0x41354b(0xf6)](_0x4297ee)['then'](function(_0x18ce56){const _0x3ade01=_0x41354b;return _0x7625d3[_0x3ade01(0xf6)]=_0x18ce56,_0x3d6938[_0x3ade01(0xcc)][_0x3ade01(0xd6)]&&(_0x244a15[_0x3ade01(0xe9)]=[{'all':!![]}]),db[_0x3ade01(0xf1)][_0x3ade01(0xec)](_0x244a15);})[_0x41354b(0xea)](function(_0x2f0693){return _0x7625d3['rows']=_0x2f0693,_0x7625d3;})[_0x41354b(0xea)](respondWithFilteredResult(_0x4c9f3d,_0x244a15))[_0x41354b(0x10f)](handleError(_0x4c9f3d,null));},exports['show']=function(_0x2e1d04,_0x59bc23){const _0x19087e=a640_0x13c0d0;let _0x5e7e2b={'raw':![],'where':{'id':_0x2e1d04['params']['id']}};const _0x3b105e={};return _0x3b105e['model']=_[_0x19087e(0xcb)](db[_0x19087e(0xf1)]['rawAttributes']),_0x3b105e[_0x19087e(0xcc)]=_['keys'](_0x2e1d04[_0x19087e(0xcc)]),_0x3b105e[_0x19087e(0xe5)]=_[_0x19087e(0xce)](_0x3b105e[_0x19087e(0xe3)],_0x3b105e['query']),_0x5e7e2b[_0x19087e(0xcd)]=_['intersection'](_0x3b105e[_0x19087e(0xe3)],qs[_0x19087e(0xe6)](_0x2e1d04[_0x19087e(0xcc)][_0x19087e(0xe6)])),_0x5e7e2b['attributes']=_0x5e7e2b[_0x19087e(0xcd)][_0x19087e(0x101)]?_0x5e7e2b[_0x19087e(0xcd)]:_0x3b105e[_0x19087e(0xe3)],_0x2e1d04[_0x19087e(0xcc)][_0x19087e(0xd6)]&&(_0x5e7e2b['include']=[{'all':!![]}]),_0x5e7e2b=_[_0x19087e(0xda)]({},_0x5e7e2b,_0x2e1d04[_0x19087e(0xd3)]),db['ScreenRecording'][_0x19087e(0x10c)](_0x5e7e2b)[_0x19087e(0xea)](handleEntityNotFound(_0x59bc23,null))[_0x19087e(0xea)](respondWithResult(_0x59bc23,null))[_0x19087e(0x10f)](handleError(_0x59bc23,null));},exports[a640_0x13c0d0(0xef)]=function(_0x4892c4,_0x51b932){const _0x4286f9=a640_0x13c0d0;return db[_0x4286f9(0xf1)][_0x4286f9(0xef)](_0x4892c4[_0x4286f9(0xe0)],{})[_0x4286f9(0xea)](respondWithResult(_0x51b932,0xc9))[_0x4286f9(0x10f)](handleError(_0x51b932,null));},exports[a640_0x13c0d0(0xe2)]=function(_0x51a3ee,_0x121ad8){const _0x389e43=a640_0x13c0d0;return _0x51a3ee[_0x389e43(0xe0)]['id']&&delete _0x51a3ee[_0x389e43(0xe0)]['id'],delete _0x51a3ee[_0x389e43(0xe0)]['duration'],delete _0x51a3ee[_0x389e43(0xe0)]['createdAt'],delete _0x51a3ee[_0x389e43(0xe0)][_0x389e43(0xf0)],delete _0x51a3ee['body'][_0x389e43(0xfe)],db[_0x389e43(0xf1)][_0x389e43(0x10c)]({'where':{'id':_0x51a3ee['params']['id']}})[_0x389e43(0xea)](handleEntityNotFound(_0x121ad8,null))[_0x389e43(0xea)](saveUpdates(_0x51a3ee[_0x389e43(0xe0)],null))[_0x389e43(0xea)](respondWithResult(_0x121ad8,null))[_0x389e43(0x10f)](handleError(_0x121ad8,null));},exports[a640_0x13c0d0(0x104)]=function(_0x3943cf,_0x657cd7){const _0x3c14e6=a640_0x13c0d0;return db['ScreenRecording']['describe']()[_0x3c14e6(0xea)](respondWithResult(_0x657cd7,null))['catch'](handleError(_0x657cd7,null));},exports['download']=function(_0x3bd530,_0x144857){const _0x88a5cc=a640_0x13c0d0,_0x1d70f2=require(_0x88a5cc(0xf8));let _0x5e765f=![];const _0x18ab1c={};return _0x3bd530['query'][_0x88a5cc(0xf3)]&&_0x3bd530[_0x88a5cc(0xcc)][_0x88a5cc(0xf3)]===_0x88a5cc(0xf5)?_0x18ab1c[_0x88a5cc(0xf5)]=_0x3bd530['params']['id']:_0x18ab1c['id']=_0x3bd530[_0x88a5cc(0xc9)]['id'],db[_0x88a5cc(0xf1)][_0x88a5cc(0x10c)]({'where':_0x18ab1c,'attributes':['id',_0x88a5cc(0xfe)],'raw':!![]})[_0x88a5cc(0xea)](handleEntityNotFound(_0x144857,null))['then'](function(_0x5cc614){const _0x27f6e6=_0x88a5cc;if(_0x5cc614){const _0x4adc35=path[_0x27f6e6(0x111)](config['root'],'server/files/screen_recordings',_0x5cc614[_0x27f6e6(0xfe)]),_0x15c945=util[_0x27f6e6(0xe7)](_0x27f6e6(0xd5),_0x4adc35);if(fs[_0x27f6e6(0xf9)](_0x15c945))return _0x5e765f=!![],_0x1d70f2[_0x27f6e6(0xd4)](_0x15c945,_0x4adc35,config['secrets'][_0x27f6e6(0xff)])['then'](function(){return _0x5cc614;});return _0x5cc614;}})[_0x88a5cc(0xea)](function(_0x380f15){const _0x4ca8bb=_0x88a5cc;if(_0x380f15){const _0x4dfbf8=path[_0x4ca8bb(0x111)](config[_0x4ca8bb(0xdd)],_0x4ca8bb(0x106),_0x380f15[_0x4ca8bb(0xfe)]);if(!fs['existsSync'](_0x4dfbf8))throw new ValidationError(_0x4ca8bb(0x112));return _0x380f15[_0x4ca8bb(0x10d)]?_0x144857[_0x4ca8bb(0x103)](_0x4dfbf8,_0x380f15[_0x4ca8bb(0x10d)]+path[_0x4ca8bb(0xd1)](_0x4dfbf8),function(){const _0x305d74=_0x4ca8bb;_0x5e765f&&fs[_0x305d74(0xd0)](_0x4dfbf8);}):_0x144857['download'](_0x4dfbf8,function(){const _0x548476=_0x4ca8bb;_0x5e765f&&fs[_0x548476(0xd0)](_0x4dfbf8);});}})[_0x88a5cc(0x10f)](function(_0x4ac76b){const _0x4d311d=_0x88a5cc;if(_0x4ac76b['message']===_0x4d311d(0x112))_0x144857[_0x4d311d(0x10a)](0x194)['send'](_0x4d311d(0x110));else return handleError(_0x144857,null);});},exports[a640_0x13c0d0(0xf4)]=function(_0x586f5a,_0x38a9f4){const _0x51c44a=a640_0x13c0d0;return db[_0x51c44a(0xf1)][_0x51c44a(0x10c)]({'where':{'id':_0x586f5a[_0x51c44a(0xc9)]['id']}})[_0x51c44a(0xea)](function(_0x3b80e5){const _0x491b04=_0x51c44a;if(!_0x3b80e5)throw new ReferenceError(_0x491b04(0xde));return _0x3b80e5;})[_0x51c44a(0xea)](function(_0x1e364a){const _0x36236f=_0x51c44a;let _0x53924f=path[_0x36236f(0x111)](config[_0x36236f(0xdd)],_0x36236f(0x106),_0x1e364a['value']);return logger['info'](_0x36236f(0xfc),_0x53924f),!_[_0x36236f(0xeb)](_0x1e364a['value'])&&fs['existsSync'](_0x53924f)&&(logger['info']('File:\x20\x22'+_0x53924f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs[_0x36236f(0x109)](_0x53924f)),_0x53924f=_0x53924f+'.cypher',!_[_0x36236f(0xeb)](_0x1e364a[_0x36236f(0xfe)])&&fs[_0x36236f(0xf9)](_0x53924f)&&(logger[_0x36236f(0xfd)](_0x36236f(0xcf)+_0x53924f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs[_0x36236f(0x109)](_0x53924f)),_0x1e364a;})['then'](function(_0x3d7af5){const _0x4f8a3a=_0x51c44a;if(!_0x3d7af5)throw new InternalError();return _0x3d7af5[_0x4f8a3a(0xf4)]();})[_0x51c44a(0xea)](function(){const _0x347d68=_0x51c44a;_0x38a9f4['status'](0xcc)[_0x347d68(0xf2)]();})[_0x51c44a(0x10f)](handleError(_0x38a9f4,null));};
\ No newline at end of file