Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4c58=['url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise'];(function(_0x26916e,_0x59ca88){var _0x55d319=function(_0x4adc03){while(--_0x4adc03){_0x26916e['push'](_0x26916e['shift']());}};_0x55d319(++_0x59ca88);}(_0x4c58,0x175));var _0x84c5=function(_0x254527,_0x5dc524){_0x254527=_0x254527-0x0;var _0x4888cf=_0x4c58[_0x254527];return _0x4888cf;};'use strict';var rp=require(_0x84c5('0x0'));var url=require(_0x84c5('0x1'));var logger=require(_0x84c5('0x2'))(_0x84c5('0x3'));module[_0x84c5('0x4')]=function(_0x2750cb,_0xe3f3e9){var _0x16562f={'method':_0x84c5('0x5'),'uri':url[_0x84c5('0x6')](_0xe3f3e9[_0x84c5('0x7')],_0x84c5('0x8')),'form':{'grant_type':_0x84c5('0x9'),'username':_0xe3f3e9['username'],'password':_0xe3f3e9['password']},'json':!![]};return rp(_0x16562f)['then'](function(_0x2c47aa){var _0x302abc={'method':_0x84c5('0x5'),'uri':url[_0x84c5('0x6')](_0xe3f3e9[_0x84c5('0xa')],_0x84c5('0xb')),'body':{'type':_0xe3f3e9[_0x84c5('0xc')]||_0x84c5('0xd'),'channelId':_0x84c5('0xe'),'conversation':{'id':_0x2750cb[_0x84c5('0xf')]},'from':{'id':_0x2750cb[_0x84c5('0x10')],'name':_0x2750cb[_0x84c5('0x11')]},'recipient':{'id':_0x2750cb[_0x84c5('0x12')],'name':_0x2750cb[_0x84c5('0x13')]},'text':_0xe3f3e9[_0x84c5('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2c47aa[_0x84c5('0x15')]},'json':!![]};if(_0xe3f3e9[_0x84c5('0x16')]){_0x302abc['body'][_0x84c5('0x17')][_0x84c5('0x18')]=_0xe3f3e9[_0x84c5('0x16')];}if(_0xe3f3e9[_0x84c5('0x19')]=='1'){_0x302abc[_0x84c5('0x1a')][_0x84c5('0x17')][_0x84c5('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x84c5('0x1c')};}if(_0xe3f3e9[_0x84c5('0x1d')]){_0x302abc['body'][_0x84c5('0x17')][_0x84c5('0x1e')]=_0xe3f3e9[_0x84c5('0x1d')];if(_0xe3f3e9['custom_action_data']){_0x302abc[_0x84c5('0x1a')][_0x84c5('0x17')]['CustomActionData']=_0xe3f3e9[_0x84c5('0x1f')];}}logger[_0x84c5('0x20')](JSON[_0x84c5('0x21')](_0x302abc));return rp(_0x302abc);});};