Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 343a069..d66e736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc04a=['info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','ScreenRecording','fieldName','type','key','model','differenceBy','map','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','duration','closedAt','describe','download','../../components/encryptor','uniqueid','value','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found'];(function(_0x7828e3,_0x2083cd){var _0x191efd=function(_0x3d5eec){while(--_0x3d5eec){_0x7828e3['push'](_0x7828e3['shift']());}};_0x191efd(++_0x2083cd);}(_0xc04a,0xd7));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xac04('0x0'));var emlformat=require(_0xac04('0x1'));var rimraf=require(_0xac04('0x2'));var zipdir=require(_0xac04('0x3'));var jsonpatch=require(_0xac04('0x4'));var rp=require(_0xac04('0x5'));var moment=require('moment');var BPromise=require(_0xac04('0x6'));var Mustache=require(_0xac04('0x7'));var util=require(_0xac04('0x8'));var path=require('path');var sox=require(_0xac04('0x9'));var csv=require('to-csv');var ejs=require(_0xac04('0xa'));var fs=require('fs');var _=require(_0xac04('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac04('0xc'));var deskjs=require(_0xac04('0xd'));var toCsv=require(_0xac04('0xe'));var querystring=require(_0xac04('0xf'));var Papa=require(_0xac04('0x10'));var Redis=require(_0xac04('0x11'));var authService=require(_0xac04('0x12'));var qs=require(_0xac04('0x13'));var as=require(_0xac04('0x14'));var hardwareService=require(_0xac04('0x15'));var logger=require(_0xac04('0x16'))(_0xac04('0x17'));var utils=require(_0xac04('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xac04('0x19'))['db'];function respondWithStatusCode(_0x303a81,_0x2c8768){_0x2c8768=_0x2c8768||0xcc;return function(_0x4806bc){if(_0x4806bc){return _0x303a81[_0xac04('0x1a')](_0x2c8768);}return _0x303a81['status'](_0x2c8768)['end']();};}function respondWithResult(_0x6924d,_0x24d37a){_0x24d37a=_0x24d37a||0xc8;return function(_0x5622d7){if(_0x5622d7){return _0x6924d[_0xac04('0x1b')](_0x24d37a)['json'](_0x5622d7);}};}function respondWithFilteredResult(_0x4f3f7b,_0x28e853){return function(_0x46d218){if(_0x46d218){var _0xdaa286=_0x46d218[_0xac04('0x1c')],_0x23a716=_0x28e853[_0xac04('0x1d')],_0x8077c0=_0x28e853[_0xac04('0x1d')]+_0x28e853[_0xac04('0x1e')],_0x465a5f;if(_0x8077c0>=_0xdaa286){_0x8077c0=_0xdaa286;_0x465a5f=0xc8;}else{_0x465a5f=0xce;}_0x4f3f7b['status'](_0x465a5f);return _0x4f3f7b['set'](_0xac04('0x1f'),_0x23a716+'-'+_0x8077c0+'/'+_0xdaa286)['json'](_0x46d218);}return null;};}function patchUpdates(_0x4298a0){return function(_0x1fba4f){try{jsonpatch[_0xac04('0x20')](_0x1fba4f,_0x4298a0,!![]);}catch(_0x4f5fc2){return BPromise['reject'](_0x4f5fc2);}return _0x1fba4f[_0xac04('0x21')]();};}function saveUpdates(_0x3005e1,_0x3c82b3){return function(_0x37e60e){if(_0x37e60e){return _0x37e60e[_0xac04('0x22')](_0x3005e1)[_0xac04('0x23')](function(_0x185a54){return _0x185a54;});}return null;};}function removeEntity(_0x627374,_0x3a5912){return function(_0x4af9cb){if(_0x4af9cb){return _0x4af9cb[_0xac04('0x24')]()[_0xac04('0x23')](function(){_0x627374[_0xac04('0x1b')](0xcc)[_0xac04('0x25')]();});}};}function handleEntityNotFound(_0x229119,_0x547a9){return function(_0x5aeac4){if(!_0x5aeac4){_0x229119[_0xac04('0x1a')](0x194);}return _0x5aeac4;};}function handleError(_0x548fbc,_0x4ef275){_0x4ef275=_0x4ef275||0x1f4;return function(_0x591535){logger[_0xac04('0x26')](_0x591535[_0xac04('0x27')]);if(_0x591535[_0xac04('0x28')]){delete _0x591535['name'];}_0x548fbc[_0xac04('0x1b')](_0x4ef275)[_0xac04('0x29')](_0x591535);};}exports[_0xac04('0x2a')]=function(_0x579f5c,_0x5cbc14){var _0x52ab66={},_0x14cb97={},_0x5eeb01={'count':0x0,'rows':[]};var _0x40728a=_['map'](db[_0xac04('0x2b')]['rawAttributes'],function(_0x5ad60d){return{'name':_0x5ad60d[_0xac04('0x2c')],'type':_0x5ad60d[_0xac04('0x2d')][_0xac04('0x2e')]};});_0x14cb97[_0xac04('0x2f')]=_[_0xac04('0x30')](_[_0xac04('0x31')](_0x40728a,_0xac04('0x28')),[_0xac04('0x32')]);_0x14cb97[_0xac04('0x33')]=_['keys'](_0x579f5c[_0xac04('0x33')]);_0x14cb97[_0xac04('0x34')]=_[_0xac04('0x35')](_0x14cb97[_0xac04('0x2f')],_0x14cb97['query']);_0x52ab66[_0xac04('0x36')]=_['intersection'](_0x14cb97[_0xac04('0x2f')],qs[_0xac04('0x37')](_0x579f5c[_0xac04('0x33')][_0xac04('0x37')]));_0x52ab66['attributes']=_0x52ab66[_0xac04('0x36')][_0xac04('0x38')]?_0x52ab66[_0xac04('0x36')]:_0x14cb97['model'];if(!_0x579f5c[_0xac04('0x33')][_0xac04('0x39')]('nolimit')){_0x52ab66[_0xac04('0x1e')]=qs[_0xac04('0x1e')](_0x579f5c[_0xac04('0x33')][_0xac04('0x1e')]);_0x52ab66[_0xac04('0x1d')]=qs[_0xac04('0x1d')](_0x579f5c[_0xac04('0x33')][_0xac04('0x1d')]);}_0x52ab66[_0xac04('0x3a')]=qs['sort'](_0x579f5c[_0xac04('0x33')][_0xac04('0x3b')]);_0x52ab66[_0xac04('0x3c')]=qs['filters'](_[_0xac04('0x3d')](_0x579f5c[_0xac04('0x33')],_0x14cb97['filters']),_0x40728a);if(_0x579f5c['query'][_0xac04('0x3e')]){_0x52ab66[_0xac04('0x3c')]=_[_0xac04('0x3f')](_0x52ab66[_0xac04('0x3c')],{'$or':_[_0xac04('0x31')](_0x40728a,function(_0x27ca30){if(_0x27ca30[_0xac04('0x2d')]!==_0xac04('0x40')){var _0x13e085={};_0x13e085[_0x27ca30[_0xac04('0x28')]]={'$like':'%'+_0x579f5c['query'][_0xac04('0x3e')]+'%'};return _0x13e085;}})});}_0x52ab66=_[_0xac04('0x3f')]({},_0x52ab66,_0x579f5c[_0xac04('0x41')]);var _0x1c4f53={'where':_0x52ab66[_0xac04('0x3c')]};return db[_0xac04('0x2b')][_0xac04('0x1c')](_0x1c4f53)[_0xac04('0x23')](function(_0x4b06f3){_0x5eeb01['count']=_0x4b06f3;if(_0x579f5c[_0xac04('0x33')][_0xac04('0x42')]){_0x52ab66['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x52ab66);})['then'](function(_0x4df8cd){_0x5eeb01[_0xac04('0x43')]=_0x4df8cd;return _0x5eeb01;})['then'](respondWithFilteredResult(_0x5cbc14,_0x52ab66))[_0xac04('0x44')](handleError(_0x5cbc14,null));};exports['show']=function(_0x3088fd,_0x36bd09){var _0x4e17f4={'raw':![],'where':{'id':_0x3088fd[_0xac04('0x45')]['id']}},_0x3ed9d6={};_0x3ed9d6['model']=_[_0xac04('0x46')](db[_0xac04('0x2b')]['rawAttributes']);_0x3ed9d6[_0xac04('0x33')]=_[_0xac04('0x46')](_0x3088fd[_0xac04('0x33')]);_0x3ed9d6['filters']=_[_0xac04('0x35')](_0x3ed9d6[_0xac04('0x2f')],_0x3ed9d6[_0xac04('0x33')]);_0x4e17f4[_0xac04('0x36')]=_['intersection'](_0x3ed9d6[_0xac04('0x2f')],qs[_0xac04('0x37')](_0x3088fd[_0xac04('0x33')][_0xac04('0x37')]));_0x4e17f4['attributes']=_0x4e17f4['attributes'][_0xac04('0x38')]?_0x4e17f4[_0xac04('0x36')]:_0x3ed9d6[_0xac04('0x2f')];if(_0x3088fd[_0xac04('0x33')][_0xac04('0x42')]){_0x4e17f4[_0xac04('0x47')]=[{'all':!![]}];}_0x4e17f4=_[_0xac04('0x3f')]({},_0x4e17f4,_0x3088fd[_0xac04('0x41')]);return db[_0xac04('0x2b')][_0xac04('0x48')](_0x4e17f4)['then'](handleEntityNotFound(_0x36bd09,null))['then'](respondWithResult(_0x36bd09,null))[_0xac04('0x44')](handleError(_0x36bd09,null));};exports[_0xac04('0x49')]=function(_0x138635,_0x4ae0f9){return db[_0xac04('0x2b')][_0xac04('0x49')](_0x138635[_0xac04('0x4a')],{})[_0xac04('0x23')](respondWithResult(_0x4ae0f9,0xc9))[_0xac04('0x44')](handleError(_0x4ae0f9,null));};exports[_0xac04('0x22')]=function(_0x18b235,_0x12d966){if(_0x18b235[_0xac04('0x4a')]['id']){delete _0x18b235[_0xac04('0x4a')]['id'];}delete _0x18b235[_0xac04('0x4a')][_0xac04('0x4b')];delete _0x18b235[_0xac04('0x4a')]['createdAt'];delete _0x18b235['body'][_0xac04('0x4c')];delete _0x18b235['body']['value'];return db[_0xac04('0x2b')][_0xac04('0x48')]({'where':{'id':_0x18b235[_0xac04('0x45')]['id']}})[_0xac04('0x23')](handleEntityNotFound(_0x12d966,null))[_0xac04('0x23')](saveUpdates(_0x18b235['body'],null))['then'](respondWithResult(_0x12d966,null))['catch'](handleError(_0x12d966,null));};exports[_0xac04('0x4d')]=function(_0x35c13b,_0x5d16fb){return db[_0xac04('0x2b')][_0xac04('0x4d')]()['then'](respondWithResult(_0x5d16fb,null))[_0xac04('0x44')](handleError(_0x5d16fb,null));};exports[_0xac04('0x4e')]=function(_0x7be663,_0xb29579,_0x31d87b){var _0x519bc8=require(_0xac04('0x4f'));var _0xcd6449=![];var _0x1846df={};if(_0x7be663['query'][_0xac04('0x2d')]&&_0x7be663['query'][_0xac04('0x2d')]==='uniqueid'){_0x1846df[_0xac04('0x50')]=_0x7be663[_0xac04('0x45')]['id'];}else{_0x1846df['id']=_0x7be663[_0xac04('0x45')]['id'];}return db[_0xac04('0x2b')]['find']({'where':_0x1846df,'attributes':['id',_0xac04('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0xb29579,null))['then'](function(_0x27a2ce){if(_0x27a2ce){var _0x464b8d=path['join'](config[_0xac04('0x52')],_0xac04('0x53'),_0x27a2ce['value']);var _0x23b549=util['format'](_0xac04('0x54'),_0x464b8d);if(fs['existsSync'](_0x23b549)){_0xcd6449=!![];return _0x519bc8[_0xac04('0x55')](_0x23b549,_0x464b8d,config[_0xac04('0x56')][_0xac04('0x57')])[_0xac04('0x23')](function(){return _0x27a2ce;});}return _0x27a2ce;}})[_0xac04('0x23')](function(_0x691ee8){if(_0x691ee8){var _0x2a7fd1=path['join'](config['root'],_0xac04('0x53'),_0x691ee8['value']);if(!fs[_0xac04('0x58')](_0x2a7fd1)){throw new db[(_0xac04('0x59'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x691ee8[_0xac04('0x5a')]){return _0xb29579[_0xac04('0x4e')](_0x2a7fd1,_0x691ee8['filename']+path[_0xac04('0x5b')](_0x2a7fd1),function(){if(_0xcd6449){fs['unlink'](_0x2a7fd1);}});}else{return _0xb29579[_0xac04('0x4e')](_0x2a7fd1,function(_0x2f36d2){if(_0xcd6449){fs[_0xac04('0x5c')](_0x2a7fd1);}});}}})[_0xac04('0x44')](function(_0x479272){if(_0x479272[_0xac04('0x5d')]===_0xac04('0x5e')){_0xb29579[_0xac04('0x1b')](0x194)[_0xac04('0x29')](_0xac04('0x5f'));}else{return handleError(_0xb29579,null);}});};exports[_0xac04('0x24')]=function(_0x46626e,_0x2936ee){return db['ScreenRecording'][_0xac04('0x48')]({'where':{'id':_0x46626e['params']['id']}})[_0xac04('0x23')](function(_0x452d2f){if(!_0x452d2f)throw new ReferenceError(_0xac04('0x60'));return _0x452d2f;})[_0xac04('0x23')](function(_0x1ebdcf){var _0x218728=path['join'](config[_0xac04('0x52')],_0xac04('0x53'),_0x1ebdcf[_0xac04('0x51')]);logger[_0xac04('0x61')](_0xac04('0x62'),_0x218728);if(!_[_0xac04('0x63')](_0x1ebdcf[_0xac04('0x51')])&&fs['existsSync'](_0x218728)){logger[_0xac04('0x61')](_0xac04('0x64')+_0x218728+_0xac04('0x65'));fs[_0xac04('0x66')](_0x218728);}_0x218728=_0x218728+_0xac04('0x67');if(!_[_0xac04('0x63')](_0x1ebdcf[_0xac04('0x51')])&&fs[_0xac04('0x58')](_0x218728)){logger[_0xac04('0x61')](_0xac04('0x64')+_0x218728+_0xac04('0x65'));fs[_0xac04('0x66')](_0x218728);}return _0x1ebdcf;})['then'](function(_0x58e3fc){if(!_0x58e3fc)throw new InternalError();return _0x58e3fc[_0xac04('0x24')]();})[_0xac04('0x23')](function(){_0x2936ee[_0xac04('0x1b')](0xcc)[_0xac04('0x25')]();})['catch'](handleError(_0x2936ee,null));};
\ No newline at end of file
+var _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x58c14a,_0x52aa63){var _0x27d70a=function(_0x232622){while(--_0x232622){_0x58c14a['push'](_0x58c14a['shift']());}};_0x27d70a(++_0x52aa63);}(_0x00bb,0x1d8));var _0xb00b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x00bb[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));};
\ No newline at end of file