da8f71899a269402c3d65fe4707e8d64fc438c35
[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 _0xc662=['slots','hasOwnProperty','slot_','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc662,0xf0));var _0x2c66=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc662[_0x134c2e];return _0x2825db;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x53e11f,_0x3265f1){return new BPromise(function(_0x4921df,_0x23768d){_0x53e11f['postText'](_0x3265f1,function(_0x45a53c,_0x49adcc){if(_0x45a53c){_0x23768d(_0x45a53c);}if(_0x49adcc[_0x2c66('0x0')]){for(const _0x484086 in _0x49adcc[_0x2c66('0x0')]){if(_0x49adcc['slots'][_0x2c66('0x1')](_0x484086)){var _0x199164=_0x49adcc[_0x2c66('0x0')][_0x484086];_0x49adcc[_0x2c66('0x2')+_0x484086]=_0x199164;}}}_0x4921df(_0x49adcc);});});}module[_0x2c66('0x3')]=function(_0x2f98f9,_0x5a95ec,_0x1fc6a6,_0x337ab5,_0x576a4d,_0xc6ac6a){var _0x46ebc3=new AWS['LexRuntime']({'accessKeyId':_0x5a95ec,'secretAccessKey':_0x1fc6a6,'region':_0x337ab5});var _0x4caabf={'botAlias':'$LATEST','botName':_0xc6ac6a,'inputText':_0x576a4d,'userId':_0x2f98f9};return lexResult(_0x46ebc3,_0x4caabf);};