dfacf76e429fd1c60ede422d3a4af5942f18b7f8
[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 _0xda68=['slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xda68,0x72));var _0x8da6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda68[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8da6('0x0'));var AWS=require(_0x8da6('0x1'));function lexResult(_0x4d8883,_0x3be001){return new BPromise(function(_0x5837ca,_0x2607cc){_0x4d8883[_0x8da6('0x2')](_0x3be001,function(_0x567feb,_0x20b71f){if(_0x567feb){_0x2607cc(_0x567feb);}if(_0x20b71f[_0x8da6('0x3')]){for(const _0x47a4db in _0x20b71f[_0x8da6('0x3')]){if(_0x20b71f[_0x8da6('0x3')][_0x8da6('0x4')](_0x47a4db)){var _0x50c948=_0x20b71f[_0x8da6('0x3')][_0x47a4db];_0x20b71f[_0x8da6('0x5')+_0x47a4db]=_0x50c948;}}}_0x5837ca(_0x20b71f);});});}module[_0x8da6('0x6')]=function(_0x197e94,_0x1e8b9d,_0x23b083,_0x278f94,_0x841b92,_0x4569ef){var _0x4a810f=new AWS[(_0x8da6('0x7'))]({'accessKeyId':_0x1e8b9d,'secretAccessKey':_0x23b083,'region':_0x278f94});var _0x463182={'botAlias':_0x8da6('0x8'),'botName':_0x4569ef,'inputText':_0x841b92,'userId':_0x197e94};return lexResult(_0x4a810f,_0x463182);};