7c0fd4d0ca85434460df52bf28a3c71e260f257d
[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 _0x8e0a=['aws-sdk','slots','hasOwnProperty','exports','LexRuntime','$LATEST'];(function(_0x27a948,_0x2eebae){var _0x45ac61=function(_0x8418f5){while(--_0x8418f5){_0x27a948['push'](_0x27a948['shift']());}};_0x45ac61(++_0x2eebae);}(_0x8e0a,0x168));var _0xa8e0=function(_0x1e9210,_0x201b5c){_0x1e9210=_0x1e9210-0x0;var _0x40c9cd=_0x8e0a[_0x1e9210];return _0x40c9cd;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xa8e0('0x0'));function lexResult(_0xddb157,_0xc7ed2b){return new BPromise(function(_0x1dd49c,_0x36c945){_0xddb157['postText'](_0xc7ed2b,function(_0x43897c,_0x37e77e){if(_0x43897c){_0x36c945(_0x43897c);}if(_0x37e77e[_0xa8e0('0x1')]){for(const _0x4a60b7 in _0x37e77e[_0xa8e0('0x1')]){if(_0x37e77e['slots'][_0xa8e0('0x2')](_0x4a60b7)){var _0x37c5c8=_0x37e77e[_0xa8e0('0x1')][_0x4a60b7];_0x37e77e['slot_'+_0x4a60b7]=_0x37c5c8;}}}_0x1dd49c(_0x37e77e);});});}module[_0xa8e0('0x3')]=function(_0x2d19d4,_0x2bb50a,_0x4cc75c,_0x3fcdf4,_0xc0d0e8,_0xdcfa72){var _0x522877=new AWS[(_0xa8e0('0x4'))]({'accessKeyId':_0x2bb50a,'secretAccessKey':_0x4cc75c,'region':_0x3fcdf4});var _0x31bd2b={'botAlias':_0xa8e0('0x5'),'botName':_0xdcfa72,'inputText':_0xc0d0e8,'userId':_0x2d19d4};return lexResult(_0x522877,_0x31bd2b);};