@aws-amplify/interactions 4.1.4-unstable.7 → 4.1.4
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.
|
@@ -253,12 +253,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
253
253
|
/* harmony import */ var _whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./whatwgEncodingApi */ "../../node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js");
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
};
|
|
259
|
-
var toUtf8 = function (input) {
|
|
260
|
-
return typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
|
|
261
|
-
};
|
|
256
|
+
const fromUtf8 = (input) => typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
|
|
257
|
+
const toUtf8 = (input) => typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
|
|
262
258
|
|
|
263
259
|
|
|
264
260
|
/***/ }),
|
|
@@ -274,44 +270,44 @@ var toUtf8 = function (input) {
|
|
|
274
270
|
__webpack_require__.r(__webpack_exports__);
|
|
275
271
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
276
272
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
for (
|
|
280
|
-
|
|
273
|
+
const fromUtf8 = (input) => {
|
|
274
|
+
const bytes = [];
|
|
275
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
276
|
+
const value = input.charCodeAt(i);
|
|
281
277
|
if (value < 0x80) {
|
|
282
278
|
bytes.push(value);
|
|
283
279
|
}
|
|
284
280
|
else if (value < 0x800) {
|
|
285
|
-
bytes.push((value >> 6) |
|
|
281
|
+
bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
|
|
286
282
|
}
|
|
287
283
|
else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
288
|
-
|
|
289
|
-
bytes.push((surrogatePair >> 18) |
|
|
284
|
+
const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
|
|
285
|
+
bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
|
|
290
286
|
}
|
|
291
287
|
else {
|
|
292
|
-
bytes.push((value >> 12) |
|
|
288
|
+
bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
|
|
293
289
|
}
|
|
294
290
|
}
|
|
295
291
|
return Uint8Array.from(bytes);
|
|
296
292
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
for (
|
|
300
|
-
|
|
293
|
+
const toUtf8 = (input) => {
|
|
294
|
+
let decoded = "";
|
|
295
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
296
|
+
const byte = input[i];
|
|
301
297
|
if (byte < 0x80) {
|
|
302
298
|
decoded += String.fromCharCode(byte);
|
|
303
299
|
}
|
|
304
|
-
else if (
|
|
305
|
-
|
|
306
|
-
decoded += String.fromCharCode(((byte &
|
|
300
|
+
else if (0b11000000 <= byte && byte < 0b11100000) {
|
|
301
|
+
const nextByte = input[++i];
|
|
302
|
+
decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
|
|
307
303
|
}
|
|
308
|
-
else if (
|
|
309
|
-
|
|
310
|
-
|
|
304
|
+
else if (0b11110000 <= byte && byte < 0b101101101) {
|
|
305
|
+
const surrogatePair = [byte, input[++i], input[++i], input[++i]];
|
|
306
|
+
const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
|
|
311
307
|
decoded += decodeURIComponent(encoded);
|
|
312
308
|
}
|
|
313
309
|
else {
|
|
314
|
-
decoded += String.fromCharCode(((byte &
|
|
310
|
+
decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
|
|
315
311
|
}
|
|
316
312
|
}
|
|
317
313
|
return decoded;
|
|
@@ -3196,7 +3192,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3196
3192
|
exports.Sha256 = void 0;
|
|
3197
3193
|
var isEmptyData_1 = __webpack_require__(/*! ./isEmptyData */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js");
|
|
3198
3194
|
var constants_1 = __webpack_require__(/*! ./constants */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/build/constants.js");
|
|
3199
|
-
var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
|
|
3195
|
+
var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
|
|
3200
3196
|
var util_locate_window_1 = __webpack_require__(/*! @aws-sdk/util-locate-window */ "../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js");
|
|
3201
3197
|
var Sha256 = /** @class */ (function () {
|
|
3202
3198
|
function Sha256(secret) {
|
|
@@ -3723,6 +3719,105 @@ function bufferFromSecret(secret) {
|
|
|
3723
3719
|
}
|
|
3724
3720
|
//# sourceMappingURL=jsSha256.js.map
|
|
3725
3721
|
|
|
3722
|
+
/***/ }),
|
|
3723
|
+
|
|
3724
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js":
|
|
3725
|
+
/*!**************************************************************************************************************************************************************************!*\
|
|
3726
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js ***!
|
|
3727
|
+
\**************************************************************************************************************************************************************************/
|
|
3728
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
3729
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3730
|
+
|
|
3731
|
+
"use strict";
|
|
3732
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3733
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
3734
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
3735
|
+
/* harmony import */ var _pureJs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pureJs */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js");
|
|
3736
|
+
/* harmony import */ var _whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./whatwgEncodingApi */ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js");
|
|
3737
|
+
|
|
3738
|
+
|
|
3739
|
+
const fromUtf8 = (input) => typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
|
|
3740
|
+
const toUtf8 = (input) => typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
|
|
3741
|
+
|
|
3742
|
+
|
|
3743
|
+
/***/ }),
|
|
3744
|
+
|
|
3745
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js":
|
|
3746
|
+
/*!***************************************************************************************************************************************************************************!*\
|
|
3747
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js ***!
|
|
3748
|
+
\***************************************************************************************************************************************************************************/
|
|
3749
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
3750
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3751
|
+
|
|
3752
|
+
"use strict";
|
|
3753
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3754
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
3755
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
3756
|
+
const fromUtf8 = (input) => {
|
|
3757
|
+
const bytes = [];
|
|
3758
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
3759
|
+
const value = input.charCodeAt(i);
|
|
3760
|
+
if (value < 0x80) {
|
|
3761
|
+
bytes.push(value);
|
|
3762
|
+
}
|
|
3763
|
+
else if (value < 0x800) {
|
|
3764
|
+
bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
|
|
3765
|
+
}
|
|
3766
|
+
else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
3767
|
+
const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
|
|
3768
|
+
bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
|
|
3769
|
+
}
|
|
3770
|
+
else {
|
|
3771
|
+
bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
return Uint8Array.from(bytes);
|
|
3775
|
+
};
|
|
3776
|
+
const toUtf8 = (input) => {
|
|
3777
|
+
let decoded = "";
|
|
3778
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
3779
|
+
const byte = input[i];
|
|
3780
|
+
if (byte < 0x80) {
|
|
3781
|
+
decoded += String.fromCharCode(byte);
|
|
3782
|
+
}
|
|
3783
|
+
else if (0b11000000 <= byte && byte < 0b11100000) {
|
|
3784
|
+
const nextByte = input[++i];
|
|
3785
|
+
decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
|
|
3786
|
+
}
|
|
3787
|
+
else if (0b11110000 <= byte && byte < 0b101101101) {
|
|
3788
|
+
const surrogatePair = [byte, input[++i], input[++i], input[++i]];
|
|
3789
|
+
const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
|
|
3790
|
+
decoded += decodeURIComponent(encoded);
|
|
3791
|
+
}
|
|
3792
|
+
else {
|
|
3793
|
+
decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
|
|
3794
|
+
}
|
|
3795
|
+
}
|
|
3796
|
+
return decoded;
|
|
3797
|
+
};
|
|
3798
|
+
|
|
3799
|
+
|
|
3800
|
+
/***/ }),
|
|
3801
|
+
|
|
3802
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js":
|
|
3803
|
+
/*!**************************************************************************************************************************************************************************************!*\
|
|
3804
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js ***!
|
|
3805
|
+
\**************************************************************************************************************************************************************************************/
|
|
3806
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
3807
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3808
|
+
|
|
3809
|
+
"use strict";
|
|
3810
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3811
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
3812
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
3813
|
+
function fromUtf8(input) {
|
|
3814
|
+
return new TextEncoder().encode(input);
|
|
3815
|
+
}
|
|
3816
|
+
function toUtf8(input) {
|
|
3817
|
+
return new TextDecoder("utf-8").decode(input);
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
|
|
3726
3821
|
/***/ }),
|
|
3727
3822
|
|
|
3728
3823
|
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-service/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js":
|
|
@@ -14796,7 +14891,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14796
14891
|
exports.Sha256 = void 0;
|
|
14797
14892
|
var isEmptyData_1 = __webpack_require__(/*! ./isEmptyData */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js");
|
|
14798
14893
|
var constants_1 = __webpack_require__(/*! ./constants */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/build/constants.js");
|
|
14799
|
-
var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
|
|
14894
|
+
var util_utf8_browser_1 = __webpack_require__(/*! @aws-sdk/util-utf8-browser */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js");
|
|
14800
14895
|
var util_locate_window_1 = __webpack_require__(/*! @aws-sdk/util-locate-window */ "../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js");
|
|
14801
14896
|
var Sha256 = /** @class */ (function () {
|
|
14802
14897
|
function Sha256(secret) {
|
|
@@ -15323,6 +15418,105 @@ function bufferFromSecret(secret) {
|
|
|
15323
15418
|
}
|
|
15324
15419
|
//# sourceMappingURL=jsSha256.js.map
|
|
15325
15420
|
|
|
15421
|
+
/***/ }),
|
|
15422
|
+
|
|
15423
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js":
|
|
15424
|
+
/*!*********************************************************************************************************************************************************************!*\
|
|
15425
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js ***!
|
|
15426
|
+
\*********************************************************************************************************************************************************************/
|
|
15427
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
15428
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
15429
|
+
|
|
15430
|
+
"use strict";
|
|
15431
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15432
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
15433
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
15434
|
+
/* harmony import */ var _pureJs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pureJs */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js");
|
|
15435
|
+
/* harmony import */ var _whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./whatwgEncodingApi */ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js");
|
|
15436
|
+
|
|
15437
|
+
|
|
15438
|
+
const fromUtf8 = (input) => typeof TextEncoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["fromUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["fromUtf8"])(input);
|
|
15439
|
+
const toUtf8 = (input) => typeof TextDecoder === "function" ? Object(_whatwgEncodingApi__WEBPACK_IMPORTED_MODULE_1__["toUtf8"])(input) : Object(_pureJs__WEBPACK_IMPORTED_MODULE_0__["toUtf8"])(input);
|
|
15440
|
+
|
|
15441
|
+
|
|
15442
|
+
/***/ }),
|
|
15443
|
+
|
|
15444
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js":
|
|
15445
|
+
/*!**********************************************************************************************************************************************************************!*\
|
|
15446
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js ***!
|
|
15447
|
+
\**********************************************************************************************************************************************************************/
|
|
15448
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
15449
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
15450
|
+
|
|
15451
|
+
"use strict";
|
|
15452
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15453
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
15454
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
15455
|
+
const fromUtf8 = (input) => {
|
|
15456
|
+
const bytes = [];
|
|
15457
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
15458
|
+
const value = input.charCodeAt(i);
|
|
15459
|
+
if (value < 0x80) {
|
|
15460
|
+
bytes.push(value);
|
|
15461
|
+
}
|
|
15462
|
+
else if (value < 0x800) {
|
|
15463
|
+
bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);
|
|
15464
|
+
}
|
|
15465
|
+
else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
15466
|
+
const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);
|
|
15467
|
+
bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);
|
|
15468
|
+
}
|
|
15469
|
+
else {
|
|
15470
|
+
bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);
|
|
15471
|
+
}
|
|
15472
|
+
}
|
|
15473
|
+
return Uint8Array.from(bytes);
|
|
15474
|
+
};
|
|
15475
|
+
const toUtf8 = (input) => {
|
|
15476
|
+
let decoded = "";
|
|
15477
|
+
for (let i = 0, len = input.length; i < len; i++) {
|
|
15478
|
+
const byte = input[i];
|
|
15479
|
+
if (byte < 0x80) {
|
|
15480
|
+
decoded += String.fromCharCode(byte);
|
|
15481
|
+
}
|
|
15482
|
+
else if (0b11000000 <= byte && byte < 0b11100000) {
|
|
15483
|
+
const nextByte = input[++i];
|
|
15484
|
+
decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));
|
|
15485
|
+
}
|
|
15486
|
+
else if (0b11110000 <= byte && byte < 0b101101101) {
|
|
15487
|
+
const surrogatePair = [byte, input[++i], input[++i], input[++i]];
|
|
15488
|
+
const encoded = "%" + surrogatePair.map((byteValue) => byteValue.toString(16)).join("%");
|
|
15489
|
+
decoded += decodeURIComponent(encoded);
|
|
15490
|
+
}
|
|
15491
|
+
else {
|
|
15492
|
+
decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));
|
|
15493
|
+
}
|
|
15494
|
+
}
|
|
15495
|
+
return decoded;
|
|
15496
|
+
};
|
|
15497
|
+
|
|
15498
|
+
|
|
15499
|
+
/***/ }),
|
|
15500
|
+
|
|
15501
|
+
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js":
|
|
15502
|
+
/*!*********************************************************************************************************************************************************************************!*\
|
|
15503
|
+
!*** /root/amplify-js/node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js ***!
|
|
15504
|
+
\*********************************************************************************************************************************************************************************/
|
|
15505
|
+
/*! exports provided: fromUtf8, toUtf8 */
|
|
15506
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
15507
|
+
|
|
15508
|
+
"use strict";
|
|
15509
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15510
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromUtf8", function() { return fromUtf8; });
|
|
15511
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUtf8", function() { return toUtf8; });
|
|
15512
|
+
function fromUtf8(input) {
|
|
15513
|
+
return new TextEncoder().encode(input);
|
|
15514
|
+
}
|
|
15515
|
+
function toUtf8(input) {
|
|
15516
|
+
return new TextDecoder("utf-8").decode(input);
|
|
15517
|
+
}
|
|
15518
|
+
|
|
15519
|
+
|
|
15326
15520
|
/***/ }),
|
|
15327
15521
|
|
|
15328
15522
|
/***/ "../../node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js":
|
|
@@ -26397,7 +26591,7 @@ function __classPrivateFieldIn(state, receiver) {
|
|
|
26397
26591
|
"use strict";
|
|
26398
26592
|
__webpack_require__.r(__webpack_exports__);
|
|
26399
26593
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "locateWindow", function() { return locateWindow; });
|
|
26400
|
-
|
|
26594
|
+
const fallbackWindow = {};
|
|
26401
26595
|
function locateWindow() {
|
|
26402
26596
|
if (typeof window !== "undefined") {
|
|
26403
26597
|
return window;
|
|
@@ -31388,25 +31582,20 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
31388
31582
|
__assign = Object.assign || function (t) {
|
|
31389
31583
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31390
31584
|
s = arguments[i];
|
|
31391
|
-
|
|
31392
31585
|
for (var p in s) {
|
|
31393
31586
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
31394
31587
|
}
|
|
31395
31588
|
}
|
|
31396
|
-
|
|
31397
31589
|
return t;
|
|
31398
31590
|
};
|
|
31399
|
-
|
|
31400
31591
|
return __assign.apply(this, arguments);
|
|
31401
31592
|
};
|
|
31402
|
-
|
|
31403
31593
|
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
31404
31594
|
function adopt(value) {
|
|
31405
31595
|
return value instanceof P ? value : new P(function (resolve) {
|
|
31406
31596
|
resolve(value);
|
|
31407
31597
|
});
|
|
31408
31598
|
}
|
|
31409
|
-
|
|
31410
31599
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31411
31600
|
function fulfilled(value) {
|
|
31412
31601
|
try {
|
|
@@ -31415,7 +31604,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
31415
31604
|
reject(e);
|
|
31416
31605
|
}
|
|
31417
31606
|
}
|
|
31418
|
-
|
|
31419
31607
|
function rejected(value) {
|
|
31420
31608
|
try {
|
|
31421
31609
|
step(generator["throw"](value));
|
|
@@ -31423,29 +31611,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
31423
31611
|
reject(e);
|
|
31424
31612
|
}
|
|
31425
31613
|
}
|
|
31426
|
-
|
|
31427
31614
|
function step(result) {
|
|
31428
31615
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
31429
31616
|
}
|
|
31430
|
-
|
|
31431
31617
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31432
31618
|
});
|
|
31433
31619
|
};
|
|
31434
|
-
|
|
31435
31620
|
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
31436
31621
|
var _ = {
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
|
|
31622
|
+
label: 0,
|
|
31623
|
+
sent: function sent() {
|
|
31624
|
+
if (t[0] & 1) throw t[1];
|
|
31625
|
+
return t[1];
|
|
31626
|
+
},
|
|
31627
|
+
trys: [],
|
|
31628
|
+
ops: []
|
|
31441
31629
|
},
|
|
31442
|
-
|
|
31443
|
-
|
|
31444
|
-
|
|
31445
|
-
|
|
31446
|
-
y,
|
|
31447
|
-
t,
|
|
31448
|
-
g;
|
|
31630
|
+
f,
|
|
31631
|
+
y,
|
|
31632
|
+
t,
|
|
31633
|
+
g;
|
|
31449
31634
|
return g = {
|
|
31450
31635
|
next: verb(0),
|
|
31451
31636
|
"throw": verb(1),
|
|
@@ -31453,79 +31638,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31453
31638
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
31454
31639
|
return this;
|
|
31455
31640
|
}), g;
|
|
31456
|
-
|
|
31457
31641
|
function verb(n) {
|
|
31458
31642
|
return function (v) {
|
|
31459
31643
|
return step([n, v]);
|
|
31460
31644
|
};
|
|
31461
31645
|
}
|
|
31462
|
-
|
|
31463
31646
|
function step(op) {
|
|
31464
31647
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31465
|
-
|
|
31466
31648
|
while (_) {
|
|
31467
31649
|
try {
|
|
31468
31650
|
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;
|
|
31469
31651
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31470
|
-
|
|
31471
31652
|
switch (op[0]) {
|
|
31472
31653
|
case 0:
|
|
31473
31654
|
case 1:
|
|
31474
31655
|
t = op;
|
|
31475
31656
|
break;
|
|
31476
|
-
|
|
31477
31657
|
case 4:
|
|
31478
31658
|
_.label++;
|
|
31479
31659
|
return {
|
|
31480
31660
|
value: op[1],
|
|
31481
31661
|
done: false
|
|
31482
31662
|
};
|
|
31483
|
-
|
|
31484
31663
|
case 5:
|
|
31485
31664
|
_.label++;
|
|
31486
31665
|
y = op[1];
|
|
31487
31666
|
op = [0];
|
|
31488
31667
|
continue;
|
|
31489
|
-
|
|
31490
31668
|
case 7:
|
|
31491
31669
|
op = _.ops.pop();
|
|
31492
|
-
|
|
31493
31670
|
_.trys.pop();
|
|
31494
|
-
|
|
31495
31671
|
continue;
|
|
31496
|
-
|
|
31497
31672
|
default:
|
|
31498
31673
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
31499
31674
|
_ = 0;
|
|
31500
31675
|
continue;
|
|
31501
31676
|
}
|
|
31502
|
-
|
|
31503
31677
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
31504
31678
|
_.label = op[1];
|
|
31505
31679
|
break;
|
|
31506
31680
|
}
|
|
31507
|
-
|
|
31508
31681
|
if (op[0] === 6 && _.label < t[1]) {
|
|
31509
31682
|
_.label = t[1];
|
|
31510
31683
|
t = op;
|
|
31511
31684
|
break;
|
|
31512
31685
|
}
|
|
31513
|
-
|
|
31514
31686
|
if (t && _.label < t[2]) {
|
|
31515
31687
|
_.label = t[2];
|
|
31516
|
-
|
|
31517
31688
|
_.ops.push(op);
|
|
31518
|
-
|
|
31519
31689
|
break;
|
|
31520
31690
|
}
|
|
31521
|
-
|
|
31522
31691
|
if (t[2]) _.ops.pop();
|
|
31523
|
-
|
|
31524
31692
|
_.trys.pop();
|
|
31525
|
-
|
|
31526
31693
|
continue;
|
|
31527
31694
|
}
|
|
31528
|
-
|
|
31529
31695
|
op = body.call(thisArg, _);
|
|
31530
31696
|
} catch (e) {
|
|
31531
31697
|
op = [6, e];
|
|
@@ -31534,7 +31700,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31534
31700
|
f = t = 0;
|
|
31535
31701
|
}
|
|
31536
31702
|
}
|
|
31537
|
-
|
|
31538
31703
|
if (op[0] & 5) throw op[1];
|
|
31539
31704
|
return {
|
|
31540
31705
|
value: op[0] ? op[1] : void 0,
|
|
@@ -31544,12 +31709,8 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31544
31709
|
};
|
|
31545
31710
|
|
|
31546
31711
|
|
|
31547
|
-
|
|
31548
31712
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('Interactions');
|
|
31549
|
-
|
|
31550
|
-
var InteractionsClass =
|
|
31551
|
-
/** @class */
|
|
31552
|
-
function () {
|
|
31713
|
+
var InteractionsClass = /** @class */function () {
|
|
31553
31714
|
/**
|
|
31554
31715
|
* Initialize PubSub with AWS configurations
|
|
31555
31716
|
*
|
|
@@ -31559,12 +31720,10 @@ function () {
|
|
|
31559
31720
|
if (options === void 0) {
|
|
31560
31721
|
options = {};
|
|
31561
31722
|
}
|
|
31562
|
-
|
|
31563
31723
|
this._options = options;
|
|
31564
31724
|
logger.debug('Interactions Options', this._options);
|
|
31565
31725
|
this._pluggables = {};
|
|
31566
31726
|
}
|
|
31567
|
-
|
|
31568
31727
|
InteractionsClass.prototype.getModuleName = function () {
|
|
31569
31728
|
return 'Interactions';
|
|
31570
31729
|
};
|
|
@@ -31573,11 +31732,8 @@ function () {
|
|
|
31573
31732
|
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
31574
31733
|
* @return {InteractionsOptions} - The current configuration
|
|
31575
31734
|
*/
|
|
31576
|
-
|
|
31577
|
-
|
|
31578
31735
|
InteractionsClass.prototype.configure = function (options) {
|
|
31579
31736
|
var _this = this;
|
|
31580
|
-
|
|
31581
31737
|
var opt = options ? options.Interactions || options : {};
|
|
31582
31738
|
logger.debug('configure Interactions', {
|
|
31583
31739
|
opt: opt
|
|
@@ -31587,7 +31743,6 @@ function () {
|
|
|
31587
31743
|
}, opt), opt.Interactions);
|
|
31588
31744
|
var aws_bots_config = this._options.aws_bots_config;
|
|
31589
31745
|
var bots_config = this._options.bots;
|
|
31590
|
-
|
|
31591
31746
|
if (!Object.keys(bots_config).length && aws_bots_config) {
|
|
31592
31747
|
// Convert aws_bots_config to bots object
|
|
31593
31748
|
if (Array.isArray(aws_bots_config)) {
|
|
@@ -31595,20 +31750,17 @@ function () {
|
|
|
31595
31750
|
_this._options.bots[bot.name] = bot;
|
|
31596
31751
|
});
|
|
31597
31752
|
}
|
|
31598
|
-
}
|
|
31599
|
-
|
|
31600
|
-
|
|
31753
|
+
}
|
|
31754
|
+
// configure bots to their specific providers
|
|
31601
31755
|
Object.keys(bots_config).forEach(function (botKey) {
|
|
31602
31756
|
var _a;
|
|
31603
|
-
|
|
31604
31757
|
var bot = bots_config[botKey];
|
|
31605
|
-
var providerName = bot.providerName || 'AWSLexProvider';
|
|
31606
|
-
|
|
31758
|
+
var providerName = bot.providerName || 'AWSLexProvider';
|
|
31759
|
+
// add default provider if required
|
|
31607
31760
|
if (!_this._pluggables.AWSLexProvider && providerName === 'AWSLexProvider') {
|
|
31608
31761
|
_this._pluggables.AWSLexProvider = new _Providers__WEBPACK_IMPORTED_MODULE_1__["AWSLexProvider"]();
|
|
31609
|
-
}
|
|
31610
|
-
|
|
31611
|
-
|
|
31762
|
+
}
|
|
31763
|
+
// configure bot with it's respective provider
|
|
31612
31764
|
if (_this._pluggables[providerName]) {
|
|
31613
31765
|
_this._pluggables[providerName].configure((_a = {}, _a[bot.name] = bot, _a));
|
|
31614
31766
|
} else {
|
|
@@ -31617,10 +31769,8 @@ function () {
|
|
|
31617
31769
|
});
|
|
31618
31770
|
return this._options;
|
|
31619
31771
|
};
|
|
31620
|
-
|
|
31621
31772
|
InteractionsClass.prototype.addPluggable = function (pluggable) {
|
|
31622
31773
|
var _this = this;
|
|
31623
|
-
|
|
31624
31774
|
if (pluggable && pluggable.getCategory() === 'Interactions') {
|
|
31625
31775
|
if (!this._pluggables[pluggable.getProviderName()]) {
|
|
31626
31776
|
// configure bots for the new plugin
|
|
@@ -31628,7 +31778,6 @@ function () {
|
|
|
31628
31778
|
return _this._options.bots[botKey].providerName === pluggable.getProviderName();
|
|
31629
31779
|
}).forEach(function (botKey) {
|
|
31630
31780
|
var _a;
|
|
31631
|
-
|
|
31632
31781
|
var bot = _this._options.bots[botKey];
|
|
31633
31782
|
pluggable.configure((_a = {}, _a[bot.name] = bot, _a));
|
|
31634
31783
|
});
|
|
@@ -31639,7 +31788,6 @@ function () {
|
|
|
31639
31788
|
}
|
|
31640
31789
|
}
|
|
31641
31790
|
};
|
|
31642
|
-
|
|
31643
31791
|
InteractionsClass.prototype.send = function (botname, message) {
|
|
31644
31792
|
return __awaiter(this, void 0, void 0, function () {
|
|
31645
31793
|
var botProvider;
|
|
@@ -31647,50 +31795,32 @@ function () {
|
|
|
31647
31795
|
switch (_a.label) {
|
|
31648
31796
|
case 0:
|
|
31649
31797
|
if (!this._options.bots || !this._options.bots[botname]) {
|
|
31650
|
-
return [2
|
|
31651
|
-
/*return*/
|
|
31652
|
-
, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
31798
|
+
return [2 /*return*/, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
31653
31799
|
}
|
|
31654
|
-
|
|
31655
31800
|
botProvider = this._options.bots[botname].providerName || 'AWSLexProvider';
|
|
31656
|
-
|
|
31657
31801
|
if (!this._pluggables[botProvider]) {
|
|
31658
|
-
return [2
|
|
31659
|
-
/*return*/
|
|
31660
|
-
, Promise.reject('Bot ' + botProvider + ' does not have valid pluggin did you try addPluggable first?')];
|
|
31802
|
+
return [2 /*return*/, Promise.reject('Bot ' + botProvider + ' does not have valid pluggin did you try addPluggable first?')];
|
|
31661
31803
|
}
|
|
31662
|
-
|
|
31663
|
-
return [4
|
|
31664
|
-
/*yield*/
|
|
31665
|
-
, this._pluggables[botProvider].sendMessage(botname, message)];
|
|
31666
|
-
|
|
31804
|
+
return [4 /*yield*/, this._pluggables[botProvider].sendMessage(botname, message)];
|
|
31667
31805
|
case 1:
|
|
31668
|
-
return [2
|
|
31669
|
-
/*return*/
|
|
31670
|
-
, _a.sent()];
|
|
31806
|
+
return [2 /*return*/, _a.sent()];
|
|
31671
31807
|
}
|
|
31672
31808
|
});
|
|
31673
31809
|
});
|
|
31674
31810
|
};
|
|
31675
|
-
|
|
31676
31811
|
InteractionsClass.prototype.onComplete = function (botname, callback) {
|
|
31677
31812
|
if (!this._options.bots || !this._options.bots[botname]) {
|
|
31678
31813
|
throw new Error('Bot ' + botname + ' does not exist');
|
|
31679
31814
|
}
|
|
31680
|
-
|
|
31681
31815
|
var botProvider = this._options.bots[botname].providerName || 'AWSLexProvider';
|
|
31682
|
-
|
|
31683
31816
|
if (!this._pluggables[botProvider]) {
|
|
31684
31817
|
throw new Error('Bot ' + botProvider + ' does not have valid pluggin did you try addPluggable first?');
|
|
31685
31818
|
}
|
|
31686
|
-
|
|
31687
31819
|
this._pluggables[botProvider].onComplete(botname, callback);
|
|
31688
31820
|
};
|
|
31689
|
-
|
|
31690
31821
|
return InteractionsClass;
|
|
31691
31822
|
}();
|
|
31692
31823
|
|
|
31693
|
-
|
|
31694
31824
|
var Interactions = new InteractionsClass();
|
|
31695
31825
|
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Amplify"].register(Interactions);
|
|
31696
31826
|
|
|
@@ -31720,7 +31850,6 @@ function _typeof(obj) {
|
|
|
31720
31850
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
31721
31851
|
}, _typeof(obj);
|
|
31722
31852
|
}
|
|
31723
|
-
|
|
31724
31853
|
var __extends = undefined && undefined.__extends || function () {
|
|
31725
31854
|
var _extendStatics = function extendStatics(d, b) {
|
|
31726
31855
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -31732,44 +31861,34 @@ var __extends = undefined && undefined.__extends || function () {
|
|
|
31732
31861
|
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
31733
31862
|
}
|
|
31734
31863
|
};
|
|
31735
|
-
|
|
31736
31864
|
return _extendStatics(d, b);
|
|
31737
31865
|
};
|
|
31738
|
-
|
|
31739
31866
|
return function (d, b) {
|
|
31740
31867
|
_extendStatics(d, b);
|
|
31741
|
-
|
|
31742
31868
|
function __() {
|
|
31743
31869
|
this.constructor = d;
|
|
31744
31870
|
}
|
|
31745
|
-
|
|
31746
31871
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
31747
31872
|
};
|
|
31748
31873
|
}();
|
|
31749
|
-
|
|
31750
31874
|
var __assign = undefined && undefined.__assign || function () {
|
|
31751
31875
|
__assign = Object.assign || function (t) {
|
|
31752
31876
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31753
31877
|
s = arguments[i];
|
|
31754
|
-
|
|
31755
31878
|
for (var p in s) {
|
|
31756
31879
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
31757
31880
|
}
|
|
31758
31881
|
}
|
|
31759
|
-
|
|
31760
31882
|
return t;
|
|
31761
31883
|
};
|
|
31762
|
-
|
|
31763
31884
|
return __assign.apply(this, arguments);
|
|
31764
31885
|
};
|
|
31765
|
-
|
|
31766
31886
|
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
31767
31887
|
function adopt(value) {
|
|
31768
31888
|
return value instanceof P ? value : new P(function (resolve) {
|
|
31769
31889
|
resolve(value);
|
|
31770
31890
|
});
|
|
31771
31891
|
}
|
|
31772
|
-
|
|
31773
31892
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31774
31893
|
function fulfilled(value) {
|
|
31775
31894
|
try {
|
|
@@ -31778,7 +31897,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
31778
31897
|
reject(e);
|
|
31779
31898
|
}
|
|
31780
31899
|
}
|
|
31781
|
-
|
|
31782
31900
|
function rejected(value) {
|
|
31783
31901
|
try {
|
|
31784
31902
|
step(generator["throw"](value));
|
|
@@ -31786,29 +31904,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
31786
31904
|
reject(e);
|
|
31787
31905
|
}
|
|
31788
31906
|
}
|
|
31789
|
-
|
|
31790
31907
|
function step(result) {
|
|
31791
31908
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
31792
31909
|
}
|
|
31793
|
-
|
|
31794
31910
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31795
31911
|
});
|
|
31796
31912
|
};
|
|
31797
|
-
|
|
31798
31913
|
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
31799
31914
|
var _ = {
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31915
|
+
label: 0,
|
|
31916
|
+
sent: function sent() {
|
|
31917
|
+
if (t[0] & 1) throw t[1];
|
|
31918
|
+
return t[1];
|
|
31919
|
+
},
|
|
31920
|
+
trys: [],
|
|
31921
|
+
ops: []
|
|
31804
31922
|
},
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
y,
|
|
31810
|
-
t,
|
|
31811
|
-
g;
|
|
31923
|
+
f,
|
|
31924
|
+
y,
|
|
31925
|
+
t,
|
|
31926
|
+
g;
|
|
31812
31927
|
return g = {
|
|
31813
31928
|
next: verb(0),
|
|
31814
31929
|
"throw": verb(1),
|
|
@@ -31816,79 +31931,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31816
31931
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
31817
31932
|
return this;
|
|
31818
31933
|
}), g;
|
|
31819
|
-
|
|
31820
31934
|
function verb(n) {
|
|
31821
31935
|
return function (v) {
|
|
31822
31936
|
return step([n, v]);
|
|
31823
31937
|
};
|
|
31824
31938
|
}
|
|
31825
|
-
|
|
31826
31939
|
function step(op) {
|
|
31827
31940
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31828
|
-
|
|
31829
31941
|
while (_) {
|
|
31830
31942
|
try {
|
|
31831
31943
|
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;
|
|
31832
31944
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31833
|
-
|
|
31834
31945
|
switch (op[0]) {
|
|
31835
31946
|
case 0:
|
|
31836
31947
|
case 1:
|
|
31837
31948
|
t = op;
|
|
31838
31949
|
break;
|
|
31839
|
-
|
|
31840
31950
|
case 4:
|
|
31841
31951
|
_.label++;
|
|
31842
31952
|
return {
|
|
31843
31953
|
value: op[1],
|
|
31844
31954
|
done: false
|
|
31845
31955
|
};
|
|
31846
|
-
|
|
31847
31956
|
case 5:
|
|
31848
31957
|
_.label++;
|
|
31849
31958
|
y = op[1];
|
|
31850
31959
|
op = [0];
|
|
31851
31960
|
continue;
|
|
31852
|
-
|
|
31853
31961
|
case 7:
|
|
31854
31962
|
op = _.ops.pop();
|
|
31855
|
-
|
|
31856
31963
|
_.trys.pop();
|
|
31857
|
-
|
|
31858
31964
|
continue;
|
|
31859
|
-
|
|
31860
31965
|
default:
|
|
31861
31966
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
31862
31967
|
_ = 0;
|
|
31863
31968
|
continue;
|
|
31864
31969
|
}
|
|
31865
|
-
|
|
31866
31970
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
31867
31971
|
_.label = op[1];
|
|
31868
31972
|
break;
|
|
31869
31973
|
}
|
|
31870
|
-
|
|
31871
31974
|
if (op[0] === 6 && _.label < t[1]) {
|
|
31872
31975
|
_.label = t[1];
|
|
31873
31976
|
t = op;
|
|
31874
31977
|
break;
|
|
31875
31978
|
}
|
|
31876
|
-
|
|
31877
31979
|
if (t && _.label < t[2]) {
|
|
31878
31980
|
_.label = t[2];
|
|
31879
|
-
|
|
31880
31981
|
_.ops.push(op);
|
|
31881
|
-
|
|
31882
31982
|
break;
|
|
31883
31983
|
}
|
|
31884
|
-
|
|
31885
31984
|
if (t[2]) _.ops.pop();
|
|
31886
|
-
|
|
31887
31985
|
_.trys.pop();
|
|
31888
|
-
|
|
31889
31986
|
continue;
|
|
31890
31987
|
}
|
|
31891
|
-
|
|
31892
31988
|
op = body.call(thisArg, _);
|
|
31893
31989
|
} catch (e) {
|
|
31894
31990
|
op = [6, e];
|
|
@@ -31897,7 +31993,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31897
31993
|
f = t = 0;
|
|
31898
31994
|
}
|
|
31899
31995
|
}
|
|
31900
|
-
|
|
31901
31996
|
if (op[0] & 5) throw op[1];
|
|
31902
31997
|
return {
|
|
31903
31998
|
value: op[0] ? op[1] : void 0,
|
|
@@ -31921,39 +32016,28 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
31921
32016
|
|
|
31922
32017
|
|
|
31923
32018
|
|
|
31924
|
-
|
|
31925
|
-
|
|
31926
32019
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('AWSLexProvider');
|
|
31927
|
-
|
|
31928
|
-
var AWSLexProvider =
|
|
31929
|
-
/** @class */
|
|
31930
|
-
function (_super) {
|
|
32020
|
+
var AWSLexProvider = /** @class */function (_super) {
|
|
31931
32021
|
__extends(AWSLexProvider, _super);
|
|
31932
|
-
|
|
31933
32022
|
function AWSLexProvider(options) {
|
|
31934
32023
|
if (options === void 0) {
|
|
31935
32024
|
options = {};
|
|
31936
32025
|
}
|
|
31937
|
-
|
|
31938
32026
|
var _this = _super.call(this, options) || this;
|
|
31939
|
-
|
|
31940
32027
|
_this._botsCompleteCallback = {};
|
|
31941
32028
|
return _this;
|
|
31942
32029
|
}
|
|
31943
|
-
|
|
31944
32030
|
AWSLexProvider.prototype.getProviderName = function () {
|
|
31945
32031
|
return 'AWSLexProvider';
|
|
31946
32032
|
};
|
|
31947
|
-
|
|
31948
32033
|
AWSLexProvider.prototype.configure = function (config) {
|
|
31949
32034
|
if (config === void 0) {
|
|
31950
32035
|
config = {};
|
|
31951
32036
|
}
|
|
31952
|
-
|
|
31953
32037
|
var propertiesToTest = ['name', 'alias', 'region'];
|
|
31954
32038
|
Object.keys(config).forEach(function (botKey) {
|
|
31955
|
-
var botConfig = config[botKey];
|
|
31956
|
-
|
|
32039
|
+
var botConfig = config[botKey];
|
|
32040
|
+
// is bot config correct
|
|
31957
32041
|
if (!propertiesToTest.every(function (x) {
|
|
31958
32042
|
return x in botConfig;
|
|
31959
32043
|
})) {
|
|
@@ -31968,35 +32052,28 @@ function (_super) {
|
|
|
31968
32052
|
* This is used internally by 'sendMessage' to call onComplete callback
|
|
31969
32053
|
* for a bot if configured
|
|
31970
32054
|
*/
|
|
31971
|
-
|
|
31972
|
-
|
|
31973
32055
|
AWSLexProvider.prototype.reportBotStatus = function (data, botname) {
|
|
31974
|
-
var _this = this;
|
|
31975
|
-
|
|
31976
|
-
|
|
32056
|
+
var _this = this;
|
|
32057
|
+
// Check if state is fulfilled to resolve onFullfilment promise
|
|
31977
32058
|
logger.debug('postContent state', data.dialogState);
|
|
31978
|
-
|
|
31979
32059
|
if (data.dialogState === 'ReadyForFulfillment' || data.dialogState === 'Fulfilled') {
|
|
31980
32060
|
if (typeof this._botsCompleteCallback[botname] === 'function') {
|
|
31981
32061
|
setTimeout(function () {
|
|
31982
32062
|
return _this._botsCompleteCallback[botname](null, data);
|
|
31983
32063
|
}, 0);
|
|
31984
32064
|
}
|
|
31985
|
-
|
|
31986
32065
|
if (this._config && typeof this._config[botname].onComplete === 'function') {
|
|
31987
32066
|
setTimeout(function () {
|
|
31988
32067
|
return _this._config[botname].onComplete(null, data);
|
|
31989
32068
|
}, 0);
|
|
31990
32069
|
}
|
|
31991
32070
|
}
|
|
31992
|
-
|
|
31993
32071
|
if (data.dialogState === 'Failed') {
|
|
31994
32072
|
if (typeof this._botsCompleteCallback[botname] === 'function') {
|
|
31995
32073
|
setTimeout(function () {
|
|
31996
32074
|
return _this._botsCompleteCallback[botname]('Bot conversation failed');
|
|
31997
32075
|
}, 0);
|
|
31998
32076
|
}
|
|
31999
|
-
|
|
32000
32077
|
if (this._config && typeof this._config[botname].onComplete === 'function') {
|
|
32001
32078
|
setTimeout(function () {
|
|
32002
32079
|
return _this._config[botname].onComplete('Bot conversation failed');
|
|
@@ -32004,51 +32081,33 @@ function (_super) {
|
|
|
32004
32081
|
}
|
|
32005
32082
|
}
|
|
32006
32083
|
};
|
|
32007
|
-
|
|
32008
32084
|
AWSLexProvider.prototype.sendMessage = function (botname, message) {
|
|
32009
32085
|
return __awaiter(this, void 0, void 0, function () {
|
|
32010
32086
|
var credentials, error_1, params, postTextCommand, data, err_1, content, messageType, inputStream, _a, postContentCommand, data, audioArray, _b, response, err_2;
|
|
32011
|
-
|
|
32012
32087
|
return __generator(this, function (_c) {
|
|
32013
32088
|
switch (_c.label) {
|
|
32014
32089
|
case 0:
|
|
32015
32090
|
// check if bot exists
|
|
32016
32091
|
if (!this._config[botname]) {
|
|
32017
|
-
return [2
|
|
32018
|
-
/*return*/
|
|
32019
|
-
, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
32092
|
+
return [2 /*return*/, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
32020
32093
|
}
|
|
32021
|
-
|
|
32022
32094
|
_c.label = 1;
|
|
32023
|
-
|
|
32024
32095
|
case 1:
|
|
32025
32096
|
_c.trys.push([1, 3,, 4]);
|
|
32026
|
-
|
|
32027
|
-
return [4
|
|
32028
|
-
/*yield*/
|
|
32029
|
-
, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Credentials"].get()];
|
|
32030
|
-
|
|
32097
|
+
return [4 /*yield*/, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Credentials"].get()];
|
|
32031
32098
|
case 2:
|
|
32032
32099
|
credentials = _c.sent();
|
|
32033
|
-
return [3
|
|
32034
|
-
/*break*/
|
|
32035
|
-
, 4];
|
|
32036
|
-
|
|
32100
|
+
return [3 /*break*/, 4];
|
|
32037
32101
|
case 3:
|
|
32038
32102
|
error_1 = _c.sent();
|
|
32039
|
-
return [2
|
|
32040
|
-
/*return*/
|
|
32041
|
-
, Promise.reject('No credentials')];
|
|
32042
|
-
|
|
32103
|
+
return [2 /*return*/, Promise.reject('No credentials')];
|
|
32043
32104
|
case 4:
|
|
32044
32105
|
this.lexRuntimeServiceClient = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["LexRuntimeServiceClient"]({
|
|
32045
32106
|
region: this._config[botname].region,
|
|
32046
32107
|
credentials: credentials,
|
|
32047
32108
|
customUserAgent: Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["getAmplifyUserAgent"])()
|
|
32048
32109
|
});
|
|
32049
|
-
if (!(typeof message === 'string')) return [3
|
|
32050
|
-
/*break*/
|
|
32051
|
-
, 9];
|
|
32110
|
+
if (!(typeof message === 'string')) return [3 /*break*/, 9];
|
|
32052
32111
|
params = {
|
|
32053
32112
|
botAlias: this._config[botname].alias,
|
|
32054
32113
|
botName: botname,
|
|
@@ -32057,62 +32116,33 @@ function (_super) {
|
|
|
32057
32116
|
};
|
|
32058
32117
|
logger.debug('postText to lex', message);
|
|
32059
32118
|
_c.label = 5;
|
|
32060
|
-
|
|
32061
32119
|
case 5:
|
|
32062
32120
|
_c.trys.push([5, 7,, 8]);
|
|
32063
|
-
|
|
32064
32121
|
postTextCommand = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["PostTextCommand"](params);
|
|
32065
|
-
return [4
|
|
32066
|
-
/*yield*/
|
|
32067
|
-
, this.lexRuntimeServiceClient.send(postTextCommand)];
|
|
32068
|
-
|
|
32122
|
+
return [4 /*yield*/, this.lexRuntimeServiceClient.send(postTextCommand)];
|
|
32069
32123
|
case 6:
|
|
32070
32124
|
data = _c.sent();
|
|
32071
32125
|
this.reportBotStatus(data, botname);
|
|
32072
|
-
return [2
|
|
32073
|
-
/*return*/
|
|
32074
|
-
, data];
|
|
32075
|
-
|
|
32126
|
+
return [2 /*return*/, data];
|
|
32076
32127
|
case 7:
|
|
32077
32128
|
err_1 = _c.sent();
|
|
32078
|
-
return [2
|
|
32079
|
-
/*return*/
|
|
32080
|
-
, Promise.reject(err_1)];
|
|
32081
|
-
|
|
32129
|
+
return [2 /*return*/, Promise.reject(err_1)];
|
|
32082
32130
|
case 8:
|
|
32083
|
-
return [3
|
|
32084
|
-
/*break*/
|
|
32085
|
-
, 21];
|
|
32086
|
-
|
|
32131
|
+
return [3 /*break*/, 21];
|
|
32087
32132
|
case 9:
|
|
32088
32133
|
content = message.content, messageType = message.options.messageType;
|
|
32089
|
-
if (!(messageType === 'voice')) return [3
|
|
32090
|
-
/*break*/
|
|
32091
|
-
, 13];
|
|
32092
|
-
|
|
32134
|
+
if (!(messageType === 'voice')) return [3 /*break*/, 13];
|
|
32093
32135
|
if (_typeof(content) !== 'object') {
|
|
32094
|
-
return [2
|
|
32095
|
-
/*return*/
|
|
32096
|
-
, Promise.reject('invalid content type')];
|
|
32136
|
+
return [2 /*return*/, Promise.reject('invalid content type')];
|
|
32097
32137
|
}
|
|
32098
|
-
|
|
32099
|
-
if (!(content instanceof Uint8Array)) return [3
|
|
32100
|
-
/*break*/
|
|
32101
|
-
, 10];
|
|
32138
|
+
if (!(content instanceof Uint8Array)) return [3 /*break*/, 10];
|
|
32102
32139
|
_a = content;
|
|
32103
|
-
return [3
|
|
32104
|
-
/*break*/
|
|
32105
|
-
, 12];
|
|
32106
|
-
|
|
32140
|
+
return [3 /*break*/, 12];
|
|
32107
32141
|
case 10:
|
|
32108
|
-
return [4
|
|
32109
|
-
/*yield*/
|
|
32110
|
-
, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(content)];
|
|
32111
|
-
|
|
32142
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(content)];
|
|
32112
32143
|
case 11:
|
|
32113
32144
|
_a = _c.sent();
|
|
32114
32145
|
_c.label = 12;
|
|
32115
|
-
|
|
32116
32146
|
case 12:
|
|
32117
32147
|
inputStream = _a;
|
|
32118
32148
|
params = {
|
|
@@ -32123,14 +32153,9 @@ function (_super) {
|
|
|
32123
32153
|
accept: 'audio/mpeg',
|
|
32124
32154
|
inputStream: inputStream
|
|
32125
32155
|
};
|
|
32126
|
-
return [3
|
|
32127
|
-
/*break*/
|
|
32128
|
-
, 14];
|
|
32129
|
-
|
|
32156
|
+
return [3 /*break*/, 14];
|
|
32130
32157
|
case 13:
|
|
32131
|
-
if (typeof content !== 'string') return [2
|
|
32132
|
-
/*return*/
|
|
32133
|
-
, Promise.reject('invalid content type')];
|
|
32158
|
+
if (typeof content !== 'string') return [2 /*return*/, Promise.reject('invalid content type')];
|
|
32134
32159
|
params = {
|
|
32135
32160
|
botAlias: this._config[botname].alias,
|
|
32136
32161
|
botName: botname,
|
|
@@ -32140,58 +32165,35 @@ function (_super) {
|
|
|
32140
32165
|
accept: 'audio/mpeg'
|
|
32141
32166
|
};
|
|
32142
32167
|
_c.label = 14;
|
|
32143
|
-
|
|
32144
32168
|
case 14:
|
|
32145
32169
|
logger.debug('postContent to lex', message);
|
|
32146
32170
|
_c.label = 15;
|
|
32147
|
-
|
|
32148
32171
|
case 15:
|
|
32149
32172
|
_c.trys.push([15, 20,, 21]);
|
|
32150
|
-
|
|
32151
32173
|
postContentCommand = new _aws_sdk_client_lex_runtime_service__WEBPACK_IMPORTED_MODULE_1__["PostContentCommand"](params);
|
|
32152
|
-
return [4
|
|
32153
|
-
/*yield*/
|
|
32154
|
-
, this.lexRuntimeServiceClient.send(postContentCommand)];
|
|
32155
|
-
|
|
32174
|
+
return [4 /*yield*/, this.lexRuntimeServiceClient.send(postContentCommand)];
|
|
32156
32175
|
case 16:
|
|
32157
32176
|
data = _c.sent();
|
|
32158
|
-
if (!data.audioStream) return [3
|
|
32159
|
-
/*
|
|
32160
|
-
, 18];
|
|
32161
|
-
return [4
|
|
32162
|
-
/*yield*/
|
|
32163
|
-
, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(data.audioStream)];
|
|
32164
|
-
|
|
32177
|
+
if (!data.audioStream) return [3 /*break*/, 18];
|
|
32178
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(data.audioStream)];
|
|
32165
32179
|
case 17:
|
|
32166
32180
|
_b = _c.sent();
|
|
32167
|
-
return [3
|
|
32168
|
-
/*break*/
|
|
32169
|
-
, 19];
|
|
32170
|
-
|
|
32181
|
+
return [3 /*break*/, 19];
|
|
32171
32182
|
case 18:
|
|
32172
32183
|
_b = undefined;
|
|
32173
32184
|
_c.label = 19;
|
|
32174
|
-
|
|
32175
32185
|
case 19:
|
|
32176
32186
|
audioArray = _b;
|
|
32177
32187
|
response = __assign(__assign({}, data), {
|
|
32178
32188
|
audioStream: audioArray
|
|
32179
32189
|
});
|
|
32180
32190
|
this.reportBotStatus(response, botname);
|
|
32181
|
-
return [2
|
|
32182
|
-
/*return*/
|
|
32183
|
-
, response];
|
|
32184
|
-
|
|
32191
|
+
return [2 /*return*/, response];
|
|
32185
32192
|
case 20:
|
|
32186
32193
|
err_2 = _c.sent();
|
|
32187
|
-
return [2
|
|
32188
|
-
/*return*/
|
|
32189
|
-
, Promise.reject(err_2)];
|
|
32190
|
-
|
|
32194
|
+
return [2 /*return*/, Promise.reject(err_2)];
|
|
32191
32195
|
case 21:
|
|
32192
|
-
return [2
|
|
32193
|
-
/*return*/
|
|
32194
|
-
];
|
|
32196
|
+
return [2 /*return*/];
|
|
32195
32197
|
}
|
|
32196
32198
|
});
|
|
32197
32199
|
});
|
|
@@ -32202,15 +32204,12 @@ function (_super) {
|
|
|
32202
32204
|
if (!this._config[botname]) {
|
|
32203
32205
|
throw new Error('Bot ' + botname + ' does not exist');
|
|
32204
32206
|
}
|
|
32205
|
-
|
|
32206
32207
|
this._botsCompleteCallback[botname] = callback;
|
|
32207
32208
|
};
|
|
32208
|
-
|
|
32209
32209
|
return AWSLexProvider;
|
|
32210
32210
|
}(_InteractionsProvider__WEBPACK_IMPORTED_MODULE_0__["AbstractInteractionsProvider"]);
|
|
32211
32211
|
|
|
32212
32212
|
|
|
32213
|
-
|
|
32214
32213
|
/***/ }),
|
|
32215
32214
|
|
|
32216
32215
|
/***/ "./lib-esm/Providers/AWSLexProviderHelper/commonUtils.js":
|
|
@@ -32230,7 +32229,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32230
32229
|
resolve(value);
|
|
32231
32230
|
});
|
|
32232
32231
|
}
|
|
32233
|
-
|
|
32234
32232
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32235
32233
|
function fulfilled(value) {
|
|
32236
32234
|
try {
|
|
@@ -32239,7 +32237,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32239
32237
|
reject(e);
|
|
32240
32238
|
}
|
|
32241
32239
|
}
|
|
32242
|
-
|
|
32243
32240
|
function rejected(value) {
|
|
32244
32241
|
try {
|
|
32245
32242
|
step(generator["throw"](value));
|
|
@@ -32247,29 +32244,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32247
32244
|
reject(e);
|
|
32248
32245
|
}
|
|
32249
32246
|
}
|
|
32250
|
-
|
|
32251
32247
|
function step(result) {
|
|
32252
32248
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
32253
32249
|
}
|
|
32254
|
-
|
|
32255
32250
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32256
32251
|
});
|
|
32257
32252
|
};
|
|
32258
|
-
|
|
32259
32253
|
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
32260
32254
|
var _ = {
|
|
32261
|
-
|
|
32262
|
-
|
|
32263
|
-
|
|
32264
|
-
|
|
32255
|
+
label: 0,
|
|
32256
|
+
sent: function sent() {
|
|
32257
|
+
if (t[0] & 1) throw t[1];
|
|
32258
|
+
return t[1];
|
|
32259
|
+
},
|
|
32260
|
+
trys: [],
|
|
32261
|
+
ops: []
|
|
32265
32262
|
},
|
|
32266
|
-
|
|
32267
|
-
|
|
32268
|
-
|
|
32269
|
-
|
|
32270
|
-
y,
|
|
32271
|
-
t,
|
|
32272
|
-
g;
|
|
32263
|
+
f,
|
|
32264
|
+
y,
|
|
32265
|
+
t,
|
|
32266
|
+
g;
|
|
32273
32267
|
return g = {
|
|
32274
32268
|
next: verb(0),
|
|
32275
32269
|
"throw": verb(1),
|
|
@@ -32277,79 +32271,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32277
32271
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
32278
32272
|
return this;
|
|
32279
32273
|
}), g;
|
|
32280
|
-
|
|
32281
32274
|
function verb(n) {
|
|
32282
32275
|
return function (v) {
|
|
32283
32276
|
return step([n, v]);
|
|
32284
32277
|
};
|
|
32285
32278
|
}
|
|
32286
|
-
|
|
32287
32279
|
function step(op) {
|
|
32288
32280
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32289
|
-
|
|
32290
32281
|
while (_) {
|
|
32291
32282
|
try {
|
|
32292
32283
|
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;
|
|
32293
32284
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32294
|
-
|
|
32295
32285
|
switch (op[0]) {
|
|
32296
32286
|
case 0:
|
|
32297
32287
|
case 1:
|
|
32298
32288
|
t = op;
|
|
32299
32289
|
break;
|
|
32300
|
-
|
|
32301
32290
|
case 4:
|
|
32302
32291
|
_.label++;
|
|
32303
32292
|
return {
|
|
32304
32293
|
value: op[1],
|
|
32305
32294
|
done: false
|
|
32306
32295
|
};
|
|
32307
|
-
|
|
32308
32296
|
case 5:
|
|
32309
32297
|
_.label++;
|
|
32310
32298
|
y = op[1];
|
|
32311
32299
|
op = [0];
|
|
32312
32300
|
continue;
|
|
32313
|
-
|
|
32314
32301
|
case 7:
|
|
32315
32302
|
op = _.ops.pop();
|
|
32316
|
-
|
|
32317
32303
|
_.trys.pop();
|
|
32318
|
-
|
|
32319
32304
|
continue;
|
|
32320
|
-
|
|
32321
32305
|
default:
|
|
32322
32306
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
32323
32307
|
_ = 0;
|
|
32324
32308
|
continue;
|
|
32325
32309
|
}
|
|
32326
|
-
|
|
32327
32310
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
32328
32311
|
_.label = op[1];
|
|
32329
32312
|
break;
|
|
32330
32313
|
}
|
|
32331
|
-
|
|
32332
32314
|
if (op[0] === 6 && _.label < t[1]) {
|
|
32333
32315
|
_.label = t[1];
|
|
32334
32316
|
t = op;
|
|
32335
32317
|
break;
|
|
32336
32318
|
}
|
|
32337
|
-
|
|
32338
32319
|
if (t && _.label < t[2]) {
|
|
32339
32320
|
_.label = t[2];
|
|
32340
|
-
|
|
32341
32321
|
_.ops.push(op);
|
|
32342
|
-
|
|
32343
32322
|
break;
|
|
32344
32323
|
}
|
|
32345
|
-
|
|
32346
32324
|
if (t[2]) _.ops.pop();
|
|
32347
|
-
|
|
32348
32325
|
_.trys.pop();
|
|
32349
|
-
|
|
32350
32326
|
continue;
|
|
32351
32327
|
}
|
|
32352
|
-
|
|
32353
32328
|
op = body.call(thisArg, _);
|
|
32354
32329
|
} catch (e) {
|
|
32355
32330
|
op = [6, e];
|
|
@@ -32358,7 +32333,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32358
32333
|
f = t = 0;
|
|
32359
32334
|
}
|
|
32360
32335
|
}
|
|
32361
|
-
|
|
32362
32336
|
if (op[0] & 5) throw op[1];
|
|
32363
32337
|
return {
|
|
32364
32338
|
value: op[0] ? op[1] : void 0,
|
|
@@ -32379,43 +32353,26 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32379
32353
|
* and limitations under the License.
|
|
32380
32354
|
*/
|
|
32381
32355
|
|
|
32382
|
-
|
|
32383
|
-
|
|
32384
32356
|
var unGzipBase64AsJson = function unGzipBase64AsJson(gzipBase64) {
|
|
32385
32357
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
32386
32358
|
var decodedArrayBuffer, objString, error_1;
|
|
32387
32359
|
return __generator(this, function (_a) {
|
|
32388
32360
|
switch (_a.label) {
|
|
32389
32361
|
case 0:
|
|
32390
|
-
if (typeof gzipBase64 === 'undefined') return [2
|
|
32391
|
-
/*return*/
|
|
32392
|
-
, undefined];
|
|
32362
|
+
if (typeof gzipBase64 === 'undefined') return [2 /*return*/, undefined];
|
|
32393
32363
|
_a.label = 1;
|
|
32394
|
-
|
|
32395
32364
|
case 1:
|
|
32396
32365
|
_a.trys.push([1, 3,, 4]);
|
|
32397
|
-
|
|
32398
32366
|
decodedArrayBuffer = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["base64ToArrayBuffer"])(gzipBase64);
|
|
32399
|
-
return [4
|
|
32400
|
-
/*yield*/
|
|
32401
|
-
, Object(_utils__WEBPACK_IMPORTED_MODULE_0__["gzipDecompressToString"])(decodedArrayBuffer)];
|
|
32402
|
-
|
|
32367
|
+
return [4 /*yield*/, Object(_utils__WEBPACK_IMPORTED_MODULE_0__["gzipDecompressToString"])(decodedArrayBuffer)];
|
|
32403
32368
|
case 2:
|
|
32404
32369
|
objString = _a.sent();
|
|
32405
|
-
return [2
|
|
32406
|
-
/*return*/
|
|
32407
|
-
, JSON.parse(objString)];
|
|
32408
|
-
|
|
32370
|
+
return [2 /*return*/, JSON.parse(objString)];
|
|
32409
32371
|
case 3:
|
|
32410
32372
|
error_1 = _a.sent();
|
|
32411
|
-
return [2
|
|
32412
|
-
/*return*/
|
|
32413
|
-
, Promise.reject('unable to decode and decompress ' + error_1)];
|
|
32414
|
-
|
|
32373
|
+
return [2 /*return*/, Promise.reject('unable to decode and decompress ' + error_1)];
|
|
32415
32374
|
case 4:
|
|
32416
|
-
return [2
|
|
32417
|
-
/*return*/
|
|
32418
|
-
];
|
|
32375
|
+
return [2 /*return*/];
|
|
32419
32376
|
}
|
|
32420
32377
|
});
|
|
32421
32378
|
});
|
|
@@ -32454,7 +32411,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32454
32411
|
resolve(value);
|
|
32455
32412
|
});
|
|
32456
32413
|
}
|
|
32457
|
-
|
|
32458
32414
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32459
32415
|
function fulfilled(value) {
|
|
32460
32416
|
try {
|
|
@@ -32463,7 +32419,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32463
32419
|
reject(e);
|
|
32464
32420
|
}
|
|
32465
32421
|
}
|
|
32466
|
-
|
|
32467
32422
|
function rejected(value) {
|
|
32468
32423
|
try {
|
|
32469
32424
|
step(generator["throw"](value));
|
|
@@ -32471,29 +32426,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32471
32426
|
reject(e);
|
|
32472
32427
|
}
|
|
32473
32428
|
}
|
|
32474
|
-
|
|
32475
32429
|
function step(result) {
|
|
32476
32430
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
32477
32431
|
}
|
|
32478
|
-
|
|
32479
32432
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32480
32433
|
});
|
|
32481
32434
|
};
|
|
32482
|
-
|
|
32483
32435
|
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
32484
32436
|
var _ = {
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32488
|
-
|
|
32437
|
+
label: 0,
|
|
32438
|
+
sent: function sent() {
|
|
32439
|
+
if (t[0] & 1) throw t[1];
|
|
32440
|
+
return t[1];
|
|
32441
|
+
},
|
|
32442
|
+
trys: [],
|
|
32443
|
+
ops: []
|
|
32489
32444
|
},
|
|
32490
|
-
|
|
32491
|
-
|
|
32492
|
-
|
|
32493
|
-
|
|
32494
|
-
y,
|
|
32495
|
-
t,
|
|
32496
|
-
g;
|
|
32445
|
+
f,
|
|
32446
|
+
y,
|
|
32447
|
+
t,
|
|
32448
|
+
g;
|
|
32497
32449
|
return g = {
|
|
32498
32450
|
next: verb(0),
|
|
32499
32451
|
"throw": verb(1),
|
|
@@ -32501,79 +32453,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32501
32453
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
32502
32454
|
return this;
|
|
32503
32455
|
}), g;
|
|
32504
|
-
|
|
32505
32456
|
function verb(n) {
|
|
32506
32457
|
return function (v) {
|
|
32507
32458
|
return step([n, v]);
|
|
32508
32459
|
};
|
|
32509
32460
|
}
|
|
32510
|
-
|
|
32511
32461
|
function step(op) {
|
|
32512
32462
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32513
|
-
|
|
32514
32463
|
while (_) {
|
|
32515
32464
|
try {
|
|
32516
32465
|
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;
|
|
32517
32466
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32518
|
-
|
|
32519
32467
|
switch (op[0]) {
|
|
32520
32468
|
case 0:
|
|
32521
32469
|
case 1:
|
|
32522
32470
|
t = op;
|
|
32523
32471
|
break;
|
|
32524
|
-
|
|
32525
32472
|
case 4:
|
|
32526
32473
|
_.label++;
|
|
32527
32474
|
return {
|
|
32528
32475
|
value: op[1],
|
|
32529
32476
|
done: false
|
|
32530
32477
|
};
|
|
32531
|
-
|
|
32532
32478
|
case 5:
|
|
32533
32479
|
_.label++;
|
|
32534
32480
|
y = op[1];
|
|
32535
32481
|
op = [0];
|
|
32536
32482
|
continue;
|
|
32537
|
-
|
|
32538
32483
|
case 7:
|
|
32539
32484
|
op = _.ops.pop();
|
|
32540
|
-
|
|
32541
32485
|
_.trys.pop();
|
|
32542
|
-
|
|
32543
32486
|
continue;
|
|
32544
|
-
|
|
32545
32487
|
default:
|
|
32546
32488
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
32547
32489
|
_ = 0;
|
|
32548
32490
|
continue;
|
|
32549
32491
|
}
|
|
32550
|
-
|
|
32551
32492
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
32552
32493
|
_.label = op[1];
|
|
32553
32494
|
break;
|
|
32554
32495
|
}
|
|
32555
|
-
|
|
32556
32496
|
if (op[0] === 6 && _.label < t[1]) {
|
|
32557
32497
|
_.label = t[1];
|
|
32558
32498
|
t = op;
|
|
32559
32499
|
break;
|
|
32560
32500
|
}
|
|
32561
|
-
|
|
32562
32501
|
if (t && _.label < t[2]) {
|
|
32563
32502
|
_.label = t[2];
|
|
32564
|
-
|
|
32565
32503
|
_.ops.push(op);
|
|
32566
|
-
|
|
32567
32504
|
break;
|
|
32568
32505
|
}
|
|
32569
|
-
|
|
32570
32506
|
if (t[2]) _.ops.pop();
|
|
32571
|
-
|
|
32572
32507
|
_.trys.pop();
|
|
32573
|
-
|
|
32574
32508
|
continue;
|
|
32575
32509
|
}
|
|
32576
|
-
|
|
32577
32510
|
op = body.call(thisArg, _);
|
|
32578
32511
|
} catch (e) {
|
|
32579
32512
|
op = [6, e];
|
|
@@ -32582,7 +32515,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32582
32515
|
f = t = 0;
|
|
32583
32516
|
}
|
|
32584
32517
|
}
|
|
32585
|
-
|
|
32586
32518
|
if (op[0] & 5) throw op[1];
|
|
32587
32519
|
return {
|
|
32588
32520
|
value: op[0] ? op[1] : void 0,
|
|
@@ -32591,28 +32523,21 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32591
32523
|
}
|
|
32592
32524
|
};
|
|
32593
32525
|
|
|
32594
|
-
|
|
32595
32526
|
var convert = function convert(stream) {
|
|
32596
32527
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
32597
32528
|
return __generator(this, function (_a) {
|
|
32598
32529
|
if (stream instanceof Blob || stream instanceof ReadableStream) {
|
|
32599
|
-
return [2
|
|
32600
|
-
/*return*/
|
|
32601
|
-
, new Response(stream).arrayBuffer().then(function (buffer) {
|
|
32530
|
+
return [2 /*return*/, new Response(stream).arrayBuffer().then(function (buffer) {
|
|
32602
32531
|
return new Uint8Array(buffer);
|
|
32603
32532
|
})];
|
|
32604
32533
|
} else {
|
|
32605
|
-
return [2
|
|
32606
|
-
/*return*/
|
|
32607
|
-
, Promise.reject('Invalid content type')];
|
|
32534
|
+
return [2 /*return*/, Promise.reject('Invalid content type')];
|
|
32608
32535
|
}
|
|
32609
|
-
|
|
32610
|
-
return [2
|
|
32611
|
-
/*return*/
|
|
32612
|
-
];
|
|
32536
|
+
return [2 /*return*/];
|
|
32613
32537
|
});
|
|
32614
32538
|
});
|
|
32615
32539
|
};
|
|
32540
|
+
|
|
32616
32541
|
var base64ToArrayBuffer = function base64ToArrayBuffer(base64) {
|
|
32617
32542
|
return Uint8Array.from(window.atob(base64), function (c) {
|
|
32618
32543
|
return c.charCodeAt(0);
|
|
@@ -32623,18 +32548,13 @@ var gzipDecompressToString = function gzipDecompressToString(data) {
|
|
|
32623
32548
|
return __generator(this, function (_a) {
|
|
32624
32549
|
switch (_a.label) {
|
|
32625
32550
|
case 0:
|
|
32626
|
-
return [4
|
|
32627
|
-
/*yield*/
|
|
32628
|
-
, new Promise(function (resolve, reject) {
|
|
32551
|
+
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
|
32629
32552
|
Object(fflate__WEBPACK_IMPORTED_MODULE_0__["gunzip"])(data, function (err, resp) {
|
|
32630
32553
|
if (err) reject(err);else resolve(Object(fflate__WEBPACK_IMPORTED_MODULE_0__["strFromU8"])(resp));
|
|
32631
32554
|
});
|
|
32632
32555
|
})];
|
|
32633
|
-
|
|
32634
32556
|
case 1:
|
|
32635
|
-
return [2
|
|
32636
|
-
/*return*/
|
|
32637
|
-
, _a.sent()];
|
|
32557
|
+
return [2 /*return*/, _a.sent()];
|
|
32638
32558
|
}
|
|
32639
32559
|
});
|
|
32640
32560
|
});
|
|
@@ -32667,7 +32587,6 @@ function _typeof(obj) {
|
|
|
32667
32587
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
32668
32588
|
}, _typeof(obj);
|
|
32669
32589
|
}
|
|
32670
|
-
|
|
32671
32590
|
var __extends = undefined && undefined.__extends || function () {
|
|
32672
32591
|
var _extendStatics = function extendStatics(d, b) {
|
|
32673
32592
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -32679,44 +32598,34 @@ var __extends = undefined && undefined.__extends || function () {
|
|
|
32679
32598
|
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
32680
32599
|
}
|
|
32681
32600
|
};
|
|
32682
|
-
|
|
32683
32601
|
return _extendStatics(d, b);
|
|
32684
32602
|
};
|
|
32685
|
-
|
|
32686
32603
|
return function (d, b) {
|
|
32687
32604
|
_extendStatics(d, b);
|
|
32688
|
-
|
|
32689
32605
|
function __() {
|
|
32690
32606
|
this.constructor = d;
|
|
32691
32607
|
}
|
|
32692
|
-
|
|
32693
32608
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
32694
32609
|
};
|
|
32695
32610
|
}();
|
|
32696
|
-
|
|
32697
32611
|
var __assign = undefined && undefined.__assign || function () {
|
|
32698
32612
|
__assign = Object.assign || function (t) {
|
|
32699
32613
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
32700
32614
|
s = arguments[i];
|
|
32701
|
-
|
|
32702
32615
|
for (var p in s) {
|
|
32703
32616
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
32704
32617
|
}
|
|
32705
32618
|
}
|
|
32706
|
-
|
|
32707
32619
|
return t;
|
|
32708
32620
|
};
|
|
32709
|
-
|
|
32710
32621
|
return __assign.apply(this, arguments);
|
|
32711
32622
|
};
|
|
32712
|
-
|
|
32713
32623
|
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
32714
32624
|
function adopt(value) {
|
|
32715
32625
|
return value instanceof P ? value : new P(function (resolve) {
|
|
32716
32626
|
resolve(value);
|
|
32717
32627
|
});
|
|
32718
32628
|
}
|
|
32719
|
-
|
|
32720
32629
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32721
32630
|
function fulfilled(value) {
|
|
32722
32631
|
try {
|
|
@@ -32725,7 +32634,6 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32725
32634
|
reject(e);
|
|
32726
32635
|
}
|
|
32727
32636
|
}
|
|
32728
|
-
|
|
32729
32637
|
function rejected(value) {
|
|
32730
32638
|
try {
|
|
32731
32639
|
step(generator["throw"](value));
|
|
@@ -32733,29 +32641,26 @@ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _argument
|
|
|
32733
32641
|
reject(e);
|
|
32734
32642
|
}
|
|
32735
32643
|
}
|
|
32736
|
-
|
|
32737
32644
|
function step(result) {
|
|
32738
32645
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
32739
32646
|
}
|
|
32740
|
-
|
|
32741
32647
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32742
32648
|
});
|
|
32743
32649
|
};
|
|
32744
|
-
|
|
32745
32650
|
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
32746
32651
|
var _ = {
|
|
32747
|
-
|
|
32748
|
-
|
|
32749
|
-
|
|
32750
|
-
|
|
32652
|
+
label: 0,
|
|
32653
|
+
sent: function sent() {
|
|
32654
|
+
if (t[0] & 1) throw t[1];
|
|
32655
|
+
return t[1];
|
|
32656
|
+
},
|
|
32657
|
+
trys: [],
|
|
32658
|
+
ops: []
|
|
32751
32659
|
},
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
y,
|
|
32757
|
-
t,
|
|
32758
|
-
g;
|
|
32660
|
+
f,
|
|
32661
|
+
y,
|
|
32662
|
+
t,
|
|
32663
|
+
g;
|
|
32759
32664
|
return g = {
|
|
32760
32665
|
next: verb(0),
|
|
32761
32666
|
"throw": verb(1),
|
|
@@ -32763,79 +32668,60 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32763
32668
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
32764
32669
|
return this;
|
|
32765
32670
|
}), g;
|
|
32766
|
-
|
|
32767
32671
|
function verb(n) {
|
|
32768
32672
|
return function (v) {
|
|
32769
32673
|
return step([n, v]);
|
|
32770
32674
|
};
|
|
32771
32675
|
}
|
|
32772
|
-
|
|
32773
32676
|
function step(op) {
|
|
32774
32677
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32775
|
-
|
|
32776
32678
|
while (_) {
|
|
32777
32679
|
try {
|
|
32778
32680
|
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;
|
|
32779
32681
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32780
|
-
|
|
32781
32682
|
switch (op[0]) {
|
|
32782
32683
|
case 0:
|
|
32783
32684
|
case 1:
|
|
32784
32685
|
t = op;
|
|
32785
32686
|
break;
|
|
32786
|
-
|
|
32787
32687
|
case 4:
|
|
32788
32688
|
_.label++;
|
|
32789
32689
|
return {
|
|
32790
32690
|
value: op[1],
|
|
32791
32691
|
done: false
|
|
32792
32692
|
};
|
|
32793
|
-
|
|
32794
32693
|
case 5:
|
|
32795
32694
|
_.label++;
|
|
32796
32695
|
y = op[1];
|
|
32797
32696
|
op = [0];
|
|
32798
32697
|
continue;
|
|
32799
|
-
|
|
32800
32698
|
case 7:
|
|
32801
32699
|
op = _.ops.pop();
|
|
32802
|
-
|
|
32803
32700
|
_.trys.pop();
|
|
32804
|
-
|
|
32805
32701
|
continue;
|
|
32806
|
-
|
|
32807
32702
|
default:
|
|
32808
32703
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
32809
32704
|
_ = 0;
|
|
32810
32705
|
continue;
|
|
32811
32706
|
}
|
|
32812
|
-
|
|
32813
32707
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
32814
32708
|
_.label = op[1];
|
|
32815
32709
|
break;
|
|
32816
32710
|
}
|
|
32817
|
-
|
|
32818
32711
|
if (op[0] === 6 && _.label < t[1]) {
|
|
32819
32712
|
_.label = t[1];
|
|
32820
32713
|
t = op;
|
|
32821
32714
|
break;
|
|
32822
32715
|
}
|
|
32823
|
-
|
|
32824
32716
|
if (t && _.label < t[2]) {
|
|
32825
32717
|
_.label = t[2];
|
|
32826
|
-
|
|
32827
32718
|
_.ops.push(op);
|
|
32828
|
-
|
|
32829
32719
|
break;
|
|
32830
32720
|
}
|
|
32831
|
-
|
|
32832
32721
|
if (t[2]) _.ops.pop();
|
|
32833
|
-
|
|
32834
32722
|
_.trys.pop();
|
|
32835
|
-
|
|
32836
32723
|
continue;
|
|
32837
32724
|
}
|
|
32838
|
-
|
|
32839
32725
|
op = body.call(thisArg, _);
|
|
32840
32726
|
} catch (e) {
|
|
32841
32727
|
op = [6, e];
|
|
@@ -32844,7 +32730,6 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32844
32730
|
f = t = 0;
|
|
32845
32731
|
}
|
|
32846
32732
|
}
|
|
32847
|
-
|
|
32848
32733
|
if (op[0] & 5) throw op[1];
|
|
32849
32734
|
return {
|
|
32850
32735
|
value: op[0] ? op[1] : void 0,
|
|
@@ -32869,27 +32754,18 @@ var __generator = undefined && undefined.__generator || function (thisArg, body)
|
|
|
32869
32754
|
|
|
32870
32755
|
|
|
32871
32756
|
|
|
32872
|
-
|
|
32873
|
-
|
|
32874
32757
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('AWSLexV2Provider');
|
|
32875
|
-
|
|
32876
|
-
var AWSLexV2Provider =
|
|
32877
|
-
/** @class */
|
|
32878
|
-
function (_super) {
|
|
32758
|
+
var AWSLexV2Provider = /** @class */function (_super) {
|
|
32879
32759
|
__extends(AWSLexV2Provider, _super);
|
|
32880
32760
|
/**
|
|
32881
32761
|
* Initialize Interactions with AWS configurations
|
|
32882
32762
|
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
32883
32763
|
*/
|
|
32884
|
-
|
|
32885
|
-
|
|
32886
32764
|
function AWSLexV2Provider(options) {
|
|
32887
32765
|
if (options === void 0) {
|
|
32888
32766
|
options = {};
|
|
32889
32767
|
}
|
|
32890
|
-
|
|
32891
32768
|
var _this = _super.call(this, options) || this;
|
|
32892
|
-
|
|
32893
32769
|
_this._botsCompleteCallback = {};
|
|
32894
32770
|
return _this;
|
|
32895
32771
|
}
|
|
@@ -32897,8 +32773,6 @@ function (_super) {
|
|
|
32897
32773
|
* get provider name of the plugin
|
|
32898
32774
|
* @returns {string} name of the provider
|
|
32899
32775
|
*/
|
|
32900
|
-
|
|
32901
|
-
|
|
32902
32776
|
AWSLexV2Provider.prototype.getProviderName = function () {
|
|
32903
32777
|
return 'AWSLexV2Provider';
|
|
32904
32778
|
};
|
|
@@ -32907,17 +32781,14 @@ function (_super) {
|
|
|
32907
32781
|
* @param {AWSLexV2ProviderOptions} config - Configuration of the Interactions
|
|
32908
32782
|
* @return {AWSLexV2ProviderOptions} - Current configuration
|
|
32909
32783
|
*/
|
|
32910
|
-
|
|
32911
|
-
|
|
32912
32784
|
AWSLexV2Provider.prototype.configure = function (config) {
|
|
32913
32785
|
if (config === void 0) {
|
|
32914
32786
|
config = {};
|
|
32915
32787
|
}
|
|
32916
|
-
|
|
32917
32788
|
var propertiesToTest = ['name', 'botId', 'aliasId', 'localeId', 'providerName', 'region'];
|
|
32918
32789
|
Object.keys(config).forEach(function (botKey) {
|
|
32919
|
-
var botConfig = config[botKey];
|
|
32920
|
-
|
|
32790
|
+
var botConfig = config[botKey];
|
|
32791
|
+
// is bot config correct
|
|
32921
32792
|
if (!propertiesToTest.every(function (x) {
|
|
32922
32793
|
return x in botConfig;
|
|
32923
32794
|
})) {
|
|
@@ -32933,8 +32804,6 @@ function (_super) {
|
|
|
32933
32804
|
* @param {string | InteractionsMessage} message - message to send to the bot
|
|
32934
32805
|
* @return {Promise<InteractionsResponse>} A promise resolves to the response from the bot
|
|
32935
32806
|
*/
|
|
32936
|
-
|
|
32937
|
-
|
|
32938
32807
|
AWSLexV2Provider.prototype.sendMessage = function (botname, message) {
|
|
32939
32808
|
return __awaiter(this, void 0, void 0, function () {
|
|
32940
32809
|
var credentials, error_1, response, reqBaseParams;
|
|
@@ -32943,32 +32812,18 @@ function (_super) {
|
|
|
32943
32812
|
case 0:
|
|
32944
32813
|
// check if bot exists
|
|
32945
32814
|
if (!this._config[botname]) {
|
|
32946
|
-
return [2
|
|
32947
|
-
/*return*/
|
|
32948
|
-
, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
32815
|
+
return [2 /*return*/, Promise.reject('Bot ' + botname + ' does not exist')];
|
|
32949
32816
|
}
|
|
32950
|
-
|
|
32951
32817
|
_a.label = 1;
|
|
32952
|
-
|
|
32953
32818
|
case 1:
|
|
32954
32819
|
_a.trys.push([1, 3,, 4]);
|
|
32955
|
-
|
|
32956
|
-
return [4
|
|
32957
|
-
/*yield*/
|
|
32958
|
-
, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Credentials"].get()];
|
|
32959
|
-
|
|
32820
|
+
return [4 /*yield*/, _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["Credentials"].get()];
|
|
32960
32821
|
case 2:
|
|
32961
32822
|
credentials = _a.sent();
|
|
32962
|
-
return [3
|
|
32963
|
-
/*break*/
|
|
32964
|
-
, 4];
|
|
32965
|
-
|
|
32823
|
+
return [3 /*break*/, 4];
|
|
32966
32824
|
case 3:
|
|
32967
32825
|
error_1 = _a.sent();
|
|
32968
|
-
return [2
|
|
32969
|
-
/*return*/
|
|
32970
|
-
, Promise.reject('No credentials')];
|
|
32971
|
-
|
|
32826
|
+
return [2 /*return*/, Promise.reject('No credentials')];
|
|
32972
32827
|
case 4:
|
|
32973
32828
|
this._lexRuntimeServiceV2Client = new _aws_sdk_client_lex_runtime_v2__WEBPACK_IMPORTED_MODULE_1__["LexRuntimeV2Client"]({
|
|
32974
32829
|
region: this._config[botname].region,
|
|
@@ -32981,32 +32836,18 @@ function (_super) {
|
|
|
32981
32836
|
localeId: this._config[botname].localeId,
|
|
32982
32837
|
sessionId: credentials.identityId
|
|
32983
32838
|
};
|
|
32984
|
-
if (!(typeof message === 'string')) return [3
|
|
32985
|
-
/*
|
|
32986
|
-
, 6];
|
|
32987
|
-
return [4
|
|
32988
|
-
/*yield*/
|
|
32989
|
-
, this._handleRecognizeTextCommand(botname, message, reqBaseParams)];
|
|
32990
|
-
|
|
32839
|
+
if (!(typeof message === 'string')) return [3 /*break*/, 6];
|
|
32840
|
+
return [4 /*yield*/, this._handleRecognizeTextCommand(botname, message, reqBaseParams)];
|
|
32991
32841
|
case 5:
|
|
32992
32842
|
response = _a.sent();
|
|
32993
|
-
return [3
|
|
32994
|
-
/*break*/
|
|
32995
|
-
, 8];
|
|
32996
|
-
|
|
32843
|
+
return [3 /*break*/, 8];
|
|
32997
32844
|
case 6:
|
|
32998
|
-
return [4
|
|
32999
|
-
/*yield*/
|
|
33000
|
-
, this._handleRecognizeUtteranceCommand(botname, message, reqBaseParams)];
|
|
33001
|
-
|
|
32845
|
+
return [4 /*yield*/, this._handleRecognizeUtteranceCommand(botname, message, reqBaseParams)];
|
|
33002
32846
|
case 7:
|
|
33003
32847
|
response = _a.sent();
|
|
33004
32848
|
_a.label = 8;
|
|
33005
|
-
|
|
33006
32849
|
case 8:
|
|
33007
|
-
return [2
|
|
33008
|
-
/*return*/
|
|
33009
|
-
, response];
|
|
32850
|
+
return [2 /*return*/, response];
|
|
33010
32851
|
}
|
|
33011
32852
|
});
|
|
33012
32853
|
});
|
|
@@ -33017,60 +32858,47 @@ function (_super) {
|
|
|
33017
32858
|
* @param {string} botname - Bot name to attach the onComplete callback
|
|
33018
32859
|
* @param {(err: Error | null, confirmation: InteractionsResponse) => void} callback - called when Intent Fulfilled
|
|
33019
32860
|
*/
|
|
33020
|
-
|
|
33021
|
-
|
|
33022
32861
|
AWSLexV2Provider.prototype.onComplete = function (botname, callback) {
|
|
33023
32862
|
// does bot exist
|
|
33024
32863
|
if (!this._config[botname]) {
|
|
33025
32864
|
throw new Error('Bot ' + botname + ' does not exist');
|
|
33026
32865
|
}
|
|
33027
|
-
|
|
33028
32866
|
this._botsCompleteCallback[botname] = callback;
|
|
33029
32867
|
};
|
|
33030
32868
|
/**
|
|
33031
32869
|
* @private
|
|
33032
32870
|
* call onComplete callback for a bot if configured
|
|
33033
32871
|
*/
|
|
33034
|
-
|
|
33035
|
-
|
|
33036
32872
|
AWSLexV2Provider.prototype._reportBotStatus = function (data, botname) {
|
|
33037
32873
|
var _this = this;
|
|
33038
|
-
|
|
33039
32874
|
var _a, _b, _c, _d, _e, _f;
|
|
33040
|
-
|
|
33041
|
-
|
|
33042
|
-
|
|
32875
|
+
var sessionState = data === null || data === void 0 ? void 0 : data.sessionState;
|
|
32876
|
+
// Check if state is fulfilled to resolve onFullfilment promise
|
|
33043
32877
|
logger.debug('postContent state', (_a = sessionState === null || sessionState === void 0 ? void 0 : sessionState.intent) === null || _a === void 0 ? void 0 : _a.state);
|
|
33044
32878
|
var isConfigOnCompleteAttached = typeof ((_b = this._config) === null || _b === void 0 ? void 0 : _b[botname].onComplete) === 'function';
|
|
33045
|
-
var isApiOnCompleteAttached = typeof ((_c = this._botsCompleteCallback) === null || _c === void 0 ? void 0 : _c[botname]) === 'function';
|
|
33046
|
-
|
|
32879
|
+
var isApiOnCompleteAttached = typeof ((_c = this._botsCompleteCallback) === null || _c === void 0 ? void 0 : _c[botname]) === 'function';
|
|
32880
|
+
// no onComplete callbacks added
|
|
33047
32881
|
if (!isConfigOnCompleteAttached && !isApiOnCompleteAttached) return;
|
|
33048
|
-
|
|
33049
32882
|
if (((_d = sessionState === null || sessionState === void 0 ? void 0 : sessionState.intent) === null || _d === void 0 ? void 0 : _d.state) === 'ReadyForFulfillment' || ((_e = sessionState === null || sessionState === void 0 ? void 0 : sessionState.intent) === null || _e === void 0 ? void 0 : _e.state) === 'Fulfilled') {
|
|
33050
32883
|
if (isApiOnCompleteAttached) {
|
|
33051
32884
|
setTimeout(function () {
|
|
33052
32885
|
var _a;
|
|
33053
|
-
|
|
33054
32886
|
return (_a = _this._botsCompleteCallback) === null || _a === void 0 ? void 0 : _a[botname](null, data);
|
|
33055
32887
|
}, 0);
|
|
33056
32888
|
}
|
|
33057
|
-
|
|
33058
32889
|
if (isConfigOnCompleteAttached) {
|
|
33059
32890
|
setTimeout(function () {
|
|
33060
32891
|
return _this._config[botname].onComplete(null, data);
|
|
33061
32892
|
}, 0);
|
|
33062
32893
|
}
|
|
33063
32894
|
}
|
|
33064
|
-
|
|
33065
32895
|
if (((_f = sessionState === null || sessionState === void 0 ? void 0 : sessionState.intent) === null || _f === void 0 ? void 0 : _f.state) === 'Failed') {
|
|
33066
32896
|
var error_2 = new Error('Bot conversation failed');
|
|
33067
|
-
|
|
33068
32897
|
if (isApiOnCompleteAttached) {
|
|
33069
32898
|
setTimeout(function () {
|
|
33070
32899
|
return _this._botsCompleteCallback[botname](error_2);
|
|
33071
32900
|
}, 0);
|
|
33072
32901
|
}
|
|
33073
|
-
|
|
33074
32902
|
if (isConfigOnCompleteAttached) {
|
|
33075
32903
|
setTimeout(function () {
|
|
33076
32904
|
return _this._config[botname].onComplete(error_2);
|
|
@@ -33083,69 +32911,40 @@ function (_super) {
|
|
|
33083
32911
|
* decompress attributes
|
|
33084
32912
|
* update audioStream format
|
|
33085
32913
|
*/
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
32914
|
AWSLexV2Provider.prototype._formatUtteranceCommandOutput = function (data) {
|
|
33089
32915
|
return __awaiter(this, void 0, void 0, function () {
|
|
33090
32916
|
var response, _a, _b, _c;
|
|
33091
|
-
|
|
33092
32917
|
return __generator(this, function (_d) {
|
|
33093
32918
|
switch (_d.label) {
|
|
33094
32919
|
case 0:
|
|
33095
32920
|
_a = [__assign({}, data)];
|
|
33096
32921
|
_b = {};
|
|
33097
|
-
return [4
|
|
33098
|
-
/*yield*/
|
|
33099
|
-
, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.messages)];
|
|
33100
|
-
|
|
32922
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.messages)];
|
|
33101
32923
|
case 1:
|
|
33102
32924
|
_b.messages = _d.sent();
|
|
33103
|
-
return [4
|
|
33104
|
-
/*yield*/
|
|
33105
|
-
, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.sessionState)];
|
|
33106
|
-
|
|
32925
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.sessionState)];
|
|
33107
32926
|
case 2:
|
|
33108
32927
|
_b.sessionState = _d.sent();
|
|
33109
|
-
return [4
|
|
33110
|
-
/*yield*/
|
|
33111
|
-
, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.interpretations)];
|
|
33112
|
-
|
|
32928
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.interpretations)];
|
|
33113
32929
|
case 3:
|
|
33114
32930
|
_b.interpretations = _d.sent();
|
|
33115
|
-
return [4
|
|
33116
|
-
/*yield*/
|
|
33117
|
-
, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.requestAttributes)];
|
|
33118
|
-
|
|
32931
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.requestAttributes)];
|
|
33119
32932
|
case 4:
|
|
33120
32933
|
_b.requestAttributes = _d.sent();
|
|
33121
|
-
return [4
|
|
33122
|
-
/*yield*/
|
|
33123
|
-
, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.inputTranscript)];
|
|
33124
|
-
|
|
32934
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_commonUtils__WEBPACK_IMPORTED_MODULE_4__["unGzipBase64AsJson"])(data.inputTranscript)];
|
|
33125
32935
|
case 5:
|
|
33126
32936
|
_b.inputTranscript = _d.sent();
|
|
33127
|
-
if (!data.audioStream) return [3
|
|
33128
|
-
/*
|
|
33129
|
-
, 7];
|
|
33130
|
-
return [4
|
|
33131
|
-
/*yield*/
|
|
33132
|
-
, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(data.audioStream)];
|
|
33133
|
-
|
|
32937
|
+
if (!data.audioStream) return [3 /*break*/, 7];
|
|
32938
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(data.audioStream)];
|
|
33134
32939
|
case 6:
|
|
33135
32940
|
_c = _d.sent();
|
|
33136
|
-
return [3
|
|
33137
|
-
/*break*/
|
|
33138
|
-
, 8];
|
|
33139
|
-
|
|
32941
|
+
return [3 /*break*/, 8];
|
|
33140
32942
|
case 7:
|
|
33141
32943
|
_c = undefined;
|
|
33142
32944
|
_d.label = 8;
|
|
33143
|
-
|
|
33144
32945
|
case 8:
|
|
33145
32946
|
response = __assign.apply(void 0, _a.concat([(_b.audioStream = _c, _b)]));
|
|
33146
|
-
return [2
|
|
33147
|
-
/*return*/
|
|
33148
|
-
, response];
|
|
32947
|
+
return [2 /*return*/, response];
|
|
33149
32948
|
}
|
|
33150
32949
|
});
|
|
33151
32950
|
});
|
|
@@ -33154,8 +32953,6 @@ function (_super) {
|
|
|
33154
32953
|
* handle client's `RecognizeTextCommand`
|
|
33155
32954
|
* used for sending simple text message
|
|
33156
32955
|
*/
|
|
33157
|
-
|
|
33158
|
-
|
|
33159
32956
|
AWSLexV2Provider.prototype._handleRecognizeTextCommand = function (botname, data, baseParams) {
|
|
33160
32957
|
return __awaiter(this, void 0, void 0, function () {
|
|
33161
32958
|
var params, recognizeTextCommand, data_1, err_1;
|
|
@@ -33167,34 +32964,19 @@ function (_super) {
|
|
|
33167
32964
|
text: data
|
|
33168
32965
|
});
|
|
33169
32966
|
_a.label = 1;
|
|
33170
|
-
|
|
33171
32967
|
case 1:
|
|
33172
32968
|
_a.trys.push([1, 3,, 4]);
|
|
33173
|
-
|
|
33174
32969
|
recognizeTextCommand = new _aws_sdk_client_lex_runtime_v2__WEBPACK_IMPORTED_MODULE_1__["RecognizeTextCommand"](params);
|
|
33175
|
-
return [4
|
|
33176
|
-
/*yield*/
|
|
33177
|
-
, this._lexRuntimeServiceV2Client.send(recognizeTextCommand)];
|
|
33178
|
-
|
|
32970
|
+
return [4 /*yield*/, this._lexRuntimeServiceV2Client.send(recognizeTextCommand)];
|
|
33179
32971
|
case 2:
|
|
33180
32972
|
data_1 = _a.sent();
|
|
33181
|
-
|
|
33182
32973
|
this._reportBotStatus(data_1, botname);
|
|
33183
|
-
|
|
33184
|
-
return [2
|
|
33185
|
-
/*return*/
|
|
33186
|
-
, data_1];
|
|
33187
|
-
|
|
32974
|
+
return [2 /*return*/, data_1];
|
|
33188
32975
|
case 3:
|
|
33189
32976
|
err_1 = _a.sent();
|
|
33190
|
-
return [2
|
|
33191
|
-
/*return*/
|
|
33192
|
-
, Promise.reject(err_1)];
|
|
33193
|
-
|
|
32977
|
+
return [2 /*return*/, Promise.reject(err_1)];
|
|
33194
32978
|
case 4:
|
|
33195
|
-
return [2
|
|
33196
|
-
/*return*/
|
|
33197
|
-
];
|
|
32979
|
+
return [2 /*return*/];
|
|
33198
32980
|
}
|
|
33199
32981
|
});
|
|
33200
32982
|
});
|
|
@@ -33203,98 +32985,57 @@ function (_super) {
|
|
|
33203
32985
|
* handle client's `RecognizeUtteranceCommand`
|
|
33204
32986
|
* used for obj text or obj voice message
|
|
33205
32987
|
*/
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
32988
|
AWSLexV2Provider.prototype._handleRecognizeUtteranceCommand = function (botname, data, baseParams) {
|
|
33209
32989
|
return __awaiter(this, void 0, void 0, function () {
|
|
33210
32990
|
var content, messageType, params, inputStream, _a, recognizeUtteranceCommand, data_2, response, err_2;
|
|
33211
|
-
|
|
33212
32991
|
return __generator(this, function (_b) {
|
|
33213
32992
|
switch (_b.label) {
|
|
33214
32993
|
case 0:
|
|
33215
32994
|
content = data.content, messageType = data.options.messageType;
|
|
33216
32995
|
logger.debug('postContent to lex2', data);
|
|
33217
|
-
if (!(messageType === 'voice')) return [3
|
|
33218
|
-
/*break*/
|
|
33219
|
-
, 4];
|
|
33220
|
-
|
|
32996
|
+
if (!(messageType === 'voice')) return [3 /*break*/, 4];
|
|
33221
32997
|
if (_typeof(content) !== 'object') {
|
|
33222
|
-
return [2
|
|
33223
|
-
/*return*/
|
|
33224
|
-
, Promise.reject('invalid content type')];
|
|
32998
|
+
return [2 /*return*/, Promise.reject('invalid content type')];
|
|
33225
32999
|
}
|
|
33226
|
-
|
|
33227
|
-
if (!(content instanceof Uint8Array)) return [3
|
|
33228
|
-
/*break*/
|
|
33229
|
-
, 1];
|
|
33000
|
+
if (!(content instanceof Uint8Array)) return [3 /*break*/, 1];
|
|
33230
33001
|
_a = content;
|
|
33231
|
-
return [3
|
|
33232
|
-
/*break*/
|
|
33233
|
-
, 3];
|
|
33234
|
-
|
|
33002
|
+
return [3 /*break*/, 3];
|
|
33235
33003
|
case 1:
|
|
33236
|
-
return [4
|
|
33237
|
-
/*yield*/
|
|
33238
|
-
, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(content)];
|
|
33239
|
-
|
|
33004
|
+
return [4 /*yield*/, Object(_AWSLexProviderHelper_utils__WEBPACK_IMPORTED_MODULE_3__["convert"])(content)];
|
|
33240
33005
|
case 2:
|
|
33241
33006
|
_a = _b.sent();
|
|
33242
33007
|
_b.label = 3;
|
|
33243
|
-
|
|
33244
33008
|
case 3:
|
|
33245
33009
|
inputStream = _a;
|
|
33246
33010
|
params = __assign(__assign({}, baseParams), {
|
|
33247
33011
|
requestContentType: 'audio/x-l16; sample-rate=16000; channel-count=1',
|
|
33248
33012
|
inputStream: inputStream
|
|
33249
33013
|
});
|
|
33250
|
-
return [3
|
|
33251
|
-
/*break*/
|
|
33252
|
-
, 5];
|
|
33253
|
-
|
|
33014
|
+
return [3 /*break*/, 5];
|
|
33254
33015
|
case 4:
|
|
33255
33016
|
// text input
|
|
33256
|
-
if (typeof content !== 'string') return [2
|
|
33257
|
-
/*return*/
|
|
33258
|
-
, Promise.reject('invalid content type')];
|
|
33017
|
+
if (typeof content !== 'string') return [2 /*return*/, Promise.reject('invalid content type')];
|
|
33259
33018
|
params = __assign(__assign({}, baseParams), {
|
|
33260
33019
|
requestContentType: 'text/plain; charset=utf-8',
|
|
33261
33020
|
inputStream: content
|
|
33262
33021
|
});
|
|
33263
33022
|
_b.label = 5;
|
|
33264
|
-
|
|
33265
33023
|
case 5:
|
|
33266
33024
|
_b.trys.push([5, 8,, 9]);
|
|
33267
|
-
|
|
33268
33025
|
recognizeUtteranceCommand = new _aws_sdk_client_lex_runtime_v2__WEBPACK_IMPORTED_MODULE_1__["RecognizeUtteranceCommand"](params);
|
|
33269
|
-
return [4
|
|
33270
|
-
/*yield*/
|
|
33271
|
-
, this._lexRuntimeServiceV2Client.send(recognizeUtteranceCommand)];
|
|
33272
|
-
|
|
33026
|
+
return [4 /*yield*/, this._lexRuntimeServiceV2Client.send(recognizeUtteranceCommand)];
|
|
33273
33027
|
case 6:
|
|
33274
33028
|
data_2 = _b.sent();
|
|
33275
|
-
return [4
|
|
33276
|
-
/*yield*/
|
|
33277
|
-
, this._formatUtteranceCommandOutput(data_2)];
|
|
33278
|
-
|
|
33029
|
+
return [4 /*yield*/, this._formatUtteranceCommandOutput(data_2)];
|
|
33279
33030
|
case 7:
|
|
33280
33031
|
response = _b.sent();
|
|
33281
|
-
|
|
33282
33032
|
this._reportBotStatus(response, botname);
|
|
33283
|
-
|
|
33284
|
-
return [2
|
|
33285
|
-
/*return*/
|
|
33286
|
-
, response];
|
|
33287
|
-
|
|
33033
|
+
return [2 /*return*/, response];
|
|
33288
33034
|
case 8:
|
|
33289
33035
|
err_2 = _b.sent();
|
|
33290
|
-
return [2
|
|
33291
|
-
/*return*/
|
|
33292
|
-
, Promise.reject(err_2)];
|
|
33293
|
-
|
|
33036
|
+
return [2 /*return*/, Promise.reject(err_2)];
|
|
33294
33037
|
case 9:
|
|
33295
|
-
return [2
|
|
33296
|
-
/*return*/
|
|
33297
|
-
];
|
|
33038
|
+
return [2 /*return*/];
|
|
33298
33039
|
}
|
|
33299
33040
|
});
|
|
33300
33041
|
});
|
|
@@ -33304,7 +33045,6 @@ function (_super) {
|
|
|
33304
33045
|
}(_InteractionsProvider__WEBPACK_IMPORTED_MODULE_0__["AbstractInteractionsProvider"]);
|
|
33305
33046
|
|
|
33306
33047
|
|
|
33307
|
-
|
|
33308
33048
|
/***/ }),
|
|
33309
33049
|
|
|
33310
33050
|
/***/ "./lib-esm/Providers/InteractionsProvider.js":
|
|
@@ -33335,46 +33075,34 @@ var __assign = undefined && undefined.__assign || function () {
|
|
|
33335
33075
|
__assign = Object.assign || function (t) {
|
|
33336
33076
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33337
33077
|
s = arguments[i];
|
|
33338
|
-
|
|
33339
33078
|
for (var p in s) {
|
|
33340
33079
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
33341
33080
|
}
|
|
33342
33081
|
}
|
|
33343
|
-
|
|
33344
33082
|
return t;
|
|
33345
33083
|
};
|
|
33346
|
-
|
|
33347
33084
|
return __assign.apply(this, arguments);
|
|
33348
33085
|
};
|
|
33349
33086
|
|
|
33350
|
-
|
|
33351
33087
|
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["ConsoleLogger"]('AbstractInteractionsProvider');
|
|
33352
|
-
|
|
33353
|
-
var AbstractInteractionsProvider =
|
|
33354
|
-
/** @class */
|
|
33355
|
-
function () {
|
|
33088
|
+
var AbstractInteractionsProvider = /** @class */function () {
|
|
33356
33089
|
function AbstractInteractionsProvider(options) {
|
|
33357
33090
|
if (options === void 0) {
|
|
33358
33091
|
options = {};
|
|
33359
33092
|
}
|
|
33360
|
-
|
|
33361
33093
|
this._config = options;
|
|
33362
33094
|
}
|
|
33363
|
-
|
|
33364
33095
|
AbstractInteractionsProvider.prototype.configure = function (config) {
|
|
33365
33096
|
if (config === void 0) {
|
|
33366
33097
|
config = {};
|
|
33367
33098
|
}
|
|
33368
|
-
|
|
33369
33099
|
this._config = __assign(__assign({}, this._config), config);
|
|
33370
33100
|
logger.debug("configure " + this.getProviderName(), this._config);
|
|
33371
33101
|
return this.options;
|
|
33372
33102
|
};
|
|
33373
|
-
|
|
33374
33103
|
AbstractInteractionsProvider.prototype.getCategory = function () {
|
|
33375
33104
|
return 'Interactions';
|
|
33376
33105
|
};
|
|
33377
|
-
|
|
33378
33106
|
Object.defineProperty(AbstractInteractionsProvider.prototype, "options", {
|
|
33379
33107
|
get: function get() {
|
|
33380
33108
|
return __assign({}, this._config);
|
|
@@ -33386,7 +33114,6 @@ function () {
|
|
|
33386
33114
|
}();
|
|
33387
33115
|
|
|
33388
33116
|
|
|
33389
|
-
|
|
33390
33117
|
/***/ }),
|
|
33391
33118
|
|
|
33392
33119
|
/***/ "./lib-esm/Providers/index.js":
|
|
@@ -33462,7 +33189,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33462
33189
|
/**
|
|
33463
33190
|
* @deprecated use named import
|
|
33464
33191
|
*/
|
|
33465
|
-
|
|
33466
33192
|
/* harmony default export */ __webpack_exports__["default"] = (_Interactions__WEBPACK_IMPORTED_MODULE_0__["Interactions"]);
|
|
33467
33193
|
|
|
33468
33194
|
|