Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / services / agi / scripts / sestek / nda / index.js
index 798b5bc..6c98465 100644 (file)
@@ -1 +1 @@
-const a1211_0x1bb6=['request-promise-native','ndaactivity_type','info','CustomAction','message','calleridname','channelData','password','ndagenerate_audio','dnid','username','POST','toString','audio/wav','project','ndassistant_url','URL','stringify','exports','Nda','body','ndauth_url','/api/NaturalDialogAssistant/v1/Run','extension','access_token','custom_action_data','callerid','uniqueid','../../../../../config/logger','url','text','ProjectName'];(function(_0x57da1b,_0x40ed0a){const _0x1bb623=function(_0x282426){while(--_0x282426){_0x57da1b['push'](_0x57da1b['shift']());}};_0x1bb623(++_0x40ed0a);}(a1211_0x1bb6,0xfc));const a1211_0x2824=function(_0x57da1b,_0x40ed0a){_0x57da1b=_0x57da1b-0x14b;let _0x1bb623=a1211_0x1bb6[_0x57da1b];return _0x1bb623;};const a1211_0xde6937=a1211_0x2824;'use strict';const rp=require(a1211_0xde6937(0x14f)),url=require(a1211_0xde6937(0x14c)),logger=require(a1211_0xde6937(0x14b))('agi');module[a1211_0xde6937(0x161)]=function(_0x2a8a1d,_0x13ebb6){const _0x48257d=a1211_0xde6937,_0x1cb3aa=new url['URL']('/token',_0x13ebb6[_0x48257d(0x164)])[_0x48257d(0x15b)](),_0x3aa99d={'method':_0x48257d(0x15a),'uri':_0x1cb3aa,'form':{'grant_type':_0x48257d(0x156),'username':_0x13ebb6[_0x48257d(0x159)],'password':_0x13ebb6[_0x48257d(0x156)]},'json':!![]};return rp(_0x3aa99d)['then'](function(_0x3af86b){const _0x270f26=_0x48257d,_0x2edab1=new url[(_0x270f26(0x15f))](_0x270f26(0x165),_0x13ebb6[_0x270f26(0x15e)])[_0x270f26(0x15b)](),_0x490161={'method':_0x270f26(0x15a),'uri':_0x2edab1,'body':{'type':_0x13ebb6[_0x270f26(0x150)]||_0x270f26(0x153),'channelId':_0x270f26(0x162),'conversation':{'id':_0x2a8a1d[_0x270f26(0x16a)]},'from':{'id':_0x2a8a1d[_0x270f26(0x169)],'name':_0x2a8a1d[_0x270f26(0x154)]},'recipient':{'id':_0x2a8a1d[_0x270f26(0x158)],'name':_0x2a8a1d[_0x270f26(0x166)]},'text':_0x13ebb6[_0x270f26(0x14d)],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3af86b[_0x270f26(0x167)]},'json':!![]};return _0x13ebb6[_0x270f26(0x15d)]&&(_0x490161[_0x270f26(0x163)][_0x270f26(0x155)][_0x270f26(0x14e)]=_0x13ebb6[_0x270f26(0x15d)]),_0x13ebb6[_0x270f26(0x157)]=='1'&&(_0x490161[_0x270f26(0x163)][_0x270f26(0x155)]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x270f26(0x15c)}),_0x13ebb6['custom_action']&&(_0x490161[_0x270f26(0x163)]['channelData'][_0x270f26(0x152)]=_0x13ebb6['custom_action'],_0x13ebb6[_0x270f26(0x168)]&&(_0x490161['body'][_0x270f26(0x155)]['CustomActionData']=_0x13ebb6[_0x270f26(0x168)])),logger[_0x270f26(0x151)](JSON[_0x270f26(0x160)](_0x490161)),rp(_0x490161);});};
\ No newline at end of file
+const a1211_0x4d72=['exports','Nda','uniqueid','CustomAction','text','then','channelData','callerid','POST','password','AudioOutputSettings','project','Bearer\x20','url','access_token','body','info','../../../../../config/logger','agi','ndagenerate_audio','custom_action_data','custom_action','toString','ndaactivity_type','URL','audio/wav','/token','calleridname','CustomActionData'];(function(_0x544e96,_0x1fdce3){const _0x4d72a4=function(_0x192045){while(--_0x192045){_0x544e96['push'](_0x544e96['shift']());}};_0x4d72a4(++_0x1fdce3);}(a1211_0x4d72,0x141));const a1211_0x1920=function(_0x544e96,_0x1fdce3){_0x544e96=_0x544e96-0x128;let _0x4d72a4=a1211_0x4d72[_0x544e96];return _0x4d72a4;};const a1211_0x194574=a1211_0x1920;'use strict';const rp=require('request-promise-native'),url=require(a1211_0x194574(0x133)),logger=require(a1211_0x194574(0x137))(a1211_0x194574(0x138));module[a1211_0x194574(0x143)]=function(_0x40fbe9,_0xa4dcff){const _0x30223d=a1211_0x194574,_0x2d7398=new url[(_0x30223d(0x13e))](_0x30223d(0x140),_0xa4dcff['ndauth_url'])[_0x30223d(0x13c)](),_0x496374={'method':_0x30223d(0x12e),'uri':_0x2d7398,'form':{'grant_type':_0x30223d(0x12f),'username':_0xa4dcff['username'],'password':_0xa4dcff[_0x30223d(0x12f)]},'json':!![]};return rp(_0x496374)[_0x30223d(0x12b)](function(_0x4e7fb4){const _0xa2010f=_0x30223d,_0x1d6b2e=new url[(_0xa2010f(0x13e))]('/api/NaturalDialogAssistant/v1/Run',_0xa4dcff['ndassistant_url'])[_0xa2010f(0x13c)](),_0x566d8c={'method':'POST','uri':_0x1d6b2e,'body':{'type':_0xa4dcff[_0xa2010f(0x13d)]||'message','channelId':_0xa2010f(0x144),'conversation':{'id':_0x40fbe9[_0xa2010f(0x128)]},'from':{'id':_0x40fbe9[_0xa2010f(0x12d)],'name':_0x40fbe9[_0xa2010f(0x141)]},'recipient':{'id':_0x40fbe9['dnid'],'name':_0x40fbe9['extension']},'text':_0xa4dcff[_0xa2010f(0x12a)],'channelData':{}},'headers':{'Authorization':_0xa2010f(0x132)+_0x4e7fb4[_0xa2010f(0x134)]},'json':!![]};return _0xa4dcff[_0xa2010f(0x131)]&&(_0x566d8c[_0xa2010f(0x135)]['channelData']['ProjectName']=_0xa4dcff[_0xa2010f(0x131)]),_0xa4dcff[_0xa2010f(0x139)]=='1'&&(_0x566d8c[_0xa2010f(0x135)][_0xa2010f(0x12c)][_0xa2010f(0x130)]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa2010f(0x13f)}),_0xa4dcff[_0xa2010f(0x13b)]&&(_0x566d8c[_0xa2010f(0x135)][_0xa2010f(0x12c)][_0xa2010f(0x129)]=_0xa4dcff[_0xa2010f(0x13b)],_0xa4dcff[_0xa2010f(0x13a)]&&(_0x566d8c[_0xa2010f(0x135)][_0xa2010f(0x12c)][_0xa2010f(0x142)]=_0xa4dcff[_0xa2010f(0x13a)])),logger[_0xa2010f(0x136)](JSON['stringify'](_0x566d8c)),rp(_0x566d8c);});};
\ No newline at end of file