Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / api / voiceRecording / voiceRecording.controller.js
index 619b70e..d68892b 100644 (file)
@@ -1 +1 @@
-const a771_0x5a79=['rows','Cloud\x20Provider\x20not\x20available','runTranscribe','Sentiment\x20Analysis\x20not\x20configured','Transcribe\x20not\x20configured','sentimentAccountId','uniqueid','findOne','count','fields','TranscriptionJobName','IN_PROGRESS','key','TranscriptionJobStatus','listBuckets','../../config/environment','value','update','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','unlinkSync','json','transcribeStatus','sentimentRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','and','then','Name','name','Setting','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','intersection','isNil','limit','TranscribeService','secrets','pick','like','sequelize','cancellazione\x20fisica\x20documento\x20%s','$and','.cypher','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','unlink','NEW','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','api','query','data1','writeFile','existsSync','transcribe','language','attributes','merge','where','aws-sdk','end','/server/files/transcribes/transcribe_','createBucket','basename','map','filter','push','fieldName','../../components/parsers/qs','.txt','path','type','filename','downloads','decryptFile','transcribeAccountId','offset','status','Transcript\x20not\x20available','keys','downloadTranscribe','error','startTranscriptionJob','fileText','Content-Range','undefined','VoiceRecording','../../config/logger','send','Not\x20found','include','includeAll','upload','../../mysqldb','Voice\x20Recording\x20not\x20found','root','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','%s.cypher','TranscriptionJob','destroy','params','length','filters','recording','differenceBy','show','Buckets','Location','extname','sendStatus','findAll','runSentiment','body','error-middleware/errors','sort','data2','info','tempSentiment','model','message','find','MD5','format','download','rawAttributes','describe','uuid','VoiceRecording\x20not\x20found','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','../../components/encryptor','bucket','CloudProvider','sentiment','token','set','options','catch'];(function(_0x50a5ef,_0x5a79cc){const _0x18a806=function(_0xb6233b){while(--_0xb6233b){_0x50a5ef['push'](_0x50a5ef['shift']());}};_0x18a806(++_0x5a79cc);}(a771_0x5a79,0x106));const a771_0x18a8=function(_0x50a5ef,_0x5a79cc){_0x50a5ef=_0x50a5ef-0x0;let _0x18a806=a771_0x5a79[_0x50a5ef];return _0x18a806;};const _0x2adc94=a771_0x18a8;'use strict';const util=require('util'),path=require(_0x2adc94('0x4b')),fs=require('fs'),_=require('lodash'),AWS=require(_0x2adc94('0x40')),{v4:uuidv4}=require(_0x2adc94('0x83')),qs=require(_0x2adc94('0x49')),logger=require(_0x2adc94('0x5c'))(_0x2adc94('0x36')),config=require(_0x2adc94('0x17')),db=require(_0x2adc94('0x62'))['db'],{Op,fn,col,ValidationError}=require(_0x2adc94('0x2e')),{InternalError}=require(_0x2adc94('0x76'));function respondWithResult(_0xb6233b,_0x598282){return _0x598282=_0x598282||0xc8,function(_0x247883){const _0x141174=a771_0x18a8;if(_0x247883)return _0xb6233b[_0x141174('0x52')](_0x598282)[_0x141174('0x1c')](_0x247883);};}function respondWithFilteredResult(_0x199f08,_0x5b2434){return function(_0x1a22f7){const _0x3fafc8=a771_0x18a8;if(_0x1a22f7){const _0x5add2d=_0x1a22f7[_0x3fafc8('0x10')],_0x1a7ac4=_0x5b2434[_0x3fafc8('0x51')];let _0x4726b4=_0x5b2434[_0x3fafc8('0x51')]+_0x5b2434[_0x3fafc8('0x29')],_0x4fb701;return _0x4726b4>=_0x5add2d?(_0x4726b4=_0x5add2d,_0x4fb701=0xc8):_0x4fb701=0xce,_0x199f08[_0x3fafc8('0x52')](_0x4fb701),_0x199f08[_0x3fafc8('0x5')](_0x3fafc8('0x59'),_0x1a7ac4+'-'+_0x4726b4+'/'+_0x5add2d)['json'](_0x1a22f7);}return null;};}function saveUpdates(_0x1e9bb2){return function(_0x2fe6d2){const _0x1e4b26=a771_0x18a8;if(_0x2fe6d2)return _0x2fe6d2[_0x1e4b26('0x19')](_0x1e9bb2)[_0x1e4b26('0x21')](function(_0x32cabc){return _0x32cabc;});return null;};}function handleEntityNotFound(_0x240c26){return function(_0x16e48a){const _0x4d7657=a771_0x18a8;return!_0x16e48a&&_0x240c26[_0x4d7657('0x72')](0x194),_0x16e48a;};}function handleError(_0x54c7d6,_0x44e968){return _0x44e968=_0x44e968||0x1f4,function(_0x17be38){const _0xcd9ed=a771_0x18a8;logger[_0xcd9ed('0x56')](_0x17be38['stack']),_0x17be38[_0xcd9ed('0x23')]&&delete _0x17be38[_0xcd9ed('0x23')],_0x54c7d6[_0xcd9ed('0x52')](_0x44e968)[_0xcd9ed('0x5d')](_0x17be38);};}exports['index']=function(_0x5fb0ec,_0x4a7b26){const _0x3b8c6f=_0x2adc94;let _0xca96b7={};const _0x269027={},_0x1937e9={'count':0x0,'rows':[]},_0x160e5e=_[_0x3b8c6f('0x45')](db[_0x3b8c6f('0x5b')][_0x3b8c6f('0x81')],function(_0x495bd7){const _0x13dd0d=_0x3b8c6f;return{'name':_0x495bd7[_0x13dd0d('0x48')],'type':_0x495bd7[_0x13dd0d('0x4c')][_0x13dd0d('0x14')]};});_0x269027[_0x3b8c6f('0x7b')]=_[_0x3b8c6f('0x6d')](_[_0x3b8c6f('0x45')](_0x160e5e,_0x3b8c6f('0x23')),[_0x3b8c6f('0x7f')]),_0x269027[_0x3b8c6f('0x37')]=_[_0x3b8c6f('0x54')](_0x5fb0ec[_0x3b8c6f('0x37')]),_0x269027[_0x3b8c6f('0x6b')]=_[_0x3b8c6f('0x27')](_0x269027[_0x3b8c6f('0x7b')],_0x269027['query']),_0xca96b7[_0x3b8c6f('0x3d')]=_[_0x3b8c6f('0x27')](_0x269027[_0x3b8c6f('0x7b')],qs[_0x3b8c6f('0x11')](_0x5fb0ec[_0x3b8c6f('0x37')][_0x3b8c6f('0x11')])),_0xca96b7[_0x3b8c6f('0x3d')]=_0xca96b7[_0x3b8c6f('0x3d')]['length']?_0xca96b7[_0x3b8c6f('0x3d')]:_0x269027['model'];typeof _0x5fb0ec[_0x3b8c6f('0x37')]['nolimit']===_0x3b8c6f('0x5a')&&(_0xca96b7[_0x3b8c6f('0x29')]=qs[_0x3b8c6f('0x29')](_0x5fb0ec[_0x3b8c6f('0x37')]['limit']),_0xca96b7[_0x3b8c6f('0x51')]=qs[_0x3b8c6f('0x51')](_0x5fb0ec[_0x3b8c6f('0x37')][_0x3b8c6f('0x51')]));_0xca96b7['order']=qs[_0x3b8c6f('0x77')](_0x5fb0ec['query'][_0x3b8c6f('0x77')]),_0xca96b7[_0x3b8c6f('0x3f')]=qs[_0x3b8c6f('0x6b')](_[_0x3b8c6f('0x2c')](_0x5fb0ec[_0x3b8c6f('0x37')],_0x269027[_0x3b8c6f('0x6b')]),_0x160e5e);_0x5fb0ec[_0x3b8c6f('0x37')][_0x3b8c6f('0x46')]&&(_0xca96b7[_0x3b8c6f('0x3f')]=_['merge'](_0xca96b7['where'],{[Op['or']]:_[_0x3b8c6f('0x45')](_0x160e5e,function(_0x2a4bbf){const _0x3909cc=_0x3b8c6f;if(_0x2a4bbf[_0x3909cc('0x4c')]!=='VIRTUAL'){const _0x453748={};return _0x453748[_0x2a4bbf[_0x3909cc('0x23')]]={[Op[_0x3909cc('0x2d')]]:'%'+_0x5fb0ec[_0x3909cc('0x37')][_0x3909cc('0x46')]+'%'},_0x453748;}})}));_0xca96b7=_[_0x3b8c6f('0x3e')]({},_0xca96b7,_0x5fb0ec[_0x3b8c6f('0x6')]);const _0x6677fd={'where':_0xca96b7[_0x3b8c6f('0x3f')]};return db[_0x3b8c6f('0x5b')][_0x3b8c6f('0x10')](_0x6677fd)[_0x3b8c6f('0x21')](function(_0x1cd8b4){const _0x3d550f=_0x3b8c6f;return _0x1937e9[_0x3d550f('0x10')]=_0x1cd8b4,_0x5fb0ec[_0x3d550f('0x37')]['includeAll']&&(_0xca96b7[_0x3d550f('0x5f')]=[{'all':!![]}]),db[_0x3d550f('0x5b')][_0x3d550f('0x73')](_0xca96b7);})['then'](function(_0x451bd7){const _0x1d4691=_0x3b8c6f;return _0x1937e9[_0x1d4691('0x8')]=_0x451bd7,_0x1937e9;})['then'](respondWithFilteredResult(_0x4a7b26,_0xca96b7))[_0x3b8c6f('0x7')](handleError(_0x4a7b26,null));},exports[_0x2adc94('0x6e')]=function(_0x4a6129,_0x300b36){const _0x453d17=_0x2adc94;let _0x56cafb={'raw':![],'where':{'id':_0x4a6129[_0x453d17('0x69')]['id']}};const _0x389826={};return _0x389826[_0x453d17('0x7b')]=_[_0x453d17('0x54')](db['VoiceRecording'][_0x453d17('0x81')]),_0x389826[_0x453d17('0x37')]=_[_0x453d17('0x54')](_0x4a6129[_0x453d17('0x37')]),_0x389826['filters']=_['intersection'](_0x389826[_0x453d17('0x7b')],_0x389826[_0x453d17('0x37')]),_0x56cafb[_0x453d17('0x3d')]=_['intersection'](_0x389826[_0x453d17('0x7b')],qs['fields'](_0x4a6129['query'][_0x453d17('0x11')])),_0x56cafb[_0x453d17('0x3d')]=_0x56cafb[_0x453d17('0x3d')][_0x453d17('0x6a')]?_0x56cafb[_0x453d17('0x3d')]:_0x389826[_0x453d17('0x7b')],_0x4a6129['query'][_0x453d17('0x60')]&&(_0x56cafb['include']=[{'all':!![]}]),_0x56cafb=_[_0x453d17('0x3e')]({},_0x56cafb,_0x4a6129['options']),db[_0x453d17('0x5b')][_0x453d17('0xf')](_0x56cafb)[_0x453d17('0x21')](handleEntityNotFound(_0x300b36,null))[_0x453d17('0x21')](respondWithResult(_0x300b36,null))[_0x453d17('0x7')](handleError(_0x300b36,null));},exports['create']=function(_0x540e9a,_0x5c2500){const _0x28143c=_0x2adc94;return db['VoiceRecording']['create'](_0x540e9a[_0x28143c('0x75')],{})[_0x28143c('0x21')](respondWithResult(_0x5c2500,0xc9))[_0x28143c('0x7')](handleError(_0x5c2500,null));},exports[_0x2adc94('0x19')]=function(_0x25c144,_0x251ae0){const _0x21fbca=_0x2adc94;return _0x25c144[_0x21fbca('0x75')]['id']&&delete _0x25c144['body']['id'],db[_0x21fbca('0x5b')][_0x21fbca('0xf')]({'where':{'id':_0x25c144['params']['id']}})[_0x21fbca('0x21')](handleEntityNotFound(_0x251ae0,null))['then'](saveUpdates(_0x25c144[_0x21fbca('0x75')],null))[_0x21fbca('0x21')](respondWithResult(_0x251ae0,null))['catch'](handleError(_0x251ae0,null));},exports[_0x2adc94('0x82')]=function(_0x549439,_0x4f141e){const _0x3b61a0=_0x2adc94;return db['VoiceRecording'][_0x3b61a0('0x82')]()[_0x3b61a0('0x21')](respondWithResult(_0x4f141e,null))[_0x3b61a0('0x7')](handleError(_0x4f141e,null));},exports[_0x2adc94('0x80')]=function(_0xf21ed8,_0x229a91){const _0x977398=_0x2adc94,_0x36721b=require('../../components/encryptor');let _0x3b190b=![];const _0x272351={};return _0xf21ed8[_0x977398('0x37')][_0x977398('0x4c')]&&_0xf21ed8[_0x977398('0x37')][_0x977398('0x4c')]==='uniqueid'?_0x272351[_0x977398('0xe')]=_0xf21ed8[_0x977398('0x69')]['id']:_0x272351['id']=_0xf21ed8[_0x977398('0x69')]['id'],db[_0x977398('0x5b')]['findOne']({'where':_0x272351,'attributes':['id',_0x977398('0x18')],'raw':!![]})['then'](handleEntityNotFound(_0x229a91,null))[_0x977398('0x21')](function(_0x85a31f){const _0x59fd73=_0x977398;if(_0x85a31f){const _0x3fcdf9=_0x85a31f[_0x59fd73('0x18')],_0x3ee639=util[_0x59fd73('0x7f')]('%s.cypher',_0x3fcdf9);if(fs[_0x59fd73('0x3a')](_0x3ee639))return _0x3b190b=!![],_0x36721b[_0x59fd73('0x4f')](_0x3ee639,_0x3fcdf9,config['secrets'][_0x59fd73('0x6c')])[_0x59fd73('0x21')](function(){return _0x85a31f;});return _0x85a31f;}})[_0x977398('0x21')](function(_0x511430){const _0x402c9b=_0x977398;if(_0x511430){const _0x41a8fa=_0x511430['value'];if(!fs[_0x402c9b('0x3a')](_0x41a8fa))throw new ValidationError(_0x402c9b('0x84'));return _0x511430[_0x402c9b('0x4d')]?_0x229a91[_0x402c9b('0x80')](_0x41a8fa,_0x511430['filename']+path[_0x402c9b('0x71')](_0x41a8fa),function(){const _0x54babc=_0x402c9b;_0x3b190b&&fs[_0x54babc('0x33')](_0x41a8fa);}):_0x229a91[_0x402c9b('0x80')](_0x41a8fa,function(){_0x3b190b&&fs['unlink'](_0x41a8fa);});}})['catch'](function(_0x2f8602){const _0x1d324c=_0x977398;if(_0x2f8602[_0x1d324c('0x7c')]==='VoiceRecording\x20not\x20found')_0x229a91['status'](0x194)[_0x1d324c('0x5d')](_0x1d324c('0x5e'));else return handleError(_0x229a91,null);});},exports[_0x2adc94('0x4e')]=function(_0x3eb6b6,_0x44023e){const _0x3f5741=_0x2adc94,_0x408e86=require(_0x3f5741('0x0'));let _0x12c98d=![];const _0x536806={[Op[_0x3f5741('0x20')]]:[_0x536806(fn(_0x3f5741('0x7e'),col(_0x3f5741('0xe'))),_0x3eb6b6[_0x3f5741('0x37')][_0x3f5741('0x4')])]};return _0x3eb6b6[_0x3f5741('0x37')][_0x3f5741('0x4c')]&&_0x3eb6b6[_0x3f5741('0x37')]['type']===_0x3f5741('0xe')?_0x536806[_0x3f5741('0x30')]['push']({'uniqueid':_0x3eb6b6['params']['id']}):_0x536806[_0x3f5741('0x30')][_0x3f5741('0x47')]({'id':_0x3eb6b6['params']['id']}),db[_0x3f5741('0x5b')]['findOne']({'where':_0x536806,'attributes':['id','value'],'raw':!![]})[_0x3f5741('0x21')](handleEntityNotFound(_0x44023e,null))[_0x3f5741('0x21')](function(_0x3d188a){const _0x1be381=_0x3f5741;if(_0x3d188a){const _0x407e6d=util['format'](_0x1be381('0x66'),_0x3d188a[_0x1be381('0x18')]);if(fs['existsSync'](_0x407e6d))return _0x12c98d=!![],_0x408e86[_0x1be381('0x4f')](_0x407e6d,_0x3d188a['value'],config[_0x1be381('0x2b')][_0x1be381('0x6c')])[_0x1be381('0x21')](function(){return _0x3d188a;});return _0x3d188a;}})[_0x3f5741('0x21')](function(_0x2c666b){const _0x1fb813=_0x3f5741;if(_0x2c666b){if(!fs[_0x1fb813('0x3a')](_0x2c666b['value']))throw new ValidationError('VoiceRecording\x20not\x20found');return _0x2c666b[_0x1fb813('0x4d')]?_0x44023e['download'](_0x2c666b[_0x1fb813('0x18')],_0x2c666b[_0x1fb813('0x4d')]+path['extname'](_0x2c666b[_0x1fb813('0x18')]),function(){const _0x583637=_0x1fb813;_0x12c98d&&fs[_0x583637('0x33')](_0x2c666b[_0x583637('0x18')]);}):_0x44023e[_0x1fb813('0x80')](_0x2c666b['value'],function(){const _0x3c9d0d=_0x1fb813;_0x12c98d&&fs[_0x3c9d0d('0x33')](_0x2c666b[_0x3c9d0d('0x18')]);});}})['catch'](handleError(_0x44023e,null));},exports[_0x2adc94('0x68')]=function(_0x3281e1,_0x2edc91){const _0x1fd1aa=_0x2adc94;return db['VoiceRecording']['findOne']({'where':{'id':_0x3281e1[_0x1fd1aa('0x69')]['id']}})['then'](function(_0x2f87a3){if(!_0x2f87a3)throw new ReferenceError('Entity\x20not\x20found');return _0x2f87a3;})[_0x1fd1aa('0x21')](function(_0x1e44d4){const _0x5a19eb=_0x1fd1aa;let _0x32e74e=_0x1e44d4[_0x5a19eb('0x18')];return logger[_0x5a19eb('0x79')](_0x5a19eb('0x2f'),_0x32e74e),!_[_0x5a19eb('0x28')](_0x1e44d4[_0x5a19eb('0x18')])&&fs[_0x5a19eb('0x3a')](_0x32e74e)&&(logger[_0x5a19eb('0x79')](_0x5a19eb('0x26')+_0x32e74e+_0x5a19eb('0x25')),fs[_0x5a19eb('0x1b')](_0x32e74e)),_0x32e74e=_0x32e74e+_0x5a19eb('0x31'),!_[_0x5a19eb('0x28')](_0x1e44d4['value'])&&fs[_0x5a19eb('0x3a')](_0x32e74e)&&(logger[_0x5a19eb('0x79')](_0x5a19eb('0x26')+_0x32e74e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione'),fs[_0x5a19eb('0x1b')](_0x32e74e)),_0x1e44d4;})[_0x1fd1aa('0x21')](function(_0x3d1229){if(!_0x3d1229)throw new InternalError();return _0x3d1229['destroy']();})[_0x1fd1aa('0x21')](function(){const _0x2e7afe=_0x1fd1aa;_0x2edc91[_0x2e7afe('0x52')](0xcc)[_0x2e7afe('0x41')]();})['catch'](handleError(_0x2edc91,null));};function getBucketslist(_0x15f6d4,_0x36acad,_0x368470){return new Promise(function(_0xc7bf4e,_0x48e12a){const _0x2ddf4a=a771_0x18a8,_0x221d7e=new AWS['S3']({'accessKeyId':_0x36acad,'secretAccessKey':_0x15f6d4,'region':_0x368470});_0x221d7e[_0x2ddf4a('0x16')]({},function(_0x5f0fd4,_0x47c3c3){return _0x5f0fd4?_0x48e12a(_0x5f0fd4):_0xc7bf4e(_0x47c3c3);});});}function createBucket(_0x6861c5,_0x42db95,_0x29cf20,_0x52c746){return new Promise(function(_0x3eb656,_0x4d5a36){const _0x5df473=a771_0x18a8,_0x3459e5=new AWS['S3']({'accessKeyId':_0x42db95,'secretAccessKey':_0x6861c5,'region':_0x29cf20});_0x3459e5[_0x5df473('0x43')]({'Bucket':_0x52c746},function(_0x434607,_0x5a8a46){return _0x434607?_0x4d5a36(_0x434607):_0x3eb656(_0x5a8a46);});});}function uploadFile(_0x58b767,_0x2f4c59,_0x1fd17d,_0xbb3b80,_0x1f44f6,_0x3cf293){return new Promise(function(_0x3efb55,_0xef6d60){const _0x55b1fa=a771_0x18a8,_0x4b7284=new AWS['S3']({'accessKeyId':_0x2f4c59,'secretAccessKey':_0x58b767,'region':_0x1fd17d});_0x4b7284[_0x55b1fa('0x61')]({'Bucket':_0xbb3b80,'Key':_0x1f44f6,'Body':_0x3cf293},function(_0xb320c6,_0x2f5c1a){return _0xb320c6?_0xef6d60(_0xb320c6):_0x3efb55(_0x2f5c1a);});});}function startTranscribe(_0x4dfb2c,_0x408bce,_0x3de5b9,_0x599f7c,_0x451e3b,_0x4f0e7b){return new Promise(function(_0x244300,_0xd74072){const _0x1390d3=a771_0x18a8,_0x8c31fa=new AWS[(_0x1390d3('0x2a'))]({'accessKeyId':_0x408bce,'secretAccessKey':_0x4dfb2c,'region':_0x3de5b9});_0x8c31fa[_0x1390d3('0x57')]({'TranscriptionJobName':_0x599f7c,'LanguageCode':_0x451e3b,'Media':{'MediaFileUri':_0x4f0e7b}},function(_0x26b3d9,_0x59dbce){return _0x26b3d9?_0xd74072(_0x26b3d9):_0x244300(_0x59dbce);});});}function transcribe(_0x541fc8,_0x392586,_0x27b0b1,_0x3369b7,_0x8eca44,_0x24a037,_0x2a76ec){return new Promise(function(_0x501e7b,_0x28dfd6){const _0x5a6b53=a771_0x18a8,_0x58c75e={};return logger[_0x5a6b53('0x79')](util[_0x5a6b53('0x7f')](_0x5a6b53('0x32'),_0x541fc8,_0x8eca44)),uploadFile(_0x392586,_0x27b0b1,_0x3369b7,_0x8eca44,path[_0x5a6b53('0x44')](_0x24a037),fs['readFileSync'](_0x24a037))['then'](function(_0x17fb0b){const _0x46d7d8=_0x5a6b53;return logger['info'](util[_0x46d7d8('0x7f')](_0x46d7d8('0x65'),_0x541fc8,_0x8eca44,_0x17fb0b[_0x46d7d8('0x70')])),_0x58c75e[_0x46d7d8('0x1')]=_0x17fb0b['Bucket'],_0x58c75e['location']=_0x17fb0b[_0x46d7d8('0x70')],logger[_0x46d7d8('0x79')](util[_0x46d7d8('0x7f')](_0x46d7d8('0x86'),_0x541fc8)),startTranscribe(_0x392586,_0x27b0b1,_0x3369b7,uuidv4(),_0x2a76ec,_0x17fb0b[_0x46d7d8('0x70')]);})[_0x5a6b53('0x21')](function(_0x2c8d0e){const _0x5464b2=_0x5a6b53;return logger[_0x5464b2('0x79')](util[_0x5464b2('0x7f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x541fc8,_0x2c8d0e[_0x5464b2('0x67')]['TranscriptionJobName'])),_0x58c75e['transcribeName']=_0x2c8d0e['TranscriptionJob'][_0x5464b2('0x12')],_0x58c75e[_0x5464b2('0x1d')]=_0x2c8d0e[_0x5464b2('0x67')][_0x5464b2('0x15')],_0x501e7b(_0x58c75e);})[_0x5a6b53('0x7')](function(_0x3fa415){return _0x28dfd6(_0x3fa415);});});}exports[_0x2adc94('0xa')]=function(_0x1320b5,_0x24790a){const _0x735568=_0x2adc94;let _0x212249,_0x21cf30,_0x233510;const _0x26033d=require(_0x735568('0x0'));return db[_0x735568('0x5b')][_0x735568('0xf')]({'where':{'id':_0x1320b5['params']['id']}})['then'](function(_0x14c425){const _0x5851cb=_0x735568;if(_0x14c425){const _0x20c8a8=util[_0x5851cb('0x7f')](_0x5851cb('0x66'),_0x14c425[_0x5851cb('0x18')]);if(fs[_0x5851cb('0x3a')](_0x20c8a8))return _0x26033d['decryptFile'](_0x20c8a8,_0x14c425[_0x5851cb('0x18')],config[_0x5851cb('0x2b')][_0x5851cb('0x6c')])['then'](function(){return _0x14c425;});return _0x14c425;}})[_0x735568('0x21')](function(_0x2c8653){const _0xb4aca7=_0x735568;if(!_0x2c8653)throw new ValidationError(_0xb4aca7('0x63'));return _0x21cf30=_0x2c8653,db[_0xb4aca7('0x24')][_0xb4aca7('0xf')]({'where':{'id':0x1}});})[_0x735568('0x21')](handleEntityNotFound(_0x24790a,null))[_0x735568('0x21')](function(_0x41c78c){const _0x3aec8b=_0x735568;if(_0x41c78c){_0x212249=_0x41c78c;if(!_0x212249[_0x3aec8b('0x3b')]||!_0x212249[_0x3aec8b('0x50')]||!_0x212249[_0x3aec8b('0x85')]||!_0x212249[_0x3aec8b('0x3c')]||!_0x212249[_0x3aec8b('0x1')])throw new ValidationError(_0x3aec8b('0xc'));if(_0x1320b5[_0x3aec8b('0x75')][_0x3aec8b('0x74')]&&(!_0x212249[_0x3aec8b('0x3')]||!_0x212249[_0x3aec8b('0xd')]||!_0x212249[_0x3aec8b('0x1e')]||!_0x212249[_0x3aec8b('0x3c')]||!_0x212249[_0x3aec8b('0x1')]))throw new ValidationError(_0x3aec8b('0xb'));return db[_0x3aec8b('0x2')]['findOne']({'where':{'id':_0x212249[_0x3aec8b('0x50')]}});}})[_0x735568('0x21')](function(_0x35bad2){const _0x56402c=_0x735568;if(!_0x35bad2)throw new ValidationError(_0x56402c('0x9'));if(!_0x35bad2[_0x56402c('0x38')]||!_0x35bad2[_0x56402c('0x78')])throw new ValidationError('Cloud\x20Provider\x20not\x20configured');return _0x233510=_0x35bad2,getBucketslist(_0x233510['data1'],_0x233510[_0x56402c('0x78')],_0x212249['transcribeRegion']);})['then'](function(_0x341749){const _0x357413=_0x735568;if(_0x341749&&_0x341749[_0x357413('0x6f')]){const _0x45d9df=_[_0x357413('0x7d')](_0x341749[_0x357413('0x6f')],function(_0x1ae529){const _0xb4c3d5=_0x357413;return _0x1ae529[_0xb4c3d5('0x22')]===_0x212249[_0xb4c3d5('0x1')];});if(!_0x45d9df)return logger[_0x357413('0x79')](util[_0x357413('0x7f')](_0x357413('0x35'),_0x1320b5[_0x357413('0x69')]['id'],_0x212249[_0x357413('0x1')])),createBucket(_0x233510['data1'],_0x233510['data2'],_0x212249[_0x357413('0x85')],_0x212249[_0x357413('0x1')]);logger[_0x357413('0x79')](util[_0x357413('0x7f')](_0x357413('0x1f'),_0x1320b5[_0x357413('0x69')]['id'],_0x212249[_0x357413('0x1')]));return;}})[_0x735568('0x21')](function(){const _0x1d6b7f=_0x735568;return _0x21cf30['transcribeStatus']===_0x1d6b7f('0x34')?transcribe(_0x1320b5[_0x1d6b7f('0x69')]['id'],_0x233510[_0x1d6b7f('0x38')],_0x233510['data2'],_0x212249[_0x1d6b7f('0x85')],_0x212249['bucket'],_0x21cf30[_0x1d6b7f('0x18')],_0x212249[_0x1d6b7f('0x3c')]):(logger[_0x1d6b7f('0x79')](util[_0x1d6b7f('0x7f')](_0x1d6b7f('0x1a'),_0x1320b5[_0x1d6b7f('0x69')]['id'])),{'transcribeStatus':_0x1d6b7f('0x13')});})[_0x735568('0x21')](function(_0xffe56e){const _0x2a263e=_0x735568;if(_0xffe56e)return _0xffe56e[_0x2a263e('0x7a')]=_0x1320b5['body'][_0x2a263e('0x74')],_0x21cf30['update'](_0xffe56e);})[_0x735568('0x21')](respondWithResult(_0x24790a,null))[_0x735568('0x7')](handleError(_0x24790a,null));};function writeFile(_0x5051e1,_0x31102f){return new Promise(function(_0x36abfc,_0x20bfd9){const _0x5a45e9=a771_0x18a8;fs[_0x5a45e9('0x39')](_0x31102f,_0x5051e1,function(_0x52628f,_0x1ca7ff){return _0x52628f?_0x20bfd9(_0x52628f):_0x36abfc(_0x1ca7ff);});});}exports[_0x2adc94('0x55')]=function(_0x419053,_0x42135e){const _0x42dbc2=_0x2adc94;return db[_0x42dbc2('0x5b')]['findOne']({'where':{'id':_0x419053[_0x42dbc2('0x69')]['id']}})[_0x42dbc2('0x21')](handleEntityNotFound(_0x42135e))[_0x42dbc2('0x21')](function(_0x4f8df9){const _0x3e1c26=_0x42dbc2;if(_0x4f8df9&&_0x4f8df9[_0x3e1c26('0x58')]){const _0x18d2d6=_0x4f8df9['fileText'],_0x1639ce=config[_0x3e1c26('0x64')]+_0x3e1c26('0x42')+_0x4f8df9['id']+_0x3e1c26('0x4a');if(fs[_0x3e1c26('0x3a')](_0x1639ce))return _0x1639ce;return writeFile(_0x18d2d6,_0x1639ce)[_0x3e1c26('0x21')](function(){return _0x1639ce;});}else throw new ValidationError(_0x3e1c26('0x53'));})['then'](function(_0x500b18){const _0x2d892c=_0x42dbc2;return _0x42135e[_0x2d892c('0x80')](_0x500b18);})[_0x42dbc2('0x7')](handleError(_0x42135e));};
\ No newline at end of file
+const a771_0x2bdd=['%s.cypher','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','decryptFile','../../config/logger','VoiceRecording','sendStatus','set','length','transcribeRegion','create','describe','sequelize','fileText','end','language','rows','filter','TranscriptionJobStatus','Transcript\x20not\x20available','transcribeAccountId','value','where','key','transcribeStatus','VoiceRecording\x20not\x20found','runSentiment','nolimit','TranscriptionJob','filename','readFileSync','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','runTranscribe','$and','.cypher','../../mysqldb','status','destroy','model','VIRTUAL','includeAll','api','existsSync','filters','keys','fields','message','basename','info','extname','body','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','Not\x20found','lodash','unlinkSync','cancellazione\x20fisica\x20documento\x20%s','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','util','bucket','push','writeFile','count','NEW','query','sort','Buckets','path','then','sentimentRegion','findOne','rawAttributes','Content-Range','Transcribe\x20not\x20configured','limit','format','send','data1','downloads','fieldName','IN_PROGRESS','uuid','Name','transcribe','Location','Entity\x20not\x20found','downloadTranscribe','json','find','../../components/parsers/qs','update','merge','transcribeName','../../config/environment','findAll','token','stack','Cloud\x20Provider\x20not\x20available','../../components/encryptor','include','map','error','root','.txt','secrets','and','Setting','options','order','name','Bucket','uniqueid','catch','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','offset','listBuckets','TranscribeService','upload','createBucket','isNil','params','type','download','differenceBy','intersection','unlink','recording','TranscriptionJobName','error-middleware/errors','data2','attributes'];(function(_0x1f0a95,_0x2bdd02){const _0x3ba963=function(_0x35af69){while(--_0x35af69){_0x1f0a95['push'](_0x1f0a95['shift']());}};_0x3ba963(++_0x2bdd02);}(a771_0x2bdd,0x175));const a771_0x3ba9=function(_0x1f0a95,_0x2bdd02){_0x1f0a95=_0x1f0a95-0x0;let _0x3ba963=a771_0x2bdd[_0x1f0a95];return _0x3ba963;};const _0x4bb842=a771_0x3ba9;'use strict';const util=require(_0x4bb842('0x4d')),path=require(_0x4bb842('0x56')),fs=require('fs'),_=require(_0x4bb842('0x49')),AWS=require('aws-sdk'),{v4:uuidv4}=require(_0x4bb842('0x64')),qs=require(_0x4bb842('0x6c')),logger=require(_0x4bb842('0x17'))(_0x4bb842('0x3d')),config=require(_0x4bb842('0x70')),db=require(_0x4bb842('0x37'))['db'],{Op,fn,col,ValidationError}=require(_0x4bb842('0x1f')),{InternalError}=require(_0x4bb842('0x11'));function respondWithResult(_0x35af69,_0x176e29){return _0x176e29=_0x176e29||0xc8,function(_0xef7441){const _0xe45f17=a771_0x3ba9;if(_0xef7441)return _0x35af69[_0xe45f17('0x38')](_0x176e29)[_0xe45f17('0x6a')](_0xef7441);};}function respondWithFilteredResult(_0x16096c,_0x57f29d){return function(_0x5a676e){const _0x17f295=a771_0x3ba9;if(_0x5a676e){const _0x37e938=_0x5a676e[_0x17f295('0x51')],_0x485501=_0x57f29d[_0x17f295('0x3')];let _0x1a8dbf=_0x57f29d['offset']+_0x57f29d[_0x17f295('0x5d')],_0x4752ee;return _0x1a8dbf>=_0x37e938?(_0x1a8dbf=_0x37e938,_0x4752ee=0xc8):_0x4752ee=0xce,_0x16096c['status'](_0x4752ee),_0x16096c[_0x17f295('0x1a')](_0x17f295('0x5b'),_0x485501+'-'+_0x1a8dbf+'/'+_0x37e938)[_0x17f295('0x6a')](_0x5a676e);}return null;};}function saveUpdates(_0x4512ec){return function(_0x53914c){const _0x2f56a9=a771_0x3ba9;if(_0x53914c)return _0x53914c['update'](_0x4512ec)[_0x2f56a9('0x57')](function(_0xf5ad6f){return _0xf5ad6f;});return null;};}function handleEntityNotFound(_0xcae067){return function(_0x4c0a65){const _0x22786a=a771_0x3ba9;return!_0x4c0a65&&_0xcae067[_0x22786a('0x19')](0x194),_0x4c0a65;};}function handleError(_0x423a88,_0x40cd7b){return _0x40cd7b=_0x40cd7b||0x1f4,function(_0x4da98c){const _0x4111d0=a771_0x3ba9;logger[_0x4111d0('0x78')](_0x4da98c[_0x4111d0('0x73')]),_0x4da98c[_0x4111d0('0x80')]&&delete _0x4da98c[_0x4111d0('0x80')],_0x423a88[_0x4111d0('0x38')](_0x40cd7b)[_0x4111d0('0x5f')](_0x4da98c);};}exports['index']=function(_0xa44d4c,_0x4928b3){const _0x11d533=_0x4bb842;let _0x4daf67={};const _0x4f2901={},_0x3e2359={'count':0x0,'rows':[]},_0x5b7a8a=_['map'](db[_0x11d533('0x18')][_0x11d533('0x5a')],function(_0x5a4c76){const _0x5abda7=_0x11d533;return{'name':_0x5a4c76[_0x5abda7('0x62')],'type':_0x5a4c76[_0x5abda7('0xa')][_0x5abda7('0x2a')]};});_0x4f2901['model']=_[_0x11d533('0xc')](_[_0x11d533('0x77')](_0x5b7a8a,_0x11d533('0x80')),[_0x11d533('0x5e')]),_0x4f2901['query']=_['keys'](_0xa44d4c[_0x11d533('0x53')]),_0x4f2901[_0x11d533('0x3f')]=_['intersection'](_0x4f2901['model'],_0x4f2901[_0x11d533('0x53')]),_0x4daf67['attributes']=_[_0x11d533('0xd')](_0x4f2901[_0x11d533('0x3a')],qs[_0x11d533('0x41')](_0xa44d4c[_0x11d533('0x53')]['fields'])),_0x4daf67[_0x11d533('0x13')]=_0x4daf67[_0x11d533('0x13')][_0x11d533('0x1b')]?_0x4daf67[_0x11d533('0x13')]:_0x4f2901[_0x11d533('0x3a')];typeof _0xa44d4c[_0x11d533('0x53')][_0x11d533('0x2e')]==='undefined'&&(_0x4daf67[_0x11d533('0x5d')]=qs[_0x11d533('0x5d')](_0xa44d4c[_0x11d533('0x53')]['limit']),_0x4daf67['offset']=qs[_0x11d533('0x3')](_0xa44d4c[_0x11d533('0x53')][_0x11d533('0x3')]));_0x4daf67[_0x11d533('0x7f')]=qs[_0x11d533('0x54')](_0xa44d4c[_0x11d533('0x53')][_0x11d533('0x54')]),_0x4daf67[_0x11d533('0x29')]=qs[_0x11d533('0x3f')](_['pick'](_0xa44d4c[_0x11d533('0x53')],_0x4f2901['filters']),_0x5b7a8a);_0xa44d4c[_0x11d533('0x53')][_0x11d533('0x24')]&&(_0x4daf67[_0x11d533('0x29')]=_[_0x11d533('0x6e')](_0x4daf67[_0x11d533('0x29')],{[Op['or']]:_[_0x11d533('0x77')](_0x5b7a8a,function(_0xe6a9ab){const _0x5c6090=_0x11d533;if(_0xe6a9ab[_0x5c6090('0xa')]!==_0x5c6090('0x3b')){const _0x2d36e8={};return _0x2d36e8[_0xe6a9ab[_0x5c6090('0x80')]]={[Op['like']]:'%'+_0xa44d4c[_0x5c6090('0x53')][_0x5c6090('0x24')]+'%'},_0x2d36e8;}})}));_0x4daf67=_[_0x11d533('0x6e')]({},_0x4daf67,_0xa44d4c[_0x11d533('0x7e')]);const _0x50a469={'where':_0x4daf67[_0x11d533('0x29')]};return db[_0x11d533('0x18')][_0x11d533('0x51')](_0x50a469)[_0x11d533('0x57')](function(_0x47100){const _0x2f7a43=_0x11d533;return _0x3e2359[_0x2f7a43('0x51')]=_0x47100,_0xa44d4c[_0x2f7a43('0x53')][_0x2f7a43('0x3c')]&&(_0x4daf67[_0x2f7a43('0x76')]=[{'all':!![]}]),db['VoiceRecording'][_0x2f7a43('0x71')](_0x4daf67);})[_0x11d533('0x57')](function(_0x41c076){const _0x50d5c4=_0x11d533;return _0x3e2359[_0x50d5c4('0x23')]=_0x41c076,_0x3e2359;})[_0x11d533('0x57')](respondWithFilteredResult(_0x4928b3,_0x4daf67))[_0x11d533('0x0')](handleError(_0x4928b3,null));},exports['show']=function(_0x1ebeb5,_0x557c3f){const _0x3dc2dd=_0x4bb842;let _0x2c300c={'raw':![],'where':{'id':_0x1ebeb5[_0x3dc2dd('0x9')]['id']}};const _0xa5c400={};return _0xa5c400['model']=_[_0x3dc2dd('0x40')](db[_0x3dc2dd('0x18')][_0x3dc2dd('0x5a')]),_0xa5c400['query']=_[_0x3dc2dd('0x40')](_0x1ebeb5[_0x3dc2dd('0x53')]),_0xa5c400[_0x3dc2dd('0x3f')]=_[_0x3dc2dd('0xd')](_0xa5c400[_0x3dc2dd('0x3a')],_0xa5c400[_0x3dc2dd('0x53')]),_0x2c300c[_0x3dc2dd('0x13')]=_[_0x3dc2dd('0xd')](_0xa5c400[_0x3dc2dd('0x3a')],qs[_0x3dc2dd('0x41')](_0x1ebeb5[_0x3dc2dd('0x53')][_0x3dc2dd('0x41')])),_0x2c300c['attributes']=_0x2c300c[_0x3dc2dd('0x13')][_0x3dc2dd('0x1b')]?_0x2c300c[_0x3dc2dd('0x13')]:_0xa5c400[_0x3dc2dd('0x3a')],_0x1ebeb5[_0x3dc2dd('0x53')][_0x3dc2dd('0x3c')]&&(_0x2c300c[_0x3dc2dd('0x76')]=[{'all':!![]}]),_0x2c300c=_[_0x3dc2dd('0x6e')]({},_0x2c300c,_0x1ebeb5[_0x3dc2dd('0x7e')]),db[_0x3dc2dd('0x18')]['findOne'](_0x2c300c)[_0x3dc2dd('0x57')](handleEntityNotFound(_0x557c3f,null))[_0x3dc2dd('0x57')](respondWithResult(_0x557c3f,null))[_0x3dc2dd('0x0')](handleError(_0x557c3f,null));},exports[_0x4bb842('0x1d')]=function(_0x1f2094,_0x3ad9ba){const _0x5eb30f=_0x4bb842;return db[_0x5eb30f('0x18')]['create'](_0x1f2094[_0x5eb30f('0x46')],{})['then'](respondWithResult(_0x3ad9ba,0xc9))[_0x5eb30f('0x0')](handleError(_0x3ad9ba,null));},exports['update']=function(_0x4703f4,_0x1d7626){const _0x503d67=_0x4bb842;return _0x4703f4[_0x503d67('0x46')]['id']&&delete _0x4703f4[_0x503d67('0x46')]['id'],db[_0x503d67('0x18')][_0x503d67('0x59')]({'where':{'id':_0x4703f4[_0x503d67('0x9')]['id']}})[_0x503d67('0x57')](handleEntityNotFound(_0x1d7626,null))[_0x503d67('0x57')](saveUpdates(_0x4703f4[_0x503d67('0x46')],null))[_0x503d67('0x57')](respondWithResult(_0x1d7626,null))[_0x503d67('0x0')](handleError(_0x1d7626,null));},exports[_0x4bb842('0x1e')]=function(_0xdfc921,_0x58c394){const _0x3e508e=_0x4bb842;return db[_0x3e508e('0x18')][_0x3e508e('0x1e')]()['then'](respondWithResult(_0x58c394,null))[_0x3e508e('0x0')](handleError(_0x58c394,null));},exports[_0x4bb842('0xb')]=function(_0xe9e3f3,_0x177e71){const _0x59d2b8=_0x4bb842,_0x1a5e3a=require(_0x59d2b8('0x75'));let _0x2bd773=![];const _0x26c58a={};return _0xe9e3f3[_0x59d2b8('0x53')][_0x59d2b8('0xa')]&&_0xe9e3f3[_0x59d2b8('0x53')]['type']===_0x59d2b8('0x82')?_0x26c58a[_0x59d2b8('0x82')]=_0xe9e3f3[_0x59d2b8('0x9')]['id']:_0x26c58a['id']=_0xe9e3f3['params']['id'],db[_0x59d2b8('0x18')][_0x59d2b8('0x59')]({'where':_0x26c58a,'attributes':['id',_0x59d2b8('0x28')],'raw':!![]})[_0x59d2b8('0x57')](handleEntityNotFound(_0x177e71,null))[_0x59d2b8('0x57')](function(_0x2a4c6c){const _0xc8cdc5=_0x59d2b8;if(_0x2a4c6c){const _0x2f6e71=_0x2a4c6c[_0xc8cdc5('0x28')],_0x17c539=util[_0xc8cdc5('0x5e')]('%s.cypher',_0x2f6e71);if(fs[_0xc8cdc5('0x3e')](_0x17c539))return _0x2bd773=!![],_0x1a5e3a[_0xc8cdc5('0x16')](_0x17c539,_0x2f6e71,config[_0xc8cdc5('0x7b')][_0xc8cdc5('0xf')])[_0xc8cdc5('0x57')](function(){return _0x2a4c6c;});return _0x2a4c6c;}})[_0x59d2b8('0x57')](function(_0x1feef9){const _0x3e808e=_0x59d2b8;if(_0x1feef9){const _0x361635=_0x1feef9['value'];if(!fs[_0x3e808e('0x3e')](_0x361635))throw new ValidationError(_0x3e808e('0x2c'));return _0x1feef9['filename']?_0x177e71[_0x3e808e('0xb')](_0x361635,_0x1feef9[_0x3e808e('0x30')]+path[_0x3e808e('0x45')](_0x361635),function(){_0x2bd773&&fs['unlink'](_0x361635);}):_0x177e71[_0x3e808e('0xb')](_0x361635,function(){const _0x26c5cf=_0x3e808e;_0x2bd773&&fs[_0x26c5cf('0xe')](_0x361635);});}})['catch'](function(_0x3187b7){const _0x55359f=_0x59d2b8;if(_0x3187b7[_0x55359f('0x42')]===_0x55359f('0x2c'))_0x177e71[_0x55359f('0x38')](0x194)['send'](_0x55359f('0x48'));else return handleError(_0x177e71,null);});},exports[_0x4bb842('0x61')]=function(_0x264ae0,_0xab6c8e){const _0x1b1b7b=_0x4bb842,_0x375c2b=require(_0x1b1b7b('0x75'));let _0x3398ee=![];const _0x3bec55={[Op[_0x1b1b7b('0x7c')]]:[_0x3bec55(fn('MD5',col(_0x1b1b7b('0x82'))),_0x264ae0[_0x1b1b7b('0x53')][_0x1b1b7b('0x72')])]};return _0x264ae0[_0x1b1b7b('0x53')][_0x1b1b7b('0xa')]&&_0x264ae0[_0x1b1b7b('0x53')]['type']===_0x1b1b7b('0x82')?_0x3bec55[_0x1b1b7b('0x35')][_0x1b1b7b('0x4f')]({'uniqueid':_0x264ae0[_0x1b1b7b('0x9')]['id']}):_0x3bec55[_0x1b1b7b('0x35')]['push']({'id':_0x264ae0[_0x1b1b7b('0x9')]['id']}),db[_0x1b1b7b('0x18')][_0x1b1b7b('0x59')]({'where':_0x3bec55,'attributes':['id',_0x1b1b7b('0x28')],'raw':!![]})[_0x1b1b7b('0x57')](handleEntityNotFound(_0xab6c8e,null))[_0x1b1b7b('0x57')](function(_0x9b0834){const _0x5e8653=_0x1b1b7b;if(_0x9b0834){const _0x2823eb=util[_0x5e8653('0x5e')]('%s.cypher',_0x9b0834[_0x5e8653('0x28')]);if(fs['existsSync'](_0x2823eb))return _0x3398ee=!![],_0x375c2b[_0x5e8653('0x16')](_0x2823eb,_0x9b0834['value'],config['secrets'][_0x5e8653('0xf')])[_0x5e8653('0x57')](function(){return _0x9b0834;});return _0x9b0834;}})[_0x1b1b7b('0x57')](function(_0x30c513){const _0x4cc9f2=_0x1b1b7b;if(_0x30c513){if(!fs[_0x4cc9f2('0x3e')](_0x30c513[_0x4cc9f2('0x28')]))throw new ValidationError(_0x4cc9f2('0x2c'));return _0x30c513[_0x4cc9f2('0x30')]?_0xab6c8e['download'](_0x30c513[_0x4cc9f2('0x28')],_0x30c513[_0x4cc9f2('0x30')]+path[_0x4cc9f2('0x45')](_0x30c513[_0x4cc9f2('0x28')]),function(){const _0x40a48d=_0x4cc9f2;_0x3398ee&&fs['unlink'](_0x30c513[_0x40a48d('0x28')]);}):_0xab6c8e[_0x4cc9f2('0xb')](_0x30c513['value'],function(){const _0x4aefc6=_0x4cc9f2;_0x3398ee&&fs[_0x4aefc6('0xe')](_0x30c513[_0x4aefc6('0x28')]);});}})['catch'](handleError(_0xab6c8e,null));},exports['destroy']=function(_0x206e80,_0x1261d6){const _0x59001b=_0x4bb842;return db[_0x59001b('0x18')][_0x59001b('0x59')]({'where':{'id':_0x206e80[_0x59001b('0x9')]['id']}})[_0x59001b('0x57')](function(_0x120011){const _0x2d0deb=_0x59001b;if(!_0x120011)throw new ReferenceError(_0x2d0deb('0x68'));return _0x120011;})[_0x59001b('0x57')](function(_0x21d240){const _0x92cee3=_0x59001b;let _0x115c1b=_0x21d240[_0x92cee3('0x28')];return logger[_0x92cee3('0x44')](_0x92cee3('0x4b'),_0x115c1b),!_[_0x92cee3('0x8')](_0x21d240['value'])&&fs[_0x92cee3('0x3e')](_0x115c1b)&&(logger['info']('File:\x20\x22'+_0x115c1b+_0x92cee3('0x2')),fs[_0x92cee3('0x4a')](_0x115c1b)),_0x115c1b=_0x115c1b+_0x92cee3('0x36'),!_[_0x92cee3('0x8')](_0x21d240['value'])&&fs['existsSync'](_0x115c1b)&&(logger[_0x92cee3('0x44')]('File:\x20\x22'+_0x115c1b+_0x92cee3('0x2')),fs[_0x92cee3('0x4a')](_0x115c1b)),_0x21d240;})[_0x59001b('0x57')](function(_0x3b77d7){const _0x21f5ee=_0x59001b;if(!_0x3b77d7)throw new InternalError();return _0x3b77d7[_0x21f5ee('0x39')]();})[_0x59001b('0x57')](function(){const _0x39199d=_0x59001b;_0x1261d6[_0x39199d('0x38')](0xcc)[_0x39199d('0x21')]();})[_0x59001b('0x0')](handleError(_0x1261d6,null));};function getBucketslist(_0x2942fe,_0x287b27,_0x576b14){return new Promise(function(_0x43a249,_0x234415){const _0x106300=a771_0x3ba9,_0x4c74f6=new AWS['S3']({'accessKeyId':_0x287b27,'secretAccessKey':_0x2942fe,'region':_0x576b14});_0x4c74f6[_0x106300('0x4')]({},function(_0x4859de,_0xab3115){return _0x4859de?_0x234415(_0x4859de):_0x43a249(_0xab3115);});});}function createBucket(_0x5aec8a,_0x4bbd75,_0x1dc8e0,_0x14470a){return new Promise(function(_0x241fa4,_0x5c319d){const _0x4834e4=a771_0x3ba9,_0x448cf4=new AWS['S3']({'accessKeyId':_0x4bbd75,'secretAccessKey':_0x5aec8a,'region':_0x1dc8e0});_0x448cf4[_0x4834e4('0x7')]({'Bucket':_0x14470a},function(_0x4f555c,_0x10e988){return _0x4f555c?_0x5c319d(_0x4f555c):_0x241fa4(_0x10e988);});});}function uploadFile(_0x6ff598,_0x3e04b1,_0x4e7675,_0x36f54b,_0x462ad7,_0x2ef1a9){return new Promise(function(_0x135052,_0x68cec0){const _0x52a001=a771_0x3ba9,_0x553bd2=new AWS['S3']({'accessKeyId':_0x3e04b1,'secretAccessKey':_0x6ff598,'region':_0x4e7675});_0x553bd2[_0x52a001('0x6')]({'Bucket':_0x36f54b,'Key':_0x462ad7,'Body':_0x2ef1a9},function(_0x2ac774,_0x260c64){return _0x2ac774?_0x68cec0(_0x2ac774):_0x135052(_0x260c64);});});}function startTranscribe(_0x4bcdfd,_0xa33cc,_0x1c8192,_0x31a926,_0x32893f,_0x18949f){return new Promise(function(_0x4dd645,_0x16dd77){const _0x50984e=a771_0x3ba9,_0x18c990=new AWS[(_0x50984e('0x5'))]({'accessKeyId':_0xa33cc,'secretAccessKey':_0x4bcdfd,'region':_0x1c8192});_0x18c990['startTranscriptionJob']({'TranscriptionJobName':_0x31a926,'LanguageCode':_0x32893f,'Media':{'MediaFileUri':_0x18949f}},function(_0x5f59f5,_0x5e1035){return _0x5f59f5?_0x16dd77(_0x5f59f5):_0x4dd645(_0x5e1035);});});}function transcribe(_0x3a0dbf,_0x57e1d8,_0x537a13,_0x15ae5d,_0x173e11,_0x52f321,_0xcef2e9){return new Promise(function(_0x279503,_0x2d6f1b){const _0x58975d=a771_0x3ba9,_0x16e5ec={};return logger[_0x58975d('0x44')](util['format'](_0x58975d('0x33'),_0x3a0dbf,_0x173e11)),uploadFile(_0x57e1d8,_0x537a13,_0x15ae5d,_0x173e11,path[_0x58975d('0x43')](_0x52f321),fs[_0x58975d('0x31')](_0x52f321))[_0x58975d('0x57')](function(_0x47537d){const _0x48a7ba=_0x58975d;return logger[_0x48a7ba('0x44')](util[_0x48a7ba('0x5e')](_0x48a7ba('0x1'),_0x3a0dbf,_0x173e11,_0x47537d[_0x48a7ba('0x67')])),_0x16e5ec[_0x48a7ba('0x4e')]=_0x47537d[_0x48a7ba('0x81')],_0x16e5ec['location']=_0x47537d[_0x48a7ba('0x67')],logger[_0x48a7ba('0x44')](util['format'](_0x48a7ba('0x4c'),_0x3a0dbf)),startTranscribe(_0x57e1d8,_0x537a13,_0x15ae5d,uuidv4(),_0xcef2e9,_0x47537d[_0x48a7ba('0x67')]);})[_0x58975d('0x57')](function(_0x14f871){const _0x5c1f74=_0x58975d;return logger[_0x5c1f74('0x44')](util[_0x5c1f74('0x5e')](_0x5c1f74('0x47'),_0x3a0dbf,_0x14f871[_0x5c1f74('0x2f')][_0x5c1f74('0x10')])),_0x16e5ec[_0x5c1f74('0x6f')]=_0x14f871[_0x5c1f74('0x2f')][_0x5c1f74('0x10')],_0x16e5ec[_0x5c1f74('0x2b')]=_0x14f871[_0x5c1f74('0x2f')][_0x5c1f74('0x25')],_0x279503(_0x16e5ec);})[_0x58975d('0x0')](function(_0x5f3cfc){return _0x2d6f1b(_0x5f3cfc);});});}exports[_0x4bb842('0x34')]=function(_0x55263b,_0x17943d){const _0x16c5b4=_0x4bb842;let _0x7bb96e,_0x3bd5de,_0x19cc50;const _0x4a4be2=require(_0x16c5b4('0x75'));return db[_0x16c5b4('0x18')][_0x16c5b4('0x59')]({'where':{'id':_0x55263b['params']['id']}})['then'](function(_0x4789e8){const _0x369a4b=_0x16c5b4;if(_0x4789e8){const _0x51bfd9=util[_0x369a4b('0x5e')](_0x369a4b('0x14'),_0x4789e8[_0x369a4b('0x28')]);if(fs[_0x369a4b('0x3e')](_0x51bfd9))return _0x4a4be2[_0x369a4b('0x16')](_0x51bfd9,_0x4789e8[_0x369a4b('0x28')],config['secrets'][_0x369a4b('0xf')])[_0x369a4b('0x57')](function(){return _0x4789e8;});return _0x4789e8;}})[_0x16c5b4('0x57')](function(_0x4afb1a){const _0x232c8d=_0x16c5b4;if(!_0x4afb1a)throw new ValidationError('Voice\x20Recording\x20not\x20found');return _0x3bd5de=_0x4afb1a,db[_0x232c8d('0x7d')][_0x232c8d('0x59')]({'where':{'id':0x1}});})[_0x16c5b4('0x57')](handleEntityNotFound(_0x17943d,null))[_0x16c5b4('0x57')](function(_0x1096cc){const _0x59d786=_0x16c5b4;if(_0x1096cc){_0x7bb96e=_0x1096cc;if(!_0x7bb96e[_0x59d786('0x66')]||!_0x7bb96e[_0x59d786('0x27')]||!_0x7bb96e[_0x59d786('0x1c')]||!_0x7bb96e['language']||!_0x7bb96e['bucket'])throw new ValidationError(_0x59d786('0x5c'));if(_0x55263b['body'][_0x59d786('0x2d')]&&(!_0x7bb96e['sentiment']||!_0x7bb96e['sentimentAccountId']||!_0x7bb96e[_0x59d786('0x58')]||!_0x7bb96e[_0x59d786('0x22')]||!_0x7bb96e['bucket']))throw new ValidationError('Sentiment\x20Analysis\x20not\x20configured');return db['CloudProvider'][_0x59d786('0x59')]({'where':{'id':_0x7bb96e[_0x59d786('0x27')]}});}})[_0x16c5b4('0x57')](function(_0x15f7df){const _0x4839fa=_0x16c5b4;if(!_0x15f7df)throw new ValidationError(_0x4839fa('0x74'));if(!_0x15f7df['data1']||!_0x15f7df['data2'])throw new ValidationError('Cloud\x20Provider\x20not\x20configured');return _0x19cc50=_0x15f7df,getBucketslist(_0x19cc50['data1'],_0x19cc50[_0x4839fa('0x12')],_0x7bb96e[_0x4839fa('0x1c')]);})['then'](function(_0x2f1517){const _0x469b83=_0x16c5b4;if(_0x2f1517&&_0x2f1517[_0x469b83('0x55')]){const _0x100f8b=_[_0x469b83('0x6b')](_0x2f1517[_0x469b83('0x55')],function(_0x2e1e6f){const _0x2c65c1=_0x469b83;return _0x2e1e6f[_0x2c65c1('0x65')]===_0x7bb96e[_0x2c65c1('0x4e')];});if(!_0x100f8b)return logger['info'](util['format'](_0x469b83('0x15'),_0x55263b[_0x469b83('0x9')]['id'],_0x7bb96e[_0x469b83('0x4e')])),createBucket(_0x19cc50[_0x469b83('0x60')],_0x19cc50[_0x469b83('0x12')],_0x7bb96e[_0x469b83('0x1c')],_0x7bb96e[_0x469b83('0x4e')]);logger[_0x469b83('0x44')](util['format'](_0x469b83('0x32'),_0x55263b[_0x469b83('0x9')]['id'],_0x7bb96e[_0x469b83('0x4e')]));return;}})[_0x16c5b4('0x57')](function(){const _0x181b7b=_0x16c5b4;return _0x3bd5de[_0x181b7b('0x2b')]===_0x181b7b('0x52')?transcribe(_0x55263b[_0x181b7b('0x9')]['id'],_0x19cc50['data1'],_0x19cc50['data2'],_0x7bb96e['transcribeRegion'],_0x7bb96e['bucket'],_0x3bd5de[_0x181b7b('0x28')],_0x7bb96e[_0x181b7b('0x22')]):(logger[_0x181b7b('0x44')](util[_0x181b7b('0x5e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x55263b[_0x181b7b('0x9')]['id'])),{'transcribeStatus':_0x181b7b('0x63')});})[_0x16c5b4('0x57')](function(_0x205e62){const _0x16a313=_0x16c5b4;if(_0x205e62)return _0x205e62['tempSentiment']=_0x55263b[_0x16a313('0x46')][_0x16a313('0x2d')],_0x3bd5de[_0x16a313('0x6d')](_0x205e62);})['then'](respondWithResult(_0x17943d,null))[_0x16c5b4('0x0')](handleError(_0x17943d,null));};function writeFile(_0x2fd28e,_0x5f14af){return new Promise(function(_0x27409a,_0x47acd3){const _0x332999=a771_0x3ba9;fs[_0x332999('0x50')](_0x5f14af,_0x2fd28e,function(_0x52b697,_0x3f6731){return _0x52b697?_0x47acd3(_0x52b697):_0x27409a(_0x3f6731);});});}exports[_0x4bb842('0x69')]=function(_0x47bc33,_0x4ab9d3){const _0x166f1f=_0x4bb842;return db[_0x166f1f('0x18')][_0x166f1f('0x59')]({'where':{'id':_0x47bc33['params']['id']}})[_0x166f1f('0x57')](handleEntityNotFound(_0x4ab9d3))[_0x166f1f('0x57')](function(_0x5d6c4f){const _0x52077b=_0x166f1f;if(_0x5d6c4f&&_0x5d6c4f['fileText']){const _0x4861e3=_0x5d6c4f[_0x52077b('0x20')],_0x2b19c6=config[_0x52077b('0x79')]+'/server/files/transcribes/transcribe_'+_0x5d6c4f['id']+_0x52077b('0x7a');if(fs[_0x52077b('0x3e')](_0x2b19c6))return _0x2b19c6;return writeFile(_0x4861e3,_0x2b19c6)[_0x52077b('0x57')](function(){return _0x2b19c6;});}else throw new ValidationError(_0x52077b('0x26'));})[_0x166f1f('0x57')](function(_0x1f6a7d){return _0x4ab9d3['download'](_0x1f6a7d);})['catch'](handleError(_0x4ab9d3));};
\ No newline at end of file