Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / squareRecording / squareRecording.controller.js
index 6fd7f39..77eb10a 100644 (file)
@@ -1 +1 @@
-const a724_0x3dbb=['limit','map','body','Entity\x20not\x20found','attributes','util','VIRTUAL','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','SquareRecording','extname','filename','nolimit','sendStatus','.cypher','../../config/environment','download','type','offset','unlink','count','show','rawAttributes','intersection','findOne','%s.cypher','includeAll','uniqueid','status','json','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','update','path','SquareRecording\x20not\x20found','length','secrets','info','catch','pick','stack','Content-Range','end','keys','error','fields','Not\x20found','savePath','unlinkSync','model','send','options','order','../../config/logger','where','rows','filters','existsSync','destroy','create','include','params','name','recording','index','../../components/encryptor','isNil','sort','filter','set','merge','sequelize','findAll','query','then','format'];(function(_0xc1f2be,_0x44a563){const _0x3dbb43=function(_0xc9fcac){while(--_0xc9fcac){_0xc1f2be['push'](_0xc1f2be['shift']());}};_0x3dbb43(++_0x44a563);}(a724_0x3dbb,0xf4));const a724_0xc9fc=function(_0xc1f2be,_0x44a563){_0xc1f2be=_0xc1f2be-0x12f;let _0x3dbb43=a724_0x3dbb[_0xc1f2be];return _0x3dbb43;};const a724_0xabd3b5=a724_0xc9fc;'use strict';const util=require(a724_0xabd3b5(0x16c)),path=require(a724_0xabd3b5(0x13c)),fs=require('fs'),_=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(a724_0xabd3b5(0x150))('api'),config=require(a724_0xabd3b5(0x176)),{db}=require('../../mysqldb'),{Op,ValidationError}=require(a724_0xabd3b5(0x162)),{InternalError}=require('error-middleware/errors');function respondWithResult(_0x5cd2d7,_0x440ac7){return _0x440ac7=_0x440ac7||0xc8,function(_0x3519fa){const _0x3c6bd6=a724_0xc9fc;if(_0x3519fa)return _0x5cd2d7[_0x3c6bd6(0x138)](_0x440ac7)[_0x3c6bd6(0x139)](_0x3519fa);};}function respondWithFilteredResult(_0xd338f0,_0x56a3ab){return function(_0x327dc9){const _0x2e206b=a724_0xc9fc;if(_0x327dc9){const _0xfb7319=_0x327dc9[_0x2e206b(0x130)],_0x3075a1=_0x56a3ab[_0x2e206b(0x179)];let _0x4ad805=_0x56a3ab[_0x2e206b(0x179)]+_0x56a3ab['limit'],_0x131b16;return _0x4ad805>=_0xfb7319?(_0x4ad805=_0xfb7319,_0x131b16=0xc8):_0x131b16=0xce,_0xd338f0[_0x2e206b(0x138)](_0x131b16),_0xd338f0[_0x2e206b(0x160)](_0x2e206b(0x144),_0x3075a1+'-'+_0x4ad805+'/'+_0xfb7319)[_0x2e206b(0x139)](_0x327dc9);}return null;};}function saveUpdates(_0xdd6997){return function(_0x316d33){const _0x59e1c9=a724_0xc9fc;if(_0x316d33)return _0x316d33[_0x59e1c9(0x13b)](_0xdd6997)['then'](function(_0x44d2c8){return _0x44d2c8;});return null;};}function handleEntityNotFound(_0x1ed22c){return function(_0x2c13e2){const _0xc3dccf=a724_0xc9fc;return!_0x2c13e2&&_0x1ed22c[_0xc3dccf(0x174)](0x194),_0x2c13e2;};}function handleError(_0x565b58,_0xbedb24){return _0xbedb24=_0xbedb24||0x1f4,function(_0x76bcc4){const _0x588608=a724_0xc9fc;logger[_0x588608(0x147)](_0x76bcc4[_0x588608(0x143)]),_0x76bcc4['name']&&delete _0x76bcc4[_0x588608(0x159)],_0x565b58[_0x588608(0x138)](_0xbedb24)['send'](_0x76bcc4);};}exports[a724_0xabd3b5(0x15b)]=function(_0x4da8a7,_0x22562e){const _0x5b04ff=a724_0xabd3b5;let _0x19cc06={};const _0x5c33b8={},_0x19fe7b={'count':0x0,'rows':[]},_0x1dade9=_['map'](db[_0x5b04ff(0x170)]['rawAttributes'],function(_0x303708){return{'name':_0x303708['fieldName'],'type':_0x303708['type']['key']};});_0x5c33b8[_0x5b04ff(0x14c)]=_[_0x5b04ff(0x168)](_0x1dade9,_0x5b04ff(0x159)),_0x5c33b8['query']=_[_0x5b04ff(0x146)](_0x4da8a7['query']),_0x5c33b8[_0x5b04ff(0x153)]=_['intersection'](_0x5c33b8[_0x5b04ff(0x14c)],_0x5c33b8[_0x5b04ff(0x164)]),_0x19cc06[_0x5b04ff(0x16b)]=_[_0x5b04ff(0x133)](_0x5c33b8[_0x5b04ff(0x14c)],qs[_0x5b04ff(0x148)](_0x4da8a7[_0x5b04ff(0x164)]['fields'])),_0x19cc06[_0x5b04ff(0x16b)]=_0x19cc06[_0x5b04ff(0x16b)][_0x5b04ff(0x13e)]?_0x19cc06[_0x5b04ff(0x16b)]:_0x5c33b8[_0x5b04ff(0x14c)];typeof _0x4da8a7['query'][_0x5b04ff(0x173)]==='undefined'&&(_0x19cc06[_0x5b04ff(0x167)]=qs[_0x5b04ff(0x167)](_0x4da8a7['query'][_0x5b04ff(0x167)]),_0x19cc06[_0x5b04ff(0x179)]=qs[_0x5b04ff(0x179)](_0x4da8a7[_0x5b04ff(0x164)][_0x5b04ff(0x179)]));_0x19cc06[_0x5b04ff(0x14f)]=qs[_0x5b04ff(0x15e)](_0x4da8a7[_0x5b04ff(0x164)][_0x5b04ff(0x15e)]),_0x19cc06[_0x5b04ff(0x151)]=qs['filters'](_[_0x5b04ff(0x142)](_0x4da8a7[_0x5b04ff(0x164)],_0x5c33b8[_0x5b04ff(0x153)]),_0x1dade9);_0x4da8a7[_0x5b04ff(0x164)]['filter']&&(_0x19cc06[_0x5b04ff(0x151)]=_[_0x5b04ff(0x161)](_0x19cc06['where'],{[Op['or']]:_[_0x5b04ff(0x168)](_0x1dade9,function(_0x3e0173){const _0x5943ce=_0x5b04ff;if(_0x3e0173[_0x5943ce(0x178)]!==_0x5943ce(0x16d)){const _0x475384={};return _0x475384[_0x3e0173[_0x5943ce(0x159)]]={[Op['like']]:'%'+_0x4da8a7[_0x5943ce(0x164)][_0x5943ce(0x15f)]+'%'},_0x475384;}})}));_0x19cc06=_[_0x5b04ff(0x161)]({},_0x19cc06,_0x4da8a7[_0x5b04ff(0x14e)]);const _0x1c3c77={'where':_0x19cc06['where']};return db[_0x5b04ff(0x170)]['count'](_0x1c3c77)[_0x5b04ff(0x165)](function(_0x3f1fa0){const _0x31470a=_0x5b04ff;return _0x19fe7b[_0x31470a(0x130)]=_0x3f1fa0,_0x4da8a7[_0x31470a(0x164)][_0x31470a(0x136)]&&(_0x19cc06[_0x31470a(0x157)]=[{'all':!![]}]),db['SquareRecording'][_0x31470a(0x163)](_0x19cc06);})[_0x5b04ff(0x165)](function(_0x2bfe52){const _0xad7f9f=_0x5b04ff;return _0x19fe7b[_0xad7f9f(0x152)]=_0x2bfe52,_0x19fe7b;})[_0x5b04ff(0x165)](respondWithFilteredResult(_0x22562e,_0x19cc06))[_0x5b04ff(0x141)](handleError(_0x22562e,null));},exports[a724_0xabd3b5(0x131)]=function(_0x14726f,_0x6d8cb7){const _0x339bee=a724_0xabd3b5;let _0x13f1ec={'raw':!![],'where':{'id':_0x14726f['params']['id']}};const _0x3472e3={};return _0x3472e3[_0x339bee(0x14c)]=_['keys'](db['SquareRecording'][_0x339bee(0x132)]),_0x3472e3[_0x339bee(0x164)]=_['keys'](_0x14726f[_0x339bee(0x164)]),_0x3472e3[_0x339bee(0x153)]=_['intersection'](_0x3472e3[_0x339bee(0x14c)],_0x3472e3[_0x339bee(0x164)]),_0x13f1ec[_0x339bee(0x16b)]=_[_0x339bee(0x133)](_0x3472e3[_0x339bee(0x14c)],qs[_0x339bee(0x148)](_0x14726f['query'][_0x339bee(0x148)])),_0x13f1ec['attributes']=_0x13f1ec['attributes']['length']?_0x13f1ec[_0x339bee(0x16b)]:_0x3472e3[_0x339bee(0x14c)],_0x14726f[_0x339bee(0x164)][_0x339bee(0x136)]&&(_0x13f1ec[_0x339bee(0x157)]=[{'all':!![]}]),_0x13f1ec=_[_0x339bee(0x161)]({},_0x13f1ec,_0x14726f['options']),db[_0x339bee(0x170)][_0x339bee(0x134)](_0x13f1ec)['then'](handleEntityNotFound(_0x6d8cb7,null))[_0x339bee(0x165)](respondWithResult(_0x6d8cb7,null))['catch'](handleError(_0x6d8cb7,null));},exports[a724_0xabd3b5(0x156)]=function(_0x42a8f9,_0x11f257){const _0x56d30c=a724_0xabd3b5;return db['SquareRecording'][_0x56d30c(0x156)](_0x42a8f9[_0x56d30c(0x169)],{})[_0x56d30c(0x165)](respondWithResult(_0x11f257,0xc9))['catch'](handleError(_0x11f257,null));},exports[a724_0xabd3b5(0x13b)]=function(_0x5ae09e,_0x44ad3f){const _0xa6daf3=a724_0xabd3b5;return _0x5ae09e[_0xa6daf3(0x169)]['id']&&delete _0x5ae09e[_0xa6daf3(0x169)]['id'],db[_0xa6daf3(0x170)][_0xa6daf3(0x134)]({'where':{'id':_0x5ae09e['params']['id']}})[_0xa6daf3(0x165)](handleEntityNotFound(_0x44ad3f,null))[_0xa6daf3(0x165)](saveUpdates(_0x5ae09e['body'],null))[_0xa6daf3(0x165)](respondWithResult(_0x44ad3f,null))[_0xa6daf3(0x141)](handleError(_0x44ad3f,null));},exports[a724_0xabd3b5(0x177)]=function(_0x2279ac,_0x31f7b5){const _0x3f452f=a724_0xabd3b5,_0x19c03b=require(_0x3f452f(0x15c));let _0x5cd5e7=![];const _0x54799b={};return _0x2279ac['query']['type']&&_0x2279ac[_0x3f452f(0x164)][_0x3f452f(0x178)]===_0x3f452f(0x137)?_0x54799b[_0x3f452f(0x137)]=_0x2279ac[_0x3f452f(0x158)]['id']:_0x54799b['id']=_0x2279ac['params']['id'],db[_0x3f452f(0x170)][_0x3f452f(0x134)]({'where':_0x54799b,'attributes':['id',_0x3f452f(0x14a),_0x3f452f(0x172)],'raw':!![]})[_0x3f452f(0x165)](handleEntityNotFound(_0x31f7b5,null))['then'](function(_0x224199){const _0x4058f0=_0x3f452f;if(_0x224199){const _0x553d5c=_0x224199['savePath'],_0x7518d1=util[_0x4058f0(0x166)](_0x4058f0(0x135),_0x553d5c);if(fs[_0x4058f0(0x154)](_0x7518d1))return _0x5cd5e7=!![],_0x19c03b['decryptFile'](_0x7518d1,_0x553d5c,config[_0x4058f0(0x13f)][_0x4058f0(0x15a)])[_0x4058f0(0x165)](function(){return _0x224199;});return _0x224199;}})[_0x3f452f(0x165)](function(_0xec8d0){const _0x26b4c1=_0x3f452f;if(_0xec8d0){const _0x11904a=_0xec8d0[_0x26b4c1(0x14a)];if(!fs['existsSync'](_0x11904a))throw new ValidationError(_0x26b4c1(0x13d));return _0xec8d0[_0x26b4c1(0x172)]?_0x31f7b5[_0x26b4c1(0x177)](_0x11904a,_0xec8d0[_0x26b4c1(0x172)]+path[_0x26b4c1(0x171)](_0x11904a),function(){const _0x1ae9df=_0x26b4c1;_0x5cd5e7&&fs[_0x1ae9df(0x12f)](_0x11904a);}):_0x31f7b5[_0x26b4c1(0x177)](_0x11904a,function(){const _0x2e88e5=_0x26b4c1;_0x5cd5e7&&fs[_0x2e88e5(0x12f)](_0x11904a);});}})[_0x3f452f(0x141)](function(_0x561099){const _0x5b3457=_0x3f452f;if(_0x561099['message']==='SquareRecording\x20not\x20found')_0x31f7b5['status'](0x194)[_0x5b3457(0x14d)](_0x5b3457(0x149));else return handleError(_0x31f7b5,null);});},exports[a724_0xabd3b5(0x155)]=function(_0x448497,_0x1ec6d3){const _0x13cfcc=a724_0xabd3b5;return db[_0x13cfcc(0x170)][_0x13cfcc(0x134)]({'where':{'id':_0x448497['params']['id']}})['then'](function(_0xfac890){const _0x20eeb5=_0x13cfcc;if(!_0xfac890)throw new ReferenceError(_0x20eeb5(0x16a));return _0xfac890;})[_0x13cfcc(0x165)](function(_0x1d1fb7){const _0x1e70b0=_0x13cfcc;let _0x550cee=_0x1d1fb7[_0x1e70b0(0x14a)];return logger[_0x1e70b0(0x140)](_0x1e70b0(0x16e),_0x550cee),!_['isNil'](_0x1d1fb7['savePath'])&&fs[_0x1e70b0(0x154)](_0x550cee)&&(logger[_0x1e70b0(0x140)]('File:\x20\x22'+_0x550cee+_0x1e70b0(0x13a)),fs[_0x1e70b0(0x14b)](_0x550cee)),_0x550cee=_0x550cee+_0x1e70b0(0x175),!_[_0x1e70b0(0x15d)](_0x1d1fb7[_0x1e70b0(0x14a)])&&fs[_0x1e70b0(0x154)](_0x550cee)&&(logger[_0x1e70b0(0x140)](_0x1e70b0(0x16f)+_0x550cee+_0x1e70b0(0x13a)),fs['unlinkSync'](_0x550cee)),_0x1d1fb7;})['then'](function(_0x2b3930){const _0x2b6b3c=_0x13cfcc;if(!_0x2b3930)throw new InternalError();return _0x2b3930[_0x2b6b3c(0x155)]();})[_0x13cfcc(0x165)](function(){const _0x2490ab=_0x13cfcc;_0x1ec6d3['status'](0xcc)[_0x2490ab(0x145)]();})[_0x13cfcc(0x141)](handleError(_0x1ec6d3,null));};
\ No newline at end of file
+'use strict';const a724_0x4368=['count','update','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','create','error-middleware/errors','error','filter','path','findAll','offset','catch','destroy','File:\x20\x22','attributes','unlink','map','SquareRecording','rows','extname','order','@components/parsers/qs','@mysqldb','index','319402rBGZFg','2oJWrKL','limit','api','fieldName','util','options','966113AyOVnm','filters','sequelize','@config/environment','@utils/filter-attributes','414bxaldr','secrets','Not\x20found','uniqueid','intersection','end','unlinkSync','Entity\x20not\x20found','query','SquareRecording\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','includeAll','length','send','isNil','Content-Range','existsSync','fields','params','then','include','savePath','model','json','decryptFile','lodash','body','.cypher','findOne','1095471cersKU','1STiGBK','name','message','filename','318fgibyT','undefined','show','1764478NtYeYI','status','rawAttributes','download','where','417393zFpIbb','keys','type','%s.cypher','537413rukwPJ','sendStatus'];const a724_0x5ba0=function(_0xb8f70,_0x367be3){_0xb8f70=_0xb8f70-0x10e;let _0x43689a=a724_0x4368[_0xb8f70];return _0x43689a;};const a724_0x54ba15=a724_0x5ba0;(function(_0x5ef339,_0x42f5eb){const _0xe5b9=a724_0x5ba0;while(!![]){try{const _0x184a94=-parseInt(_0xe5b9(0x135))+parseInt(_0xe5b9(0x153))*-parseInt(_0xe5b9(0x139))+parseInt(_0xe5b9(0x159))*-parseInt(_0xe5b9(0x129))+-parseInt(_0xe5b9(0x15e))*parseInt(_0xe5b9(0x12d))+parseInt(_0xe5b9(0x152))+parseInt(_0xe5b9(0x128))+parseInt(_0xe5b9(0x130));if(_0x184a94===_0x42f5eb)break;else _0x5ef339['push'](_0x5ef339['shift']());}catch(_0x3679a0){_0x5ef339['push'](_0x5ef339['shift']());}}}(a724_0x4368,0x8fe37));const util=require(a724_0x54ba15(0x157)),path=require(a724_0x54ba15(0x142)),fs=require('fs'),_=require(a724_0x54ba15(0x124)),qs=require(a724_0x54ba15(0x14f)),logger=require('@config/logger')(a724_0x54ba15(0x155)),config=require(a724_0x54ba15(0x15c)),{db}=require(a724_0x54ba15(0x150)),{ValidationError}=require(a724_0x54ba15(0x15b)),{filterAttributes}=require(a724_0x54ba15(0x15d)),{InternalError}=require(a724_0x54ba15(0x13f));function respondWithResult(_0x35de60,_0x5e0898){return _0x5e0898=_0x5e0898||0xc8,function(_0x38d949){const _0x50eb3b=a724_0x5ba0;if(_0x38d949)return _0x35de60['status'](_0x5e0898)[_0x50eb3b(0x122)](_0x38d949);};}function respondWithFilteredResult(_0x1723e6,_0x1127f6){return function(_0xe796a9){const _0xe5d96c=a724_0x5ba0;if(_0xe796a9){const _0x17f39d=_0xe796a9[_0xe5d96c(0x13b)],_0x5e3e6a=_0x1127f6[_0xe5d96c(0x144)];let _0x4858ca=_0x1127f6[_0xe5d96c(0x144)]+_0x1127f6[_0xe5d96c(0x154)],_0xb5e4cc;return _0x4858ca>=_0x17f39d?(_0x4858ca=_0x17f39d,_0xb5e4cc=0xc8):_0xb5e4cc=0xce,_0x1723e6[_0xe5d96c(0x131)](_0xb5e4cc),_0x1723e6['set'](_0xe5d96c(0x11a),_0x5e3e6a+'-'+_0x4858ca+'/'+_0x17f39d)[_0xe5d96c(0x122)](_0xe796a9);}return null;};}function saveUpdates(_0x45dde1){return function(_0x4cdc3c){const _0x5b2dfb=a724_0x5ba0;if(_0x4cdc3c)return _0x4cdc3c[_0x5b2dfb(0x13c)](_0x45dde1)[_0x5b2dfb(0x11e)](function(_0x53fa89){return _0x53fa89;});return null;};}function handleEntityNotFound(_0x1b52e6){return function(_0x2dfd5c){const _0x27ee51=a724_0x5ba0;return!_0x2dfd5c&&_0x1b52e6[_0x27ee51(0x13a)](0x194),_0x2dfd5c;};}function handleError(_0xf09514,_0x4f395f){return _0x4f395f=_0x4f395f||0x1f4,function(_0xf35c71){const _0x3bb73f=a724_0x5ba0;logger[_0x3bb73f(0x140)](_0xf35c71['stack']),_0xf35c71[_0x3bb73f(0x12a)]&&delete _0xf35c71[_0x3bb73f(0x12a)],_0xf09514[_0x3bb73f(0x131)](_0x4f395f)[_0x3bb73f(0x118)](_0xf35c71);};}exports[a724_0x54ba15(0x151)]=function(_0x33000f,_0x38ff7f){const _0x3a33b7=a724_0x54ba15;let _0xf313d9={};const _0x1c6eea={},_0x11d726={'count':0x0,'rows':[]},_0x483110=_[_0x3a33b7(0x14a)](db[_0x3a33b7(0x14b)][_0x3a33b7(0x132)],function(_0x4e858a){const _0x570b07=_0x3a33b7;return{'name':_0x4e858a[_0x570b07(0x156)],'type':_0x4e858a[_0x570b07(0x137)]['key']};});_0x1c6eea['model']=_[_0x3a33b7(0x14a)](_0x483110,'name'),_0x1c6eea[_0x3a33b7(0x113)]=_[_0x3a33b7(0x136)](_0x33000f[_0x3a33b7(0x113)]),_0x1c6eea[_0x3a33b7(0x15a)]=_[_0x3a33b7(0x10f)](_0x1c6eea[_0x3a33b7(0x121)],_0x1c6eea['query']),_0xf313d9[_0x3a33b7(0x148)]=_[_0x3a33b7(0x10f)](_0x1c6eea[_0x3a33b7(0x121)],qs[_0x3a33b7(0x11c)](_0x33000f[_0x3a33b7(0x113)][_0x3a33b7(0x11c)])),_0xf313d9['attributes']=_0xf313d9[_0x3a33b7(0x148)][_0x3a33b7(0x117)]?_0xf313d9['attributes']:_0x1c6eea[_0x3a33b7(0x121)];typeof _0x33000f['query']['nolimit']===_0x3a33b7(0x12e)&&(_0xf313d9[_0x3a33b7(0x154)]=qs[_0x3a33b7(0x154)](_0x33000f[_0x3a33b7(0x113)][_0x3a33b7(0x154)]),_0xf313d9[_0x3a33b7(0x144)]=qs['offset'](_0x33000f[_0x3a33b7(0x113)][_0x3a33b7(0x144)]));_0xf313d9[_0x3a33b7(0x14e)]=qs['sort'](_0x33000f[_0x3a33b7(0x113)]['sort']),_0xf313d9[_0x3a33b7(0x134)]=qs[_0x3a33b7(0x15a)](_['pick'](_0x33000f[_0x3a33b7(0x113)],_0x1c6eea[_0x3a33b7(0x15a)]),_0x483110),_0xf313d9=filterAttributes(_0xf313d9,_0x33000f['query'][_0x3a33b7(0x141)],_0x483110,_0x33000f[_0x3a33b7(0x158)]);const _0x758f6d={'where':_0xf313d9['where']};return db[_0x3a33b7(0x14b)][_0x3a33b7(0x13b)](_0x758f6d)[_0x3a33b7(0x11e)](function(_0x3d8ba3){const _0x2f5ac3=_0x3a33b7;return _0x11d726[_0x2f5ac3(0x13b)]=_0x3d8ba3,_0x33000f['query'][_0x2f5ac3(0x116)]&&(_0xf313d9[_0x2f5ac3(0x11f)]=[{'all':!![]}]),db[_0x2f5ac3(0x14b)][_0x2f5ac3(0x143)](_0xf313d9);})[_0x3a33b7(0x11e)](function(_0x4a04b6){const _0x1705a3=_0x3a33b7;return _0x11d726[_0x1705a3(0x14c)]=_0x4a04b6,_0x11d726;})['then'](respondWithFilteredResult(_0x38ff7f,_0xf313d9))[_0x3a33b7(0x145)](handleError(_0x38ff7f,null));},exports[a724_0x54ba15(0x12f)]=function(_0x2fb910,_0x27560d){const _0x5e971e=a724_0x54ba15;let _0x1a8676={'raw':!![],'where':{'id':_0x2fb910[_0x5e971e(0x11d)]['id']}};const _0x379256={};return _0x379256[_0x5e971e(0x121)]=_[_0x5e971e(0x136)](db[_0x5e971e(0x14b)]['rawAttributes']),_0x379256['query']=_[_0x5e971e(0x136)](_0x2fb910[_0x5e971e(0x113)]),_0x379256['filters']=_[_0x5e971e(0x10f)](_0x379256[_0x5e971e(0x121)],_0x379256[_0x5e971e(0x113)]),_0x1a8676[_0x5e971e(0x148)]=_[_0x5e971e(0x10f)](_0x379256[_0x5e971e(0x121)],qs[_0x5e971e(0x11c)](_0x2fb910[_0x5e971e(0x113)][_0x5e971e(0x11c)])),_0x1a8676[_0x5e971e(0x148)]=_0x1a8676[_0x5e971e(0x148)][_0x5e971e(0x117)]?_0x1a8676['attributes']:_0x379256['model'],_0x2fb910[_0x5e971e(0x113)][_0x5e971e(0x116)]&&(_0x1a8676[_0x5e971e(0x11f)]=[{'all':!![]}]),_0x1a8676=_['merge']({},_0x1a8676,_0x2fb910[_0x5e971e(0x158)]),db['SquareRecording']['findOne'](_0x1a8676)[_0x5e971e(0x11e)](handleEntityNotFound(_0x27560d,null))[_0x5e971e(0x11e)](respondWithResult(_0x27560d,null))[_0x5e971e(0x145)](handleError(_0x27560d,null));},exports['create']=function(_0x11f44e,_0x46eeb4){const _0x180a06=a724_0x54ba15;return db[_0x180a06(0x14b)][_0x180a06(0x13e)](_0x11f44e['body'],{})['then'](respondWithResult(_0x46eeb4,0xc9))[_0x180a06(0x145)](handleError(_0x46eeb4,null));},exports[a724_0x54ba15(0x13c)]=function(_0x446060,_0x5a6c5d){const _0x43de8a=a724_0x54ba15;return _0x446060[_0x43de8a(0x125)]['id']&&delete _0x446060['body']['id'],db[_0x43de8a(0x14b)]['findOne']({'where':{'id':_0x446060[_0x43de8a(0x11d)]['id']}})[_0x43de8a(0x11e)](handleEntityNotFound(_0x5a6c5d,null))[_0x43de8a(0x11e)](saveUpdates(_0x446060[_0x43de8a(0x125)],null))['then'](respondWithResult(_0x5a6c5d,null))[_0x43de8a(0x145)](handleError(_0x5a6c5d,null));},exports[a724_0x54ba15(0x133)]=function(_0xa4293e,_0x4b7e4f){const _0x35a40c=a724_0x54ba15,_0x38fa14=require('@components/encryptor');let _0x5b904d=![];const _0xd9acf2={};return _0xa4293e[_0x35a40c(0x113)][_0x35a40c(0x137)]&&_0xa4293e[_0x35a40c(0x113)][_0x35a40c(0x137)]===_0x35a40c(0x10e)?_0xd9acf2[_0x35a40c(0x10e)]=_0xa4293e[_0x35a40c(0x11d)]['id']:_0xd9acf2['id']=_0xa4293e[_0x35a40c(0x11d)]['id'],db['SquareRecording'][_0x35a40c(0x127)]({'where':_0xd9acf2,'attributes':['id',_0x35a40c(0x120),'filename'],'raw':!![]})[_0x35a40c(0x11e)](handleEntityNotFound(_0x4b7e4f,null))[_0x35a40c(0x11e)](function(_0x5d95f1){const _0x3bb09a=_0x35a40c;if(_0x5d95f1){const _0x410cf7=_0x5d95f1[_0x3bb09a(0x120)],_0x346f18=util['format'](_0x3bb09a(0x138),_0x410cf7);if(fs['existsSync'](_0x346f18))return _0x5b904d=!![],_0x38fa14[_0x3bb09a(0x123)](_0x346f18,_0x410cf7,config[_0x3bb09a(0x15f)]['recording'])[_0x3bb09a(0x11e)](function(){return _0x5d95f1;});return _0x5d95f1;}})[_0x35a40c(0x11e)](function(_0x5dc2a2){const _0x3616fb=_0x35a40c;if(_0x5dc2a2){const _0x48e2d2=_0x5dc2a2[_0x3616fb(0x120)];if(!fs['existsSync'](_0x48e2d2))throw new ValidationError(_0x3616fb(0x114));return _0x5dc2a2[_0x3616fb(0x12c)]?_0x4b7e4f[_0x3616fb(0x133)](_0x48e2d2,_0x5dc2a2[_0x3616fb(0x12c)]+path[_0x3616fb(0x14d)](_0x48e2d2),function(){const _0x74a5be=_0x3616fb;_0x5b904d&&fs[_0x74a5be(0x149)](_0x48e2d2);}):_0x4b7e4f['download'](_0x48e2d2,function(){_0x5b904d&&fs['unlink'](_0x48e2d2);});}})[_0x35a40c(0x145)](function(_0xe385d0){const _0x128332=_0x35a40c;if(_0xe385d0[_0x128332(0x12b)]===_0x128332(0x114))_0x4b7e4f['status'](0x194)[_0x128332(0x118)](_0x128332(0x160));else return handleError(_0x4b7e4f,null);});},exports[a724_0x54ba15(0x146)]=function(_0x23642e,_0x2a7679){const _0x5b96ec=a724_0x54ba15;return db[_0x5b96ec(0x14b)][_0x5b96ec(0x127)]({'where':{'id':_0x23642e['params']['id']}})[_0x5b96ec(0x11e)](function(_0x118592){const _0x3fee26=_0x5b96ec;if(!_0x118592)throw new ReferenceError(_0x3fee26(0x112));return _0x118592;})[_0x5b96ec(0x11e)](function(_0x348e84){const _0x188779=_0x5b96ec;let _0x12e485=_0x348e84['savePath'];return logger['info'](_0x188779(0x115),_0x12e485),!_[_0x188779(0x119)](_0x348e84[_0x188779(0x120)])&&fs['existsSync'](_0x12e485)&&(logger['info'](_0x188779(0x147)+_0x12e485+_0x188779(0x13d)),fs[_0x188779(0x111)](_0x12e485)),_0x12e485=_0x12e485+_0x188779(0x126),!_[_0x188779(0x119)](_0x348e84['savePath'])&&fs[_0x188779(0x11b)](_0x12e485)&&(logger['info']('File:\x20\x22'+_0x12e485+_0x188779(0x13d)),fs[_0x188779(0x111)](_0x12e485)),_0x348e84;})['then'](function(_0x492d5e){if(!_0x492d5e)throw new InternalError();return _0x492d5e['destroy']();})[_0x5b96ec(0x11e)](function(){const _0x2f227a=_0x5b96ec;_0x2a7679[_0x2f227a(0x131)](0xcc)[_0x2f227a(0x110)]();})[_0x5b96ec(0x145)](handleError(_0x2a7679,null));};
\ No newline at end of file