659afc81803c04096274012e12b8eaab001a6b24
[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 _0x6ef6=['slots','slot_','exports','LexRuntime','$LATEST','bluebird','postText'];(function(_0x2e938d,_0x346e53){var _0x50d42d=function(_0x144326){while(--_0x144326){_0x2e938d['push'](_0x2e938d['shift']());}};_0x50d42d(++_0x346e53);}(_0x6ef6,0x14e));var _0x66ef=function(_0x419c4a,_0x5d525d){_0x419c4a=_0x419c4a-0x0;var _0x4dae37=_0x6ef6[_0x419c4a];return _0x4dae37;};'use strict';var BPromise=require(_0x66ef('0x0'));var AWS=require('aws-sdk');function lexResult(_0x2d1c2f,_0x4c1476){return new BPromise(function(_0x3561b5,_0x3c9002){_0x2d1c2f[_0x66ef('0x1')](_0x4c1476,function(_0x340bdb,_0x449923){if(_0x340bdb){_0x3c9002(_0x340bdb);}if(_0x449923[_0x66ef('0x2')]){for(const _0x29f243 in _0x449923[_0x66ef('0x2')]){if(_0x449923[_0x66ef('0x2')]['hasOwnProperty'](_0x29f243)){var _0xd9b9f4=_0x449923[_0x66ef('0x2')][_0x29f243];_0x449923[_0x66ef('0x3')+_0x29f243]=_0xd9b9f4;}}}_0x3561b5(_0x449923);});});}module[_0x66ef('0x4')]=function(_0x5b30a9,_0x13968b,_0x3acee2,_0x79dd85,_0xd3e348,_0x9fdf9){var _0x124040=new AWS[(_0x66ef('0x5'))]({'accessKeyId':_0x13968b,'secretAccessKey':_0x3acee2,'region':_0x79dd85});var _0x4bcdda={'botAlias':_0x66ef('0x6'),'botName':_0x9fdf9,'inputText':_0xd3e348,'userId':_0x5b30a9};return lexResult(_0x124040,_0x4bcdda);};