Built motion from commit (unavailable).|2.0.84
[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 _0x2ef3=['project','info','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','calleridname','dnid','extension','text','access_token','body'];(function(_0xd49d86,_0x426071){var _0x12cd0b=function(_0x1160cc){while(--_0x1160cc){_0xd49d86['push'](_0xd49d86['shift']());}};_0x12cd0b(++_0x426071);}(_0x2ef3,0xba));var _0x32ef=function(_0x4c34a3,_0x2774f3){_0x4c34a3=_0x4c34a3-0x0;var _0x471c13=_0x2ef3[_0x4c34a3];return _0x471c13;};'use strict';var rp=require(_0x32ef('0x0'));var url=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));module[_0x32ef('0x4')]=function(_0x38047b,_0x48106c){var _0x38f865={'method':_0x32ef('0x5'),'uri':url['resolve'](_0x48106c[_0x32ef('0x6')],_0x32ef('0x7')),'form':{'grant_type':'password','username':_0x48106c['username'],'password':_0x48106c[_0x32ef('0x8')]},'json':!![]};return rp(_0x38f865)[_0x32ef('0x9')](function(_0x367c39){var _0x2fb8eb={'method':_0x32ef('0x5'),'uri':url[_0x32ef('0xa')](_0x48106c[_0x32ef('0xb')],_0x32ef('0xc')),'body':{'type':_0x32ef('0xd'),'channelId':_0x32ef('0xe'),'conversation':{'id':_0x38047b['uniqueid']},'from':{'id':_0x38047b['callerid'],'name':_0x38047b[_0x32ef('0xf')]},'recipient':{'id':_0x38047b[_0x32ef('0x10')],'name':_0x38047b[_0x32ef('0x11')]},'text':_0x48106c[_0x32ef('0x12')]},'headers':{'Authorization':'Bearer\x20'+_0x367c39[_0x32ef('0x13')]},'json':!![]};if(_0x48106c['project']){_0x2fb8eb[_0x32ef('0x14')]['channelData']={'ProjectName':_0x48106c[_0x32ef('0x15')]};}logger[_0x32ef('0x16')](JSON['stringify'](_0x2fb8eb));return rp(_0x2fb8eb);});};