Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index a9cc0d8..a5a6993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b7=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','password','username'];(function(_0x1477b3,_0x5cd677){var _0xa66bed=function(_0x429eda){while(--_0x429eda){_0x1477b3['push'](_0x1477b3['shift']());}};_0xa66bed(++_0x5cd677);}(_0xa1b7,0xaa));var _0x7a1b=function(_0x45856f,_0x37896b){_0x45856f=_0x45856f-0x0;var _0x18ed82=_0xa1b7[_0x45856f];return _0x18ed82;};'use strict';var rp=require(_0x7a1b('0x0'));var url=require(_0x7a1b('0x1'));var logger=require(_0x7a1b('0x2'))(_0x7a1b('0x3'));module[_0x7a1b('0x4')]=function(_0xb98ccf,_0x56cab9){var _0x219ce9={'method':_0x7a1b('0x5'),'uri':url[_0x7a1b('0x6')](_0x56cab9[_0x7a1b('0x7')],'/token'),'form':{'grant_type':_0x7a1b('0x8'),'username':_0x56cab9[_0x7a1b('0x9')],'password':_0x56cab9[_0x7a1b('0x8')]},'json':!![]};return rp(_0x219ce9)[_0x7a1b('0xa')](function(_0x4e32a2){var _0x155a9b={'method':'POST','uri':url[_0x7a1b('0x6')](_0x56cab9[_0x7a1b('0xb')],_0x7a1b('0xc')),'body':{'type':_0x56cab9[_0x7a1b('0xd')]||'message','channelId':_0x7a1b('0xe'),'conversation':{'id':_0xb98ccf['uniqueid']},'from':{'id':_0xb98ccf['callerid'],'name':_0xb98ccf[_0x7a1b('0xf')]},'recipient':{'id':_0xb98ccf[_0x7a1b('0x10')],'name':_0xb98ccf[_0x7a1b('0x11')]},'text':_0x56cab9[_0x7a1b('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4e32a2[_0x7a1b('0x13')]},'json':!![]};if(_0x56cab9[_0x7a1b('0x14')]){_0x155a9b[_0x7a1b('0x15')][_0x7a1b('0x16')][_0x7a1b('0x17')]=_0x56cab9[_0x7a1b('0x14')];}if(_0x56cab9[_0x7a1b('0x18')]=='1'){_0x155a9b['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7a1b('0x19')};}if(_0x56cab9[_0x7a1b('0x1a')]){_0x155a9b['body']['channelData']['CustomAction']=_0x56cab9['custom_action'];if(_0x56cab9[_0x7a1b('0x1b')]){_0x155a9b[_0x7a1b('0x15')]['channelData'][_0x7a1b('0x1c')]=_0x56cab9[_0x7a1b('0x1b')];}}logger['info'](JSON[_0x7a1b('0x1d')](_0x155a9b));return rp(_0x155a9b);});};
\ No newline at end of file
+var _0xe958=['ndauth_url','/token','password','username','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve'];(function(_0x59a6ca,_0x49bda3){var _0x5b23d2=function(_0xd8d24){while(--_0xd8d24){_0x59a6ca['push'](_0x59a6ca['shift']());}};_0x5b23d2(++_0x49bda3);}(_0xe958,0x17a));var _0x8e95=function(_0x2e754b,_0x1b2c9c){_0x2e754b=_0x2e754b-0x0;var _0x329d6e=_0xe958[_0x2e754b];return _0x329d6e;};'use strict';var rp=require(_0x8e95('0x0'));var url=require(_0x8e95('0x1'));var logger=require(_0x8e95('0x2'))('agi');module[_0x8e95('0x3')]=function(_0x1fb6f0,_0x40873e){var _0x8a7dc1={'method':_0x8e95('0x4'),'uri':url[_0x8e95('0x5')](_0x40873e[_0x8e95('0x6')],_0x8e95('0x7')),'form':{'grant_type':_0x8e95('0x8'),'username':_0x40873e[_0x8e95('0x9')],'password':_0x40873e[_0x8e95('0x8')]},'json':!![]};return rp(_0x8a7dc1)['then'](function(_0x7068c){var _0x3afddd={'method':_0x8e95('0x4'),'uri':url[_0x8e95('0x5')](_0x40873e[_0x8e95('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x40873e[_0x8e95('0xb')]||_0x8e95('0xc'),'channelId':_0x8e95('0xd'),'conversation':{'id':_0x1fb6f0[_0x8e95('0xe')]},'from':{'id':_0x1fb6f0[_0x8e95('0xf')],'name':_0x1fb6f0[_0x8e95('0x10')]},'recipient':{'id':_0x1fb6f0[_0x8e95('0x11')],'name':_0x1fb6f0[_0x8e95('0x12')]},'text':_0x40873e['text'],'channelData':{}},'headers':{'Authorization':_0x8e95('0x13')+_0x7068c[_0x8e95('0x14')]},'json':!![]};if(_0x40873e[_0x8e95('0x15')]){_0x3afddd[_0x8e95('0x16')][_0x8e95('0x17')]['ProjectName']=_0x40873e[_0x8e95('0x15')];}if(_0x40873e[_0x8e95('0x18')]=='1'){_0x3afddd['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8e95('0x19')};}if(_0x40873e['custom_action']){_0x3afddd['body'][_0x8e95('0x17')][_0x8e95('0x1a')]=_0x40873e[_0x8e95('0x1b')];if(_0x40873e[_0x8e95('0x1c')]){_0x3afddd[_0x8e95('0x16')][_0x8e95('0x17')][_0x8e95('0x1d')]=_0x40873e['custom_action_data'];}}logger[_0x8e95('0x1e')](JSON[_0x8e95('0x1f')](_0x3afddd));return rp(_0x3afddd);});};
\ No newline at end of file