@aws-sdk/client-lex-runtime-v2 3.183.0 → 3.185.0

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.
@@ -1,3 +1,4 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import packageInfo from "../package.json";
2
3
  import { Sha256 } from "@aws-crypto/sha256-browser";
3
4
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
@@ -12,33 +13,15 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
12
13
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
14
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
14
15
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
15
- export const getRuntimeConfig = (config) => {
16
- const defaultsMode = resolveDefaultsModeConfig(config);
17
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
18
- const clientSharedValues = getSharedRuntimeConfig(config);
19
- return {
20
- ...clientSharedValues,
21
- ...config,
22
- runtime: "browser",
23
- defaultsMode,
24
- base64Decoder: config?.base64Decoder ?? fromBase64,
25
- base64Encoder: config?.base64Encoder ?? toBase64,
26
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
27
- credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
28
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
29
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
30
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
31
- (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })),
32
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
33
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
34
- region: config?.region ?? invalidProvider("Region is missing"),
35
- requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
36
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
37
- sha256: config?.sha256 ?? Sha256,
38
- streamCollector: config?.streamCollector ?? streamCollector,
39
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
40
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
41
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
42
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
43
- };
16
+ export var getRuntimeConfig = function (config) {
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
18
+ var defaultsMode = resolveDefaultsModeConfig(config);
19
+ var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
20
+ var clientSharedValues = getSharedRuntimeConfig(config);
21
+ return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: (_f = config === null || config === void 0 ? void 0 : config.eventStreamPayloadHandlerProvider) !== null && _f !== void 0 ? _f : (function () { return ({ handle: invalidFunction("event stream request is not supported in browser.") }); }), eventStreamSerdeProvider: (_g = config === null || config === void 0 ? void 0 : config.eventStreamSerdeProvider) !== null && _g !== void 0 ? _g : eventStreamSerdeProvider, maxAttempts: (_h = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _h !== void 0 ? _h : DEFAULT_MAX_ATTEMPTS, region: (_j = config === null || config === void 0 ? void 0 : config.region) !== null && _j !== void 0 ? _j : invalidProvider("Region is missing"), requestHandler: (_k = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _k !== void 0 ? _k : new RequestHandler(defaultConfigProvider), retryMode: (_l = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _l !== void 0 ? _l : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
22
+ switch (_a.label) {
23
+ case 0: return [4, defaultConfigProvider()];
24
+ case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
25
+ }
26
+ }); }); }), sha256: (_m = config === null || config === void 0 ? void 0 : config.sha256) !== null && _m !== void 0 ? _m : Sha256, streamCollector: (_o = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _o !== void 0 ? _o : streamCollector, useDualstackEndpoint: (_p = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _p !== void 0 ? _p : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_q = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _q !== void 0 ? _q : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_r = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _r !== void 0 ? _r : fromUtf8, utf8Encoder: (_s = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _s !== void 0 ? _s : toUtf8 });
44
27
  };
@@ -1,3 +1,4 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import packageInfo from "../package.json";
2
3
  import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
3
4
  import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver";
@@ -16,38 +17,23 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar
16
17
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
17
18
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
18
19
  import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
19
- export const getRuntimeConfig = (config) => {
20
+ export var getRuntimeConfig = function (config) {
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
20
22
  emitWarningIfUnsupportedVersion(process.version);
21
- const defaultsMode = resolveDefaultsModeConfig(config);
22
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
23
- const clientSharedValues = getSharedRuntimeConfig(config);
24
- return {
25
- ...clientSharedValues,
26
- ...config,
27
- runtime: "node",
28
- defaultsMode,
29
- base64Decoder: config?.base64Decoder ?? fromBase64,
30
- base64Encoder: config?.base64Encoder ?? toBase64,
31
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
32
- credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
33
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
34
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
35
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
36
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
37
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
38
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
39
- requestHandler: config?.requestHandler ??
40
- new RequestHandler(async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true })),
41
- retryMode: config?.retryMode ??
42
- loadNodeConfig({
43
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
44
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
45
- }),
46
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
47
- streamCollector: config?.streamCollector ?? streamCollector,
48
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
49
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
50
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
51
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
52
- };
23
+ var defaultsMode = resolveDefaultsModeConfig(config);
24
+ var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
25
+ var clientSharedValues = getSharedRuntimeConfig(config);
26
+ return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: (_f = config === null || config === void 0 ? void 0 : config.eventStreamPayloadHandlerProvider) !== null && _f !== void 0 ? _f : eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: (_g = config === null || config === void 0 ? void 0 : config.eventStreamSerdeProvider) !== null && _g !== void 0 ? _g : eventStreamSerdeProvider, maxAttempts: (_h = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _h !== void 0 ? _h : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_j = config === null || config === void 0 ? void 0 : config.region) !== null && _j !== void 0 ? _j : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_k = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _k !== void 0 ? _k : new RequestHandler(function () { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
27
+ switch (_b.label) {
28
+ case 0:
29
+ _a = [{}];
30
+ return [4, defaultConfigProvider()];
31
+ case 1: return [2, (__assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { disableConcurrentStreams: true }]))];
32
+ }
33
+ }); }); }), retryMode: (_l = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _l !== void 0 ? _l : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
34
+ switch (_a.label) {
35
+ case 0: return [4, defaultConfigProvider()];
36
+ case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
37
+ }
38
+ }); }); } })), sha256: (_m = config === null || config === void 0 ? void 0 : config.sha256) !== null && _m !== void 0 ? _m : Hash.bind(null, "sha256"), streamCollector: (_o = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _o !== void 0 ? _o : streamCollector, useDualstackEndpoint: (_p = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _p !== void 0 ? _p : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_q = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _q !== void 0 ? _q : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_r = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _r !== void 0 ? _r : fromUtf8, utf8Encoder: (_s = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _s !== void 0 ? _s : toUtf8 });
53
39
  };
@@ -1,14 +1,9 @@
1
+ import { __assign } from "tslib";
1
2
  import { Sha256 } from "@aws-crypto/sha256-js";
2
3
  import { invalidFunction } from "@aws-sdk/invalid-dependency";
3
4
  import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
- export const getRuntimeConfig = (config) => {
5
- const browserDefaults = getBrowserRuntimeConfig(config);
6
- return {
7
- ...browserDefaults,
8
- ...config,
9
- runtime: "react-native",
10
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
11
- (() => ({ handle: invalidFunction("event stream request is not supported in ReactNative.") })),
12
- sha256: config?.sha256 ?? Sha256,
13
- };
5
+ export var getRuntimeConfig = function (config) {
6
+ var _a, _b;
7
+ var browserDefaults = getBrowserRuntimeConfig(config);
8
+ return __assign(__assign(__assign({}, browserDefaults), config), { runtime: "react-native", eventStreamPayloadHandlerProvider: (_a = config === null || config === void 0 ? void 0 : config.eventStreamPayloadHandlerProvider) !== null && _a !== void 0 ? _a : (function () { return ({ handle: invalidFunction("event stream request is not supported in ReactNative.") }); }), sha256: (_b = config === null || config === void 0 ? void 0 : config.sha256) !== null && _b !== void 0 ? _b : Sha256 });
14
9
  };
@@ -1,10 +1,13 @@
1
1
  import { parseUrl } from "@aws-sdk/url-parser";
2
2
  import { defaultRegionInfoProvider } from "./endpoints";
3
- export const getRuntimeConfig = (config) => ({
4
- apiVersion: "2020-08-07",
5
- disableHostPrefix: config?.disableHostPrefix ?? false,
6
- logger: config?.logger ?? {},
7
- regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
8
- serviceId: config?.serviceId ?? "Lex Runtime V2",
9
- urlParser: config?.urlParser ?? parseUrl,
10
- });
3
+ export var getRuntimeConfig = function (config) {
4
+ var _a, _b, _c, _d, _e;
5
+ return ({
6
+ apiVersion: "2020-08-07",
7
+ disableHostPrefix: (_a = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _a !== void 0 ? _a : false,
8
+ logger: (_b = config === null || config === void 0 ? void 0 : config.logger) !== null && _b !== void 0 ? _b : {},
9
+ regionInfoProvider: (_c = config === null || config === void 0 ? void 0 : config.regionInfoProvider) !== null && _c !== void 0 ? _c : defaultRegionInfoProvider,
10
+ serviceId: (_d = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _d !== void 0 ? _d : "Lex Runtime V2",
11
+ urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : parseUrl,
12
+ });
13
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-lex-runtime-v2",
3
3
  "description": "AWS SDK for JavaScript Lex Runtime V2 Client for Node.js, Browser and React Native",
4
- "version": "3.183.0",
4
+ "version": "3.185.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -19,9 +19,9 @@
19
19
  "dependencies": {
20
20
  "@aws-crypto/sha256-browser": "2.0.0",
21
21
  "@aws-crypto/sha256-js": "2.0.0",
22
- "@aws-sdk/client-sts": "3.183.0",
22
+ "@aws-sdk/client-sts": "3.185.0",
23
23
  "@aws-sdk/config-resolver": "3.183.0",
24
- "@aws-sdk/credential-provider-node": "3.183.0",
24
+ "@aws-sdk/credential-provider-node": "3.185.0",
25
25
  "@aws-sdk/eventstream-handler-node": "3.183.0",
26
26
  "@aws-sdk/eventstream-serde-browser": "3.183.0",
27
27
  "@aws-sdk/eventstream-serde-config-resolver": "3.183.0",
@@ -34,13 +34,13 @@
34
34
  "@aws-sdk/middleware-host-header": "3.183.0",
35
35
  "@aws-sdk/middleware-logger": "3.183.0",
36
36
  "@aws-sdk/middleware-recursion-detection": "3.183.0",
37
- "@aws-sdk/middleware-retry": "3.183.0",
37
+ "@aws-sdk/middleware-retry": "3.185.0",
38
38
  "@aws-sdk/middleware-serde": "3.183.0",
39
39
  "@aws-sdk/middleware-signing": "3.183.0",
40
40
  "@aws-sdk/middleware-stack": "3.183.0",
41
41
  "@aws-sdk/middleware-user-agent": "3.183.0",
42
42
  "@aws-sdk/node-config-provider": "3.183.0",
43
- "@aws-sdk/node-http-handler": "3.183.0",
43
+ "@aws-sdk/node-http-handler": "3.185.0",
44
44
  "@aws-sdk/protocol-http": "3.183.0",
45
45
  "@aws-sdk/smithy-client": "3.183.0",
46
46
  "@aws-sdk/types": "3.183.0",