Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index ae7f1a4..b340904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0b=['duration','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','set','Content-Range','apply','save','then','end','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','update','body'];(function(_0xf04b83,_0x399c28){var _0x3d15eb=function(_0x3b554d){while(--_0x3b554d){_0xf04b83['push'](_0xf04b83['shift']());}};_0x3d15eb(++_0x399c28);}(_0x4b0b,0x150));var _0xb4b0=function(_0x489ca0,_0xbb5ffe){_0x489ca0=_0x489ca0-0x0;var _0x522236=_0x4b0b[_0x489ca0];return _0x522236;};'use strict';var pdf=require(_0xb4b0('0x0'));var emlformat=require(_0xb4b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb4b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4b0('0x3'));var moment=require(_0xb4b0('0x4'));var BPromise=require(_0xb4b0('0x5'));var Mustache=require(_0xb4b0('0x6'));var util=require(_0xb4b0('0x7'));var path=require(_0xb4b0('0x8'));var sox=require(_0xb4b0('0x9'));var csv=require(_0xb4b0('0xa'));var ejs=require(_0xb4b0('0xb'));var fs=require('fs');var _=require(_0xb4b0('0xc'));var squel=require(_0xb4b0('0xd'));var crypto=require(_0xb4b0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb4b0('0xf'));var toCsv=require(_0xb4b0('0xa'));var querystring=require(_0xb4b0('0x10'));var Papa=require(_0xb4b0('0x11'));var Redis=require('ioredis');var authService=require(_0xb4b0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb4b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4b0('0x14'))(_0xb4b0('0x15'));var utils=require(_0xb4b0('0x16'));var config=require(_0xb4b0('0x17'));var licenseUtil=require(_0xb4b0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5e69,_0x19779a){_0x19779a=_0x19779a||0xcc;return function(_0x561bab){if(_0x561bab){return _0x4c5e69[_0xb4b0('0x19')](_0x19779a);}return _0x4c5e69[_0xb4b0('0x1a')](_0x19779a)['end']();};}function respondWithResult(_0x4af0c8,_0x570933){_0x570933=_0x570933||0xc8;return function(_0x36fd71){if(_0x36fd71){return _0x4af0c8[_0xb4b0('0x1a')](_0x570933)[_0xb4b0('0x1b')](_0x36fd71);}};}function respondWithFilteredResult(_0x3e02c6,_0x1641f2){return function(_0x121c2a){if(_0x121c2a){var _0x3d74c9=_0x121c2a[_0xb4b0('0x1c')],_0x2a1191=_0x1641f2['offset'],_0x4a2795=_0x1641f2[_0xb4b0('0x1d')]+_0x1641f2['limit'],_0x4873dd;if(_0x4a2795>=_0x3d74c9){_0x4a2795=_0x3d74c9;_0x4873dd=0xc8;}else{_0x4873dd=0xce;}_0x3e02c6[_0xb4b0('0x1a')](_0x4873dd);return _0x3e02c6[_0xb4b0('0x1e')](_0xb4b0('0x1f'),_0x2a1191+'-'+_0x4a2795+'/'+_0x3d74c9)[_0xb4b0('0x1b')](_0x121c2a);}return null;};}function patchUpdates(_0x5713dd){return function(_0x1c1687){try{jsonpatch[_0xb4b0('0x20')](_0x1c1687,_0x5713dd,!![]);}catch(_0x59dd49){return BPromise['reject'](_0x59dd49);}return _0x1c1687[_0xb4b0('0x21')]();};}function saveUpdates(_0x20e0d8,_0x202c04){return function(_0x1f5c9f){if(_0x1f5c9f){return _0x1f5c9f['update'](_0x20e0d8)[_0xb4b0('0x22')](function(_0x12bc5d){return _0x12bc5d;});}return null;};}function removeEntity(_0x231215,_0x9e1730){return function(_0x504490){if(_0x504490){return _0x504490['destroy']()['then'](function(){_0x231215[_0xb4b0('0x1a')](0xcc)[_0xb4b0('0x23')]();});}};}function handleEntityNotFound(_0x7e8c3c,_0x48c957){return function(_0x2f2d8){if(!_0x2f2d8){_0x7e8c3c[_0xb4b0('0x19')](0x194);}return _0x2f2d8;};}function handleError(_0x59e160,_0x38d87b){_0x38d87b=_0x38d87b||0x1f4;return function(_0x4cfbdf){logger['error'](_0x4cfbdf[_0xb4b0('0x24')]);if(_0x4cfbdf[_0xb4b0('0x25')]){delete _0x4cfbdf[_0xb4b0('0x25')];}_0x59e160['status'](_0x38d87b)[_0xb4b0('0x26')](_0x4cfbdf);};}exports[_0xb4b0('0x27')]=function(_0x12f77a,_0x5ecf9a){var _0x1274f1={},_0x43ac29={},_0x511c14={'count':0x0,'rows':[]};var _0x348550=_[_0xb4b0('0x28')](db[_0xb4b0('0x29')][_0xb4b0('0x2a')],function(_0x13d980){return{'name':_0x13d980[_0xb4b0('0x2b')],'type':_0x13d980[_0xb4b0('0x2c')][_0xb4b0('0x2d')]};});_0x43ac29[_0xb4b0('0x2e')]=_[_0xb4b0('0x2f')](_[_0xb4b0('0x28')](_0x348550,_0xb4b0('0x25')),['format']);_0x43ac29['query']=_[_0xb4b0('0x30')](_0x12f77a[_0xb4b0('0x31')]);_0x43ac29[_0xb4b0('0x32')]=_['intersection'](_0x43ac29[_0xb4b0('0x2e')],_0x43ac29[_0xb4b0('0x31')]);_0x1274f1['attributes']=_[_0xb4b0('0x33')](_0x43ac29[_0xb4b0('0x2e')],qs[_0xb4b0('0x34')](_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x34')]));_0x1274f1[_0xb4b0('0x35')]=_0x1274f1[_0xb4b0('0x35')][_0xb4b0('0x36')]?_0x1274f1[_0xb4b0('0x35')]:_0x43ac29['model'];if(!_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x37')](_0xb4b0('0x38'))){_0x1274f1[_0xb4b0('0x39')]=qs['limit'](_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x39')]);_0x1274f1[_0xb4b0('0x1d')]=qs['offset'](_0x12f77a[_0xb4b0('0x31')]['offset']);}_0x1274f1[_0xb4b0('0x3a')]=qs['sort'](_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x3b')]);_0x1274f1[_0xb4b0('0x3c')]=qs[_0xb4b0('0x32')](_[_0xb4b0('0x3d')](_0x12f77a['query'],_0x43ac29['filters']),_0x348550);if(_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x3e')]){_0x1274f1[_0xb4b0('0x3c')]=_[_0xb4b0('0x3f')](_0x1274f1['where'],{'$or':_['map'](_0x348550,function(_0x38decb){if(_0x38decb[_0xb4b0('0x2c')]!==_0xb4b0('0x40')){var _0x3bf02a={};_0x3bf02a[_0x38decb[_0xb4b0('0x25')]]={'$like':'%'+_0x12f77a[_0xb4b0('0x31')][_0xb4b0('0x3e')]+'%'};return _0x3bf02a;}})});}_0x1274f1=_[_0xb4b0('0x3f')]({},_0x1274f1,_0x12f77a[_0xb4b0('0x41')]);var _0x41a8d2={'where':_0x1274f1[_0xb4b0('0x3c')]};return db[_0xb4b0('0x29')]['count'](_0x41a8d2)['then'](function(_0x3b14d2){_0x511c14['count']=_0x3b14d2;if(_0x12f77a[_0xb4b0('0x31')]['includeAll']){_0x1274f1[_0xb4b0('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x1274f1);})[_0xb4b0('0x22')](function(_0x162347){_0x511c14[_0xb4b0('0x43')]=_0x162347;return _0x511c14;})[_0xb4b0('0x22')](respondWithFilteredResult(_0x5ecf9a,_0x1274f1))['catch'](handleError(_0x5ecf9a,null));};exports[_0xb4b0('0x44')]=function(_0x228d2c,_0x203458){var _0x39582c={'raw':![],'where':{'id':_0x228d2c[_0xb4b0('0x45')]['id']}},_0x17f931={};_0x17f931[_0xb4b0('0x2e')]=_[_0xb4b0('0x30')](db['ScreenRecording'][_0xb4b0('0x2a')]);_0x17f931[_0xb4b0('0x31')]=_[_0xb4b0('0x30')](_0x228d2c['query']);_0x17f931[_0xb4b0('0x32')]=_[_0xb4b0('0x33')](_0x17f931[_0xb4b0('0x2e')],_0x17f931[_0xb4b0('0x31')]);_0x39582c[_0xb4b0('0x35')]=_['intersection'](_0x17f931[_0xb4b0('0x2e')],qs['fields'](_0x228d2c[_0xb4b0('0x31')][_0xb4b0('0x34')]));_0x39582c['attributes']=_0x39582c[_0xb4b0('0x35')]['length']?_0x39582c[_0xb4b0('0x35')]:_0x17f931[_0xb4b0('0x2e')];if(_0x228d2c['query'][_0xb4b0('0x46')]){_0x39582c['include']=[{'all':!![]}];}_0x39582c=_['merge']({},_0x39582c,_0x228d2c[_0xb4b0('0x41')]);return db[_0xb4b0('0x29')][_0xb4b0('0x47')](_0x39582c)[_0xb4b0('0x22')](handleEntityNotFound(_0x203458,null))[_0xb4b0('0x22')](respondWithResult(_0x203458,null))[_0xb4b0('0x48')](handleError(_0x203458,null));};exports[_0xb4b0('0x49')]=function(_0xab807e,_0x3e2238){return db[_0xb4b0('0x29')][_0xb4b0('0x49')](_0xab807e['body'],{})['then'](respondWithResult(_0x3e2238,0xc9))[_0xb4b0('0x48')](handleError(_0x3e2238,null));};exports[_0xb4b0('0x4a')]=function(_0x143a12,_0x1a814d){if(_0x143a12[_0xb4b0('0x4b')]['id']){delete _0x143a12[_0xb4b0('0x4b')]['id'];}delete _0x143a12[_0xb4b0('0x4b')][_0xb4b0('0x4c')];delete _0x143a12[_0xb4b0('0x4b')]['createdAt'];delete _0x143a12[_0xb4b0('0x4b')]['closedAt'];delete _0x143a12['body']['value'];return db[_0xb4b0('0x29')][_0xb4b0('0x47')]({'where':{'id':_0x143a12[_0xb4b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a814d,null))[_0xb4b0('0x22')](saveUpdates(_0x143a12[_0xb4b0('0x4b')],null))[_0xb4b0('0x22')](respondWithResult(_0x1a814d,null))[_0xb4b0('0x48')](handleError(_0x1a814d,null));};exports[_0xb4b0('0x4d')]=function(_0xc9ab0,_0x55c822){return db['ScreenRecording'][_0xb4b0('0x4d')]()[_0xb4b0('0x22')](respondWithResult(_0x55c822,null))['catch'](handleError(_0x55c822,null));};exports[_0xb4b0('0x4e')]=function(_0x1deda2,_0x550fdf,_0x151da0){var _0x4eb212=require(_0xb4b0('0x4f'));var _0x33b25d=![];var _0x2cf067={};if(_0x1deda2[_0xb4b0('0x31')][_0xb4b0('0x2c')]&&_0x1deda2[_0xb4b0('0x31')][_0xb4b0('0x2c')]===_0xb4b0('0x50')){_0x2cf067[_0xb4b0('0x50')]=_0x1deda2[_0xb4b0('0x45')]['id'];}else{_0x2cf067['id']=_0x1deda2['params']['id'];}return db[_0xb4b0('0x29')][_0xb4b0('0x47')]({'where':_0x2cf067,'attributes':['id',_0xb4b0('0x51')],'raw':!![]})[_0xb4b0('0x22')](handleEntityNotFound(_0x550fdf,null))['then'](function(_0x744459){if(_0x744459){var _0x16b68d=path[_0xb4b0('0x52')](config[_0xb4b0('0x53')],_0xb4b0('0x54'),_0x744459[_0xb4b0('0x51')]);var _0x4677f9=util[_0xb4b0('0x55')](_0xb4b0('0x56'),_0x16b68d);if(fs[_0xb4b0('0x57')](_0x4677f9)){_0x33b25d=!![];return _0x4eb212[_0xb4b0('0x58')](_0x4677f9,_0x16b68d,config[_0xb4b0('0x59')][_0xb4b0('0x5a')])[_0xb4b0('0x22')](function(){return _0x744459;});}return _0x744459;}})['then'](function(_0x267a45){if(_0x267a45){var _0x2a5615=path[_0xb4b0('0x52')](config[_0xb4b0('0x53')],_0xb4b0('0x54'),_0x267a45[_0xb4b0('0x51')]);if(!fs[_0xb4b0('0x57')](_0x2a5615)){throw new db['Sequelize'][(_0xb4b0('0x5b'))](_0xb4b0('0x5c'));}if(_0x267a45[_0xb4b0('0x5d')]){return _0x550fdf['download'](_0x2a5615,_0x267a45[_0xb4b0('0x5d')]+path['extname'](_0x2a5615),function(){if(_0x33b25d){fs[_0xb4b0('0x5e')](_0x2a5615);}});}else{return _0x550fdf[_0xb4b0('0x4e')](_0x2a5615,function(_0x4f3421){if(_0x33b25d){fs['unlink'](_0x2a5615);}});}}})[_0xb4b0('0x48')](function(_0xa6fbe3){if(_0xa6fbe3[_0xb4b0('0x5f')]===_0xb4b0('0x5c')){_0x550fdf[_0xb4b0('0x1a')](0x194)[_0xb4b0('0x26')](_0xb4b0('0x60'));}else{return handleError(_0x550fdf,null);}});};exports['destroy']=function(_0x4e69ed,_0x51a5c8){return db[_0xb4b0('0x29')][_0xb4b0('0x47')]({'where':{'id':_0x4e69ed['params']['id']}})[_0xb4b0('0x22')](function(_0x461c6a){if(!_0x461c6a)throw new ReferenceError(_0xb4b0('0x61'));return _0x461c6a;})[_0xb4b0('0x22')](function(_0x4955c8){var _0x1dda47=path[_0xb4b0('0x52')](config['root'],'server/files/screen_recordings',_0x4955c8[_0xb4b0('0x51')]);logger['info'](_0xb4b0('0x62'),_0x1dda47);if(!_['isNil'](_0x4955c8[_0xb4b0('0x51')])&&fs[_0xb4b0('0x57')](_0x1dda47)){logger[_0xb4b0('0x63')](_0xb4b0('0x64')+_0x1dda47+_0xb4b0('0x65'));fs['unlinkSync'](_0x1dda47);}_0x1dda47=_0x1dda47+_0xb4b0('0x66');if(!_['isNil'](_0x4955c8[_0xb4b0('0x51')])&&fs[_0xb4b0('0x57')](_0x1dda47)){logger[_0xb4b0('0x63')](_0xb4b0('0x64')+_0x1dda47+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x1dda47);}return _0x4955c8;})[_0xb4b0('0x22')](function(_0x330322){if(!_0x330322)throw new InternalError();return _0x330322['destroy']();})[_0xb4b0('0x22')](function(){_0x51a5c8[_0xb4b0('0x1a')](0xcc)['end']();})[_0xb4b0('0x48')](handleError(_0x51a5c8,null));};
\ No newline at end of file
+var _0xb009=['ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','duration','createdAt','closedAt','value','find','describe','uniqueid','join','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','ValidationError','ScreenRecording\x20not\x20found','download','filename','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x1b4e6e,_0x5c260c){var _0x55a228=function(_0x36cc2b){while(--_0x36cc2b){_0x1b4e6e['push'](_0x1b4e6e['shift']());}};_0x55a228(++_0x5c260c);}(_0xb009,0x186));var _0x9b00=function(_0x508c71,_0x55b144){_0x508c71=_0x508c71-0x0;var _0x1a1f53=_0xb009[_0x508c71];return _0x1a1f53;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b00('0x0'));var rimraf=require(_0x9b00('0x1'));var zipdir=require(_0x9b00('0x2'));var jsonpatch=require(_0x9b00('0x3'));var rp=require('request-promise');var moment=require(_0x9b00('0x4'));var BPromise=require(_0x9b00('0x5'));var Mustache=require(_0x9b00('0x6'));var util=require(_0x9b00('0x7'));var path=require('path');var sox=require(_0x9b00('0x8'));var csv=require(_0x9b00('0x9'));var ejs=require(_0x9b00('0xa'));var fs=require('fs');var _=require(_0x9b00('0xb'));var squel=require(_0x9b00('0xc'));var crypto=require(_0x9b00('0xd'));var jsforce=require(_0x9b00('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9b00('0x9'));var querystring=require(_0x9b00('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b00('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9b00('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b00('0x12'))('api');var utils=require(_0x9b00('0x13'));var config=require(_0x9b00('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14bfe1,_0x4fc7eb){_0x4fc7eb=_0x4fc7eb||0xcc;return function(_0x26c26f){if(_0x26c26f){return _0x14bfe1[_0x9b00('0x15')](_0x4fc7eb);}return _0x14bfe1[_0x9b00('0x16')](_0x4fc7eb)[_0x9b00('0x17')]();};}function respondWithResult(_0x31b59d,_0x91631c){_0x91631c=_0x91631c||0xc8;return function(_0x39d73b){if(_0x39d73b){return _0x31b59d['status'](_0x91631c)[_0x9b00('0x18')](_0x39d73b);}};}function respondWithFilteredResult(_0x169172,_0x2ec08a){return function(_0x358d46){if(_0x358d46){var _0xb19148=_0x358d46[_0x9b00('0x19')],_0x27a9f1=_0x2ec08a[_0x9b00('0x1a')],_0xda2be1=_0x2ec08a[_0x9b00('0x1a')]+_0x2ec08a['limit'],_0x2b023f;if(_0xda2be1>=_0xb19148){_0xda2be1=_0xb19148;_0x2b023f=0xc8;}else{_0x2b023f=0xce;}_0x169172['status'](_0x2b023f);return _0x169172[_0x9b00('0x1b')](_0x9b00('0x1c'),_0x27a9f1+'-'+_0xda2be1+'/'+_0xb19148)[_0x9b00('0x18')](_0x358d46);}return null;};}function patchUpdates(_0x5ae9ef){return function(_0x9fcbe0){try{jsonpatch['apply'](_0x9fcbe0,_0x5ae9ef,!![]);}catch(_0x2821b1){return BPromise[_0x9b00('0x1d')](_0x2821b1);}return _0x9fcbe0['save']();};}function saveUpdates(_0x14e05e,_0x4fd9e0){return function(_0x3a699d){if(_0x3a699d){return _0x3a699d[_0x9b00('0x1e')](_0x14e05e)[_0x9b00('0x1f')](function(_0xf84650){return _0xf84650;});}return null;};}function removeEntity(_0x1f00ed,_0x123bed){return function(_0x40c48b){if(_0x40c48b){return _0x40c48b[_0x9b00('0x20')]()[_0x9b00('0x1f')](function(){_0x1f00ed[_0x9b00('0x16')](0xcc)[_0x9b00('0x17')]();});}};}function handleEntityNotFound(_0x18aab5,_0x1707a){return function(_0xb20877){if(!_0xb20877){_0x18aab5['sendStatus'](0x194);}return _0xb20877;};}function handleError(_0x55bebf,_0x486bf0){_0x486bf0=_0x486bf0||0x1f4;return function(_0x23861a){logger[_0x9b00('0x21')](_0x23861a[_0x9b00('0x22')]);if(_0x23861a[_0x9b00('0x23')]){delete _0x23861a[_0x9b00('0x23')];}_0x55bebf[_0x9b00('0x16')](_0x486bf0)[_0x9b00('0x24')](_0x23861a);};}exports['index']=function(_0x5409cd,_0x4215f2){var _0x41a060={},_0x564c28={},_0x2c58b9={'count':0x0,'rows':[]};var _0x41ca3c=_[_0x9b00('0x25')](db[_0x9b00('0x26')]['rawAttributes'],function(_0x3219b2){return{'name':_0x3219b2[_0x9b00('0x27')],'type':_0x3219b2[_0x9b00('0x28')][_0x9b00('0x29')]};});_0x564c28[_0x9b00('0x2a')]=_['differenceBy'](_['map'](_0x41ca3c,_0x9b00('0x23')),[_0x9b00('0x2b')]);_0x564c28[_0x9b00('0x2c')]=_[_0x9b00('0x2d')](_0x5409cd['query']);_0x564c28[_0x9b00('0x2e')]=_[_0x9b00('0x2f')](_0x564c28[_0x9b00('0x2a')],_0x564c28[_0x9b00('0x2c')]);_0x41a060[_0x9b00('0x30')]=_[_0x9b00('0x2f')](_0x564c28[_0x9b00('0x2a')],qs[_0x9b00('0x31')](_0x5409cd['query'][_0x9b00('0x31')]));_0x41a060[_0x9b00('0x30')]=_0x41a060[_0x9b00('0x30')][_0x9b00('0x32')]?_0x41a060[_0x9b00('0x30')]:_0x564c28[_0x9b00('0x2a')];if(!_0x5409cd['query'][_0x9b00('0x33')](_0x9b00('0x34'))){_0x41a060[_0x9b00('0x35')]=qs['limit'](_0x5409cd[_0x9b00('0x2c')][_0x9b00('0x35')]);_0x41a060[_0x9b00('0x1a')]=qs[_0x9b00('0x1a')](_0x5409cd[_0x9b00('0x2c')][_0x9b00('0x1a')]);}_0x41a060[_0x9b00('0x36')]=qs[_0x9b00('0x37')](_0x5409cd['query']['sort']);_0x41a060[_0x9b00('0x38')]=qs[_0x9b00('0x2e')](_[_0x9b00('0x39')](_0x5409cd[_0x9b00('0x2c')],_0x564c28[_0x9b00('0x2e')]),_0x41ca3c);if(_0x5409cd[_0x9b00('0x2c')]['filter']){_0x41a060[_0x9b00('0x38')]=_[_0x9b00('0x3a')](_0x41a060[_0x9b00('0x38')],{'$or':_[_0x9b00('0x25')](_0x41ca3c,function(_0x44d3e7){if(_0x44d3e7[_0x9b00('0x28')]!==_0x9b00('0x3b')){var _0x1dc362={};_0x1dc362[_0x44d3e7[_0x9b00('0x23')]]={'$like':'%'+_0x5409cd[_0x9b00('0x2c')][_0x9b00('0x3c')]+'%'};return _0x1dc362;}})});}_0x41a060=_['merge']({},_0x41a060,_0x5409cd[_0x9b00('0x3d')]);var _0x57f4d9={'where':_0x41a060[_0x9b00('0x38')]};return db[_0x9b00('0x26')][_0x9b00('0x19')](_0x57f4d9)[_0x9b00('0x1f')](function(_0x7d23d7){_0x2c58b9[_0x9b00('0x19')]=_0x7d23d7;if(_0x5409cd['query'][_0x9b00('0x3e')]){_0x41a060[_0x9b00('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9b00('0x40')](_0x41a060);})[_0x9b00('0x1f')](function(_0x5684c3){_0x2c58b9[_0x9b00('0x41')]=_0x5684c3;return _0x2c58b9;})['then'](respondWithFilteredResult(_0x4215f2,_0x41a060))[_0x9b00('0x42')](handleError(_0x4215f2,null));};exports[_0x9b00('0x43')]=function(_0x4d0cec,_0x59c000){var _0x4dd89d={'raw':![],'where':{'id':_0x4d0cec[_0x9b00('0x44')]['id']}},_0x3fb155={};_0x3fb155[_0x9b00('0x2a')]=_[_0x9b00('0x2d')](db[_0x9b00('0x26')][_0x9b00('0x45')]);_0x3fb155['query']=_[_0x9b00('0x2d')](_0x4d0cec['query']);_0x3fb155[_0x9b00('0x2e')]=_[_0x9b00('0x2f')](_0x3fb155['model'],_0x3fb155['query']);_0x4dd89d[_0x9b00('0x30')]=_[_0x9b00('0x2f')](_0x3fb155[_0x9b00('0x2a')],qs['fields'](_0x4d0cec[_0x9b00('0x2c')]['fields']));_0x4dd89d[_0x9b00('0x30')]=_0x4dd89d[_0x9b00('0x30')]['length']?_0x4dd89d[_0x9b00('0x30')]:_0x3fb155[_0x9b00('0x2a')];if(_0x4d0cec[_0x9b00('0x2c')][_0x9b00('0x3e')]){_0x4dd89d[_0x9b00('0x3f')]=[{'all':!![]}];}_0x4dd89d=_[_0x9b00('0x3a')]({},_0x4dd89d,_0x4d0cec[_0x9b00('0x3d')]);return db[_0x9b00('0x26')]['find'](_0x4dd89d)['then'](handleEntityNotFound(_0x59c000,null))[_0x9b00('0x1f')](respondWithResult(_0x59c000,null))['catch'](handleError(_0x59c000,null));};exports[_0x9b00('0x46')]=function(_0x4d24f3,_0x31827a){return db[_0x9b00('0x26')][_0x9b00('0x46')](_0x4d24f3['body'],{})[_0x9b00('0x1f')](respondWithResult(_0x31827a,0xc9))['catch'](handleError(_0x31827a,null));};exports[_0x9b00('0x1e')]=function(_0x221566,_0x3f185a){if(_0x221566[_0x9b00('0x47')]['id']){delete _0x221566[_0x9b00('0x47')]['id'];}delete _0x221566[_0x9b00('0x47')][_0x9b00('0x48')];delete _0x221566['body'][_0x9b00('0x49')];delete _0x221566[_0x9b00('0x47')][_0x9b00('0x4a')];delete _0x221566[_0x9b00('0x47')][_0x9b00('0x4b')];return db[_0x9b00('0x26')][_0x9b00('0x4c')]({'where':{'id':_0x221566[_0x9b00('0x44')]['id']}})[_0x9b00('0x1f')](handleEntityNotFound(_0x3f185a,null))['then'](saveUpdates(_0x221566[_0x9b00('0x47')],null))[_0x9b00('0x1f')](respondWithResult(_0x3f185a,null))[_0x9b00('0x42')](handleError(_0x3f185a,null));};exports['describe']=function(_0x45f991,_0x3c60b9){return db[_0x9b00('0x26')][_0x9b00('0x4d')]()[_0x9b00('0x1f')](respondWithResult(_0x3c60b9,null))[_0x9b00('0x42')](handleError(_0x3c60b9,null));};exports['download']=function(_0x2e0958,_0x11ec81,_0x6dd682){var _0x4ef00e=require('../../components/encryptor');var _0x36384e=![];var _0x2ff323={};if(_0x2e0958[_0x9b00('0x2c')][_0x9b00('0x28')]&&_0x2e0958[_0x9b00('0x2c')][_0x9b00('0x28')]===_0x9b00('0x4e')){_0x2ff323[_0x9b00('0x4e')]=_0x2e0958[_0x9b00('0x44')]['id'];}else{_0x2ff323['id']=_0x2e0958['params']['id'];}return db[_0x9b00('0x26')][_0x9b00('0x4c')]({'where':_0x2ff323,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ec81,null))[_0x9b00('0x1f')](function(_0x8f2db8){if(_0x8f2db8){var _0x4047bb=path[_0x9b00('0x4f')](config['root'],_0x9b00('0x50'),_0x8f2db8[_0x9b00('0x4b')]);var _0x3087e6=util['format']('%s.cypher',_0x4047bb);if(fs[_0x9b00('0x51')](_0x3087e6)){_0x36384e=!![];return _0x4ef00e[_0x9b00('0x52')](_0x3087e6,_0x4047bb,config[_0x9b00('0x53')][_0x9b00('0x54')])['then'](function(){return _0x8f2db8;});}return _0x8f2db8;}})[_0x9b00('0x1f')](function(_0x301e00){if(_0x301e00){var _0x33bd1c=path[_0x9b00('0x4f')](config[_0x9b00('0x55')],_0x9b00('0x50'),_0x301e00['value']);if(!fs[_0x9b00('0x51')](_0x33bd1c)){throw new db['Sequelize'][(_0x9b00('0x56'))](_0x9b00('0x57'));}if(_0x301e00['filename']){return _0x11ec81[_0x9b00('0x58')](_0x33bd1c,_0x301e00[_0x9b00('0x59')]+path['extname'](_0x33bd1c),function(){if(_0x36384e){fs[_0x9b00('0x5a')](_0x33bd1c);}});}else{return _0x11ec81[_0x9b00('0x58')](_0x33bd1c,function(_0x54633e){if(_0x36384e){fs['unlink'](_0x33bd1c);}});}}})['catch'](function(_0xea796e){if(_0xea796e['message']===_0x9b00('0x57')){_0x11ec81[_0x9b00('0x16')](0x194)[_0x9b00('0x24')](_0x9b00('0x5b'));}else{return handleError(_0x11ec81,null);}});};exports['destroy']=function(_0xf427e8,_0x26f684){return db['ScreenRecording'][_0x9b00('0x4c')]({'where':{'id':_0xf427e8[_0x9b00('0x44')]['id']}})[_0x9b00('0x1f')](function(_0x36e968){if(!_0x36e968)throw new ReferenceError(_0x9b00('0x5c'));return _0x36e968;})[_0x9b00('0x1f')](function(_0x1d875c){var _0x1dbc10=path['join'](config[_0x9b00('0x55')],_0x9b00('0x50'),_0x1d875c[_0x9b00('0x4b')]);logger[_0x9b00('0x5d')](_0x9b00('0x5e'),_0x1dbc10);if(!_[_0x9b00('0x5f')](_0x1d875c[_0x9b00('0x4b')])&&fs[_0x9b00('0x51')](_0x1dbc10)){logger[_0x9b00('0x5d')](_0x9b00('0x60')+_0x1dbc10+_0x9b00('0x61'));fs[_0x9b00('0x62')](_0x1dbc10);}_0x1dbc10=_0x1dbc10+_0x9b00('0x63');if(!_['isNil'](_0x1d875c[_0x9b00('0x4b')])&&fs['existsSync'](_0x1dbc10)){logger[_0x9b00('0x5d')](_0x9b00('0x60')+_0x1dbc10+_0x9b00('0x61'));fs[_0x9b00('0x62')](_0x1dbc10);}return _0x1d875c;})[_0x9b00('0x1f')](function(_0x34f764){if(!_0x34f764)throw new InternalError();return _0x34f764['destroy']();})[_0x9b00('0x1f')](function(){_0x26f684['status'](0xcc)[_0x9b00('0x17')]();})[_0x9b00('0x42')](handleError(_0x26f684,null));};
\ No newline at end of file