c247f94f643831d01e52393f6441e094a68a3a9e
[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 _0xed6e=['LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x4ebe55,_0x27daf2){var _0x8bd230=function(_0xf75dfe){while(--_0xf75dfe){_0x4ebe55['push'](_0x4ebe55['shift']());}};_0x8bd230(++_0x27daf2);}(_0xed6e,0x1d6));var _0xeed6=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xed6e[_0x36884e];return _0x1cc367;};'use strict';var BPromise=require(_0xeed6('0x0'));var AWS=require(_0xeed6('0x1'));function lexResult(_0x4651f8,_0x59ea9a){return new BPromise(function(_0x5ad9b6,_0x20101c){_0x4651f8[_0xeed6('0x2')](_0x59ea9a,function(_0x53ed12,_0x24c4bf){if(_0x53ed12){_0x20101c(_0x53ed12);}if(_0x24c4bf[_0xeed6('0x3')]){for(const _0x47b0f6 in _0x24c4bf[_0xeed6('0x3')]){if(_0x24c4bf[_0xeed6('0x3')][_0xeed6('0x4')](_0x47b0f6)){var _0x169105=_0x24c4bf[_0xeed6('0x3')][_0x47b0f6];_0x24c4bf[_0xeed6('0x5')+_0x47b0f6]=_0x169105;}}}_0x5ad9b6(_0x24c4bf);});});}module[_0xeed6('0x6')]=function(_0x185ffe,_0x37f52a,_0x650924,_0x260159,_0x24d7ce,_0x33f928){var _0xd69346=new AWS[(_0xeed6('0x7'))]({'accessKeyId':_0x37f52a,'secretAccessKey':_0x650924,'region':_0x260159});var _0x26c9c1={'botAlias':_0xeed6('0x8'),'botName':_0x33f928,'inputText':_0x24d7ce,'userId':_0x185ffe};return lexResult(_0xd69346,_0x26c9c1);};