Built motion from commit (unavailable).|2.4.4
[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 _0x74ca=['hasOwnProperty','exports','LexRuntime','aws-sdk','postText','slots'];(function(_0x35b93f,_0x48cda5){var _0x412fff=function(_0xef391c){while(--_0xef391c){_0x35b93f['push'](_0x35b93f['shift']());}};_0x412fff(++_0x48cda5);}(_0x74ca,0x183));var _0xa74c=function(_0x539693,_0xbf390e){_0x539693=_0x539693-0x0;var _0x5de9ac=_0x74ca[_0x539693];return _0x5de9ac;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xa74c('0x0'));function lexResult(_0x359e48,_0x32ee41){return new BPromise(function(_0x321e9e,_0x4e49da){_0x359e48[_0xa74c('0x1')](_0x32ee41,function(_0x1a27f0,_0x3ee2d7){if(_0x1a27f0){_0x4e49da(_0x1a27f0);}if(_0x3ee2d7['slots']){for(const _0x3dd92e in _0x3ee2d7[_0xa74c('0x2')]){if(_0x3ee2d7[_0xa74c('0x2')][_0xa74c('0x3')](_0x3dd92e)){var _0x4eaf58=_0x3ee2d7['slots'][_0x3dd92e];_0x3ee2d7['slot_'+_0x3dd92e]=_0x4eaf58;}}}_0x321e9e(_0x3ee2d7);});});}module[_0xa74c('0x4')]=function(_0x59a259,_0x53b4a3,_0x108b87,_0x3865b2,_0x57157c,_0xdd221d){var _0x39e592=new AWS[(_0xa74c('0x5'))]({'accessKeyId':_0x53b4a3,'secretAccessKey':_0x108b87,'region':_0x3865b2});var _0x21c892={'botAlias':'$LATEST','botName':_0xdd221d,'inputText':_0x57157c,'userId':_0x59a259};return lexResult(_0x39e592,_0x21c892);};