Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / squareRecording / squareRecording.controller.js
index 7fec153..9eafc74 100644 (file)
@@ -1 +1 @@
-const a605_0x608c=['filter','type','unlink','options','decryptFile','status','message','filename','File:\x20\x22','update','rawAttributes','rows','isNil','create','secrets','existsSync','length','Not\x20found','savePath','unlinkSync','then','SquareRecording','offset','../../config/logger','%s.cypher','where','findOne','attributes','extname','sequelize','util','query','includeAll','download','.cypher','catch','lodash','../../components/parsers/qs','format','send','uniqueid','undefined','Content-Range','api','cancellazione\x20fisica\x20documento\x20%s','filters','like','key','limit','sort','error','fieldName','pick','name','index','fields','body','Entity\x20not\x20found','include','map','params','info','VIRTUAL','model','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','merge','recording','intersection','end','count','error-middleware/errors','findAll','json','sendStatus','set','SquareRecording\x20not\x20found','keys','destroy','nolimit'];(function(_0x2c63b7,_0x608cfd){const _0x4023ea=function(_0x4e6118){while(--_0x4e6118){_0x2c63b7['push'](_0x2c63b7['shift']());}};_0x4023ea(++_0x608cfd);}(a605_0x608c,0x193));const a605_0x4023=function(_0x2c63b7,_0x608cfd){_0x2c63b7=_0x2c63b7-0x0;let _0x4023ea=a605_0x608c[_0x2c63b7];return _0x4023ea;};const _0x218c4e=a605_0x4023;'use strict';const util=require(_0x218c4e('0x16')),path=require('path'),fs=require('fs'),_=require(_0x218c4e('0x1c')),qs=require(_0x218c4e('0x1d')),logger=require(_0x218c4e('0xf'))(_0x218c4e('0x23')),config=require('../../config/environment'),db=require('../../mysqldb')['db'],{Op,ValidationError}=require(_0x218c4e('0x15')),{InternalError}=require(_0x218c4e('0x3e'));function respondWithResult(_0x4e6118,_0x319bbd){return _0x319bbd=_0x319bbd||0xc8,function(_0x3b3481){const _0x4aa68b=a605_0x4023;if(_0x3b3481)return _0x4e6118['status'](_0x319bbd)[_0x4aa68b('0x40')](_0x3b3481);};}function respondWithFilteredResult(_0x176153,_0x5e34f3){return function(_0xa8455c){const _0xedc242=a605_0x4023;if(_0xa8455c){const _0x25a4a0=_0xa8455c[_0xedc242('0x3d')],_0x54fc4f=_0x5e34f3[_0xedc242('0xe')];let _0x32e90f=_0x5e34f3['offset']+_0x5e34f3[_0xedc242('0x28')],_0x3f7c3f;return _0x32e90f>=_0x25a4a0?(_0x32e90f=_0x25a4a0,_0x3f7c3f=0xc8):_0x3f7c3f=0xce,_0x176153[_0xedc242('0x4c')](_0x3f7c3f),_0x176153[_0xedc242('0x42')](_0xedc242('0x22'),_0x54fc4f+'-'+_0x32e90f+'/'+_0x25a4a0)[_0xedc242('0x40')](_0xa8455c);}return null;};}function saveUpdates(_0x35f772){return function(_0x2b460e){const _0x247657=a605_0x4023;if(_0x2b460e)return _0x2b460e[_0x247657('0x1')](_0x35f772)['then'](function(_0x1f1940){return _0x1f1940;});return null;};}function handleEntityNotFound(_0x588fb1){return function(_0x57341d){const _0x5284a9=a605_0x4023;return!_0x57341d&&_0x588fb1[_0x5284a9('0x41')](0x194),_0x57341d;};}function handleError(_0x90ee71,_0x89b802){return _0x89b802=_0x89b802||0x1f4,function(_0x298652){const _0x526228=a605_0x4023;logger[_0x526228('0x2a')](_0x298652['stack']),_0x298652['name']&&delete _0x298652[_0x526228('0x2d')],_0x90ee71[_0x526228('0x4c')](_0x89b802)[_0x526228('0x1f')](_0x298652);};}exports[_0x218c4e('0x2e')]=function(_0x528520,_0x324f9b){const _0x28d529=_0x218c4e;let _0x39ce16={};const _0x5258e1={},_0x1f5971={'count':0x0,'rows':[]},_0x32badd=_['map'](db['SquareRecording'][_0x28d529('0x2')],function(_0x35c80f){const _0x5eed64=_0x28d529;return{'name':_0x35c80f[_0x5eed64('0x2b')],'type':_0x35c80f[_0x5eed64('0x48')][_0x5eed64('0x27')]};});_0x5258e1[_0x28d529('0x37')]=_[_0x28d529('0x33')](_0x32badd,'name'),_0x5258e1[_0x28d529('0x17')]=_['keys'](_0x528520['query']),_0x5258e1[_0x28d529('0x25')]=_['intersection'](_0x5258e1[_0x28d529('0x37')],_0x5258e1[_0x28d529('0x17')]),_0x39ce16[_0x28d529('0x13')]=_[_0x28d529('0x3b')](_0x5258e1[_0x28d529('0x37')],qs['fields'](_0x528520[_0x28d529('0x17')][_0x28d529('0x2f')])),_0x39ce16[_0x28d529('0x13')]=_0x39ce16[_0x28d529('0x13')][_0x28d529('0x8')]?_0x39ce16[_0x28d529('0x13')]:_0x5258e1[_0x28d529('0x37')];typeof _0x528520[_0x28d529('0x17')][_0x28d529('0x46')]===_0x28d529('0x21')&&(_0x39ce16[_0x28d529('0x28')]=qs[_0x28d529('0x28')](_0x528520[_0x28d529('0x17')][_0x28d529('0x28')]),_0x39ce16[_0x28d529('0xe')]=qs['offset'](_0x528520[_0x28d529('0x17')][_0x28d529('0xe')]));_0x39ce16['order']=qs[_0x28d529('0x29')](_0x528520[_0x28d529('0x17')][_0x28d529('0x29')]),_0x39ce16['where']=qs[_0x28d529('0x25')](_[_0x28d529('0x2c')](_0x528520['query'],_0x5258e1[_0x28d529('0x25')]),_0x32badd);_0x528520[_0x28d529('0x17')][_0x28d529('0x47')]&&(_0x39ce16[_0x28d529('0x11')]=_['merge'](_0x39ce16[_0x28d529('0x11')],{[Op['or']]:_[_0x28d529('0x33')](_0x32badd,function(_0x3a190f){const _0xb3096e=_0x28d529;if(_0x3a190f[_0xb3096e('0x48')]!==_0xb3096e('0x36')){const _0x5f09e5={};return _0x5f09e5[_0x3a190f['name']]={[Op[_0xb3096e('0x26')]]:'%'+_0x528520['query'][_0xb3096e('0x47')]+'%'},_0x5f09e5;}})}));_0x39ce16=_[_0x28d529('0x39')]({},_0x39ce16,_0x528520['options']);const _0x33eef8={'where':_0x39ce16[_0x28d529('0x11')]};return db[_0x28d529('0xd')][_0x28d529('0x3d')](_0x33eef8)[_0x28d529('0xc')](function(_0x5579d9){const _0x5bfa74=_0x28d529;return _0x1f5971[_0x5bfa74('0x3d')]=_0x5579d9,_0x528520[_0x5bfa74('0x17')][_0x5bfa74('0x18')]&&(_0x39ce16[_0x5bfa74('0x32')]=[{'all':!![]}]),db[_0x5bfa74('0xd')][_0x5bfa74('0x3f')](_0x39ce16);})[_0x28d529('0xc')](function(_0x58b4bf){const _0x8b3789=_0x28d529;return _0x1f5971[_0x8b3789('0x3')]=_0x58b4bf,_0x1f5971;})[_0x28d529('0xc')](respondWithFilteredResult(_0x324f9b,_0x39ce16))['catch'](handleError(_0x324f9b,null));},exports['show']=function(_0x6f01a2,_0x2ebc7b){const _0x154d7b=_0x218c4e;let _0x136898={'raw':!![],'where':{'id':_0x6f01a2[_0x154d7b('0x34')]['id']}};const _0x3fb9f0={};return _0x3fb9f0[_0x154d7b('0x37')]=_[_0x154d7b('0x44')](db['SquareRecording']['rawAttributes']),_0x3fb9f0[_0x154d7b('0x17')]=_[_0x154d7b('0x44')](_0x6f01a2[_0x154d7b('0x17')]),_0x3fb9f0[_0x154d7b('0x25')]=_[_0x154d7b('0x3b')](_0x3fb9f0[_0x154d7b('0x37')],_0x3fb9f0[_0x154d7b('0x17')]),_0x136898[_0x154d7b('0x13')]=_['intersection'](_0x3fb9f0['model'],qs[_0x154d7b('0x2f')](_0x6f01a2[_0x154d7b('0x17')][_0x154d7b('0x2f')])),_0x136898[_0x154d7b('0x13')]=_0x136898['attributes'][_0x154d7b('0x8')]?_0x136898['attributes']:_0x3fb9f0[_0x154d7b('0x37')],_0x6f01a2[_0x154d7b('0x17')][_0x154d7b('0x18')]&&(_0x136898[_0x154d7b('0x32')]=[{'all':!![]}]),_0x136898=_[_0x154d7b('0x39')]({},_0x136898,_0x6f01a2[_0x154d7b('0x4a')]),db[_0x154d7b('0xd')][_0x154d7b('0x12')](_0x136898)['then'](handleEntityNotFound(_0x2ebc7b,null))[_0x154d7b('0xc')](respondWithResult(_0x2ebc7b,null))['catch'](handleError(_0x2ebc7b,null));},exports['create']=function(_0x49455d,_0x48e795){const _0x17cdc9=_0x218c4e;return db[_0x17cdc9('0xd')][_0x17cdc9('0x5')](_0x49455d[_0x17cdc9('0x30')],{})[_0x17cdc9('0xc')](respondWithResult(_0x48e795,0xc9))[_0x17cdc9('0x1b')](handleError(_0x48e795,null));},exports[_0x218c4e('0x1')]=function(_0x4b1cba,_0xe32985){const _0x55bc65=_0x218c4e;return _0x4b1cba[_0x55bc65('0x30')]['id']&&delete _0x4b1cba[_0x55bc65('0x30')]['id'],db[_0x55bc65('0xd')]['findOne']({'where':{'id':_0x4b1cba[_0x55bc65('0x34')]['id']}})[_0x55bc65('0xc')](handleEntityNotFound(_0xe32985,null))[_0x55bc65('0xc')](saveUpdates(_0x4b1cba[_0x55bc65('0x30')],null))[_0x55bc65('0xc')](respondWithResult(_0xe32985,null))[_0x55bc65('0x1b')](handleError(_0xe32985,null));},exports[_0x218c4e('0x19')]=function(_0x273c66,_0x48454c){const _0x2c2ebd=_0x218c4e,_0x7fc7d8=require('../../components/encryptor');let _0x559fa7=![];const _0x5defac={};return _0x273c66[_0x2c2ebd('0x17')][_0x2c2ebd('0x48')]&&_0x273c66[_0x2c2ebd('0x17')][_0x2c2ebd('0x48')]==='uniqueid'?_0x5defac[_0x2c2ebd('0x20')]=_0x273c66['params']['id']:_0x5defac['id']=_0x273c66['params']['id'],db[_0x2c2ebd('0xd')]['findOne']({'where':_0x5defac,'attributes':['id',_0x2c2ebd('0xa'),'filename'],'raw':!![]})[_0x2c2ebd('0xc')](handleEntityNotFound(_0x48454c,null))[_0x2c2ebd('0xc')](function(_0x35c468){const _0x10e5d9=_0x2c2ebd;if(_0x35c468){const _0xe53aed=_0x35c468['savePath'],_0x510189=util[_0x10e5d9('0x1e')](_0x10e5d9('0x10'),_0xe53aed);if(fs[_0x10e5d9('0x7')](_0x510189))return _0x559fa7=!![],_0x7fc7d8[_0x10e5d9('0x4b')](_0x510189,_0xe53aed,config[_0x10e5d9('0x6')][_0x10e5d9('0x3a')])[_0x10e5d9('0xc')](function(){return _0x35c468;});return _0x35c468;}})['then'](function(_0x21fca6){const _0x3e4cbd=_0x2c2ebd;if(_0x21fca6){const _0x59d739=_0x21fca6['savePath'];if(!fs[_0x3e4cbd('0x7')](_0x59d739))throw new ValidationError(_0x3e4cbd('0x43'));return _0x21fca6[_0x3e4cbd('0x4e')]?_0x48454c[_0x3e4cbd('0x19')](_0x59d739,_0x21fca6[_0x3e4cbd('0x4e')]+path[_0x3e4cbd('0x14')](_0x59d739),function(){const _0x562b13=_0x3e4cbd;_0x559fa7&&fs[_0x562b13('0x49')](_0x59d739);}):_0x48454c[_0x3e4cbd('0x19')](_0x59d739,function(){const _0x301db8=_0x3e4cbd;_0x559fa7&&fs[_0x301db8('0x49')](_0x59d739);});}})[_0x2c2ebd('0x1b')](function(_0x25f267){const _0x4975ab=_0x2c2ebd;if(_0x25f267[_0x4975ab('0x4d')]==='SquareRecording\x20not\x20found')_0x48454c[_0x4975ab('0x4c')](0x194)['send'](_0x4975ab('0x9'));else return handleError(_0x48454c,null);});},exports[_0x218c4e('0x45')]=function(_0x3888aa,_0x456411){const _0x3dceb7=_0x218c4e;return db[_0x3dceb7('0xd')]['findOne']({'where':{'id':_0x3888aa[_0x3dceb7('0x34')]['id']}})[_0x3dceb7('0xc')](function(_0x433900){const _0x7ad392=_0x3dceb7;if(!_0x433900)throw new ReferenceError(_0x7ad392('0x31'));return _0x433900;})[_0x3dceb7('0xc')](function(_0x384e5a){const _0x48366f=_0x3dceb7;let _0x287e14=_0x384e5a['savePath'];return logger['info'](_0x48366f('0x24'),_0x287e14),!_[_0x48366f('0x4')](_0x384e5a[_0x48366f('0xa')])&&fs[_0x48366f('0x7')](_0x287e14)&&(logger[_0x48366f('0x35')](_0x48366f('0x0')+_0x287e14+_0x48366f('0x38')),fs[_0x48366f('0xb')](_0x287e14)),_0x287e14=_0x287e14+_0x48366f('0x1a'),!_[_0x48366f('0x4')](_0x384e5a[_0x48366f('0xa')])&&fs[_0x48366f('0x7')](_0x287e14)&&(logger[_0x48366f('0x35')]('File:\x20\x22'+_0x287e14+_0x48366f('0x38')),fs['unlinkSync'](_0x287e14)),_0x384e5a;})['then'](function(_0x1aa8af){if(!_0x1aa8af)throw new InternalError();return _0x1aa8af['destroy']();})[_0x3dceb7('0xc')](function(){const _0x21949b=_0x3dceb7;_0x456411[_0x21949b('0x4c')](0xcc)[_0x21949b('0x3c')]();})['catch'](handleError(_0x456411,null));};
\ No newline at end of file
+const a605_0xabb4=['stack','error-middleware/errors','create','../../components/encryptor','File:\x20\x22','set','findOne','error','sendStatus','intersection','download','query','index','offset','unlinkSync','model','SquareRecording\x20not\x20found','unlink','format','destroy','fields','keys','name','options','status','length','map','../../mysqldb','show','Content-Range','../../config/logger','attributes','catch','send','existsSync','then','info','uniqueid','pick','end','fieldName','filter','params','../../config/environment','like','api','message','filters','body','rawAttributes','.cypher','lodash','includeAll','util','sort','decryptFile','extname','savePath','filename','SquareRecording','json','type','where','recording','count','limit','include','path','isNil','merge','update'];(function(_0x110b75,_0xabb46e){const _0x1f3caf=function(_0x357c58){while(--_0x357c58){_0x110b75['push'](_0x110b75['shift']());}};_0x1f3caf(++_0xabb46e);}(a605_0xabb4,0x1bb));const a605_0x1f3c=function(_0x110b75,_0xabb46e){_0x110b75=_0x110b75-0x0;let _0x1f3caf=a605_0xabb4[_0x110b75];return _0x1f3caf;};const _0x5e1f28=a605_0x1f3c;'use strict';const util=require(_0x5e1f28('0x24')),path=require(_0x5e1f28('0x32')),fs=require('fs'),_=require(_0x5e1f28('0x22')),qs=require('../../components/parsers/qs'),logger=require(_0x5e1f28('0xd'))(_0x5e1f28('0x1c')),config=require(_0x5e1f28('0x1a')),db=require(_0x5e1f28('0xa'))['db'],{Op,ValidationError}=require('sequelize'),{InternalError}=require(_0x5e1f28('0x37'));function respondWithResult(_0x357c58,_0x487d33){return _0x487d33=_0x487d33||0xc8,function(_0x531d35){const _0x5ae22c=a605_0x1f3c;if(_0x531d35)return _0x357c58[_0x5ae22c('0x7')](_0x487d33)[_0x5ae22c('0x2b')](_0x531d35);};}function respondWithFilteredResult(_0xf97c36,_0x4ea1f3){return function(_0xc7438f){const _0x186533=a605_0x1f3c;if(_0xc7438f){const _0xfb111c=_0xc7438f[_0x186533('0x2f')],_0x4b7fdf=_0x4ea1f3[_0x186533('0x43')];let _0xe11d4a=_0x4ea1f3[_0x186533('0x43')]+_0x4ea1f3[_0x186533('0x30')],_0x16407f;return _0xe11d4a>=_0xfb111c?(_0xe11d4a=_0xfb111c,_0x16407f=0xc8):_0x16407f=0xce,_0xf97c36['status'](_0x16407f),_0xf97c36[_0x186533('0x3b')](_0x186533('0xc'),_0x4b7fdf+'-'+_0xe11d4a+'/'+_0xfb111c)['json'](_0xc7438f);}return null;};}function saveUpdates(_0x9d09e3){return function(_0x16fa6d){const _0x1bf76e=a605_0x1f3c;if(_0x16fa6d)return _0x16fa6d[_0x1bf76e('0x35')](_0x9d09e3)[_0x1bf76e('0x12')](function(_0x3c6e62){return _0x3c6e62;});return null;};}function handleEntityNotFound(_0x25649b){return function(_0x517c31){const _0x47ea4f=a605_0x1f3c;return!_0x517c31&&_0x25649b[_0x47ea4f('0x3e')](0x194),_0x517c31;};}function handleError(_0x2b05ec,_0x166931){return _0x166931=_0x166931||0x1f4,function(_0x1fedce){const _0x313d9c=a605_0x1f3c;logger[_0x313d9c('0x3d')](_0x1fedce[_0x313d9c('0x36')]),_0x1fedce[_0x313d9c('0x5')]&&delete _0x1fedce[_0x313d9c('0x5')],_0x2b05ec['status'](_0x166931)[_0x313d9c('0x10')](_0x1fedce);};}exports[_0x5e1f28('0x42')]=function(_0x1390d9,_0x35726e){const _0x40c0fa=_0x5e1f28;let _0x32a6f2={};const _0x1ee78f={},_0x159945={'count':0x0,'rows':[]},_0x429bc8=_['map'](db[_0x40c0fa('0x2a')][_0x40c0fa('0x20')],function(_0x37d12b){const _0x49f45f=_0x40c0fa;return{'name':_0x37d12b[_0x49f45f('0x17')],'type':_0x37d12b[_0x49f45f('0x2c')]['key']};});_0x1ee78f[_0x40c0fa('0x45')]=_[_0x40c0fa('0x9')](_0x429bc8,_0x40c0fa('0x5')),_0x1ee78f['query']=_[_0x40c0fa('0x4')](_0x1390d9[_0x40c0fa('0x41')]),_0x1ee78f[_0x40c0fa('0x1e')]=_[_0x40c0fa('0x3f')](_0x1ee78f[_0x40c0fa('0x45')],_0x1ee78f[_0x40c0fa('0x41')]),_0x32a6f2['attributes']=_['intersection'](_0x1ee78f[_0x40c0fa('0x45')],qs['fields'](_0x1390d9[_0x40c0fa('0x41')][_0x40c0fa('0x3')])),_0x32a6f2['attributes']=_0x32a6f2[_0x40c0fa('0xe')][_0x40c0fa('0x8')]?_0x32a6f2[_0x40c0fa('0xe')]:_0x1ee78f[_0x40c0fa('0x45')];typeof _0x1390d9[_0x40c0fa('0x41')]['nolimit']==='undefined'&&(_0x32a6f2['limit']=qs[_0x40c0fa('0x30')](_0x1390d9[_0x40c0fa('0x41')][_0x40c0fa('0x30')]),_0x32a6f2[_0x40c0fa('0x43')]=qs['offset'](_0x1390d9[_0x40c0fa('0x41')][_0x40c0fa('0x43')]));_0x32a6f2['order']=qs['sort'](_0x1390d9[_0x40c0fa('0x41')][_0x40c0fa('0x25')]),_0x32a6f2[_0x40c0fa('0x2d')]=qs[_0x40c0fa('0x1e')](_[_0x40c0fa('0x15')](_0x1390d9[_0x40c0fa('0x41')],_0x1ee78f['filters']),_0x429bc8);_0x1390d9['query']['filter']&&(_0x32a6f2[_0x40c0fa('0x2d')]=_[_0x40c0fa('0x34')](_0x32a6f2[_0x40c0fa('0x2d')],{[Op['or']]:_[_0x40c0fa('0x9')](_0x429bc8,function(_0x4a35f2){const _0x25905a=_0x40c0fa;if(_0x4a35f2['type']!=='VIRTUAL'){const _0x31c688={};return _0x31c688[_0x4a35f2[_0x25905a('0x5')]]={[Op[_0x25905a('0x1b')]]:'%'+_0x1390d9[_0x25905a('0x41')][_0x25905a('0x18')]+'%'},_0x31c688;}})}));_0x32a6f2=_[_0x40c0fa('0x34')]({},_0x32a6f2,_0x1390d9[_0x40c0fa('0x6')]);const _0x5b574f={'where':_0x32a6f2[_0x40c0fa('0x2d')]};return db[_0x40c0fa('0x2a')]['count'](_0x5b574f)[_0x40c0fa('0x12')](function(_0x1242e7){const _0x26ffeb=_0x40c0fa;return _0x159945[_0x26ffeb('0x2f')]=_0x1242e7,_0x1390d9[_0x26ffeb('0x41')][_0x26ffeb('0x23')]&&(_0x32a6f2['include']=[{'all':!![]}]),db['SquareRecording']['findAll'](_0x32a6f2);})['then'](function(_0x2bde30){return _0x159945['rows']=_0x2bde30,_0x159945;})['then'](respondWithFilteredResult(_0x35726e,_0x32a6f2))['catch'](handleError(_0x35726e,null));},exports[_0x5e1f28('0xb')]=function(_0x3e62a0,_0x593ef1){const _0x36f78b=_0x5e1f28;let _0x4aa9ba={'raw':!![],'where':{'id':_0x3e62a0[_0x36f78b('0x19')]['id']}};const _0xc755d7={};return _0xc755d7[_0x36f78b('0x45')]=_[_0x36f78b('0x4')](db[_0x36f78b('0x2a')][_0x36f78b('0x20')]),_0xc755d7[_0x36f78b('0x41')]=_[_0x36f78b('0x4')](_0x3e62a0[_0x36f78b('0x41')]),_0xc755d7[_0x36f78b('0x1e')]=_['intersection'](_0xc755d7[_0x36f78b('0x45')],_0xc755d7[_0x36f78b('0x41')]),_0x4aa9ba[_0x36f78b('0xe')]=_['intersection'](_0xc755d7[_0x36f78b('0x45')],qs[_0x36f78b('0x3')](_0x3e62a0[_0x36f78b('0x41')][_0x36f78b('0x3')])),_0x4aa9ba[_0x36f78b('0xe')]=_0x4aa9ba[_0x36f78b('0xe')][_0x36f78b('0x8')]?_0x4aa9ba['attributes']:_0xc755d7[_0x36f78b('0x45')],_0x3e62a0[_0x36f78b('0x41')]['includeAll']&&(_0x4aa9ba[_0x36f78b('0x31')]=[{'all':!![]}]),_0x4aa9ba=_[_0x36f78b('0x34')]({},_0x4aa9ba,_0x3e62a0['options']),db['SquareRecording']['findOne'](_0x4aa9ba)[_0x36f78b('0x12')](handleEntityNotFound(_0x593ef1,null))[_0x36f78b('0x12')](respondWithResult(_0x593ef1,null))['catch'](handleError(_0x593ef1,null));},exports[_0x5e1f28('0x38')]=function(_0x345a40,_0x24380c){const _0x5ab94b=_0x5e1f28;return db['SquareRecording'][_0x5ab94b('0x38')](_0x345a40['body'],{})['then'](respondWithResult(_0x24380c,0xc9))[_0x5ab94b('0xf')](handleError(_0x24380c,null));},exports[_0x5e1f28('0x35')]=function(_0x26b859,_0x48dfc3){const _0x2b5dc5=_0x5e1f28;return _0x26b859[_0x2b5dc5('0x1f')]['id']&&delete _0x26b859[_0x2b5dc5('0x1f')]['id'],db[_0x2b5dc5('0x2a')][_0x2b5dc5('0x3c')]({'where':{'id':_0x26b859['params']['id']}})['then'](handleEntityNotFound(_0x48dfc3,null))[_0x2b5dc5('0x12')](saveUpdates(_0x26b859[_0x2b5dc5('0x1f')],null))[_0x2b5dc5('0x12')](respondWithResult(_0x48dfc3,null))[_0x2b5dc5('0xf')](handleError(_0x48dfc3,null));},exports[_0x5e1f28('0x40')]=function(_0x4c7a51,_0x35eaa3){const _0x4aeb8c=_0x5e1f28,_0x56a289=require(_0x4aeb8c('0x39'));let _0x45ab56=![];const _0x80905e={};return _0x4c7a51[_0x4aeb8c('0x41')]['type']&&_0x4c7a51[_0x4aeb8c('0x41')][_0x4aeb8c('0x2c')]===_0x4aeb8c('0x14')?_0x80905e[_0x4aeb8c('0x14')]=_0x4c7a51['params']['id']:_0x80905e['id']=_0x4c7a51[_0x4aeb8c('0x19')]['id'],db[_0x4aeb8c('0x2a')][_0x4aeb8c('0x3c')]({'where':_0x80905e,'attributes':['id',_0x4aeb8c('0x28'),_0x4aeb8c('0x29')],'raw':!![]})[_0x4aeb8c('0x12')](handleEntityNotFound(_0x35eaa3,null))[_0x4aeb8c('0x12')](function(_0x35797d){const _0x3f1a9f=_0x4aeb8c;if(_0x35797d){const _0x46a0e6=_0x35797d['savePath'],_0xee5ec6=util[_0x3f1a9f('0x1')]('%s.cypher',_0x46a0e6);if(fs[_0x3f1a9f('0x11')](_0xee5ec6))return _0x45ab56=!![],_0x56a289[_0x3f1a9f('0x26')](_0xee5ec6,_0x46a0e6,config['secrets'][_0x3f1a9f('0x2e')])[_0x3f1a9f('0x12')](function(){return _0x35797d;});return _0x35797d;}})[_0x4aeb8c('0x12')](function(_0x2756f0){const _0x5eac22=_0x4aeb8c;if(_0x2756f0){const _0x274908=_0x2756f0[_0x5eac22('0x28')];if(!fs[_0x5eac22('0x11')](_0x274908))throw new ValidationError(_0x5eac22('0x46'));return _0x2756f0['filename']?_0x35eaa3[_0x5eac22('0x40')](_0x274908,_0x2756f0[_0x5eac22('0x29')]+path[_0x5eac22('0x27')](_0x274908),function(){const _0x494295=_0x5eac22;_0x45ab56&&fs[_0x494295('0x0')](_0x274908);}):_0x35eaa3[_0x5eac22('0x40')](_0x274908,function(){const _0x325fa0=_0x5eac22;_0x45ab56&&fs[_0x325fa0('0x0')](_0x274908);});}})[_0x4aeb8c('0xf')](function(_0x17b0d3){const _0x3595f7=_0x4aeb8c;if(_0x17b0d3[_0x3595f7('0x1d')]==='SquareRecording\x20not\x20found')_0x35eaa3[_0x3595f7('0x7')](0x194)[_0x3595f7('0x10')]('Not\x20found');else return handleError(_0x35eaa3,null);});},exports[_0x5e1f28('0x2')]=function(_0x37383c,_0x37569a){const _0x1538d6=_0x5e1f28;return db[_0x1538d6('0x2a')]['findOne']({'where':{'id':_0x37383c['params']['id']}})[_0x1538d6('0x12')](function(_0xe81efc){if(!_0xe81efc)throw new ReferenceError('Entity\x20not\x20found');return _0xe81efc;})[_0x1538d6('0x12')](function(_0x58d3a9){const _0x6c1519=_0x1538d6;let _0x3249d0=_0x58d3a9[_0x6c1519('0x28')];return logger[_0x6c1519('0x13')]('cancellazione\x20fisica\x20documento\x20%s',_0x3249d0),!_[_0x6c1519('0x33')](_0x58d3a9[_0x6c1519('0x28')])&&fs[_0x6c1519('0x11')](_0x3249d0)&&(logger[_0x6c1519('0x13')]('File:\x20\x22'+_0x3249d0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs[_0x6c1519('0x44')](_0x3249d0)),_0x3249d0=_0x3249d0+_0x6c1519('0x21'),!_['isNil'](_0x58d3a9[_0x6c1519('0x28')])&&fs[_0x6c1519('0x11')](_0x3249d0)&&(logger[_0x6c1519('0x13')](_0x6c1519('0x3a')+_0x3249d0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs[_0x6c1519('0x44')](_0x3249d0)),_0x58d3a9;})['then'](function(_0x42ea6e){const _0x3c0ae3=_0x1538d6;if(!_0x42ea6e)throw new InternalError();return _0x42ea6e[_0x3c0ae3('0x2')]();})['then'](function(){const _0x361f1a=_0x1538d6;_0x37569a[_0x361f1a('0x7')](0xcc)[_0x361f1a('0x16')]();})[_0x1538d6('0xf')](handleError(_0x37569a,null));};
\ No newline at end of file