aa75b6c007c60c44c8b3e9b3715bf3eea3ced980
[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 _0x0774=['slots','hasOwnProperty','exports','$LATEST','aws-sdk'];(function(_0x30a193,_0x158ad6){var _0x5d6ccd=function(_0xaf5a46){while(--_0xaf5a46){_0x30a193['push'](_0x30a193['shift']());}};_0x5d6ccd(++_0x158ad6);}(_0x0774,0xbd));var _0x4077=function(_0x172baa,_0x33b7f6){_0x172baa=_0x172baa-0x0;var _0x3f5836=_0x0774[_0x172baa];return _0x3f5836;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x4077('0x0'));function lexResult(_0x2da7c3,_0xa658bc){return new BPromise(function(_0x2eafcb,_0x2df504){_0x2da7c3['postText'](_0xa658bc,function(_0x160a91,_0x529c30){if(_0x160a91){_0x2df504(_0x160a91);}if(_0x529c30['slots']){for(const _0x2933bd in _0x529c30[_0x4077('0x1')]){if(_0x529c30[_0x4077('0x1')][_0x4077('0x2')](_0x2933bd)){var _0x3ba477=_0x529c30['slots'][_0x2933bd];_0x529c30['slot_'+_0x2933bd]=_0x3ba477;}}}_0x2eafcb(_0x529c30);});});}module[_0x4077('0x3')]=function(_0x476700,_0xe5c2c,_0x27c1c6,_0x2e2682,_0xd44ae2,_0x242f0d){var _0x179cd6=new AWS['LexRuntime']({'accessKeyId':_0xe5c2c,'secretAccessKey':_0x27c1c6,'region':_0x2e2682});var _0x277c03={'botAlias':_0x4077('0x4'),'botName':_0x242f0d,'inputText':_0xd44ae2,'userId':_0x476700};return lexResult(_0x179cd6,_0x277c03);};