Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
index 1ac62b5..98118dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7902=['AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','resolve','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName'];(function(_0x1f9871,_0x48bb2f){var _0x4b03b9=function(_0xcd4e91){while(--_0xcd4e91){_0x1f9871['push'](_0x1f9871['shift']());}};_0x4b03b9(++_0x48bb2f);}(_0x7902,0xe8));var _0x2790=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x7902[_0xa2c0a3];return _0x52c618;};'use strict';var rp=require(_0x2790('0x0'));var url=require(_0x2790('0x1'));var logger=require('../../../../../config/logger')(_0x2790('0x2'));module[_0x2790('0x3')]=function(_0x37d77c,_0x387ffe){var _0x521e37={'method':_0x2790('0x4'),'uri':url[_0x2790('0x5')](_0x387ffe['ndauth_url'],'/token'),'form':{'grant_type':_0x2790('0x6'),'username':_0x387ffe['username'],'password':_0x387ffe[_0x2790('0x6')]},'json':!![]};return rp(_0x521e37)[_0x2790('0x7')](function(_0xbf9967){var _0xdbe672={'method':_0x2790('0x4'),'uri':url[_0x2790('0x5')](_0x387ffe[_0x2790('0x8')],_0x2790('0x9')),'body':{'type':_0x387ffe[_0x2790('0xa')]||_0x2790('0xb'),'channelId':_0x2790('0xc'),'conversation':{'id':_0x37d77c[_0x2790('0xd')]},'from':{'id':_0x37d77c[_0x2790('0xe')],'name':_0x37d77c['calleridname']},'recipient':{'id':_0x37d77c[_0x2790('0xf')],'name':_0x37d77c[_0x2790('0x10')]},'text':_0x387ffe[_0x2790('0x11')],'channelData':{}},'headers':{'Authorization':_0x2790('0x12')+_0xbf9967[_0x2790('0x13')]},'json':!![]};if(_0x387ffe[_0x2790('0x14')]){_0xdbe672[_0x2790('0x15')][_0x2790('0x16')][_0x2790('0x17')]=_0x387ffe[_0x2790('0x14')];}if(_0x387ffe['ndagenerate_audio']=='1'){_0xdbe672['body'][_0x2790('0x16')][_0x2790('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2790('0x19')};}if(_0x387ffe[_0x2790('0x1a')]){_0xdbe672[_0x2790('0x15')][_0x2790('0x16')][_0x2790('0x1b')]=_0x387ffe[_0x2790('0x1a')];if(_0x387ffe['custom_action_data']){_0xdbe672[_0x2790('0x15')][_0x2790('0x16')][_0x2790('0x1c')]=_0x387ffe[_0x2790('0x1d')];}}logger[_0x2790('0x1e')](JSON[_0x2790('0x1f')](_0xdbe672));return rp(_0xdbe672);});};
\ No newline at end of file
+var _0xe8b2=['then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','body','channelData','ProjectName','project','ndagenerate_audio','audio/wav','custom_action','custom_action_data','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0xe8b2,0x170));var _0x2e8b=function(_0x39a28e,_0x2a452b){_0x39a28e=_0x39a28e-0x0;var _0x272b62=_0xe8b2[_0x39a28e];return _0x272b62;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x2e8b('0x0'))(_0x2e8b('0x1'));module[_0x2e8b('0x2')]=function(_0x4473a0,_0x27e213){var _0x50f6f5={'method':_0x2e8b('0x3'),'uri':url[_0x2e8b('0x4')](_0x27e213[_0x2e8b('0x5')],_0x2e8b('0x6')),'form':{'grant_type':_0x2e8b('0x7'),'username':_0x27e213[_0x2e8b('0x8')],'password':_0x27e213[_0x2e8b('0x7')]},'json':!![]};return rp(_0x50f6f5)[_0x2e8b('0x9')](function(_0x569889){var _0x587a53={'method':_0x2e8b('0x3'),'uri':url[_0x2e8b('0x4')](_0x27e213['ndassistant_url'],_0x2e8b('0xa')),'body':{'type':_0x27e213['ndaactivity_type']||_0x2e8b('0xb'),'channelId':_0x2e8b('0xc'),'conversation':{'id':_0x4473a0[_0x2e8b('0xd')]},'from':{'id':_0x4473a0['callerid'],'name':_0x4473a0[_0x2e8b('0xe')]},'recipient':{'id':_0x4473a0[_0x2e8b('0xf')],'name':_0x4473a0[_0x2e8b('0x10')]},'text':_0x27e213[_0x2e8b('0x11')],'channelData':{}},'headers':{'Authorization':_0x2e8b('0x12')+_0x569889['access_token']},'json':!![]};if(_0x27e213['project']){_0x587a53[_0x2e8b('0x13')][_0x2e8b('0x14')][_0x2e8b('0x15')]=_0x27e213[_0x2e8b('0x16')];}if(_0x27e213[_0x2e8b('0x17')]=='1'){_0x587a53['body'][_0x2e8b('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2e8b('0x18')};}if(_0x27e213[_0x2e8b('0x19')]){_0x587a53[_0x2e8b('0x13')][_0x2e8b('0x14')]['CustomAction']=_0x27e213[_0x2e8b('0x19')];if(_0x27e213[_0x2e8b('0x1a')]){_0x587a53[_0x2e8b('0x13')][_0x2e8b('0x14')]['CustomActionData']=_0x27e213[_0x2e8b('0x1a')];}}logger[_0x2e8b('0x1b')](JSON[_0x2e8b('0x1c')](_0x587a53));return rp(_0x587a53);});};
\ No newline at end of file