Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 1827bb6..c6b6e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe946=['request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','intersection','catch','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','find','join','server/files/screen_recordings','format','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','eml-format','rimraf','fast-json-patch'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xe946,0x18d));var _0x6e94=function(_0x92b9e,_0x242815){_0x92b9e=_0x92b9e-0x0;var _0x542410=_0xe946[_0x92b9e];return _0x542410;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6e94('0x0'));var rimraf=require(_0x6e94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e94('0x2'));var rp=require(_0x6e94('0x3'));var moment=require(_0x6e94('0x4'));var BPromise=require(_0x6e94('0x5'));var Mustache=require('mustache');var util=require(_0x6e94('0x6'));var path=require('path');var sox=require(_0x6e94('0x7'));var csv=require(_0x6e94('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6e94('0x9'));var squel=require(_0x6e94('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6e94('0xb'));var Papa=require(_0x6e94('0xc'));var Redis=require(_0x6e94('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e94('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e94('0xf'))('api');var utils=require(_0x6e94('0x10'));var config=require(_0x6e94('0x11'));var db=require(_0x6e94('0x12'))['db'];function respondWithStatusCode(_0xd75907,_0x16d4c5){_0x16d4c5=_0x16d4c5||0xcc;return function(_0x1286a6){if(_0x1286a6){return _0xd75907[_0x6e94('0x13')](_0x16d4c5);}return _0xd75907[_0x6e94('0x14')](_0x16d4c5)[_0x6e94('0x15')]();};}function respondWithResult(_0x4450fc,_0x3a8bc5){_0x3a8bc5=_0x3a8bc5||0xc8;return function(_0x2155cc){if(_0x2155cc){return _0x4450fc[_0x6e94('0x14')](_0x3a8bc5)[_0x6e94('0x16')](_0x2155cc);}};}function respondWithFilteredResult(_0xcb855d,_0x4e993c){return function(_0x1862f2){if(_0x1862f2){var _0x2b7973=_0x1862f2['count'],_0x3ee6e0=_0x4e993c['offset'],_0x546a1d=_0x4e993c[_0x6e94('0x17')]+_0x4e993c['limit'],_0x4a703a;if(_0x546a1d>=_0x2b7973){_0x546a1d=_0x2b7973;_0x4a703a=0xc8;}else{_0x4a703a=0xce;}_0xcb855d[_0x6e94('0x14')](_0x4a703a);return _0xcb855d[_0x6e94('0x18')](_0x6e94('0x19'),_0x3ee6e0+'-'+_0x546a1d+'/'+_0x2b7973)[_0x6e94('0x16')](_0x1862f2);}return null;};}function patchUpdates(_0x244d7f){return function(_0x1cabd3){try{jsonpatch[_0x6e94('0x1a')](_0x1cabd3,_0x244d7f,!![]);}catch(_0x44faff){return BPromise[_0x6e94('0x1b')](_0x44faff);}return _0x1cabd3[_0x6e94('0x1c')]();};}function saveUpdates(_0x3c2724,_0x2e3f94){return function(_0x3ab1b5){if(_0x3ab1b5){return _0x3ab1b5[_0x6e94('0x1d')](_0x3c2724)[_0x6e94('0x1e')](function(_0x5283ed){return _0x5283ed;});}return null;};}function removeEntity(_0x5f5348,_0x3530e9){return function(_0x5be11a){if(_0x5be11a){return _0x5be11a[_0x6e94('0x1f')]()[_0x6e94('0x1e')](function(){_0x5f5348[_0x6e94('0x14')](0xcc)[_0x6e94('0x15')]();});}};}function handleEntityNotFound(_0x2a399b,_0x406786){return function(_0x218a5d){if(!_0x218a5d){_0x2a399b[_0x6e94('0x13')](0x194);}return _0x218a5d;};}function handleError(_0x1a011e,_0x6ba013){_0x6ba013=_0x6ba013||0x1f4;return function(_0x183f15){logger[_0x6e94('0x20')](_0x183f15['stack']);if(_0x183f15[_0x6e94('0x21')]){delete _0x183f15[_0x6e94('0x21')];}_0x1a011e[_0x6e94('0x14')](_0x6ba013)[_0x6e94('0x22')](_0x183f15);};}exports[_0x6e94('0x23')]=function(_0x4fdc90,_0x69c8a4){var _0x17bf12={},_0x199b35={},_0x17f398={'count':0x0,'rows':[]};var _0x58ece6=_[_0x6e94('0x24')](db[_0x6e94('0x25')][_0x6e94('0x26')],function(_0x1cbde5){return{'name':_0x1cbde5[_0x6e94('0x27')],'type':_0x1cbde5[_0x6e94('0x28')][_0x6e94('0x29')]};});_0x199b35[_0x6e94('0x2a')]=_[_0x6e94('0x2b')](_[_0x6e94('0x24')](_0x58ece6,_0x6e94('0x21')),['format']);_0x199b35[_0x6e94('0x2c')]=_[_0x6e94('0x2d')](_0x4fdc90['query']);_0x199b35[_0x6e94('0x2e')]=_['intersection'](_0x199b35[_0x6e94('0x2a')],_0x199b35[_0x6e94('0x2c')]);_0x17bf12[_0x6e94('0x2f')]=_['intersection'](_0x199b35[_0x6e94('0x2a')],qs[_0x6e94('0x30')](_0x4fdc90['query']['fields']));_0x17bf12[_0x6e94('0x2f')]=_0x17bf12[_0x6e94('0x2f')][_0x6e94('0x31')]?_0x17bf12[_0x6e94('0x2f')]:_0x199b35[_0x6e94('0x2a')];if(!_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x32')]('nolimit')){_0x17bf12[_0x6e94('0x33')]=qs[_0x6e94('0x33')](_0x4fdc90['query']['limit']);_0x17bf12[_0x6e94('0x17')]=qs[_0x6e94('0x17')](_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x17')]);}_0x17bf12[_0x6e94('0x34')]=qs[_0x6e94('0x35')](_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x35')]);_0x17bf12[_0x6e94('0x36')]=qs[_0x6e94('0x2e')](_[_0x6e94('0x37')](_0x4fdc90[_0x6e94('0x2c')],_0x199b35[_0x6e94('0x2e')]),_0x58ece6);if(_0x4fdc90['query'][_0x6e94('0x38')]){_0x17bf12[_0x6e94('0x36')]=_[_0x6e94('0x39')](_0x17bf12[_0x6e94('0x36')],{'$or':_['map'](_0x58ece6,function(_0x5acf05){if(_0x5acf05['type']!==_0x6e94('0x3a')){var _0x140edb={};_0x140edb[_0x5acf05[_0x6e94('0x21')]]={'$like':'%'+_0x4fdc90['query'][_0x6e94('0x38')]+'%'};return _0x140edb;}})});}_0x17bf12=_[_0x6e94('0x39')]({},_0x17bf12,_0x4fdc90[_0x6e94('0x3b')]);var _0x319578={'where':_0x17bf12['where']};return db[_0x6e94('0x25')]['count'](_0x319578)['then'](function(_0x3d4167){_0x17f398[_0x6e94('0x3c')]=_0x3d4167;if(_0x4fdc90[_0x6e94('0x2c')][_0x6e94('0x3d')]){_0x17bf12[_0x6e94('0x3e')]=[{'all':!![]}];}return db[_0x6e94('0x25')][_0x6e94('0x3f')](_0x17bf12);})[_0x6e94('0x1e')](function(_0x429687){_0x17f398[_0x6e94('0x40')]=_0x429687;return _0x17f398;})[_0x6e94('0x1e')](respondWithFilteredResult(_0x69c8a4,_0x17bf12))['catch'](handleError(_0x69c8a4,null));};exports['show']=function(_0x1c1160,_0x132863){var _0x186ee7={'raw':![],'where':{'id':_0x1c1160['params']['id']}},_0x303442={};_0x303442['model']=_[_0x6e94('0x2d')](db['ScreenRecording'][_0x6e94('0x26')]);_0x303442[_0x6e94('0x2c')]=_[_0x6e94('0x2d')](_0x1c1160[_0x6e94('0x2c')]);_0x303442[_0x6e94('0x2e')]=_[_0x6e94('0x41')](_0x303442['model'],_0x303442[_0x6e94('0x2c')]);_0x186ee7[_0x6e94('0x2f')]=_['intersection'](_0x303442['model'],qs['fields'](_0x1c1160['query'][_0x6e94('0x30')]));_0x186ee7[_0x6e94('0x2f')]=_0x186ee7[_0x6e94('0x2f')][_0x6e94('0x31')]?_0x186ee7[_0x6e94('0x2f')]:_0x303442['model'];if(_0x1c1160['query']['includeAll']){_0x186ee7[_0x6e94('0x3e')]=[{'all':!![]}];}_0x186ee7=_['merge']({},_0x186ee7,_0x1c1160[_0x6e94('0x3b')]);return db[_0x6e94('0x25')]['find'](_0x186ee7)['then'](handleEntityNotFound(_0x132863,null))[_0x6e94('0x1e')](respondWithResult(_0x132863,null))[_0x6e94('0x42')](handleError(_0x132863,null));};exports[_0x6e94('0x43')]=function(_0x347deb,_0x5c8a3b){return db['ScreenRecording'][_0x6e94('0x43')](_0x347deb[_0x6e94('0x44')],{})[_0x6e94('0x1e')](respondWithResult(_0x5c8a3b,0xc9))[_0x6e94('0x42')](handleError(_0x5c8a3b,null));};exports[_0x6e94('0x1d')]=function(_0x3a20d0,_0x1a9a30){if(_0x3a20d0[_0x6e94('0x44')]['id']){delete _0x3a20d0['body']['id'];}delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x45')];delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x46')];delete _0x3a20d0['body'][_0x6e94('0x47')];delete _0x3a20d0[_0x6e94('0x44')][_0x6e94('0x48')];return db[_0x6e94('0x25')]['find']({'where':{'id':_0x3a20d0[_0x6e94('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a9a30,null))[_0x6e94('0x1e')](saveUpdates(_0x3a20d0[_0x6e94('0x44')],null))[_0x6e94('0x1e')](respondWithResult(_0x1a9a30,null))['catch'](handleError(_0x1a9a30,null));};exports[_0x6e94('0x4a')]=function(_0x417fb0,_0x2e44b1){return db[_0x6e94('0x25')][_0x6e94('0x4a')]()[_0x6e94('0x1e')](respondWithResult(_0x2e44b1,null))[_0x6e94('0x42')](handleError(_0x2e44b1,null));};exports[_0x6e94('0x4b')]=function(_0x2717e2,_0xdb0689,_0x22326e){var _0x5497d6=require(_0x6e94('0x4c'));var _0x30de8e=![];var _0x38a7eb={};if(_0x2717e2[_0x6e94('0x2c')][_0x6e94('0x28')]&&_0x2717e2[_0x6e94('0x2c')][_0x6e94('0x28')]==='uniqueid'){_0x38a7eb[_0x6e94('0x4d')]=_0x2717e2[_0x6e94('0x49')]['id'];}else{_0x38a7eb['id']=_0x2717e2[_0x6e94('0x49')]['id'];}return db[_0x6e94('0x25')][_0x6e94('0x4e')]({'where':_0x38a7eb,'attributes':['id',_0x6e94('0x48')],'raw':!![]})[_0x6e94('0x1e')](handleEntityNotFound(_0xdb0689,null))[_0x6e94('0x1e')](function(_0x1b47d5){if(_0x1b47d5){var _0x49df49=path[_0x6e94('0x4f')](config['root'],_0x6e94('0x50'),_0x1b47d5[_0x6e94('0x48')]);var _0x1349a3=util[_0x6e94('0x51')]('%s.cypher',_0x49df49);if(fs[_0x6e94('0x52')](_0x1349a3)){_0x30de8e=!![];return _0x5497d6[_0x6e94('0x53')](_0x1349a3,_0x49df49,config['secrets'][_0x6e94('0x54')])[_0x6e94('0x1e')](function(){return _0x1b47d5;});}return _0x1b47d5;}})[_0x6e94('0x1e')](function(_0x54a5e0){if(_0x54a5e0){var _0x21d1c6=path['join'](config[_0x6e94('0x55')],_0x6e94('0x50'),_0x54a5e0[_0x6e94('0x48')]);if(!fs[_0x6e94('0x52')](_0x21d1c6)){throw new db[(_0x6e94('0x56'))][(_0x6e94('0x57'))](_0x6e94('0x58'));}if(_0x54a5e0[_0x6e94('0x59')]){return _0xdb0689[_0x6e94('0x4b')](_0x21d1c6,_0x54a5e0[_0x6e94('0x59')]+path[_0x6e94('0x5a')](_0x21d1c6),function(){if(_0x30de8e){fs[_0x6e94('0x5b')](_0x21d1c6);}});}else{return _0xdb0689[_0x6e94('0x4b')](_0x21d1c6,function(_0x165ca9){if(_0x30de8e){fs[_0x6e94('0x5b')](_0x21d1c6);}});}}})['catch'](function(_0x220e20){if(_0x220e20[_0x6e94('0x5c')]===_0x6e94('0x58')){_0xdb0689[_0x6e94('0x14')](0x194)[_0x6e94('0x22')](_0x6e94('0x5d'));}else{return handleError(_0xdb0689,null);}});};exports[_0x6e94('0x1f')]=function(_0x31415d,_0x116357){return db[_0x6e94('0x25')][_0x6e94('0x4e')]({'where':{'id':_0x31415d['params']['id']}})[_0x6e94('0x1e')](function(_0x664217){if(!_0x664217)throw new ReferenceError('Entity\x20not\x20found');return _0x664217;})[_0x6e94('0x1e')](function(_0x155619){var _0x35c332=path['join'](config[_0x6e94('0x55')],_0x6e94('0x50'),_0x155619[_0x6e94('0x48')]);logger[_0x6e94('0x5e')](_0x6e94('0x5f'),_0x35c332);if(!_['isNil'](_0x155619['value'])&&fs[_0x6e94('0x52')](_0x35c332)){logger['info']('File:\x20\x22'+_0x35c332+_0x6e94('0x60'));fs[_0x6e94('0x61')](_0x35c332);}_0x35c332=_0x35c332+'.cypher';if(!_[_0x6e94('0x62')](_0x155619[_0x6e94('0x48')])&&fs[_0x6e94('0x52')](_0x35c332)){logger['info'](_0x6e94('0x63')+_0x35c332+_0x6e94('0x60'));fs[_0x6e94('0x61')](_0x35c332);}return _0x155619;})[_0x6e94('0x1e')](function(_0x5ae91a){if(!_0x5ae91a)throw new InternalError();return _0x5ae91a['destroy']();})[_0x6e94('0x1e')](function(){_0x116357[_0x6e94('0x14')](0xcc)[_0x6e94('0x15')]();})[_0x6e94('0x42')](handleError(_0x116357,null));};
\ No newline at end of file
+var _0xabf1=['type','key','model','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','createdAt','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','then','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName'];(function(_0x52e18f,_0x294cc9){var _0x1c381b=function(_0x4bc1ef){while(--_0x4bc1ef){_0x52e18f['push'](_0x52e18f['shift']());}};_0x1c381b(++_0x294cc9);}(_0xabf1,0xa0));var _0x1abf=function(_0x58f992,_0x142571){_0x58f992=_0x58f992-0x0;var _0x17518b=_0xabf1[_0x58f992];return _0x17518b;};'use strict';var pdf=require(_0x1abf('0x0'));var emlformat=require(_0x1abf('0x1'));var rimraf=require(_0x1abf('0x2'));var zipdir=require(_0x1abf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1abf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1abf('0x5'));var util=require(_0x1abf('0x6'));var path=require(_0x1abf('0x7'));var sox=require(_0x1abf('0x8'));var csv=require('to-csv');var ejs=require(_0x1abf('0x9'));var fs=require('fs');var _=require(_0x1abf('0xa'));var squel=require(_0x1abf('0xb'));var crypto=require('crypto');var jsforce=require(_0x1abf('0xc'));var deskjs=require(_0x1abf('0xd'));var toCsv=require(_0x1abf('0xe'));var querystring=require(_0x1abf('0xf'));var Papa=require(_0x1abf('0x10'));var Redis=require('ioredis');var authService=require(_0x1abf('0x11'));var qs=require(_0x1abf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1abf('0x13'));var logger=require(_0x1abf('0x14'))(_0x1abf('0x15'));var utils=require(_0x1abf('0x16'));var config=require(_0x1abf('0x17'));var db=require(_0x1abf('0x18'))['db'];function respondWithStatusCode(_0x393f05,_0xbe7492){_0xbe7492=_0xbe7492||0xcc;return function(_0x10392f){if(_0x10392f){return _0x393f05[_0x1abf('0x19')](_0xbe7492);}return _0x393f05[_0x1abf('0x1a')](_0xbe7492)[_0x1abf('0x1b')]();};}function respondWithResult(_0x7978a9,_0x153938){_0x153938=_0x153938||0xc8;return function(_0x526e2e){if(_0x526e2e){return _0x7978a9[_0x1abf('0x1a')](_0x153938)['json'](_0x526e2e);}};}function respondWithFilteredResult(_0x1efef5,_0x24ceb5){return function(_0x11fb2d){if(_0x11fb2d){var _0x401eb7=_0x11fb2d[_0x1abf('0x1c')],_0xb1c766=_0x24ceb5[_0x1abf('0x1d')],_0x3b09b4=_0x24ceb5[_0x1abf('0x1d')]+_0x24ceb5[_0x1abf('0x1e')],_0x13ed29;if(_0x3b09b4>=_0x401eb7){_0x3b09b4=_0x401eb7;_0x13ed29=0xc8;}else{_0x13ed29=0xce;}_0x1efef5[_0x1abf('0x1a')](_0x13ed29);return _0x1efef5[_0x1abf('0x1f')](_0x1abf('0x20'),_0xb1c766+'-'+_0x3b09b4+'/'+_0x401eb7)['json'](_0x11fb2d);}return null;};}function patchUpdates(_0x2dc048){return function(_0x1eba68){try{jsonpatch[_0x1abf('0x21')](_0x1eba68,_0x2dc048,!![]);}catch(_0x4b1eb1){return BPromise['reject'](_0x4b1eb1);}return _0x1eba68['save']();};}function saveUpdates(_0x125509,_0x65a719){return function(_0x16a677){if(_0x16a677){return _0x16a677['update'](_0x125509)['then'](function(_0x2bb995){return _0x2bb995;});}return null;};}function removeEntity(_0x3dc17a,_0x8b621f){return function(_0x3344c9){if(_0x3344c9){return _0x3344c9['destroy']()[_0x1abf('0x22')](function(){_0x3dc17a[_0x1abf('0x1a')](0xcc)[_0x1abf('0x1b')]();});}};}function handleEntityNotFound(_0x15e43b,_0x529083){return function(_0x397346){if(!_0x397346){_0x15e43b[_0x1abf('0x19')](0x194);}return _0x397346;};}function handleError(_0x31a752,_0x1cacc6){_0x1cacc6=_0x1cacc6||0x1f4;return function(_0x15202a){logger[_0x1abf('0x23')](_0x15202a[_0x1abf('0x24')]);if(_0x15202a[_0x1abf('0x25')]){delete _0x15202a[_0x1abf('0x25')];}_0x31a752[_0x1abf('0x1a')](_0x1cacc6)[_0x1abf('0x26')](_0x15202a);};}exports[_0x1abf('0x27')]=function(_0x2db535,_0xfa91c8){var _0x25a19e={},_0x265ba5={},_0x4d2a6f={'count':0x0,'rows':[]};var _0x3aa7af=_[_0x1abf('0x28')](db[_0x1abf('0x29')][_0x1abf('0x2a')],function(_0x26f7b3){return{'name':_0x26f7b3[_0x1abf('0x2b')],'type':_0x26f7b3[_0x1abf('0x2c')][_0x1abf('0x2d')]};});_0x265ba5[_0x1abf('0x2e')]=_['differenceBy'](_[_0x1abf('0x28')](_0x3aa7af,_0x1abf('0x25')),[_0x1abf('0x2f')]);_0x265ba5[_0x1abf('0x30')]=_[_0x1abf('0x31')](_0x2db535[_0x1abf('0x30')]);_0x265ba5[_0x1abf('0x32')]=_[_0x1abf('0x33')](_0x265ba5[_0x1abf('0x2e')],_0x265ba5[_0x1abf('0x30')]);_0x25a19e[_0x1abf('0x34')]=_[_0x1abf('0x33')](_0x265ba5[_0x1abf('0x2e')],qs[_0x1abf('0x35')](_0x2db535[_0x1abf('0x30')]['fields']));_0x25a19e[_0x1abf('0x34')]=_0x25a19e[_0x1abf('0x34')][_0x1abf('0x36')]?_0x25a19e[_0x1abf('0x34')]:_0x265ba5[_0x1abf('0x2e')];if(!_0x2db535[_0x1abf('0x30')]['hasOwnProperty'](_0x1abf('0x37'))){_0x25a19e[_0x1abf('0x1e')]=qs[_0x1abf('0x1e')](_0x2db535['query'][_0x1abf('0x1e')]);_0x25a19e[_0x1abf('0x1d')]=qs['offset'](_0x2db535['query'][_0x1abf('0x1d')]);}_0x25a19e[_0x1abf('0x38')]=qs[_0x1abf('0x39')](_0x2db535[_0x1abf('0x30')][_0x1abf('0x39')]);_0x25a19e['where']=qs[_0x1abf('0x32')](_[_0x1abf('0x3a')](_0x2db535[_0x1abf('0x30')],_0x265ba5['filters']),_0x3aa7af);if(_0x2db535[_0x1abf('0x30')][_0x1abf('0x3b')]){_0x25a19e[_0x1abf('0x3c')]=_[_0x1abf('0x3d')](_0x25a19e[_0x1abf('0x3c')],{'$or':_[_0x1abf('0x28')](_0x3aa7af,function(_0x4a8626){if(_0x4a8626[_0x1abf('0x2c')]!=='VIRTUAL'){var _0x57a66b={};_0x57a66b[_0x4a8626[_0x1abf('0x25')]]={'$like':'%'+_0x2db535[_0x1abf('0x30')]['filter']+'%'};return _0x57a66b;}})});}_0x25a19e=_[_0x1abf('0x3d')]({},_0x25a19e,_0x2db535[_0x1abf('0x3e')]);var _0x20f41f={'where':_0x25a19e['where']};return db['ScreenRecording'][_0x1abf('0x1c')](_0x20f41f)[_0x1abf('0x22')](function(_0x119955){_0x4d2a6f[_0x1abf('0x1c')]=_0x119955;if(_0x2db535['query'][_0x1abf('0x3f')]){_0x25a19e[_0x1abf('0x40')]=[{'all':!![]}];}return db[_0x1abf('0x29')][_0x1abf('0x41')](_0x25a19e);})[_0x1abf('0x22')](function(_0x3d4e89){_0x4d2a6f[_0x1abf('0x42')]=_0x3d4e89;return _0x4d2a6f;})[_0x1abf('0x22')](respondWithFilteredResult(_0xfa91c8,_0x25a19e))[_0x1abf('0x43')](handleError(_0xfa91c8,null));};exports[_0x1abf('0x44')]=function(_0xaaae1e,_0x35d86f){var _0x4f623b={'raw':![],'where':{'id':_0xaaae1e['params']['id']}},_0x28d7d6={};_0x28d7d6[_0x1abf('0x2e')]=_[_0x1abf('0x31')](db[_0x1abf('0x29')][_0x1abf('0x2a')]);_0x28d7d6['query']=_[_0x1abf('0x31')](_0xaaae1e[_0x1abf('0x30')]);_0x28d7d6[_0x1abf('0x32')]=_[_0x1abf('0x33')](_0x28d7d6[_0x1abf('0x2e')],_0x28d7d6[_0x1abf('0x30')]);_0x4f623b[_0x1abf('0x34')]=_[_0x1abf('0x33')](_0x28d7d6['model'],qs[_0x1abf('0x35')](_0xaaae1e[_0x1abf('0x30')][_0x1abf('0x35')]));_0x4f623b[_0x1abf('0x34')]=_0x4f623b[_0x1abf('0x34')]['length']?_0x4f623b[_0x1abf('0x34')]:_0x28d7d6[_0x1abf('0x2e')];if(_0xaaae1e[_0x1abf('0x30')][_0x1abf('0x3f')]){_0x4f623b[_0x1abf('0x40')]=[{'all':!![]}];}_0x4f623b=_[_0x1abf('0x3d')]({},_0x4f623b,_0xaaae1e[_0x1abf('0x3e')]);return db[_0x1abf('0x29')][_0x1abf('0x45')](_0x4f623b)[_0x1abf('0x22')](handleEntityNotFound(_0x35d86f,null))[_0x1abf('0x22')](respondWithResult(_0x35d86f,null))[_0x1abf('0x43')](handleError(_0x35d86f,null));};exports[_0x1abf('0x46')]=function(_0xed6821,_0x14856a){return db['ScreenRecording']['create'](_0xed6821[_0x1abf('0x47')],{})[_0x1abf('0x22')](respondWithResult(_0x14856a,0xc9))[_0x1abf('0x43')](handleError(_0x14856a,null));};exports[_0x1abf('0x48')]=function(_0x1f4646,_0x539f9b){if(_0x1f4646[_0x1abf('0x47')]['id']){delete _0x1f4646[_0x1abf('0x47')]['id'];}delete _0x1f4646[_0x1abf('0x47')]['duration'];delete _0x1f4646['body'][_0x1abf('0x49')];delete _0x1f4646['body'][_0x1abf('0x4a')];delete _0x1f4646[_0x1abf('0x47')]['value'];return db['ScreenRecording'][_0x1abf('0x45')]({'where':{'id':_0x1f4646[_0x1abf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x539f9b,null))[_0x1abf('0x22')](saveUpdates(_0x1f4646[_0x1abf('0x47')],null))['then'](respondWithResult(_0x539f9b,null))[_0x1abf('0x43')](handleError(_0x539f9b,null));};exports[_0x1abf('0x4c')]=function(_0x3e3523,_0x4c76fe){return db[_0x1abf('0x29')]['describe']()['then'](respondWithResult(_0x4c76fe,null))['catch'](handleError(_0x4c76fe,null));};exports[_0x1abf('0x4d')]=function(_0x353733,_0x5730e5,_0x453182){var _0x5b66e5=require('../../components/encryptor');var _0x554e19=![];var _0x2a258c={};if(_0x353733[_0x1abf('0x30')]['type']&&_0x353733[_0x1abf('0x30')]['type']===_0x1abf('0x4e')){_0x2a258c[_0x1abf('0x4e')]=_0x353733[_0x1abf('0x4b')]['id'];}else{_0x2a258c['id']=_0x353733[_0x1abf('0x4b')]['id'];}return db[_0x1abf('0x29')][_0x1abf('0x45')]({'where':_0x2a258c,'attributes':['id',_0x1abf('0x4f')],'raw':!![]})[_0x1abf('0x22')](handleEntityNotFound(_0x5730e5,null))[_0x1abf('0x22')](function(_0xd8f826){if(_0xd8f826){var _0x309aa9=path[_0x1abf('0x50')](config[_0x1abf('0x51')],_0x1abf('0x52'),_0xd8f826[_0x1abf('0x4f')]);var _0x3ffd6d=util[_0x1abf('0x2f')]('%s.cypher',_0x309aa9);if(fs['existsSync'](_0x3ffd6d)){_0x554e19=!![];return _0x5b66e5[_0x1abf('0x53')](_0x3ffd6d,_0x309aa9,config[_0x1abf('0x54')][_0x1abf('0x55')])[_0x1abf('0x22')](function(){return _0xd8f826;});}return _0xd8f826;}})[_0x1abf('0x22')](function(_0x2eea51){if(_0x2eea51){var _0x523966=path[_0x1abf('0x50')](config[_0x1abf('0x51')],_0x1abf('0x52'),_0x2eea51[_0x1abf('0x4f')]);if(!fs[_0x1abf('0x56')](_0x523966)){throw new db[(_0x1abf('0x57'))][(_0x1abf('0x58'))](_0x1abf('0x59'));}if(_0x2eea51[_0x1abf('0x5a')]){return _0x5730e5[_0x1abf('0x4d')](_0x523966,_0x2eea51['filename']+path[_0x1abf('0x5b')](_0x523966),function(){if(_0x554e19){fs[_0x1abf('0x5c')](_0x523966);}});}else{return _0x5730e5[_0x1abf('0x4d')](_0x523966,function(_0x273aca){if(_0x554e19){fs[_0x1abf('0x5c')](_0x523966);}});}}})[_0x1abf('0x43')](function(_0x5b57b2){if(_0x5b57b2[_0x1abf('0x5d')]===_0x1abf('0x59')){_0x5730e5[_0x1abf('0x1a')](0x194)[_0x1abf('0x26')]('Not\x20found');}else{return handleError(_0x5730e5,null);}});};exports['destroy']=function(_0x3e5366,_0x4f054d){return db[_0x1abf('0x29')][_0x1abf('0x45')]({'where':{'id':_0x3e5366[_0x1abf('0x4b')]['id']}})[_0x1abf('0x22')](function(_0x36eacb){if(!_0x36eacb)throw new ReferenceError(_0x1abf('0x5e'));return _0x36eacb;})['then'](function(_0x337be8){var _0xca1d23=path[_0x1abf('0x50')](config[_0x1abf('0x51')],_0x1abf('0x52'),_0x337be8[_0x1abf('0x4f')]);logger[_0x1abf('0x5f')](_0x1abf('0x60'),_0xca1d23);if(!_[_0x1abf('0x61')](_0x337be8[_0x1abf('0x4f')])&&fs['existsSync'](_0xca1d23)){logger[_0x1abf('0x5f')]('File:\x20\x22'+_0xca1d23+_0x1abf('0x62'));fs[_0x1abf('0x63')](_0xca1d23);}_0xca1d23=_0xca1d23+'.cypher';if(!_[_0x1abf('0x61')](_0x337be8[_0x1abf('0x4f')])&&fs[_0x1abf('0x56')](_0xca1d23)){logger[_0x1abf('0x5f')](_0x1abf('0x64')+_0xca1d23+_0x1abf('0x62'));fs[_0x1abf('0x63')](_0xca1d23);}return _0x337be8;})[_0x1abf('0x22')](function(_0xb3b579){if(!_0xb3b579)throw new InternalError();return _0xb3b579[_0x1abf('0x65')]();})[_0x1abf('0x22')](function(){_0x4f054d[_0x1abf('0x1a')](0xcc)[_0x1abf('0x1b')]();})['catch'](handleError(_0x4f054d,null));};
\ No newline at end of file