Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index 4cda160..b30f674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd41=['extension','access_token','project','channelData','ndagenerate_audio','body','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','/token','password','then','resolve','ndassistant_url','Nda','uniqueid','callerid','calleridname','dnid'];(function(_0xfcbbea,_0x5b10c2){var _0x344e0c=function(_0x1caf7d){while(--_0x1caf7d){_0xfcbbea['push'](_0xfcbbea['shift']());}};_0x344e0c(++_0x5b10c2);}(_0xcd41,0xc9));var _0x1cd4=function(_0x28f030,_0x3544d3){_0x28f030=_0x28f030-0x0;var _0x18ca29=_0xcd41[_0x28f030];return _0x18ca29;};'use strict';var rp=require(_0x1cd4('0x0'));var url=require(_0x1cd4('0x1'));var logger=require(_0x1cd4('0x2'))('agi');module[_0x1cd4('0x3')]=function(_0x1422bc,_0xd4eca9){var _0x47f44d={'method':_0x1cd4('0x4'),'uri':url['resolve'](_0xd4eca9['ndauth_url'],_0x1cd4('0x5')),'form':{'grant_type':'password','username':_0xd4eca9['username'],'password':_0xd4eca9[_0x1cd4('0x6')]},'json':!![]};return rp(_0x47f44d)[_0x1cd4('0x7')](function(_0x287379){var _0x510149={'method':_0x1cd4('0x4'),'uri':url[_0x1cd4('0x8')](_0xd4eca9[_0x1cd4('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0xd4eca9['ndaactivity_type']||'message','channelId':_0x1cd4('0xa'),'conversation':{'id':_0x1422bc[_0x1cd4('0xb')]},'from':{'id':_0x1422bc[_0x1cd4('0xc')],'name':_0x1422bc[_0x1cd4('0xd')]},'recipient':{'id':_0x1422bc[_0x1cd4('0xe')],'name':_0x1422bc[_0x1cd4('0xf')]},'text':_0xd4eca9['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x287379[_0x1cd4('0x10')]},'json':!![]};if(_0xd4eca9[_0x1cd4('0x11')]){_0x510149['body'][_0x1cd4('0x12')]['ProjectName']=_0xd4eca9['project'];}if(_0xd4eca9[_0x1cd4('0x13')]=='1'){_0x510149[_0x1cd4('0x14')][_0x1cd4('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1cd4('0x15')};}if(_0xd4eca9[_0x1cd4('0x16')]){_0x510149['body']['channelData']['CustomAction']=_0xd4eca9[_0x1cd4('0x16')];if(_0xd4eca9[_0x1cd4('0x17')]){_0x510149['body'][_0x1cd4('0x12')][_0x1cd4('0x18')]=_0xd4eca9['custom_action_data'];}}logger[_0x1cd4('0x19')](JSON[_0x1cd4('0x1a')](_0x510149));return rp(_0x510149);});};
\ No newline at end of file
+var _0x8bc6=['uniqueid','callerid','calleridname','dnid','extension','text','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','exports','POST','resolve','ndauth_url','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x2ad60a,_0x1b0197){var _0x404008=function(_0x49fc38){while(--_0x49fc38){_0x2ad60a['push'](_0x2ad60a['shift']());}};_0x404008(++_0x1b0197);}(_0x8bc6,0x1d3));var _0x68bc=function(_0x3d05f1,_0x10fab4){_0x3d05f1=_0x3d05f1-0x0;var _0x38cafd=_0x8bc6[_0x3d05f1];return _0x38cafd;};'use strict';var rp=require('request-promise');var url=require(_0x68bc('0x0'));var logger=require('../../../../../config/logger')(_0x68bc('0x1'));module[_0x68bc('0x2')]=function(_0x34ea6c,_0x2f104e){var _0x158c22={'method':_0x68bc('0x3'),'uri':url[_0x68bc('0x4')](_0x2f104e[_0x68bc('0x5')],_0x68bc('0x6')),'form':{'grant_type':'password','username':_0x2f104e[_0x68bc('0x7')],'password':_0x2f104e[_0x68bc('0x8')]},'json':!![]};return rp(_0x158c22)['then'](function(_0x14c82b){var _0x2c0c2b={'method':_0x68bc('0x3'),'uri':url[_0x68bc('0x4')](_0x2f104e[_0x68bc('0x9')],_0x68bc('0xa')),'body':{'type':_0x2f104e[_0x68bc('0xb')]||_0x68bc('0xc'),'channelId':'Nda','conversation':{'id':_0x34ea6c[_0x68bc('0xd')]},'from':{'id':_0x34ea6c[_0x68bc('0xe')],'name':_0x34ea6c[_0x68bc('0xf')]},'recipient':{'id':_0x34ea6c[_0x68bc('0x10')],'name':_0x34ea6c[_0x68bc('0x11')]},'text':_0x2f104e[_0x68bc('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x14c82b['access_token']},'json':!![]};if(_0x2f104e['project']){_0x2c0c2b[_0x68bc('0x13')]['channelData'][_0x68bc('0x14')]=_0x2f104e[_0x68bc('0x15')];}if(_0x2f104e[_0x68bc('0x16')]=='1'){_0x2c0c2b[_0x68bc('0x13')][_0x68bc('0x17')][_0x68bc('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x68bc('0x19')};}if(_0x2f104e[_0x68bc('0x1a')]){_0x2c0c2b[_0x68bc('0x13')][_0x68bc('0x17')][_0x68bc('0x1b')]=_0x2f104e[_0x68bc('0x1a')];if(_0x2f104e[_0x68bc('0x1c')]){_0x2c0c2b['body'][_0x68bc('0x17')][_0x68bc('0x1d')]=_0x2f104e[_0x68bc('0x1c')];}}logger[_0x68bc('0x1e')](JSON[_0x68bc('0x1f')](_0x2c0c2b));return rp(_0x2c0c2b);});};
\ No newline at end of file