@aws-sdk/client-kinesis-video-media 3.181.0 → 3.183.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,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-kinesis-video-media
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
7
15
 
8
16
 
@@ -1,25 +1,18 @@
1
- import { __extends } from "tslib";
2
1
  import { GetMediaCommand } from "./commands/GetMediaCommand";
3
2
  import { KinesisVideoMediaClient } from "./KinesisVideoMediaClient";
4
- var KinesisVideoMedia = (function (_super) {
5
- __extends(KinesisVideoMedia, _super);
6
- function KinesisVideoMedia() {
7
- return _super !== null && _super.apply(this, arguments) || this;
8
- }
9
- KinesisVideoMedia.prototype.getMedia = function (args, optionsOrCb, cb) {
10
- var command = new GetMediaCommand(args);
3
+ export class KinesisVideoMedia extends KinesisVideoMediaClient {
4
+ getMedia(args, optionsOrCb, cb) {
5
+ const command = new GetMediaCommand(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 KinesisVideoMedia;
24
- }(KinesisVideoMediaClient));
25
- export { KinesisVideoMedia };
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 KinesisVideoMediaClient = (function (_super) {
13
- __extends(KinesisVideoMediaClient, _super);
14
- function KinesisVideoMediaClient(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 KinesisVideoMediaClient 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
- KinesisVideoMediaClient.prototype.destroy = function () {
35
- _super.prototype.destroy.call(this);
36
- };
37
- return KinesisVideoMediaClient;
38
- }(__Client));
39
- export { KinesisVideoMediaClient };
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 { GetMediaInputFilterSensitiveLog, GetMediaOutputFilterSensitiveLog, } from "../models/models_0";
5
4
  import { deserializeAws_restJson1GetMediaCommand, serializeAws_restJson1GetMediaCommand, } from "../protocols/Aws_restJson1";
6
- var GetMediaCommand = (function (_super) {
7
- __extends(GetMediaCommand, _super);
8
- function GetMediaCommand(input) {
9
- var _this = _super.call(this) || this;
10
- _this.input = input;
11
- return _this;
5
+ export class GetMediaCommand extends $Command {
6
+ constructor(input) {
7
+ super();
8
+ this.input = input;
12
9
  }
13
- GetMediaCommand.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 = "KinesisVideoMediaClient";
18
- var commandName = "GetMediaCommand";
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 = "KinesisVideoMediaClient";
15
+ const commandName = "GetMediaCommand";
16
+ const handlerExecutionContext = {
17
+ logger,
18
+ clientName,
19
+ commandName,
23
20
  inputFilterSensitiveLog: GetMediaInputFilterSensitiveLog,
24
21
  outputFilterSensitiveLog: GetMediaOutputFilterSensitiveLog,
25
22
  };
26
- var requestHandler = configuration.requestHandler;
27
- return stack.resolve(function (request) {
28
- return requestHandler.handle(request.request, options || {});
29
- }, handlerExecutionContext);
30
- };
31
- GetMediaCommand.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_restJson1GetMediaCommand(input, context);
33
- };
34
- GetMediaCommand.prototype.deserialize = function (output, context) {
28
+ }
29
+ deserialize(output, context) {
35
30
  return deserializeAws_restJson1GetMediaCommand(output, context);
36
- };
37
- return GetMediaCommand;
38
- }($Command));
39
- export { GetMediaCommand };
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: "kinesisvideo", regionHash: regionHash, partitionHash: partitionHash }))];
127
- });
128
- }); };
123
+ export const defaultRegionInfoProvider = async (region, options) => getRegionInfo(region, {
124
+ ...options,
125
+ signingService: "kinesisvideo",
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 KinesisVideoMediaServiceException = (function (_super) {
4
- __extends(KinesisVideoMediaServiceException, _super);
5
- function KinesisVideoMediaServiceException(options) {
6
- var _this = _super.call(this, options) || this;
7
- Object.setPrototypeOf(_this, KinesisVideoMediaServiceException.prototype);
8
- return _this;
2
+ export class KinesisVideoMediaServiceException extends __ServiceException {
3
+ constructor(options) {
4
+ super(options);
5
+ Object.setPrototypeOf(this, KinesisVideoMediaServiceException.prototype);
9
6
  }
10
- return KinesisVideoMediaServiceException;
11
- }(__ServiceException));
12
- export { KinesisVideoMediaServiceException };
7
+ }
@@ -1,31 +1,30 @@
1
- import { __assign, __extends } from "tslib";
2
1
  import { KinesisVideoMediaServiceException as __BaseException } from "./KinesisVideoMediaServiceException";
3
- var ClientLimitExceededException = (function (_super) {
4
- __extends(ClientLimitExceededException, _super);
5
- function ClientLimitExceededException(opts) {
6
- var _this = _super.call(this, __assign({ name: "ClientLimitExceededException", $fault: "client" }, opts)) || this;
7
- _this.name = "ClientLimitExceededException";
8
- _this.$fault = "client";
9
- Object.setPrototypeOf(_this, ClientLimitExceededException.prototype);
10
- _this.Message = opts.Message;
11
- return _this;
2
+ export class ClientLimitExceededException extends __BaseException {
3
+ constructor(opts) {
4
+ super({
5
+ name: "ClientLimitExceededException",
6
+ $fault: "client",
7
+ ...opts,
8
+ });
9
+ this.name = "ClientLimitExceededException";
10
+ this.$fault = "client";
11
+ Object.setPrototypeOf(this, ClientLimitExceededException.prototype);
12
+ this.Message = opts.Message;
12
13
  }
13
- return ClientLimitExceededException;
14
- }(__BaseException));
15
- export { ClientLimitExceededException };
16
- var ConnectionLimitExceededException = (function (_super) {
17
- __extends(ConnectionLimitExceededException, _super);
18
- function ConnectionLimitExceededException(opts) {
19
- var _this = _super.call(this, __assign({ name: "ConnectionLimitExceededException", $fault: "client" }, opts)) || this;
20
- _this.name = "ConnectionLimitExceededException";
21
- _this.$fault = "client";
22
- Object.setPrototypeOf(_this, ConnectionLimitExceededException.prototype);
23
- _this.Message = opts.Message;
24
- return _this;
14
+ }
15
+ export class ConnectionLimitExceededException extends __BaseException {
16
+ constructor(opts) {
17
+ super({
18
+ name: "ConnectionLimitExceededException",
19
+ $fault: "client",
20
+ ...opts,
21
+ });
22
+ this.name = "ConnectionLimitExceededException";
23
+ this.$fault = "client";
24
+ Object.setPrototypeOf(this, ConnectionLimitExceededException.prototype);
25
+ this.Message = opts.Message;
25
26
  }
26
- return ConnectionLimitExceededException;
27
- }(__BaseException));
28
- export { ConnectionLimitExceededException };
27
+ }
29
28
  export var StartSelectorType;
30
29
  (function (StartSelectorType) {
31
30
  StartSelectorType["CONTINUATION_TOKEN"] = "CONTINUATION_TOKEN";
@@ -35,58 +34,64 @@ export var StartSelectorType;
35
34
  StartSelectorType["PRODUCER_TIMESTAMP"] = "PRODUCER_TIMESTAMP";
36
35
  StartSelectorType["SERVER_TIMESTAMP"] = "SERVER_TIMESTAMP";
37
36
  })(StartSelectorType || (StartSelectorType = {}));
38
- var InvalidArgumentException = (function (_super) {
39
- __extends(InvalidArgumentException, _super);
40
- function InvalidArgumentException(opts) {
41
- var _this = _super.call(this, __assign({ name: "InvalidArgumentException", $fault: "client" }, opts)) || this;
42
- _this.name = "InvalidArgumentException";
43
- _this.$fault = "client";
44
- Object.setPrototypeOf(_this, InvalidArgumentException.prototype);
45
- _this.Message = opts.Message;
46
- return _this;
37
+ export class InvalidArgumentException extends __BaseException {
38
+ constructor(opts) {
39
+ super({
40
+ name: "InvalidArgumentException",
41
+ $fault: "client",
42
+ ...opts,
43
+ });
44
+ this.name = "InvalidArgumentException";
45
+ this.$fault = "client";
46
+ Object.setPrototypeOf(this, InvalidArgumentException.prototype);
47
+ this.Message = opts.Message;
47
48
  }
48
- return InvalidArgumentException;
49
- }(__BaseException));
50
- export { InvalidArgumentException };
51
- var InvalidEndpointException = (function (_super) {
52
- __extends(InvalidEndpointException, _super);
53
- function InvalidEndpointException(opts) {
54
- var _this = _super.call(this, __assign({ name: "InvalidEndpointException", $fault: "client" }, opts)) || this;
55
- _this.name = "InvalidEndpointException";
56
- _this.$fault = "client";
57
- Object.setPrototypeOf(_this, InvalidEndpointException.prototype);
58
- _this.Message = opts.Message;
59
- return _this;
49
+ }
50
+ export class InvalidEndpointException extends __BaseException {
51
+ constructor(opts) {
52
+ super({
53
+ name: "InvalidEndpointException",
54
+ $fault: "client",
55
+ ...opts,
56
+ });
57
+ this.name = "InvalidEndpointException";
58
+ this.$fault = "client";
59
+ Object.setPrototypeOf(this, InvalidEndpointException.prototype);
60
+ this.Message = opts.Message;
60
61
  }
61
- return InvalidEndpointException;
62
- }(__BaseException));
63
- export { InvalidEndpointException };
64
- var NotAuthorizedException = (function (_super) {
65
- __extends(NotAuthorizedException, _super);
66
- function NotAuthorizedException(opts) {
67
- var _this = _super.call(this, __assign({ name: "NotAuthorizedException", $fault: "client" }, opts)) || this;
68
- _this.name = "NotAuthorizedException";
69
- _this.$fault = "client";
70
- Object.setPrototypeOf(_this, NotAuthorizedException.prototype);
71
- _this.Message = opts.Message;
72
- return _this;
62
+ }
63
+ export class NotAuthorizedException extends __BaseException {
64
+ constructor(opts) {
65
+ super({
66
+ name: "NotAuthorizedException",
67
+ $fault: "client",
68
+ ...opts,
69
+ });
70
+ this.name = "NotAuthorizedException";
71
+ this.$fault = "client";
72
+ Object.setPrototypeOf(this, NotAuthorizedException.prototype);
73
+ this.Message = opts.Message;
73
74
  }
74
- return NotAuthorizedException;
75
- }(__BaseException));
76
- export { NotAuthorizedException };
77
- var ResourceNotFoundException = (function (_super) {
78
- __extends(ResourceNotFoundException, _super);
79
- function ResourceNotFoundException(opts) {
80
- var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
81
- _this.name = "ResourceNotFoundException";
82
- _this.$fault = "client";
83
- Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
84
- _this.Message = opts.Message;
85
- return _this;
75
+ }
76
+ export class ResourceNotFoundException extends __BaseException {
77
+ constructor(opts) {
78
+ super({
79
+ name: "ResourceNotFoundException",
80
+ $fault: "client",
81
+ ...opts,
82
+ });
83
+ this.name = "ResourceNotFoundException";
84
+ this.$fault = "client";
85
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
86
+ this.Message = opts.Message;
86
87
  }
87
- return ResourceNotFoundException;
88
- }(__BaseException));
89
- export { ResourceNotFoundException };
90
- export var StartSelectorFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
91
- export var GetMediaInputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
92
- export var GetMediaOutputFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
88
+ }
89
+ export const StartSelectorFilterSensitiveLog = (obj) => ({
90
+ ...obj,
91
+ });
92
+ export const GetMediaInputFilterSensitiveLog = (obj) => ({
93
+ ...obj,
94
+ });
95
+ export const GetMediaOutputFilterSensitiveLog = (obj) => ({
96
+ ...obj,
97
+ });
@@ -1,229 +1,192 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { KinesisVideoMediaServiceException as __BaseException } from "../models/KinesisVideoMediaServiceException";
5
4
  import { ClientLimitExceededException, ConnectionLimitExceededException, InvalidArgumentException, InvalidEndpointException, NotAuthorizedException, ResourceNotFoundException, } from "../models/models_0";
6
- export var serializeAws_restJson1GetMediaCommand = 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 || "") + "/getMedia";
17
- body = JSON.stringify(__assign(__assign(__assign({}, (input.StartSelector != null && {
18
- StartSelector: serializeAws_restJson1StartSelector(input.StartSelector, context),
19
- })), (input.StreamARN != null && { StreamARN: input.StreamARN })), (input.StreamName != null && { StreamName: input.StreamName })));
20
- return [2, new __HttpRequest({
21
- protocol: protocol,
22
- hostname: hostname,
23
- port: port,
24
- method: "POST",
25
- headers: headers,
26
- path: resolvedPath,
27
- body: body,
28
- })];
29
- }
30
- });
31
- }); };
32
- export var deserializeAws_restJson1GetMediaCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var contents, data;
34
- return __generator(this, function (_a) {
35
- if (output.statusCode !== 200 && output.statusCode >= 300) {
36
- return [2, deserializeAws_restJson1GetMediaCommandError(output, context)];
37
- }
38
- contents = map({
39
- $metadata: deserializeMetadata(output),
40
- ContentType: [, output.headers["content-type"]],
41
- });
42
- data = output.body;
43
- contents.Payload = data;
44
- return [2, contents];
5
+ export const serializeAws_restJson1GetMediaCommand = 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 || ""}` + "/getMedia";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.StartSelector != null && {
14
+ StartSelector: serializeAws_restJson1StartSelector(input.StartSelector, context),
15
+ }),
16
+ ...(input.StreamARN != null && { StreamARN: input.StreamARN }),
17
+ ...(input.StreamName != null && { StreamName: input.StreamName }),
45
18
  });
46
- }); };
47
- var deserializeAws_restJson1GetMediaCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
48
- var parsedOutput, _a, errorCode, _b, parsedBody;
49
- var _c;
50
- return __generator(this, function (_d) {
51
- switch (_d.label) {
52
- case 0:
53
- _a = [__assign({}, output)];
54
- _c = {};
55
- return [4, parseErrorBody(output.body, context)];
56
- case 1:
57
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
58
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
59
- _b = errorCode;
60
- switch (_b) {
61
- case "ClientLimitExceededException": return [3, 2];
62
- case "com.amazonaws.kinesisvideomedia#ClientLimitExceededException": return [3, 2];
63
- case "ConnectionLimitExceededException": return [3, 4];
64
- case "com.amazonaws.kinesisvideomedia#ConnectionLimitExceededException": return [3, 4];
65
- case "InvalidArgumentException": return [3, 6];
66
- case "com.amazonaws.kinesisvideomedia#InvalidArgumentException": return [3, 6];
67
- case "InvalidEndpointException": return [3, 8];
68
- case "com.amazonaws.kinesisvideomedia#InvalidEndpointException": return [3, 8];
69
- case "NotAuthorizedException": return [3, 10];
70
- case "com.amazonaws.kinesisvideomedia#NotAuthorizedException": return [3, 10];
71
- case "ResourceNotFoundException": return [3, 12];
72
- case "com.amazonaws.kinesisvideomedia#ResourceNotFoundException": return [3, 12];
73
- }
74
- return [3, 14];
75
- case 2: return [4, deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context)];
76
- case 3: throw _d.sent();
77
- case 4: return [4, deserializeAws_restJson1ConnectionLimitExceededExceptionResponse(parsedOutput, context)];
78
- case 5: throw _d.sent();
79
- case 6: return [4, deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context)];
80
- case 7: throw _d.sent();
81
- case 8: return [4, deserializeAws_restJson1InvalidEndpointExceptionResponse(parsedOutput, context)];
82
- case 9: throw _d.sent();
83
- case 10: return [4, deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)];
84
- case 11: throw _d.sent();
85
- case 12: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
86
- case 13: throw _d.sent();
87
- case 14:
88
- parsedBody = parsedOutput.body;
89
- throwDefaultError({
90
- output: output,
91
- parsedBody: parsedBody,
92
- exceptionCtor: __BaseException,
93
- errorCode: errorCode,
94
- });
95
- _d.label = 15;
96
- case 15: return [2];
97
- }
19
+ return new __HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "POST",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
98
27
  });
99
- }); };
100
- var map = __map;
101
- var deserializeAws_restJson1ClientLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
102
- var contents, data, exception;
103
- return __generator(this, function (_a) {
104
- contents = map({});
105
- data = parsedOutput.body;
106
- if (data.Message != null) {
107
- contents.Message = __expectString(data.Message);
108
- }
109
- exception = new ClientLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
110
- return [2, __decorateServiceException(exception, parsedOutput.body)];
28
+ };
29
+ export const deserializeAws_restJson1GetMediaCommand = async (output, context) => {
30
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
31
+ return deserializeAws_restJson1GetMediaCommandError(output, context);
32
+ }
33
+ const contents = map({
34
+ $metadata: deserializeMetadata(output),
35
+ ContentType: [, output.headers["content-type"]],
111
36
  });
112
- }); };
113
- var deserializeAws_restJson1ConnectionLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
114
- var contents, data, exception;
115
- return __generator(this, function (_a) {
116
- contents = map({});
117
- data = parsedOutput.body;
118
- if (data.Message != null) {
119
- contents.Message = __expectString(data.Message);
120
- }
121
- exception = new ConnectionLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
122
- return [2, __decorateServiceException(exception, parsedOutput.body)];
37
+ const data = output.body;
38
+ contents.Payload = data;
39
+ return contents;
40
+ };
41
+ const deserializeAws_restJson1GetMediaCommandError = async (output, context) => {
42
+ const parsedOutput = {
43
+ ...output,
44
+ body: await parseErrorBody(output.body, context),
45
+ };
46
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
47
+ switch (errorCode) {
48
+ case "ClientLimitExceededException":
49
+ case "com.amazonaws.kinesisvideomedia#ClientLimitExceededException":
50
+ throw await deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context);
51
+ case "ConnectionLimitExceededException":
52
+ case "com.amazonaws.kinesisvideomedia#ConnectionLimitExceededException":
53
+ throw await deserializeAws_restJson1ConnectionLimitExceededExceptionResponse(parsedOutput, context);
54
+ case "InvalidArgumentException":
55
+ case "com.amazonaws.kinesisvideomedia#InvalidArgumentException":
56
+ throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
57
+ case "InvalidEndpointException":
58
+ case "com.amazonaws.kinesisvideomedia#InvalidEndpointException":
59
+ throw await deserializeAws_restJson1InvalidEndpointExceptionResponse(parsedOutput, context);
60
+ case "NotAuthorizedException":
61
+ case "com.amazonaws.kinesisvideomedia#NotAuthorizedException":
62
+ throw await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context);
63
+ case "ResourceNotFoundException":
64
+ case "com.amazonaws.kinesisvideomedia#ResourceNotFoundException":
65
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
66
+ default:
67
+ const parsedBody = parsedOutput.body;
68
+ throwDefaultError({
69
+ output,
70
+ parsedBody,
71
+ exceptionCtor: __BaseException,
72
+ errorCode,
73
+ });
74
+ }
75
+ };
76
+ const map = __map;
77
+ const deserializeAws_restJson1ClientLimitExceededExceptionResponse = async (parsedOutput, context) => {
78
+ const contents = map({});
79
+ const data = parsedOutput.body;
80
+ if (data.Message != null) {
81
+ contents.Message = __expectString(data.Message);
82
+ }
83
+ const exception = new ClientLimitExceededException({
84
+ $metadata: deserializeMetadata(parsedOutput),
85
+ ...contents,
123
86
  });
124
- }); };
125
- var deserializeAws_restJson1InvalidArgumentExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
126
- var contents, data, exception;
127
- return __generator(this, function (_a) {
128
- contents = map({});
129
- data = parsedOutput.body;
130
- if (data.Message != null) {
131
- contents.Message = __expectString(data.Message);
132
- }
133
- exception = new InvalidArgumentException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
134
- return [2, __decorateServiceException(exception, parsedOutput.body)];
87
+ return __decorateServiceException(exception, parsedOutput.body);
88
+ };
89
+ const deserializeAws_restJson1ConnectionLimitExceededExceptionResponse = async (parsedOutput, context) => {
90
+ const contents = map({});
91
+ const data = parsedOutput.body;
92
+ if (data.Message != null) {
93
+ contents.Message = __expectString(data.Message);
94
+ }
95
+ const exception = new ConnectionLimitExceededException({
96
+ $metadata: deserializeMetadata(parsedOutput),
97
+ ...contents,
135
98
  });
136
- }); };
137
- var deserializeAws_restJson1InvalidEndpointExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
138
- var contents, data, exception;
139
- return __generator(this, function (_a) {
140
- contents = map({});
141
- data = parsedOutput.body;
142
- if (data.Message != null) {
143
- contents.Message = __expectString(data.Message);
144
- }
145
- exception = new InvalidEndpointException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
146
- return [2, __decorateServiceException(exception, parsedOutput.body)];
99
+ return __decorateServiceException(exception, parsedOutput.body);
100
+ };
101
+ const deserializeAws_restJson1InvalidArgumentExceptionResponse = async (parsedOutput, context) => {
102
+ const contents = map({});
103
+ const data = parsedOutput.body;
104
+ if (data.Message != null) {
105
+ contents.Message = __expectString(data.Message);
106
+ }
107
+ const exception = new InvalidArgumentException({
108
+ $metadata: deserializeMetadata(parsedOutput),
109
+ ...contents,
147
110
  });
148
- }); };
149
- var deserializeAws_restJson1NotAuthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
150
- var contents, data, exception;
151
- return __generator(this, function (_a) {
152
- contents = map({});
153
- data = parsedOutput.body;
154
- if (data.Message != null) {
155
- contents.Message = __expectString(data.Message);
156
- }
157
- exception = new NotAuthorizedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
158
- return [2, __decorateServiceException(exception, parsedOutput.body)];
111
+ return __decorateServiceException(exception, parsedOutput.body);
112
+ };
113
+ const deserializeAws_restJson1InvalidEndpointExceptionResponse = async (parsedOutput, context) => {
114
+ const contents = map({});
115
+ const data = parsedOutput.body;
116
+ if (data.Message != null) {
117
+ contents.Message = __expectString(data.Message);
118
+ }
119
+ const exception = new InvalidEndpointException({
120
+ $metadata: deserializeMetadata(parsedOutput),
121
+ ...contents,
159
122
  });
160
- }); };
161
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
162
- var contents, data, exception;
163
- return __generator(this, function (_a) {
164
- contents = map({});
165
- data = parsedOutput.body;
166
- if (data.Message != null) {
167
- contents.Message = __expectString(data.Message);
168
- }
169
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
170
- return [2, __decorateServiceException(exception, parsedOutput.body)];
123
+ return __decorateServiceException(exception, parsedOutput.body);
124
+ };
125
+ const deserializeAws_restJson1NotAuthorizedExceptionResponse = async (parsedOutput, context) => {
126
+ const contents = map({});
127
+ const data = parsedOutput.body;
128
+ if (data.Message != null) {
129
+ contents.Message = __expectString(data.Message);
130
+ }
131
+ const exception = new NotAuthorizedException({
132
+ $metadata: deserializeMetadata(parsedOutput),
133
+ ...contents,
171
134
  });
172
- }); };
173
- var serializeAws_restJson1StartSelector = function (input, context) {
174
- return __assign(__assign(__assign(__assign({}, (input.AfterFragmentNumber != null && { AfterFragmentNumber: input.AfterFragmentNumber })), (input.ContinuationToken != null && { ContinuationToken: input.ContinuationToken })), (input.StartSelectorType != null && { StartSelectorType: input.StartSelectorType })), (input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }));
135
+ return __decorateServiceException(exception, parsedOutput.body);
175
136
  };
176
- var deserializeMetadata = function (output) {
177
- var _a;
178
- return ({
179
- httpStatusCode: output.statusCode,
180
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
181
- extendedRequestId: output.headers["x-amz-id-2"],
182
- cfId: output.headers["x-amz-cf-id"],
137
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
138
+ const contents = map({});
139
+ const data = parsedOutput.body;
140
+ if (data.Message != null) {
141
+ contents.Message = __expectString(data.Message);
142
+ }
143
+ const exception = new ResourceNotFoundException({
144
+ $metadata: deserializeMetadata(parsedOutput),
145
+ ...contents,
183
146
  });
147
+ return __decorateServiceException(exception, parsedOutput.body);
184
148
  };
185
- var collectBody = function (streamBody, context) {
186
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
149
+ const serializeAws_restJson1StartSelector = (input, context) => {
150
+ return {
151
+ ...(input.AfterFragmentNumber != null && { AfterFragmentNumber: input.AfterFragmentNumber }),
152
+ ...(input.ContinuationToken != null && { ContinuationToken: input.ContinuationToken }),
153
+ ...(input.StartSelectorType != null && { StartSelectorType: input.StartSelectorType }),
154
+ ...(input.StartTimestamp != null && { StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) }),
155
+ };
156
+ };
157
+ const deserializeMetadata = (output) => ({
158
+ httpStatusCode: output.statusCode,
159
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
160
+ extendedRequestId: output.headers["x-amz-id-2"],
161
+ cfId: output.headers["x-amz-cf-id"],
162
+ });
163
+ const collectBody = (streamBody = new Uint8Array(), context) => {
187
164
  if (streamBody instanceof Uint8Array) {
188
165
  return Promise.resolve(streamBody);
189
166
  }
190
167
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
191
168
  };
192
- var collectBodyString = function (streamBody, context) {
193
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
194
- };
195
- var isSerializableHeaderValue = function (value) {
196
- return value !== undefined &&
197
- value !== null &&
198
- value !== "" &&
199
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
200
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
201
- };
202
- var parseBody = function (streamBody, context) {
203
- return collectBodyString(streamBody, context).then(function (encoded) {
204
- if (encoded.length) {
205
- return JSON.parse(encoded);
206
- }
207
- return {};
208
- });
169
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
170
+ const isSerializableHeaderValue = (value) => value !== undefined &&
171
+ value !== null &&
172
+ value !== "" &&
173
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
174
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
175
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
176
+ if (encoded.length) {
177
+ return JSON.parse(encoded);
178
+ }
179
+ return {};
180
+ });
181
+ const parseErrorBody = async (errorBody, context) => {
182
+ const value = await parseBody(errorBody, context);
183
+ value.message = value.message ?? value.Message;
184
+ return value;
209
185
  };
210
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
211
- var value;
212
- var _a;
213
- return __generator(this, function (_b) {
214
- switch (_b.label) {
215
- case 0: return [4, parseBody(errorBody, context)];
216
- case 1:
217
- value = _b.sent();
218
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
219
- return [2, value];
220
- }
221
- });
222
- }); };
223
- var loadRestJsonErrorCode = function (output, data) {
224
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
225
- var sanitizeErrorCode = function (rawValue) {
226
- var cleanValue = rawValue;
186
+ const loadRestJsonErrorCode = (output, data) => {
187
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
188
+ const sanitizeErrorCode = (rawValue) => {
189
+ let cleanValue = rawValue;
227
190
  if (typeof cleanValue === "number") {
228
191
  cleanValue = cleanValue.toString();
229
192
  }
@@ -238,7 +201,7 @@ var loadRestJsonErrorCode = function (output, data) {
238
201
  }
239
202
  return cleanValue;
240
203
  };
241
- var headerKey = findKey(output.headers, "x-amzn-errortype");
204
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
242
205
  if (headerKey !== undefined) {
243
206
  return sanitizeErrorCode(output.headers[headerKey]);
244
207
  }
@@ -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: "2017-09-30",
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 : "Kinesis Video Media",
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: "2017-09-30",
5
+ disableHostPrefix: config?.disableHostPrefix ?? false,
6
+ logger: config?.logger ?? {},
7
+ regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
8
+ serviceId: config?.serviceId ?? "Kinesis Video Media",
9
+ urlParser: config?.urlParser ?? parseUrl,
10
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-media",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Media Client for Node.js, Browser and React Native",
4
- "version": "3.181.0",
4
+ "version": "3.183.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.181.0",
23
- "@aws-sdk/config-resolver": "3.178.0",
24
- "@aws-sdk/credential-provider-node": "3.181.0",
25
- "@aws-sdk/fetch-http-handler": "3.178.0",
26
- "@aws-sdk/hash-node": "3.178.0",
27
- "@aws-sdk/invalid-dependency": "3.178.0",
28
- "@aws-sdk/middleware-content-length": "3.178.0",
29
- "@aws-sdk/middleware-host-header": "3.178.0",
30
- "@aws-sdk/middleware-logger": "3.178.0",
31
- "@aws-sdk/middleware-recursion-detection": "3.178.0",
32
- "@aws-sdk/middleware-retry": "3.178.0",
33
- "@aws-sdk/middleware-serde": "3.178.0",
34
- "@aws-sdk/middleware-signing": "3.179.0",
35
- "@aws-sdk/middleware-stack": "3.178.0",
36
- "@aws-sdk/middleware-user-agent": "3.178.0",
37
- "@aws-sdk/node-config-provider": "3.178.0",
38
- "@aws-sdk/node-http-handler": "3.178.0",
39
- "@aws-sdk/protocol-http": "3.178.0",
40
- "@aws-sdk/smithy-client": "3.180.0",
41
- "@aws-sdk/types": "3.178.0",
42
- "@aws-sdk/url-parser": "3.178.0",
43
- "@aws-sdk/util-base64-browser": "3.170.0",
44
- "@aws-sdk/util-base64-node": "3.170.0",
45
- "@aws-sdk/util-body-length-browser": "3.170.0",
46
- "@aws-sdk/util-body-length-node": "3.170.0",
47
- "@aws-sdk/util-defaults-mode-browser": "3.180.0",
48
- "@aws-sdk/util-defaults-mode-node": "3.180.0",
49
- "@aws-sdk/util-user-agent-browser": "3.178.0",
50
- "@aws-sdk/util-user-agent-node": "3.178.0",
51
- "@aws-sdk/util-utf8-browser": "3.170.0",
52
- "@aws-sdk/util-utf8-node": "3.170.0",
22
+ "@aws-sdk/client-sts": "3.183.0",
23
+ "@aws-sdk/config-resolver": "3.183.0",
24
+ "@aws-sdk/credential-provider-node": "3.183.0",
25
+ "@aws-sdk/fetch-http-handler": "3.183.0",
26
+ "@aws-sdk/hash-node": "3.183.0",
27
+ "@aws-sdk/invalid-dependency": "3.183.0",
28
+ "@aws-sdk/middleware-content-length": "3.183.0",
29
+ "@aws-sdk/middleware-host-header": "3.183.0",
30
+ "@aws-sdk/middleware-logger": "3.183.0",
31
+ "@aws-sdk/middleware-recursion-detection": "3.183.0",
32
+ "@aws-sdk/middleware-retry": "3.183.0",
33
+ "@aws-sdk/middleware-serde": "3.183.0",
34
+ "@aws-sdk/middleware-signing": "3.183.0",
35
+ "@aws-sdk/middleware-stack": "3.183.0",
36
+ "@aws-sdk/middleware-user-agent": "3.183.0",
37
+ "@aws-sdk/node-config-provider": "3.183.0",
38
+ "@aws-sdk/node-http-handler": "3.183.0",
39
+ "@aws-sdk/protocol-http": "3.183.0",
40
+ "@aws-sdk/smithy-client": "3.183.0",
41
+ "@aws-sdk/types": "3.183.0",
42
+ "@aws-sdk/url-parser": "3.183.0",
43
+ "@aws-sdk/util-base64-browser": "3.183.0",
44
+ "@aws-sdk/util-base64-node": "3.183.0",
45
+ "@aws-sdk/util-body-length-browser": "3.183.0",
46
+ "@aws-sdk/util-body-length-node": "3.183.0",
47
+ "@aws-sdk/util-defaults-mode-browser": "3.183.0",
48
+ "@aws-sdk/util-defaults-mode-node": "3.183.0",
49
+ "@aws-sdk/util-user-agent-browser": "3.183.0",
50
+ "@aws-sdk/util-user-agent-node": "3.183.0",
51
+ "@aws-sdk/util-utf8-browser": "3.183.0",
52
+ "@aws-sdk/util-utf8-node": "3.183.0",
53
53
  "tslib": "^2.3.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@aws-sdk/service-client-documentation-generator": "3.170.0",
56
+ "@aws-sdk/service-client-documentation-generator": "3.183.0",
57
57
  "@tsconfig/recommended": "1.0.1",
58
58
  "@types/node": "^12.7.5",
59
59
  "concurrently": "7.0.0",