Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / config / schedule / transcribe.js
index c70b476..eb31560 100644 (file)
@@ -1 +1 @@
-const a1020_0x5caf=['language','No\x20transcribe\x20job\x20to\x20check','TranscriptionJob','IN_PROGRESS','data1','Neutral','172699bTrpGF','Transcript','transcripts','sentiment','aws-sdk','Setting','fileText','SentimentScore','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','96623BTGwKB','transcribeRegion','34084mCHvDe','Negative','resolve','244984KGcxcE','error','request-promise-native','815478nAwICm','start','VoiceRecording','findAll','results','255539XDpkCj','Positive','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Comprehend','info','then','264376AyUqkS','update','TranscribeService','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','push','sentimentRegion','data2','util','transcribe','Cloud\x20Provider\x20not\x20available','TranscriptFileUri','name','Cloud\x20Provider\x20not\x20configured','forEach','FAILED','length','catch','COMPLETED','SequelizeValidationError','Sentiment','Mixed','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Settings\x20not\x20available','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeAccountId','format','bucket','inspect','TranscriptionJobStatus','5KIzaHp','Transcribe\x20not\x20configured','[RECORDING:%d]\x20Transcript\x20downloaded','Transcript\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','tempSentiment','transcribeName','detectSentiment','Sentiment\x20Analysis\x20not\x20requested','FailureReason','findOne','2UKWFiP','all'];const a1020_0x3178=function(_0x15e253,_0x3f171c){_0x15e253=_0x15e253-0x8f;let _0x5caf4c=a1020_0x5caf[_0x15e253];return _0x5caf4c;};const a1020_0x42d785=a1020_0x3178;(function(_0x5cd74b,_0x3da2fb){const _0x5445d9=a1020_0x3178;while(!![]){try{const _0x2a4e69=parseInt(_0x5445d9(0x8f))+-parseInt(_0x5445d9(0xad))+-parseInt(_0x5445d9(0x9d))+parseInt(_0x5445d9(0x9a))*-parseInt(_0x5445d9(0xca))+-parseInt(_0x5445d9(0xa5))+-parseInt(_0x5445d9(0xd5))*-parseInt(_0x5445d9(0x98))+parseInt(_0x5445d9(0xa0));if(_0x2a4e69===_0x3da2fb)break;else _0x5cd74b['push'](_0x5cd74b['shift']());}catch(_0x4a77fd){_0x5cd74b['push'](_0x5cd74b['shift']());}}}(a1020_0x5caf,0x3c158));const AWS=require(a1020_0x42d785(0x93)),rp=require(a1020_0x42d785(0x9f)),util=require(a1020_0x42d785(0xb4)),{db}=require('@mysqldb'),{ValidationError}=require('sequelize'),logger=require('@config/logger')(a1020_0x42d785(0xb5));function getTranscriptionJob(_0x25dd53,_0x55393f,_0x179598,_0x340abf){return new Promise(function(_0x3338fc,_0x42ecee){const _0x2b3f76=a1020_0x3178,_0xae57f6=new AWS[(_0x2b3f76(0xaf))]({'accessKeyId':_0x55393f,'secretAccessKey':_0x25dd53,'region':_0x179598});_0xae57f6['getTranscriptionJob']({'TranscriptionJobName':_0x340abf},function(_0x1cf088,_0x2a09e8){return _0x1cf088?_0x42ecee(_0x1cf088):_0x3338fc(_0x2a09e8);});});}function sentiment(_0x2d6312,_0x4b9608,_0x281313,_0x1a867c,_0x4449a8){return new Promise(function(_0x2f8992,_0x385561){const _0x506145=a1020_0x3178,_0x4fb177=new AWS[(_0x506145(0xaa))]({'accessKeyId':_0x4b9608,'secretAccessKey':_0x2d6312,'region':_0x281313});_0x4fb177[_0x506145(0xd1)]({'Text':_0x1a867c,'LanguageCode':_0x4449a8['substring'](0x0,0x2)},function(_0x189928,_0x4c64ff){return _0x189928?_0x385561(_0x189928):_0x2f8992(_0x4c64ff);});});}function checkTranscribeJob(_0x35fcc4,_0x30066d,_0x21987c){let _0x432263;return new Promise(function(_0x7a375d){const _0x16dbaf=a1020_0x3178;return logger[_0x16dbaf(0xab)](util['format'](_0x16dbaf(0xc4),_0x35fcc4['id'],_0x35fcc4[_0x16dbaf(0xd0)])),getTranscriptionJob(_0x21987c[_0x16dbaf(0xdb)],_0x21987c[_0x16dbaf(0xb3)],_0x30066d[_0x16dbaf(0x99)],_0x35fcc4[_0x16dbaf(0xd0)])[_0x16dbaf(0xac)](function(_0x1162e9){const _0x19e02a=_0x16dbaf;logger[_0x19e02a(0xab)](util[_0x19e02a(0xc6)](_0x19e02a(0xb0),_0x35fcc4['id'],_0x35fcc4[_0x19e02a(0xd0)],_0x1162e9[_0x19e02a(0xd9)]['TranscriptionJobStatus']));if(!_0x35fcc4[_0x19e02a(0x95)])switch(_0x1162e9[_0x19e02a(0xd9)][_0x19e02a(0xc9)]){case _0x19e02a(0xbe):{const _0x52068d={'transcribeStatus':_0x1162e9['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x1162e9[_0x19e02a(0xd9)]['Transcript'][_0x19e02a(0xb7)]};return logger['info'](util[_0x19e02a(0xc6)]('[RECORDING:%d]\x20Get\x20transcript',_0x35fcc4['id'])),rp({'uri':_0x1162e9[_0x19e02a(0xd9)][_0x19e02a(0x90)]['TranscriptFileUri'],'json':!![]})[_0x19e02a(0xac)](function(_0x20055a){const _0x3bd1=_0x19e02a;logger[_0x3bd1(0xab)](util[_0x3bd1(0xc6)](_0x3bd1(0xcc),_0x35fcc4['id']));if(_0x20055a&&_0x20055a[_0x3bd1(0xa4)]&&_0x20055a[_0x3bd1(0xa4)][_0x3bd1(0x91)]&&_0x20055a[_0x3bd1(0xa4)][_0x3bd1(0x91)][_0x3bd1(0xbc)]){_0x52068d[_0x3bd1(0x95)]='';for(let _0x20da47=0x0;_0x20da47<_0x20055a[_0x3bd1(0xa4)][_0x3bd1(0x91)][_0x3bd1(0xbc)];_0x20da47++){_0x52068d[_0x3bd1(0x95)]+=_0x20055a[_0x3bd1(0xa4)][_0x3bd1(0x91)][_0x20da47]['transcript']+'';}}return _0x35fcc4['update'](_0x52068d);})[_0x19e02a(0xac)](function(){const _0x21280e=_0x19e02a;logger[_0x21280e(0xab)](util[_0x21280e(0xc6)](_0x21280e(0x97),_0x35fcc4['id']));if(!_0x35fcc4['tempSentiment'])throw new ValidationError('Sentiment\x20Analysis\x20not\x20requested');if(!_0x30066d[_0x21280e(0x92)]||!_0x30066d['sentimentAccountId']||!_0x30066d[_0x21280e(0xb2)]||!_0x30066d[_0x21280e(0xd7)]||!_0x30066d[_0x21280e(0xc7)])throw new ValidationError(_0x21280e(0xa8));if(!_0x52068d[_0x21280e(0x95)])throw new Error('Transcript\x20not\x20available');return _0x30066d[_0x21280e(0xa7)]===_0x21987c['id']?_0x21987c:db[_0x21280e(0xa9)][_0x21280e(0xd4)]({'where':{'id':_0x30066d[_0x21280e(0xa7)]}});})['then'](function(_0x262fcb){const _0x2e42e3=_0x19e02a;if(!_0x262fcb)throw new ValidationError(_0x2e42e3(0xb6));if(!_0x262fcb[_0x2e42e3(0xdb)]||!_0x262fcb[_0x2e42e3(0xb3)])throw new ValidationError(_0x2e42e3(0xb9));return _0x432263=_0x262fcb,logger[_0x2e42e3(0xab)](util[_0x2e42e3(0xc6)](_0x2e42e3(0xc2),_0x35fcc4['id'])),sentiment(_0x432263['data1'],_0x432263[_0x2e42e3(0xb3)],_0x30066d['sentimentRegion'],_0x52068d[_0x2e42e3(0x95)],_0x30066d[_0x2e42e3(0xd7)]);})[_0x19e02a(0xac)](function(_0x16adef){const _0x51f05e=_0x19e02a;return logger['info'](util[_0x51f05e(0xc6)](_0x51f05e(0xce),_0x35fcc4['id'])),_0x35fcc4['update']({'sentiment':_0x16adef[_0x51f05e(0xc0)],'sPositive':_0x16adef[_0x51f05e(0x96)][_0x51f05e(0xa6)],'sNegative':_0x16adef[_0x51f05e(0x96)][_0x51f05e(0x9b)],'sMixed':_0x16adef['SentimentScore'][_0x51f05e(0xc1)],'sNeutral':_0x16adef[_0x51f05e(0x96)]['Neutral']});})[_0x19e02a(0xac)](function(){const _0x3e3168=_0x19e02a;logger[_0x3e3168(0xab)](util[_0x3e3168(0xc6)](_0x3e3168(0x97),_0x35fcc4['id'])),_0x7a375d();});}case _0x19e02a(0xbb):return _0x35fcc4[_0x19e02a(0xae)]({'transcribeStatus':_0x19e02a(0xbb),'failureReason':_0x1162e9[_0x19e02a(0xd9)][_0x19e02a(0xd3)]})[_0x19e02a(0xac)](function(){const _0x5b5294=_0x19e02a;logger['info'](util[_0x5b5294(0xc6)](_0x5b5294(0x97),_0x35fcc4['id'])),_0x7a375d();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x35fcc4['id']));break;}else return Promise[_0x19e02a(0x9c)]()['then'](function(){const _0x201b05=_0x19e02a;if(!_0x35fcc4[_0x201b05(0xcf)])throw new ValidationError(_0x201b05(0xd2));if(!_0x30066d[_0x201b05(0x92)]||!_0x30066d[_0x201b05(0xa7)]||!_0x30066d[_0x201b05(0xb2)]||!_0x30066d[_0x201b05(0xd7)]||!_0x30066d[_0x201b05(0xc7)])throw new ValidationError(_0x201b05(0xa8));if(!_0x35fcc4[_0x201b05(0x95)])throw new Error(_0x201b05(0xcd));return _0x30066d['sentimentAccountId']===_0x21987c['id']?_0x21987c:db[_0x201b05(0xa9)][_0x201b05(0xd4)]({'where':{'id':_0x30066d[_0x201b05(0xa7)]}});})[_0x19e02a(0xac)](function(_0x45319b){const _0x51a773=_0x19e02a;if(!_0x45319b)throw new ValidationError(_0x51a773(0xb6));if(!_0x45319b[_0x51a773(0xdb)]||!_0x45319b['data2'])throw new ValidationError(_0x51a773(0xb9));return _0x432263=_0x45319b,logger[_0x51a773(0xab)](util['format'](_0x51a773(0xc2),_0x35fcc4['id'])),sentiment(_0x432263[_0x51a773(0xdb)],_0x432263[_0x51a773(0xb3)],_0x30066d[_0x51a773(0xb2)],_0x35fcc4[_0x51a773(0x95)],_0x30066d['language']);})[_0x19e02a(0xac)](function(_0x52427a){const _0x4314ce=_0x19e02a;return logger['info'](util[_0x4314ce(0xc6)]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x35fcc4['id'])),_0x35fcc4[_0x4314ce(0xae)]({'sentiment':_0x52427a[_0x4314ce(0xc0)],'sPositive':_0x52427a['SentimentScore'][_0x4314ce(0xa6)],'sNegative':_0x52427a[_0x4314ce(0x96)][_0x4314ce(0x9b)],'sMixed':_0x52427a[_0x4314ce(0x96)]['Mixed'],'sNeutral':_0x52427a['SentimentScore'][_0x4314ce(0xdc)],'transcribeStatus':_0x4314ce(0xbe)});})[_0x19e02a(0xac)](function(){const _0x3f2172=_0x19e02a;logger[_0x3f2172(0xab)](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x35fcc4['id'])),_0x7a375d();});})[_0x16dbaf(0xbd)](function(_0x2d7fa2){const _0x1a748b=_0x16dbaf;_0x2d7fa2&&((!_0x2d7fa2[_0x1a748b(0xb8)]||_0x2d7fa2['name']!==_0x1a748b(0xbf))&&logger['error'](util[_0x1a748b(0xc6)]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x35fcc4['id']),util[_0x1a748b(0xc8)](_0x2d7fa2,{'showHidden':![],'depth':null}))),_0x7a375d();});});}function checkTranscribe(){const _0x19e8bd=a1020_0x42d785;let _0x333cfd,_0x480626,_0x24bcd6;return db[_0x19e8bd(0xa2)][_0x19e8bd(0xa3)]({'where':{'transcribeStatus':_0x19e8bd(0xda)}})[_0x19e8bd(0xac)](function(_0x3ca7ed){const _0x186ef2=_0x19e8bd;if(!_0x3ca7ed||!_0x3ca7ed[_0x186ef2(0xbc)])throw new ValidationError(_0x186ef2(0xd8));return _0x333cfd=_0x3ca7ed,db[_0x186ef2(0x94)][_0x186ef2(0xd4)]({'where':{'id':0x1}});})[_0x19e8bd(0xac)](function(_0x1f6761){const _0x342185=_0x19e8bd;if(!_0x1f6761)throw new ValidationError(_0x342185(0xc3));_0x480626=_0x1f6761;if(!_0x480626['transcribe']||!_0x480626[_0x342185(0xc5)]||!_0x480626[_0x342185(0x99)]||!_0x480626['language']||!_0x480626[_0x342185(0xc7)])throw new ValidationError(_0x342185(0xcb));return db[_0x342185(0xa9)][_0x342185(0xd4)]({'where':{'id':_0x480626['transcribeAccountId']}});})[_0x19e8bd(0xac)](function(_0x139646){const _0x3f91b1=_0x19e8bd;if(!_0x139646)throw new ValidationError('Cloud\x20Provider\x20not\x20available');if(!_0x139646['data1']||!_0x139646[_0x3f91b1(0xb3)])throw new ValidationError(_0x3f91b1(0xb9));_0x24bcd6=_0x139646;const _0x55e79d=[];return _0x333cfd[_0x3f91b1(0xba)](function(_0x275184){const _0x42dfdb=_0x3f91b1;_0x55e79d[_0x42dfdb(0xb1)](checkTranscribeJob(_0x275184,_0x480626,_0x24bcd6));}),Promise[_0x3f91b1(0xd6)](_0x55e79d);})[_0x19e8bd(0xbd)](function(_0x2af9a3){const _0x212557=_0x19e8bd;_0x2af9a3&&((!_0x2af9a3['name']||_0x2af9a3['name']!=='SequelizeValidationError')&&logger[_0x212557(0x9e)](util[_0x212557(0xc8)](_0x2af9a3,{'showHidden':![],'depth':null})));});}exports[a1020_0x42d785(0xa1)]=function(){return setInterval(function(){return checkTranscribe();},0x3c*0x3e8),checkTranscribe();};
\ No newline at end of file
+const a1022_0x1579=['length','Settings\x20not\x20available','detectSentiment','Transcript','catch','results','sequelize','996yHzuMH','data2','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','sentiment','FAILED','657ssPKzT','request-promise-native','sentimentAccountId','transcribeAccountId','forEach','push','name','TranscriptionJob','sentimentRegion','VoiceRecording','1qoaxSj','resolve','inspect','[RECORDING:%d]\x20Transcript\x20downloaded','update','info','91819YgSWZo','tempSentiment','Sentiment','1nWpvve','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','Negative','Sentiment\x20Analysis\x20not\x20requested','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','83UutnsW','Cloud\x20Provider\x20not\x20configured','bucket','substring','TranscriptionJobStatus','format','IN_PROGRESS','22323dIOdfw','49257TvgCHY','CloudProvider','Mixed','SentimentScore','242075YzwCWC','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','Transcribe\x20not\x20configured','COMPLETED','No\x20transcribe\x20job\x20to\x20check','112618OFFDoD','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','fileText','Cloud\x20Provider\x20not\x20available','FailureReason','Setting','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','transcribeRegion','Positive','transcripts','transcript','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','findAll','SequelizeValidationError','@mysqldb','Neutral','Sentiment\x20Analysis\x20not\x20configured','all','error','data1','TranscribeService','transcribe','start','882355XWVpvY','Comprehend','findOne'];const a1022_0x3e04=function(_0x467d1b,_0x3b5220){_0x467d1b=_0x467d1b-0x92;let _0x1579d8=a1022_0x1579[_0x467d1b];return _0x1579d8;};const a1022_0x4aa8a5=a1022_0x3e04;(function(_0x48ea08,_0x1d2a1b){const _0x3119a5=a1022_0x3e04;while(!![]){try{const _0x542282=-parseInt(_0x3119a5(0x95))*-parseInt(_0x3119a5(0xac))+-parseInt(_0x3119a5(0xd9))*parseInt(_0x3119a5(0xde))+parseInt(_0x3119a5(0x9b))+-parseInt(_0x3119a5(0x9e))*parseInt(_0x3119a5(0xcf))+parseInt(_0x3119a5(0xb0))+-parseInt(_0x3119a5(0xb6))+-parseInt(_0x3119a5(0xab))*-parseInt(_0x3119a5(0xa4));if(_0x542282===_0x1d2a1b)break;else _0x48ea08['push'](_0x48ea08['shift']());}catch(_0x9131f8){_0x48ea08['push'](_0x48ea08['shift']());}}}(a1022_0x1579,0x8f377));const AWS=require('aws-sdk'),rp=require(a1022_0x4aa8a5(0xdf)),util=require('util'),{db}=require(a1022_0x4aa8a5(0xc6)),{ValidationError}=require(a1022_0x4aa8a5(0xd8)),logger=require('@config/logger')('transcribe');function getTranscriptionJob(_0x2c428e,_0x3983a7,_0x4a00cf,_0x29bb71){return new Promise(function(_0x421f7d,_0x219539){const _0xd5d667=a1022_0x3e04,_0x31a4cc=new AWS[(_0xd5d667(0xcc))]({'accessKeyId':_0x3983a7,'secretAccessKey':_0x2c428e,'region':_0x4a00cf});_0x31a4cc['getTranscriptionJob']({'TranscriptionJobName':_0x29bb71},function(_0x574058,_0x44b642){return _0x574058?_0x219539(_0x574058):_0x421f7d(_0x44b642);});});}function sentiment(_0x3d2427,_0x21f763,_0x2a594e,_0x53b119,_0x38c069){return new Promise(function(_0x1060c4,_0x8740a9){const _0x2e7b3a=a1022_0x3e04,_0x4da7d0=new AWS[(_0x2e7b3a(0xd0))]({'accessKeyId':_0x21f763,'secretAccessKey':_0x3d2427,'region':_0x2a594e});_0x4da7d0[_0x2e7b3a(0xd4)]({'Text':_0x53b119,'LanguageCode':_0x38c069[_0x2e7b3a(0xa7)](0x0,0x2)},function(_0x136bb9,_0x1b1d6d){return _0x136bb9?_0x8740a9(_0x136bb9):_0x1060c4(_0x1b1d6d);});});}function checkTranscribeJob(_0x26c516,_0x28b3bd,_0x3982bb){let _0x3056c5;return new Promise(function(_0x1b35fc){const _0x37034e=a1022_0x3e04;return logger['info'](util['format'](_0x37034e(0xa3),_0x26c516['id'],_0x26c516[_0x37034e(0xa0)])),getTranscriptionJob(_0x3982bb['data1'],_0x3982bb[_0x37034e(0xda)],_0x28b3bd[_0x37034e(0xbe)],_0x26c516['transcribeName'])[_0x37034e(0xc2)](function(_0x3f74e8){const _0x583138=_0x37034e;logger[_0x583138(0x9a)](util['format'](_0x583138(0x9f),_0x26c516['id'],_0x26c516[_0x583138(0xa0)],_0x3f74e8[_0x583138(0x92)]['TranscriptionJobStatus']));if(!_0x26c516[_0x583138(0xb8)])switch(_0x3f74e8['TranscriptionJob'][_0x583138(0xa8)]){case _0x583138(0xb4):{const _0x337b34={'transcribeStatus':_0x3f74e8['TranscriptionJob'][_0x583138(0xa8)],'fileUri':_0x3f74e8[_0x583138(0x92)]['Transcript'][_0x583138(0xb2)]};return logger['info'](util['format'](_0x583138(0xb1),_0x26c516['id'])),rp({'uri':_0x3f74e8[_0x583138(0x92)][_0x583138(0xd5)]['TranscriptFileUri'],'json':!![]})[_0x583138(0xc2)](function(_0x179cdb){const _0x444263=_0x583138;logger['info'](util[_0x444263(0xa9)](_0x444263(0x98),_0x26c516['id']));if(_0x179cdb&&_0x179cdb[_0x444263(0xd7)]&&_0x179cdb['results']['transcripts']&&_0x179cdb['results'][_0x444263(0xc0)][_0x444263(0xd2)]){_0x337b34[_0x444263(0xb8)]='';for(let _0x1c836f=0x0;_0x1c836f<_0x179cdb[_0x444263(0xd7)]['transcripts'][_0x444263(0xd2)];_0x1c836f++){_0x337b34[_0x444263(0xb8)]+=_0x179cdb['results'][_0x444263(0xc0)][_0x1c836f][_0x444263(0xc1)]+'';}}return _0x26c516[_0x444263(0x99)](_0x337b34);})['then'](function(){const _0x4582f4=_0x583138;logger[_0x4582f4(0x9a)](util[_0x4582f4(0xa9)](_0x4582f4(0xc3),_0x26c516['id']));if(!_0x26c516[_0x4582f4(0x9c)])throw new ValidationError(_0x4582f4(0xa2));if(!_0x28b3bd[_0x4582f4(0xdc)]||!_0x28b3bd[_0x4582f4(0xe0)]||!_0x28b3bd[_0x4582f4(0x93)]||!_0x28b3bd['language']||!_0x28b3bd['bucket'])throw new ValidationError(_0x4582f4(0xc8));if(!_0x337b34[_0x4582f4(0xb8)])throw new Error('Transcript\x20not\x20available');return _0x28b3bd['sentimentAccountId']===_0x3982bb['id']?_0x3982bb:db[_0x4582f4(0xad)][_0x4582f4(0xd1)]({'where':{'id':_0x28b3bd['sentimentAccountId']}});})[_0x583138(0xc2)](function(_0x1919d6){const _0x122b36=_0x583138;if(!_0x1919d6)throw new ValidationError(_0x122b36(0xb9));if(!_0x1919d6[_0x122b36(0xcb)]||!_0x1919d6[_0x122b36(0xda)])throw new ValidationError('Cloud\x20Provider\x20not\x20configured');return _0x3056c5=_0x1919d6,logger['info'](util['format'](_0x122b36(0xbc),_0x26c516['id'])),sentiment(_0x3056c5['data1'],_0x3056c5['data2'],_0x28b3bd[_0x122b36(0x93)],_0x337b34['fileText'],_0x28b3bd[_0x122b36(0xbd)]);})[_0x583138(0xc2)](function(_0x3cda22){const _0x2fa399=_0x583138;return logger[_0x2fa399(0x9a)](util['format'](_0x2fa399(0xb7),_0x26c516['id'])),_0x26c516[_0x2fa399(0x99)]({'sentiment':_0x3cda22[_0x2fa399(0x9d)],'sPositive':_0x3cda22[_0x2fa399(0xaf)][_0x2fa399(0xbf)],'sNegative':_0x3cda22[_0x2fa399(0xaf)][_0x2fa399(0xa1)],'sMixed':_0x3cda22[_0x2fa399(0xaf)][_0x2fa399(0xae)],'sNeutral':_0x3cda22['SentimentScore'][_0x2fa399(0xc7)]});})[_0x583138(0xc2)](function(){const _0x3c58e9=_0x583138;logger['info'](util[_0x3c58e9(0xa9)]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x26c516['id'])),_0x1b35fc();});}case _0x583138(0xdd):return _0x26c516[_0x583138(0x99)]({'transcribeStatus':_0x583138(0xdd),'failureReason':_0x3f74e8[_0x583138(0x92)][_0x583138(0xba)]})[_0x583138(0xc2)](function(){const _0x2e3dcd=_0x583138;logger[_0x2e3dcd(0x9a)](util[_0x2e3dcd(0xa9)](_0x2e3dcd(0xc3),_0x26c516['id'])),_0x1b35fc();});default:logger[_0x583138(0x9a)](util[_0x583138(0xa9)]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x26c516['id']));break;}else return Promise[_0x583138(0x96)]()['then'](function(){const _0x5a8520=_0x583138;if(!_0x26c516[_0x5a8520(0x9c)])throw new ValidationError('Sentiment\x20Analysis\x20not\x20requested');if(!_0x28b3bd[_0x5a8520(0xdc)]||!_0x28b3bd['sentimentAccountId']||!_0x28b3bd[_0x5a8520(0x93)]||!_0x28b3bd[_0x5a8520(0xbd)]||!_0x28b3bd[_0x5a8520(0xa6)])throw new ValidationError(_0x5a8520(0xc8));if(!_0x26c516[_0x5a8520(0xb8)])throw new Error('Transcript\x20not\x20available');return _0x28b3bd[_0x5a8520(0xe0)]===_0x3982bb['id']?_0x3982bb:db['CloudProvider'][_0x5a8520(0xd1)]({'where':{'id':_0x28b3bd[_0x5a8520(0xe0)]}});})[_0x583138(0xc2)](function(_0x459bfb){const _0x2f6f71=_0x583138;if(!_0x459bfb)throw new ValidationError(_0x2f6f71(0xb9));if(!_0x459bfb[_0x2f6f71(0xcb)]||!_0x459bfb[_0x2f6f71(0xda)])throw new ValidationError(_0x2f6f71(0xa5));return _0x3056c5=_0x459bfb,logger[_0x2f6f71(0x9a)](util[_0x2f6f71(0xa9)](_0x2f6f71(0xbc),_0x26c516['id'])),sentiment(_0x3056c5[_0x2f6f71(0xcb)],_0x3056c5[_0x2f6f71(0xda)],_0x28b3bd['sentimentRegion'],_0x26c516[_0x2f6f71(0xb8)],_0x28b3bd['language']);})['then'](function(_0x598a1d){const _0x50bef9=_0x583138;return logger[_0x50bef9(0x9a)](util[_0x50bef9(0xa9)](_0x50bef9(0xb7),_0x26c516['id'])),_0x26c516[_0x50bef9(0x99)]({'sentiment':_0x598a1d[_0x50bef9(0x9d)],'sPositive':_0x598a1d[_0x50bef9(0xaf)]['Positive'],'sNegative':_0x598a1d['SentimentScore'][_0x50bef9(0xa1)],'sMixed':_0x598a1d[_0x50bef9(0xaf)][_0x50bef9(0xae)],'sNeutral':_0x598a1d['SentimentScore'][_0x50bef9(0xc7)],'transcribeStatus':'COMPLETED'});})[_0x583138(0xc2)](function(){const _0x12b770=_0x583138;logger['info'](util[_0x12b770(0xa9)](_0x12b770(0xc3),_0x26c516['id'])),_0x1b35fc();});})[_0x37034e(0xd6)](function(_0x223cef){const _0x5aafdd=_0x37034e;_0x223cef&&((!_0x223cef[_0x5aafdd(0xe4)]||_0x223cef[_0x5aafdd(0xe4)]!==_0x5aafdd(0xc5))&&logger[_0x5aafdd(0xca)](util[_0x5aafdd(0xa9)](_0x5aafdd(0xdb),_0x26c516['id']),util[_0x5aafdd(0x97)](_0x223cef,{'showHidden':![],'depth':null}))),_0x1b35fc();});});}function checkTranscribe(){const _0x384173=a1022_0x4aa8a5;let _0x4091cc,_0x3634e2,_0x4fa94b;return db[_0x384173(0x94)][_0x384173(0xc4)]({'where':{'transcribeStatus':_0x384173(0xaa)}})[_0x384173(0xc2)](function(_0x66d4bf){const _0x44391a=_0x384173;if(!_0x66d4bf||!_0x66d4bf[_0x44391a(0xd2)])throw new ValidationError(_0x44391a(0xb5));return _0x4091cc=_0x66d4bf,db[_0x44391a(0xbb)][_0x44391a(0xd1)]({'where':{'id':0x1}});})[_0x384173(0xc2)](function(_0x5ef483){const _0x52411e=_0x384173;if(!_0x5ef483)throw new ValidationError(_0x52411e(0xd3));_0x3634e2=_0x5ef483;if(!_0x3634e2[_0x52411e(0xcd)]||!_0x3634e2['transcribeAccountId']||!_0x3634e2['transcribeRegion']||!_0x3634e2[_0x52411e(0xbd)]||!_0x3634e2[_0x52411e(0xa6)])throw new ValidationError(_0x52411e(0xb3));return db[_0x52411e(0xad)][_0x52411e(0xd1)]({'where':{'id':_0x3634e2[_0x52411e(0xe1)]}});})['then'](function(_0xd472a2){const _0x294baa=_0x384173;if(!_0xd472a2)throw new ValidationError(_0x294baa(0xb9));if(!_0xd472a2[_0x294baa(0xcb)]||!_0xd472a2['data2'])throw new ValidationError(_0x294baa(0xa5));_0x4fa94b=_0xd472a2;const _0x2e493a=[];return _0x4091cc[_0x294baa(0xe2)](function(_0x366617){const _0x577c2b=_0x294baa;_0x2e493a[_0x577c2b(0xe3)](checkTranscribeJob(_0x366617,_0x3634e2,_0x4fa94b));}),Promise[_0x294baa(0xc9)](_0x2e493a);})['catch'](function(_0x35bce1){const _0x2fdca1=_0x384173;_0x35bce1&&((!_0x35bce1[_0x2fdca1(0xe4)]||_0x35bce1['name']!==_0x2fdca1(0xc5))&&logger['error'](util[_0x2fdca1(0x97)](_0x35bce1,{'showHidden':![],'depth':null})));});}exports[a1022_0x4aa8a5(0xce)]=function(){return setInterval(function(){return checkTranscribe();},0x3c*0x3e8),checkTranscribe();};
\ No newline at end of file