@aws-amplify/interactions 4.1.9 → 4.1.10-unstable.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -8
- package/lib/.tsbuildinfo +3 -0
- package/lib/Interactions.d.ts +24 -0
- package/lib/Interactions.js +4 -50
- package/lib/Interactions.js.map +1 -1
- package/lib/Providers/AWSLexProvider.d.ts +24 -0
- package/lib/Providers/AWSLexProvider.js +7 -76
- package/lib/Providers/AWSLexProvider.js.map +1 -1
- package/lib/Providers/AWSLexProviderHelper/commonUtils.d.ts +1 -0
- package/lib/Providers/AWSLexProviderHelper/commonUtils.js +5 -50
- package/lib/Providers/AWSLexProviderHelper/commonUtils.js.map +1 -1
- package/lib/Providers/AWSLexProviderHelper/utils.d.ts +3 -0
- package/lib/Providers/AWSLexProviderHelper/utils.js +7 -52
- package/lib/Providers/AWSLexProviderHelper/utils.js.map +1 -1
- package/lib/Providers/AWSLexProviderHelper/utils.native.d.ts +3 -0
- package/lib/Providers/AWSLexProviderHelper/utils.native.js +11 -56
- package/lib/Providers/AWSLexProviderHelper/utils.native.js.map +1 -1
- package/lib/Providers/AWSLexV2Provider.d.ts +58 -0
- package/lib/Providers/AWSLexV2Provider.js +17 -86
- package/lib/Providers/AWSLexV2Provider.js.map +1 -1
- package/lib/Providers/InteractionsProvider.d.ts +11 -0
- package/lib/Providers/InteractionsProvider.js +5 -25
- package/lib/Providers/InteractionsProvider.js.map +1 -1
- package/lib/Providers/index.d.ts +3 -0
- package/lib/Providers/index.js +8 -18
- package/lib/Providers/index.js.map +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.js +8 -22
- package/lib/index.js.map +1 -1
- package/lib/types/Interactions.d.ts +16 -0
- package/lib/types/Provider.d.ts +12 -0
- package/lib/types/Providers/AWSLexProvider.d.ts +10 -0
- package/lib/types/Providers/AWSLexV2Provider.d.ts +12 -0
- package/lib/types/Response.d.ts +3 -0
- package/lib/types/Response.js +2 -12
- package/lib/types/Response.js.map +1 -1
- package/lib/types/index.d.ts +5 -0
- package/lib-esm/.tsbuildinfo +3 -0
- package/lib-esm/Interactions.js +1 -47
- package/lib-esm/Interactions.js.map +1 -1
- package/lib-esm/Providers/AWSLexProvider.js +3 -72
- package/lib-esm/Providers/AWSLexProvider.js.map +1 -1
- package/lib-esm/Providers/AWSLexProviderHelper/commonUtils.js +3 -48
- package/lib-esm/Providers/AWSLexProviderHelper/commonUtils.js.map +1 -1
- package/lib-esm/Providers/AWSLexProviderHelper/utils.js +3 -48
- package/lib-esm/Providers/AWSLexProviderHelper/utils.js.map +1 -1
- package/lib-esm/Providers/AWSLexProviderHelper/utils.native.js +3 -48
- package/lib-esm/Providers/AWSLexProviderHelper/utils.native.js.map +1 -1
- package/lib-esm/Providers/AWSLexV2Provider.js +3 -72
- package/lib-esm/Providers/AWSLexV2Provider.js.map +1 -1
- package/lib-esm/Providers/InteractionsProvider.js +3 -23
- package/lib-esm/Providers/InteractionsProvider.js.map +1 -1
- package/lib-esm/Providers/index.d.ts +3 -3
- package/lib-esm/Providers/index.js +5 -15
- package/lib-esm/Providers/index.js.map +1 -1
- package/lib-esm/index.d.ts +4 -9
- package/lib-esm/index.js +6 -21
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/types/Response.js +2 -12
- package/lib-esm/types/Response.js.map +1 -1
- package/package.json +13 -9
- package/src/Interactions.ts +2 -12
- package/src/Providers/AWSLexProvider.ts +2 -12
- package/src/Providers/AWSLexProviderHelper/commonUtils.ts +2 -12
- package/src/Providers/AWSLexProviderHelper/utils.native.ts +2 -12
- package/src/Providers/AWSLexProviderHelper/utils.ts +2 -12
- package/src/Providers/AWSLexV2Provider.ts +2 -12
- package/src/Providers/InteractionsProvider.ts +2 -12
- package/src/Providers/index.ts +5 -15
- package/src/index.ts +6 -23
- package/src/types/Interactions.ts +2 -12
- package/src/types/Provider.ts +2 -12
- package/src/types/Providers/AWSLexProvider.ts +2 -12
- package/src/types/Providers/AWSLexV2Provider.ts +2 -12
- package/src/types/Response.ts +2 -12
- package/src/types/index.ts +2 -12
- package/build.js +0 -5
- package/dist/aws-amplify-interactions.js +0 -33213
- package/dist/aws-amplify-interactions.js.map +0 -1
- package/dist/aws-amplify-interactions.min.js +0 -116
- package/dist/aws-amplify-interactions.min.js.map +0 -1
- package/index.js +0 -7
- package/webpack.config.dev.js +0 -6
|
@@ -1,77 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
-
function step(op) {
|
|
40
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
42
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
-
switch (op[0]) {
|
|
45
|
-
case 0: case 1: t = op; break;
|
|
46
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
-
default:
|
|
50
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
-
if (t[2]) _.ops.pop();
|
|
55
|
-
_.trys.pop(); continue;
|
|
56
|
-
}
|
|
57
|
-
op = body.call(thisArg, _);
|
|
58
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
67
|
-
* the License. A copy of the License is located at
|
|
68
|
-
*
|
|
69
|
-
* http://aws.amazon.com/apache2.0/
|
|
70
|
-
*
|
|
71
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
72
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
73
|
-
* and limitations under the License.
|
|
74
|
-
*/
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
75
6
|
var InteractionsProvider_1 = require("./InteractionsProvider");
|
|
76
7
|
var client_lex_runtime_v2_1 = require("@aws-sdk/client-lex-runtime-v2");
|
|
77
8
|
var core_1 = require("@aws-amplify/core");
|
|
@@ -79,7 +10,7 @@ var utils_1 = require("./AWSLexProviderHelper/utils");
|
|
|
79
10
|
var commonUtils_1 = require("./AWSLexProviderHelper/commonUtils");
|
|
80
11
|
var logger = new core_1.ConsoleLogger('AWSLexV2Provider');
|
|
81
12
|
var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
82
|
-
__extends(AWSLexV2Provider, _super);
|
|
13
|
+
tslib_1.__extends(AWSLexV2Provider, _super);
|
|
83
14
|
/**
|
|
84
15
|
* Initialize Interactions with AWS configurations
|
|
85
16
|
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
@@ -129,9 +60,9 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
129
60
|
* @return {Promise<InteractionsResponse>} A promise resolves to the response from the bot
|
|
130
61
|
*/
|
|
131
62
|
AWSLexV2Provider.prototype.sendMessage = function (botname, message) {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
133
64
|
var credentials, error_1, response, reqBaseParams;
|
|
134
|
-
return __generator(this, function (_a) {
|
|
65
|
+
return tslib_1.__generator(this, function (_a) {
|
|
135
66
|
switch (_a.label) {
|
|
136
67
|
case 0:
|
|
137
68
|
// check if bot exists
|
|
@@ -227,12 +158,12 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
227
158
|
* update audioStream format
|
|
228
159
|
*/
|
|
229
160
|
AWSLexV2Provider.prototype._formatUtteranceCommandOutput = function (data) {
|
|
230
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
161
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
231
162
|
var response, _a, _b, _c;
|
|
232
|
-
return __generator(this, function (_d) {
|
|
163
|
+
return tslib_1.__generator(this, function (_d) {
|
|
233
164
|
switch (_d.label) {
|
|
234
165
|
case 0:
|
|
235
|
-
_a = [__assign({}, data)];
|
|
166
|
+
_a = [tslib_1.__assign({}, data)];
|
|
236
167
|
_b = {};
|
|
237
168
|
return [4 /*yield*/, commonUtils_1.unGzipBase64AsJson(data.messages)];
|
|
238
169
|
case 1:
|
|
@@ -258,7 +189,7 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
258
189
|
_c = undefined;
|
|
259
190
|
_d.label = 8;
|
|
260
191
|
case 8:
|
|
261
|
-
response = __assign.apply(void 0, _a.concat([(_b.audioStream = _c, _b)]));
|
|
192
|
+
response = tslib_1.__assign.apply(void 0, _a.concat([(_b.audioStream = _c, _b)]));
|
|
262
193
|
return [2 /*return*/, response];
|
|
263
194
|
}
|
|
264
195
|
});
|
|
@@ -269,13 +200,13 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
269
200
|
* used for sending simple text message
|
|
270
201
|
*/
|
|
271
202
|
AWSLexV2Provider.prototype._handleRecognizeTextCommand = function (botname, data, baseParams) {
|
|
272
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
203
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
273
204
|
var params, recognizeTextCommand, data_1, err_1;
|
|
274
|
-
return __generator(this, function (_a) {
|
|
205
|
+
return tslib_1.__generator(this, function (_a) {
|
|
275
206
|
switch (_a.label) {
|
|
276
207
|
case 0:
|
|
277
208
|
logger.debug('postText to lex2', data);
|
|
278
|
-
params = __assign(__assign({}, baseParams), { text: data });
|
|
209
|
+
params = tslib_1.__assign(tslib_1.__assign({}, baseParams), { text: data });
|
|
279
210
|
_a.label = 1;
|
|
280
211
|
case 1:
|
|
281
212
|
_a.trys.push([1, 3, , 4]);
|
|
@@ -298,9 +229,9 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
298
229
|
* used for obj text or obj voice message
|
|
299
230
|
*/
|
|
300
231
|
AWSLexV2Provider.prototype._handleRecognizeUtteranceCommand = function (botname, data, baseParams) {
|
|
301
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
232
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
302
233
|
var content, messageType, params, inputStream, _a, recognizeUtteranceCommand, data_2, response, err_2;
|
|
303
|
-
return __generator(this, function (_b) {
|
|
234
|
+
return tslib_1.__generator(this, function (_b) {
|
|
304
235
|
switch (_b.label) {
|
|
305
236
|
case 0:
|
|
306
237
|
content = data.content, messageType = data.options.messageType;
|
|
@@ -318,13 +249,13 @@ var AWSLexV2Provider = /** @class */ (function (_super) {
|
|
|
318
249
|
_b.label = 3;
|
|
319
250
|
case 3:
|
|
320
251
|
inputStream = _a;
|
|
321
|
-
params = __assign(__assign({}, baseParams), { requestContentType: 'audio/x-l16; sample-rate=16000; channel-count=1', inputStream: inputStream });
|
|
252
|
+
params = tslib_1.__assign(tslib_1.__assign({}, baseParams), { requestContentType: 'audio/x-l16; sample-rate=16000; channel-count=1', inputStream: inputStream });
|
|
322
253
|
return [3 /*break*/, 5];
|
|
323
254
|
case 4:
|
|
324
255
|
// text input
|
|
325
256
|
if (typeof content !== 'string')
|
|
326
257
|
return [2 /*return*/, Promise.reject('invalid content type')];
|
|
327
|
-
params = __assign(__assign({}, baseParams), { requestContentType: 'text/plain; charset=utf-8', inputStream: content });
|
|
258
|
+
params = tslib_1.__assign(tslib_1.__assign({}, baseParams), { requestContentType: 'text/plain; charset=utf-8', inputStream: content });
|
|
328
259
|
_b.label = 5;
|
|
329
260
|
case 5:
|
|
330
261
|
_b.trys.push([5, 8, , 9]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AWSLexV2Provider.js","sourceRoot":"","sources":["../../src/Providers/AWSLexV2Provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AWSLexV2Provider.js","sourceRoot":"","sources":["../../src/Providers/AWSLexV2Provider.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,+DAAsE;AAOtE,wEAQwC;AACxC,0CAI2B;AAC3B,sDAAuD;AACvD,kEAAwE;AAExE,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,kBAAkB,CAAC,CAAC;AA6B9C;IAAsC,4CAA4B;IAIjE;;;OAGG;IACH,0BAAY,OAAiC;QAAjC,wBAAA,EAAA,YAAiC;QAA7C,YACC,kBAAM,OAAO,CAAC,SAEd;QADA,KAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;;IACjC,CAAC;IAED;;;OAGG;IACI,0CAAe,GAAtB;QACC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,oCAAS,GAAhB,UACC,MAAoC;QAApC,uBAAA,EAAA,WAAoC;QAEpC,IAAM,gBAAgB,GAAG;YACxB,MAAM;YACN,OAAO;YACP,SAAS;YACT,UAAU;YACV,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;6BAItC,CAAA,WAAW,KAAK,OAAO,CAAA,EAAvB,wBAAuB;wBAC1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;4BAChC,sBAAO,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAC;yBAC9C;6BAGA,CAAA,OAAO,YAAY,UAAU,CAAA,EAA7B,wBAA6B;wBAAG,KAAA,OAAO,CAAA;;4BAAG,qBAAM,eAAO,CAAC,OAAO,CAAC,EAAA;;wBAAtB,KAAA,SAAsB,CAAA;;;wBAD3D,WAAW,KACgD;wBAEjE,MAAM,yCACF,UAAU,KACb,kBAAkB,EAAE,iDAAiD,EACrE,WAAW,aAAA,GACX,CAAC;;;wBAEF,aAAa;wBACb,IAAI,OAAO,OAAO,KAAK,QAAQ;4BAC9B,sBAAO,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAC;wBAE/C,MAAM,yCACF,UAAU,KACb,kBAAkB,EAAE,2BAA2B,EAC/C,WAAW,EAAE,OAAO,GACpB,CAAC;;;;wBAKI,yBAAyB,GAAG,IAAI,iDAAyB,CAAC,MAAM,CAAC,CAAC;wBAC3D,qBAAM,IAAI,CAAC,0BAA0B,CAAC,IAAI,CACtD,yBAAyB,CACzB,EAAA;;wBAFK,SAAO,SAEZ;wBAEgB,qBAAM,IAAI,CAAC,6BAA6B,CAAC,MAAI,CAAC,EAAA;;wBAAzD,QAAQ,GAAG,SAA8C;wBAC/D,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;wBACzC,sBAAO,QAAQ,EAAC;;;wBAEhB,sBAAO,OAAO,CAAC,MAAM,CAAC,KAAG,CAAC,EAAC;;;;;KAE5B;IACF,uBAAC;AAAD,CAAC,AArRD,CAAsC,mDAA4B,GAqRjE;AArRY,4CAAgB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InteractionsProvider, InteractionsOptions, InteractionsResponse } from '../types';
|
|
2
|
+
export declare abstract class AbstractInteractionsProvider implements InteractionsProvider {
|
|
3
|
+
protected _config: InteractionsOptions;
|
|
4
|
+
constructor(options?: InteractionsOptions);
|
|
5
|
+
configure(config?: InteractionsOptions): InteractionsOptions;
|
|
6
|
+
getCategory(): string;
|
|
7
|
+
abstract getProviderName(): string;
|
|
8
|
+
protected get options(): InteractionsOptions;
|
|
9
|
+
abstract sendMessage(botname: string, message: string | Object): Promise<object>;
|
|
10
|
+
abstract onComplete(botname: string, callback: (err: any, confirmation: InteractionsResponse) => void): any;
|
|
11
|
+
}
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
6
|
-
* the License. A copy of the License is located at
|
|
7
|
-
*
|
|
8
|
-
* http://aws.amazon.com/apache2.0/
|
|
9
|
-
*
|
|
10
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
11
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
-
* and limitations under the License.
|
|
13
|
-
*/
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
25
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
26
6
|
var core_1 = require("@aws-amplify/core");
|
|
27
7
|
var logger = new core_1.ConsoleLogger('AbstractInteractionsProvider');
|
|
28
8
|
var AbstractInteractionsProvider = /** @class */ (function () {
|
|
@@ -32,7 +12,7 @@ var AbstractInteractionsProvider = /** @class */ (function () {
|
|
|
32
12
|
}
|
|
33
13
|
AbstractInteractionsProvider.prototype.configure = function (config) {
|
|
34
14
|
if (config === void 0) { config = {}; }
|
|
35
|
-
this._config = __assign(__assign({}, this._config), config);
|
|
15
|
+
this._config = tslib_1.__assign(tslib_1.__assign({}, this._config), config);
|
|
36
16
|
logger.debug("configure " + this.getProviderName(), this._config);
|
|
37
17
|
return this.options;
|
|
38
18
|
};
|
|
@@ -41,7 +21,7 @@ var AbstractInteractionsProvider = /** @class */ (function () {
|
|
|
41
21
|
};
|
|
42
22
|
Object.defineProperty(AbstractInteractionsProvider.prototype, "options", {
|
|
43
23
|
get: function () {
|
|
44
|
-
return __assign({}, this._config);
|
|
24
|
+
return tslib_1.__assign({}, this._config);
|
|
45
25
|
},
|
|
46
26
|
enumerable: true,
|
|
47
27
|
configurable: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionsProvider.js","sourceRoot":"","sources":["../../src/Providers/InteractionsProvider.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"InteractionsProvider.js","sourceRoot":"","sources":["../../src/Providers/InteractionsProvider.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAQtC,0CAA4D;AAE5D,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,8BAA8B,CAAC,CAAC;AAE1D;IAIC,sCAAY,OAAiC;QAAjC,wBAAA,EAAA,YAAiC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,gDAAS,GAAT,UAAU,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACzC,IAAI,CAAC,OAAO,yCAAQ,IAAI,CAAC,OAAO,GAAK,MAAM,CAAE,CAAC;QAE9C,MAAM,CAAC,KAAK,CAAC,eAAa,IAAI,CAAC,eAAe,EAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAElE,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,kDAAW,GAAX;QACC,OAAO,cAAc,CAAC;IACvB,CAAC;IAID,sBAAc,iDAAO;aAArB;YACC,4BAAY,IAAI,CAAC,OAAO,EAAG;QAC5B,CAAC;;;OAAA;IAWF,mCAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCqB,oEAA4B"}
|
package/lib/Providers/index.js
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function __export(m) {
|
|
3
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
-
}
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
15
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
16
|
-
* and limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
__export(require("./AWSLexProvider"));
|
|
19
|
-
__export(require("./AWSLexV2Provider"));
|
|
20
|
-
__export(require("./InteractionsProvider"));
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
var AWSLexProvider_1 = require("./AWSLexProvider");
|
|
6
|
+
exports.AWSLexProvider = AWSLexProvider_1.AWSLexProvider;
|
|
7
|
+
var AWSLexV2Provider_1 = require("./AWSLexV2Provider");
|
|
8
|
+
exports.AWSLexV2Provider = AWSLexV2Provider_1.AWSLexV2Provider;
|
|
9
|
+
var InteractionsProvider_1 = require("./InteractionsProvider");
|
|
10
|
+
exports.AbstractInteractionsProvider = InteractionsProvider_1.AbstractInteractionsProvider;
|
|
21
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Providers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Providers/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,mDAAkD;AAAzC,0CAAA,cAAc,CAAA;AACvB,uDAAsD;AAA7C,8CAAA,gBAAgB,CAAA;AACzB,+DAAsE;AAA7D,8DAAA,4BAA4B,CAAA"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Interactions } from './Interactions';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export { AbstractInteractionsProvider } from './Providers/InteractionsProvider';
|
|
4
|
+
export { AWSLexProvider } from './Providers/AWSLexProvider';
|
|
5
|
+
export { AWSLexV2Provider } from './Providers/AWSLexV2Provider';
|
package/lib/index.js
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/*
|
|
7
|
-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
10
|
-
* the License. A copy of the License is located at
|
|
11
|
-
*
|
|
12
|
-
* http://aws.amazon.com/apache2.0/
|
|
13
|
-
*
|
|
14
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
15
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
16
|
-
* and limitations under the License.
|
|
17
|
-
*/
|
|
18
5
|
var Interactions_1 = require("./Interactions");
|
|
19
6
|
exports.Interactions = Interactions_1.Interactions;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
__export(require("./Providers/AWSLexV2Provider"));
|
|
7
|
+
var InteractionsProvider_1 = require("./Providers/InteractionsProvider");
|
|
8
|
+
exports.AbstractInteractionsProvider = InteractionsProvider_1.AbstractInteractionsProvider;
|
|
9
|
+
var AWSLexProvider_1 = require("./Providers/AWSLexProvider");
|
|
10
|
+
exports.AWSLexProvider = AWSLexProvider_1.AWSLexProvider;
|
|
11
|
+
var AWSLexV2Provider_1 = require("./Providers/AWSLexV2Provider");
|
|
12
|
+
exports.AWSLexV2Provider = AWSLexV2Provider_1.AWSLexV2Provider;
|
|
27
13
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,+CAA8C;AAArC,sCAAA,YAAY,CAAA;AAErB,yEAAgF;AAAvE,8DAAA,4BAA4B,CAAA;AACrC,6DAA4D;AAAnD,0CAAA,cAAc,CAAA;AACvB,iEAAgE;AAAvD,8CAAA,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface InteractionsOptions {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export declare type InteractionsTextMessage = {
|
|
5
|
+
content: string;
|
|
6
|
+
options: {
|
|
7
|
+
messageType: 'text';
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare type InteractionsVoiceMessage = {
|
|
11
|
+
content: object;
|
|
12
|
+
options: {
|
|
13
|
+
messageType: 'voice';
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type InteractionsMessage = InteractionsTextMessage | InteractionsVoiceMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InteractionsOptions } from './Interactions';
|
|
2
|
+
import { InteractionsResponse } from './Response';
|
|
3
|
+
export interface InteractionsProvider {
|
|
4
|
+
configure(config: InteractionsOptions): InteractionsOptions;
|
|
5
|
+
getCategory(): string;
|
|
6
|
+
getProviderName(): string;
|
|
7
|
+
sendMessage(botname: string, message: string | Object): Promise<object>;
|
|
8
|
+
onComplete(botname: string, callback: (err: any, confirmation: InteractionsResponse) => void): any;
|
|
9
|
+
}
|
|
10
|
+
export interface InteractionsProviders {
|
|
11
|
+
[key: string]: InteractionsProvider;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AWSLexProviderOption {
|
|
2
|
+
name: string;
|
|
3
|
+
alias: string;
|
|
4
|
+
region: string;
|
|
5
|
+
providerName?: string;
|
|
6
|
+
onComplete?(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
7
|
+
}
|
|
8
|
+
export interface AWSLexProviderOptions {
|
|
9
|
+
[key: string]: AWSLexProviderOption;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AWSLexV2ProviderOption {
|
|
2
|
+
name: string;
|
|
3
|
+
botId: string;
|
|
4
|
+
aliasId: string;
|
|
5
|
+
localeId: string;
|
|
6
|
+
region: string;
|
|
7
|
+
providerName: string;
|
|
8
|
+
onComplete?(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
9
|
+
}
|
|
10
|
+
export interface AWSLexV2ProviderOptions {
|
|
11
|
+
[key: string]: AWSLexV2ProviderOption;
|
|
12
|
+
}
|
package/lib/types/Response.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
6
|
-
* the License. A copy of the License is located at
|
|
7
|
-
*
|
|
8
|
-
* http://aws.amazon.com/apache2.0/
|
|
9
|
-
*
|
|
10
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
11
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
-
* and limitations under the License.
|
|
13
|
-
*/
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
14
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
5
|
//# sourceMappingURL=Response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../src/types/Response.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../src/types/Response.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC"}
|
package/lib-esm/Interactions.js
CHANGED
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
48
2
|
import { Amplify, ConsoleLogger as Logger } from '@aws-amplify/core';
|
|
49
3
|
import { AWSLexProvider } from './Providers';
|
|
50
4
|
var logger = new Logger('Interactions');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interactions.js","sourceRoot":"","sources":["../src/Interactions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Interactions.js","sourceRoot":"","sources":["../src/Interactions.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC;AAE1C;IAKC;;;;OAIG;IACH,2BAAY,OAAiC;QAAjC,wBAAA,EAAA,YAAiC;QAC5C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACvB,CAAC;IAEM,yCAAa,GAApB;QACC,OAAO,cAAc,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,qCAAS,GAAhB,UAAiB,OAA4B;QAA7C,iBAyCC;QAxCA,IAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM,CAAC,KAAK,CAAC,wBAAwB,EA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; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
/*
|
|
62
|
-
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
63
|
-
*
|
|
64
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
65
|
-
* the License. A copy of the License is located at
|
|
66
|
-
*
|
|
67
|
-
* http://aws.amazon.com/apache2.0/
|
|
68
|
-
*
|
|
69
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
70
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
71
|
-
* and limitations under the License.
|
|
72
|
-
*/
|
|
1
|
+
import { __assign, __awaiter, __extends, __generator } from "tslib";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
73
4
|
import { AbstractInteractionsProvider } from './InteractionsProvider';
|
|
74
5
|
import { LexRuntimeServiceClient, PostTextCommand, PostContentCommand, } from '@aws-sdk/client-lex-runtime-service';
|
|
75
6
|
import { ConsoleLogger as Logger, Credentials, getAmplifyUserAgent, } from '@aws-amplify/core';
|