X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fservices%2Fagi%2Fscripts%2Fsestek%2Fnda%2Findex.js;h=cff58a7c54ddab52335da376c64c57dac797aa5c;hb=08f6e0b86d261e0f7c3417afd107d7f774257198;hp=843f5e9afb7a4cf369162445e36c38704f9feca1;hpb=77cac286a995d5774f6d69ad14d2f583dccfe84b;p=motion2.git diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 843f5e9..cff58a7 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 _0x67df=['text','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','audio/wav','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','/api/NaturalDialogAssistant/v1/Run','Nda','callerid','calleridname','extension'];(function(_0x16a445,_0xa4b993){var _0x5ac203=function(_0x53f977){while(--_0x53f977){_0x16a445['push'](_0x16a445['shift']());}};_0x5ac203(++_0xa4b993);}(_0x67df,0x182));var _0xf67d=function(_0x1a76c8,_0x4fb45c){_0x1a76c8=_0x1a76c8-0x0;var _0x4f9826=_0x67df[_0x1a76c8];return _0x4f9826;};'use strict';var rp=require(_0xf67d('0x0'));var url=require(_0xf67d('0x1'));var logger=require(_0xf67d('0x2'))(_0xf67d('0x3'));module[_0xf67d('0x4')]=function(_0x507acf,_0x12126c){var _0x7c1969={'method':_0xf67d('0x5'),'uri':url[_0xf67d('0x6')](_0x12126c[_0xf67d('0x7')],_0xf67d('0x8')),'form':{'grant_type':'password','username':_0x12126c[_0xf67d('0x9')],'password':_0x12126c[_0xf67d('0xa')]},'json':!![]};return rp(_0x7c1969)[_0xf67d('0xb')](function(_0x40c1db){var _0x14776d={'method':_0xf67d('0x5'),'uri':url['resolve'](_0x12126c['ndassistant_url'],_0xf67d('0xc')),'body':{'type':_0x12126c['ndaactivity_type']||'message','channelId':_0xf67d('0xd'),'conversation':{'id':_0x507acf['uniqueid']},'from':{'id':_0x507acf[_0xf67d('0xe')],'name':_0x507acf[_0xf67d('0xf')]},'recipient':{'id':_0x507acf['dnid'],'name':_0x507acf[_0xf67d('0x10')]},'text':_0x12126c[_0xf67d('0x11')],'channelData':{}},'headers':{'Authorization':_0xf67d('0x12')+_0x40c1db[_0xf67d('0x13')]},'json':!![]};if(_0x12126c['project']){_0x14776d[_0xf67d('0x14')]['channelData'][_0xf67d('0x15')]=_0x12126c[_0xf67d('0x16')];}if(_0x12126c[_0xf67d('0x17')]=='1'){_0x14776d[_0xf67d('0x14')][_0xf67d('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf67d('0x19')};}if(_0x12126c['custom_action']){_0x14776d[_0xf67d('0x14')][_0xf67d('0x18')][_0xf67d('0x1a')]=_0x12126c[_0xf67d('0x1b')];if(_0x12126c[_0xf67d('0x1c')]){_0x14776d[_0xf67d('0x14')][_0xf67d('0x18')]['CustomActionData']=_0x12126c[_0xf67d('0x1c')];}}logger[_0xf67d('0x1d')](JSON[_0xf67d('0x1e')](_0x14776d));return rp(_0x14776d);});}; \ No newline at end of file +var _0xc80a=['access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','stringify','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','password','username','then','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20'];(function(_0x351cbc,_0x30380c){var _0x37b81b=function(_0x50afa8){while(--_0x50afa8){_0x351cbc['push'](_0x351cbc['shift']());}};_0x37b81b(++_0x30380c);}(_0xc80a,0xcf));var _0xac80=function(_0x4b8c55,_0x21484a){_0x4b8c55=_0x4b8c55-0x0;var _0x37998b=_0xc80a[_0x4b8c55];return _0x37998b;};'use strict';var rp=require(_0xac80('0x0'));var url=require('url');var logger=require(_0xac80('0x1'))(_0xac80('0x2'));module[_0xac80('0x3')]=function(_0x48f837,_0x79aad2){var _0x1235d9={'method':_0xac80('0x4'),'uri':url['resolve'](_0x79aad2[_0xac80('0x5')],'/token'),'form':{'grant_type':_0xac80('0x6'),'username':_0x79aad2[_0xac80('0x7')],'password':_0x79aad2[_0xac80('0x6')]},'json':!![]};return rp(_0x1235d9)[_0xac80('0x8')](function(_0x293f19){var _0xb5f205={'method':_0xac80('0x4'),'uri':url['resolve'](_0x79aad2['ndassistant_url'],_0xac80('0x9')),'body':{'type':_0x79aad2['ndaactivity_type']||'message','channelId':_0xac80('0xa'),'conversation':{'id':_0x48f837[_0xac80('0xb')]},'from':{'id':_0x48f837[_0xac80('0xc')],'name':_0x48f837[_0xac80('0xd')]},'recipient':{'id':_0x48f837['dnid'],'name':_0x48f837[_0xac80('0xe')]},'text':_0x79aad2[_0xac80('0xf')],'channelData':{}},'headers':{'Authorization':_0xac80('0x10')+_0x293f19[_0xac80('0x11')]},'json':!![]};if(_0x79aad2['project']){_0xb5f205[_0xac80('0x12')][_0xac80('0x13')][_0xac80('0x14')]=_0x79aad2['project'];}if(_0x79aad2[_0xac80('0x15')]=='1'){_0xb5f205[_0xac80('0x12')][_0xac80('0x13')][_0xac80('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xac80('0x17')};}if(_0x79aad2['custom_action']){_0xb5f205['body'][_0xac80('0x13')]['CustomAction']=_0x79aad2[_0xac80('0x18')];if(_0x79aad2[_0xac80('0x19')]){_0xb5f205[_0xac80('0x12')][_0xac80('0x13')][_0xac80('0x1a')]=_0x79aad2['custom_action_data'];}}logger['info'](JSON[_0xac80('0x1b')](_0xb5f205));return rp(_0xb5f205);});}; \ No newline at end of file