Built motion from commit 97153652.|2.6.26
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index 22a006a..78e9fd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d4=['project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','url','../../../../../config/logger','agi','POST','ndauth_url','/token','username','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token'];(function(_0x1692ac,_0x1c86f9){var _0x2b3046=function(_0x5d662a){while(--_0x5d662a){_0x1692ac['push'](_0x1692ac['shift']());}};_0x2b3046(++_0x1c86f9);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x302b5e,_0x564a8e){_0x302b5e=_0x302b5e-0x0;var _0x523ab7=_0xe3d4[_0x302b5e];return _0x523ab7;};'use strict';var rp=require('request-promise');var url=require(_0x4e3d('0x0'));var logger=require(_0x4e3d('0x1'))(_0x4e3d('0x2'));module['exports']=function(_0x327f5a,_0x349efe){var _0x5a7634={'method':_0x4e3d('0x3'),'uri':url['resolve'](_0x349efe[_0x4e3d('0x4')],_0x4e3d('0x5')),'form':{'grant_type':'password','username':_0x349efe[_0x4e3d('0x6')],'password':_0x349efe[_0x4e3d('0x7')]},'json':!![]};return rp(_0x5a7634)['then'](function(_0x40b814){var _0x4275b0={'method':_0x4e3d('0x3'),'uri':url[_0x4e3d('0x8')](_0x349efe[_0x4e3d('0x9')],_0x4e3d('0xa')),'body':{'type':_0x349efe['ndaactivity_type']||'message','channelId':_0x4e3d('0xb'),'conversation':{'id':_0x327f5a[_0x4e3d('0xc')]},'from':{'id':_0x327f5a[_0x4e3d('0xd')],'name':_0x327f5a[_0x4e3d('0xe')]},'recipient':{'id':_0x327f5a[_0x4e3d('0xf')],'name':_0x327f5a[_0x4e3d('0x10')]},'text':_0x349efe['text'],'channelData':{}},'headers':{'Authorization':_0x4e3d('0x11')+_0x40b814[_0x4e3d('0x12')]},'json':!![]};if(_0x349efe[_0x4e3d('0x13')]){_0x4275b0[_0x4e3d('0x14')][_0x4e3d('0x15')][_0x4e3d('0x16')]=_0x349efe[_0x4e3d('0x13')];}if(_0x349efe[_0x4e3d('0x17')]=='1'){_0x4275b0['body'][_0x4e3d('0x15')][_0x4e3d('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4e3d('0x19')};}if(_0x349efe['custom_action']){_0x4275b0[_0x4e3d('0x14')][_0x4e3d('0x15')][_0x4e3d('0x1a')]=_0x349efe[_0x4e3d('0x1b')];if(_0x349efe[_0x4e3d('0x1c')]){_0x4275b0[_0x4e3d('0x14')][_0x4e3d('0x15')][_0x4e3d('0x1d')]=_0x349efe['custom_action_data'];}}logger[_0x4e3d('0x1e')](JSON['stringify'](_0x4275b0));return rp(_0x4275b0);});};
\ No newline at end of file
+var _0xce3a=['Nda','uniqueid','callerid','calleridname','Bearer\x20','body','ProjectName','ndagenerate_audio','channelData','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x3314f9,_0x400d4e){var _0x28359d=function(_0x13783e){while(--_0x13783e){_0x3314f9['push'](_0x3314f9['shift']());}};_0x28359d(++_0x400d4e);}(_0xce3a,0x194));var _0xace3=function(_0x5254b1,_0x3b5cd1){_0x5254b1=_0x5254b1-0x0;var _0x3b9730=_0xce3a[_0x5254b1];return _0x3b9730;};'use strict';var rp=require(_0xace3('0x0'));var url=require(_0xace3('0x1'));var logger=require(_0xace3('0x2'))(_0xace3('0x3'));module[_0xace3('0x4')]=function(_0x37ef15,_0x1f1865){var _0x215d89={'method':_0xace3('0x5'),'uri':url[_0xace3('0x6')](_0x1f1865[_0xace3('0x7')],_0xace3('0x8')),'form':{'grant_type':'password','username':_0x1f1865[_0xace3('0x9')],'password':_0x1f1865[_0xace3('0xa')]},'json':!![]};return rp(_0x215d89)[_0xace3('0xb')](function(_0x22f00a){var _0x4e27ad={'method':_0xace3('0x5'),'uri':url['resolve'](_0x1f1865[_0xace3('0xc')],_0xace3('0xd')),'body':{'type':_0x1f1865[_0xace3('0xe')]||_0xace3('0xf'),'channelId':_0xace3('0x10'),'conversation':{'id':_0x37ef15[_0xace3('0x11')]},'from':{'id':_0x37ef15[_0xace3('0x12')],'name':_0x37ef15[_0xace3('0x13')]},'recipient':{'id':_0x37ef15['dnid'],'name':_0x37ef15['extension']},'text':_0x1f1865['text'],'channelData':{}},'headers':{'Authorization':_0xace3('0x14')+_0x22f00a['access_token']},'json':!![]};if(_0x1f1865['project']){_0x4e27ad[_0xace3('0x15')]['channelData'][_0xace3('0x16')]=_0x1f1865['project'];}if(_0x1f1865[_0xace3('0x17')]=='1'){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xace3('0x19')};}if(_0x1f1865[_0xace3('0x1a')]){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['CustomAction']=_0x1f1865[_0xace3('0x1a')];if(_0x1f1865[_0xace3('0x1b')]){_0x4e27ad[_0xace3('0x15')][_0xace3('0x18')]['CustomActionData']=_0x1f1865[_0xace3('0x1b')];}}logger[_0xace3('0x1c')](JSON[_0xace3('0x1d')](_0x4e27ad));return rp(_0x4e27ad);});};
\ No newline at end of file