@aws-amplify/interactions 4.0.49-size-improvement.21 → 4.0.49
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 +8 -0
- package/dist/aws-amplify-interactions.js +388 -34
- package/dist/aws-amplify-interactions.js.map +1 -1
- package/dist/aws-amplify-interactions.min.js +4 -4
- package/dist/aws-amplify-interactions.min.js.map +1 -1
- package/lib-esm/Interactions.js +47 -1
- package/lib-esm/Interactions.js.map +1 -1
- package/lib-esm/Providers/AWSLexProvider.js +60 -1
- package/lib-esm/Providers/AWSLexProvider.js.map +1 -1
- package/lib-esm/Providers/AWSLexProviderHelper/convert.native.js +36 -1
- package/lib-esm/Providers/AWSLexProviderHelper/convert.native.js.map +1 -1
- package/lib-esm/Providers/InteractionsProvider.js +11 -1
- package/lib-esm/Providers/InteractionsProvider.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/interactions@4.0.48...@aws-amplify/interactions@4.0.49) (2022-08-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/interactions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.0.48](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/interactions@4.0.47...@aws-amplify/interactions@4.0.48) (2022-08-01)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-amplify/interactions
|
|
@@ -11032,14 +11032,171 @@ module.exports = g;
|
|
|
11032
11032
|
__webpack_require__.r(__webpack_exports__);
|
|
11033
11033
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InteractionsClass", function() { return InteractionsClass; });
|
|
11034
11034
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interactions", function() { return Interactions; });
|
|
11035
|
-
/* harmony import */ var
|
|
11036
|
-
/* harmony import */ var
|
|
11037
|
-
/* harmony import */ var
|
|
11038
|
-
|
|
11035
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
11036
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
11037
|
+
/* harmony import */ var _Providers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Providers */ "./lib-esm/Providers/index.js");
|
|
11038
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
11039
|
+
__assign = Object.assign || function (t) {
|
|
11040
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11041
|
+
s = arguments[i];
|
|
11042
|
+
|
|
11043
|
+
for (var p in s) {
|
|
11044
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
11047
|
+
|
|
11048
|
+
return t;
|
|
11049
|
+
};
|
|
11050
|
+
|
|
11051
|
+
return __assign.apply(this, arguments);
|
|
11052
|
+
};
|
|
11053
|
+
|
|
11054
|
+
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
11055
|
+
function adopt(value) {
|
|
11056
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
11057
|
+
resolve(value);
|
|
11058
|
+
});
|
|
11059
|
+
}
|
|
11060
|
+
|
|
11061
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11062
|
+
function fulfilled(value) {
|
|
11063
|
+
try {
|
|
11064
|
+
step(generator.next(value));
|
|
11065
|
+
} catch (e) {
|
|
11066
|
+
reject(e);
|
|
11067
|
+
}
|
|
11068
|
+
}
|
|
11069
|
+
|
|
11070
|
+
function rejected(value) {
|
|
11071
|
+
try {
|
|
11072
|
+
step(generator["throw"](value));
|
|
11073
|
+
} catch (e) {
|
|
11074
|
+
reject(e);
|
|
11075
|
+
}
|
|
11076
|
+
}
|
|
11077
|
+
|
|
11078
|
+
function step(result) {
|
|
11079
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
11080
|
+
}
|
|
11081
|
+
|
|
11082
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11083
|
+
});
|
|
11084
|
+
};
|
|
11085
|
+
|
|
11086
|
+
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
11087
|
+
var _ = {
|
|
11088
|
+
label: 0,
|
|
11089
|
+
sent: function sent() {
|
|
11090
|
+
if (t[0] & 1) throw t[1];
|
|
11091
|
+
return t[1];
|
|
11092
|
+
},
|
|
11093
|
+
trys: [],
|
|
11094
|
+
ops: []
|
|
11095
|
+
},
|
|
11096
|
+
f,
|
|
11097
|
+
y,
|
|
11098
|
+
t,
|
|
11099
|
+
g;
|
|
11100
|
+
return g = {
|
|
11101
|
+
next: verb(0),
|
|
11102
|
+
"throw": verb(1),
|
|
11103
|
+
"return": verb(2)
|
|
11104
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
11105
|
+
return this;
|
|
11106
|
+
}), g;
|
|
11107
|
+
|
|
11108
|
+
function verb(n) {
|
|
11109
|
+
return function (v) {
|
|
11110
|
+
return step([n, v]);
|
|
11111
|
+
};
|
|
11112
|
+
}
|
|
11113
|
+
|
|
11114
|
+
function step(op) {
|
|
11115
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
11116
|
+
|
|
11117
|
+
while (_) {
|
|
11118
|
+
try {
|
|
11119
|
+
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;
|
|
11120
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11121
|
+
|
|
11122
|
+
switch (op[0]) {
|
|
11123
|
+
case 0:
|
|
11124
|
+
case 1:
|
|
11125
|
+
t = op;
|
|
11126
|
+
break;
|
|
11127
|
+
|
|
11128
|
+
case 4:
|
|
11129
|
+
_.label++;
|
|
11130
|
+
return {
|
|
11131
|
+
value: op[1],
|
|
11132
|
+
done: false
|
|
11133
|
+
};
|
|
11134
|
+
|
|
11135
|
+
case 5:
|
|
11136
|
+
_.label++;
|
|
11137
|
+
y = op[1];
|
|
11138
|
+
op = [0];
|
|
11139
|
+
continue;
|
|
11140
|
+
|
|
11141
|
+
case 7:
|
|
11142
|
+
op = _.ops.pop();
|
|
11143
|
+
|
|
11144
|
+
_.trys.pop();
|
|
11145
|
+
|
|
11146
|
+
continue;
|
|
11147
|
+
|
|
11148
|
+
default:
|
|
11149
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
11150
|
+
_ = 0;
|
|
11151
|
+
continue;
|
|
11152
|
+
}
|
|
11039
11153
|
|
|
11154
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
11155
|
+
_.label = op[1];
|
|
11156
|
+
break;
|
|
11157
|
+
}
|
|
11158
|
+
|
|
11159
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
11160
|
+
_.label = t[1];
|
|
11161
|
+
t = op;
|
|
11162
|
+
break;
|
|
11163
|
+
}
|
|
11040
11164
|
|
|
11165
|
+
if (t && _.label < t[2]) {
|
|
11166
|
+
_.label = t[2];
|
|
11041
11167
|
|
|
11042
|
-
|
|
11168
|
+
_.ops.push(op);
|
|
11169
|
+
|
|
11170
|
+
break;
|
|
11171
|
+
}
|
|
11172
|
+
|
|
11173
|
+
if (t[2]) _.ops.pop();
|
|
11174
|
+
|
|
11175
|
+
_.trys.pop();
|
|
11176
|
+
|
|
11177
|
+
continue;
|
|
11178
|
+
}
|
|
11179
|
+
|
|
11180
|
+
op = body.call(thisArg, _);
|
|
11181
|
+
} catch (e) {
|
|
11182
|
+
op = [6, e];
|
|
11183
|
+
y = 0;
|
|
11184
|
+
} finally {
|
|
11185
|
+
f = t = 0;
|
|
11186
|
+
}
|
|
11187
|
+
}
|
|
11188
|
+
|
|
11189
|
+
if (op[0] & 5) throw op[1];
|
|
11190
|
+
return {
|
|
11191
|
+
value: op[0] ? op[1] : void 0,
|
|
11192
|
+
done: true
|
|
11193
|
+
};
|
|
11194
|
+
}
|
|
11195
|
+
};
|
|
11196
|
+
|
|
11197
|
+
|
|
11198
|
+
|
|
11199
|
+
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Interactions');
|
|
11043
11200
|
|
|
11044
11201
|
var InteractionsClass =
|
|
11045
11202
|
/** @class */
|
|
@@ -11072,7 +11229,7 @@ function () {
|
|
|
11072
11229
|
logger.debug('configure Interactions', {
|
|
11073
11230
|
opt: opt
|
|
11074
11231
|
});
|
|
11075
|
-
this._options =
|
|
11232
|
+
this._options = __assign(__assign({
|
|
11076
11233
|
bots: {}
|
|
11077
11234
|
}, opt), opt.Interactions);
|
|
11078
11235
|
var aws_bots_config = this._options.aws_bots_config;
|
|
@@ -11093,7 +11250,7 @@ function () {
|
|
|
11093
11250
|
}).find(function (bot) {
|
|
11094
11251
|
return !bot.providerName || bot.providerName === 'AWSLexProvider';
|
|
11095
11252
|
})) {
|
|
11096
|
-
this._pluggables.AWSLexProvider = new
|
|
11253
|
+
this._pluggables.AWSLexProvider = new _Providers__WEBPACK_IMPORTED_MODULE_1__["AWSLexProvider"]();
|
|
11097
11254
|
}
|
|
11098
11255
|
|
|
11099
11256
|
Object.keys(this._pluggables).map(function (key) {
|
|
@@ -11115,9 +11272,9 @@ function () {
|
|
|
11115
11272
|
};
|
|
11116
11273
|
|
|
11117
11274
|
InteractionsClass.prototype.send = function (botname, message) {
|
|
11118
|
-
return
|
|
11275
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11119
11276
|
var botProvider;
|
|
11120
|
-
return
|
|
11277
|
+
return __generator(this, function (_a) {
|
|
11121
11278
|
switch (_a.label) {
|
|
11122
11279
|
case 0:
|
|
11123
11280
|
if (!this._options.bots || !this._options.bots[botname]) {
|
|
@@ -11162,7 +11319,7 @@ function () {
|
|
|
11162
11319
|
|
|
11163
11320
|
|
|
11164
11321
|
var Interactions = new InteractionsClass(null);
|
|
11165
|
-
|
|
11322
|
+
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Amplify"].register(Interactions);
|
|
11166
11323
|
|
|
11167
11324
|
/***/ }),
|
|
11168
11325
|
|
|
@@ -11176,12 +11333,11 @@ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Amplify"].register(Interactions)
|
|
|
11176
11333
|
"use strict";
|
|
11177
11334
|
__webpack_require__.r(__webpack_exports__);
|
|
11178
11335
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AWSLexProvider", function() { return AWSLexProvider; });
|
|
11179
|
-
/* harmony import */ var
|
|
11180
|
-
/* harmony import */ var
|
|
11181
|
-
/* harmony import */ var
|
|
11182
|
-
/* harmony import */ var
|
|
11183
|
-
/* harmony import */ var
|
|
11184
|
-
/* harmony import */ var _AWSLexProviderHelper_convert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AWSLexProviderHelper/convert */ "./lib-esm/Providers/AWSLexProviderHelper/convert.js");
|
|
11336
|
+
/* harmony import */ var _InteractionsProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./InteractionsProvider */ "./lib-esm/Providers/InteractionsProvider.js");
|
|
11337
|
+
/* harmony import */ var _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-sdk/client-lex-runtime-service */ "../../node_modules/@aws-sdk/client-lex-runtime-service/dist/es/index.js");
|
|
11338
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
11339
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
11340
|
+
/* harmony import */ var _AWSLexProviderHelper_convert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AWSLexProviderHelper/convert */ "./lib-esm/Providers/AWSLexProviderHelper/convert.js");
|
|
11185
11341
|
/*
|
|
11186
11342
|
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11187
11343
|
*
|
|
@@ -11194,17 +11350,201 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11194
11350
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11195
11351
|
* and limitations under the License.
|
|
11196
11352
|
*/
|
|
11353
|
+
var __extends = undefined && undefined.__extends || function () {
|
|
11354
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
11355
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
11356
|
+
__proto__: []
|
|
11357
|
+
} instanceof Array && function (d, b) {
|
|
11358
|
+
d.__proto__ = b;
|
|
11359
|
+
} || function (d, b) {
|
|
11360
|
+
for (var p in b) {
|
|
11361
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
11362
|
+
}
|
|
11363
|
+
};
|
|
11197
11364
|
|
|
11365
|
+
return _extendStatics(d, b);
|
|
11366
|
+
};
|
|
11198
11367
|
|
|
11368
|
+
return function (d, b) {
|
|
11369
|
+
_extendStatics(d, b);
|
|
11199
11370
|
|
|
11371
|
+
function __() {
|
|
11372
|
+
this.constructor = d;
|
|
11373
|
+
}
|
|
11200
11374
|
|
|
11375
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
11376
|
+
};
|
|
11377
|
+
}();
|
|
11378
|
+
|
|
11379
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
11380
|
+
__assign = Object.assign || function (t) {
|
|
11381
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11382
|
+
s = arguments[i];
|
|
11201
11383
|
|
|
11202
|
-
var
|
|
11384
|
+
for (var p in s) {
|
|
11385
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
|
|
11389
|
+
return t;
|
|
11390
|
+
};
|
|
11391
|
+
|
|
11392
|
+
return __assign.apply(this, arguments);
|
|
11393
|
+
};
|
|
11394
|
+
|
|
11395
|
+
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
11396
|
+
function adopt(value) {
|
|
11397
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
11398
|
+
resolve(value);
|
|
11399
|
+
});
|
|
11400
|
+
}
|
|
11401
|
+
|
|
11402
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11403
|
+
function fulfilled(value) {
|
|
11404
|
+
try {
|
|
11405
|
+
step(generator.next(value));
|
|
11406
|
+
} catch (e) {
|
|
11407
|
+
reject(e);
|
|
11408
|
+
}
|
|
11409
|
+
}
|
|
11410
|
+
|
|
11411
|
+
function rejected(value) {
|
|
11412
|
+
try {
|
|
11413
|
+
step(generator["throw"](value));
|
|
11414
|
+
} catch (e) {
|
|
11415
|
+
reject(e);
|
|
11416
|
+
}
|
|
11417
|
+
}
|
|
11418
|
+
|
|
11419
|
+
function step(result) {
|
|
11420
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
11421
|
+
}
|
|
11422
|
+
|
|
11423
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11424
|
+
});
|
|
11425
|
+
};
|
|
11426
|
+
|
|
11427
|
+
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
11428
|
+
var _ = {
|
|
11429
|
+
label: 0,
|
|
11430
|
+
sent: function sent() {
|
|
11431
|
+
if (t[0] & 1) throw t[1];
|
|
11432
|
+
return t[1];
|
|
11433
|
+
},
|
|
11434
|
+
trys: [],
|
|
11435
|
+
ops: []
|
|
11436
|
+
},
|
|
11437
|
+
f,
|
|
11438
|
+
y,
|
|
11439
|
+
t,
|
|
11440
|
+
g;
|
|
11441
|
+
return g = {
|
|
11442
|
+
next: verb(0),
|
|
11443
|
+
"throw": verb(1),
|
|
11444
|
+
"return": verb(2)
|
|
11445
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
11446
|
+
return this;
|
|
11447
|
+
}), g;
|
|
11448
|
+
|
|
11449
|
+
function verb(n) {
|
|
11450
|
+
return function (v) {
|
|
11451
|
+
return step([n, v]);
|
|
11452
|
+
};
|
|
11453
|
+
}
|
|
11454
|
+
|
|
11455
|
+
function step(op) {
|
|
11456
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
11457
|
+
|
|
11458
|
+
while (_) {
|
|
11459
|
+
try {
|
|
11460
|
+
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;
|
|
11461
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11462
|
+
|
|
11463
|
+
switch (op[0]) {
|
|
11464
|
+
case 0:
|
|
11465
|
+
case 1:
|
|
11466
|
+
t = op;
|
|
11467
|
+
break;
|
|
11468
|
+
|
|
11469
|
+
case 4:
|
|
11470
|
+
_.label++;
|
|
11471
|
+
return {
|
|
11472
|
+
value: op[1],
|
|
11473
|
+
done: false
|
|
11474
|
+
};
|
|
11475
|
+
|
|
11476
|
+
case 5:
|
|
11477
|
+
_.label++;
|
|
11478
|
+
y = op[1];
|
|
11479
|
+
op = [0];
|
|
11480
|
+
continue;
|
|
11481
|
+
|
|
11482
|
+
case 7:
|
|
11483
|
+
op = _.ops.pop();
|
|
11484
|
+
|
|
11485
|
+
_.trys.pop();
|
|
11486
|
+
|
|
11487
|
+
continue;
|
|
11488
|
+
|
|
11489
|
+
default:
|
|
11490
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
11491
|
+
_ = 0;
|
|
11492
|
+
continue;
|
|
11493
|
+
}
|
|
11494
|
+
|
|
11495
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
11496
|
+
_.label = op[1];
|
|
11497
|
+
break;
|
|
11498
|
+
}
|
|
11499
|
+
|
|
11500
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
11501
|
+
_.label = t[1];
|
|
11502
|
+
t = op;
|
|
11503
|
+
break;
|
|
11504
|
+
}
|
|
11505
|
+
|
|
11506
|
+
if (t && _.label < t[2]) {
|
|
11507
|
+
_.label = t[2];
|
|
11508
|
+
|
|
11509
|
+
_.ops.push(op);
|
|
11510
|
+
|
|
11511
|
+
break;
|
|
11512
|
+
}
|
|
11513
|
+
|
|
11514
|
+
if (t[2]) _.ops.pop();
|
|
11515
|
+
|
|
11516
|
+
_.trys.pop();
|
|
11517
|
+
|
|
11518
|
+
continue;
|
|
11519
|
+
}
|
|
11520
|
+
|
|
11521
|
+
op = body.call(thisArg, _);
|
|
11522
|
+
} catch (e) {
|
|
11523
|
+
op = [6, e];
|
|
11524
|
+
y = 0;
|
|
11525
|
+
} finally {
|
|
11526
|
+
f = t = 0;
|
|
11527
|
+
}
|
|
11528
|
+
}
|
|
11529
|
+
|
|
11530
|
+
if (op[0] & 5) throw op[1];
|
|
11531
|
+
return {
|
|
11532
|
+
value: op[0] ? op[1] : void 0,
|
|
11533
|
+
done: true
|
|
11534
|
+
};
|
|
11535
|
+
}
|
|
11536
|
+
};
|
|
11537
|
+
|
|
11538
|
+
|
|
11539
|
+
|
|
11540
|
+
|
|
11541
|
+
|
|
11542
|
+
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('AWSLexProvider');
|
|
11203
11543
|
|
|
11204
11544
|
var AWSLexProvider =
|
|
11205
11545
|
/** @class */
|
|
11206
11546
|
function (_super) {
|
|
11207
|
-
|
|
11547
|
+
__extends(AWSLexProvider, _super);
|
|
11208
11548
|
|
|
11209
11549
|
function AWSLexProvider(options) {
|
|
11210
11550
|
if (options === void 0) {
|
|
@@ -11261,9 +11601,9 @@ function (_super) {
|
|
|
11261
11601
|
};
|
|
11262
11602
|
|
|
11263
11603
|
AWSLexProvider.prototype.sendMessage = function (botname, message) {
|
|
11264
|
-
return
|
|
11604
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11265
11605
|
var credentials, params, postTextCommand, data, err_1, content, messageType, postContentCommand, data, audioArray, err_2;
|
|
11266
|
-
return
|
|
11606
|
+
return __generator(this, function (_a) {
|
|
11267
11607
|
switch (_a.label) {
|
|
11268
11608
|
case 0:
|
|
11269
11609
|
if (!this._config[botname]) {
|
|
@@ -11274,7 +11614,7 @@ function (_super) {
|
|
|
11274
11614
|
|
|
11275
11615
|
return [4
|
|
11276
11616
|
/*yield*/
|
|
11277
|
-
,
|
|
11617
|
+
, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Credentials"].get()];
|
|
11278
11618
|
|
|
11279
11619
|
case 1:
|
|
11280
11620
|
credentials = _a.sent();
|
|
@@ -11285,10 +11625,10 @@ function (_super) {
|
|
|
11285
11625
|
, Promise.reject('No credentials')];
|
|
11286
11626
|
}
|
|
11287
11627
|
|
|
11288
|
-
this.lexRuntimeServiceClient = new
|
|
11628
|
+
this.lexRuntimeServiceClient = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["LexRuntimeServiceClient"]({
|
|
11289
11629
|
region: this._config[botname].region,
|
|
11290
11630
|
credentials: credentials,
|
|
11291
|
-
customUserAgent: Object(
|
|
11631
|
+
customUserAgent: Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["getAmplifyUserAgent"])()
|
|
11292
11632
|
});
|
|
11293
11633
|
if (!(typeof message === 'string')) return [3
|
|
11294
11634
|
/*break*/
|
|
@@ -11305,7 +11645,7 @@ function (_super) {
|
|
|
11305
11645
|
case 2:
|
|
11306
11646
|
_a.trys.push([2, 4,, 5]);
|
|
11307
11647
|
|
|
11308
|
-
postTextCommand = new
|
|
11648
|
+
postTextCommand = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["PostTextCommand"](params);
|
|
11309
11649
|
return [4
|
|
11310
11650
|
/*yield*/
|
|
11311
11651
|
, this.lexRuntimeServiceClient.send(postTextCommand)];
|
|
@@ -11357,7 +11697,7 @@ function (_super) {
|
|
|
11357
11697
|
case 7:
|
|
11358
11698
|
_a.trys.push([7, 10,, 11]);
|
|
11359
11699
|
|
|
11360
|
-
postContentCommand = new
|
|
11700
|
+
postContentCommand = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["PostContentCommand"](params);
|
|
11361
11701
|
return [4
|
|
11362
11702
|
/*yield*/
|
|
11363
11703
|
, this.lexRuntimeServiceClient.send(postContentCommand)];
|
|
@@ -11366,14 +11706,14 @@ function (_super) {
|
|
|
11366
11706
|
data = _a.sent();
|
|
11367
11707
|
return [4
|
|
11368
11708
|
/*yield*/
|
|
11369
|
-
, Object(
|
|
11709
|
+
, Object(_AWSLexProviderHelper_convert__WEBPACK_IMPORTED_MODULE_3__["convert"])(data.audioStream)];
|
|
11370
11710
|
|
|
11371
11711
|
case 9:
|
|
11372
11712
|
audioArray = _a.sent();
|
|
11373
11713
|
this.reportBotStatus(data, botname);
|
|
11374
11714
|
return [2
|
|
11375
11715
|
/*return*/
|
|
11376
|
-
,
|
|
11716
|
+
, __assign(__assign({}, data), {
|
|
11377
11717
|
audioStream: audioArray
|
|
11378
11718
|
})];
|
|
11379
11719
|
|
|
@@ -11401,7 +11741,7 @@ function (_super) {
|
|
|
11401
11741
|
};
|
|
11402
11742
|
|
|
11403
11743
|
return AWSLexProvider;
|
|
11404
|
-
}(
|
|
11744
|
+
}(_InteractionsProvider__WEBPACK_IMPORTED_MODULE_0__["AbstractInteractionsProvider"]);
|
|
11405
11745
|
|
|
11406
11746
|
|
|
11407
11747
|
|
|
@@ -11439,9 +11779,8 @@ var convert = function convert(stream) {
|
|
|
11439
11779
|
"use strict";
|
|
11440
11780
|
__webpack_require__.r(__webpack_exports__);
|
|
11441
11781
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractInteractionsProvider", function() { return AbstractInteractionsProvider; });
|
|
11442
|
-
/* harmony import */ var
|
|
11443
|
-
/* harmony import */ var
|
|
11444
|
-
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
11782
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
11783
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
11445
11784
|
/*
|
|
11446
11785
|
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11447
11786
|
*
|
|
@@ -11454,9 +11793,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11454
11793
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11455
11794
|
* and limitations under the License.
|
|
11456
11795
|
*/
|
|
11796
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
11797
|
+
__assign = Object.assign || function (t) {
|
|
11798
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11799
|
+
s = arguments[i];
|
|
11800
|
+
|
|
11801
|
+
for (var p in s) {
|
|
11802
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
11803
|
+
}
|
|
11804
|
+
}
|
|
11805
|
+
|
|
11806
|
+
return t;
|
|
11807
|
+
};
|
|
11808
|
+
|
|
11809
|
+
return __assign.apply(this, arguments);
|
|
11810
|
+
};
|
|
11457
11811
|
|
|
11458
11812
|
|
|
11459
|
-
var logger = new
|
|
11813
|
+
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('AbstractInteractionsProvider');
|
|
11460
11814
|
|
|
11461
11815
|
var AbstractInteractionsProvider =
|
|
11462
11816
|
/** @class */
|
|
@@ -11474,7 +11828,7 @@ function () {
|
|
|
11474
11828
|
config = {};
|
|
11475
11829
|
}
|
|
11476
11830
|
|
|
11477
|
-
this._config =
|
|
11831
|
+
this._config = __assign(__assign({}, this._config), config);
|
|
11478
11832
|
logger.debug("configure " + this.getProviderName(), this._config);
|
|
11479
11833
|
return this.options;
|
|
11480
11834
|
};
|
|
@@ -11485,7 +11839,7 @@ function () {
|
|
|
11485
11839
|
|
|
11486
11840
|
Object.defineProperty(AbstractInteractionsProvider.prototype, "options", {
|
|
11487
11841
|
get: function get() {
|
|
11488
|
-
return
|
|
11842
|
+
return __assign({}, this._config);
|
|
11489
11843
|
},
|
|
11490
11844
|
enumerable: true,
|
|
11491
11845
|
configurable: true
|