Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / screenRecording / screenRecording.controller.js
index 5ad3aa2..bd86174 100644 (file)
@@ -1 +1 @@
-const a534_0x2f3f=['order','send','VIRTUAL','api','existsSync','../../components/parsers/qs','error','attributes','message','create','%s.cypher','download','decryptFile','isNil','filters','recording','options','status','../../config/environment','fieldName','includeAll','stack','name','createdAt','ScreenRecording','fields','params','cancellazione\x20fisica\x20documento\x20%s','server/files/screen_recordings','describe','nolimit','util','index','value','body','sort','lodash','path','limit','ScreenRecording\x20not\x20found','rows','destroy','update','Entity\x20not\x20found','File:\x20\x22','root','model','json','../../config/logger','../../components/encryptor','filename','extname','merge','like','rawAttributes','map','set','offset','secrets','show','where','join','differenceBy','intersection','type','info','count','key','findOne','query','../../mysqldb','catch','uniqueid','then','keys','Not\x20found','format','filter','undefined'];(function(_0x37aa9d,_0x2f3f7d){const _0x960f87=function(_0x8dc5ac){while(--_0x8dc5ac){_0x37aa9d['push'](_0x37aa9d['shift']());}};_0x960f87(++_0x2f3f7d);}(a534_0x2f3f,0x1b1));const a534_0x960f=function(_0x37aa9d,_0x2f3f7d){_0x37aa9d=_0x37aa9d-0x0;let _0x960f87=a534_0x2f3f[_0x37aa9d];return _0x960f87;};const _0x248e59=a534_0x960f;'use strict';const util=require(_0x248e59('0x48')),path=require(_0x248e59('0x4e')),fs=require('fs'),_=require(_0x248e59('0x4d')),qs=require(_0x248e59('0x2e')),logger=require(_0x248e59('0xa'))(_0x248e59('0x2c')),config=require(_0x248e59('0x3b')),db=require(_0x248e59('0x20'))['db'],{Op,ValidationError}=require('sequelize'),{InternalError}=require('error-middleware/errors');function respondWithResult(_0x8dc5ac,_0x3b9a0a){return _0x3b9a0a=_0x3b9a0a||0xc8,function(_0x1f59d5){const _0x1ccdd3=a534_0x960f;if(_0x1f59d5)return _0x8dc5ac[_0x1ccdd3('0x3a')](_0x3b9a0a)[_0x1ccdd3('0x9')](_0x1f59d5);};}function respondWithFilteredResult(_0x6a97bd,_0x343982){return function(_0x1b5178){const _0x39b2aa=a534_0x960f;if(_0x1b5178){const _0x2702b8=_0x1b5178[_0x39b2aa('0x1c')],_0x475bc5=_0x343982[_0x39b2aa('0x13')];let _0x3c0077=_0x343982[_0x39b2aa('0x13')]+_0x343982[_0x39b2aa('0x0')],_0x2b6988;return _0x3c0077>=_0x2702b8?(_0x3c0077=_0x2702b8,_0x2b6988=0xc8):_0x2b6988=0xce,_0x6a97bd[_0x39b2aa('0x3a')](_0x2b6988),_0x6a97bd[_0x39b2aa('0x12')]('Content-Range',_0x475bc5+'-'+_0x3c0077+'/'+_0x2702b8)[_0x39b2aa('0x9')](_0x1b5178);}return null;};}function saveUpdates(_0x3c2ac4){return function(_0x55e00e){const _0x1e7c21=a534_0x960f;if(_0x55e00e)return _0x55e00e[_0x1e7c21('0x4')](_0x3c2ac4)[_0x1e7c21('0x23')](function(_0x50a48d){return _0x50a48d;});return null;};}function handleEntityNotFound(_0x25346b){return function(_0x48c708){return!_0x48c708&&_0x25346b['sendStatus'](0x194),_0x48c708;};}function handleError(_0x3cf1ad,_0x565132){return _0x565132=_0x565132||0x1f4,function(_0x1c63fc){const _0xf6a18e=a534_0x960f;logger[_0xf6a18e('0x2f')](_0x1c63fc[_0xf6a18e('0x3e')]),_0x1c63fc[_0xf6a18e('0x3f')]&&delete _0x1c63fc['name'],_0x3cf1ad['status'](_0x565132)['send'](_0x1c63fc);};}exports[_0x248e59('0x49')]=function(_0x5caff5,_0x866ee6){const _0x10fbbf=_0x248e59;let _0x3ce933={};const _0xd33478={},_0x17dfca={'count':0x0,'rows':[]},_0x3d3561=_[_0x10fbbf('0x11')](db[_0x10fbbf('0x41')][_0x10fbbf('0x10')],function(_0x21a07a){const _0x388c43=_0x10fbbf;return{'name':_0x21a07a[_0x388c43('0x3c')],'type':_0x21a07a[_0x388c43('0x1a')][_0x388c43('0x1d')]};});_0xd33478['model']=_[_0x10fbbf('0x18')](_['map'](_0x3d3561,'name'),[_0x10fbbf('0x26')]),_0xd33478[_0x10fbbf('0x1f')]=_[_0x10fbbf('0x24')](_0x5caff5['query']),_0xd33478[_0x10fbbf('0x37')]=_['intersection'](_0xd33478['model'],_0xd33478[_0x10fbbf('0x1f')]),_0x3ce933[_0x10fbbf('0x30')]=_[_0x10fbbf('0x19')](_0xd33478[_0x10fbbf('0x8')],qs[_0x10fbbf('0x42')](_0x5caff5[_0x10fbbf('0x1f')]['fields'])),_0x3ce933[_0x10fbbf('0x30')]=_0x3ce933['attributes']['length']?_0x3ce933[_0x10fbbf('0x30')]:_0xd33478[_0x10fbbf('0x8')];typeof _0x5caff5['query'][_0x10fbbf('0x47')]===_0x10fbbf('0x28')&&(_0x3ce933[_0x10fbbf('0x0')]=qs['limit'](_0x5caff5[_0x10fbbf('0x1f')][_0x10fbbf('0x0')]),_0x3ce933[_0x10fbbf('0x13')]=qs[_0x10fbbf('0x13')](_0x5caff5[_0x10fbbf('0x1f')][_0x10fbbf('0x13')]));_0x3ce933[_0x10fbbf('0x29')]=qs[_0x10fbbf('0x4c')](_0x5caff5[_0x10fbbf('0x1f')]['sort']),_0x3ce933[_0x10fbbf('0x16')]=qs[_0x10fbbf('0x37')](_['pick'](_0x5caff5[_0x10fbbf('0x1f')],_0xd33478['filters']),_0x3d3561);_0x5caff5[_0x10fbbf('0x1f')][_0x10fbbf('0x27')]&&(_0x3ce933['where']=_[_0x10fbbf('0xe')](_0x3ce933[_0x10fbbf('0x16')],{[Op['or']]:_['map'](_0x3d3561,function(_0x5e054b){const _0x3dc9a7=_0x10fbbf;if(_0x5e054b[_0x3dc9a7('0x1a')]!==_0x3dc9a7('0x2b')){const _0x15bd6f={};return _0x15bd6f[_0x5e054b['name']]={[Op[_0x3dc9a7('0xf')]]:'%'+_0x5caff5[_0x3dc9a7('0x1f')]['filter']+'%'},_0x15bd6f;}})}));_0x3ce933=_[_0x10fbbf('0xe')]({},_0x3ce933,_0x5caff5[_0x10fbbf('0x39')]);const _0x816139={'where':_0x3ce933[_0x10fbbf('0x16')]};return db[_0x10fbbf('0x41')][_0x10fbbf('0x1c')](_0x816139)[_0x10fbbf('0x23')](function(_0x29e6f8){const _0xc129ee=_0x10fbbf;return _0x17dfca[_0xc129ee('0x1c')]=_0x29e6f8,_0x5caff5[_0xc129ee('0x1f')]['includeAll']&&(_0x3ce933['include']=[{'all':!![]}]),db[_0xc129ee('0x41')]['findAll'](_0x3ce933);})[_0x10fbbf('0x23')](function(_0x57556d){const _0x5654af=_0x10fbbf;return _0x17dfca[_0x5654af('0x2')]=_0x57556d,_0x17dfca;})['then'](respondWithFilteredResult(_0x866ee6,_0x3ce933))[_0x10fbbf('0x21')](handleError(_0x866ee6,null));},exports[_0x248e59('0x15')]=function(_0x424d9c,_0x1a01a9){const _0x1676fc=_0x248e59;let _0x741da0={'raw':![],'where':{'id':_0x424d9c[_0x1676fc('0x43')]['id']}};const _0x52ade4={};return _0x52ade4[_0x1676fc('0x8')]=_[_0x1676fc('0x24')](db[_0x1676fc('0x41')]['rawAttributes']),_0x52ade4['query']=_[_0x1676fc('0x24')](_0x424d9c[_0x1676fc('0x1f')]),_0x52ade4[_0x1676fc('0x37')]=_['intersection'](_0x52ade4[_0x1676fc('0x8')],_0x52ade4[_0x1676fc('0x1f')]),_0x741da0[_0x1676fc('0x30')]=_[_0x1676fc('0x19')](_0x52ade4[_0x1676fc('0x8')],qs[_0x1676fc('0x42')](_0x424d9c[_0x1676fc('0x1f')][_0x1676fc('0x42')])),_0x741da0[_0x1676fc('0x30')]=_0x741da0[_0x1676fc('0x30')]['length']?_0x741da0[_0x1676fc('0x30')]:_0x52ade4[_0x1676fc('0x8')],_0x424d9c[_0x1676fc('0x1f')][_0x1676fc('0x3d')]&&(_0x741da0['include']=[{'all':!![]}]),_0x741da0=_[_0x1676fc('0xe')]({},_0x741da0,_0x424d9c[_0x1676fc('0x39')]),db[_0x1676fc('0x41')][_0x1676fc('0x1e')](_0x741da0)[_0x1676fc('0x23')](handleEntityNotFound(_0x1a01a9,null))['then'](respondWithResult(_0x1a01a9,null))['catch'](handleError(_0x1a01a9,null));},exports[_0x248e59('0x32')]=function(_0x44c342,_0x41c405){const _0x1100f5=_0x248e59;return db[_0x1100f5('0x41')]['create'](_0x44c342[_0x1100f5('0x4b')],{})[_0x1100f5('0x23')](respondWithResult(_0x41c405,0xc9))[_0x1100f5('0x21')](handleError(_0x41c405,null));},exports[_0x248e59('0x4')]=function(_0x19406e,_0x326a09){const _0x458ec6=_0x248e59;return _0x19406e[_0x458ec6('0x4b')]['id']&&delete _0x19406e[_0x458ec6('0x4b')]['id'],delete _0x19406e[_0x458ec6('0x4b')]['duration'],delete _0x19406e[_0x458ec6('0x4b')][_0x458ec6('0x40')],delete _0x19406e[_0x458ec6('0x4b')]['closedAt'],delete _0x19406e[_0x458ec6('0x4b')][_0x458ec6('0x4a')],db[_0x458ec6('0x41')][_0x458ec6('0x1e')]({'where':{'id':_0x19406e[_0x458ec6('0x43')]['id']}})[_0x458ec6('0x23')](handleEntityNotFound(_0x326a09,null))[_0x458ec6('0x23')](saveUpdates(_0x19406e['body'],null))[_0x458ec6('0x23')](respondWithResult(_0x326a09,null))['catch'](handleError(_0x326a09,null));},exports['describe']=function(_0x54d6fe,_0x178e33){const _0x45c13f=_0x248e59;return db[_0x45c13f('0x41')][_0x45c13f('0x46')]()[_0x45c13f('0x23')](respondWithResult(_0x178e33,null))['catch'](handleError(_0x178e33,null));},exports[_0x248e59('0x34')]=function(_0x28fd1d,_0x33349b){const _0xda1f6a=_0x248e59,_0x3afaac=require(_0xda1f6a('0xb'));let _0x2f5a19=![];const _0x512a17={};return _0x28fd1d[_0xda1f6a('0x1f')][_0xda1f6a('0x1a')]&&_0x28fd1d[_0xda1f6a('0x1f')][_0xda1f6a('0x1a')]===_0xda1f6a('0x22')?_0x512a17[_0xda1f6a('0x22')]=_0x28fd1d[_0xda1f6a('0x43')]['id']:_0x512a17['id']=_0x28fd1d[_0xda1f6a('0x43')]['id'],db[_0xda1f6a('0x41')]['findOne']({'where':_0x512a17,'attributes':['id',_0xda1f6a('0x4a')],'raw':!![]})[_0xda1f6a('0x23')](handleEntityNotFound(_0x33349b,null))['then'](function(_0x5c5e39){const _0x50b9b0=_0xda1f6a;if(_0x5c5e39){const _0x3a5e1b=path[_0x50b9b0('0x17')](config[_0x50b9b0('0x7')],'server/files/screen_recordings',_0x5c5e39[_0x50b9b0('0x4a')]),_0x124f20=util[_0x50b9b0('0x26')](_0x50b9b0('0x33'),_0x3a5e1b);if(fs[_0x50b9b0('0x2d')](_0x124f20))return _0x2f5a19=!![],_0x3afaac[_0x50b9b0('0x35')](_0x124f20,_0x3a5e1b,config[_0x50b9b0('0x14')][_0x50b9b0('0x38')])['then'](function(){return _0x5c5e39;});return _0x5c5e39;}})['then'](function(_0x4add55){const _0x31b787=_0xda1f6a;if(_0x4add55){const _0x532383=path['join'](config['root'],_0x31b787('0x45'),_0x4add55[_0x31b787('0x4a')]);if(!fs[_0x31b787('0x2d')](_0x532383))throw new ValidationError(_0x31b787('0x1'));return _0x4add55[_0x31b787('0xc')]?_0x33349b[_0x31b787('0x34')](_0x532383,_0x4add55['filename']+path[_0x31b787('0xd')](_0x532383),function(){_0x2f5a19&&fs['unlink'](_0x532383);}):_0x33349b[_0x31b787('0x34')](_0x532383,function(){_0x2f5a19&&fs['unlink'](_0x532383);});}})[_0xda1f6a('0x21')](function(_0x1d2520){const _0x285175=_0xda1f6a;if(_0x1d2520[_0x285175('0x31')]===_0x285175('0x1'))_0x33349b['status'](0x194)[_0x285175('0x2a')](_0x285175('0x25'));else return handleError(_0x33349b,null);});},exports[_0x248e59('0x3')]=function(_0x5d4f16,_0x301fd2){const _0x24618d=_0x248e59;return db[_0x24618d('0x41')][_0x24618d('0x1e')]({'where':{'id':_0x5d4f16[_0x24618d('0x43')]['id']}})[_0x24618d('0x23')](function(_0x34e5c9){const _0x2215df=_0x24618d;if(!_0x34e5c9)throw new ReferenceError(_0x2215df('0x5'));return _0x34e5c9;})[_0x24618d('0x23')](function(_0x919aa5){const _0x14fe68=_0x24618d;let _0x8f5794=path[_0x14fe68('0x17')](config['root'],_0x14fe68('0x45'),_0x919aa5[_0x14fe68('0x4a')]);return logger[_0x14fe68('0x1b')](_0x14fe68('0x44'),_0x8f5794),!_[_0x14fe68('0x36')](_0x919aa5[_0x14fe68('0x4a')])&&fs['existsSync'](_0x8f5794)&&(logger[_0x14fe68('0x1b')](_0x14fe68('0x6')+_0x8f5794+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs['unlinkSync'](_0x8f5794)),_0x8f5794=_0x8f5794+'.cypher',!_['isNil'](_0x919aa5[_0x14fe68('0x4a')])&&fs[_0x14fe68('0x2d')](_0x8f5794)&&(logger['info'](_0x14fe68('0x6')+_0x8f5794+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs['unlinkSync'](_0x8f5794)),_0x919aa5;})[_0x24618d('0x23')](function(_0x57a2a8){const _0x13ea27=_0x24618d;if(!_0x57a2a8)throw new InternalError();return _0x57a2a8[_0x13ea27('0x3')]();})[_0x24618d('0x23')](function(){const _0x3e5257=_0x24618d;_0x301fd2[_0x3e5257('0x3a')](0xcc)['end']();})['catch'](handleError(_0x301fd2,null));};
\ No newline at end of file
+const a534_0x544e=['uniqueid','unlinkSync','format','order','stack','set','body','filename','existsSync','nolimit','count','limit','length','lodash','type','sequelize','unlink','Entity\x20not\x20found','params','attributes','then','include','.cypher','Not\x20found','describe','key','../../mysqldb','rawAttributes','value','catch','download','filters','../../config/environment','decryptFile','like','path','secrets','options','isNil','message','server/files/screen_recordings','ScreenRecording','error-middleware/errors','fieldName','json','show','findOne','intersection','sendStatus','merge','fields','model','rows','root','create','offset','Content-Range','ScreenRecording\x20not\x20found','query','index','../../config/logger','join','where','closedAt','duration','status','sort','filter','File:\x20\x22','info','VIRTUAL','util','destroy','update','keys','pick','%s.cypher','../../components/encryptor','../../components/parsers/qs','recording','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','map','differenceBy','name','includeAll'];(function(_0x3bafd6,_0x544eb1){const _0xf6b4ab=function(_0x36f7a2){while(--_0x36f7a2){_0x3bafd6['push'](_0x3bafd6['shift']());}};_0xf6b4ab(++_0x544eb1);}(a534_0x544e,0x73));const a534_0xf6b4=function(_0x3bafd6,_0x544eb1){_0x3bafd6=_0x3bafd6-0x0;let _0xf6b4ab=a534_0x544e[_0x3bafd6];return _0xf6b4ab;};const _0x30f295=a534_0xf6b4;'use strict';const util=require(_0x30f295('0x29')),path=require(_0x30f295('0x5')),fs=require('fs'),_=require(_0x30f295('0x44')),qs=require(_0x30f295('0x30')),logger=require(_0x30f295('0x1e'))('api'),config=require(_0x30f295('0x2')),db=require(_0x30f295('0x51'))['db'],{Op,ValidationError}=require(_0x30f295('0x46')),{InternalError}=require(_0x30f295('0xc'));function respondWithResult(_0x36f7a2,_0x5e1a15){return _0x5e1a15=_0x5e1a15||0xc8,function(_0x3faca2){const _0x57d644=a534_0xf6b4;if(_0x3faca2)return _0x36f7a2[_0x57d644('0x23')](_0x5e1a15)[_0x57d644('0xe')](_0x3faca2);};}function respondWithFilteredResult(_0x350ec8,_0x4e2895){return function(_0x3eb3b0){const _0x36699f=a534_0xf6b4;if(_0x3eb3b0){const _0x5631cf=_0x3eb3b0[_0x36699f('0x41')],_0x4a1609=_0x4e2895[_0x36699f('0x19')];let _0xa1d76d=_0x4e2895['offset']+_0x4e2895[_0x36699f('0x42')],_0x424699;return _0xa1d76d>=_0x5631cf?(_0xa1d76d=_0x5631cf,_0x424699=0xc8):_0x424699=0xce,_0x350ec8[_0x36699f('0x23')](_0x424699),_0x350ec8[_0x36699f('0x3c')](_0x36699f('0x1a'),_0x4a1609+'-'+_0xa1d76d+'/'+_0x5631cf)[_0x36699f('0xe')](_0x3eb3b0);}return null;};}function saveUpdates(_0xbbf0c1){return function(_0x5e24f7){if(_0x5e24f7)return _0x5e24f7['update'](_0xbbf0c1)['then'](function(_0x4aadbf){return _0x4aadbf;});return null;};}function handleEntityNotFound(_0xc97119){return function(_0x275bb2){const _0x15e902=a534_0xf6b4;return!_0x275bb2&&_0xc97119[_0x15e902('0x12')](0x194),_0x275bb2;};}function handleError(_0x2e0598,_0xc5be6d){return _0xc5be6d=_0xc5be6d||0x1f4,function(_0x26155d){const _0x38d171=a534_0xf6b4;logger['error'](_0x26155d[_0x38d171('0x3b')]),_0x26155d[_0x38d171('0x35')]&&delete _0x26155d['name'],_0x2e0598[_0x38d171('0x23')](_0xc5be6d)['send'](_0x26155d);};}exports[_0x30f295('0x1d')]=function(_0x48fd57,_0x554cc9){const _0x56b947=_0x30f295;let _0x3c3f3f={};const _0x5d39e8={},_0x46d4a0={'count':0x0,'rows':[]},_0x789217=_[_0x56b947('0x33')](db[_0x56b947('0xb')][_0x56b947('0x52')],function(_0x2b1e4c){const _0x8d63d1=_0x56b947;return{'name':_0x2b1e4c[_0x8d63d1('0xd')],'type':_0x2b1e4c[_0x8d63d1('0x45')][_0x8d63d1('0x50')]};});_0x5d39e8[_0x56b947('0x15')]=_[_0x56b947('0x34')](_[_0x56b947('0x33')](_0x789217,_0x56b947('0x35')),['format']),_0x5d39e8[_0x56b947('0x1c')]=_[_0x56b947('0x2c')](_0x48fd57['query']),_0x5d39e8['filters']=_['intersection'](_0x5d39e8['model'],_0x5d39e8[_0x56b947('0x1c')]),_0x3c3f3f[_0x56b947('0x4a')]=_['intersection'](_0x5d39e8[_0x56b947('0x15')],qs[_0x56b947('0x14')](_0x48fd57[_0x56b947('0x1c')][_0x56b947('0x14')])),_0x3c3f3f[_0x56b947('0x4a')]=_0x3c3f3f[_0x56b947('0x4a')][_0x56b947('0x43')]?_0x3c3f3f['attributes']:_0x5d39e8[_0x56b947('0x15')];typeof _0x48fd57[_0x56b947('0x1c')][_0x56b947('0x40')]==='undefined'&&(_0x3c3f3f['limit']=qs['limit'](_0x48fd57[_0x56b947('0x1c')][_0x56b947('0x42')]),_0x3c3f3f[_0x56b947('0x19')]=qs[_0x56b947('0x19')](_0x48fd57[_0x56b947('0x1c')]['offset']));_0x3c3f3f[_0x56b947('0x3a')]=qs[_0x56b947('0x24')](_0x48fd57['query']['sort']),_0x3c3f3f[_0x56b947('0x20')]=qs['filters'](_[_0x56b947('0x2d')](_0x48fd57[_0x56b947('0x1c')],_0x5d39e8[_0x56b947('0x1')]),_0x789217);_0x48fd57[_0x56b947('0x1c')][_0x56b947('0x25')]&&(_0x3c3f3f[_0x56b947('0x20')]=_[_0x56b947('0x13')](_0x3c3f3f['where'],{[Op['or']]:_[_0x56b947('0x33')](_0x789217,function(_0x42894c){const _0x4bf796=_0x56b947;if(_0x42894c['type']!==_0x4bf796('0x28')){const _0x10ab84={};return _0x10ab84[_0x42894c[_0x4bf796('0x35')]]={[Op[_0x4bf796('0x4')]]:'%'+_0x48fd57[_0x4bf796('0x1c')][_0x4bf796('0x25')]+'%'},_0x10ab84;}})}));_0x3c3f3f=_[_0x56b947('0x13')]({},_0x3c3f3f,_0x48fd57[_0x56b947('0x7')]);const _0x2b1ced={'where':_0x3c3f3f[_0x56b947('0x20')]};return db[_0x56b947('0xb')][_0x56b947('0x41')](_0x2b1ced)[_0x56b947('0x4b')](function(_0x12ab49){const _0x3b17ed=_0x56b947;return _0x46d4a0[_0x3b17ed('0x41')]=_0x12ab49,_0x48fd57['query'][_0x3b17ed('0x36')]&&(_0x3c3f3f[_0x3b17ed('0x4c')]=[{'all':!![]}]),db[_0x3b17ed('0xb')]['findAll'](_0x3c3f3f);})[_0x56b947('0x4b')](function(_0x529876){const _0x331da2=_0x56b947;return _0x46d4a0[_0x331da2('0x16')]=_0x529876,_0x46d4a0;})[_0x56b947('0x4b')](respondWithFilteredResult(_0x554cc9,_0x3c3f3f))[_0x56b947('0x54')](handleError(_0x554cc9,null));},exports[_0x30f295('0xf')]=function(_0x2d1d00,_0x3ca747){const _0x7c8f71=_0x30f295;let _0x4eed4b={'raw':![],'where':{'id':_0x2d1d00[_0x7c8f71('0x49')]['id']}};const _0x5a0b31={};return _0x5a0b31[_0x7c8f71('0x15')]=_[_0x7c8f71('0x2c')](db[_0x7c8f71('0xb')]['rawAttributes']),_0x5a0b31['query']=_[_0x7c8f71('0x2c')](_0x2d1d00[_0x7c8f71('0x1c')]),_0x5a0b31[_0x7c8f71('0x1')]=_[_0x7c8f71('0x11')](_0x5a0b31['model'],_0x5a0b31[_0x7c8f71('0x1c')]),_0x4eed4b['attributes']=_[_0x7c8f71('0x11')](_0x5a0b31[_0x7c8f71('0x15')],qs[_0x7c8f71('0x14')](_0x2d1d00[_0x7c8f71('0x1c')]['fields'])),_0x4eed4b[_0x7c8f71('0x4a')]=_0x4eed4b[_0x7c8f71('0x4a')][_0x7c8f71('0x43')]?_0x4eed4b[_0x7c8f71('0x4a')]:_0x5a0b31['model'],_0x2d1d00[_0x7c8f71('0x1c')][_0x7c8f71('0x36')]&&(_0x4eed4b['include']=[{'all':!![]}]),_0x4eed4b=_[_0x7c8f71('0x13')]({},_0x4eed4b,_0x2d1d00[_0x7c8f71('0x7')]),db[_0x7c8f71('0xb')][_0x7c8f71('0x10')](_0x4eed4b)['then'](handleEntityNotFound(_0x3ca747,null))['then'](respondWithResult(_0x3ca747,null))['catch'](handleError(_0x3ca747,null));},exports[_0x30f295('0x18')]=function(_0x569f6a,_0x29d69b){const _0x5bacda=_0x30f295;return db[_0x5bacda('0xb')][_0x5bacda('0x18')](_0x569f6a[_0x5bacda('0x3d')],{})[_0x5bacda('0x4b')](respondWithResult(_0x29d69b,0xc9))[_0x5bacda('0x54')](handleError(_0x29d69b,null));},exports[_0x30f295('0x2b')]=function(_0x1fa352,_0x370a9d){const _0x3552fc=_0x30f295;return _0x1fa352[_0x3552fc('0x3d')]['id']&&delete _0x1fa352[_0x3552fc('0x3d')]['id'],delete _0x1fa352[_0x3552fc('0x3d')][_0x3552fc('0x22')],delete _0x1fa352[_0x3552fc('0x3d')]['createdAt'],delete _0x1fa352['body'][_0x3552fc('0x21')],delete _0x1fa352[_0x3552fc('0x3d')]['value'],db[_0x3552fc('0xb')][_0x3552fc('0x10')]({'where':{'id':_0x1fa352[_0x3552fc('0x49')]['id']}})[_0x3552fc('0x4b')](handleEntityNotFound(_0x370a9d,null))['then'](saveUpdates(_0x1fa352[_0x3552fc('0x3d')],null))[_0x3552fc('0x4b')](respondWithResult(_0x370a9d,null))[_0x3552fc('0x54')](handleError(_0x370a9d,null));},exports[_0x30f295('0x4f')]=function(_0x5416db,_0x5985dd){const _0xb15005=_0x30f295;return db[_0xb15005('0xb')]['describe']()[_0xb15005('0x4b')](respondWithResult(_0x5985dd,null))[_0xb15005('0x54')](handleError(_0x5985dd,null));},exports[_0x30f295('0x0')]=function(_0x450a25,_0x401f9a){const _0x1f6127=_0x30f295,_0xd764e2=require(_0x1f6127('0x2f'));let _0x587e5c=![];const _0x319980={};return _0x450a25[_0x1f6127('0x1c')][_0x1f6127('0x45')]&&_0x450a25[_0x1f6127('0x1c')][_0x1f6127('0x45')]==='uniqueid'?_0x319980[_0x1f6127('0x37')]=_0x450a25['params']['id']:_0x319980['id']=_0x450a25[_0x1f6127('0x49')]['id'],db['ScreenRecording'][_0x1f6127('0x10')]({'where':_0x319980,'attributes':['id',_0x1f6127('0x53')],'raw':!![]})[_0x1f6127('0x4b')](handleEntityNotFound(_0x401f9a,null))[_0x1f6127('0x4b')](function(_0x400e3c){const _0x4465af=_0x1f6127;if(_0x400e3c){const _0x5051c9=path[_0x4465af('0x1f')](config[_0x4465af('0x17')],_0x4465af('0xa'),_0x400e3c['value']),_0x24ea61=util[_0x4465af('0x39')](_0x4465af('0x2e'),_0x5051c9);if(fs[_0x4465af('0x3f')](_0x24ea61))return _0x587e5c=!![],_0xd764e2[_0x4465af('0x3')](_0x24ea61,_0x5051c9,config[_0x4465af('0x6')][_0x4465af('0x31')])[_0x4465af('0x4b')](function(){return _0x400e3c;});return _0x400e3c;}})[_0x1f6127('0x4b')](function(_0x417683){const _0x5a7749=_0x1f6127;if(_0x417683){const _0x184430=path[_0x5a7749('0x1f')](config['root'],'server/files/screen_recordings',_0x417683[_0x5a7749('0x53')]);if(!fs[_0x5a7749('0x3f')](_0x184430))throw new ValidationError(_0x5a7749('0x1b'));return _0x417683[_0x5a7749('0x3e')]?_0x401f9a[_0x5a7749('0x0')](_0x184430,_0x417683[_0x5a7749('0x3e')]+path['extname'](_0x184430),function(){const _0x4e6cdc=_0x5a7749;_0x587e5c&&fs[_0x4e6cdc('0x47')](_0x184430);}):_0x401f9a['download'](_0x184430,function(){const _0x2527de=_0x5a7749;_0x587e5c&&fs[_0x2527de('0x47')](_0x184430);});}})['catch'](function(_0x2fa131){const _0xadaf2e=_0x1f6127;if(_0x2fa131[_0xadaf2e('0x9')]===_0xadaf2e('0x1b'))_0x401f9a[_0xadaf2e('0x23')](0x194)['send'](_0xadaf2e('0x4e'));else return handleError(_0x401f9a,null);});},exports['destroy']=function(_0x441509,_0x53f8ea){const _0x222b6a=_0x30f295;return db['ScreenRecording'][_0x222b6a('0x10')]({'where':{'id':_0x441509[_0x222b6a('0x49')]['id']}})['then'](function(_0x552a3b){const _0x1a52ac=_0x222b6a;if(!_0x552a3b)throw new ReferenceError(_0x1a52ac('0x48'));return _0x552a3b;})[_0x222b6a('0x4b')](function(_0x6c2a37){const _0x5ba201=_0x222b6a;let _0xbb2821=path[_0x5ba201('0x1f')](config[_0x5ba201('0x17')],_0x5ba201('0xa'),_0x6c2a37[_0x5ba201('0x53')]);return logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xbb2821),!_[_0x5ba201('0x8')](_0x6c2a37['value'])&&fs['existsSync'](_0xbb2821)&&(logger[_0x5ba201('0x27')](_0x5ba201('0x26')+_0xbb2821+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs['unlinkSync'](_0xbb2821)),_0xbb2821=_0xbb2821+_0x5ba201('0x4d'),!_[_0x5ba201('0x8')](_0x6c2a37[_0x5ba201('0x53')])&&fs['existsSync'](_0xbb2821)&&(logger[_0x5ba201('0x27')]('File:\x20\x22'+_0xbb2821+_0x5ba201('0x32')),fs[_0x5ba201('0x38')](_0xbb2821)),_0x6c2a37;})[_0x222b6a('0x4b')](function(_0x4b6522){const _0x27687e=_0x222b6a;if(!_0x4b6522)throw new InternalError();return _0x4b6522[_0x27687e('0x2a')]();})[_0x222b6a('0x4b')](function(){const _0x3a9aee=_0x222b6a;_0x53f8ea[_0x3a9aee('0x23')](0xcc)['end']();})['catch'](handleError(_0x53f8ea,null));};
\ No newline at end of file