Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index a5f78b9..39a913e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x336f=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','create','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','sendStatus','stack','name','render','merge','body','contact','agent','interaction','account','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','format','query','keys','filters','intersection','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x336f,0x176));var _0xf336=function(_0x4ee80d,_0x28a619){_0x4ee80d=_0x4ee80d-0x0;var _0x183cda=_0x336f[_0x4ee80d];return _0x183cda;};'use strict';var emlformat=require(_0xf336('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf336('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf336('0x2'));var Mustache=require(_0xf336('0x3'));var util=require(_0xf336('0x4'));var path=require('path');var sox=require(_0xf336('0x5'));var csv=require('to-csv');var ejs=require(_0xf336('0x6'));var fs=require('fs');var fs_extra=require(_0xf336('0x7'));var _=require(_0xf336('0x8'));var squel=require(_0xf336('0x9'));var crypto=require('crypto');var jsforce=require(_0xf336('0xa'));var deskjs=require(_0xf336('0xb'));var toCsv=require(_0xf336('0xc'));var querystring=require(_0xf336('0xd'));var Papa=require('papaparse');var Redis=require(_0xf336('0xe'));var authService=require(_0xf336('0xf'));var qs=require(_0xf336('0x10'));var as=require(_0xf336('0x11'));var hardwareService=require(_0xf336('0x12'));var logger=require(_0xf336('0x13'))(_0xf336('0x14'));var utils=require(_0xf336('0x15'));var config=require(_0xf336('0x16'));var licenseUtil=require(_0xf336('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259629,_0xbdee9c){_0xbdee9c=_0xbdee9c||0xcc;return function(_0x5bc89b){if(_0x5bc89b){return _0x259629['sendStatus'](_0xbdee9c);}return _0x259629[_0xf336('0x18')](_0xbdee9c)[_0xf336('0x19')]();};}function respondWithResult(_0xabaa74,_0x4dcac2){_0x4dcac2=_0x4dcac2||0xc8;return function(_0x1790f0){if(_0x1790f0){return _0xabaa74[_0xf336('0x18')](_0x4dcac2)[_0xf336('0x1a')](_0x1790f0);}};}function respondWithFilteredResult(_0x5b9223,_0x56b4a1){return function(_0x12d28e){if(_0x12d28e){var _0x446ff9=typeof _0x56b4a1[_0xf336('0x1b')]===_0xf336('0x1c')&&typeof _0x56b4a1[_0xf336('0x1d')]===_0xf336('0x1c');var _0x22a25e=_0x12d28e[_0xf336('0x1e')];var _0x258a0e=_0x446ff9?0x0:_0x56b4a1['offset'];var _0x5dee3e=_0x446ff9?_0x12d28e['count']:_0x56b4a1[_0xf336('0x1b')]+_0x56b4a1[_0xf336('0x1d')];var _0x120989;if(_0x5dee3e>=_0x22a25e){_0x5dee3e=_0x22a25e;_0x120989=0xc8;}else{_0x120989=0xce;}_0x5b9223['status'](_0x120989);return _0x5b9223['set']('Content-Range',_0x258a0e+'-'+_0x5dee3e+'/'+_0x22a25e)[_0xf336('0x1a')](_0x12d28e);}return null;};}function patchUpdates(_0x4e5ac0){return function(_0x353b8a){try{jsonpatch[_0xf336('0x1f')](_0x353b8a,_0x4e5ac0,!![]);}catch(_0x11e4ad){return BPromise['reject'](_0x11e4ad);}return _0x353b8a['save']();};}function saveUpdates(_0xfde7c5,_0x2c3a94){return function(_0x574fa7){if(_0x574fa7){return _0x574fa7[_0xf336('0x20')](_0xfde7c5)[_0xf336('0x21')](function(_0x719ebb){return _0x719ebb;});}return null;};}function removeEntity(_0x129d03,_0x14652a){return function(_0x308fb6){if(_0x308fb6){return _0x308fb6[_0xf336('0x22')]()['then'](function(){_0x129d03[_0xf336('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49329d,_0x217744){return function(_0x443bc8){if(!_0x443bc8){_0x49329d[_0xf336('0x23')](0x194);}return _0x443bc8;};}function handleError(_0x4b7d11,_0x1d1257){_0x1d1257=_0x1d1257||0x1f4;return function(_0x3a1119){logger['error'](_0x3a1119[_0xf336('0x24')]);if(_0x3a1119[_0xf336('0x25')]){delete _0x3a1119['name'];}_0x4b7d11[_0xf336('0x18')](_0x1d1257)['send'](_0x3a1119);};}function getMustacheRender(_0x22afc0,_0x488929){return Mustache[_0xf336('0x26')](_0x22afc0,_[_0xf336('0x27')](_0x488929[_0xf336('0x28')],{'contact':_0x488929[_0xf336('0x29')],'message':_0x488929['message'],'agent':_0x488929[_0xf336('0x2a')],'interaction':_0x488929[_0xf336('0x2b')],'account':_0x488929[_0xf336('0x2c')]}))||'';}exports[_0xf336('0x2d')]=function(_0x5496e1,_0x49b79f){var _0x1d78cb={},_0x5cda3c={},_0x4f2888={'count':0x0,'rows':[]};var _0x3ac9fb=_[_0xf336('0x2e')](db[_0xf336('0x2f')][_0xf336('0x30')],function(_0x5abd57){return{'name':_0x5abd57[_0xf336('0x31')],'type':_0x5abd57['type']['key']};});_0x5cda3c[_0xf336('0x32')]=_[_0xf336('0x33')](_[_0xf336('0x2e')](_0x3ac9fb,'name'),[_0xf336('0x34')]);_0x5cda3c[_0xf336('0x35')]=_[_0xf336('0x36')](_0x5496e1[_0xf336('0x35')]);_0x5cda3c[_0xf336('0x37')]=_[_0xf336('0x38')](_0x5cda3c[_0xf336('0x32')],_0x5cda3c[_0xf336('0x35')]);_0x1d78cb['attributes']=_['intersection'](_0x5cda3c[_0xf336('0x32')],qs['fields'](_0x5496e1['query'][_0xf336('0x39')]));_0x1d78cb[_0xf336('0x3a')]=_0x1d78cb[_0xf336('0x3a')][_0xf336('0x3b')]?_0x1d78cb['attributes']:_0x5cda3c[_0xf336('0x32')];if(!_0x5496e1['query'][_0xf336('0x3c')](_0xf336('0x3d'))){_0x1d78cb[_0xf336('0x1d')]=qs['limit'](_0x5496e1[_0xf336('0x35')]['limit']);_0x1d78cb[_0xf336('0x1b')]=qs[_0xf336('0x1b')](_0x5496e1[_0xf336('0x35')][_0xf336('0x1b')]);}_0x1d78cb[_0xf336('0x3e')]=qs[_0xf336('0x3f')](_0x5496e1[_0xf336('0x35')][_0xf336('0x3f')]);_0x1d78cb[_0xf336('0x40')]=qs[_0xf336('0x37')](_[_0xf336('0x41')](_0x5496e1[_0xf336('0x35')],_0x5cda3c['filters']),_0x3ac9fb);if(_0x5496e1['query'][_0xf336('0x42')]){_0x1d78cb['where']=_[_0xf336('0x27')](_0x1d78cb[_0xf336('0x40')],{'$or':_[_0xf336('0x2e')](_0x3ac9fb,function(_0x4db491){if(_0x4db491[_0xf336('0x43')]!==_0xf336('0x44')){var _0x3bca39={};_0x3bca39[_0x4db491['name']]={'$like':'%'+_0x5496e1[_0xf336('0x35')]['filter']+'%'};return _0x3bca39;}})});}_0x1d78cb=_[_0xf336('0x27')]({},_0x1d78cb,_0x5496e1['options']);var _0x547771={'where':_0x1d78cb[_0xf336('0x40')]};return db[_0xf336('0x2f')][_0xf336('0x1e')](_0x547771)[_0xf336('0x21')](function(_0x33ef66){_0x4f2888[_0xf336('0x1e')]=_0x33ef66;if(_0x5496e1[_0xf336('0x35')][_0xf336('0x45')]){_0x1d78cb[_0xf336('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xf336('0x47')](_0x1d78cb);})['then'](function(_0x59213e){_0x4f2888[_0xf336('0x48')]=_0x59213e;return _0x4f2888;})[_0xf336('0x21')](respondWithFilteredResult(_0x49b79f,_0x1d78cb))['catch'](handleError(_0x49b79f,null));};exports[_0xf336('0x49')]=function(_0x4ec45d,_0x5b9c9b){var _0x200877={'raw':![],'where':{'id':_0x4ec45d['params']['id']}},_0x50632c={};_0x50632c[_0xf336('0x32')]=_[_0xf336('0x36')](db[_0xf336('0x2f')][_0xf336('0x30')]);_0x50632c[_0xf336('0x35')]=_[_0xf336('0x36')](_0x4ec45d[_0xf336('0x35')]);_0x50632c[_0xf336('0x37')]=_['intersection'](_0x50632c[_0xf336('0x32')],_0x50632c[_0xf336('0x35')]);_0x200877[_0xf336('0x3a')]=_['intersection'](_0x50632c[_0xf336('0x32')],qs[_0xf336('0x39')](_0x4ec45d[_0xf336('0x35')]['fields']));_0x200877[_0xf336('0x3a')]=_0x200877[_0xf336('0x3a')]['length']?_0x200877[_0xf336('0x3a')]:_0x50632c[_0xf336('0x32')];if(_0x4ec45d[_0xf336('0x35')][_0xf336('0x45')]){_0x200877[_0xf336('0x46')]=[{'all':!![]}];}_0x200877=_[_0xf336('0x27')]({},_0x200877,_0x4ec45d[_0xf336('0x4a')]);return db[_0xf336('0x2f')][_0xf336('0x4b')](_0x200877)[_0xf336('0x21')](handleEntityNotFound(_0x5b9c9b,null))[_0xf336('0x21')](respondWithResult(_0x5b9c9b,null))[_0xf336('0x4c')](handleError(_0x5b9c9b,null));};exports[_0xf336('0x4d')]=function(_0x22fca4,_0x2d69b0){return db[_0xf336('0x2f')]['create'](_0x22fca4['body'],{})['then'](respondWithResult(_0x2d69b0,0xc9))['catch'](handleError(_0x2d69b0,null));};exports[_0xf336('0x20')]=function(_0x20c54e,_0x3f42bb){if(_0x20c54e[_0xf336('0x28')]['id']){delete _0x20c54e[_0xf336('0x28')]['id'];}delete _0x20c54e['body'][_0xf336('0x4e')];delete _0x20c54e[_0xf336('0x28')][_0xf336('0x4f')];delete _0x20c54e['body']['closedAt'];delete _0x20c54e['body'][_0xf336('0x50')];return db['ScreenRecording'][_0xf336('0x4b')]({'where':{'id':_0x20c54e[_0xf336('0x51')]['id']}})[_0xf336('0x21')](handleEntityNotFound(_0x3f42bb,null))[_0xf336('0x21')](saveUpdates(_0x20c54e['body'],null))[_0xf336('0x21')](respondWithResult(_0x3f42bb,null))[_0xf336('0x4c')](handleError(_0x3f42bb,null));};exports[_0xf336('0x52')]=function(_0xf0c435,_0x332a83){return db[_0xf336('0x2f')][_0xf336('0x52')]()[_0xf336('0x21')](respondWithResult(_0x332a83,null))['catch'](handleError(_0x332a83,null));};exports[_0xf336('0x53')]=function(_0x1f0682,_0x12de1a,_0x3c84df){var _0x31476b=require(_0xf336('0x54'));var _0x2dc4d0=![];var _0x8dd133={};if(_0x1f0682[_0xf336('0x35')][_0xf336('0x43')]&&_0x1f0682[_0xf336('0x35')][_0xf336('0x43')]===_0xf336('0x55')){_0x8dd133[_0xf336('0x55')]=_0x1f0682[_0xf336('0x51')]['id'];}else{_0x8dd133['id']=_0x1f0682[_0xf336('0x51')]['id'];}return db[_0xf336('0x2f')][_0xf336('0x4b')]({'where':_0x8dd133,'attributes':['id','value'],'raw':!![]})[_0xf336('0x21')](handleEntityNotFound(_0x12de1a,null))[_0xf336('0x21')](function(_0xb7af66){if(_0xb7af66){var _0x545ea4=path[_0xf336('0x56')](config[_0xf336('0x57')],'server/files/screen_recordings',_0xb7af66['value']);var _0x15c1e3=util[_0xf336('0x34')](_0xf336('0x58'),_0x545ea4);if(fs[_0xf336('0x59')](_0x15c1e3)){_0x2dc4d0=!![];return _0x31476b[_0xf336('0x5a')](_0x15c1e3,_0x545ea4,config[_0xf336('0x5b')][_0xf336('0x5c')])[_0xf336('0x21')](function(){return _0xb7af66;});}return _0xb7af66;}})[_0xf336('0x21')](function(_0x4711f8){if(_0x4711f8){var _0xa16722=path[_0xf336('0x56')](config[_0xf336('0x57')],'server/files/screen_recordings',_0x4711f8[_0xf336('0x50')]);if(!fs[_0xf336('0x59')](_0xa16722)){throw new db[(_0xf336('0x5d'))][(_0xf336('0x5e'))](_0xf336('0x5f'));}if(_0x4711f8[_0xf336('0x60')]){return _0x12de1a['download'](_0xa16722,_0x4711f8[_0xf336('0x60')]+path[_0xf336('0x61')](_0xa16722),function(){if(_0x2dc4d0){fs['unlink'](_0xa16722);}});}else{return _0x12de1a['download'](_0xa16722,function(_0x594041){if(_0x2dc4d0){fs[_0xf336('0x62')](_0xa16722);}});}}})[_0xf336('0x4c')](function(_0x546344){if(_0x546344[_0xf336('0x63')]===_0xf336('0x5f')){_0x12de1a[_0xf336('0x18')](0x194)[_0xf336('0x64')](_0xf336('0x65'));}else{return handleError(_0x12de1a,null);}});};exports[_0xf336('0x22')]=function(_0x20a776,_0x29cb1e){return db[_0xf336('0x2f')][_0xf336('0x4b')]({'where':{'id':_0x20a776['params']['id']}})[_0xf336('0x21')](function(_0x4d8a2b){if(_[_0xf336('0x66')](_0x4d8a2b)){throw new ReferenceError(_0xf336('0x67'));}return _0x4d8a2b;})['then'](function(_0x5369ae){var _0x56dcc5=path[_0xf336('0x56')](config['root'],'server/files/screen_recordings',_0x5369ae[_0xf336('0x50')]);logger[_0xf336('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x56dcc5);if(!_[_0xf336('0x66')](_0x5369ae[_0xf336('0x50')])&&fs[_0xf336('0x59')](_0x56dcc5)){logger[_0xf336('0x68')]('File:\x20\x22'+_0x56dcc5+_0xf336('0x69'));fs[_0xf336('0x6a')](_0x56dcc5);}_0x56dcc5=_0x56dcc5+_0xf336('0x6b');if(!_[_0xf336('0x66')](_0x5369ae[_0xf336('0x50')])&&fs[_0xf336('0x59')](_0x56dcc5)){logger[_0xf336('0x68')]('File:\x20\x22'+_0x56dcc5+_0xf336('0x69'));fs[_0xf336('0x6a')](_0x56dcc5);}return _0x5369ae;})[_0xf336('0x21')](function(_0x400f6d){if(!_0x400f6d)throw new InternalError();return _0x400f6d[_0xf336('0x22')]();})[_0xf336('0x21')](function(){_0x29cb1e['status'](0xcc)[_0xf336('0x19')]();})[_0xf336('0x4c')](handleError(_0x29cb1e,null));};
\ No newline at end of file
+var _0xb551=['render','merge','body','contact','agent','interaction','ScreenRecording','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','VIRTUAL','options','include','show','params','rawAttributes','length','includeAll','find','catch','create','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','server/files/screen_recordings','%s.cypher','recording','join','root','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x5ee1c1,_0x4cd5e3){var _0x1fdc7d=function(_0x1298eb){while(--_0x1298eb){_0x5ee1c1['push'](_0x5ee1c1['shift']());}};_0x1fdc7d(++_0x4cd5e3);}(_0xb551,0x171));var _0x1b55=function(_0x1f8f9d,_0x3913f4){_0x1f8f9d=_0x1f8f9d-0x0;var _0x5e9e3b=_0xb551[_0x1f8f9d];return _0x5e9e3b;};'use strict';var emlformat=require(_0x1b55('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b55('0x1'));var moment=require(_0x1b55('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1b55('0x3'));var util=require('util');var path=require(_0x1b55('0x4'));var sox=require(_0x1b55('0x5'));var csv=require('to-csv');var ejs=require(_0x1b55('0x6'));var fs=require('fs');var fs_extra=require(_0x1b55('0x7'));var _=require('lodash');var squel=require(_0x1b55('0x8'));var crypto=require(_0x1b55('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1b55('0xa'));var toCsv=require(_0x1b55('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b55('0xc'));var qs=require(_0x1b55('0xd'));var as=require(_0x1b55('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b55('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x1b55('0x10'));var licenseUtil=require(_0x1b55('0x11'));var db=require(_0x1b55('0x12'))['db'];function respondWithStatusCode(_0x45d03d,_0x1c3408){_0x1c3408=_0x1c3408||0xcc;return function(_0x4932f3){if(_0x4932f3){return _0x45d03d[_0x1b55('0x13')](_0x1c3408);}return _0x45d03d[_0x1b55('0x14')](_0x1c3408)[_0x1b55('0x15')]();};}function respondWithResult(_0x15f723,_0x3ab7be){_0x3ab7be=_0x3ab7be||0xc8;return function(_0x4df274){if(_0x4df274){return _0x15f723[_0x1b55('0x14')](_0x3ab7be)['json'](_0x4df274);}};}function respondWithFilteredResult(_0x4eddc9,_0x569c9c){return function(_0x2df655){if(_0x2df655){var _0x3ba369=typeof _0x569c9c[_0x1b55('0x16')]==='undefined'&&typeof _0x569c9c[_0x1b55('0x17')]===_0x1b55('0x18');var _0x101708=_0x2df655[_0x1b55('0x19')];var _0xed1726=_0x3ba369?0x0:_0x569c9c[_0x1b55('0x16')];var _0x171f4b=_0x3ba369?_0x2df655[_0x1b55('0x19')]:_0x569c9c[_0x1b55('0x16')]+_0x569c9c[_0x1b55('0x17')];var _0x5004ca;if(_0x171f4b>=_0x101708){_0x171f4b=_0x101708;_0x5004ca=0xc8;}else{_0x5004ca=0xce;}_0x4eddc9[_0x1b55('0x14')](_0x5004ca);return _0x4eddc9[_0x1b55('0x1a')](_0x1b55('0x1b'),_0xed1726+'-'+_0x171f4b+'/'+_0x101708)[_0x1b55('0x1c')](_0x2df655);}return null;};}function patchUpdates(_0x9d49c6){return function(_0x4d6852){try{jsonpatch[_0x1b55('0x1d')](_0x4d6852,_0x9d49c6,!![]);}catch(_0x3826a3){return BPromise[_0x1b55('0x1e')](_0x3826a3);}return _0x4d6852[_0x1b55('0x1f')]();};}function saveUpdates(_0x1c2318,_0x309b1d){return function(_0x30856a){if(_0x30856a){return _0x30856a[_0x1b55('0x20')](_0x1c2318)[_0x1b55('0x21')](function(_0x3b4949){return _0x3b4949;});}return null;};}function removeEntity(_0x46126b,_0x447309){return function(_0x14f199){if(_0x14f199){return _0x14f199[_0x1b55('0x22')]()['then'](function(){_0x46126b[_0x1b55('0x14')](0xcc)[_0x1b55('0x15')]();});}};}function handleEntityNotFound(_0x5c5806,_0x2b60c5){return function(_0x1fda18){if(!_0x1fda18){_0x5c5806[_0x1b55('0x13')](0x194);}return _0x1fda18;};}function handleError(_0x58cac8,_0x9db73b){_0x9db73b=_0x9db73b||0x1f4;return function(_0x52793b){logger[_0x1b55('0x23')](_0x52793b[_0x1b55('0x24')]);if(_0x52793b[_0x1b55('0x25')]){delete _0x52793b[_0x1b55('0x25')];}_0x58cac8[_0x1b55('0x14')](_0x9db73b)[_0x1b55('0x26')](_0x52793b);};}function getMustacheRender(_0x29f4a2,_0x57d5e7){return Mustache[_0x1b55('0x27')](_0x29f4a2,_[_0x1b55('0x28')](_0x57d5e7[_0x1b55('0x29')],{'contact':_0x57d5e7[_0x1b55('0x2a')],'message':_0x57d5e7['message'],'agent':_0x57d5e7[_0x1b55('0x2b')],'interaction':_0x57d5e7[_0x1b55('0x2c')],'account':_0x57d5e7['account']}))||'';}exports['index']=function(_0x4ccdaa,_0x485e84){var _0x5a359d={},_0x5306be={},_0x2a647a={'count':0x0,'rows':[]};var _0x15575e=_['map'](db[_0x1b55('0x2d')]['rawAttributes'],function(_0xc780af){return{'name':_0xc780af[_0x1b55('0x2e')],'type':_0xc780af[_0x1b55('0x2f')][_0x1b55('0x30')]};});_0x5306be[_0x1b55('0x31')]=_['differenceBy'](_[_0x1b55('0x32')](_0x15575e,'name'),['format']);_0x5306be[_0x1b55('0x33')]=_[_0x1b55('0x34')](_0x4ccdaa[_0x1b55('0x33')]);_0x5306be[_0x1b55('0x35')]=_[_0x1b55('0x36')](_0x5306be[_0x1b55('0x31')],_0x5306be['query']);_0x5a359d['attributes']=_[_0x1b55('0x36')](_0x5306be[_0x1b55('0x31')],qs[_0x1b55('0x37')](_0x4ccdaa[_0x1b55('0x33')][_0x1b55('0x37')]));_0x5a359d[_0x1b55('0x38')]=_0x5a359d[_0x1b55('0x38')]['length']?_0x5a359d[_0x1b55('0x38')]:_0x5306be[_0x1b55('0x31')];if(!_0x4ccdaa[_0x1b55('0x33')]['hasOwnProperty'](_0x1b55('0x39'))){_0x5a359d['limit']=qs[_0x1b55('0x17')](_0x4ccdaa['query'][_0x1b55('0x17')]);_0x5a359d[_0x1b55('0x16')]=qs[_0x1b55('0x16')](_0x4ccdaa[_0x1b55('0x33')]['offset']);}_0x5a359d[_0x1b55('0x3a')]=qs[_0x1b55('0x3b')](_0x4ccdaa[_0x1b55('0x33')]['sort']);_0x5a359d['where']=qs[_0x1b55('0x35')](_['pick'](_0x4ccdaa[_0x1b55('0x33')],_0x5306be[_0x1b55('0x35')]),_0x15575e);if(_0x4ccdaa[_0x1b55('0x33')][_0x1b55('0x3c')]){_0x5a359d[_0x1b55('0x3d')]=_[_0x1b55('0x28')](_0x5a359d[_0x1b55('0x3d')],{'$or':_[_0x1b55('0x32')](_0x15575e,function(_0x553889){if(_0x553889[_0x1b55('0x2f')]!==_0x1b55('0x3e')){var _0x31e88d={};_0x31e88d[_0x553889[_0x1b55('0x25')]]={'$like':'%'+_0x4ccdaa[_0x1b55('0x33')][_0x1b55('0x3c')]+'%'};return _0x31e88d;}})});}_0x5a359d=_[_0x1b55('0x28')]({},_0x5a359d,_0x4ccdaa[_0x1b55('0x3f')]);var _0x209527={'where':_0x5a359d[_0x1b55('0x3d')]};return db[_0x1b55('0x2d')][_0x1b55('0x19')](_0x209527)[_0x1b55('0x21')](function(_0x105469){_0x2a647a['count']=_0x105469;if(_0x4ccdaa[_0x1b55('0x33')]['includeAll']){_0x5a359d[_0x1b55('0x40')]=[{'all':!![]}];}return db[_0x1b55('0x2d')]['findAll'](_0x5a359d);})[_0x1b55('0x21')](function(_0x51c9ac){_0x2a647a['rows']=_0x51c9ac;return _0x2a647a;})[_0x1b55('0x21')](respondWithFilteredResult(_0x485e84,_0x5a359d))['catch'](handleError(_0x485e84,null));};exports[_0x1b55('0x41')]=function(_0x30e12a,_0x2ac723){var _0x224c5a={'raw':![],'where':{'id':_0x30e12a[_0x1b55('0x42')]['id']}},_0x120d92={};_0x120d92[_0x1b55('0x31')]=_['keys'](db[_0x1b55('0x2d')][_0x1b55('0x43')]);_0x120d92[_0x1b55('0x33')]=_[_0x1b55('0x34')](_0x30e12a[_0x1b55('0x33')]);_0x120d92[_0x1b55('0x35')]=_[_0x1b55('0x36')](_0x120d92[_0x1b55('0x31')],_0x120d92[_0x1b55('0x33')]);_0x224c5a[_0x1b55('0x38')]=_[_0x1b55('0x36')](_0x120d92[_0x1b55('0x31')],qs['fields'](_0x30e12a[_0x1b55('0x33')][_0x1b55('0x37')]));_0x224c5a[_0x1b55('0x38')]=_0x224c5a[_0x1b55('0x38')][_0x1b55('0x44')]?_0x224c5a[_0x1b55('0x38')]:_0x120d92['model'];if(_0x30e12a[_0x1b55('0x33')][_0x1b55('0x45')]){_0x224c5a[_0x1b55('0x40')]=[{'all':!![]}];}_0x224c5a=_[_0x1b55('0x28')]({},_0x224c5a,_0x30e12a[_0x1b55('0x3f')]);return db['ScreenRecording'][_0x1b55('0x46')](_0x224c5a)['then'](handleEntityNotFound(_0x2ac723,null))['then'](respondWithResult(_0x2ac723,null))[_0x1b55('0x47')](handleError(_0x2ac723,null));};exports[_0x1b55('0x48')]=function(_0x230fb6,_0x3f6422){return db['ScreenRecording'][_0x1b55('0x48')](_0x230fb6[_0x1b55('0x29')],{})[_0x1b55('0x21')](respondWithResult(_0x3f6422,0xc9))[_0x1b55('0x47')](handleError(_0x3f6422,null));};exports['update']=function(_0x3b468e,_0x269b6b){if(_0x3b468e[_0x1b55('0x29')]['id']){delete _0x3b468e[_0x1b55('0x29')]['id'];}delete _0x3b468e[_0x1b55('0x29')][_0x1b55('0x49')];delete _0x3b468e[_0x1b55('0x29')][_0x1b55('0x4a')];delete _0x3b468e[_0x1b55('0x29')]['closedAt'];delete _0x3b468e[_0x1b55('0x29')][_0x1b55('0x4b')];return db['ScreenRecording'][_0x1b55('0x46')]({'where':{'id':_0x3b468e['params']['id']}})[_0x1b55('0x21')](handleEntityNotFound(_0x269b6b,null))['then'](saveUpdates(_0x3b468e['body'],null))[_0x1b55('0x21')](respondWithResult(_0x269b6b,null))[_0x1b55('0x47')](handleError(_0x269b6b,null));};exports[_0x1b55('0x4c')]=function(_0x3ee978,_0x30f9a4){return db[_0x1b55('0x2d')][_0x1b55('0x4c')]()['then'](respondWithResult(_0x30f9a4,null))[_0x1b55('0x47')](handleError(_0x30f9a4,null));};exports[_0x1b55('0x4d')]=function(_0x22535a,_0xa50c22,_0x59d489){var _0x21ef31=require(_0x1b55('0x4e'));var _0x505765=![];var _0x693307={};if(_0x22535a[_0x1b55('0x33')][_0x1b55('0x2f')]&&_0x22535a['query'][_0x1b55('0x2f')]==='uniqueid'){_0x693307[_0x1b55('0x4f')]=_0x22535a['params']['id'];}else{_0x693307['id']=_0x22535a[_0x1b55('0x42')]['id'];}return db['ScreenRecording']['find']({'where':_0x693307,'attributes':['id','value'],'raw':!![]})[_0x1b55('0x21')](handleEntityNotFound(_0xa50c22,null))[_0x1b55('0x21')](function(_0xb5c3bb){if(_0xb5c3bb){var _0x2e5ed3=path['join'](config['root'],_0x1b55('0x50'),_0xb5c3bb[_0x1b55('0x4b')]);var _0x21e7a8=util['format'](_0x1b55('0x51'),_0x2e5ed3);if(fs['existsSync'](_0x21e7a8)){_0x505765=!![];return _0x21ef31['decryptFile'](_0x21e7a8,_0x2e5ed3,config['secrets'][_0x1b55('0x52')])[_0x1b55('0x21')](function(){return _0xb5c3bb;});}return _0xb5c3bb;}})['then'](function(_0x5e2674){if(_0x5e2674){var _0x18eb83=path[_0x1b55('0x53')](config[_0x1b55('0x54')],_0x1b55('0x50'),_0x5e2674[_0x1b55('0x4b')]);if(!fs[_0x1b55('0x55')](_0x18eb83)){throw new db[(_0x1b55('0x56'))][(_0x1b55('0x57'))](_0x1b55('0x58'));}if(_0x5e2674[_0x1b55('0x59')]){return _0xa50c22[_0x1b55('0x4d')](_0x18eb83,_0x5e2674[_0x1b55('0x59')]+path[_0x1b55('0x5a')](_0x18eb83),function(){if(_0x505765){fs[_0x1b55('0x5b')](_0x18eb83);}});}else{return _0xa50c22[_0x1b55('0x4d')](_0x18eb83,function(_0x1d0274){if(_0x505765){fs[_0x1b55('0x5b')](_0x18eb83);}});}}})['catch'](function(_0x31ca10){if(_0x31ca10[_0x1b55('0x5c')]===_0x1b55('0x58')){_0xa50c22[_0x1b55('0x14')](0x194)[_0x1b55('0x26')](_0x1b55('0x5d'));}else{return handleError(_0xa50c22,null);}});};exports['destroy']=function(_0x411f8b,_0x2797d0){return db[_0x1b55('0x2d')][_0x1b55('0x46')]({'where':{'id':_0x411f8b[_0x1b55('0x42')]['id']}})['then'](function(_0x346b97){if(_[_0x1b55('0x5e')](_0x346b97)){throw new ReferenceError(_0x1b55('0x5f'));}return _0x346b97;})[_0x1b55('0x21')](function(_0x552ae1){var _0x9dbfee=path['join'](config[_0x1b55('0x54')],_0x1b55('0x50'),_0x552ae1[_0x1b55('0x4b')]);logger[_0x1b55('0x60')](_0x1b55('0x61'),_0x9dbfee);if(!_[_0x1b55('0x5e')](_0x552ae1['value'])&&fs[_0x1b55('0x55')](_0x9dbfee)){logger['info'](_0x1b55('0x62')+_0x9dbfee+_0x1b55('0x63'));fs[_0x1b55('0x64')](_0x9dbfee);}_0x9dbfee=_0x9dbfee+_0x1b55('0x65');if(!_['isNil'](_0x552ae1[_0x1b55('0x4b')])&&fs[_0x1b55('0x55')](_0x9dbfee)){logger[_0x1b55('0x60')]('File:\x20\x22'+_0x9dbfee+_0x1b55('0x63'));fs[_0x1b55('0x64')](_0x9dbfee);}return _0x552ae1;})[_0x1b55('0x21')](function(_0x3c7df0){if(!_0x3c7df0)throw new InternalError();return _0x3c7df0['destroy']();})[_0x1b55('0x21')](function(){_0x2797d0[_0x1b55('0x14')](0xcc)[_0x1b55('0x15')]();})['catch'](handleError(_0x2797d0,null));};
\ No newline at end of file