Built motion from commit 14588770.|2.5.38
[motion2.git] / server / api / screenRecording / screenRecording.controller.js
index 29ee2b6..cb6bf39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6636=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','update','then','destroy','error','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','include','findAll','rows','catch','rawAttributes','includeAll','options','find','create','body','duration','createdAt','value','describe','download','uniqueid','params','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0x6636,0x16b));var _0x6663=function(_0x15dcda,_0x5955cf){_0x15dcda=_0x15dcda-0x0;var _0xf3b24d=_0x6636[_0x15dcda];return _0xf3b24d;};'use strict';var pdf=require(_0x6663('0x0'));var emlformat=require(_0x6663('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6663('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6663('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6663('0x4'));var util=require(_0x6663('0x5'));var path=require(_0x6663('0x6'));var sox=require('sox');var csv=require(_0x6663('0x7'));var ejs=require(_0x6663('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6663('0x9'));var crypto=require(_0x6663('0xa'));var jsforce=require(_0x6663('0xb'));var deskjs=require(_0x6663('0xc'));var toCsv=require(_0x6663('0x7'));var querystring=require(_0x6663('0xd'));var Papa=require(_0x6663('0xe'));var Redis=require(_0x6663('0xf'));var authService=require(_0x6663('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6663('0x11'));var logger=require(_0x6663('0x12'))(_0x6663('0x13'));var utils=require(_0x6663('0x14'));var config=require(_0x6663('0x15'));var db=require(_0x6663('0x16'))['db'];function respondWithStatusCode(_0x28b83b,_0x286da0){_0x286da0=_0x286da0||0xcc;return function(_0x4e12c1){if(_0x4e12c1){return _0x28b83b['sendStatus'](_0x286da0);}return _0x28b83b[_0x6663('0x17')](_0x286da0)[_0x6663('0x18')]();};}function respondWithResult(_0x175587,_0x41043e){_0x41043e=_0x41043e||0xc8;return function(_0x25d4d6){if(_0x25d4d6){return _0x175587[_0x6663('0x17')](_0x41043e)[_0x6663('0x19')](_0x25d4d6);}};}function respondWithFilteredResult(_0x38b0fd,_0x44a2c4){return function(_0xe6ffb8){if(_0xe6ffb8){var _0x54940a=_0xe6ffb8['count'],_0x469e0e=_0x44a2c4[_0x6663('0x1a')],_0x4ed40e=_0x44a2c4[_0x6663('0x1a')]+_0x44a2c4[_0x6663('0x1b')],_0x3e6f89;if(_0x4ed40e>=_0x54940a){_0x4ed40e=_0x54940a;_0x3e6f89=0xc8;}else{_0x3e6f89=0xce;}_0x38b0fd[_0x6663('0x17')](_0x3e6f89);return _0x38b0fd[_0x6663('0x1c')]('Content-Range',_0x469e0e+'-'+_0x4ed40e+'/'+_0x54940a)[_0x6663('0x19')](_0xe6ffb8);}return null;};}function patchUpdates(_0x4455ce){return function(_0x26748c){try{jsonpatch[_0x6663('0x1d')](_0x26748c,_0x4455ce,!![]);}catch(_0x2fb90d){return BPromise[_0x6663('0x1e')](_0x2fb90d);}return _0x26748c['save']();};}function saveUpdates(_0xb3acc2,_0x26b1eb){return function(_0x26602e){if(_0x26602e){return _0x26602e[_0x6663('0x1f')](_0xb3acc2)[_0x6663('0x20')](function(_0x4e643b){return _0x4e643b;});}return null;};}function removeEntity(_0x4cdd50,_0xbff695){return function(_0x4aa857){if(_0x4aa857){return _0x4aa857[_0x6663('0x21')]()[_0x6663('0x20')](function(){_0x4cdd50[_0x6663('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3396fa,_0x1642d5){return function(_0x1093a5){if(!_0x1093a5){_0x3396fa['sendStatus'](0x194);}return _0x1093a5;};}function handleError(_0x37a89e,_0x4564f2){_0x4564f2=_0x4564f2||0x1f4;return function(_0x3bd85b){logger[_0x6663('0x22')](_0x3bd85b['stack']);if(_0x3bd85b[_0x6663('0x23')]){delete _0x3bd85b['name'];}_0x37a89e[_0x6663('0x17')](_0x4564f2)[_0x6663('0x24')](_0x3bd85b);};}exports[_0x6663('0x25')]=function(_0x3e9a8d,_0x3d80c8){var _0xef7d0d={},_0x5b271b={},_0x4c32bc={'count':0x0,'rows':[]};var _0x225c4a=_[_0x6663('0x26')](db[_0x6663('0x27')]['rawAttributes'],function(_0x41e854){return{'name':_0x41e854[_0x6663('0x28')],'type':_0x41e854[_0x6663('0x29')][_0x6663('0x2a')]};});_0x5b271b[_0x6663('0x2b')]=_[_0x6663('0x2c')](_[_0x6663('0x26')](_0x225c4a,_0x6663('0x23')),[_0x6663('0x2d')]);_0x5b271b['query']=_[_0x6663('0x2e')](_0x3e9a8d[_0x6663('0x2f')]);_0x5b271b['filters']=_[_0x6663('0x30')](_0x5b271b[_0x6663('0x2b')],_0x5b271b[_0x6663('0x2f')]);_0xef7d0d[_0x6663('0x31')]=_[_0x6663('0x30')](_0x5b271b[_0x6663('0x2b')],qs[_0x6663('0x32')](_0x3e9a8d[_0x6663('0x2f')]['fields']));_0xef7d0d['attributes']=_0xef7d0d[_0x6663('0x31')][_0x6663('0x33')]?_0xef7d0d[_0x6663('0x31')]:_0x5b271b[_0x6663('0x2b')];if(!_0x3e9a8d[_0x6663('0x2f')]['hasOwnProperty']('nolimit')){_0xef7d0d[_0x6663('0x1b')]=qs[_0x6663('0x1b')](_0x3e9a8d[_0x6663('0x2f')]['limit']);_0xef7d0d[_0x6663('0x1a')]=qs[_0x6663('0x1a')](_0x3e9a8d[_0x6663('0x2f')][_0x6663('0x1a')]);}_0xef7d0d[_0x6663('0x34')]=qs[_0x6663('0x35')](_0x3e9a8d['query'][_0x6663('0x35')]);_0xef7d0d[_0x6663('0x36')]=qs[_0x6663('0x37')](_[_0x6663('0x38')](_0x3e9a8d['query'],_0x5b271b[_0x6663('0x37')]));if(_0x3e9a8d[_0x6663('0x2f')]['filter']){_0xef7d0d[_0x6663('0x36')]=_[_0x6663('0x39')](_0xef7d0d[_0x6663('0x36')],{'$or':_['map'](_0x225c4a,function(_0x421912){if(_0x421912[_0x6663('0x29')]!==_0x6663('0x3a')){var _0x4dc801={};_0x4dc801[_0x421912['name']]={'$like':'%'+_0x3e9a8d[_0x6663('0x2f')][_0x6663('0x3b')]+'%'};return _0x4dc801;}})});}_0xef7d0d=_[_0x6663('0x39')]({},_0xef7d0d,_0x3e9a8d['options']);var _0x3e852a={'where':_0xef7d0d[_0x6663('0x36')]};return db[_0x6663('0x27')][_0x6663('0x3c')](_0x3e852a)[_0x6663('0x20')](function(_0x53afaf){_0x4c32bc['count']=_0x53afaf;if(_0x3e9a8d['query']['includeAll']){_0xef7d0d[_0x6663('0x3d')]=[{'all':!![]}];}return db[_0x6663('0x27')][_0x6663('0x3e')](_0xef7d0d);})[_0x6663('0x20')](function(_0x203e29){_0x4c32bc[_0x6663('0x3f')]=_0x203e29;return _0x4c32bc;})[_0x6663('0x20')](respondWithFilteredResult(_0x3d80c8,_0xef7d0d))[_0x6663('0x40')](handleError(_0x3d80c8,null));};exports['show']=function(_0xb82f4a,_0x4f0590){var _0x487df2={'raw':![],'where':{'id':_0xb82f4a['params']['id']}},_0xe529a1={};_0xe529a1[_0x6663('0x2b')]=_['keys'](db['ScreenRecording'][_0x6663('0x41')]);_0xe529a1[_0x6663('0x2f')]=_[_0x6663('0x2e')](_0xb82f4a['query']);_0xe529a1[_0x6663('0x37')]=_['intersection'](_0xe529a1['model'],_0xe529a1[_0x6663('0x2f')]);_0x487df2[_0x6663('0x31')]=_[_0x6663('0x30')](_0xe529a1[_0x6663('0x2b')],qs[_0x6663('0x32')](_0xb82f4a[_0x6663('0x2f')]['fields']));_0x487df2[_0x6663('0x31')]=_0x487df2[_0x6663('0x31')][_0x6663('0x33')]?_0x487df2['attributes']:_0xe529a1[_0x6663('0x2b')];if(_0xb82f4a[_0x6663('0x2f')][_0x6663('0x42')]){_0x487df2[_0x6663('0x3d')]=[{'all':!![]}];}_0x487df2=_['merge']({},_0x487df2,_0xb82f4a[_0x6663('0x43')]);return db[_0x6663('0x27')][_0x6663('0x44')](_0x487df2)[_0x6663('0x20')](handleEntityNotFound(_0x4f0590,null))[_0x6663('0x20')](respondWithResult(_0x4f0590,null))[_0x6663('0x40')](handleError(_0x4f0590,null));};exports[_0x6663('0x45')]=function(_0x14bd37,_0x1b55cf){return db[_0x6663('0x27')][_0x6663('0x45')](_0x14bd37[_0x6663('0x46')],{})[_0x6663('0x20')](respondWithResult(_0x1b55cf,0xc9))[_0x6663('0x40')](handleError(_0x1b55cf,null));};exports[_0x6663('0x1f')]=function(_0x2dea19,_0x5bf972){if(_0x2dea19[_0x6663('0x46')]['id']){delete _0x2dea19[_0x6663('0x46')]['id'];}delete _0x2dea19['body'][_0x6663('0x47')];delete _0x2dea19[_0x6663('0x46')][_0x6663('0x48')];delete _0x2dea19[_0x6663('0x46')]['closedAt'];delete _0x2dea19[_0x6663('0x46')][_0x6663('0x49')];return db[_0x6663('0x27')][_0x6663('0x44')]({'where':{'id':_0x2dea19['params']['id']}})['then'](handleEntityNotFound(_0x5bf972,null))['then'](saveUpdates(_0x2dea19[_0x6663('0x46')],null))[_0x6663('0x20')](respondWithResult(_0x5bf972,null))[_0x6663('0x40')](handleError(_0x5bf972,null));};exports['describe']=function(_0x1cab3e,_0x430616){return db['ScreenRecording'][_0x6663('0x4a')]()['then'](respondWithResult(_0x430616,null))[_0x6663('0x40')](handleError(_0x430616,null));};exports[_0x6663('0x4b')]=function(_0xbee271,_0x4f3c8d,_0x19288f){var _0x32d2d3=require('../../components/encryptor');var _0x2bbd55=![];var _0x2d157e={};if(_0xbee271[_0x6663('0x2f')]['type']&&_0xbee271['query']['type']==='uniqueid'){_0x2d157e[_0x6663('0x4c')]=_0xbee271[_0x6663('0x4d')]['id'];}else{_0x2d157e['id']=_0xbee271[_0x6663('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x2d157e,'attributes':['id','value'],'raw':!![]})[_0x6663('0x20')](handleEntityNotFound(_0x4f3c8d,null))[_0x6663('0x20')](function(_0x49fe42){if(_0x49fe42){var _0x455eea=path[_0x6663('0x4e')](config[_0x6663('0x4f')],_0x6663('0x50'),_0x49fe42[_0x6663('0x49')]);var _0x1ed5d8=util['format'](_0x6663('0x51'),_0x455eea);if(fs[_0x6663('0x52')](_0x1ed5d8)){_0x2bbd55=!![];return _0x32d2d3[_0x6663('0x53')](_0x1ed5d8,_0x455eea,config['secrets'][_0x6663('0x54')])[_0x6663('0x20')](function(){return _0x49fe42;});}return _0x49fe42;}})['then'](function(_0x1de480){if(_0x1de480){var _0x2aabe5=path[_0x6663('0x4e')](config[_0x6663('0x4f')],'server/files/screen_recordings',_0x1de480['value']);if(!fs[_0x6663('0x52')](_0x2aabe5)){throw new db['Sequelize'][(_0x6663('0x55'))](_0x6663('0x56'));}if(_0x1de480[_0x6663('0x57')]){return _0x4f3c8d[_0x6663('0x4b')](_0x2aabe5,_0x1de480[_0x6663('0x57')]+path['extname'](_0x2aabe5),function(){if(_0x2bbd55){fs[_0x6663('0x58')](_0x2aabe5);}});}else{return _0x4f3c8d[_0x6663('0x4b')](_0x2aabe5,function(_0x5d95d1){if(_0x2bbd55){fs[_0x6663('0x58')](_0x2aabe5);}});}}})[_0x6663('0x40')](function(_0x2acea7){if(_0x2acea7['message']===_0x6663('0x56')){_0x4f3c8d[_0x6663('0x17')](0x194)['send'](_0x6663('0x59'));}else{return handleError(_0x4f3c8d,null);}});};exports[_0x6663('0x21')]=function(_0x2d5dfe,_0x44e755){return db[_0x6663('0x27')][_0x6663('0x44')]({'where':{'id':_0x2d5dfe[_0x6663('0x4d')]['id']}})[_0x6663('0x20')](function(_0x5cc097){if(!_0x5cc097)throw new ReferenceError('Entity\x20not\x20found');return _0x5cc097;})[_0x6663('0x20')](function(_0x444e80){var _0x3b038e=path[_0x6663('0x4e')](config[_0x6663('0x4f')],_0x6663('0x50'),_0x444e80[_0x6663('0x49')]);logger['info'](_0x6663('0x5a'),_0x3b038e);if(!_[_0x6663('0x5b')](_0x444e80[_0x6663('0x49')])&&fs[_0x6663('0x52')](_0x3b038e)){logger['info'](_0x6663('0x5c')+_0x3b038e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6663('0x5d')](_0x3b038e);}_0x3b038e=_0x3b038e+'.cypher';if(!_['isNil'](_0x444e80[_0x6663('0x49')])&&fs[_0x6663('0x52')](_0x3b038e)){logger['info'](_0x6663('0x5c')+_0x3b038e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6663('0x5d')](_0x3b038e);}return _0x444e80;})[_0x6663('0x20')](function(_0x47079c){if(!_0x47079c)throw new InternalError();return _0x47079c[_0x6663('0x21')]();})[_0x6663('0x20')](function(){_0x44e755[_0x6663('0x17')](0xcc)[_0x6663('0x18')]();})['catch'](handleError(_0x44e755,null));};
\ No newline at end of file
+var _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x2b08c4,_0x321a22){var _0xc7406e=function(_0x1bea3a){while(--_0x1bea3a){_0x2b08c4['push'](_0x2b08c4['shift']());}};_0xc7406e(++_0x321a22);}(_0xed1f,0x6a));var _0xfed1=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xed1f[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));};
\ No newline at end of file