f369791233cc15bf5414a8d6b8856e2be836ef8d
[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 _0xbd0b=['LexRuntime','bluebird','postText','slots','slot_','exports'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0xbd0b,0x199));var _0xbbd0=function(_0x46fa93,_0x20afbd){_0x46fa93=_0x46fa93-0x0;var _0x29d80f=_0xbd0b[_0x46fa93];return _0x29d80f;};'use strict';var BPromise=require(_0xbbd0('0x0'));var AWS=require('aws-sdk');function lexResult(_0x237c1e,_0x37d0fb){return new BPromise(function(_0x22416d,_0x10ddd6){_0x237c1e[_0xbbd0('0x1')](_0x37d0fb,function(_0x993b98,_0x408db9){if(_0x993b98){_0x10ddd6(_0x993b98);}if(_0x408db9[_0xbbd0('0x2')]){for(const _0x5427c8 in _0x408db9['slots']){if(_0x408db9[_0xbbd0('0x2')]['hasOwnProperty'](_0x5427c8)){var _0x26ec3e=_0x408db9['slots'][_0x5427c8];_0x408db9[_0xbbd0('0x3')+_0x5427c8]=_0x26ec3e;}}}_0x22416d(_0x408db9);});});}module[_0xbbd0('0x4')]=function(_0x5ae1bb,_0x156a10,_0x19c34d,_0x459ede,_0x113ba0,_0x501769){var _0x452356=new AWS[(_0xbbd0('0x5'))]({'accessKeyId':_0x156a10,'secretAccessKey':_0x19c34d,'region':_0x459ede});var _0x4f24fb={'botAlias':'$LATEST','botName':_0x501769,'inputText':_0x113ba0,'userId':_0x5ae1bb};return lexResult(_0x452356,_0x4f24fb);};