Built motion from commit (unavailable).|2.4.7
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index d7dfb47..529817a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5990=['custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','resolve','ndauth_url','username','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','CustomAction'];(function(_0x5de10b,_0x5af540){var _0x477b4a=function(_0x1e0e2b){while(--_0x1e0e2b){_0x5de10b['push'](_0x5de10b['shift']());}};_0x477b4a(++_0x5af540);}(_0x5990,0xf5));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0x0599('0x0'));var url=require(_0x0599('0x1'));var logger=require('../../../../../config/logger')(_0x0599('0x2'));module['exports']=function(_0x52bbcb,_0x213674){var _0x98a822={'method':'POST','uri':url[_0x0599('0x3')](_0x213674[_0x0599('0x4')],'/token'),'form':{'grant_type':'password','username':_0x213674[_0x0599('0x5')],'password':_0x213674['password']},'json':!![]};return rp(_0x98a822)['then'](function(_0x330477){var _0x33e0f6={'method':_0x0599('0x6'),'uri':url[_0x0599('0x3')](_0x213674[_0x0599('0x7')],_0x0599('0x8')),'body':{'type':_0x213674[_0x0599('0x9')]||_0x0599('0xa'),'channelId':'Nda','conversation':{'id':_0x52bbcb[_0x0599('0xb')]},'from':{'id':_0x52bbcb[_0x0599('0xc')],'name':_0x52bbcb[_0x0599('0xd')]},'recipient':{'id':_0x52bbcb[_0x0599('0xe')],'name':_0x52bbcb[_0x0599('0xf')]},'text':_0x213674[_0x0599('0x10')],'channelData':{}},'headers':{'Authorization':_0x0599('0x11')+_0x330477[_0x0599('0x12')]},'json':!![]};if(_0x213674[_0x0599('0x13')]){_0x33e0f6[_0x0599('0x14')][_0x0599('0x15')][_0x0599('0x16')]=_0x213674[_0x0599('0x13')];}if(_0x213674[_0x0599('0x17')]=='1'){_0x33e0f6[_0x0599('0x14')][_0x0599('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x213674['custom_action']){_0x33e0f6[_0x0599('0x14')][_0x0599('0x15')][_0x0599('0x18')]=_0x213674[_0x0599('0x19')];if(_0x213674[_0x0599('0x1a')]){_0x33e0f6['body'][_0x0599('0x15')][_0x0599('0x1b')]=_0x213674[_0x0599('0x1a')];}}logger[_0x0599('0x1c')](JSON[_0x0599('0x1d')](_0x33e0f6));return rp(_0x33e0f6);});};
\ No newline at end of file
+var _0xc00b=['channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio'];(function(_0x110273,_0x3032a5){var _0x217dcf=function(_0x123265){while(--_0x123265){_0x110273['push'](_0x110273['shift']());}};_0x217dcf(++_0x3032a5);}(_0xc00b,0x64));var _0xbc00=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0xc00b[_0x287059];return _0x225c79;};'use strict';var rp=require(_0xbc00('0x0'));var url=require(_0xbc00('0x1'));var logger=require(_0xbc00('0x2'))('agi');module[_0xbc00('0x3')]=function(_0x3bb84f,_0x468d93){var _0x317733={'method':_0xbc00('0x4'),'uri':url[_0xbc00('0x5')](_0x468d93[_0xbc00('0x6')],'/token'),'form':{'grant_type':_0xbc00('0x7'),'username':_0x468d93[_0xbc00('0x8')],'password':_0x468d93[_0xbc00('0x7')]},'json':!![]};return rp(_0x317733)[_0xbc00('0x9')](function(_0x89dc22){var _0x58af38={'method':'POST','uri':url[_0xbc00('0x5')](_0x468d93[_0xbc00('0xa')],_0xbc00('0xb')),'body':{'type':_0x468d93[_0xbc00('0xc')]||'message','channelId':_0xbc00('0xd'),'conversation':{'id':_0x3bb84f['uniqueid']},'from':{'id':_0x3bb84f[_0xbc00('0xe')],'name':_0x3bb84f[_0xbc00('0xf')]},'recipient':{'id':_0x3bb84f[_0xbc00('0x10')],'name':_0x3bb84f[_0xbc00('0x11')]},'text':_0x468d93['text'],'channelData':{}},'headers':{'Authorization':_0xbc00('0x12')+_0x89dc22[_0xbc00('0x13')]},'json':!![]};if(_0x468d93[_0xbc00('0x14')]){_0x58af38[_0xbc00('0x15')]['channelData'][_0xbc00('0x16')]=_0x468d93[_0xbc00('0x14')];}if(_0x468d93[_0xbc00('0x17')]=='1'){_0x58af38[_0xbc00('0x15')][_0xbc00('0x18')][_0xbc00('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xbc00('0x1a')};}if(_0x468d93[_0xbc00('0x1b')]){_0x58af38[_0xbc00('0x15')][_0xbc00('0x18')][_0xbc00('0x1c')]=_0x468d93[_0xbc00('0x1b')];if(_0x468d93[_0xbc00('0x1d')]){_0x58af38[_0xbc00('0x15')][_0xbc00('0x18')]['CustomActionData']=_0x468d93[_0xbc00('0x1d')];}}logger['info'](JSON[_0xbc00('0x1e')](_0x58af38));return rp(_0x58af38);});};
\ No newline at end of file