X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Fagi%2Fscripts%2Fsestek%2Fnda%2Findex.js;h=02f8343a6ff2868cb8732439bfb13e299c59a43d;hb=784ff39bf52a5b7c5ee0b7b10d0e51f0257b5940;hp=b2286f3daf08dec6d983474145967dcf47130e6b;hpb=17b36376d3b7411763084143a03a7c6d2fc5e7b1;p=motion2.git diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index b2286f3..02f8343 100644 --- a/server/services/agi/scripts/sestek/nda/index.js +++ b/server/services/agi/scripts/sestek/nda/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31a6=['text','Bearer\x20','access_token','body','project','ndagenerate_audio','channelData','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','ndauth_url','password','then','resolve','message','Nda','callerid','dnid'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x31a6,0x145));var _0x631a=function(_0x47f09e,_0x226150){_0x47f09e=_0x47f09e-0x0;var _0x4f9852=_0x31a6[_0x47f09e];return _0x4f9852;};'use strict';var rp=require(_0x631a('0x0'));var url=require(_0x631a('0x1'));var logger=require(_0x631a('0x2'))(_0x631a('0x3'));module['exports']=function(_0x124f26,_0x482322){var _0x44f4a3={'method':_0x631a('0x4'),'uri':url['resolve'](_0x482322[_0x631a('0x5')],'/token'),'form':{'grant_type':_0x631a('0x6'),'username':_0x482322['username'],'password':_0x482322[_0x631a('0x6')]},'json':!![]};return rp(_0x44f4a3)[_0x631a('0x7')](function(_0x2e47f1){var _0x20f95a={'method':_0x631a('0x4'),'uri':url[_0x631a('0x8')](_0x482322['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x482322['ndaactivity_type']||_0x631a('0x9'),'channelId':_0x631a('0xa'),'conversation':{'id':_0x124f26['uniqueid']},'from':{'id':_0x124f26[_0x631a('0xb')],'name':_0x124f26['calleridname']},'recipient':{'id':_0x124f26[_0x631a('0xc')],'name':_0x124f26['extension']},'text':_0x482322[_0x631a('0xd')],'channelData':{}},'headers':{'Authorization':_0x631a('0xe')+_0x2e47f1[_0x631a('0xf')]},'json':!![]};if(_0x482322['project']){_0x20f95a[_0x631a('0x10')]['channelData']['ProjectName']=_0x482322[_0x631a('0x11')];}if(_0x482322[_0x631a('0x12')]=='1'){_0x20f95a[_0x631a('0x10')][_0x631a('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x631a('0x14')};}if(_0x482322[_0x631a('0x15')]){_0x20f95a[_0x631a('0x10')]['channelData']['CustomAction']=_0x482322[_0x631a('0x15')];if(_0x482322[_0x631a('0x16')]){_0x20f95a[_0x631a('0x10')][_0x631a('0x13')][_0x631a('0x17')]=_0x482322[_0x631a('0x16')];}}logger[_0x631a('0x18')](JSON[_0x631a('0x19')](_0x20f95a));return rp(_0x20f95a);});}; \ No newline at end of file +var _0x4c58=['url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise'];(function(_0x26916e,_0x59ca88){var _0x55d319=function(_0x4adc03){while(--_0x4adc03){_0x26916e['push'](_0x26916e['shift']());}};_0x55d319(++_0x59ca88);}(_0x4c58,0x175));var _0x84c5=function(_0x254527,_0x5dc524){_0x254527=_0x254527-0x0;var _0x4888cf=_0x4c58[_0x254527];return _0x4888cf;};'use strict';var rp=require(_0x84c5('0x0'));var url=require(_0x84c5('0x1'));var logger=require(_0x84c5('0x2'))(_0x84c5('0x3'));module[_0x84c5('0x4')]=function(_0x2750cb,_0xe3f3e9){var _0x16562f={'method':_0x84c5('0x5'),'uri':url[_0x84c5('0x6')](_0xe3f3e9[_0x84c5('0x7')],_0x84c5('0x8')),'form':{'grant_type':_0x84c5('0x9'),'username':_0xe3f3e9['username'],'password':_0xe3f3e9['password']},'json':!![]};return rp(_0x16562f)['then'](function(_0x2c47aa){var _0x302abc={'method':_0x84c5('0x5'),'uri':url[_0x84c5('0x6')](_0xe3f3e9[_0x84c5('0xa')],_0x84c5('0xb')),'body':{'type':_0xe3f3e9[_0x84c5('0xc')]||_0x84c5('0xd'),'channelId':_0x84c5('0xe'),'conversation':{'id':_0x2750cb[_0x84c5('0xf')]},'from':{'id':_0x2750cb[_0x84c5('0x10')],'name':_0x2750cb[_0x84c5('0x11')]},'recipient':{'id':_0x2750cb[_0x84c5('0x12')],'name':_0x2750cb[_0x84c5('0x13')]},'text':_0xe3f3e9[_0x84c5('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2c47aa[_0x84c5('0x15')]},'json':!![]};if(_0xe3f3e9[_0x84c5('0x16')]){_0x302abc['body'][_0x84c5('0x17')][_0x84c5('0x18')]=_0xe3f3e9[_0x84c5('0x16')];}if(_0xe3f3e9[_0x84c5('0x19')]=='1'){_0x302abc[_0x84c5('0x1a')][_0x84c5('0x17')][_0x84c5('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x84c5('0x1c')};}if(_0xe3f3e9[_0x84c5('0x1d')]){_0x302abc['body'][_0x84c5('0x17')][_0x84c5('0x1e')]=_0xe3f3e9[_0x84c5('0x1d')];if(_0xe3f3e9['custom_action_data']){_0x302abc[_0x84c5('0x1a')][_0x84c5('0x17')]['CustomActionData']=_0xe3f3e9[_0x84c5('0x1f')];}}logger[_0x84c5('0x20')](JSON[_0x84c5('0x21')](_0x302abc));return rp(_0x302abc);});}; \ No newline at end of file