Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 33f7b40..343a069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd11b=['value','describe','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','root','Sequelize','filename','download','unlink','ScreenRecording\x20not\x20found','Not\x20found','destroy','Entity\x20not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','duration','createdAt','closedAt'];(function(_0x195060,_0x529335){var _0x384d57=function(_0x458a87){while(--_0x458a87){_0x195060['push'](_0x195060['shift']());}};_0x384d57(++_0x529335);}(_0xd11b,0x148));var _0xbd11=function(_0x45f6e5,_0x17a515){_0x45f6e5=_0x45f6e5-0x0;var _0x48f124=_0xd11b[_0x45f6e5];return _0x48f124;};'use strict';var pdf=require(_0xbd11('0x0'));var emlformat=require(_0xbd11('0x1'));var rimraf=require(_0xbd11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd11('0x3'));var rp=require('request-promise');var moment=require(_0xbd11('0x4'));var BPromise=require(_0xbd11('0x5'));var Mustache=require(_0xbd11('0x6'));var util=require(_0xbd11('0x7'));var path=require(_0xbd11('0x8'));var sox=require(_0xbd11('0x9'));var csv=require(_0xbd11('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd11('0xb'));var squel=require(_0xbd11('0xc'));var crypto=require('crypto');var jsforce=require(_0xbd11('0xd'));var deskjs=require(_0xbd11('0xe'));var toCsv=require(_0xbd11('0xa'));var querystring=require('querystring');var Papa=require(_0xbd11('0xf'));var Redis=require(_0xbd11('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbd11('0x11'));var as=require(_0xbd11('0x12'));var hardwareService=require(_0xbd11('0x13'));var logger=require('../../config/logger')(_0xbd11('0x14'));var utils=require(_0xbd11('0x15'));var config=require(_0xbd11('0x16'));var licenseUtil=require(_0xbd11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36b952,_0x5c0a90){_0x5c0a90=_0x5c0a90||0xcc;return function(_0x27213d){if(_0x27213d){return _0x36b952[_0xbd11('0x18')](_0x5c0a90);}return _0x36b952['status'](_0x5c0a90)[_0xbd11('0x19')]();};}function respondWithResult(_0x272933,_0x433735){_0x433735=_0x433735||0xc8;return function(_0x2aa131){if(_0x2aa131){return _0x272933[_0xbd11('0x1a')](_0x433735)[_0xbd11('0x1b')](_0x2aa131);}};}function respondWithFilteredResult(_0xca0b3f,_0x4b9959){return function(_0x5cb60c){if(_0x5cb60c){var _0xac90c5=_0x5cb60c[_0xbd11('0x1c')],_0x15e0d3=_0x4b9959['offset'],_0x3b22cc=_0x4b9959[_0xbd11('0x1d')]+_0x4b9959[_0xbd11('0x1e')],_0x5b72c5;if(_0x3b22cc>=_0xac90c5){_0x3b22cc=_0xac90c5;_0x5b72c5=0xc8;}else{_0x5b72c5=0xce;}_0xca0b3f[_0xbd11('0x1a')](_0x5b72c5);return _0xca0b3f[_0xbd11('0x1f')](_0xbd11('0x20'),_0x15e0d3+'-'+_0x3b22cc+'/'+_0xac90c5)[_0xbd11('0x1b')](_0x5cb60c);}return null;};}function patchUpdates(_0x385ec8){return function(_0x35d5f4){try{jsonpatch[_0xbd11('0x21')](_0x35d5f4,_0x385ec8,!![]);}catch(_0x2f9378){return BPromise[_0xbd11('0x22')](_0x2f9378);}return _0x35d5f4[_0xbd11('0x23')]();};}function saveUpdates(_0x102d75,_0x6b1ace){return function(_0x7da2d4){if(_0x7da2d4){return _0x7da2d4[_0xbd11('0x24')](_0x102d75)['then'](function(_0x7e4696){return _0x7e4696;});}return null;};}function removeEntity(_0x4f8e2e,_0x30ccdd){return function(_0x2f395a){if(_0x2f395a){return _0x2f395a['destroy']()[_0xbd11('0x25')](function(){_0x4f8e2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25525a,_0x20fce4){return function(_0x4c9c13){if(!_0x4c9c13){_0x25525a[_0xbd11('0x18')](0x194);}return _0x4c9c13;};}function handleError(_0x25fc47,_0xfa9747){_0xfa9747=_0xfa9747||0x1f4;return function(_0x57b353){logger['error'](_0x57b353[_0xbd11('0x26')]);if(_0x57b353[_0xbd11('0x27')]){delete _0x57b353[_0xbd11('0x27')];}_0x25fc47[_0xbd11('0x1a')](_0xfa9747)[_0xbd11('0x28')](_0x57b353);};}exports['index']=function(_0x717158,_0x261bdc){var _0xbeb498={},_0x3eb054={},_0x304905={'count':0x0,'rows':[]};var _0x45cbff=_[_0xbd11('0x29')](db[_0xbd11('0x2a')][_0xbd11('0x2b')],function(_0x282700){return{'name':_0x282700[_0xbd11('0x2c')],'type':_0x282700[_0xbd11('0x2d')][_0xbd11('0x2e')]};});_0x3eb054[_0xbd11('0x2f')]=_['differenceBy'](_[_0xbd11('0x29')](_0x45cbff,'name'),[_0xbd11('0x30')]);_0x3eb054[_0xbd11('0x31')]=_[_0xbd11('0x32')](_0x717158[_0xbd11('0x31')]);_0x3eb054[_0xbd11('0x33')]=_['intersection'](_0x3eb054[_0xbd11('0x2f')],_0x3eb054[_0xbd11('0x31')]);_0xbeb498[_0xbd11('0x34')]=_[_0xbd11('0x35')](_0x3eb054['model'],qs[_0xbd11('0x36')](_0x717158[_0xbd11('0x31')][_0xbd11('0x36')]));_0xbeb498['attributes']=_0xbeb498['attributes']['length']?_0xbeb498[_0xbd11('0x34')]:_0x3eb054['model'];if(!_0x717158[_0xbd11('0x31')][_0xbd11('0x37')](_0xbd11('0x38'))){_0xbeb498[_0xbd11('0x1e')]=qs[_0xbd11('0x1e')](_0x717158['query'][_0xbd11('0x1e')]);_0xbeb498[_0xbd11('0x1d')]=qs[_0xbd11('0x1d')](_0x717158[_0xbd11('0x31')][_0xbd11('0x1d')]);}_0xbeb498['order']=qs[_0xbd11('0x39')](_0x717158[_0xbd11('0x31')][_0xbd11('0x39')]);_0xbeb498[_0xbd11('0x3a')]=qs[_0xbd11('0x33')](_[_0xbd11('0x3b')](_0x717158[_0xbd11('0x31')],_0x3eb054[_0xbd11('0x33')]),_0x45cbff);if(_0x717158[_0xbd11('0x31')][_0xbd11('0x3c')]){_0xbeb498[_0xbd11('0x3a')]=_[_0xbd11('0x3d')](_0xbeb498[_0xbd11('0x3a')],{'$or':_[_0xbd11('0x29')](_0x45cbff,function(_0x3b25a6){if(_0x3b25a6['type']!=='VIRTUAL'){var _0x5367a3={};_0x5367a3[_0x3b25a6[_0xbd11('0x27')]]={'$like':'%'+_0x717158[_0xbd11('0x31')]['filter']+'%'};return _0x5367a3;}})});}_0xbeb498=_[_0xbd11('0x3d')]({},_0xbeb498,_0x717158[_0xbd11('0x3e')]);var _0x630171={'where':_0xbeb498['where']};return db[_0xbd11('0x2a')]['count'](_0x630171)['then'](function(_0x744a4e){_0x304905[_0xbd11('0x1c')]=_0x744a4e;if(_0x717158[_0xbd11('0x31')][_0xbd11('0x3f')]){_0xbeb498[_0xbd11('0x40')]=[{'all':!![]}];}return db[_0xbd11('0x2a')][_0xbd11('0x41')](_0xbeb498);})[_0xbd11('0x25')](function(_0x194183){_0x304905[_0xbd11('0x42')]=_0x194183;return _0x304905;})[_0xbd11('0x25')](respondWithFilteredResult(_0x261bdc,_0xbeb498))['catch'](handleError(_0x261bdc,null));};exports[_0xbd11('0x43')]=function(_0x5917ea,_0x3a8cd8){var _0x2abaa7={'raw':![],'where':{'id':_0x5917ea[_0xbd11('0x44')]['id']}},_0x16889f={};_0x16889f[_0xbd11('0x2f')]=_[_0xbd11('0x32')](db[_0xbd11('0x2a')][_0xbd11('0x2b')]);_0x16889f[_0xbd11('0x31')]=_[_0xbd11('0x32')](_0x5917ea['query']);_0x16889f[_0xbd11('0x33')]=_[_0xbd11('0x35')](_0x16889f[_0xbd11('0x2f')],_0x16889f[_0xbd11('0x31')]);_0x2abaa7[_0xbd11('0x34')]=_[_0xbd11('0x35')](_0x16889f[_0xbd11('0x2f')],qs['fields'](_0x5917ea[_0xbd11('0x31')][_0xbd11('0x36')]));_0x2abaa7['attributes']=_0x2abaa7[_0xbd11('0x34')]['length']?_0x2abaa7[_0xbd11('0x34')]:_0x16889f['model'];if(_0x5917ea[_0xbd11('0x31')][_0xbd11('0x3f')]){_0x2abaa7[_0xbd11('0x40')]=[{'all':!![]}];}_0x2abaa7=_['merge']({},_0x2abaa7,_0x5917ea[_0xbd11('0x3e')]);return db[_0xbd11('0x2a')][_0xbd11('0x45')](_0x2abaa7)[_0xbd11('0x25')](handleEntityNotFound(_0x3a8cd8,null))[_0xbd11('0x25')](respondWithResult(_0x3a8cd8,null))[_0xbd11('0x46')](handleError(_0x3a8cd8,null));};exports[_0xbd11('0x47')]=function(_0x37289e,_0x488606){return db[_0xbd11('0x2a')][_0xbd11('0x47')](_0x37289e[_0xbd11('0x48')],{})[_0xbd11('0x25')](respondWithResult(_0x488606,0xc9))[_0xbd11('0x46')](handleError(_0x488606,null));};exports['update']=function(_0x45e664,_0x5f3df0){if(_0x45e664[_0xbd11('0x48')]['id']){delete _0x45e664[_0xbd11('0x48')]['id'];}delete _0x45e664[_0xbd11('0x48')][_0xbd11('0x49')];delete _0x45e664[_0xbd11('0x48')][_0xbd11('0x4a')];delete _0x45e664[_0xbd11('0x48')][_0xbd11('0x4b')];delete _0x45e664[_0xbd11('0x48')][_0xbd11('0x4c')];return db[_0xbd11('0x2a')][_0xbd11('0x45')]({'where':{'id':_0x45e664[_0xbd11('0x44')]['id']}})[_0xbd11('0x25')](handleEntityNotFound(_0x5f3df0,null))[_0xbd11('0x25')](saveUpdates(_0x45e664[_0xbd11('0x48')],null))[_0xbd11('0x25')](respondWithResult(_0x5f3df0,null))['catch'](handleError(_0x5f3df0,null));};exports[_0xbd11('0x4d')]=function(_0x1ad925,_0x5bb807){return db[_0xbd11('0x2a')][_0xbd11('0x4d')]()[_0xbd11('0x25')](respondWithResult(_0x5bb807,null))['catch'](handleError(_0x5bb807,null));};exports['download']=function(_0x393218,_0x2589ec,_0x197e16){var _0x1a4c12=require(_0xbd11('0x4e'));var _0x24023d=![];var _0x4d7143={};if(_0x393218[_0xbd11('0x31')]['type']&&_0x393218[_0xbd11('0x31')][_0xbd11('0x2d')]===_0xbd11('0x4f')){_0x4d7143[_0xbd11('0x4f')]=_0x393218[_0xbd11('0x44')]['id'];}else{_0x4d7143['id']=_0x393218['params']['id'];}return db['ScreenRecording']['find']({'where':_0x4d7143,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2589ec,null))[_0xbd11('0x25')](function(_0x944cb8){if(_0x944cb8){var _0x4efc49=path[_0xbd11('0x50')](config['root'],_0xbd11('0x51'),_0x944cb8[_0xbd11('0x4c')]);var _0x10fb0d=util['format'](_0xbd11('0x52'),_0x4efc49);if(fs[_0xbd11('0x53')](_0x10fb0d)){_0x24023d=!![];return _0x1a4c12[_0xbd11('0x54')](_0x10fb0d,_0x4efc49,config[_0xbd11('0x55')]['recording'])[_0xbd11('0x25')](function(){return _0x944cb8;});}return _0x944cb8;}})['then'](function(_0x342826){if(_0x342826){var _0x4aaa14=path[_0xbd11('0x50')](config[_0xbd11('0x56')],_0xbd11('0x51'),_0x342826[_0xbd11('0x4c')]);if(!fs[_0xbd11('0x53')](_0x4aaa14)){throw new db[(_0xbd11('0x57'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x342826[_0xbd11('0x58')]){return _0x2589ec[_0xbd11('0x59')](_0x4aaa14,_0x342826['filename']+path['extname'](_0x4aaa14),function(){if(_0x24023d){fs[_0xbd11('0x5a')](_0x4aaa14);}});}else{return _0x2589ec['download'](_0x4aaa14,function(_0x49ca7d){if(_0x24023d){fs[_0xbd11('0x5a')](_0x4aaa14);}});}}})[_0xbd11('0x46')](function(_0x4998eb){if(_0x4998eb['message']===_0xbd11('0x5b')){_0x2589ec['status'](0x194)[_0xbd11('0x28')](_0xbd11('0x5c'));}else{return handleError(_0x2589ec,null);}});};exports[_0xbd11('0x5d')]=function(_0x1154e2,_0x9af060){return db[_0xbd11('0x2a')]['find']({'where':{'id':_0x1154e2[_0xbd11('0x44')]['id']}})[_0xbd11('0x25')](function(_0x236a0f){if(!_0x236a0f)throw new ReferenceError(_0xbd11('0x5e'));return _0x236a0f;})[_0xbd11('0x25')](function(_0x1b37ec){var _0x2dee20=path[_0xbd11('0x50')](config[_0xbd11('0x56')],_0xbd11('0x51'),_0x1b37ec[_0xbd11('0x4c')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2dee20);if(!_[_0xbd11('0x5f')](_0x1b37ec[_0xbd11('0x4c')])&&fs[_0xbd11('0x53')](_0x2dee20)){logger[_0xbd11('0x60')](_0xbd11('0x61')+_0x2dee20+_0xbd11('0x62'));fs['unlinkSync'](_0x2dee20);}_0x2dee20=_0x2dee20+_0xbd11('0x63');if(!_[_0xbd11('0x5f')](_0x1b37ec[_0xbd11('0x4c')])&&fs[_0xbd11('0x53')](_0x2dee20)){logger[_0xbd11('0x60')](_0xbd11('0x61')+_0x2dee20+_0xbd11('0x62'));fs[_0xbd11('0x64')](_0x2dee20);}return _0x1b37ec;})[_0xbd11('0x25')](function(_0x596f3a){if(!_0x596f3a)throw new InternalError();return _0x596f3a['destroy']();})[_0xbd11('0x25')](function(){_0x9af060[_0xbd11('0x1a')](0xcc)['end']();})[_0xbd11('0x46')](handleError(_0x9af060,null));};
\ No newline at end of file
+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