24766916d39c20a8ffc2a01f61d7811285f7fc08
[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 _0x7efd=['$LATEST','bluebird','aws-sdk','slots','hasOwnProperty','slot_'];(function(_0x981fea,_0x4665c6){var _0x236293=function(_0x2141c3){while(--_0x2141c3){_0x981fea['push'](_0x981fea['shift']());}};_0x236293(++_0x4665c6);}(_0x7efd,0x103));var _0xd7ef=function(_0x53df85,_0x1b796e){_0x53df85=_0x53df85-0x0;var _0xb89708=_0x7efd[_0x53df85];return _0xb89708;};'use strict';var BPromise=require(_0xd7ef('0x0'));var AWS=require(_0xd7ef('0x1'));function lexResult(_0x301bb6,_0x1248c2){return new BPromise(function(_0x205149,_0x2384aa){_0x301bb6['postText'](_0x1248c2,function(_0x243be5,_0x5f1e7c){if(_0x243be5){_0x2384aa(_0x243be5);}if(_0x5f1e7c[_0xd7ef('0x2')]){for(const _0x2068ae in _0x5f1e7c['slots']){if(_0x5f1e7c[_0xd7ef('0x2')][_0xd7ef('0x3')](_0x2068ae)){var _0x3596a9=_0x5f1e7c['slots'][_0x2068ae];_0x5f1e7c[_0xd7ef('0x4')+_0x2068ae]=_0x3596a9;}}}_0x205149(_0x5f1e7c);});});}module['exports']=function(_0x3dca56,_0x128b51,_0x2d61b6,_0x3693b1,_0x48fc83,_0x4b3c26){var _0x512cc2=new AWS['LexRuntime']({'accessKeyId':_0x128b51,'secretAccessKey':_0x2d61b6,'region':_0x3693b1});var _0x296bbc={'botAlias':_0xd7ef('0x5'),'botName':_0x4b3c26,'inputText':_0x48fc83,'userId':_0x3dca56};return lexResult(_0x512cc2,_0x296bbc);};