Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index e552080..5b72910 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df4=['callerid','calleridname','dnid','extension','text','access_token','project','channelData','ndagenerate_audio','custom_action','body','CustomAction','custom_action_data','CustomActionData','info','../../../../../config/logger','agi','exports','POST','/token','password','username','resolve','ndassistant_url','ndaactivity_type','Nda','uniqueid'];(function(_0x56e383,_0x2f844f){var _0x4a2156=function(_0x34f534){while(--_0x34f534){_0x56e383['push'](_0x56e383['shift']());}};_0x4a2156(++_0x2f844f);}(_0x3df4,0x102));var _0x43df=function(_0x5a28ae,_0x31bcf3){_0x5a28ae=_0x5a28ae-0x0;var _0x2f5156=_0x3df4[_0x5a28ae];return _0x2f5156;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x43df('0x0'))(_0x43df('0x1'));module[_0x43df('0x2')]=function(_0x206707,_0x38a050){var _0x2985bf={'method':_0x43df('0x3'),'uri':url['resolve'](_0x38a050['ndauth_url'],_0x43df('0x4')),'form':{'grant_type':_0x43df('0x5'),'username':_0x38a050[_0x43df('0x6')],'password':_0x38a050[_0x43df('0x5')]},'json':!![]};return rp(_0x2985bf)['then'](function(_0x5863be){var _0x2492a9={'method':_0x43df('0x3'),'uri':url[_0x43df('0x7')](_0x38a050[_0x43df('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x38a050[_0x43df('0x9')]||'message','channelId':_0x43df('0xa'),'conversation':{'id':_0x206707[_0x43df('0xb')]},'from':{'id':_0x206707[_0x43df('0xc')],'name':_0x206707[_0x43df('0xd')]},'recipient':{'id':_0x206707[_0x43df('0xe')],'name':_0x206707[_0x43df('0xf')]},'text':_0x38a050[_0x43df('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5863be[_0x43df('0x11')]},'json':!![]};if(_0x38a050[_0x43df('0x12')]){_0x2492a9['body'][_0x43df('0x13')]['ProjectName']=_0x38a050[_0x43df('0x12')];}if(_0x38a050[_0x43df('0x14')]=='1'){_0x2492a9['body'][_0x43df('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x38a050[_0x43df('0x15')]){_0x2492a9[_0x43df('0x16')]['channelData'][_0x43df('0x17')]=_0x38a050['custom_action'];if(_0x38a050[_0x43df('0x18')]){_0x2492a9[_0x43df('0x16')][_0x43df('0x13')][_0x43df('0x19')]=_0x38a050[_0x43df('0x18')];}}logger[_0x43df('0x1a')](JSON['stringify'](_0x2492a9));return rp(_0x2492a9);});};
\ No newline at end of file
+var _0x7d98=['ndagenerate_audio','AudioOutputSettings','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','password','then','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName'];(function(_0x161bd5,_0x3bbc97){var _0x560baf=function(_0x34ad65){while(--_0x34ad65){_0x161bd5['push'](_0x161bd5['shift']());}};_0x560baf(++_0x3bbc97);}(_0x7d98,0xe7));var _0x87d9=function(_0x15fc7a,_0xd21741){_0x15fc7a=_0x15fc7a-0x0;var _0x3aa9f4=_0x7d98[_0x15fc7a];return _0x3aa9f4;};'use strict';var rp=require(_0x87d9('0x0'));var url=require('url');var logger=require(_0x87d9('0x1'))(_0x87d9('0x2'));module[_0x87d9('0x3')]=function(_0xbee750,_0x47cceb){var _0x417ed2={'method':_0x87d9('0x4'),'uri':url['resolve'](_0x47cceb[_0x87d9('0x5')],'/token'),'form':{'grant_type':'password','username':_0x47cceb['username'],'password':_0x47cceb[_0x87d9('0x6')]},'json':!![]};return rp(_0x417ed2)[_0x87d9('0x7')](function(_0x2dc542){var _0x5f2693={'method':_0x87d9('0x4'),'uri':url[_0x87d9('0x8')](_0x47cceb[_0x87d9('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x47cceb[_0x87d9('0xa')]||_0x87d9('0xb'),'channelId':_0x87d9('0xc'),'conversation':{'id':_0xbee750[_0x87d9('0xd')]},'from':{'id':_0xbee750[_0x87d9('0xe')],'name':_0xbee750[_0x87d9('0xf')]},'recipient':{'id':_0xbee750[_0x87d9('0x10')],'name':_0xbee750[_0x87d9('0x11')]},'text':_0x47cceb[_0x87d9('0x12')],'channelData':{}},'headers':{'Authorization':_0x87d9('0x13')+_0x2dc542[_0x87d9('0x14')]},'json':!![]};if(_0x47cceb[_0x87d9('0x15')]){_0x5f2693[_0x87d9('0x16')][_0x87d9('0x17')][_0x87d9('0x18')]=_0x47cceb[_0x87d9('0x15')];}if(_0x47cceb[_0x87d9('0x19')]=='1'){_0x5f2693[_0x87d9('0x16')][_0x87d9('0x17')][_0x87d9('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x47cceb['custom_action']){_0x5f2693[_0x87d9('0x16')][_0x87d9('0x17')][_0x87d9('0x1b')]=_0x47cceb['custom_action'];if(_0x47cceb['custom_action_data']){_0x5f2693[_0x87d9('0x16')][_0x87d9('0x17')][_0x87d9('0x1c')]=_0x47cceb[_0x87d9('0x1d')];}}logger[_0x87d9('0x1e')](JSON[_0x87d9('0x1f')](_0x5f2693));return rp(_0x5f2693);});};
\ No newline at end of file