@aws-sdk/client-connect-contact-lens 3.186.0 → 3.190.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.190.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.189.0...v3.190.0) (2022-10-17)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-connect-contact-lens
9
+
10
+
11
+
12
+
13
+
14
+ # [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-connect-contact-lens
17
+
18
+
19
+
20
+
21
+
6
22
  # [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
7
23
 
8
24
  **Note:** Version bump only for package @aws-sdk/client-connect-contact-lens
@@ -1,25 +1,18 @@
1
- import { __extends } from "tslib";
2
1
  import { ListRealtimeContactAnalysisSegmentsCommand, } from "./commands/ListRealtimeContactAnalysisSegmentsCommand";
3
2
  import { ConnectContactLensClient } from "./ConnectContactLensClient";
4
- var ConnectContactLens = (function (_super) {
5
- __extends(ConnectContactLens, _super);
6
- function ConnectContactLens() {
7
- return _super !== null && _super.apply(this, arguments) || this;
8
- }
9
- ConnectContactLens.prototype.listRealtimeContactAnalysisSegments = function (args, optionsOrCb, cb) {
10
- var command = new ListRealtimeContactAnalysisSegmentsCommand(args);
3
+ export class ConnectContactLens extends ConnectContactLensClient {
4
+ listRealtimeContactAnalysisSegments(args, optionsOrCb, cb) {
5
+ const command = new ListRealtimeContactAnalysisSegmentsCommand(args);
11
6
  if (typeof optionsOrCb === "function") {
12
7
  this.send(command, optionsOrCb);
13
8
  }
14
9
  else if (typeof cb === "function") {
15
10
  if (typeof optionsOrCb !== "object")
16
- throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
11
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
17
12
  this.send(command, optionsOrCb || {}, cb);
18
13
  }
19
14
  else {
20
15
  return this.send(command, optionsOrCb);
21
16
  }
22
- };
23
- return ConnectContactLens;
24
- }(ConnectContactLensClient));
25
- export { ConnectContactLens };
17
+ }
18
+ }
@@ -1,4 +1,3 @@
1
- import { __extends } from "tslib";
2
1
  import { resolveEndpointsConfig, resolveRegionConfig, } from "@aws-sdk/config-resolver";
3
2
  import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4
3
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
@@ -9,31 +8,26 @@ import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-sig
9
8
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
10
9
  import { Client as __Client, } from "@aws-sdk/smithy-client";
11
10
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
12
- var ConnectContactLensClient = (function (_super) {
13
- __extends(ConnectContactLensClient, _super);
14
- function ConnectContactLensClient(configuration) {
15
- var _this = this;
16
- var _config_0 = __getRuntimeConfig(configuration);
17
- var _config_1 = resolveRegionConfig(_config_0);
18
- var _config_2 = resolveEndpointsConfig(_config_1);
19
- var _config_3 = resolveRetryConfig(_config_2);
20
- var _config_4 = resolveHostHeaderConfig(_config_3);
21
- var _config_5 = resolveAwsAuthConfig(_config_4);
22
- var _config_6 = resolveUserAgentConfig(_config_5);
23
- _this = _super.call(this, _config_6) || this;
24
- _this.config = _config_6;
25
- _this.middlewareStack.use(getRetryPlugin(_this.config));
26
- _this.middlewareStack.use(getContentLengthPlugin(_this.config));
27
- _this.middlewareStack.use(getHostHeaderPlugin(_this.config));
28
- _this.middlewareStack.use(getLoggerPlugin(_this.config));
29
- _this.middlewareStack.use(getRecursionDetectionPlugin(_this.config));
30
- _this.middlewareStack.use(getAwsAuthPlugin(_this.config));
31
- _this.middlewareStack.use(getUserAgentPlugin(_this.config));
32
- return _this;
11
+ export class ConnectContactLensClient extends __Client {
12
+ constructor(configuration) {
13
+ const _config_0 = __getRuntimeConfig(configuration);
14
+ const _config_1 = resolveRegionConfig(_config_0);
15
+ const _config_2 = resolveEndpointsConfig(_config_1);
16
+ const _config_3 = resolveRetryConfig(_config_2);
17
+ const _config_4 = resolveHostHeaderConfig(_config_3);
18
+ const _config_5 = resolveAwsAuthConfig(_config_4);
19
+ const _config_6 = resolveUserAgentConfig(_config_5);
20
+ super(_config_6);
21
+ this.config = _config_6;
22
+ this.middlewareStack.use(getRetryPlugin(this.config));
23
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
24
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
25
+ this.middlewareStack.use(getLoggerPlugin(this.config));
26
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
27
+ this.middlewareStack.use(getAwsAuthPlugin(this.config));
28
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
33
29
  }
34
- ConnectContactLensClient.prototype.destroy = function () {
35
- _super.prototype.destroy.call(this);
36
- };
37
- return ConnectContactLensClient;
38
- }(__Client));
39
- export { ConnectContactLensClient };
30
+ destroy() {
31
+ super.destroy();
32
+ }
33
+ }
@@ -1,39 +1,32 @@
1
- import { __extends } from "tslib";
2
1
  import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
2
  import { Command as $Command } from "@aws-sdk/smithy-client";
4
3
  import { ListRealtimeContactAnalysisSegmentsRequestFilterSensitiveLog, ListRealtimeContactAnalysisSegmentsResponseFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand, serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand, } from "../protocols/Aws_restJson1";
6
- var ListRealtimeContactAnalysisSegmentsCommand = (function (_super) {
7
- __extends(ListRealtimeContactAnalysisSegmentsCommand, _super);
8
- function ListRealtimeContactAnalysisSegmentsCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class ListRealtimeContactAnalysisSegmentsCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- ListRealtimeContactAnalysisSegmentsCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
10
+ resolveMiddleware(clientStack, configuration, options) {
14
11
  this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
- var stack = clientStack.concat(this.middlewareStack);
16
- var logger = configuration.logger;
17
- var clientName = "ConnectContactLensClient";
18
- var commandName = "ListRealtimeContactAnalysisSegmentsCommand";
19
- var handlerExecutionContext = {
20
- logger: logger,
21
- clientName: clientName,
22
- commandName: commandName,
12
+ const stack = clientStack.concat(this.middlewareStack);
13
+ const { logger } = configuration;
14
+ const clientName = "ConnectContactLensClient";
15
+ const commandName = "ListRealtimeContactAnalysisSegmentsCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: ListRealtimeContactAnalysisSegmentsRequestFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: ListRealtimeContactAnalysisSegmentsResponseFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- ListRealtimeContactAnalysisSegmentsCommand.prototype.serialize = function (input, context) {
23
+ const { requestHandler } = configuration;
24
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
25
+ }
26
+ serialize(input, context) {
32
27
  return serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand(input, context);
33
- };
34
- ListRealtimeContactAnalysisSegmentsCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand(output, context);
36
- };
37
- return ListRealtimeContactAnalysisSegmentsCommand;
38
- }($Command));
39
- export { ListRealtimeContactAnalysisSegmentsCommand };
31
+ }
32
+ }
@@ -1,7 +1,6 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { getRegionInfo } from "@aws-sdk/config-resolver";
3
- var regionHash = {};
4
- var partitionHash = {
2
+ const regionHash = {};
3
+ const partitionHash = {
5
4
  aws: {
6
5
  regions: [
7
6
  "af-south-1",
@@ -121,8 +120,9 @@ var partitionHash = {
121
120
  ],
122
121
  },
123
122
  };
124
- export var defaultRegionInfoProvider = function (region, options) { return __awaiter(void 0, void 0, void 0, function () {
125
- return __generator(this, function (_a) {
126
- return [2, getRegionInfo(region, __assign(__assign({}, options), { signingService: "connect", regionHash: regionHash, partitionHash: partitionHash }))];
127
- });
128
- }); };
123
+ export const defaultRegionInfoProvider = async (region, options) => getRegionInfo(region, {
124
+ ...options,
125
+ signingService: "connect",
126
+ regionHash,
127
+ partitionHash,
128
+ });
@@ -1,12 +1,7 @@
1
- import { __extends } from "tslib";
2
1
  import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
- var ConnectContactLensServiceException = (function (_super) {
4
- __extends(ConnectContactLensServiceException, _super);
5
- function ConnectContactLensServiceException(options) {
6
- var _this = _super.call(this, options) || this;
7
- Object.setPrototypeOf(_this, ConnectContactLensServiceException.prototype);
8
- return _this;
2
+ export class ConnectContactLensServiceException extends __ServiceException {
3
+ constructor(options) {
4
+ super(options);
5
+ Object.setPrototypeOf(this, ConnectContactLensServiceException.prototype);
9
6
  }
10
- return ConnectContactLensServiceException;
11
- }(__ServiceException));
12
- export { ConnectContactLensServiceException };
7
+ }
@@ -1,82 +1,99 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { ConnectContactLensServiceException as __BaseException } from "./ConnectContactLensServiceException";
3
- var AccessDeniedException = (function (_super) {
4
- __extends(AccessDeniedException, _super);
5
- function AccessDeniedException(opts) {
6
- var _this = _super.call(this, __assign({ name: "AccessDeniedException", $fault: "client" }, opts)) || this;
7
- _this.name = "AccessDeniedException";
8
- _this.$fault = "client";
9
- Object.setPrototypeOf(_this, AccessDeniedException.prototype);
10
- _this.Message = opts.Message;
11
- return _this;
2
+ export class AccessDeniedException extends __BaseException {
3
+ constructor(opts) {
4
+ super({
5
+ name: "AccessDeniedException",
6
+ $fault: "client",
7
+ ...opts,
8
+ });
9
+ this.name = "AccessDeniedException";
10
+ this.$fault = "client";
11
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
12
+ this.Message = opts.Message;
12
13
  }
13
- return AccessDeniedException;
14
- }(__BaseException));
15
- export { AccessDeniedException };
16
- var InternalServiceException = (function (_super) {
17
- __extends(InternalServiceException, _super);
18
- function InternalServiceException(opts) {
19
- var _this = _super.call(this, __assign({ name: "InternalServiceException", $fault: "server" }, opts)) || this;
20
- _this.name = "InternalServiceException";
21
- _this.$fault = "server";
22
- Object.setPrototypeOf(_this, InternalServiceException.prototype);
23
- _this.Message = opts.Message;
24
- return _this;
14
+ }
15
+ export class InternalServiceException extends __BaseException {
16
+ constructor(opts) {
17
+ super({
18
+ name: "InternalServiceException",
19
+ $fault: "server",
20
+ ...opts,
21
+ });
22
+ this.name = "InternalServiceException";
23
+ this.$fault = "server";
24
+ Object.setPrototypeOf(this, InternalServiceException.prototype);
25
+ this.Message = opts.Message;
25
26
  }
26
- return InternalServiceException;
27
- }(__BaseException));
28
- export { InternalServiceException };
29
- var InvalidRequestException = (function (_super) {
30
- __extends(InvalidRequestException, _super);
31
- function InvalidRequestException(opts) {
32
- var _this = _super.call(this, __assign({ name: "InvalidRequestException", $fault: "client" }, opts)) || this;
33
- _this.name = "InvalidRequestException";
34
- _this.$fault = "client";
35
- Object.setPrototypeOf(_this, InvalidRequestException.prototype);
36
- _this.Message = opts.Message;
37
- return _this;
27
+ }
28
+ export class InvalidRequestException extends __BaseException {
29
+ constructor(opts) {
30
+ super({
31
+ name: "InvalidRequestException",
32
+ $fault: "client",
33
+ ...opts,
34
+ });
35
+ this.name = "InvalidRequestException";
36
+ this.$fault = "client";
37
+ Object.setPrototypeOf(this, InvalidRequestException.prototype);
38
+ this.Message = opts.Message;
38
39
  }
39
- return InvalidRequestException;
40
- }(__BaseException));
41
- export { InvalidRequestException };
40
+ }
42
41
  export var SentimentValue;
43
42
  (function (SentimentValue) {
44
43
  SentimentValue["NEGATIVE"] = "NEGATIVE";
45
44
  SentimentValue["NEUTRAL"] = "NEUTRAL";
46
45
  SentimentValue["POSITIVE"] = "POSITIVE";
47
46
  })(SentimentValue || (SentimentValue = {}));
48
- var ResourceNotFoundException = (function (_super) {
49
- __extends(ResourceNotFoundException, _super);
50
- function ResourceNotFoundException(opts) {
51
- var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
52
- _this.name = "ResourceNotFoundException";
53
- _this.$fault = "client";
54
- Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
55
- _this.Message = opts.Message;
56
- return _this;
47
+ export class ResourceNotFoundException extends __BaseException {
48
+ constructor(opts) {
49
+ super({
50
+ name: "ResourceNotFoundException",
51
+ $fault: "client",
52
+ ...opts,
53
+ });
54
+ this.name = "ResourceNotFoundException";
55
+ this.$fault = "client";
56
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
57
+ this.Message = opts.Message;
57
58
  }
58
- return ResourceNotFoundException;
59
- }(__BaseException));
60
- export { ResourceNotFoundException };
61
- var ThrottlingException = (function (_super) {
62
- __extends(ThrottlingException, _super);
63
- function ThrottlingException(opts) {
64
- var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
65
- _this.name = "ThrottlingException";
66
- _this.$fault = "client";
67
- Object.setPrototypeOf(_this, ThrottlingException.prototype);
68
- _this.Message = opts.Message;
69
- return _this;
59
+ }
60
+ export class ThrottlingException extends __BaseException {
61
+ constructor(opts) {
62
+ super({
63
+ name: "ThrottlingException",
64
+ $fault: "client",
65
+ ...opts,
66
+ });
67
+ this.name = "ThrottlingException";
68
+ this.$fault = "client";
69
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
70
+ this.Message = opts.Message;
70
71
  }
71
- return ThrottlingException;
72
- }(__BaseException));
73
- export { ThrottlingException };
74
- export var ListRealtimeContactAnalysisSegmentsRequestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
75
- export var PointOfInterestFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
76
- export var CategoryDetailsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
77
- export var CategoriesFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
78
- export var CharacterOffsetsFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
79
- export var IssueDetectedFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
80
- export var TranscriptFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
81
- export var RealtimeContactAnalysisSegmentFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
82
- export var ListRealtimeContactAnalysisSegmentsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
72
+ }
73
+ export const ListRealtimeContactAnalysisSegmentsRequestFilterSensitiveLog = (obj) => ({
74
+ ...obj,
75
+ });
76
+ export const PointOfInterestFilterSensitiveLog = (obj) => ({
77
+ ...obj,
78
+ });
79
+ export const CategoryDetailsFilterSensitiveLog = (obj) => ({
80
+ ...obj,
81
+ });
82
+ export const CategoriesFilterSensitiveLog = (obj) => ({
83
+ ...obj,
84
+ });
85
+ export const CharacterOffsetsFilterSensitiveLog = (obj) => ({
86
+ ...obj,
87
+ });
88
+ export const IssueDetectedFilterSensitiveLog = (obj) => ({
89
+ ...obj,
90
+ });
91
+ export const TranscriptFilterSensitiveLog = (obj) => ({
92
+ ...obj,
93
+ });
94
+ export const RealtimeContactAnalysisSegmentFilterSensitiveLog = (obj) => ({
95
+ ...obj,
96
+ });
97
+ export const ListRealtimeContactAnalysisSegmentsResponseFilterSensitiveLog = (obj) => ({
98
+ ...obj,
99
+ });
@@ -1,75 +1,32 @@
1
- import { __asyncGenerator, __await, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
1
  import { ListRealtimeContactAnalysisSegmentsCommand, } from "../commands/ListRealtimeContactAnalysisSegmentsCommand";
3
2
  import { ConnectContactLens } from "../ConnectContactLens";
4
3
  import { ConnectContactLensClient } from "../ConnectContactLensClient";
5
- var makePagedClientRequest = function (client, input) {
6
- var args = [];
7
- for (var _i = 2; _i < arguments.length; _i++) {
8
- args[_i - 2] = arguments[_i];
9
- }
10
- return __awaiter(void 0, void 0, void 0, function () {
11
- return __generator(this, function (_a) {
12
- switch (_a.label) {
13
- case 0: return [4, client.send.apply(client, __spreadArray([new ListRealtimeContactAnalysisSegmentsCommand(input)], __read(args), false))];
14
- case 1: return [2, _a.sent()];
15
- }
16
- });
17
- });
4
+ const makePagedClientRequest = async (client, input, ...args) => {
5
+ return await client.send(new ListRealtimeContactAnalysisSegmentsCommand(input), ...args);
18
6
  };
19
- var makePagedRequest = function (client, input) {
20
- var args = [];
21
- for (var _i = 2; _i < arguments.length; _i++) {
22
- args[_i - 2] = arguments[_i];
23
- }
24
- return __awaiter(void 0, void 0, void 0, function () {
25
- return __generator(this, function (_a) {
26
- switch (_a.label) {
27
- case 0: return [4, client.listRealtimeContactAnalysisSegments.apply(client, __spreadArray([input], __read(args), false))];
28
- case 1: return [2, _a.sent()];
29
- }
30
- });
31
- });
7
+ const makePagedRequest = async (client, input, ...args) => {
8
+ return await client.listRealtimeContactAnalysisSegments(input, ...args);
32
9
  };
33
- export function paginateListRealtimeContactAnalysisSegments(config, input) {
34
- var additionalArguments = [];
35
- for (var _i = 2; _i < arguments.length; _i++) {
36
- additionalArguments[_i - 2] = arguments[_i];
10
+ export async function* paginateListRealtimeContactAnalysisSegments(config, input, ...additionalArguments) {
11
+ let token = config.startingToken || undefined;
12
+ let hasNext = true;
13
+ let page;
14
+ while (hasNext) {
15
+ input.NextToken = token;
16
+ input["MaxResults"] = config.pageSize;
17
+ if (config.client instanceof ConnectContactLens) {
18
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
19
+ }
20
+ else if (config.client instanceof ConnectContactLensClient) {
21
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else {
24
+ throw new Error("Invalid client, expected ConnectContactLens | ConnectContactLensClient");
25
+ }
26
+ yield page;
27
+ const prevToken = token;
28
+ token = page.NextToken;
29
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
37
30
  }
38
- return __asyncGenerator(this, arguments, function paginateListRealtimeContactAnalysisSegments_1() {
39
- var token, hasNext, page, prevToken;
40
- return __generator(this, function (_a) {
41
- switch (_a.label) {
42
- case 0:
43
- token = config.startingToken || undefined;
44
- hasNext = true;
45
- _a.label = 1;
46
- case 1:
47
- if (!hasNext) return [3, 9];
48
- input.NextToken = token;
49
- input["MaxResults"] = config.pageSize;
50
- if (!(config.client instanceof ConnectContactLens)) return [3, 3];
51
- return [4, __await(makePagedRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
52
- case 2:
53
- page = _a.sent();
54
- return [3, 6];
55
- case 3:
56
- if (!(config.client instanceof ConnectContactLensClient)) return [3, 5];
57
- return [4, __await(makePagedClientRequest.apply(void 0, __spreadArray([config.client, input], __read(additionalArguments), false)))];
58
- case 4:
59
- page = _a.sent();
60
- return [3, 6];
61
- case 5: throw new Error("Invalid client, expected ConnectContactLens | ConnectContactLensClient");
62
- case 6: return [4, __await(page)];
63
- case 7: return [4, _a.sent()];
64
- case 8:
65
- _a.sent();
66
- prevToken = token;
67
- token = page.NextToken;
68
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
69
- return [3, 1];
70
- case 9: return [4, __await(undefined)];
71
- case 10: return [2, _a.sent()];
72
- }
73
- });
74
- });
31
+ return undefined;
75
32
  }
@@ -1,170 +1,141 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ConnectContactLensServiceException as __BaseException } from "../models/ConnectContactLensServiceException";
5
4
  import { AccessDeniedException, InternalServiceException, InvalidRequestException, ResourceNotFoundException, ThrottlingException, } from "../models/models_0";
6
- export var serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {
14
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
17
- "/realtime-contact-analysis/analysis-segments";
18
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.ContactId != null && { ContactId: input.ContactId })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })));
19
- return [2, new __HttpRequest({
20
- protocol: protocol,
21
- hostname: hostname,
22
- port: port,
23
- method: "POST",
24
- headers: headers,
25
- path: resolvedPath,
26
- body: body,
27
- })];
28
- }
5
+ export const serializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
11
+ "/realtime-contact-analysis/analysis-segments";
12
+ let body;
13
+ body = JSON.stringify({
14
+ ...(input.ContactId != null && { ContactId: input.ContactId }),
15
+ ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
16
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
17
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
29
18
  });
30
- }); };
31
- export var deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
32
- var contents, data, _a, _b;
33
- return __generator(this, function (_c) {
34
- switch (_c.label) {
35
- case 0:
36
- if (output.statusCode !== 200 && output.statusCode >= 300) {
37
- return [2, deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError(output, context)];
38
- }
39
- contents = map({
40
- $metadata: deserializeMetadata(output),
41
- });
42
- _a = __expectNonNull;
43
- _b = __expectObject;
44
- return [4, parseBody(output.body, context)];
45
- case 1:
46
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
47
- if (data.NextToken != null) {
48
- contents.NextToken = __expectString(data.NextToken);
49
- }
50
- if (data.Segments != null) {
51
- contents.Segments = deserializeAws_restJson1RealtimeContactAnalysisSegments(data.Segments, context);
52
- }
53
- return [2, contents];
54
- }
19
+ return new __HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
55
27
  });
56
- }); };
57
- var deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var parsedOutput, _a, errorCode, _b, parsedBody;
59
- var _c;
60
- return __generator(this, function (_d) {
61
- switch (_d.label) {
62
- case 0:
63
- _a = [__assign({}, output)];
64
- _c = {};
65
- return [4, parseErrorBody(output.body, context)];
66
- case 1:
67
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
68
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
69
- _b = errorCode;
70
- switch (_b) {
71
- case "AccessDeniedException": return [3, 2];
72
- case "com.amazonaws.connectcontactlens#AccessDeniedException": return [3, 2];
73
- case "InternalServiceException": return [3, 4];
74
- case "com.amazonaws.connectcontactlens#InternalServiceException": return [3, 4];
75
- case "InvalidRequestException": return [3, 6];
76
- case "com.amazonaws.connectcontactlens#InvalidRequestException": return [3, 6];
77
- case "ResourceNotFoundException": return [3, 8];
78
- case "com.amazonaws.connectcontactlens#ResourceNotFoundException": return [3, 8];
79
- case "ThrottlingException": return [3, 10];
80
- case "com.amazonaws.connectcontactlens#ThrottlingException": return [3, 10];
81
- }
82
- return [3, 12];
83
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
84
- case 3: throw _d.sent();
85
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
86
- case 5: throw _d.sent();
87
- case 6: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
88
- case 7: throw _d.sent();
89
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
90
- case 9: throw _d.sent();
91
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
92
- case 11: throw _d.sent();
93
- case 12:
94
- parsedBody = parsedOutput.body;
95
- throwDefaultError({
96
- output: output,
97
- parsedBody: parsedBody,
98
- exceptionCtor: __BaseException,
99
- errorCode: errorCode,
100
- });
101
- _d.label = 13;
102
- case 13: return [2];
103
- }
28
+ };
29
+ export const deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommand = async (output, context) => {
30
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
31
+ return deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError(output, context);
32
+ }
33
+ const contents = map({
34
+ $metadata: deserializeMetadata(output),
104
35
  });
105
- }); };
106
- var map = __map;
107
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
108
- var contents, data, exception;
109
- return __generator(this, function (_a) {
110
- contents = map({});
111
- data = parsedOutput.body;
112
- if (data.Message != null) {
113
- contents.Message = __expectString(data.Message);
114
- }
115
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
116
- return [2, __decorateServiceException(exception, parsedOutput.body)];
36
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
37
+ if (data.NextToken != null) {
38
+ contents.NextToken = __expectString(data.NextToken);
39
+ }
40
+ if (data.Segments != null) {
41
+ contents.Segments = deserializeAws_restJson1RealtimeContactAnalysisSegments(data.Segments, context);
42
+ }
43
+ return contents;
44
+ };
45
+ const deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError = async (output, context) => {
46
+ const parsedOutput = {
47
+ ...output,
48
+ body: await parseErrorBody(output.body, context),
49
+ };
50
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
51
+ switch (errorCode) {
52
+ case "AccessDeniedException":
53
+ case "com.amazonaws.connectcontactlens#AccessDeniedException":
54
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
55
+ case "InternalServiceException":
56
+ case "com.amazonaws.connectcontactlens#InternalServiceException":
57
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
58
+ case "InvalidRequestException":
59
+ case "com.amazonaws.connectcontactlens#InvalidRequestException":
60
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
61
+ case "ResourceNotFoundException":
62
+ case "com.amazonaws.connectcontactlens#ResourceNotFoundException":
63
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
64
+ case "ThrottlingException":
65
+ case "com.amazonaws.connectcontactlens#ThrottlingException":
66
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
67
+ default:
68
+ const parsedBody = parsedOutput.body;
69
+ throwDefaultError({
70
+ output,
71
+ parsedBody,
72
+ exceptionCtor: __BaseException,
73
+ errorCode,
74
+ });
75
+ }
76
+ };
77
+ const map = __map;
78
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
79
+ const contents = map({});
80
+ const data = parsedOutput.body;
81
+ if (data.Message != null) {
82
+ contents.Message = __expectString(data.Message);
83
+ }
84
+ const exception = new AccessDeniedException({
85
+ $metadata: deserializeMetadata(parsedOutput),
86
+ ...contents,
117
87
  });
118
- }); };
119
- var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
120
- var contents, data, exception;
121
- return __generator(this, function (_a) {
122
- contents = map({});
123
- data = parsedOutput.body;
124
- if (data.Message != null) {
125
- contents.Message = __expectString(data.Message);
126
- }
127
- exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
128
- return [2, __decorateServiceException(exception, parsedOutput.body)];
88
+ return __decorateServiceException(exception, parsedOutput.body);
89
+ };
90
+ const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
91
+ const contents = map({});
92
+ const data = parsedOutput.body;
93
+ if (data.Message != null) {
94
+ contents.Message = __expectString(data.Message);
95
+ }
96
+ const exception = new InternalServiceException({
97
+ $metadata: deserializeMetadata(parsedOutput),
98
+ ...contents,
129
99
  });
130
- }); };
131
- var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
132
- var contents, data, exception;
133
- return __generator(this, function (_a) {
134
- contents = map({});
135
- data = parsedOutput.body;
136
- if (data.Message != null) {
137
- contents.Message = __expectString(data.Message);
138
- }
139
- exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
140
- return [2, __decorateServiceException(exception, parsedOutput.body)];
100
+ return __decorateServiceException(exception, parsedOutput.body);
101
+ };
102
+ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
103
+ const contents = map({});
104
+ const data = parsedOutput.body;
105
+ if (data.Message != null) {
106
+ contents.Message = __expectString(data.Message);
107
+ }
108
+ const exception = new InvalidRequestException({
109
+ $metadata: deserializeMetadata(parsedOutput),
110
+ ...contents,
141
111
  });
142
- }); };
143
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
144
- var contents, data, exception;
145
- return __generator(this, function (_a) {
146
- contents = map({});
147
- data = parsedOutput.body;
148
- if (data.Message != null) {
149
- contents.Message = __expectString(data.Message);
150
- }
151
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
152
- return [2, __decorateServiceException(exception, parsedOutput.body)];
112
+ return __decorateServiceException(exception, parsedOutput.body);
113
+ };
114
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
115
+ const contents = map({});
116
+ const data = parsedOutput.body;
117
+ if (data.Message != null) {
118
+ contents.Message = __expectString(data.Message);
119
+ }
120
+ const exception = new ResourceNotFoundException({
121
+ $metadata: deserializeMetadata(parsedOutput),
122
+ ...contents,
153
123
  });
154
- }); };
155
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
156
- var contents, data, exception;
157
- return __generator(this, function (_a) {
158
- contents = map({});
159
- data = parsedOutput.body;
160
- if (data.Message != null) {
161
- contents.Message = __expectString(data.Message);
162
- }
163
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
164
- return [2, __decorateServiceException(exception, parsedOutput.body)];
124
+ return __decorateServiceException(exception, parsedOutput.body);
125
+ };
126
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
127
+ const contents = map({});
128
+ const data = parsedOutput.body;
129
+ if (data.Message != null) {
130
+ contents.Message = __expectString(data.Message);
131
+ }
132
+ const exception = new ThrottlingException({
133
+ $metadata: deserializeMetadata(parsedOutput),
134
+ ...contents,
165
135
  });
166
- }); };
167
- var deserializeAws_restJson1Categories = function (output, context) {
136
+ return __decorateServiceException(exception, parsedOutput.body);
137
+ };
138
+ const deserializeAws_restJson1Categories = (output, context) => {
168
139
  return {
169
140
  MatchedCategories: output.MatchedCategories != null
170
141
  ? deserializeAws_restJson1MatchedCategories(output.MatchedCategories, context)
@@ -174,30 +145,30 @@ var deserializeAws_restJson1Categories = function (output, context) {
174
145
  : undefined,
175
146
  };
176
147
  };
177
- var deserializeAws_restJson1CategoryDetails = function (output, context) {
148
+ const deserializeAws_restJson1CategoryDetails = (output, context) => {
178
149
  return {
179
150
  PointsOfInterest: output.PointsOfInterest != null
180
151
  ? deserializeAws_restJson1PointsOfInterest(output.PointsOfInterest, context)
181
152
  : undefined,
182
153
  };
183
154
  };
184
- var deserializeAws_restJson1CharacterOffsets = function (output, context) {
155
+ const deserializeAws_restJson1CharacterOffsets = (output, context) => {
185
156
  return {
186
157
  BeginOffsetChar: __expectInt32(output.BeginOffsetChar),
187
158
  EndOffsetChar: __expectInt32(output.EndOffsetChar),
188
159
  };
189
160
  };
190
- var deserializeAws_restJson1IssueDetected = function (output, context) {
161
+ const deserializeAws_restJson1IssueDetected = (output, context) => {
191
162
  return {
192
163
  CharacterOffsets: output.CharacterOffsets != null
193
164
  ? deserializeAws_restJson1CharacterOffsets(output.CharacterOffsets, context)
194
165
  : undefined,
195
166
  };
196
167
  };
197
- var deserializeAws_restJson1IssuesDetected = function (output, context) {
198
- var retVal = (output || [])
199
- .filter(function (e) { return e != null; })
200
- .map(function (entry) {
168
+ const deserializeAws_restJson1IssuesDetected = (output, context) => {
169
+ const retVal = (output || [])
170
+ .filter((e) => e != null)
171
+ .map((entry) => {
201
172
  if (entry === null) {
202
173
  return null;
203
174
  }
@@ -205,10 +176,10 @@ var deserializeAws_restJson1IssuesDetected = function (output, context) {
205
176
  });
206
177
  return retVal;
207
178
  };
208
- var deserializeAws_restJson1MatchedCategories = function (output, context) {
209
- var retVal = (output || [])
210
- .filter(function (e) { return e != null; })
211
- .map(function (entry) {
179
+ const deserializeAws_restJson1MatchedCategories = (output, context) => {
180
+ const retVal = (output || [])
181
+ .filter((e) => e != null)
182
+ .map((entry) => {
212
183
  if (entry === null) {
213
184
  return null;
214
185
  }
@@ -216,26 +187,27 @@ var deserializeAws_restJson1MatchedCategories = function (output, context) {
216
187
  });
217
188
  return retVal;
218
189
  };
219
- var deserializeAws_restJson1MatchedDetails = function (output, context) {
220
- return Object.entries(output).reduce(function (acc, _a) {
221
- var _b;
222
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
190
+ const deserializeAws_restJson1MatchedDetails = (output, context) => {
191
+ return Object.entries(output).reduce((acc, [key, value]) => {
223
192
  if (value === null) {
224
193
  return acc;
225
194
  }
226
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1CategoryDetails(value, context), _b));
195
+ return {
196
+ ...acc,
197
+ [key]: deserializeAws_restJson1CategoryDetails(value, context),
198
+ };
227
199
  }, {});
228
200
  };
229
- var deserializeAws_restJson1PointOfInterest = function (output, context) {
201
+ const deserializeAws_restJson1PointOfInterest = (output, context) => {
230
202
  return {
231
203
  BeginOffsetMillis: __expectInt32(output.BeginOffsetMillis),
232
204
  EndOffsetMillis: __expectInt32(output.EndOffsetMillis),
233
205
  };
234
206
  };
235
- var deserializeAws_restJson1PointsOfInterest = function (output, context) {
236
- var retVal = (output || [])
237
- .filter(function (e) { return e != null; })
238
- .map(function (entry) {
207
+ const deserializeAws_restJson1PointsOfInterest = (output, context) => {
208
+ const retVal = (output || [])
209
+ .filter((e) => e != null)
210
+ .map((entry) => {
239
211
  if (entry === null) {
240
212
  return null;
241
213
  }
@@ -243,16 +215,16 @@ var deserializeAws_restJson1PointsOfInterest = function (output, context) {
243
215
  });
244
216
  return retVal;
245
217
  };
246
- var deserializeAws_restJson1RealtimeContactAnalysisSegment = function (output, context) {
218
+ const deserializeAws_restJson1RealtimeContactAnalysisSegment = (output, context) => {
247
219
  return {
248
220
  Categories: output.Categories != null ? deserializeAws_restJson1Categories(output.Categories, context) : undefined,
249
221
  Transcript: output.Transcript != null ? deserializeAws_restJson1Transcript(output.Transcript, context) : undefined,
250
222
  };
251
223
  };
252
- var deserializeAws_restJson1RealtimeContactAnalysisSegments = function (output, context) {
253
- var retVal = (output || [])
254
- .filter(function (e) { return e != null; })
255
- .map(function (entry) {
224
+ const deserializeAws_restJson1RealtimeContactAnalysisSegments = (output, context) => {
225
+ const retVal = (output || [])
226
+ .filter((e) => e != null)
227
+ .map((entry) => {
256
228
  if (entry === null) {
257
229
  return null;
258
230
  }
@@ -260,7 +232,7 @@ var deserializeAws_restJson1RealtimeContactAnalysisSegments = function (output,
260
232
  });
261
233
  return retVal;
262
234
  };
263
- var deserializeAws_restJson1Transcript = function (output, context) {
235
+ const deserializeAws_restJson1Transcript = (output, context) => {
264
236
  return {
265
237
  BeginOffsetMillis: __expectInt32(output.BeginOffsetMillis),
266
238
  Content: __expectString(output.Content),
@@ -274,57 +246,39 @@ var deserializeAws_restJson1Transcript = function (output, context) {
274
246
  Sentiment: __expectString(output.Sentiment),
275
247
  };
276
248
  };
277
- var deserializeMetadata = function (output) {
278
- var _a, _b;
279
- return ({
280
- httpStatusCode: output.statusCode,
281
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
282
- extendedRequestId: output.headers["x-amz-id-2"],
283
- cfId: output.headers["x-amz-cf-id"],
284
- });
285
- };
286
- var collectBody = function (streamBody, context) {
287
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
249
+ const deserializeMetadata = (output) => ({
250
+ httpStatusCode: output.statusCode,
251
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
252
+ extendedRequestId: output.headers["x-amz-id-2"],
253
+ cfId: output.headers["x-amz-cf-id"],
254
+ });
255
+ const collectBody = (streamBody = new Uint8Array(), context) => {
288
256
  if (streamBody instanceof Uint8Array) {
289
257
  return Promise.resolve(streamBody);
290
258
  }
291
259
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
292
260
  };
293
- var collectBodyString = function (streamBody, context) {
294
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
295
- };
296
- var isSerializableHeaderValue = function (value) {
297
- return value !== undefined &&
298
- value !== null &&
299
- value !== "" &&
300
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
301
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
302
- };
303
- var parseBody = function (streamBody, context) {
304
- return collectBodyString(streamBody, context).then(function (encoded) {
305
- if (encoded.length) {
306
- return JSON.parse(encoded);
307
- }
308
- return {};
309
- });
261
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
262
+ const isSerializableHeaderValue = (value) => value !== undefined &&
263
+ value !== null &&
264
+ value !== "" &&
265
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
266
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
267
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
268
+ if (encoded.length) {
269
+ return JSON.parse(encoded);
270
+ }
271
+ return {};
272
+ });
273
+ const parseErrorBody = async (errorBody, context) => {
274
+ const value = await parseBody(errorBody, context);
275
+ value.message = value.message ?? value.Message;
276
+ return value;
310
277
  };
311
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
312
- var value;
313
- var _a;
314
- return __generator(this, function (_b) {
315
- switch (_b.label) {
316
- case 0: return [4, parseBody(errorBody, context)];
317
- case 1:
318
- value = _b.sent();
319
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
320
- return [2, value];
321
- }
322
- });
323
- }); };
324
- var loadRestJsonErrorCode = function (output, data) {
325
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
326
- var sanitizeErrorCode = function (rawValue) {
327
- var cleanValue = rawValue;
278
+ const loadRestJsonErrorCode = (output, data) => {
279
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
280
+ const sanitizeErrorCode = (rawValue) => {
281
+ let cleanValue = rawValue;
328
282
  if (typeof cleanValue === "number") {
329
283
  cleanValue = cleanValue.toString();
330
284
  }
@@ -339,7 +293,7 @@ var loadRestJsonErrorCode = function (output, data) {
339
293
  }
340
294
  return cleanValue;
341
295
  };
342
- var headerKey = findKey(output.headers, "x-amzn-errortype");
296
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
343
297
  if (headerKey !== undefined) {
344
298
  return sanitizeErrorCode(output.headers[headerKey]);
345
299
  }
@@ -1,4 +1,3 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import packageInfo from "../package.json";
3
2
  import { Sha256 } from "@aws-crypto/sha256-browser";
4
3
  import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
@@ -12,15 +11,30 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
12
11
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
12
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
14
13
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
15
- export var getRuntimeConfig = function (config) {
16
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
17
- var defaultsMode = resolveDefaultsModeConfig(config);
18
- var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
19
- var clientSharedValues = getSharedRuntimeConfig(config);
20
- 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 }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
21
- switch (_a.label) {
22
- case 0: return [4, defaultConfigProvider()];
23
- case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
24
- }
25
- }); }); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
14
+ export const getRuntimeConfig = (config) => {
15
+ const defaultsMode = resolveDefaultsModeConfig(config);
16
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
17
+ const clientSharedValues = getSharedRuntimeConfig(config);
18
+ return {
19
+ ...clientSharedValues,
20
+ ...config,
21
+ runtime: "browser",
22
+ defaultsMode,
23
+ base64Decoder: config?.base64Decoder ?? fromBase64,
24
+ base64Encoder: config?.base64Encoder ?? toBase64,
25
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
26
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
27
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
28
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
29
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
30
+ region: config?.region ?? invalidProvider("Region is missing"),
31
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
32
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
33
+ sha256: config?.sha256 ?? Sha256,
34
+ streamCollector: config?.streamCollector ?? streamCollector,
35
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
36
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
37
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
38
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
39
+ };
26
40
  };
@@ -1,4 +1,3 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import packageInfo from "../package.json";
3
2
  import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
4
3
  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";
@@ -15,16 +14,35 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar
15
14
  import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
16
15
  import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
17
16
  import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
18
- export var getRuntimeConfig = function (config) {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
17
+ export const getRuntimeConfig = (config) => {
20
18
  emitWarningIfUnsupportedVersion(process.version);
21
- var defaultsMode = resolveDefaultsModeConfig(config);
22
- var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
23
- var clientSharedValues = getSharedRuntimeConfig(config);
24
- 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 }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
25
- switch (_a.label) {
26
- case 0: return [4, defaultConfigProvider()];
27
- case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
28
- }
29
- }); }); } })), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "sha256"), streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
19
+ const defaultsMode = resolveDefaultsModeConfig(config);
20
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
21
+ const clientSharedValues = getSharedRuntimeConfig(config);
22
+ return {
23
+ ...clientSharedValues,
24
+ ...config,
25
+ runtime: "node",
26
+ defaultsMode,
27
+ base64Decoder: config?.base64Decoder ?? fromBase64,
28
+ base64Encoder: config?.base64Encoder ?? toBase64,
29
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
30
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
31
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
32
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
33
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
34
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
35
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
36
+ retryMode: config?.retryMode ??
37
+ loadNodeConfig({
38
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
39
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
40
+ }),
41
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
42
+ streamCollector: config?.streamCollector ?? streamCollector,
43
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
44
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
45
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
46
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
47
+ };
30
48
  };
@@ -1,8 +1,11 @@
1
- import { __assign } from "tslib";
2
1
  import { Sha256 } from "@aws-crypto/sha256-js";
3
2
  import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
- export var getRuntimeConfig = function (config) {
5
- var _a;
6
- var browserDefaults = getBrowserRuntimeConfig(config);
7
- return __assign(__assign(__assign({}, browserDefaults), config), { runtime: "react-native", sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : Sha256 });
3
+ export const getRuntimeConfig = (config) => {
4
+ const browserDefaults = getBrowserRuntimeConfig(config);
5
+ return {
6
+ ...browserDefaults,
7
+ ...config,
8
+ runtime: "react-native",
9
+ sha256: config?.sha256 ?? Sha256,
10
+ };
8
11
  };
@@ -1,13 +1,10 @@
1
1
  import { parseUrl } from "@aws-sdk/url-parser";
2
2
  import { defaultRegionInfoProvider } from "./endpoints";
3
- export var getRuntimeConfig = function (config) {
4
- var _a, _b, _c, _d, _e;
5
- return ({
6
- apiVersion: "2020-08-21",
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 : "Connect Contact Lens",
11
- urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : parseUrl,
12
- });
13
- };
3
+ export const getRuntimeConfig = (config) => ({
4
+ apiVersion: "2020-08-21",
5
+ disableHostPrefix: config?.disableHostPrefix ?? false,
6
+ logger: config?.logger ?? {},
7
+ regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
8
+ serviceId: config?.serviceId ?? "Connect Contact Lens",
9
+ urlParser: config?.urlParser ?? parseUrl,
10
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-connect-contact-lens",
3
3
  "description": "AWS SDK for JavaScript Connect Contact Lens Client for Node.js, Browser and React Native",
4
- "version": "3.186.0",
4
+ "version": "3.190.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,41 +19,41 @@
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.186.0",
23
- "@aws-sdk/config-resolver": "3.186.0",
24
- "@aws-sdk/credential-provider-node": "3.186.0",
25
- "@aws-sdk/fetch-http-handler": "3.186.0",
26
- "@aws-sdk/hash-node": "3.186.0",
27
- "@aws-sdk/invalid-dependency": "3.186.0",
28
- "@aws-sdk/middleware-content-length": "3.186.0",
29
- "@aws-sdk/middleware-host-header": "3.186.0",
30
- "@aws-sdk/middleware-logger": "3.186.0",
31
- "@aws-sdk/middleware-recursion-detection": "3.186.0",
32
- "@aws-sdk/middleware-retry": "3.186.0",
33
- "@aws-sdk/middleware-serde": "3.186.0",
34
- "@aws-sdk/middleware-signing": "3.186.0",
35
- "@aws-sdk/middleware-stack": "3.186.0",
36
- "@aws-sdk/middleware-user-agent": "3.186.0",
37
- "@aws-sdk/node-config-provider": "3.186.0",
38
- "@aws-sdk/node-http-handler": "3.186.0",
39
- "@aws-sdk/protocol-http": "3.186.0",
40
- "@aws-sdk/smithy-client": "3.186.0",
41
- "@aws-sdk/types": "3.186.0",
42
- "@aws-sdk/url-parser": "3.186.0",
43
- "@aws-sdk/util-base64-browser": "3.186.0",
44
- "@aws-sdk/util-base64-node": "3.186.0",
45
- "@aws-sdk/util-body-length-browser": "3.186.0",
46
- "@aws-sdk/util-body-length-node": "3.186.0",
47
- "@aws-sdk/util-defaults-mode-browser": "3.186.0",
48
- "@aws-sdk/util-defaults-mode-node": "3.186.0",
49
- "@aws-sdk/util-user-agent-browser": "3.186.0",
50
- "@aws-sdk/util-user-agent-node": "3.186.0",
51
- "@aws-sdk/util-utf8-browser": "3.186.0",
52
- "@aws-sdk/util-utf8-node": "3.186.0",
22
+ "@aws-sdk/client-sts": "3.190.0",
23
+ "@aws-sdk/config-resolver": "3.190.0",
24
+ "@aws-sdk/credential-provider-node": "3.190.0",
25
+ "@aws-sdk/fetch-http-handler": "3.190.0",
26
+ "@aws-sdk/hash-node": "3.190.0",
27
+ "@aws-sdk/invalid-dependency": "3.190.0",
28
+ "@aws-sdk/middleware-content-length": "3.190.0",
29
+ "@aws-sdk/middleware-host-header": "3.190.0",
30
+ "@aws-sdk/middleware-logger": "3.190.0",
31
+ "@aws-sdk/middleware-recursion-detection": "3.190.0",
32
+ "@aws-sdk/middleware-retry": "3.190.0",
33
+ "@aws-sdk/middleware-serde": "3.190.0",
34
+ "@aws-sdk/middleware-signing": "3.190.0",
35
+ "@aws-sdk/middleware-stack": "3.190.0",
36
+ "@aws-sdk/middleware-user-agent": "3.190.0",
37
+ "@aws-sdk/node-config-provider": "3.190.0",
38
+ "@aws-sdk/node-http-handler": "3.190.0",
39
+ "@aws-sdk/protocol-http": "3.190.0",
40
+ "@aws-sdk/smithy-client": "3.190.0",
41
+ "@aws-sdk/types": "3.190.0",
42
+ "@aws-sdk/url-parser": "3.190.0",
43
+ "@aws-sdk/util-base64-browser": "3.188.0",
44
+ "@aws-sdk/util-base64-node": "3.188.0",
45
+ "@aws-sdk/util-body-length-browser": "3.188.0",
46
+ "@aws-sdk/util-body-length-node": "3.188.0",
47
+ "@aws-sdk/util-defaults-mode-browser": "3.190.0",
48
+ "@aws-sdk/util-defaults-mode-node": "3.190.0",
49
+ "@aws-sdk/util-user-agent-browser": "3.190.0",
50
+ "@aws-sdk/util-user-agent-node": "3.190.0",
51
+ "@aws-sdk/util-utf8-browser": "3.188.0",
52
+ "@aws-sdk/util-utf8-node": "3.188.0",
53
53
  "tslib": "^2.3.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@aws-sdk/service-client-documentation-generator": "3.186.0",
56
+ "@aws-sdk/service-client-documentation-generator": "3.188.0",
57
57
  "@tsconfig/recommended": "1.0.1",
58
58
  "@types/node": "^12.7.5",
59
59
  "concurrently": "7.0.0",