@aws-sdk/client-kinesis-video-signaling 3.312.0 → 3.315.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.
@@ -12,12 +12,12 @@ const se_GetIceServerConfigCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/get-ice-server-config";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.ChannelARN != null && { ChannelARN: input.ChannelARN }),
17
- ...(input.ClientId != null && { ClientId: input.ClientId }),
18
- ...(input.Service != null && { Service: input.Service }),
19
- ...(input.Username != null && { Username: input.Username }),
20
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ ChannelARN: [],
17
+ ClientId: [],
18
+ Service: [],
19
+ Username: [],
20
+ }));
21
21
  return new protocol_http_1.HttpRequest({
22
22
  protocol,
23
23
  hostname,
@@ -36,11 +36,11 @@ const se_SendAlexaOfferToMasterCommand = async (input, context) => {
36
36
  };
37
37
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/send-alexa-offer-to-master";
38
38
  let body;
39
- body = JSON.stringify({
40
- ...(input.ChannelARN != null && { ChannelARN: input.ChannelARN }),
41
- ...(input.MessagePayload != null && { MessagePayload: input.MessagePayload }),
42
- ...(input.SenderClientId != null && { SenderClientId: input.SenderClientId }),
43
- });
39
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
40
+ ChannelARN: [],
41
+ MessagePayload: [],
42
+ SenderClientId: [],
43
+ }));
44
44
  return new protocol_http_1.HttpRequest({
45
45
  protocol,
46
46
  hostname,
@@ -56,13 +56,14 @@ const de_GetIceServerConfigCommand = async (output, context) => {
56
56
  if (output.statusCode !== 200 && output.statusCode >= 300) {
57
57
  return de_GetIceServerConfigCommandError(output, context);
58
58
  }
59
- const contents = map({
59
+ const contents = (0, smithy_client_1.map)({
60
60
  $metadata: deserializeMetadata(output),
61
61
  });
62
62
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
63
- if (data.IceServerList != null) {
64
- contents.IceServerList = de_IceServerList(data.IceServerList, context);
65
- }
63
+ const doc = (0, smithy_client_1.take)(data, {
64
+ IceServerList: smithy_client_1._json,
65
+ });
66
+ Object.assign(contents, doc);
66
67
  return contents;
67
68
  };
68
69
  exports.de_GetIceServerConfigCommand = de_GetIceServerConfigCommand;
@@ -93,10 +94,9 @@ const de_GetIceServerConfigCommandError = async (output, context) => {
93
94
  throw await de_SessionExpiredExceptionRes(parsedOutput, context);
94
95
  default:
95
96
  const parsedBody = parsedOutput.body;
96
- (0, smithy_client_1.throwDefaultError)({
97
+ return throwDefaultError({
97
98
  output,
98
99
  parsedBody,
99
- exceptionCtor: KinesisVideoSignalingServiceException_1.KinesisVideoSignalingServiceException,
100
100
  errorCode,
101
101
  });
102
102
  }
@@ -105,13 +105,14 @@ const de_SendAlexaOfferToMasterCommand = async (output, context) => {
105
105
  if (output.statusCode !== 200 && output.statusCode >= 300) {
106
106
  return de_SendAlexaOfferToMasterCommandError(output, context);
107
107
  }
108
- const contents = map({
108
+ const contents = (0, smithy_client_1.map)({
109
109
  $metadata: deserializeMetadata(output),
110
110
  });
111
111
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
112
- if (data.Answer != null) {
113
- contents.Answer = (0, smithy_client_1.expectString)(data.Answer);
114
- }
112
+ const doc = (0, smithy_client_1.take)(data, {
113
+ Answer: smithy_client_1.expectString,
114
+ });
115
+ Object.assign(contents, doc);
115
116
  return contents;
116
117
  };
117
118
  exports.de_SendAlexaOfferToMasterCommand = de_SendAlexaOfferToMasterCommand;
@@ -136,21 +137,21 @@ const de_SendAlexaOfferToMasterCommandError = async (output, context) => {
136
137
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
137
138
  default:
138
139
  const parsedBody = parsedOutput.body;
139
- (0, smithy_client_1.throwDefaultError)({
140
+ return throwDefaultError({
140
141
  output,
141
142
  parsedBody,
142
- exceptionCtor: KinesisVideoSignalingServiceException_1.KinesisVideoSignalingServiceException,
143
143
  errorCode,
144
144
  });
145
145
  }
146
146
  };
147
- const map = smithy_client_1.map;
147
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(KinesisVideoSignalingServiceException_1.KinesisVideoSignalingServiceException);
148
148
  const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
149
- const contents = map({});
149
+ const contents = (0, smithy_client_1.map)({});
150
150
  const data = parsedOutput.body;
151
- if (data.Message != null) {
152
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
153
- }
151
+ const doc = (0, smithy_client_1.take)(data, {
152
+ Message: smithy_client_1.expectString,
153
+ });
154
+ Object.assign(contents, doc);
154
155
  const exception = new models_0_1.ClientLimitExceededException({
155
156
  $metadata: deserializeMetadata(parsedOutput),
156
157
  ...contents,
@@ -158,11 +159,12 @@ const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
158
159
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
159
160
  };
160
161
  const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
161
- const contents = map({});
162
+ const contents = (0, smithy_client_1.map)({});
162
163
  const data = parsedOutput.body;
163
- if (data.Message != null) {
164
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
165
- }
164
+ const doc = (0, smithy_client_1.take)(data, {
165
+ Message: smithy_client_1.expectString,
166
+ });
167
+ Object.assign(contents, doc);
166
168
  const exception = new models_0_1.InvalidArgumentException({
167
169
  $metadata: deserializeMetadata(parsedOutput),
168
170
  ...contents,
@@ -170,11 +172,12 @@ const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
170
172
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
171
173
  };
172
174
  const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
173
- const contents = map({});
175
+ const contents = (0, smithy_client_1.map)({});
174
176
  const data = parsedOutput.body;
175
- if (data.message != null) {
176
- contents.message = (0, smithy_client_1.expectString)(data.message);
177
- }
177
+ const doc = (0, smithy_client_1.take)(data, {
178
+ message: smithy_client_1.expectString,
179
+ });
180
+ Object.assign(contents, doc);
178
181
  const exception = new models_0_1.InvalidClientException({
179
182
  $metadata: deserializeMetadata(parsedOutput),
180
183
  ...contents,
@@ -182,11 +185,12 @@ const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
182
185
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
183
186
  };
184
187
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
185
- const contents = map({});
188
+ const contents = (0, smithy_client_1.map)({});
186
189
  const data = parsedOutput.body;
187
- if (data.Message != null) {
188
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
189
- }
190
+ const doc = (0, smithy_client_1.take)(data, {
191
+ Message: smithy_client_1.expectString,
192
+ });
193
+ Object.assign(contents, doc);
190
194
  const exception = new models_0_1.NotAuthorizedException({
191
195
  $metadata: deserializeMetadata(parsedOutput),
192
196
  ...contents,
@@ -194,11 +198,12 @@ const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
194
198
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
195
199
  };
196
200
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
197
- const contents = map({});
201
+ const contents = (0, smithy_client_1.map)({});
198
202
  const data = parsedOutput.body;
199
- if (data.Message != null) {
200
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
201
- }
203
+ const doc = (0, smithy_client_1.take)(data, {
204
+ Message: smithy_client_1.expectString,
205
+ });
206
+ Object.assign(contents, doc);
202
207
  const exception = new models_0_1.ResourceNotFoundException({
203
208
  $metadata: deserializeMetadata(parsedOutput),
204
209
  ...contents,
@@ -206,47 +211,18 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
206
211
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
207
212
  };
208
213
  const de_SessionExpiredExceptionRes = async (parsedOutput, context) => {
209
- const contents = map({});
214
+ const contents = (0, smithy_client_1.map)({});
210
215
  const data = parsedOutput.body;
211
- if (data.message != null) {
212
- contents.message = (0, smithy_client_1.expectString)(data.message);
213
- }
216
+ const doc = (0, smithy_client_1.take)(data, {
217
+ message: smithy_client_1.expectString,
218
+ });
219
+ Object.assign(contents, doc);
214
220
  const exception = new models_0_1.SessionExpiredException({
215
221
  $metadata: deserializeMetadata(parsedOutput),
216
222
  ...contents,
217
223
  });
218
224
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
219
225
  };
220
- const de_IceServer = (output, context) => {
221
- return {
222
- Password: (0, smithy_client_1.expectString)(output.Password),
223
- Ttl: (0, smithy_client_1.expectInt32)(output.Ttl),
224
- Uris: output.Uris != null ? de_Uris(output.Uris, context) : undefined,
225
- Username: (0, smithy_client_1.expectString)(output.Username),
226
- };
227
- };
228
- const de_IceServerList = (output, context) => {
229
- const retVal = (output || [])
230
- .filter((e) => e != null)
231
- .map((entry) => {
232
- if (entry === null) {
233
- return null;
234
- }
235
- return de_IceServer(entry, context);
236
- });
237
- return retVal;
238
- };
239
- const de_Uris = (output, context) => {
240
- const retVal = (output || [])
241
- .filter((e) => e != null)
242
- .map((entry) => {
243
- if (entry === null) {
244
- return null;
245
- }
246
- return (0, smithy_client_1.expectString)(entry);
247
- });
248
- return retVal;
249
- };
250
226
  const deserializeMetadata = (output) => ({
251
227
  httpStatusCode: output.statusCode,
252
228
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
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";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { KinesisVideoSignalingServiceException as __BaseException } from "../models/KinesisVideoSignalingServiceException";
4
4
  import { ClientLimitExceededException, InvalidArgumentException, InvalidClientException, NotAuthorizedException, ResourceNotFoundException, SessionExpiredException, } from "../models/models_0";
5
5
  export const se_GetIceServerConfigCommand = async (input, context) => {
@@ -9,12 +9,12 @@ export const se_GetIceServerConfigCommand = async (input, context) => {
9
9
  };
10
10
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/get-ice-server-config";
11
11
  let body;
12
- body = JSON.stringify({
13
- ...(input.ChannelARN != null && { ChannelARN: input.ChannelARN }),
14
- ...(input.ClientId != null && { ClientId: input.ClientId }),
15
- ...(input.Service != null && { Service: input.Service }),
16
- ...(input.Username != null && { Username: input.Username }),
17
- });
12
+ body = JSON.stringify(take(input, {
13
+ ChannelARN: [],
14
+ ClientId: [],
15
+ Service: [],
16
+ Username: [],
17
+ }));
18
18
  return new __HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -32,11 +32,11 @@ export const se_SendAlexaOfferToMasterCommand = async (input, context) => {
32
32
  };
33
33
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/send-alexa-offer-to-master";
34
34
  let body;
35
- body = JSON.stringify({
36
- ...(input.ChannelARN != null && { ChannelARN: input.ChannelARN }),
37
- ...(input.MessagePayload != null && { MessagePayload: input.MessagePayload }),
38
- ...(input.SenderClientId != null && { SenderClientId: input.SenderClientId }),
39
- });
35
+ body = JSON.stringify(take(input, {
36
+ ChannelARN: [],
37
+ MessagePayload: [],
38
+ SenderClientId: [],
39
+ }));
40
40
  return new __HttpRequest({
41
41
  protocol,
42
42
  hostname,
@@ -55,9 +55,10 @@ export const de_GetIceServerConfigCommand = async (output, context) => {
55
55
  $metadata: deserializeMetadata(output),
56
56
  });
57
57
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
58
- if (data.IceServerList != null) {
59
- contents.IceServerList = de_IceServerList(data.IceServerList, context);
60
- }
58
+ const doc = take(data, {
59
+ IceServerList: _json,
60
+ });
61
+ Object.assign(contents, doc);
61
62
  return contents;
62
63
  };
63
64
  const de_GetIceServerConfigCommandError = async (output, context) => {
@@ -87,10 +88,9 @@ const de_GetIceServerConfigCommandError = async (output, context) => {
87
88
  throw await de_SessionExpiredExceptionRes(parsedOutput, context);
88
89
  default:
89
90
  const parsedBody = parsedOutput.body;
90
- throwDefaultError({
91
+ return throwDefaultError({
91
92
  output,
92
93
  parsedBody,
93
- exceptionCtor: __BaseException,
94
94
  errorCode,
95
95
  });
96
96
  }
@@ -103,9 +103,10 @@ export const de_SendAlexaOfferToMasterCommand = async (output, context) => {
103
103
  $metadata: deserializeMetadata(output),
104
104
  });
105
105
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
106
- if (data.Answer != null) {
107
- contents.Answer = __expectString(data.Answer);
108
- }
106
+ const doc = take(data, {
107
+ Answer: __expectString,
108
+ });
109
+ Object.assign(contents, doc);
109
110
  return contents;
110
111
  };
111
112
  const de_SendAlexaOfferToMasterCommandError = async (output, context) => {
@@ -129,21 +130,21 @@ const de_SendAlexaOfferToMasterCommandError = async (output, context) => {
129
130
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
130
131
  default:
131
132
  const parsedBody = parsedOutput.body;
132
- throwDefaultError({
133
+ return throwDefaultError({
133
134
  output,
134
135
  parsedBody,
135
- exceptionCtor: __BaseException,
136
136
  errorCode,
137
137
  });
138
138
  }
139
139
  };
140
- const map = __map;
140
+ const throwDefaultError = withBaseException(__BaseException);
141
141
  const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
142
142
  const contents = map({});
143
143
  const data = parsedOutput.body;
144
- if (data.Message != null) {
145
- contents.Message = __expectString(data.Message);
146
- }
144
+ const doc = take(data, {
145
+ Message: __expectString,
146
+ });
147
+ Object.assign(contents, doc);
147
148
  const exception = new ClientLimitExceededException({
148
149
  $metadata: deserializeMetadata(parsedOutput),
149
150
  ...contents,
@@ -153,9 +154,10 @@ const de_ClientLimitExceededExceptionRes = async (parsedOutput, context) => {
153
154
  const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
154
155
  const contents = map({});
155
156
  const data = parsedOutput.body;
156
- if (data.Message != null) {
157
- contents.Message = __expectString(data.Message);
158
- }
157
+ const doc = take(data, {
158
+ Message: __expectString,
159
+ });
160
+ Object.assign(contents, doc);
159
161
  const exception = new InvalidArgumentException({
160
162
  $metadata: deserializeMetadata(parsedOutput),
161
163
  ...contents,
@@ -165,9 +167,10 @@ const de_InvalidArgumentExceptionRes = async (parsedOutput, context) => {
165
167
  const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
166
168
  const contents = map({});
167
169
  const data = parsedOutput.body;
168
- if (data.message != null) {
169
- contents.message = __expectString(data.message);
170
- }
170
+ const doc = take(data, {
171
+ message: __expectString,
172
+ });
173
+ Object.assign(contents, doc);
171
174
  const exception = new InvalidClientException({
172
175
  $metadata: deserializeMetadata(parsedOutput),
173
176
  ...contents,
@@ -177,9 +180,10 @@ const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
177
180
  const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
178
181
  const contents = map({});
179
182
  const data = parsedOutput.body;
180
- if (data.Message != null) {
181
- contents.Message = __expectString(data.Message);
182
- }
183
+ const doc = take(data, {
184
+ Message: __expectString,
185
+ });
186
+ Object.assign(contents, doc);
183
187
  const exception = new NotAuthorizedException({
184
188
  $metadata: deserializeMetadata(parsedOutput),
185
189
  ...contents,
@@ -189,9 +193,10 @@ const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
189
193
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
190
194
  const contents = map({});
191
195
  const data = parsedOutput.body;
192
- if (data.Message != null) {
193
- contents.Message = __expectString(data.Message);
194
- }
196
+ const doc = take(data, {
197
+ Message: __expectString,
198
+ });
199
+ Object.assign(contents, doc);
195
200
  const exception = new ResourceNotFoundException({
196
201
  $metadata: deserializeMetadata(parsedOutput),
197
202
  ...contents,
@@ -201,45 +206,16 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
201
206
  const de_SessionExpiredExceptionRes = async (parsedOutput, context) => {
202
207
  const contents = map({});
203
208
  const data = parsedOutput.body;
204
- if (data.message != null) {
205
- contents.message = __expectString(data.message);
206
- }
209
+ const doc = take(data, {
210
+ message: __expectString,
211
+ });
212
+ Object.assign(contents, doc);
207
213
  const exception = new SessionExpiredException({
208
214
  $metadata: deserializeMetadata(parsedOutput),
209
215
  ...contents,
210
216
  });
211
217
  return __decorateServiceException(exception, parsedOutput.body);
212
218
  };
213
- const de_IceServer = (output, context) => {
214
- return {
215
- Password: __expectString(output.Password),
216
- Ttl: __expectInt32(output.Ttl),
217
- Uris: output.Uris != null ? de_Uris(output.Uris, context) : undefined,
218
- Username: __expectString(output.Username),
219
- };
220
- };
221
- const de_IceServerList = (output, context) => {
222
- const retVal = (output || [])
223
- .filter((e) => e != null)
224
- .map((entry) => {
225
- if (entry === null) {
226
- return null;
227
- }
228
- return de_IceServer(entry, context);
229
- });
230
- return retVal;
231
- };
232
- const de_Uris = (output, context) => {
233
- const retVal = (output || [])
234
- .filter((e) => e != null)
235
- .map((entry) => {
236
- if (entry === null) {
237
- return null;
238
- }
239
- return __expectString(entry);
240
- });
241
- return retVal;
242
- };
243
219
  const deserializeMetadata = (output) => ({
244
220
  httpStatusCode: output.statusCode,
245
221
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-signaling",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Signaling Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.315.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",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.312.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",