52aa82d4e49c317be152fcd78d98387f0efa48fb
[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 _0x0e39=['slot_','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x5c4139,_0x12479e){var _0x5df4b6=function(_0xb532ce){while(--_0xb532ce){_0x5c4139['push'](_0x5c4139['shift']());}};_0x5df4b6(++_0x12479e);}(_0x0e39,0x85));var _0x90e3=function(_0x23a4bc,_0x32deba){_0x23a4bc=_0x23a4bc-0x0;var _0x2a450e=_0x0e39[_0x23a4bc];return _0x2a450e;};'use strict';var BPromise=require(_0x90e3('0x0'));var AWS=require(_0x90e3('0x1'));function lexResult(_0x5e199a,_0x4ede1f){return new BPromise(function(_0x1a9490,_0x33dd6b){_0x5e199a[_0x90e3('0x2')](_0x4ede1f,function(_0x375f86,_0x4bec31){if(_0x375f86){_0x33dd6b(_0x375f86);}if(_0x4bec31['slots']){for(const _0x2a73d1 in _0x4bec31['slots']){if(_0x4bec31[_0x90e3('0x3')][_0x90e3('0x4')](_0x2a73d1)){var _0x3bcf45=_0x4bec31[_0x90e3('0x3')][_0x2a73d1];_0x4bec31[_0x90e3('0x5')+_0x2a73d1]=_0x3bcf45;}}}_0x1a9490(_0x4bec31);});});}module['exports']=function(_0x2e4a47,_0x3df8fd,_0x47e82b,_0x5d51d2,_0x3be7d8,_0x3d6a18){var _0x27f01a=new AWS['LexRuntime']({'accessKeyId':_0x3df8fd,'secretAccessKey':_0x47e82b,'region':_0x5d51d2});var _0x32f512={'botAlias':'$LATEST','botName':_0x3d6a18,'inputText':_0x3be7d8,'userId':_0x2e4a47};return lexResult(_0x27f01a,_0x32f512);};