@aws-sdk/client-kinesis-video-webrtc-storage 3.234.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.
Files changed (71) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +212 -0
  3. package/dist-cjs/KinesisVideoWebRTCStorage.js +37 -0
  4. package/dist-cjs/KinesisVideoWebRTCStorageClient.js +40 -0
  5. package/dist-cjs/commands/JoinStorageSessionAsViewerCommand.js +46 -0
  6. package/dist-cjs/commands/JoinStorageSessionCommand.js +46 -0
  7. package/dist-cjs/commands/index.js +5 -0
  8. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  9. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  10. package/dist-cjs/endpoint/ruleset.js +303 -0
  11. package/dist-cjs/index.js +10 -0
  12. package/dist-cjs/models/KinesisVideoWebRTCStorageServiceException.js +11 -0
  13. package/dist-cjs/models/index.js +4 -0
  14. package/dist-cjs/models/models_0.js +64 -0
  15. package/dist-cjs/protocols/Aws_restJson1.js +237 -0
  16. package/dist-cjs/runtimeConfig.browser.js +42 -0
  17. package/dist-cjs/runtimeConfig.js +51 -0
  18. package/dist-cjs/runtimeConfig.native.js +15 -0
  19. package/dist-cjs/runtimeConfig.shared.js +18 -0
  20. package/dist-es/KinesisVideoWebRTCStorage.js +33 -0
  21. package/dist-es/KinesisVideoWebRTCStorageClient.js +36 -0
  22. package/dist-es/commands/JoinStorageSessionAsViewerCommand.js +42 -0
  23. package/dist-es/commands/JoinStorageSessionCommand.js +42 -0
  24. package/dist-es/commands/index.js +2 -0
  25. package/dist-es/endpoint/EndpointParameters.js +8 -0
  26. package/dist-es/endpoint/endpointResolver.js +8 -0
  27. package/dist-es/endpoint/ruleset.js +300 -0
  28. package/dist-es/index.js +5 -0
  29. package/dist-es/models/KinesisVideoWebRTCStorageServiceException.js +7 -0
  30. package/dist-es/models/index.js +1 -0
  31. package/dist-es/models/models_0.js +55 -0
  32. package/dist-es/protocols/Aws_restJson1.js +230 -0
  33. package/dist-es/runtimeConfig.browser.js +37 -0
  34. package/dist-es/runtimeConfig.js +46 -0
  35. package/dist-es/runtimeConfig.native.js +11 -0
  36. package/dist-es/runtimeConfig.shared.js +14 -0
  37. package/dist-types/KinesisVideoWebRTCStorage.d.ts +60 -0
  38. package/dist-types/KinesisVideoWebRTCStorageClient.d.ts +144 -0
  39. package/dist-types/commands/JoinStorageSessionAsViewerCommand.d.ts +54 -0
  40. package/dist-types/commands/JoinStorageSessionCommand.d.ts +58 -0
  41. package/dist-types/commands/index.d.ts +2 -0
  42. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  43. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  44. package/dist-types/endpoint/ruleset.d.ts +2 -0
  45. package/dist-types/index.d.ts +5 -0
  46. package/dist-types/models/KinesisVideoWebRTCStorageServiceException.d.ts +10 -0
  47. package/dist-types/models/index.d.ts +1 -0
  48. package/dist-types/models/models_0.d.ts +105 -0
  49. package/dist-types/protocols/Aws_restJson1.d.ts +8 -0
  50. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  51. package/dist-types/runtimeConfig.d.ts +42 -0
  52. package/dist-types/runtimeConfig.native.d.ts +41 -0
  53. package/dist-types/runtimeConfig.shared.d.ts +16 -0
  54. package/dist-types/ts3.4/KinesisVideoWebRTCStorage.d.ts +38 -0
  55. package/dist-types/ts3.4/KinesisVideoWebRTCStorageClient.d.ts +124 -0
  56. package/dist-types/ts3.4/commands/JoinStorageSessionAsViewerCommand.d.ts +37 -0
  57. package/dist-types/ts3.4/commands/JoinStorageSessionCommand.d.ts +33 -0
  58. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  59. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +34 -0
  60. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  61. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  62. package/dist-types/ts3.4/index.d.ts +5 -0
  63. package/dist-types/ts3.4/models/KinesisVideoWebRTCStorageServiceException.d.ts +7 -0
  64. package/dist-types/ts3.4/models/index.d.ts +1 -0
  65. package/dist-types/ts3.4/models/models_0.d.ts +43 -0
  66. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +29 -0
  67. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
  68. package/dist-types/ts3.4/runtimeConfig.d.ts +93 -0
  69. package/dist-types/ts3.4/runtimeConfig.native.d.ts +82 -0
  70. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +18 -0
  71. package/package.json +102 -0
@@ -0,0 +1,230 @@
1
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
+ import { decorateServiceException as __decorateServiceException, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
3
+ import { KinesisVideoWebRTCStorageServiceException as __BaseException } from "../models/KinesisVideoWebRTCStorageServiceException";
4
+ import { AccessDeniedException, ClientLimitExceededException, InvalidArgumentException, ResourceNotFoundException, } from "../models/models_0";
5
+ export const serializeAws_restJson1JoinStorageSessionCommand = 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 || ""}` + "/joinStorageSession";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.channelArn != null && { channelArn: input.channelArn }),
14
+ });
15
+ return new __HttpRequest({
16
+ protocol,
17
+ hostname,
18
+ port,
19
+ method: "POST",
20
+ headers,
21
+ path: resolvedPath,
22
+ body,
23
+ });
24
+ };
25
+ export const serializeAws_restJson1JoinStorageSessionAsViewerCommand = async (input, context) => {
26
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
27
+ const headers = {
28
+ "content-type": "application/json",
29
+ };
30
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/joinStorageSessionAsViewer";
31
+ let body;
32
+ body = JSON.stringify({
33
+ ...(input.channelArn != null && { channelArn: input.channelArn }),
34
+ ...(input.clientId != null && { clientId: input.clientId }),
35
+ });
36
+ return new __HttpRequest({
37
+ protocol,
38
+ hostname,
39
+ port,
40
+ method: "POST",
41
+ headers,
42
+ path: resolvedPath,
43
+ body,
44
+ });
45
+ };
46
+ export const deserializeAws_restJson1JoinStorageSessionCommand = async (output, context) => {
47
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
48
+ return deserializeAws_restJson1JoinStorageSessionCommandError(output, context);
49
+ }
50
+ const contents = map({
51
+ $metadata: deserializeMetadata(output),
52
+ });
53
+ await collectBody(output.body, context);
54
+ return contents;
55
+ };
56
+ const deserializeAws_restJson1JoinStorageSessionCommandError = async (output, context) => {
57
+ const parsedOutput = {
58
+ ...output,
59
+ body: await parseErrorBody(output.body, context),
60
+ };
61
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
62
+ switch (errorCode) {
63
+ case "AccessDeniedException":
64
+ case "com.amazonaws.kinesisvideowebrtcstorage#AccessDeniedException":
65
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
66
+ case "ClientLimitExceededException":
67
+ case "com.amazonaws.kinesisvideowebrtcstorage#ClientLimitExceededException":
68
+ throw await deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context);
69
+ case "InvalidArgumentException":
70
+ case "com.amazonaws.kinesisvideowebrtcstorage#InvalidArgumentException":
71
+ throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
72
+ case "ResourceNotFoundException":
73
+ case "com.amazonaws.kinesisvideowebrtcstorage#ResourceNotFoundException":
74
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
75
+ default:
76
+ const parsedBody = parsedOutput.body;
77
+ throwDefaultError({
78
+ output,
79
+ parsedBody,
80
+ exceptionCtor: __BaseException,
81
+ errorCode,
82
+ });
83
+ }
84
+ };
85
+ export const deserializeAws_restJson1JoinStorageSessionAsViewerCommand = async (output, context) => {
86
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
87
+ return deserializeAws_restJson1JoinStorageSessionAsViewerCommandError(output, context);
88
+ }
89
+ const contents = map({
90
+ $metadata: deserializeMetadata(output),
91
+ });
92
+ await collectBody(output.body, context);
93
+ return contents;
94
+ };
95
+ const deserializeAws_restJson1JoinStorageSessionAsViewerCommandError = async (output, context) => {
96
+ const parsedOutput = {
97
+ ...output,
98
+ body: await parseErrorBody(output.body, context),
99
+ };
100
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
101
+ switch (errorCode) {
102
+ case "AccessDeniedException":
103
+ case "com.amazonaws.kinesisvideowebrtcstorage#AccessDeniedException":
104
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
105
+ case "ClientLimitExceededException":
106
+ case "com.amazonaws.kinesisvideowebrtcstorage#ClientLimitExceededException":
107
+ throw await deserializeAws_restJson1ClientLimitExceededExceptionResponse(parsedOutput, context);
108
+ case "InvalidArgumentException":
109
+ case "com.amazonaws.kinesisvideowebrtcstorage#InvalidArgumentException":
110
+ throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context);
111
+ case "ResourceNotFoundException":
112
+ case "com.amazonaws.kinesisvideowebrtcstorage#ResourceNotFoundException":
113
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
114
+ default:
115
+ const parsedBody = parsedOutput.body;
116
+ throwDefaultError({
117
+ output,
118
+ parsedBody,
119
+ exceptionCtor: __BaseException,
120
+ errorCode,
121
+ });
122
+ }
123
+ };
124
+ const map = __map;
125
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = 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 AccessDeniedException({
132
+ $metadata: deserializeMetadata(parsedOutput),
133
+ ...contents,
134
+ });
135
+ return __decorateServiceException(exception, parsedOutput.body);
136
+ };
137
+ const deserializeAws_restJson1ClientLimitExceededExceptionResponse = 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 ClientLimitExceededException({
144
+ $metadata: deserializeMetadata(parsedOutput),
145
+ ...contents,
146
+ });
147
+ return __decorateServiceException(exception, parsedOutput.body);
148
+ };
149
+ const deserializeAws_restJson1InvalidArgumentExceptionResponse = async (parsedOutput, context) => {
150
+ const contents = map({});
151
+ const data = parsedOutput.body;
152
+ if (data.message != null) {
153
+ contents.message = __expectString(data.message);
154
+ }
155
+ const exception = new InvalidArgumentException({
156
+ $metadata: deserializeMetadata(parsedOutput),
157
+ ...contents,
158
+ });
159
+ return __decorateServiceException(exception, parsedOutput.body);
160
+ };
161
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
162
+ const contents = map({});
163
+ const data = parsedOutput.body;
164
+ if (data.message != null) {
165
+ contents.message = __expectString(data.message);
166
+ }
167
+ const exception = new ResourceNotFoundException({
168
+ $metadata: deserializeMetadata(parsedOutput),
169
+ ...contents,
170
+ });
171
+ return __decorateServiceException(exception, parsedOutput.body);
172
+ };
173
+ const deserializeMetadata = (output) => ({
174
+ httpStatusCode: output.statusCode,
175
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
176
+ extendedRequestId: output.headers["x-amz-id-2"],
177
+ cfId: output.headers["x-amz-cf-id"],
178
+ });
179
+ const collectBody = (streamBody = new Uint8Array(), context) => {
180
+ if (streamBody instanceof Uint8Array) {
181
+ return Promise.resolve(streamBody);
182
+ }
183
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
184
+ };
185
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
186
+ const isSerializableHeaderValue = (value) => value !== undefined &&
187
+ value !== null &&
188
+ value !== "" &&
189
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
190
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
191
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
192
+ if (encoded.length) {
193
+ return JSON.parse(encoded);
194
+ }
195
+ return {};
196
+ });
197
+ const parseErrorBody = async (errorBody, context) => {
198
+ const value = await parseBody(errorBody, context);
199
+ value.message = value.message ?? value.Message;
200
+ return value;
201
+ };
202
+ const loadRestJsonErrorCode = (output, data) => {
203
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
204
+ const sanitizeErrorCode = (rawValue) => {
205
+ let cleanValue = rawValue;
206
+ if (typeof cleanValue === "number") {
207
+ cleanValue = cleanValue.toString();
208
+ }
209
+ if (cleanValue.indexOf(",") >= 0) {
210
+ cleanValue = cleanValue.split(",")[0];
211
+ }
212
+ if (cleanValue.indexOf(":") >= 0) {
213
+ cleanValue = cleanValue.split(":")[0];
214
+ }
215
+ if (cleanValue.indexOf("#") >= 0) {
216
+ cleanValue = cleanValue.split("#")[1];
217
+ }
218
+ return cleanValue;
219
+ };
220
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
221
+ if (headerKey !== undefined) {
222
+ return sanitizeErrorCode(output.headers[headerKey]);
223
+ }
224
+ if (data.code !== undefined) {
225
+ return sanitizeErrorCode(data.code);
226
+ }
227
+ if (data["__type"] !== undefined) {
228
+ return sanitizeErrorCode(data["__type"]);
229
+ }
230
+ };
@@ -0,0 +1,37 @@
1
+ import packageInfo from "../package.json";
2
+ import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
4
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
5
+ import { invalidProvider } from "@aws-sdk/invalid-dependency";
6
+ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
7
+ import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry";
8
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
9
+ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
10
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
11
+ import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
12
+ import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
13
+ export const getRuntimeConfig = (config) => {
14
+ const defaultsMode = resolveDefaultsModeConfig(config);
15
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
16
+ const clientSharedValues = getSharedRuntimeConfig(config);
17
+ return {
18
+ ...clientSharedValues,
19
+ ...config,
20
+ runtime: "browser",
21
+ defaultsMode,
22
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
23
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
24
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
25
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
26
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
27
+ region: config?.region ?? invalidProvider("Region is missing"),
28
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
29
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
30
+ sha256: config?.sha256 ?? Sha256,
31
+ streamCollector: config?.streamCollector ?? streamCollector,
32
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
33
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
34
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
35
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
36
+ };
37
+ };
@@ -0,0 +1,46 @@
1
+ import packageInfo from "../package.json";
2
+ import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
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";
4
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
5
+ import { Hash } from "@aws-sdk/hash-node";
6
+ import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
7
+ import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
8
+ import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
9
+ import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
10
+ import { DEFAULT_RETRY_MODE } from "@aws-sdk/util-retry";
11
+ import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
12
+ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
13
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
14
+ import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
15
+ import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
16
+ import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
17
+ export const getRuntimeConfig = (config) => {
18
+ emitWarningIfUnsupportedVersion(process.version);
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
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
28
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
29
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
30
+ defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
31
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
32
+ region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
33
+ requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
34
+ retryMode: config?.retryMode ??
35
+ loadNodeConfig({
36
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
37
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
38
+ }),
39
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
40
+ streamCollector: config?.streamCollector ?? streamCollector,
41
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
42
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
43
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
44
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
45
+ };
46
+ };
@@ -0,0 +1,11 @@
1
+ import { Sha256 } from "@aws-crypto/sha256-js";
2
+ import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
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
+ };
11
+ };
@@ -0,0 +1,14 @@
1
+ import { NoOpLogger } from "@aws-sdk/smithy-client";
2
+ import { parseUrl } from "@aws-sdk/url-parser";
3
+ import { fromBase64, toBase64 } from "@aws-sdk/util-base64";
4
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
5
+ export const getRuntimeConfig = (config) => ({
6
+ apiVersion: "2018-05-10",
7
+ base64Decoder: config?.base64Decoder ?? fromBase64,
8
+ base64Encoder: config?.base64Encoder ?? toBase64,
9
+ disableHostPrefix: config?.disableHostPrefix ?? false,
10
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
11
+ logger: config?.logger ?? new NoOpLogger(),
12
+ serviceId: config?.serviceId ?? "Kinesis Video WebRTC Storage",
13
+ urlParser: config?.urlParser ?? parseUrl,
14
+ });
@@ -0,0 +1,60 @@
1
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
+ import { JoinStorageSessionAsViewerCommandInput, JoinStorageSessionAsViewerCommandOutput } from "./commands/JoinStorageSessionAsViewerCommand";
3
+ import { JoinStorageSessionCommandInput, JoinStorageSessionCommandOutput } from "./commands/JoinStorageSessionCommand";
4
+ import { KinesisVideoWebRTCStorageClient } from "./KinesisVideoWebRTCStorageClient";
5
+ /**
6
+ * <p>
7
+ * </p>
8
+ */
9
+ export declare class KinesisVideoWebRTCStorage extends KinesisVideoWebRTCStorageClient {
10
+ /**
11
+ * <p>
12
+ * Join the ongoing one way-video and/or multi-way audio WebRTC session as
13
+ * a video producing device for an input channel. If there’s no existing
14
+ * session for the channel, a new streaming session needs to be created, and the
15
+ * Amazon Resource Name (ARN) of the signaling channel must be provided.
16
+ * </p>
17
+ * <p>Currently for the <code>SINGLE_MASTER</code> type, a video producing
18
+ * device is able to ingest both audio and video media into a stream,
19
+ * while viewers can only ingest audio. Both a video producing device
20
+ * and viewers can join the session first, and wait for other participants.</p>
21
+ * <p>While participants are having peer to peer conversations through webRTC,
22
+ * the ingested media session will be stored into the Kinesis Video Stream.
23
+ * Multiple viewers are able to playback real-time media.</p>
24
+ * <p>Customers can also use existing Kinesis Video Streams features like
25
+ * <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
26
+ * with ingested WebRTC media.</p>
27
+ * <note>
28
+ * <p>Assume that only one video producing device client
29
+ * can be associated with a session for the channel. If more than one
30
+ * client joins the session of a specific channel as a video producing device,
31
+ * the most recent client request takes precedence. </p>
32
+ * </note>
33
+ */
34
+ joinStorageSession(args: JoinStorageSessionCommandInput, options?: __HttpHandlerOptions): Promise<JoinStorageSessionCommandOutput>;
35
+ joinStorageSession(args: JoinStorageSessionCommandInput, cb: (err: any, data?: JoinStorageSessionCommandOutput) => void): void;
36
+ joinStorageSession(args: JoinStorageSessionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: JoinStorageSessionCommandOutput) => void): void;
37
+ /**
38
+ * <p>
39
+ * Join the ongoing one way-video and/or multi-way audio WebRTC session as
40
+ * a viewer for an input channel. If there’s
41
+ * no existing session for the channel, create a new streaming session and provide
42
+ * the Amazon Resource Name (ARN) of the signaling channel (<code>channelArn</code>)
43
+ * and client id (<code>clientId</code>).
44
+ * </p>
45
+ * <p>Currently for <code>SINGLE_MASTER</code> type, a video producing device
46
+ * is able to ingest both audio and video media into a stream, while viewers
47
+ * can only ingest audio. Both a video producing device and viewers can join
48
+ * a session first and wait for other participants. While participants are having peer to peer conversations through webRTC,
49
+ * the ingested media session will be stored into the Kinesis Video Stream.
50
+ * Multiple viewers are able to playback real-time media.
51
+ * </p>
52
+ * <p>Customers can also use existing Kinesis Video Streams features like
53
+ * <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
54
+ * with ingested WebRTC media. If there’s an existing session with the same
55
+ * <code>clientId</code> that's found in the join session request, the new request takes precedence.</p>
56
+ */
57
+ joinStorageSessionAsViewer(args: JoinStorageSessionAsViewerCommandInput, options?: __HttpHandlerOptions): Promise<JoinStorageSessionAsViewerCommandOutput>;
58
+ joinStorageSessionAsViewer(args: JoinStorageSessionAsViewerCommandInput, cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void): void;
59
+ joinStorageSessionAsViewer(args: JoinStorageSessionAsViewerCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void): void;
60
+ }
@@ -0,0 +1,144 @@
1
+ import { RegionInputConfig, RegionResolvedConfig } from "@aws-sdk/config-resolver";
2
+ import { EndpointInputConfig, EndpointResolvedConfig } from "@aws-sdk/middleware-endpoint";
3
+ import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
4
+ import { RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry";
5
+ import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
6
+ import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
7
+ import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
8
+ import { Client as __Client, DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client";
9
+ import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
10
+ import { JoinStorageSessionAsViewerCommandInput, JoinStorageSessionAsViewerCommandOutput } from "./commands/JoinStorageSessionAsViewerCommand";
11
+ import { JoinStorageSessionCommandInput, JoinStorageSessionCommandOutput } from "./commands/JoinStorageSessionCommand";
12
+ import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
13
+ export declare type ServiceInputTypes = JoinStorageSessionAsViewerCommandInput | JoinStorageSessionCommandInput;
14
+ export declare type ServiceOutputTypes = JoinStorageSessionAsViewerCommandOutput | JoinStorageSessionCommandOutput;
15
+ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
16
+ /**
17
+ * The HTTP handler to use. Fetch in browser and Https in Nodejs.
18
+ */
19
+ requestHandler?: __HttpHandler;
20
+ /**
21
+ * A constructor for a class implementing the {@link __Hash} interface
22
+ * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
23
+ * @internal
24
+ */
25
+ sha256?: __HashConstructor;
26
+ /**
27
+ * The function that will be used to convert strings into HTTP endpoints.
28
+ * @internal
29
+ */
30
+ urlParser?: __UrlParser;
31
+ /**
32
+ * A function that can calculate the length of a request body.
33
+ * @internal
34
+ */
35
+ bodyLengthChecker?: __BodyLengthCalculator;
36
+ /**
37
+ * A function that converts a stream into an array of bytes.
38
+ * @internal
39
+ */
40
+ streamCollector?: __StreamCollector;
41
+ /**
42
+ * The function that will be used to convert a base64-encoded string to a byte array.
43
+ * @internal
44
+ */
45
+ base64Decoder?: __Decoder;
46
+ /**
47
+ * The function that will be used to convert binary data to a base64-encoded string.
48
+ * @internal
49
+ */
50
+ base64Encoder?: __Encoder;
51
+ /**
52
+ * The function that will be used to convert a UTF8-encoded string to a byte array.
53
+ * @internal
54
+ */
55
+ utf8Decoder?: __Decoder;
56
+ /**
57
+ * The function that will be used to convert binary data to a UTF-8 encoded string.
58
+ * @internal
59
+ */
60
+ utf8Encoder?: __Encoder;
61
+ /**
62
+ * The runtime environment.
63
+ * @internal
64
+ */
65
+ runtime?: string;
66
+ /**
67
+ * Disable dyanamically changing the endpoint of the client based on the hostPrefix
68
+ * trait of an operation.
69
+ */
70
+ disableHostPrefix?: boolean;
71
+ /**
72
+ * Value for how many times a request will be made at most in case of retry.
73
+ */
74
+ maxAttempts?: number | __Provider<number>;
75
+ /**
76
+ * Specifies which retry algorithm to use.
77
+ */
78
+ retryMode?: string | __Provider<string>;
79
+ /**
80
+ * Optional logger for logging debug/info/warn/error.
81
+ */
82
+ logger?: __Logger;
83
+ /**
84
+ * Enables IPv6/IPv4 dualstack endpoint.
85
+ */
86
+ useDualstackEndpoint?: boolean | __Provider<boolean>;
87
+ /**
88
+ * Enables FIPS compatible endpoints.
89
+ */
90
+ useFipsEndpoint?: boolean | __Provider<boolean>;
91
+ /**
92
+ * Unique service identifier.
93
+ * @internal
94
+ */
95
+ serviceId?: string;
96
+ /**
97
+ * The AWS region to which this client will send requests
98
+ */
99
+ region?: string | __Provider<string>;
100
+ /**
101
+ * Default credentials provider; Not available in browser runtime.
102
+ * @internal
103
+ */
104
+ credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
105
+ /**
106
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
107
+ * @internal
108
+ */
109
+ defaultUserAgentProvider?: Provider<__UserAgent>;
110
+ /**
111
+ * The {@link DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
112
+ */
113
+ defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
114
+ }
115
+ declare type KinesisVideoWebRTCStorageClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
116
+ /**
117
+ * The configuration interface of KinesisVideoWebRTCStorageClient class constructor that set the region, credentials and other options.
118
+ */
119
+ export interface KinesisVideoWebRTCStorageClientConfig extends KinesisVideoWebRTCStorageClientConfigType {
120
+ }
121
+ declare type KinesisVideoWebRTCStorageClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
122
+ /**
123
+ * The resolved configuration interface of KinesisVideoWebRTCStorageClient class. This is resolved and normalized from the {@link KinesisVideoWebRTCStorageClientConfig | constructor configuration interface}.
124
+ */
125
+ export interface KinesisVideoWebRTCStorageClientResolvedConfig extends KinesisVideoWebRTCStorageClientResolvedConfigType {
126
+ }
127
+ /**
128
+ * <p>
129
+ * </p>
130
+ */
131
+ export declare class KinesisVideoWebRTCStorageClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, KinesisVideoWebRTCStorageClientResolvedConfig> {
132
+ /**
133
+ * The resolved configuration of KinesisVideoWebRTCStorageClient class. This is resolved and normalized from the {@link KinesisVideoWebRTCStorageClientConfig | constructor configuration interface}.
134
+ */
135
+ readonly config: KinesisVideoWebRTCStorageClientResolvedConfig;
136
+ constructor(configuration: KinesisVideoWebRTCStorageClientConfig);
137
+ /**
138
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
139
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
140
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
141
+ */
142
+ destroy(): void;
143
+ }
144
+ export {};
@@ -0,0 +1,54 @@
1
+ import { EndpointParameterInstructions } from "@aws-sdk/middleware-endpoint";
2
+ import { Command as $Command } from "@aws-sdk/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
4
+ import { KinesisVideoWebRTCStorageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KinesisVideoWebRTCStorageClient";
5
+ import { JoinStorageSessionAsViewerInput } from "../models/models_0";
6
+ export interface JoinStorageSessionAsViewerCommandInput extends JoinStorageSessionAsViewerInput {
7
+ }
8
+ export interface JoinStorageSessionAsViewerCommandOutput extends __MetadataBearer {
9
+ }
10
+ /**
11
+ * <p>
12
+ * Join the ongoing one way-video and/or multi-way audio WebRTC session as
13
+ * a viewer for an input channel. If there’s
14
+ * no existing session for the channel, create a new streaming session and provide
15
+ * the Amazon Resource Name (ARN) of the signaling channel (<code>channelArn</code>)
16
+ * and client id (<code>clientId</code>).
17
+ * </p>
18
+ * <p>Currently for <code>SINGLE_MASTER</code> type, a video producing device
19
+ * is able to ingest both audio and video media into a stream, while viewers
20
+ * can only ingest audio. Both a video producing device and viewers can join
21
+ * a session first and wait for other participants. While participants are having peer to peer conversations through webRTC,
22
+ * the ingested media session will be stored into the Kinesis Video Stream.
23
+ * Multiple viewers are able to playback real-time media.
24
+ * </p>
25
+ * <p>Customers can also use existing Kinesis Video Streams features like
26
+ * <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
27
+ * with ingested WebRTC media. If there’s an existing session with the same
28
+ * <code>clientId</code> that's found in the join session request, the new request takes precedence.</p>
29
+ * @example
30
+ * Use a bare-bones client and the command you need to make an API call.
31
+ * ```javascript
32
+ * import { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } from "@aws-sdk/client-kinesis-video-webrtc-storage"; // ES Modules import
33
+ * // const { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } = require("@aws-sdk/client-kinesis-video-webrtc-storage"); // CommonJS import
34
+ * const client = new KinesisVideoWebRTCStorageClient(config);
35
+ * const command = new JoinStorageSessionAsViewerCommand(input);
36
+ * const response = await client.send(command);
37
+ * ```
38
+ *
39
+ * @see {@link JoinStorageSessionAsViewerCommandInput} for command's `input` shape.
40
+ * @see {@link JoinStorageSessionAsViewerCommandOutput} for command's `response` shape.
41
+ * @see {@link KinesisVideoWebRTCStorageClientResolvedConfig | config} for KinesisVideoWebRTCStorageClient's `config` shape.
42
+ *
43
+ */
44
+ export declare class JoinStorageSessionAsViewerCommand extends $Command<JoinStorageSessionAsViewerCommandInput, JoinStorageSessionAsViewerCommandOutput, KinesisVideoWebRTCStorageClientResolvedConfig> {
45
+ readonly input: JoinStorageSessionAsViewerCommandInput;
46
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
47
+ constructor(input: JoinStorageSessionAsViewerCommandInput);
48
+ /**
49
+ * @internal
50
+ */
51
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: KinesisVideoWebRTCStorageClientResolvedConfig, options?: __HttpHandlerOptions): Handler<JoinStorageSessionAsViewerCommandInput, JoinStorageSessionAsViewerCommandOutput>;
52
+ private serialize;
53
+ private deserialize;
54
+ }