2d06785e0b5cfc2dd76c8419d85a78094bbe7d3a
[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 _0x9d3e=['postText','slots','slot_','exports','LexRuntime','$LATEST','aws-sdk'];(function(_0x44127a,_0x2bd9d3){var _0x2f827f=function(_0x4c2ca5){while(--_0x4c2ca5){_0x44127a['push'](_0x44127a['shift']());}};_0x2f827f(++_0x2bd9d3);}(_0x9d3e,0xd1));var _0xe9d3=function(_0x458f94,_0x308fc5){_0x458f94=_0x458f94-0x0;var _0x48dd3b=_0x9d3e[_0x458f94];return _0x48dd3b;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xe9d3('0x0'));function lexResult(_0x2dd806,_0x2b53b4){return new BPromise(function(_0xd0a5f5,_0x352198){_0x2dd806[_0xe9d3('0x1')](_0x2b53b4,function(_0x32d6f8,_0x5848d0){if(_0x32d6f8){_0x352198(_0x32d6f8);}if(_0x5848d0[_0xe9d3('0x2')]){for(const _0x401fdd in _0x5848d0[_0xe9d3('0x2')]){if(_0x5848d0[_0xe9d3('0x2')]['hasOwnProperty'](_0x401fdd)){var _0x4e3cb6=_0x5848d0['slots'][_0x401fdd];_0x5848d0[_0xe9d3('0x3')+_0x401fdd]=_0x4e3cb6;}}}_0xd0a5f5(_0x5848d0);});});}module[_0xe9d3('0x4')]=function(_0x34faac,_0x36bc8e,_0x4f2147,_0xb236b5,_0x22b362,_0x1b2947){var _0x5c93f1=new AWS[(_0xe9d3('0x5'))]({'accessKeyId':_0x36bc8e,'secretAccessKey':_0x4f2147,'region':_0xb236b5});var _0xdfcfb5={'botAlias':_0xe9d3('0x6'),'botName':_0x1b2947,'inputText':_0x22b362,'userId':_0x34faac};return lexResult(_0x5c93f1,_0xdfcfb5);};