306c925ca6abdf20a6025fa61cf28d909594ab7e
[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 _0xfc59=['slots','hasOwnProperty','slot_','exports','$LATEST','bluebird','aws-sdk'];(function(_0x59e7b2,_0x74595a){var _0x57bfb4=function(_0x160b87){while(--_0x160b87){_0x59e7b2['push'](_0x59e7b2['shift']());}};_0x57bfb4(++_0x74595a);}(_0xfc59,0x16a));var _0x9fc5=function(_0x5ea002,_0x1c95de){_0x5ea002=_0x5ea002-0x0;var _0x38491b=_0xfc59[_0x5ea002];return _0x38491b;};'use strict';var BPromise=require(_0x9fc5('0x0'));var AWS=require(_0x9fc5('0x1'));function lexResult(_0x101002,_0x50eaad){return new BPromise(function(_0x189170,_0xfc2ec1){_0x101002['postText'](_0x50eaad,function(_0x307bcb,_0x184a59){if(_0x307bcb){_0xfc2ec1(_0x307bcb);}if(_0x184a59[_0x9fc5('0x2')]){for(const _0x31361b in _0x184a59[_0x9fc5('0x2')]){if(_0x184a59[_0x9fc5('0x2')][_0x9fc5('0x3')](_0x31361b)){var _0x2ab015=_0x184a59[_0x9fc5('0x2')][_0x31361b];_0x184a59[_0x9fc5('0x4')+_0x31361b]=_0x2ab015;}}}_0x189170(_0x184a59);});});}module[_0x9fc5('0x5')]=function(_0x17ef31,_0x308d38,_0x28f76a,_0x3d7a5b,_0xf7a8f5,_0x57bbf8){var _0x272ea1=new AWS['LexRuntime']({'accessKeyId':_0x308d38,'secretAccessKey':_0x28f76a,'region':_0x3d7a5b});var _0x364f02={'botAlias':_0x9fc5('0x6'),'botName':_0x57bbf8,'inputText':_0xf7a8f5,'userId':_0x17ef31};return lexResult(_0x272ea1,_0x364f02);};