Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index 22a006a..f35537d 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 _0xadcc=['agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','dnid','extension','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','info','request-promise','../../../../../config/logger'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xadcc,0x76));var _0xcadc=function(_0x2ed999,_0xeeb69d){_0x2ed999=_0x2ed999-0x0;var _0x43d66c=_0xadcc[_0x2ed999];return _0x43d66c;};'use strict';var rp=require(_0xcadc('0x0'));var url=require('url');var logger=require(_0xcadc('0x1'))(_0xcadc('0x2'));module[_0xcadc('0x3')]=function(_0x359d33,_0x2c174f){var _0x4d0dc0={'method':'POST','uri':url[_0xcadc('0x4')](_0x2c174f[_0xcadc('0x5')],_0xcadc('0x6')),'form':{'grant_type':_0xcadc('0x7'),'username':_0x2c174f[_0xcadc('0x8')],'password':_0x2c174f[_0xcadc('0x7')]},'json':!![]};return rp(_0x4d0dc0)[_0xcadc('0x9')](function(_0x346f54){var _0x1d3edf={'method':_0xcadc('0xa'),'uri':url[_0xcadc('0x4')](_0x2c174f[_0xcadc('0xb')],_0xcadc('0xc')),'body':{'type':_0x2c174f[_0xcadc('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x359d33[_0xcadc('0xe')]},'from':{'id':_0x359d33[_0xcadc('0xf')],'name':_0x359d33['calleridname']},'recipient':{'id':_0x359d33[_0xcadc('0x10')],'name':_0x359d33[_0xcadc('0x11')]},'text':_0x2c174f[_0xcadc('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x346f54['access_token']},'json':!![]};if(_0x2c174f[_0xcadc('0x13')]){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')][_0xcadc('0x16')]=_0x2c174f['project'];}if(_0x2c174f[_0xcadc('0x17')]=='1'){_0x1d3edf['body'][_0xcadc('0x15')][_0xcadc('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcadc('0x19')};}if(_0x2c174f['custom_action']){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')]['CustomAction']=_0x2c174f[_0xcadc('0x1a')];if(_0x2c174f['custom_action_data']){_0x1d3edf[_0xcadc('0x14')][_0xcadc('0x15')][_0xcadc('0x1b')]=_0x2c174f[_0xcadc('0x1c')];}}logger[_0xcadc('0x1d')](JSON['stringify'](_0x1d3edf));return rp(_0x1d3edf);});};
\ No newline at end of file