2c30bdabd754c81694126560ad8bb584913118b9
[motion2.git] / server / services / agi / scripts / aws / lex / lib / api.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 _0xfa94=['slot_','exports','LexRuntime','aws-sdk','postText','slots'];(function(_0x5bbf6a,_0x29460a){var _0x5d051a=function(_0x2c76a7){while(--_0x2c76a7){_0x5bbf6a['push'](_0x5bbf6a['shift']());}};_0x5d051a(++_0x29460a);}(_0xfa94,0x1ad));var _0x4fa9=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xfa94[_0x325501];return _0x2c1626;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x4fa9('0x0'));function lexResult(_0x3b6284,_0x5d02cf){return new BPromise(function(_0x57c1a2,_0x3e492c){_0x3b6284[_0x4fa9('0x1')](_0x5d02cf,function(_0x27e6c2,_0x3fe0d0){if(_0x27e6c2){_0x3e492c(_0x27e6c2);}if(_0x3fe0d0[_0x4fa9('0x2')]){for(const _0x5ca7fe in _0x3fe0d0[_0x4fa9('0x2')]){if(_0x3fe0d0[_0x4fa9('0x2')]['hasOwnProperty'](_0x5ca7fe)){var _0x11fe15=_0x3fe0d0[_0x4fa9('0x2')][_0x5ca7fe];_0x3fe0d0[_0x4fa9('0x3')+_0x5ca7fe]=_0x11fe15;}}}_0x57c1a2(_0x3fe0d0);});});}module[_0x4fa9('0x4')]=function(_0x51b85a,_0x385552,_0x1c62a4,_0x536cb8,_0x78f5c6,_0x45da83){var _0x7463fb=new AWS[(_0x4fa9('0x5'))]({'accessKeyId':_0x385552,'secretAccessKey':_0x1c62a4,'region':_0x536cb8});var _0x3dcc4e={'botAlias':'$LATEST','botName':_0x45da83,'inputText':_0x78f5c6,'userId':_0x51b85a};return lexResult(_0x7463fb,_0x3dcc4e);};