Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 78d0ada..3ceaa94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','root','%s.cypher','decryptFile','secrets','recording','join','server/files/screen_recordings','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','download','unlink','message','send','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x725fa4,_0x448022){var _0x3f4258=function(_0x28ac81){while(--_0x28ac81){_0x725fa4['push'](_0x725fa4['shift']());}};_0x3f4258(++_0x448022);}(_0x038b,0x114));var _0xb038=function(_0x1339e3,_0x4d5a8d){_0x1339e3=_0x1339e3-0x0;var _0x41a541=_0x038b[_0x1339e3];return _0x41a541;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x2d')](_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24')),[_0xb038('0x2e')]);_0xc387d['query']=_[_0xb038('0x2f')](_0x2855a6['query']);_0xc387d[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x32')]);_0x12b3b6[_0xb038('0x33')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x32')][_0xb038('0x34')]));_0x12b3b6['attributes']=_0x12b3b6[_0xb038('0x33')][_0xb038('0x35')]?_0x12b3b6[_0xb038('0x33')]:_0xc387d['model'];if(!_0x2855a6['query']['hasOwnProperty'](_0xb038('0x36'))){_0x12b3b6[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x32')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs['offset'](_0x2855a6[_0xb038('0x32')][_0xb038('0x18')]);}_0x12b3b6[_0xb038('0x37')]=qs[_0xb038('0x38')](_0x2855a6['query'][_0xb038('0x38')]);_0x12b3b6[_0xb038('0x39')]=qs['filters'](_['pick'](_0x2855a6[_0xb038('0x32')],_0xc387d[_0xb038('0x30')]),_0x1783d4);if(_0x2855a6[_0xb038('0x32')][_0xb038('0x3a')]){_0x12b3b6[_0xb038('0x39')]=_['merge'](_0x12b3b6[_0xb038('0x39')],{'$or':_[_0xb038('0x26')](_0x1783d4,function(_0x26d48c){if(_0x26d48c[_0xb038('0x2a')]!=='VIRTUAL'){var _0x793da9={};_0x793da9[_0x26d48c[_0xb038('0x24')]]={'$like':'%'+_0x2855a6[_0xb038('0x32')]['filter']+'%'};return _0x793da9;}})});}_0x12b3b6=_[_0xb038('0x3b')]({},_0x12b3b6,_0x2855a6['options']);var _0x36f281={'where':_0x12b3b6[_0xb038('0x39')]};return db[_0xb038('0x27')]['count'](_0x36f281)[_0xb038('0x22')](function(_0x357c78){_0x551b55[_0xb038('0x1a')]=_0x357c78;if(_0x2855a6['query'][_0xb038('0x3c')]){_0x12b3b6[_0xb038('0x3d')]=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3e')](_0x12b3b6);})['then'](function(_0x28b922){_0x551b55[_0xb038('0x3f')]=_0x28b922;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x40')](handleError(_0x28a6a9,null));};exports['show']=function(_0x19dc7b,_0x269c7d){var _0x57816c={'raw':![],'where':{'id':_0x19dc7b[_0xb038('0x41')]['id']}},_0x207fb5={};_0x207fb5[_0xb038('0x2c')]=_['keys'](db[_0xb038('0x27')][_0xb038('0x28')]);_0x207fb5['query']=_['keys'](_0x19dc7b[_0xb038('0x32')]);_0x207fb5[_0xb038('0x30')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],_0x207fb5[_0xb038('0x32')]);_0x57816c[_0xb038('0x33')]=_[_0xb038('0x31')](_0x207fb5[_0xb038('0x2c')],qs['fields'](_0x19dc7b['query']['fields']));_0x57816c[_0xb038('0x33')]=_0x57816c[_0xb038('0x33')]['length']?_0x57816c[_0xb038('0x33')]:_0x207fb5[_0xb038('0x2c')];if(_0x19dc7b[_0xb038('0x32')]['includeAll']){_0x57816c[_0xb038('0x3d')]=[{'all':!![]}];}_0x57816c=_['merge']({},_0x57816c,_0x19dc7b['options']);return db[_0xb038('0x27')][_0xb038('0x42')](_0x57816c)[_0xb038('0x22')](handleEntityNotFound(_0x269c7d,null))[_0xb038('0x22')](respondWithResult(_0x269c7d,null))[_0xb038('0x40')](handleError(_0x269c7d,null));};exports[_0xb038('0x43')]=function(_0x2f053a,_0x473aae){return db[_0xb038('0x27')][_0xb038('0x43')](_0x2f053a['body'],{})[_0xb038('0x22')](respondWithResult(_0x473aae,0xc9))[_0xb038('0x40')](handleError(_0x473aae,null));};exports['update']=function(_0x906c9c,_0x19ab72){if(_0x906c9c['body']['id']){delete _0x906c9c[_0xb038('0x44')]['id'];}delete _0x906c9c[_0xb038('0x44')][_0xb038('0x45')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x46')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x47')];delete _0x906c9c[_0xb038('0x44')][_0xb038('0x48')];return db['ScreenRecording'][_0xb038('0x42')]({'where':{'id':_0x906c9c[_0xb038('0x41')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x19ab72,null))[_0xb038('0x22')](saveUpdates(_0x906c9c[_0xb038('0x44')],null))[_0xb038('0x22')](respondWithResult(_0x19ab72,null))['catch'](handleError(_0x19ab72,null));};exports[_0xb038('0x49')]=function(_0x2f3622,_0x2b2b4d){return db[_0xb038('0x27')][_0xb038('0x49')]()[_0xb038('0x22')](respondWithResult(_0x2b2b4d,null))[_0xb038('0x40')](handleError(_0x2b2b4d,null));};exports['download']=function(_0x3abe7a,_0x5c4a79,_0x77f211){var _0x1ea8ad=require(_0xb038('0x4a'));var _0x998fe3=![];var _0x1518c4={};if(_0x3abe7a['query']['type']&&_0x3abe7a['query'][_0xb038('0x2a')]===_0xb038('0x4b')){_0x1518c4[_0xb038('0x4b')]=_0x3abe7a[_0xb038('0x41')]['id'];}else{_0x1518c4['id']=_0x3abe7a[_0xb038('0x41')]['id'];}return db[_0xb038('0x27')]['find']({'where':_0x1518c4,'attributes':['id',_0xb038('0x48')],'raw':!![]})[_0xb038('0x22')](handleEntityNotFound(_0x5c4a79,null))['then'](function(_0x5b27d3){if(_0x5b27d3){var _0xf2907b=path['join'](config[_0xb038('0x4c')],'server/files/screen_recordings',_0x5b27d3[_0xb038('0x48')]);var _0x4677b8=util[_0xb038('0x2e')](_0xb038('0x4d'),_0xf2907b);if(fs['existsSync'](_0x4677b8)){_0x998fe3=!![];return _0x1ea8ad[_0xb038('0x4e')](_0x4677b8,_0xf2907b,config[_0xb038('0x4f')][_0xb038('0x50')])[_0xb038('0x22')](function(){return _0x5b27d3;});}return _0x5b27d3;}})[_0xb038('0x22')](function(_0x1246c8){if(_0x1246c8){var _0x14a553=path[_0xb038('0x51')](config[_0xb038('0x4c')],_0xb038('0x52'),_0x1246c8[_0xb038('0x48')]);if(!fs[_0xb038('0x53')](_0x14a553)){throw new db['Sequelize'][(_0xb038('0x54'))](_0xb038('0x55'));}if(_0x1246c8[_0xb038('0x56')]){return _0x5c4a79[_0xb038('0x57')](_0x14a553,_0x1246c8[_0xb038('0x56')]+path['extname'](_0x14a553),function(){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}else{return _0x5c4a79['download'](_0x14a553,function(_0xfb3ce6){if(_0x998fe3){fs[_0xb038('0x58')](_0x14a553);}});}}})['catch'](function(_0x15d61c){if(_0x15d61c[_0xb038('0x59')]===_0xb038('0x55')){_0x5c4a79[_0xb038('0x16')](0x194)[_0xb038('0x5a')](_0xb038('0x5b'));}else{return handleError(_0x5c4a79,null);}});};exports[_0xb038('0x5c')]=function(_0xe275b8,_0x769f1e){return db[_0xb038('0x27')]['find']({'where':{'id':_0xe275b8[_0xb038('0x41')]['id']}})['then'](function(_0x189894){if(_[_0xb038('0x5d')](_0x189894)){throw new ReferenceError(_0xb038('0x5e'));}return _0x189894;})[_0xb038('0x22')](function(_0x1f5f3f){var _0x23fb92=path[_0xb038('0x51')](config['root'],'server/files/screen_recordings',_0x1f5f3f[_0xb038('0x48')]);logger[_0xb038('0x5f')](_0xb038('0x60'),_0x23fb92);if(!_['isNil'](_0x1f5f3f['value'])&&fs[_0xb038('0x53')](_0x23fb92)){logger['info'](_0xb038('0x61')+_0x23fb92+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb038('0x62')](_0x23fb92);}_0x23fb92=_0x23fb92+'.cypher';if(!_[_0xb038('0x5d')](_0x1f5f3f[_0xb038('0x48')])&&fs[_0xb038('0x53')](_0x23fb92)){logger[_0xb038('0x5f')](_0xb038('0x61')+_0x23fb92+_0xb038('0x63'));fs['unlinkSync'](_0x23fb92);}return _0x1f5f3f;})['then'](function(_0x45e628){if(!_0x45e628)throw new InternalError();return _0x45e628['destroy']();})[_0xb038('0x22')](function(){_0x769f1e[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();})['catch'](handleError(_0x769f1e,null));};
\ No newline at end of file
+var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','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','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x275d85,_0x5a883e){var _0x3cd754=function(_0x209dee){while(--_0x209dee){_0x275d85['push'](_0x275d85['shift']());}};_0x3cd754(++_0x5a883e);}(_0xb138,0x1dd));var _0x8b13=function(_0x436adc,_0x5c9ae1){_0x436adc=_0x436adc-0x0;var _0x421a87=_0xb138[_0x436adc];return _0x421a87;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));};
\ No newline at end of file