Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / services / agi / scripts / sestek / nda / index.js
1 const a1043_0x59b3=['username','POST','URL','ndaactivity_type','/api/NaturalDialogAssistant/v1/Run','info','password','uniqueid','custom_action','project','message','custom_action_data','toString','ndassistant_url','ndagenerate_audio','url','body','callerid','exports','../../../../../config/logger','AudioOutputSettings','/token','then','CustomAction','request-promise-native','dnid','Bearer\x20','text','audio/wav','channelData'];(function(_0x36225a,_0x59b366){const _0x11066b=function(_0x31208f){while(--_0x31208f){_0x36225a['push'](_0x36225a['shift']());}};_0x11066b(++_0x59b366);}(a1043_0x59b3,0xe6));const a1043_0x1106=function(_0x36225a,_0x59b366){_0x36225a=_0x36225a-0x0;let _0x11066b=a1043_0x59b3[_0x36225a];return _0x11066b;};const _0x2ab4e8=a1043_0x1106;'use strict';const rp=require(_0x2ab4e8('0x4')),url=require(_0x2ab4e8('0x19')),logger=require(_0x2ab4e8('0x1d'))('agi');module[_0x2ab4e8('0x1c')]=function(_0x31208f,_0x44d204){const _0x3fbd0a=_0x2ab4e8,_0x86bc29=new url[(_0x3fbd0a('0xc'))](_0x3fbd0a('0x1'),_0x44d204['ndauth_url'])[_0x3fbd0a('0x16')](),_0x31b64c={'method':_0x3fbd0a('0xb'),'uri':_0x86bc29,'form':{'grant_type':_0x3fbd0a('0x10'),'username':_0x44d204[_0x3fbd0a('0xa')],'password':_0x44d204[_0x3fbd0a('0x10')]},'json':!![]};return rp(_0x31b64c)[_0x3fbd0a('0x2')](function(_0x4f0068){const _0x5edcad=_0x3fbd0a,_0x2c1d58=new url[(_0x5edcad('0xc'))](_0x5edcad('0xe'),_0x44d204[_0x5edcad('0x17')])[_0x5edcad('0x16')](),_0x38169d={'method':_0x5edcad('0xb'),'uri':_0x2c1d58,'body':{'type':_0x44d204[_0x5edcad('0xd')]||_0x5edcad('0x14'),'channelId':'Nda','conversation':{'id':_0x31208f[_0x5edcad('0x11')]},'from':{'id':_0x31208f[_0x5edcad('0x1b')],'name':_0x31208f['calleridname']},'recipient':{'id':_0x31208f[_0x5edcad('0x5')],'name':_0x31208f['extension']},'text':_0x44d204[_0x5edcad('0x7')],'channelData':{}},'headers':{'Authorization':_0x5edcad('0x6')+_0x4f0068['access_token']},'json':!![]};return _0x44d204[_0x5edcad('0x13')]&&(_0x38169d[_0x5edcad('0x1a')][_0x5edcad('0x9')]['ProjectName']=_0x44d204[_0x5edcad('0x13')]),_0x44d204[_0x5edcad('0x18')]=='1'&&(_0x38169d[_0x5edcad('0x1a')]['channelData'][_0x5edcad('0x0')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5edcad('0x8')}),_0x44d204[_0x5edcad('0x12')]&&(_0x38169d[_0x5edcad('0x1a')][_0x5edcad('0x9')][_0x5edcad('0x3')]=_0x44d204[_0x5edcad('0x12')],_0x44d204['custom_action_data']&&(_0x38169d['body'][_0x5edcad('0x9')]['CustomActionData']=_0x44d204[_0x5edcad('0x15')])),logger[_0x5edcad('0xf')](JSON['stringify'](_0x38169d)),rp(_0x38169d);});};