f9c93e4e9073f1b0aa41b6fb4c42b77fc73c41e0
[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 _0xea81=['exports','LexRuntime','$LATEST','bluebird','aws-sdk','slots','hasOwnProperty','slot_'];(function(_0x201613,_0x4f7f59){var _0x3e397b=function(_0x3a33c4){while(--_0x3a33c4){_0x201613['push'](_0x201613['shift']());}};_0x3e397b(++_0x4f7f59);}(_0xea81,0xc3));var _0x1ea8=function(_0x590ed3,_0x4e3dcf){_0x590ed3=_0x590ed3-0x0;var _0x474362=_0xea81[_0x590ed3];return _0x474362;};'use strict';var BPromise=require(_0x1ea8('0x0'));var AWS=require(_0x1ea8('0x1'));function lexResult(_0x54bbff,_0x2fc886){return new BPromise(function(_0x6689e9,_0x26696d){_0x54bbff['postText'](_0x2fc886,function(_0x34abaf,_0x46b246){if(_0x34abaf){_0x26696d(_0x34abaf);}if(_0x46b246[_0x1ea8('0x2')]){for(const _0x15ff43 in _0x46b246[_0x1ea8('0x2')]){if(_0x46b246[_0x1ea8('0x2')][_0x1ea8('0x3')](_0x15ff43)){var _0x22c72d=_0x46b246[_0x1ea8('0x2')][_0x15ff43];_0x46b246[_0x1ea8('0x4')+_0x15ff43]=_0x22c72d;}}}_0x6689e9(_0x46b246);});});}module[_0x1ea8('0x5')]=function(_0x10d6ce,_0x452bf0,_0x32c5e5,_0x3cdfc5,_0x33b656,_0x423399){var _0x7aa6c5=new AWS[(_0x1ea8('0x6'))]({'accessKeyId':_0x452bf0,'secretAccessKey':_0x32c5e5,'region':_0x3cdfc5});var _0x403e0b={'botAlias':_0x1ea8('0x7'),'botName':_0x423399,'inputText':_0x33b656,'userId':_0x10d6ce};return lexResult(_0x7aa6c5,_0x403e0b);};