b8f602d68aeb4a5183531226ad90efa90923fafb
[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 _0x51bf=['LexRuntime','$LATEST','slots','hasOwnProperty','slot_','exports'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x51bf,0x8c));var _0xf51b=function(_0x21212d,_0x58720c){_0x21212d=_0x21212d-0x0;var _0x26fd4f=_0x51bf[_0x21212d];return _0x26fd4f;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x134d18,_0x3c4be1){return new BPromise(function(_0x5b3159,_0x4884df){_0x134d18['postText'](_0x3c4be1,function(_0x590593,_0x250c4f){if(_0x590593){_0x4884df(_0x590593);}if(_0x250c4f['slots']){for(const _0x5849a6 in _0x250c4f[_0xf51b('0x0')]){if(_0x250c4f[_0xf51b('0x0')][_0xf51b('0x1')](_0x5849a6)){var _0x51f7a9=_0x250c4f[_0xf51b('0x0')][_0x5849a6];_0x250c4f[_0xf51b('0x2')+_0x5849a6]=_0x51f7a9;}}}_0x5b3159(_0x250c4f);});});}module[_0xf51b('0x3')]=function(_0x4de904,_0xe95ca4,_0x2a1fa7,_0x59f757,_0x4f9a9c,_0xd5e744){var _0x5c7674=new AWS[(_0xf51b('0x4'))]({'accessKeyId':_0xe95ca4,'secretAccessKey':_0x2a1fa7,'region':_0x59f757});var _0x1e6d1c={'botAlias':_0xf51b('0x5'),'botName':_0xd5e744,'inputText':_0x4f9a9c,'userId':_0x4de904};return lexResult(_0x5c7674,_0x1e6d1c);};