Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index 8f79b6d..5e197ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2948=['project','body','channelData','ProjectName','ndagenerate_audio','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','password','username','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token'];(function(_0x52bdd8,_0x4e2f5e){var _0x14445a=function(_0x41be88){while(--_0x41be88){_0x52bdd8['push'](_0x52bdd8['shift']());}};_0x14445a(++_0x4e2f5e);}(_0x2948,0xcb));var _0x8294=function(_0x4c53c1,_0x177202){_0x4c53c1=_0x4c53c1-0x0;var _0x54bd98=_0x2948[_0x4c53c1];return _0x54bd98;};'use strict';var rp=require(_0x8294('0x0'));var url=require(_0x8294('0x1'));var logger=require(_0x8294('0x2'))(_0x8294('0x3'));module[_0x8294('0x4')]=function(_0xbbaec1,_0xcb5eea){var _0x2209e9={'method':_0x8294('0x5'),'uri':url['resolve'](_0xcb5eea[_0x8294('0x6')],'/token'),'form':{'grant_type':_0x8294('0x7'),'username':_0xcb5eea[_0x8294('0x8')],'password':_0xcb5eea[_0x8294('0x7')]},'json':!![]};return rp(_0x2209e9)['then'](function(_0x5a7135){var _0x56f7c8={'method':'POST','uri':url[_0x8294('0x9')](_0xcb5eea[_0x8294('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0xcb5eea[_0x8294('0xb')]||_0x8294('0xc'),'channelId':_0x8294('0xd'),'conversation':{'id':_0xbbaec1[_0x8294('0xe')]},'from':{'id':_0xbbaec1[_0x8294('0xf')],'name':_0xbbaec1[_0x8294('0x10')]},'recipient':{'id':_0xbbaec1['dnid'],'name':_0xbbaec1[_0x8294('0x11')]},'text':_0xcb5eea[_0x8294('0x12')],'channelData':{}},'headers':{'Authorization':_0x8294('0x13')+_0x5a7135[_0x8294('0x14')]},'json':!![]};if(_0xcb5eea[_0x8294('0x15')]){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x18')]=_0xcb5eea['project'];}if(_0xcb5eea[_0x8294('0x19')]=='1'){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0xcb5eea['custom_action']){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x1a')]=_0xcb5eea[_0x8294('0x1b')];if(_0xcb5eea[_0x8294('0x1c')]){_0x56f7c8[_0x8294('0x16')][_0x8294('0x17')][_0x8294('0x1d')]=_0xcb5eea[_0x8294('0x1c')];}}logger[_0x8294('0x1e')](JSON[_0x8294('0x1f')](_0x56f7c8));return rp(_0x56f7c8);});};
\ No newline at end of file
+var _0xbfcc=['custom_action_data','request-promise','agi','exports','/token','password','POST','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData'];(function(_0x2a3b3a,_0x97a664){var _0xaab42b=function(_0x57ef61){while(--_0x57ef61){_0x2a3b3a['push'](_0x2a3b3a['shift']());}};_0xaab42b(++_0x97a664);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0xbfcc[_0x485abd];return _0x3379f1;};'use strict';var rp=require(_0xcbfc('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xcbfc('0x1'));module[_0xcbfc('0x2')]=function(_0x72a76d,_0x1a82e5){var _0x57f2e3={'method':'POST','uri':url['resolve'](_0x1a82e5['ndauth_url'],_0xcbfc('0x3')),'form':{'grant_type':_0xcbfc('0x4'),'username':_0x1a82e5['username'],'password':_0x1a82e5[_0xcbfc('0x4')]},'json':!![]};return rp(_0x57f2e3)['then'](function(_0x2ea130){var _0x1f8b71={'method':_0xcbfc('0x5'),'uri':url[_0xcbfc('0x6')](_0x1a82e5['ndassistant_url'],_0xcbfc('0x7')),'body':{'type':_0x1a82e5[_0xcbfc('0x8')]||_0xcbfc('0x9'),'channelId':_0xcbfc('0xa'),'conversation':{'id':_0x72a76d[_0xcbfc('0xb')]},'from':{'id':_0x72a76d[_0xcbfc('0xc')],'name':_0x72a76d['calleridname']},'recipient':{'id':_0x72a76d[_0xcbfc('0xd')],'name':_0x72a76d[_0xcbfc('0xe')]},'text':_0x1a82e5[_0xcbfc('0xf')],'channelData':{}},'headers':{'Authorization':_0xcbfc('0x10')+_0x2ea130[_0xcbfc('0x11')]},'json':!![]};if(_0x1a82e5['project']){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x14')]=_0x1a82e5['project'];}if(_0x1a82e5[_0xcbfc('0x15')]=='1'){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcbfc('0x17')};}if(_0x1a82e5['custom_action']){_0x1f8b71[_0xcbfc('0x12')][_0xcbfc('0x13')][_0xcbfc('0x18')]=_0x1a82e5[_0xcbfc('0x19')];if(_0x1a82e5['custom_action_data']){_0x1f8b71['body'][_0xcbfc('0x13')][_0xcbfc('0x1a')]=_0x1a82e5[_0xcbfc('0x1b')];}}logger['info'](JSON['stringify'](_0x1f8b71));return rp(_0x1f8b71);});};
\ No newline at end of file