21b5749b36a66ed3a5687162bf7400c6aab00506
[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 _0x3bcf=['bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','LexRuntime'];(function(_0x45b479,_0x3e6574){var _0x1c3cbe=function(_0xd53e52){while(--_0xd53e52){_0x45b479['push'](_0x45b479['shift']());}};_0x1c3cbe(++_0x3e6574);}(_0x3bcf,0x16c));var _0xf3bc=function(_0x9bf878,_0x15557d){_0x9bf878=_0x9bf878-0x0;var _0x1cd1a1=_0x3bcf[_0x9bf878];return _0x1cd1a1;};'use strict';var BPromise=require(_0xf3bc('0x0'));var AWS=require(_0xf3bc('0x1'));function lexResult(_0x156e20,_0x5346e5){return new BPromise(function(_0x2b182f,_0x4d66a0){_0x156e20[_0xf3bc('0x2')](_0x5346e5,function(_0x1fbdcc,_0x15a0b8){if(_0x1fbdcc){_0x4d66a0(_0x1fbdcc);}if(_0x15a0b8[_0xf3bc('0x3')]){for(const _0x3d3c90 in _0x15a0b8[_0xf3bc('0x3')]){if(_0x15a0b8['slots'][_0xf3bc('0x4')](_0x3d3c90)){var _0x4415c5=_0x15a0b8[_0xf3bc('0x3')][_0x3d3c90];_0x15a0b8[_0xf3bc('0x5')+_0x3d3c90]=_0x4415c5;}}}_0x2b182f(_0x15a0b8);});});}module['exports']=function(_0x3cfd0,_0x3a422e,_0x21cb11,_0x122c8d,_0x51d265,_0x52bc84){var _0x2d7db7=new AWS[(_0xf3bc('0x6'))]({'accessKeyId':_0x3a422e,'secretAccessKey':_0x21cb11,'region':_0x122c8d});var _0x58118e={'botAlias':'$LATEST','botName':_0x52bc84,'inputText':_0x51d265,'userId':_0x3cfd0};return lexResult(_0x2d7db7,_0x58118e);};