Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / squareRecording / squareRecording.controller.js
index c81a59c..3aa2710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb9=['json','count','offset','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SquareRecording','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','catch','show','params','keys','rawAttributes','include','options','find','create','body','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','download','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status'];(function(_0x3017e0,_0x399ed9){var _0x865461=function(_0x19cfc3){while(--_0x19cfc3){_0x3017e0['push'](_0x3017e0['shift']());}};_0x865461(++_0x399ed9);}(_0xfeb9,0x1c0));var _0x9feb=function(_0x3037dd,_0x52d9d5){_0x3037dd=_0x3037dd-0x0;var _0xace26=_0xfeb9[_0x3037dd];return _0xace26;};'use strict';var pdf=require(_0x9feb('0x0'));var emlformat=require(_0x9feb('0x1'));var rimraf=require(_0x9feb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9feb('0x3'));var rp=require(_0x9feb('0x4'));var moment=require(_0x9feb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9feb('0x6'));var util=require(_0x9feb('0x7'));var path=require(_0x9feb('0x8'));var sox=require(_0x9feb('0x9'));var csv=require(_0x9feb('0xa'));var ejs=require(_0x9feb('0xb'));var fs=require('fs');var _=require(_0x9feb('0xc'));var squel=require(_0x9feb('0xd'));var crypto=require(_0x9feb('0xe'));var jsforce=require(_0x9feb('0xf'));var deskjs=require(_0x9feb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9feb('0x11'));var Papa=require(_0x9feb('0x12'));var Redis=require(_0x9feb('0x13'));var authService=require(_0x9feb('0x14'));var qs=require(_0x9feb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9feb('0x16'));var logger=require(_0x9feb('0x17'))(_0x9feb('0x18'));var utils=require(_0x9feb('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0346,_0x175be8){_0x175be8=_0x175be8||0xcc;return function(_0x47a3c5){if(_0x47a3c5){return _0x1d0346['sendStatus'](_0x175be8);}return _0x1d0346[_0x9feb('0x1a')](_0x175be8)['end']();};}function respondWithResult(_0x2f3f1b,_0x1159a7){_0x1159a7=_0x1159a7||0xc8;return function(_0x1982a6){if(_0x1982a6){return _0x2f3f1b[_0x9feb('0x1a')](_0x1159a7)[_0x9feb('0x1b')](_0x1982a6);}};}function respondWithFilteredResult(_0x490948,_0x14b488){return function(_0x5e9d6a){if(_0x5e9d6a){var _0x1b2c0c=_0x5e9d6a[_0x9feb('0x1c')],_0x3335f8=_0x14b488['offset'],_0x40a526=_0x14b488[_0x9feb('0x1d')]+_0x14b488[_0x9feb('0x1e')],_0x2a1cb1;if(_0x40a526>=_0x1b2c0c){_0x40a526=_0x1b2c0c;_0x2a1cb1=0xc8;}else{_0x2a1cb1=0xce;}_0x490948[_0x9feb('0x1a')](_0x2a1cb1);return _0x490948['set'](_0x9feb('0x1f'),_0x3335f8+'-'+_0x40a526+'/'+_0x1b2c0c)[_0x9feb('0x1b')](_0x5e9d6a);}return null;};}function patchUpdates(_0x137d2b){return function(_0x5f46d0){try{jsonpatch['apply'](_0x5f46d0,_0x137d2b,!![]);}catch(_0x911c1e){return BPromise[_0x9feb('0x20')](_0x911c1e);}return _0x5f46d0[_0x9feb('0x21')]();};}function saveUpdates(_0x46d429,_0x3bcb80){return function(_0x1fe1ab){if(_0x1fe1ab){return _0x1fe1ab[_0x9feb('0x22')](_0x46d429)[_0x9feb('0x23')](function(_0x24ced6){return _0x24ced6;});}return null;};}function removeEntity(_0x5e7ab9,_0x126e8f){return function(_0x32d633){if(_0x32d633){return _0x32d633[_0x9feb('0x24')]()[_0x9feb('0x23')](function(){_0x5e7ab9[_0x9feb('0x1a')](0xcc)[_0x9feb('0x25')]();});}};}function handleEntityNotFound(_0x549607,_0x429bc4){return function(_0x2de64d){if(!_0x2de64d){_0x549607['sendStatus'](0x194);}return _0x2de64d;};}function handleError(_0x30fff9,_0x5df7fd){_0x5df7fd=_0x5df7fd||0x1f4;return function(_0x583ddb){logger[_0x9feb('0x26')](_0x583ddb[_0x9feb('0x27')]);if(_0x583ddb[_0x9feb('0x28')]){delete _0x583ddb[_0x9feb('0x28')];}_0x30fff9[_0x9feb('0x1a')](_0x5df7fd)[_0x9feb('0x29')](_0x583ddb);};}exports[_0x9feb('0x2a')]=function(_0x48ab3b,_0x383c54){var _0x293b0f={},_0x512e6d={},_0x22c23e={'count':0x0,'rows':[]};var _0x111ca2=_[_0x9feb('0x2b')](db[_0x9feb('0x2c')]['rawAttributes'],function(_0x3def41){return{'name':_0x3def41[_0x9feb('0x2d')],'type':_0x3def41[_0x9feb('0x2e')][_0x9feb('0x2f')]};});_0x512e6d['model']=_[_0x9feb('0x2b')](_0x111ca2,_0x9feb('0x28'));_0x512e6d[_0x9feb('0x30')]=_['keys'](_0x48ab3b[_0x9feb('0x30')]);_0x512e6d[_0x9feb('0x31')]=_[_0x9feb('0x32')](_0x512e6d[_0x9feb('0x33')],_0x512e6d[_0x9feb('0x30')]);_0x293b0f[_0x9feb('0x34')]=_[_0x9feb('0x32')](_0x512e6d[_0x9feb('0x33')],qs[_0x9feb('0x35')](_0x48ab3b['query'][_0x9feb('0x35')]));_0x293b0f[_0x9feb('0x34')]=_0x293b0f[_0x9feb('0x34')][_0x9feb('0x36')]?_0x293b0f[_0x9feb('0x34')]:_0x512e6d[_0x9feb('0x33')];if(!_0x48ab3b[_0x9feb('0x30')][_0x9feb('0x37')]('nolimit')){_0x293b0f[_0x9feb('0x1e')]=qs[_0x9feb('0x1e')](_0x48ab3b[_0x9feb('0x30')][_0x9feb('0x1e')]);_0x293b0f[_0x9feb('0x1d')]=qs[_0x9feb('0x1d')](_0x48ab3b[_0x9feb('0x30')]['offset']);}_0x293b0f[_0x9feb('0x38')]=qs[_0x9feb('0x39')](_0x48ab3b[_0x9feb('0x30')]['sort']);_0x293b0f[_0x9feb('0x3a')]=qs[_0x9feb('0x31')](_[_0x9feb('0x3b')](_0x48ab3b[_0x9feb('0x30')],_0x512e6d[_0x9feb('0x31')]),_0x111ca2);if(_0x48ab3b[_0x9feb('0x30')]['filter']){_0x293b0f['where']=_['merge'](_0x293b0f[_0x9feb('0x3a')],{'$or':_[_0x9feb('0x2b')](_0x111ca2,function(_0x2fd4b8){if(_0x2fd4b8[_0x9feb('0x2e')]!==_0x9feb('0x3c')){var _0x898d5b={};_0x898d5b[_0x2fd4b8[_0x9feb('0x28')]]={'$like':'%'+_0x48ab3b[_0x9feb('0x30')][_0x9feb('0x3d')]+'%'};return _0x898d5b;}})});}_0x293b0f=_[_0x9feb('0x3e')]({},_0x293b0f,_0x48ab3b['options']);var _0x3a1c12={'where':_0x293b0f['where']};return db['SquareRecording'][_0x9feb('0x1c')](_0x3a1c12)[_0x9feb('0x23')](function(_0x2a2f74){_0x22c23e[_0x9feb('0x1c')]=_0x2a2f74;if(_0x48ab3b[_0x9feb('0x30')][_0x9feb('0x3f')]){_0x293b0f['include']=[{'all':!![]}];}return db[_0x9feb('0x2c')]['findAll'](_0x293b0f);})['then'](function(_0x40b5c3){_0x22c23e['rows']=_0x40b5c3;return _0x22c23e;})[_0x9feb('0x23')](respondWithFilteredResult(_0x383c54,_0x293b0f))[_0x9feb('0x40')](handleError(_0x383c54,null));};exports[_0x9feb('0x41')]=function(_0x21d048,_0x2b6342){var _0x467f0b={'raw':!![],'where':{'id':_0x21d048[_0x9feb('0x42')]['id']}},_0x1471ab={};_0x1471ab[_0x9feb('0x33')]=_[_0x9feb('0x43')](db[_0x9feb('0x2c')][_0x9feb('0x44')]);_0x1471ab[_0x9feb('0x30')]=_[_0x9feb('0x43')](_0x21d048[_0x9feb('0x30')]);_0x1471ab[_0x9feb('0x31')]=_['intersection'](_0x1471ab['model'],_0x1471ab[_0x9feb('0x30')]);_0x467f0b[_0x9feb('0x34')]=_[_0x9feb('0x32')](_0x1471ab[_0x9feb('0x33')],qs[_0x9feb('0x35')](_0x21d048[_0x9feb('0x30')][_0x9feb('0x35')]));_0x467f0b[_0x9feb('0x34')]=_0x467f0b['attributes'][_0x9feb('0x36')]?_0x467f0b['attributes']:_0x1471ab[_0x9feb('0x33')];if(_0x21d048[_0x9feb('0x30')][_0x9feb('0x3f')]){_0x467f0b[_0x9feb('0x45')]=[{'all':!![]}];}_0x467f0b=_[_0x9feb('0x3e')]({},_0x467f0b,_0x21d048[_0x9feb('0x46')]);return db['SquareRecording'][_0x9feb('0x47')](_0x467f0b)[_0x9feb('0x23')](handleEntityNotFound(_0x2b6342,null))[_0x9feb('0x23')](respondWithResult(_0x2b6342,null))[_0x9feb('0x40')](handleError(_0x2b6342,null));};exports['create']=function(_0x138c01,_0x4cb49a){return db[_0x9feb('0x2c')][_0x9feb('0x48')](_0x138c01[_0x9feb('0x49')],{})[_0x9feb('0x23')](respondWithResult(_0x4cb49a,0xc9))[_0x9feb('0x40')](handleError(_0x4cb49a,null));};exports[_0x9feb('0x22')]=function(_0x486939,_0xd938c0){if(_0x486939[_0x9feb('0x49')]['id']){delete _0x486939[_0x9feb('0x49')]['id'];}return db[_0x9feb('0x2c')][_0x9feb('0x47')]({'where':{'id':_0x486939['params']['id']}})[_0x9feb('0x23')](handleEntityNotFound(_0xd938c0,null))[_0x9feb('0x23')](saveUpdates(_0x486939[_0x9feb('0x49')],null))['then'](respondWithResult(_0xd938c0,null))[_0x9feb('0x40')](handleError(_0xd938c0,null));};exports['download']=function(_0x3640fb,_0x34f5cc,_0x5859f2){var _0x3db826=require('../../components/encryptor');var _0x2c10d8=![];var _0x9613c6={};if(_0x3640fb[_0x9feb('0x30')][_0x9feb('0x2e')]&&_0x3640fb[_0x9feb('0x30')][_0x9feb('0x2e')]===_0x9feb('0x4a')){_0x9613c6['uniqueid']=_0x3640fb[_0x9feb('0x42')]['id'];}else{_0x9613c6['id']=_0x3640fb[_0x9feb('0x42')]['id'];}return db['SquareRecording']['find']({'where':_0x9613c6,'attributes':['id',_0x9feb('0x4b'),_0x9feb('0x4c')],'raw':!![]})[_0x9feb('0x23')](handleEntityNotFound(_0x34f5cc,null))[_0x9feb('0x23')](function(_0x4f25f8){if(_0x4f25f8){var _0x61e786=_0x4f25f8['savePath'];var _0x10da15=util[_0x9feb('0x4d')](_0x9feb('0x4e'),_0x61e786);if(fs[_0x9feb('0x4f')](_0x10da15)){_0x2c10d8=!![];return _0x3db826[_0x9feb('0x50')](_0x10da15,_0x61e786,config[_0x9feb('0x51')][_0x9feb('0x52')])[_0x9feb('0x23')](function(){return _0x4f25f8;});}return _0x4f25f8;}})[_0x9feb('0x23')](function(_0x38d589){if(_0x38d589){var _0x50dc68=_0x38d589['savePath'];if(!fs['existsSync'](_0x50dc68)){throw new db[(_0x9feb('0x53'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x38d589[_0x9feb('0x4c')]){return _0x34f5cc[_0x9feb('0x54')](_0x50dc68,_0x38d589[_0x9feb('0x4c')]+path['extname'](_0x50dc68),function(){if(_0x2c10d8){fs[_0x9feb('0x55')](_0x50dc68);}});}else{return _0x34f5cc[_0x9feb('0x54')](_0x50dc68,function(_0x6700a7){if(_0x2c10d8){fs[_0x9feb('0x55')](_0x50dc68);}});}}})[_0x9feb('0x40')](function(_0x4e9cce){if(_0x4e9cce[_0x9feb('0x56')]==='SquareRecording\x20not\x20found'){_0x34f5cc[_0x9feb('0x1a')](0x194)[_0x9feb('0x29')](_0x9feb('0x57'));}else{return handleError(_0x34f5cc,null);}});};exports['destroy']=function(_0x1a6f14,_0x249f66){return db[_0x9feb('0x2c')][_0x9feb('0x47')]({'where':{'id':_0x1a6f14[_0x9feb('0x42')]['id']}})[_0x9feb('0x23')](function(_0x3d78fe){if(!_0x3d78fe)throw new ReferenceError(_0x9feb('0x58'));return _0x3d78fe;})[_0x9feb('0x23')](function(_0x287826){var _0x40280c=_0x287826[_0x9feb('0x4b')];logger[_0x9feb('0x59')](_0x9feb('0x5a'),_0x40280c);if(!_['isNil'](_0x287826[_0x9feb('0x4b')])&&fs['existsSync'](_0x40280c)){logger[_0x9feb('0x59')](_0x9feb('0x5b')+_0x40280c+_0x9feb('0x5c'));fs[_0x9feb('0x5d')](_0x40280c);}_0x40280c=_0x40280c+'.cypher';if(!_[_0x9feb('0x5e')](_0x287826['savePath'])&&fs[_0x9feb('0x4f')](_0x40280c)){logger['info'](_0x9feb('0x5b')+_0x40280c+_0x9feb('0x5c'));fs[_0x9feb('0x5d')](_0x40280c);}return _0x287826;})[_0x9feb('0x23')](function(_0x35aff6){if(!_0x35aff6)throw new InternalError();return _0x35aff6[_0x9feb('0x24')]();})[_0x9feb('0x23')](function(){_0x249f66[_0x9feb('0x1a')](0xcc)[_0x9feb('0x25')]();})['catch'](handleError(_0x249f66,null));};
\ No newline at end of file
+var _0x1ab2=['find','catch','create','body','params','download','../../components/encryptor','uniqueid','savePath','%s.cypher','existsSync','decryptFile','recording','SquareRecording\x20not\x20found','filename','extname','unlink','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','show','keys','fields'];(function(_0xd970da,_0x3ce3d9){var _0x29bdbd=function(_0x6f9cf2){while(--_0x6f9cf2){_0xd970da['push'](_0xd970da['shift']());}};_0x29bdbd(++_0x3ce3d9);}(_0x1ab2,0x198));var _0x21ab=function(_0x23b4b5,_0xd7ea37){_0x23b4b5=_0x23b4b5-0x0;var _0x2a041a=_0x1ab2[_0x23b4b5];return _0x2a041a;};'use strict';var pdf=require(_0x21ab('0x0'));var emlformat=require(_0x21ab('0x1'));var rimraf=require(_0x21ab('0x2'));var zipdir=require(_0x21ab('0x3'));var jsonpatch=require(_0x21ab('0x4'));var rp=require('request-promise');var moment=require(_0x21ab('0x5'));var BPromise=require(_0x21ab('0x6'));var Mustache=require(_0x21ab('0x7'));var util=require(_0x21ab('0x8'));var path=require('path');var sox=require(_0x21ab('0x9'));var csv=require(_0x21ab('0xa'));var ejs=require(_0x21ab('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x21ab('0xc'));var deskjs=require(_0x21ab('0xd'));var toCsv=require(_0x21ab('0xa'));var querystring=require(_0x21ab('0xe'));var Papa=require('papaparse');var Redis=require(_0x21ab('0xf'));var authService=require(_0x21ab('0x10'));var qs=require(_0x21ab('0x11'));var as=require(_0x21ab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21ab('0x13'))(_0x21ab('0x14'));var utils=require(_0x21ab('0x15'));var config=require(_0x21ab('0x16'));var licenseUtil=require(_0x21ab('0x17'));var db=require(_0x21ab('0x18'))['db'];function respondWithStatusCode(_0x23f187,_0x44477a){_0x44477a=_0x44477a||0xcc;return function(_0x574626){if(_0x574626){return _0x23f187[_0x21ab('0x19')](_0x44477a);}return _0x23f187[_0x21ab('0x1a')](_0x44477a)[_0x21ab('0x1b')]();};}function respondWithResult(_0x2720b4,_0x4d655f){_0x4d655f=_0x4d655f||0xc8;return function(_0x3a7741){if(_0x3a7741){return _0x2720b4[_0x21ab('0x1a')](_0x4d655f)[_0x21ab('0x1c')](_0x3a7741);}};}function respondWithFilteredResult(_0x412345,_0x2d4b90){return function(_0x3784a6){if(_0x3784a6){var _0x2292a8=_0x3784a6[_0x21ab('0x1d')],_0x3414ec=_0x2d4b90[_0x21ab('0x1e')],_0x596e8a=_0x2d4b90[_0x21ab('0x1e')]+_0x2d4b90[_0x21ab('0x1f')],_0x9aa4ef;if(_0x596e8a>=_0x2292a8){_0x596e8a=_0x2292a8;_0x9aa4ef=0xc8;}else{_0x9aa4ef=0xce;}_0x412345[_0x21ab('0x1a')](_0x9aa4ef);return _0x412345[_0x21ab('0x20')](_0x21ab('0x21'),_0x3414ec+'-'+_0x596e8a+'/'+_0x2292a8)[_0x21ab('0x1c')](_0x3784a6);}return null;};}function patchUpdates(_0x49061f){return function(_0x3ac3e7){try{jsonpatch[_0x21ab('0x22')](_0x3ac3e7,_0x49061f,!![]);}catch(_0x36f474){return BPromise[_0x21ab('0x23')](_0x36f474);}return _0x3ac3e7[_0x21ab('0x24')]();};}function saveUpdates(_0x11e005,_0x5df8de){return function(_0xeae02e){if(_0xeae02e){return _0xeae02e[_0x21ab('0x25')](_0x11e005)[_0x21ab('0x26')](function(_0xcf7bca){return _0xcf7bca;});}return null;};}function removeEntity(_0x3e7ad8,_0x11a316){return function(_0x4bd5f1){if(_0x4bd5f1){return _0x4bd5f1[_0x21ab('0x27')]()[_0x21ab('0x26')](function(){_0x3e7ad8['status'](0xcc)[_0x21ab('0x1b')]();});}};}function handleEntityNotFound(_0x59b216,_0x18601b){return function(_0x205ce9){if(!_0x205ce9){_0x59b216[_0x21ab('0x19')](0x194);}return _0x205ce9;};}function handleError(_0x211e59,_0x4e5157){_0x4e5157=_0x4e5157||0x1f4;return function(_0x22685a){logger[_0x21ab('0x28')](_0x22685a[_0x21ab('0x29')]);if(_0x22685a[_0x21ab('0x2a')]){delete _0x22685a[_0x21ab('0x2a')];}_0x211e59['status'](_0x4e5157)['send'](_0x22685a);};}exports[_0x21ab('0x2b')]=function(_0x2263bc,_0x2e5740){var _0x3efd47={},_0x407d01={},_0x42e897={'count':0x0,'rows':[]};var _0x29d5cb=_['map'](db['SquareRecording'][_0x21ab('0x2c')],function(_0x13bed4){return{'name':_0x13bed4[_0x21ab('0x2d')],'type':_0x13bed4['type'][_0x21ab('0x2e')]};});_0x407d01['model']=_[_0x21ab('0x2f')](_0x29d5cb,_0x21ab('0x2a'));_0x407d01['query']=_['keys'](_0x2263bc[_0x21ab('0x30')]);_0x407d01[_0x21ab('0x31')]=_[_0x21ab('0x32')](_0x407d01[_0x21ab('0x33')],_0x407d01[_0x21ab('0x30')]);_0x3efd47[_0x21ab('0x34')]=_[_0x21ab('0x32')](_0x407d01[_0x21ab('0x33')],qs['fields'](_0x2263bc[_0x21ab('0x30')]['fields']));_0x3efd47[_0x21ab('0x34')]=_0x3efd47['attributes'][_0x21ab('0x35')]?_0x3efd47[_0x21ab('0x34')]:_0x407d01[_0x21ab('0x33')];if(!_0x2263bc['query'][_0x21ab('0x36')]('nolimit')){_0x3efd47[_0x21ab('0x1f')]=qs['limit'](_0x2263bc[_0x21ab('0x30')][_0x21ab('0x1f')]);_0x3efd47[_0x21ab('0x1e')]=qs[_0x21ab('0x1e')](_0x2263bc[_0x21ab('0x30')][_0x21ab('0x1e')]);}_0x3efd47[_0x21ab('0x37')]=qs['sort'](_0x2263bc[_0x21ab('0x30')][_0x21ab('0x38')]);_0x3efd47['where']=qs[_0x21ab('0x31')](_[_0x21ab('0x39')](_0x2263bc[_0x21ab('0x30')],_0x407d01['filters']),_0x29d5cb);if(_0x2263bc[_0x21ab('0x30')][_0x21ab('0x3a')]){_0x3efd47[_0x21ab('0x3b')]=_[_0x21ab('0x3c')](_0x3efd47[_0x21ab('0x3b')],{'$or':_[_0x21ab('0x2f')](_0x29d5cb,function(_0x4e297a){if(_0x4e297a[_0x21ab('0x3d')]!==_0x21ab('0x3e')){var _0x5cf0cc={};_0x5cf0cc[_0x4e297a[_0x21ab('0x2a')]]={'$like':'%'+_0x2263bc['query'][_0x21ab('0x3a')]+'%'};return _0x5cf0cc;}})});}_0x3efd47=_[_0x21ab('0x3c')]({},_0x3efd47,_0x2263bc[_0x21ab('0x3f')]);var _0x268d6a={'where':_0x3efd47[_0x21ab('0x3b')]};return db['SquareRecording'][_0x21ab('0x1d')](_0x268d6a)[_0x21ab('0x26')](function(_0x1dc674){_0x42e897['count']=_0x1dc674;if(_0x2263bc['query'][_0x21ab('0x40')]){_0x3efd47[_0x21ab('0x41')]=[{'all':!![]}];}return db[_0x21ab('0x42')][_0x21ab('0x43')](_0x3efd47);})[_0x21ab('0x26')](function(_0x3d7373){_0x42e897[_0x21ab('0x44')]=_0x3d7373;return _0x42e897;})[_0x21ab('0x26')](respondWithFilteredResult(_0x2e5740,_0x3efd47))['catch'](handleError(_0x2e5740,null));};exports[_0x21ab('0x45')]=function(_0x50c533,_0x276031){var _0x157a47={'raw':!![],'where':{'id':_0x50c533['params']['id']}},_0x35b707={};_0x35b707[_0x21ab('0x33')]=_['keys'](db[_0x21ab('0x42')][_0x21ab('0x2c')]);_0x35b707[_0x21ab('0x30')]=_[_0x21ab('0x46')](_0x50c533[_0x21ab('0x30')]);_0x35b707[_0x21ab('0x31')]=_[_0x21ab('0x32')](_0x35b707[_0x21ab('0x33')],_0x35b707['query']);_0x157a47[_0x21ab('0x34')]=_['intersection'](_0x35b707['model'],qs[_0x21ab('0x47')](_0x50c533[_0x21ab('0x30')][_0x21ab('0x47')]));_0x157a47[_0x21ab('0x34')]=_0x157a47['attributes']['length']?_0x157a47[_0x21ab('0x34')]:_0x35b707['model'];if(_0x50c533[_0x21ab('0x30')][_0x21ab('0x40')]){_0x157a47[_0x21ab('0x41')]=[{'all':!![]}];}_0x157a47=_['merge']({},_0x157a47,_0x50c533['options']);return db[_0x21ab('0x42')][_0x21ab('0x48')](_0x157a47)[_0x21ab('0x26')](handleEntityNotFound(_0x276031,null))[_0x21ab('0x26')](respondWithResult(_0x276031,null))[_0x21ab('0x49')](handleError(_0x276031,null));};exports[_0x21ab('0x4a')]=function(_0x433aa7,_0x3cd07c){return db[_0x21ab('0x42')]['create'](_0x433aa7[_0x21ab('0x4b')],{})[_0x21ab('0x26')](respondWithResult(_0x3cd07c,0xc9))[_0x21ab('0x49')](handleError(_0x3cd07c,null));};exports['update']=function(_0x142862,_0x484eba){if(_0x142862[_0x21ab('0x4b')]['id']){delete _0x142862[_0x21ab('0x4b')]['id'];}return db[_0x21ab('0x42')]['find']({'where':{'id':_0x142862[_0x21ab('0x4c')]['id']}})[_0x21ab('0x26')](handleEntityNotFound(_0x484eba,null))[_0x21ab('0x26')](saveUpdates(_0x142862[_0x21ab('0x4b')],null))['then'](respondWithResult(_0x484eba,null))['catch'](handleError(_0x484eba,null));};exports[_0x21ab('0x4d')]=function(_0x210c2e,_0x4c5cea,_0x46f471){var _0x2d4675=require(_0x21ab('0x4e'));var _0x2b86d1=![];var _0x3c7c8c={};if(_0x210c2e[_0x21ab('0x30')][_0x21ab('0x3d')]&&_0x210c2e[_0x21ab('0x30')][_0x21ab('0x3d')]==='uniqueid'){_0x3c7c8c[_0x21ab('0x4f')]=_0x210c2e[_0x21ab('0x4c')]['id'];}else{_0x3c7c8c['id']=_0x210c2e[_0x21ab('0x4c')]['id'];}return db[_0x21ab('0x42')]['find']({'where':_0x3c7c8c,'attributes':['id',_0x21ab('0x50'),'filename'],'raw':!![]})[_0x21ab('0x26')](handleEntityNotFound(_0x4c5cea,null))[_0x21ab('0x26')](function(_0x28e9d4){if(_0x28e9d4){var _0x42a5ce=_0x28e9d4['savePath'];var _0x3f646c=util['format'](_0x21ab('0x51'),_0x42a5ce);if(fs[_0x21ab('0x52')](_0x3f646c)){_0x2b86d1=!![];return _0x2d4675[_0x21ab('0x53')](_0x3f646c,_0x42a5ce,config['secrets'][_0x21ab('0x54')])[_0x21ab('0x26')](function(){return _0x28e9d4;});}return _0x28e9d4;}})[_0x21ab('0x26')](function(_0x4e5c82){if(_0x4e5c82){var _0x4d48cf=_0x4e5c82[_0x21ab('0x50')];if(!fs[_0x21ab('0x52')](_0x4d48cf)){throw new db['Sequelize']['ValidationError'](_0x21ab('0x55'));}if(_0x4e5c82[_0x21ab('0x56')]){return _0x4c5cea[_0x21ab('0x4d')](_0x4d48cf,_0x4e5c82[_0x21ab('0x56')]+path[_0x21ab('0x57')](_0x4d48cf),function(){if(_0x2b86d1){fs[_0x21ab('0x58')](_0x4d48cf);}});}else{return _0x4c5cea[_0x21ab('0x4d')](_0x4d48cf,function(_0xac4075){if(_0x2b86d1){fs[_0x21ab('0x58')](_0x4d48cf);}});}}})[_0x21ab('0x49')](function(_0x1a07eb){if(_0x1a07eb['message']===_0x21ab('0x55')){_0x4c5cea[_0x21ab('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x4c5cea,null);}});};exports[_0x21ab('0x27')]=function(_0x25aa0f,_0x253774){return db[_0x21ab('0x42')][_0x21ab('0x48')]({'where':{'id':_0x25aa0f[_0x21ab('0x4c')]['id']}})['then'](function(_0x1c79a3){if(!_0x1c79a3)throw new ReferenceError(_0x21ab('0x59'));return _0x1c79a3;})[_0x21ab('0x26')](function(_0x6e4705){var _0x54e077=_0x6e4705['savePath'];logger['info'](_0x21ab('0x5a'),_0x54e077);if(!_[_0x21ab('0x5b')](_0x6e4705[_0x21ab('0x50')])&&fs['existsSync'](_0x54e077)){logger[_0x21ab('0x5c')](_0x21ab('0x5d')+_0x54e077+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x21ab('0x5e')](_0x54e077);}_0x54e077=_0x54e077+'.cypher';if(!_[_0x21ab('0x5b')](_0x6e4705[_0x21ab('0x50')])&&fs[_0x21ab('0x52')](_0x54e077)){logger[_0x21ab('0x5c')](_0x21ab('0x5d')+_0x54e077+_0x21ab('0x5f'));fs[_0x21ab('0x5e')](_0x54e077);}return _0x6e4705;})[_0x21ab('0x26')](function(_0x5857b2){if(!_0x5857b2)throw new InternalError();return _0x5857b2[_0x21ab('0x27')]();})['then'](function(){_0x253774[_0x21ab('0x1a')](0xcc)[_0x21ab('0x1b')]();})[_0x21ab('0x49')](handleError(_0x253774,null));};
\ No newline at end of file