@aws-sdk/client-dynamodb-streams 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DynamoDBStreams = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const DescribeStreamCommand_1 = require("./commands/DescribeStreamCommand");
5
6
  const GetRecordsCommand_1 = require("./commands/GetRecordsCommand");
6
7
  const GetShardIteratorCommand_1 = require("./commands/GetShardIteratorCommand");
7
8
  const ListStreamsCommand_1 = require("./commands/ListStreamsCommand");
8
9
  const DynamoDBStreamsClient_1 = require("./DynamoDBStreamsClient");
10
+ const commands = {
11
+ DescribeStreamCommand: DescribeStreamCommand_1.DescribeStreamCommand,
12
+ GetRecordsCommand: GetRecordsCommand_1.GetRecordsCommand,
13
+ GetShardIteratorCommand: GetShardIteratorCommand_1.GetShardIteratorCommand,
14
+ ListStreamsCommand: ListStreamsCommand_1.ListStreamsCommand,
15
+ };
9
16
  class DynamoDBStreams extends DynamoDBStreamsClient_1.DynamoDBStreamsClient {
10
- describeStream(args, optionsOrCb, cb) {
11
- const command = new DescribeStreamCommand_1.DescribeStreamCommand(args);
12
- if (typeof optionsOrCb === "function") {
13
- this.send(command, optionsOrCb);
14
- }
15
- else if (typeof cb === "function") {
16
- if (typeof optionsOrCb !== "object")
17
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
18
- this.send(command, optionsOrCb || {}, cb);
19
- }
20
- else {
21
- return this.send(command, optionsOrCb);
22
- }
23
- }
24
- getRecords(args, optionsOrCb, cb) {
25
- const command = new GetRecordsCommand_1.GetRecordsCommand(args);
26
- if (typeof optionsOrCb === "function") {
27
- this.send(command, optionsOrCb);
28
- }
29
- else if (typeof cb === "function") {
30
- if (typeof optionsOrCb !== "object")
31
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
32
- this.send(command, optionsOrCb || {}, cb);
33
- }
34
- else {
35
- return this.send(command, optionsOrCb);
36
- }
37
- }
38
- getShardIterator(args, optionsOrCb, cb) {
39
- const command = new GetShardIteratorCommand_1.GetShardIteratorCommand(args);
40
- if (typeof optionsOrCb === "function") {
41
- this.send(command, optionsOrCb);
42
- }
43
- else if (typeof cb === "function") {
44
- if (typeof optionsOrCb !== "object")
45
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
46
- this.send(command, optionsOrCb || {}, cb);
47
- }
48
- else {
49
- return this.send(command, optionsOrCb);
50
- }
51
- }
52
- listStreams(args, optionsOrCb, cb) {
53
- const command = new ListStreamsCommand_1.ListStreamsCommand(args);
54
- if (typeof optionsOrCb === "function") {
55
- this.send(command, optionsOrCb);
56
- }
57
- else if (typeof cb === "function") {
58
- if (typeof optionsOrCb !== "object")
59
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
60
- this.send(command, optionsOrCb || {}, cb);
61
- }
62
- else {
63
- return this.send(command, optionsOrCb);
64
- }
65
- }
66
17
  }
67
18
  exports.DynamoDBStreams = DynamoDBStreams;
19
+ (0, smithy_client_1.createAggregatedClient)(commands, DynamoDBStreams);
@@ -8,28 +8,28 @@ const models_0_1 = require("../models/models_0");
8
8
  const se_DescribeStreamCommand = async (input, context) => {
9
9
  const headers = sharedHeaders("DescribeStream");
10
10
  let body;
11
- body = JSON.stringify(se_DescribeStreamInput(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
12
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
13
  };
14
14
  exports.se_DescribeStreamCommand = se_DescribeStreamCommand;
15
15
  const se_GetRecordsCommand = async (input, context) => {
16
16
  const headers = sharedHeaders("GetRecords");
17
17
  let body;
18
- body = JSON.stringify(se_GetRecordsInput(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
19
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
20
  };
21
21
  exports.se_GetRecordsCommand = se_GetRecordsCommand;
22
22
  const se_GetShardIteratorCommand = async (input, context) => {
23
23
  const headers = sharedHeaders("GetShardIterator");
24
24
  let body;
25
- body = JSON.stringify(se_GetShardIteratorInput(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
27
  };
28
28
  exports.se_GetShardIteratorCommand = se_GetShardIteratorCommand;
29
29
  const se_ListStreamsCommand = async (input, context) => {
30
30
  const headers = sharedHeaders("ListStreams");
31
31
  let body;
32
- body = JSON.stringify(se_ListStreamsInput(input, context));
32
+ body = JSON.stringify((0, smithy_client_1._json)(input));
33
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
34
  };
35
35
  exports.se_ListStreamsCommand = se_ListStreamsCommand;
@@ -44,7 +44,7 @@ const de_DescribeStreamCommand = async (output, context) => {
44
44
  $metadata: deserializeMetadata(output),
45
45
  ...contents,
46
46
  };
47
- return Promise.resolve(response);
47
+ return response;
48
48
  };
49
49
  exports.de_DescribeStreamCommand = de_DescribeStreamCommand;
50
50
  const de_DescribeStreamCommandError = async (output, context) => {
@@ -62,10 +62,9 @@ const de_DescribeStreamCommandError = async (output, context) => {
62
62
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
63
63
  default:
64
64
  const parsedBody = parsedOutput.body;
65
- (0, smithy_client_1.throwDefaultError)({
65
+ return throwDefaultError({
66
66
  output,
67
67
  parsedBody,
68
- exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
69
68
  errorCode,
70
69
  });
71
70
  }
@@ -81,7 +80,7 @@ const de_GetRecordsCommand = async (output, context) => {
81
80
  $metadata: deserializeMetadata(output),
82
81
  ...contents,
83
82
  };
84
- return Promise.resolve(response);
83
+ return response;
85
84
  };
86
85
  exports.de_GetRecordsCommand = de_GetRecordsCommand;
87
86
  const de_GetRecordsCommandError = async (output, context) => {
@@ -108,10 +107,9 @@ const de_GetRecordsCommandError = async (output, context) => {
108
107
  throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
109
108
  default:
110
109
  const parsedBody = parsedOutput.body;
111
- (0, smithy_client_1.throwDefaultError)({
110
+ return throwDefaultError({
112
111
  output,
113
112
  parsedBody,
114
- exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
115
113
  errorCode,
116
114
  });
117
115
  }
@@ -122,12 +120,12 @@ const de_GetShardIteratorCommand = async (output, context) => {
122
120
  }
123
121
  const data = await parseBody(output.body, context);
124
122
  let contents = {};
125
- contents = de_GetShardIteratorOutput(data, context);
123
+ contents = (0, smithy_client_1._json)(data);
126
124
  const response = {
127
125
  $metadata: deserializeMetadata(output),
128
126
  ...contents,
129
127
  };
130
- return Promise.resolve(response);
128
+ return response;
131
129
  };
132
130
  exports.de_GetShardIteratorCommand = de_GetShardIteratorCommand;
133
131
  const de_GetShardIteratorCommandError = async (output, context) => {
@@ -148,10 +146,9 @@ const de_GetShardIteratorCommandError = async (output, context) => {
148
146
  throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
149
147
  default:
150
148
  const parsedBody = parsedOutput.body;
151
- (0, smithy_client_1.throwDefaultError)({
149
+ return throwDefaultError({
152
150
  output,
153
151
  parsedBody,
154
- exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
155
152
  errorCode,
156
153
  });
157
154
  }
@@ -162,12 +159,12 @@ const de_ListStreamsCommand = async (output, context) => {
162
159
  }
163
160
  const data = await parseBody(output.body, context);
164
161
  let contents = {};
165
- contents = de_ListStreamsOutput(data, context);
162
+ contents = (0, smithy_client_1._json)(data);
166
163
  const response = {
167
164
  $metadata: deserializeMetadata(output),
168
165
  ...contents,
169
166
  };
170
- return Promise.resolve(response);
167
+ return response;
171
168
  };
172
169
  exports.de_ListStreamsCommand = de_ListStreamsCommand;
173
170
  const de_ListStreamsCommandError = async (output, context) => {
@@ -185,17 +182,16 @@ const de_ListStreamsCommandError = async (output, context) => {
185
182
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
186
183
  default:
187
184
  const parsedBody = parsedOutput.body;
188
- (0, smithy_client_1.throwDefaultError)({
185
+ return throwDefaultError({
189
186
  output,
190
187
  parsedBody,
191
- exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
192
188
  errorCode,
193
189
  });
194
190
  }
195
191
  };
196
192
  const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
197
193
  const body = parsedOutput.body;
198
- const deserialized = de_ExpiredIteratorException(body, context);
194
+ const deserialized = (0, smithy_client_1._json)(body);
199
195
  const exception = new models_0_1.ExpiredIteratorException({
200
196
  $metadata: deserializeMetadata(parsedOutput),
201
197
  ...deserialized,
@@ -204,7 +200,7 @@ const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
204
200
  };
205
201
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
206
202
  const body = parsedOutput.body;
207
- const deserialized = de_InternalServerError(body, context);
203
+ const deserialized = (0, smithy_client_1._json)(body);
208
204
  const exception = new models_0_1.InternalServerError({
209
205
  $metadata: deserializeMetadata(parsedOutput),
210
206
  ...deserialized,
@@ -213,7 +209,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
213
209
  };
214
210
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
215
211
  const body = parsedOutput.body;
216
- const deserialized = de_LimitExceededException(body, context);
212
+ const deserialized = (0, smithy_client_1._json)(body);
217
213
  const exception = new models_0_1.LimitExceededException({
218
214
  $metadata: deserializeMetadata(parsedOutput),
219
215
  ...deserialized,
@@ -222,7 +218,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
222
218
  };
223
219
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
224
220
  const body = parsedOutput.body;
225
- const deserialized = de_ResourceNotFoundException(body, context);
221
+ const deserialized = (0, smithy_client_1._json)(body);
226
222
  const exception = new models_0_1.ResourceNotFoundException({
227
223
  $metadata: deserializeMetadata(parsedOutput),
228
224
  ...deserialized,
@@ -231,41 +227,13 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
231
227
  };
232
228
  const de_TrimmedDataAccessExceptionRes = async (parsedOutput, context) => {
233
229
  const body = parsedOutput.body;
234
- const deserialized = de_TrimmedDataAccessException(body, context);
230
+ const deserialized = (0, smithy_client_1._json)(body);
235
231
  const exception = new models_0_1.TrimmedDataAccessException({
236
232
  $metadata: deserializeMetadata(parsedOutput),
237
233
  ...deserialized,
238
234
  });
239
235
  return (0, smithy_client_1.decorateServiceException)(exception, body);
240
236
  };
241
- const se_DescribeStreamInput = (input, context) => {
242
- return {
243
- ...(input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId }),
244
- ...(input.Limit != null && { Limit: input.Limit }),
245
- ...(input.StreamArn != null && { StreamArn: input.StreamArn }),
246
- };
247
- };
248
- const se_GetRecordsInput = (input, context) => {
249
- return {
250
- ...(input.Limit != null && { Limit: input.Limit }),
251
- ...(input.ShardIterator != null && { ShardIterator: input.ShardIterator }),
252
- };
253
- };
254
- const se_GetShardIteratorInput = (input, context) => {
255
- return {
256
- ...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
257
- ...(input.ShardId != null && { ShardId: input.ShardId }),
258
- ...(input.ShardIteratorType != null && { ShardIteratorType: input.ShardIteratorType }),
259
- ...(input.StreamArn != null && { StreamArn: input.StreamArn }),
260
- };
261
- };
262
- const se_ListStreamsInput = (input, context) => {
263
- return {
264
- ...(input.ExclusiveStartStreamArn != null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }),
265
- ...(input.Limit != null && { Limit: input.Limit }),
266
- ...(input.TableName != null && { TableName: input.TableName }),
267
- };
268
- };
269
237
  const de_AttributeMap = (output, context) => {
270
238
  return Object.entries(output).reduce((acc, [key, value]) => {
271
239
  if (value === null) {
@@ -304,7 +272,7 @@ const de_AttributeValue = (output, context) => {
304
272
  }
305
273
  if (output.NS != null) {
306
274
  return {
307
- NS: de_NumberSetAttributeValue(output.NS, context),
275
+ NS: (0, smithy_client_1._json)(output.NS),
308
276
  };
309
277
  }
310
278
  if ((0, smithy_client_1.expectBoolean)(output.NULL) !== undefined) {
@@ -315,7 +283,7 @@ const de_AttributeValue = (output, context) => {
315
283
  }
316
284
  if (output.SS != null) {
317
285
  return {
318
- SS: de_StringSetAttributeValue(output.SS, context),
286
+ SS: (0, smithy_client_1._json)(output.SS),
319
287
  };
320
288
  }
321
289
  return { $unknown: Object.entries(output)[0] };
@@ -324,84 +292,29 @@ const de_BinarySetAttributeValue = (output, context) => {
324
292
  const retVal = (output || [])
325
293
  .filter((e) => e != null)
326
294
  .map((entry) => {
327
- if (entry === null) {
328
- return null;
329
- }
330
295
  return context.base64Decoder(entry);
331
296
  });
332
297
  return retVal;
333
298
  };
334
299
  const de_DescribeStreamOutput = (output, context) => {
335
- return {
336
- StreamDescription: output.StreamDescription != null ? de_StreamDescription(output.StreamDescription, context) : undefined,
337
- };
338
- };
339
- const de_ExpiredIteratorException = (output, context) => {
340
- return {
341
- message: (0, smithy_client_1.expectString)(output.message),
342
- };
300
+ return (0, smithy_client_1.take)(output, {
301
+ StreamDescription: (_) => de_StreamDescription(_, context),
302
+ });
343
303
  };
344
304
  const de_GetRecordsOutput = (output, context) => {
345
- return {
346
- NextShardIterator: (0, smithy_client_1.expectString)(output.NextShardIterator),
347
- Records: output.Records != null ? de_RecordList(output.Records, context) : undefined,
348
- };
349
- };
350
- const de_GetShardIteratorOutput = (output, context) => {
351
- return {
352
- ShardIterator: (0, smithy_client_1.expectString)(output.ShardIterator),
353
- };
354
- };
355
- const de_Identity = (output, context) => {
356
- return {
357
- PrincipalId: (0, smithy_client_1.expectString)(output.PrincipalId),
358
- Type: (0, smithy_client_1.expectString)(output.Type),
359
- };
360
- };
361
- const de_InternalServerError = (output, context) => {
362
- return {
363
- message: (0, smithy_client_1.expectString)(output.message),
364
- };
365
- };
366
- const de_KeySchema = (output, context) => {
367
- const retVal = (output || [])
368
- .filter((e) => e != null)
369
- .map((entry) => {
370
- if (entry === null) {
371
- return null;
372
- }
373
- return de_KeySchemaElement(entry, context);
305
+ return (0, smithy_client_1.take)(output, {
306
+ NextShardIterator: smithy_client_1.expectString,
307
+ Records: (_) => de_RecordList(_, context),
374
308
  });
375
- return retVal;
376
- };
377
- const de_KeySchemaElement = (output, context) => {
378
- return {
379
- AttributeName: (0, smithy_client_1.expectString)(output.AttributeName),
380
- KeyType: (0, smithy_client_1.expectString)(output.KeyType),
381
- };
382
- };
383
- const de_LimitExceededException = (output, context) => {
384
- return {
385
- message: (0, smithy_client_1.expectString)(output.message),
386
- };
387
309
  };
388
310
  const de_ListAttributeValue = (output, context) => {
389
311
  const retVal = (output || [])
390
312
  .filter((e) => e != null)
391
313
  .map((entry) => {
392
- if (entry === null) {
393
- return null;
394
- }
395
314
  return de_AttributeValue((0, smithy_client_1.expectUnion)(entry), context);
396
315
  });
397
316
  return retVal;
398
317
  };
399
- const de_ListStreamsOutput = (output, context) => {
400
- return {
401
- LastEvaluatedStreamArn: (0, smithy_client_1.expectString)(output.LastEvaluatedStreamArn),
402
- Streams: output.Streams != null ? de_StreamList(output.Streams, context) : undefined,
403
- };
404
- };
405
318
  const de_MapAttributeValue = (output, context) => {
406
319
  return Object.entries(output).reduce((acc, [key, value]) => {
407
320
  if (value === null) {
@@ -411,129 +324,48 @@ const de_MapAttributeValue = (output, context) => {
411
324
  return acc;
412
325
  }, {});
413
326
  };
414
- const de_NumberSetAttributeValue = (output, context) => {
415
- const retVal = (output || [])
416
- .filter((e) => e != null)
417
- .map((entry) => {
418
- if (entry === null) {
419
- return null;
420
- }
421
- return (0, smithy_client_1.expectString)(entry);
422
- });
423
- return retVal;
424
- };
425
327
  const de__Record = (output, context) => {
426
- return {
427
- awsRegion: (0, smithy_client_1.expectString)(output.awsRegion),
428
- dynamodb: output.dynamodb != null ? de_StreamRecord(output.dynamodb, context) : undefined,
429
- eventID: (0, smithy_client_1.expectString)(output.eventID),
430
- eventName: (0, smithy_client_1.expectString)(output.eventName),
431
- eventSource: (0, smithy_client_1.expectString)(output.eventSource),
432
- eventVersion: (0, smithy_client_1.expectString)(output.eventVersion),
433
- userIdentity: output.userIdentity != null ? de_Identity(output.userIdentity, context) : undefined,
434
- };
328
+ return (0, smithy_client_1.take)(output, {
329
+ awsRegion: smithy_client_1.expectString,
330
+ dynamodb: (_) => de_StreamRecord(_, context),
331
+ eventID: smithy_client_1.expectString,
332
+ eventName: smithy_client_1.expectString,
333
+ eventSource: smithy_client_1.expectString,
334
+ eventVersion: smithy_client_1.expectString,
335
+ userIdentity: smithy_client_1._json,
336
+ });
435
337
  };
436
338
  const de_RecordList = (output, context) => {
437
339
  const retVal = (output || [])
438
340
  .filter((e) => e != null)
439
341
  .map((entry) => {
440
- if (entry === null) {
441
- return null;
442
- }
443
342
  return de__Record(entry, context);
444
343
  });
445
344
  return retVal;
446
345
  };
447
- const de_ResourceNotFoundException = (output, context) => {
448
- return {
449
- message: (0, smithy_client_1.expectString)(output.message),
450
- };
451
- };
452
- const de_SequenceNumberRange = (output, context) => {
453
- return {
454
- EndingSequenceNumber: (0, smithy_client_1.expectString)(output.EndingSequenceNumber),
455
- StartingSequenceNumber: (0, smithy_client_1.expectString)(output.StartingSequenceNumber),
456
- };
457
- };
458
- const de_Shard = (output, context) => {
459
- return {
460
- ParentShardId: (0, smithy_client_1.expectString)(output.ParentShardId),
461
- SequenceNumberRange: output.SequenceNumberRange != null ? de_SequenceNumberRange(output.SequenceNumberRange, context) : undefined,
462
- ShardId: (0, smithy_client_1.expectString)(output.ShardId),
463
- };
464
- };
465
- const de_ShardDescriptionList = (output, context) => {
466
- const retVal = (output || [])
467
- .filter((e) => e != null)
468
- .map((entry) => {
469
- if (entry === null) {
470
- return null;
471
- }
472
- return de_Shard(entry, context);
473
- });
474
- return retVal;
475
- };
476
- const de__Stream = (output, context) => {
477
- return {
478
- StreamArn: (0, smithy_client_1.expectString)(output.StreamArn),
479
- StreamLabel: (0, smithy_client_1.expectString)(output.StreamLabel),
480
- TableName: (0, smithy_client_1.expectString)(output.TableName),
481
- };
482
- };
483
346
  const de_StreamDescription = (output, context) => {
484
- return {
485
- CreationRequestDateTime: output.CreationRequestDateTime != null
486
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.CreationRequestDateTime)))
487
- : undefined,
488
- KeySchema: output.KeySchema != null ? de_KeySchema(output.KeySchema, context) : undefined,
489
- LastEvaluatedShardId: (0, smithy_client_1.expectString)(output.LastEvaluatedShardId),
490
- Shards: output.Shards != null ? de_ShardDescriptionList(output.Shards, context) : undefined,
491
- StreamArn: (0, smithy_client_1.expectString)(output.StreamArn),
492
- StreamLabel: (0, smithy_client_1.expectString)(output.StreamLabel),
493
- StreamStatus: (0, smithy_client_1.expectString)(output.StreamStatus),
494
- StreamViewType: (0, smithy_client_1.expectString)(output.StreamViewType),
495
- TableName: (0, smithy_client_1.expectString)(output.TableName),
496
- };
497
- };
498
- const de_StreamList = (output, context) => {
499
- const retVal = (output || [])
500
- .filter((e) => e != null)
501
- .map((entry) => {
502
- if (entry === null) {
503
- return null;
504
- }
505
- return de__Stream(entry, context);
347
+ return (0, smithy_client_1.take)(output, {
348
+ CreationRequestDateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
349
+ KeySchema: smithy_client_1._json,
350
+ LastEvaluatedShardId: smithy_client_1.expectString,
351
+ Shards: smithy_client_1._json,
352
+ StreamArn: smithy_client_1.expectString,
353
+ StreamLabel: smithy_client_1.expectString,
354
+ StreamStatus: smithy_client_1.expectString,
355
+ StreamViewType: smithy_client_1.expectString,
356
+ TableName: smithy_client_1.expectString,
506
357
  });
507
- return retVal;
508
358
  };
509
359
  const de_StreamRecord = (output, context) => {
510
- return {
511
- ApproximateCreationDateTime: output.ApproximateCreationDateTime != null
512
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.ApproximateCreationDateTime)))
513
- : undefined,
514
- Keys: output.Keys != null ? de_AttributeMap(output.Keys, context) : undefined,
515
- NewImage: output.NewImage != null ? de_AttributeMap(output.NewImage, context) : undefined,
516
- OldImage: output.OldImage != null ? de_AttributeMap(output.OldImage, context) : undefined,
517
- SequenceNumber: (0, smithy_client_1.expectString)(output.SequenceNumber),
518
- SizeBytes: (0, smithy_client_1.expectLong)(output.SizeBytes),
519
- StreamViewType: (0, smithy_client_1.expectString)(output.StreamViewType),
520
- };
521
- };
522
- const de_StringSetAttributeValue = (output, context) => {
523
- const retVal = (output || [])
524
- .filter((e) => e != null)
525
- .map((entry) => {
526
- if (entry === null) {
527
- return null;
528
- }
529
- return (0, smithy_client_1.expectString)(entry);
360
+ return (0, smithy_client_1.take)(output, {
361
+ ApproximateCreationDateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
362
+ Keys: (_) => de_AttributeMap(_, context),
363
+ NewImage: (_) => de_AttributeMap(_, context),
364
+ OldImage: (_) => de_AttributeMap(_, context),
365
+ SequenceNumber: smithy_client_1.expectString,
366
+ SizeBytes: smithy_client_1.expectLong,
367
+ StreamViewType: smithy_client_1.expectString,
530
368
  });
531
- return retVal;
532
- };
533
- const de_TrimmedDataAccessException = (output, context) => {
534
- return {
535
- message: (0, smithy_client_1.expectString)(output.message),
536
- };
537
369
  };
538
370
  const deserializeMetadata = (output) => ({
539
371
  httpStatusCode: output.statusCode,
@@ -548,6 +380,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
548
380
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
549
381
  };
550
382
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
383
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException);
551
384
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
552
385
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
553
386
  const contents = {
@@ -1,63 +1,15 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { DescribeStreamCommand, } from "./commands/DescribeStreamCommand";
2
3
  import { GetRecordsCommand } from "./commands/GetRecordsCommand";
3
4
  import { GetShardIteratorCommand, } from "./commands/GetShardIteratorCommand";
4
5
  import { ListStreamsCommand } from "./commands/ListStreamsCommand";
5
6
  import { DynamoDBStreamsClient } from "./DynamoDBStreamsClient";
7
+ const commands = {
8
+ DescribeStreamCommand,
9
+ GetRecordsCommand,
10
+ GetShardIteratorCommand,
11
+ ListStreamsCommand,
12
+ };
6
13
  export class DynamoDBStreams extends DynamoDBStreamsClient {
7
- describeStream(args, optionsOrCb, cb) {
8
- const command = new DescribeStreamCommand(args);
9
- if (typeof optionsOrCb === "function") {
10
- this.send(command, optionsOrCb);
11
- }
12
- else if (typeof cb === "function") {
13
- if (typeof optionsOrCb !== "object")
14
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
15
- this.send(command, optionsOrCb || {}, cb);
16
- }
17
- else {
18
- return this.send(command, optionsOrCb);
19
- }
20
- }
21
- getRecords(args, optionsOrCb, cb) {
22
- const command = new GetRecordsCommand(args);
23
- if (typeof optionsOrCb === "function") {
24
- this.send(command, optionsOrCb);
25
- }
26
- else if (typeof cb === "function") {
27
- if (typeof optionsOrCb !== "object")
28
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
29
- this.send(command, optionsOrCb || {}, cb);
30
- }
31
- else {
32
- return this.send(command, optionsOrCb);
33
- }
34
- }
35
- getShardIterator(args, optionsOrCb, cb) {
36
- const command = new GetShardIteratorCommand(args);
37
- if (typeof optionsOrCb === "function") {
38
- this.send(command, optionsOrCb);
39
- }
40
- else if (typeof cb === "function") {
41
- if (typeof optionsOrCb !== "object")
42
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
43
- this.send(command, optionsOrCb || {}, cb);
44
- }
45
- else {
46
- return this.send(command, optionsOrCb);
47
- }
48
- }
49
- listStreams(args, optionsOrCb, cb) {
50
- const command = new ListStreamsCommand(args);
51
- if (typeof optionsOrCb === "function") {
52
- this.send(command, optionsOrCb);
53
- }
54
- else if (typeof cb === "function") {
55
- if (typeof optionsOrCb !== "object")
56
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
57
- this.send(command, optionsOrCb || {}, cb);
58
- }
59
- else {
60
- return this.send(command, optionsOrCb);
61
- }
62
- }
63
14
  }
15
+ createAggregatedClient(commands, DynamoDBStreams);
@@ -1,29 +1,29 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { DynamoDBStreamsServiceException as __BaseException } from "../models/DynamoDBStreamsServiceException";
4
4
  import { ExpiredIteratorException, InternalServerError, LimitExceededException, ResourceNotFoundException, TrimmedDataAccessException, } from "../models/models_0";
5
5
  export const se_DescribeStreamCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("DescribeStream");
7
7
  let body;
8
- body = JSON.stringify(se_DescribeStreamInput(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_GetRecordsCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("GetRecords");
13
13
  let body;
14
- body = JSON.stringify(se_GetRecordsInput(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const se_GetShardIteratorCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("GetShardIterator");
19
19
  let body;
20
- body = JSON.stringify(se_GetShardIteratorInput(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const se_ListStreamsCommand = async (input, context) => {
24
24
  const headers = sharedHeaders("ListStreams");
25
25
  let body;
26
- body = JSON.stringify(se_ListStreamsInput(input, context));
26
+ body = JSON.stringify(_json(input));
27
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
28
  };
29
29
  export const de_DescribeStreamCommand = async (output, context) => {
@@ -37,7 +37,7 @@ export const de_DescribeStreamCommand = async (output, context) => {
37
37
  $metadata: deserializeMetadata(output),
38
38
  ...contents,
39
39
  };
40
- return Promise.resolve(response);
40
+ return response;
41
41
  };
42
42
  const de_DescribeStreamCommandError = async (output, context) => {
43
43
  const parsedOutput = {
@@ -54,10 +54,9 @@ const de_DescribeStreamCommandError = async (output, context) => {
54
54
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
55
55
  default:
56
56
  const parsedBody = parsedOutput.body;
57
- throwDefaultError({
57
+ return throwDefaultError({
58
58
  output,
59
59
  parsedBody,
60
- exceptionCtor: __BaseException,
61
60
  errorCode,
62
61
  });
63
62
  }
@@ -73,7 +72,7 @@ export const de_GetRecordsCommand = async (output, context) => {
73
72
  $metadata: deserializeMetadata(output),
74
73
  ...contents,
75
74
  };
76
- return Promise.resolve(response);
75
+ return response;
77
76
  };
78
77
  const de_GetRecordsCommandError = async (output, context) => {
79
78
  const parsedOutput = {
@@ -99,10 +98,9 @@ const de_GetRecordsCommandError = async (output, context) => {
99
98
  throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
100
99
  default:
101
100
  const parsedBody = parsedOutput.body;
102
- throwDefaultError({
101
+ return throwDefaultError({
103
102
  output,
104
103
  parsedBody,
105
- exceptionCtor: __BaseException,
106
104
  errorCode,
107
105
  });
108
106
  }
@@ -113,12 +111,12 @@ export const de_GetShardIteratorCommand = async (output, context) => {
113
111
  }
114
112
  const data = await parseBody(output.body, context);
115
113
  let contents = {};
116
- contents = de_GetShardIteratorOutput(data, context);
114
+ contents = _json(data);
117
115
  const response = {
118
116
  $metadata: deserializeMetadata(output),
119
117
  ...contents,
120
118
  };
121
- return Promise.resolve(response);
119
+ return response;
122
120
  };
123
121
  const de_GetShardIteratorCommandError = async (output, context) => {
124
122
  const parsedOutput = {
@@ -138,10 +136,9 @@ const de_GetShardIteratorCommandError = async (output, context) => {
138
136
  throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
139
137
  default:
140
138
  const parsedBody = parsedOutput.body;
141
- throwDefaultError({
139
+ return throwDefaultError({
142
140
  output,
143
141
  parsedBody,
144
- exceptionCtor: __BaseException,
145
142
  errorCode,
146
143
  });
147
144
  }
@@ -152,12 +149,12 @@ export const de_ListStreamsCommand = async (output, context) => {
152
149
  }
153
150
  const data = await parseBody(output.body, context);
154
151
  let contents = {};
155
- contents = de_ListStreamsOutput(data, context);
152
+ contents = _json(data);
156
153
  const response = {
157
154
  $metadata: deserializeMetadata(output),
158
155
  ...contents,
159
156
  };
160
- return Promise.resolve(response);
157
+ return response;
161
158
  };
162
159
  const de_ListStreamsCommandError = async (output, context) => {
163
160
  const parsedOutput = {
@@ -174,17 +171,16 @@ const de_ListStreamsCommandError = async (output, context) => {
174
171
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
175
172
  default:
176
173
  const parsedBody = parsedOutput.body;
177
- throwDefaultError({
174
+ return throwDefaultError({
178
175
  output,
179
176
  parsedBody,
180
- exceptionCtor: __BaseException,
181
177
  errorCode,
182
178
  });
183
179
  }
184
180
  };
185
181
  const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
186
182
  const body = parsedOutput.body;
187
- const deserialized = de_ExpiredIteratorException(body, context);
183
+ const deserialized = _json(body);
188
184
  const exception = new ExpiredIteratorException({
189
185
  $metadata: deserializeMetadata(parsedOutput),
190
186
  ...deserialized,
@@ -193,7 +189,7 @@ const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
193
189
  };
194
190
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
195
191
  const body = parsedOutput.body;
196
- const deserialized = de_InternalServerError(body, context);
192
+ const deserialized = _json(body);
197
193
  const exception = new InternalServerError({
198
194
  $metadata: deserializeMetadata(parsedOutput),
199
195
  ...deserialized,
@@ -202,7 +198,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
202
198
  };
203
199
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
204
200
  const body = parsedOutput.body;
205
- const deserialized = de_LimitExceededException(body, context);
201
+ const deserialized = _json(body);
206
202
  const exception = new LimitExceededException({
207
203
  $metadata: deserializeMetadata(parsedOutput),
208
204
  ...deserialized,
@@ -211,7 +207,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
211
207
  };
212
208
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
213
209
  const body = parsedOutput.body;
214
- const deserialized = de_ResourceNotFoundException(body, context);
210
+ const deserialized = _json(body);
215
211
  const exception = new ResourceNotFoundException({
216
212
  $metadata: deserializeMetadata(parsedOutput),
217
213
  ...deserialized,
@@ -220,41 +216,13 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
220
216
  };
221
217
  const de_TrimmedDataAccessExceptionRes = async (parsedOutput, context) => {
222
218
  const body = parsedOutput.body;
223
- const deserialized = de_TrimmedDataAccessException(body, context);
219
+ const deserialized = _json(body);
224
220
  const exception = new TrimmedDataAccessException({
225
221
  $metadata: deserializeMetadata(parsedOutput),
226
222
  ...deserialized,
227
223
  });
228
224
  return __decorateServiceException(exception, body);
229
225
  };
230
- const se_DescribeStreamInput = (input, context) => {
231
- return {
232
- ...(input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId }),
233
- ...(input.Limit != null && { Limit: input.Limit }),
234
- ...(input.StreamArn != null && { StreamArn: input.StreamArn }),
235
- };
236
- };
237
- const se_GetRecordsInput = (input, context) => {
238
- return {
239
- ...(input.Limit != null && { Limit: input.Limit }),
240
- ...(input.ShardIterator != null && { ShardIterator: input.ShardIterator }),
241
- };
242
- };
243
- const se_GetShardIteratorInput = (input, context) => {
244
- return {
245
- ...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
246
- ...(input.ShardId != null && { ShardId: input.ShardId }),
247
- ...(input.ShardIteratorType != null && { ShardIteratorType: input.ShardIteratorType }),
248
- ...(input.StreamArn != null && { StreamArn: input.StreamArn }),
249
- };
250
- };
251
- const se_ListStreamsInput = (input, context) => {
252
- return {
253
- ...(input.ExclusiveStartStreamArn != null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }),
254
- ...(input.Limit != null && { Limit: input.Limit }),
255
- ...(input.TableName != null && { TableName: input.TableName }),
256
- };
257
- };
258
226
  const de_AttributeMap = (output, context) => {
259
227
  return Object.entries(output).reduce((acc, [key, value]) => {
260
228
  if (value === null) {
@@ -293,7 +261,7 @@ const de_AttributeValue = (output, context) => {
293
261
  }
294
262
  if (output.NS != null) {
295
263
  return {
296
- NS: de_NumberSetAttributeValue(output.NS, context),
264
+ NS: _json(output.NS),
297
265
  };
298
266
  }
299
267
  if (__expectBoolean(output.NULL) !== undefined) {
@@ -304,7 +272,7 @@ const de_AttributeValue = (output, context) => {
304
272
  }
305
273
  if (output.SS != null) {
306
274
  return {
307
- SS: de_StringSetAttributeValue(output.SS, context),
275
+ SS: _json(output.SS),
308
276
  };
309
277
  }
310
278
  return { $unknown: Object.entries(output)[0] };
@@ -313,84 +281,29 @@ const de_BinarySetAttributeValue = (output, context) => {
313
281
  const retVal = (output || [])
314
282
  .filter((e) => e != null)
315
283
  .map((entry) => {
316
- if (entry === null) {
317
- return null;
318
- }
319
284
  return context.base64Decoder(entry);
320
285
  });
321
286
  return retVal;
322
287
  };
323
288
  const de_DescribeStreamOutput = (output, context) => {
324
- return {
325
- StreamDescription: output.StreamDescription != null ? de_StreamDescription(output.StreamDescription, context) : undefined,
326
- };
327
- };
328
- const de_ExpiredIteratorException = (output, context) => {
329
- return {
330
- message: __expectString(output.message),
331
- };
289
+ return take(output, {
290
+ StreamDescription: (_) => de_StreamDescription(_, context),
291
+ });
332
292
  };
333
293
  const de_GetRecordsOutput = (output, context) => {
334
- return {
335
- NextShardIterator: __expectString(output.NextShardIterator),
336
- Records: output.Records != null ? de_RecordList(output.Records, context) : undefined,
337
- };
338
- };
339
- const de_GetShardIteratorOutput = (output, context) => {
340
- return {
341
- ShardIterator: __expectString(output.ShardIterator),
342
- };
343
- };
344
- const de_Identity = (output, context) => {
345
- return {
346
- PrincipalId: __expectString(output.PrincipalId),
347
- Type: __expectString(output.Type),
348
- };
349
- };
350
- const de_InternalServerError = (output, context) => {
351
- return {
352
- message: __expectString(output.message),
353
- };
354
- };
355
- const de_KeySchema = (output, context) => {
356
- const retVal = (output || [])
357
- .filter((e) => e != null)
358
- .map((entry) => {
359
- if (entry === null) {
360
- return null;
361
- }
362
- return de_KeySchemaElement(entry, context);
294
+ return take(output, {
295
+ NextShardIterator: __expectString,
296
+ Records: (_) => de_RecordList(_, context),
363
297
  });
364
- return retVal;
365
- };
366
- const de_KeySchemaElement = (output, context) => {
367
- return {
368
- AttributeName: __expectString(output.AttributeName),
369
- KeyType: __expectString(output.KeyType),
370
- };
371
- };
372
- const de_LimitExceededException = (output, context) => {
373
- return {
374
- message: __expectString(output.message),
375
- };
376
298
  };
377
299
  const de_ListAttributeValue = (output, context) => {
378
300
  const retVal = (output || [])
379
301
  .filter((e) => e != null)
380
302
  .map((entry) => {
381
- if (entry === null) {
382
- return null;
383
- }
384
303
  return de_AttributeValue(__expectUnion(entry), context);
385
304
  });
386
305
  return retVal;
387
306
  };
388
- const de_ListStreamsOutput = (output, context) => {
389
- return {
390
- LastEvaluatedStreamArn: __expectString(output.LastEvaluatedStreamArn),
391
- Streams: output.Streams != null ? de_StreamList(output.Streams, context) : undefined,
392
- };
393
- };
394
307
  const de_MapAttributeValue = (output, context) => {
395
308
  return Object.entries(output).reduce((acc, [key, value]) => {
396
309
  if (value === null) {
@@ -400,129 +313,48 @@ const de_MapAttributeValue = (output, context) => {
400
313
  return acc;
401
314
  }, {});
402
315
  };
403
- const de_NumberSetAttributeValue = (output, context) => {
404
- const retVal = (output || [])
405
- .filter((e) => e != null)
406
- .map((entry) => {
407
- if (entry === null) {
408
- return null;
409
- }
410
- return __expectString(entry);
411
- });
412
- return retVal;
413
- };
414
316
  const de__Record = (output, context) => {
415
- return {
416
- awsRegion: __expectString(output.awsRegion),
417
- dynamodb: output.dynamodb != null ? de_StreamRecord(output.dynamodb, context) : undefined,
418
- eventID: __expectString(output.eventID),
419
- eventName: __expectString(output.eventName),
420
- eventSource: __expectString(output.eventSource),
421
- eventVersion: __expectString(output.eventVersion),
422
- userIdentity: output.userIdentity != null ? de_Identity(output.userIdentity, context) : undefined,
423
- };
317
+ return take(output, {
318
+ awsRegion: __expectString,
319
+ dynamodb: (_) => de_StreamRecord(_, context),
320
+ eventID: __expectString,
321
+ eventName: __expectString,
322
+ eventSource: __expectString,
323
+ eventVersion: __expectString,
324
+ userIdentity: _json,
325
+ });
424
326
  };
425
327
  const de_RecordList = (output, context) => {
426
328
  const retVal = (output || [])
427
329
  .filter((e) => e != null)
428
330
  .map((entry) => {
429
- if (entry === null) {
430
- return null;
431
- }
432
331
  return de__Record(entry, context);
433
332
  });
434
333
  return retVal;
435
334
  };
436
- const de_ResourceNotFoundException = (output, context) => {
437
- return {
438
- message: __expectString(output.message),
439
- };
440
- };
441
- const de_SequenceNumberRange = (output, context) => {
442
- return {
443
- EndingSequenceNumber: __expectString(output.EndingSequenceNumber),
444
- StartingSequenceNumber: __expectString(output.StartingSequenceNumber),
445
- };
446
- };
447
- const de_Shard = (output, context) => {
448
- return {
449
- ParentShardId: __expectString(output.ParentShardId),
450
- SequenceNumberRange: output.SequenceNumberRange != null ? de_SequenceNumberRange(output.SequenceNumberRange, context) : undefined,
451
- ShardId: __expectString(output.ShardId),
452
- };
453
- };
454
- const de_ShardDescriptionList = (output, context) => {
455
- const retVal = (output || [])
456
- .filter((e) => e != null)
457
- .map((entry) => {
458
- if (entry === null) {
459
- return null;
460
- }
461
- return de_Shard(entry, context);
462
- });
463
- return retVal;
464
- };
465
- const de__Stream = (output, context) => {
466
- return {
467
- StreamArn: __expectString(output.StreamArn),
468
- StreamLabel: __expectString(output.StreamLabel),
469
- TableName: __expectString(output.TableName),
470
- };
471
- };
472
335
  const de_StreamDescription = (output, context) => {
473
- return {
474
- CreationRequestDateTime: output.CreationRequestDateTime != null
475
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationRequestDateTime)))
476
- : undefined,
477
- KeySchema: output.KeySchema != null ? de_KeySchema(output.KeySchema, context) : undefined,
478
- LastEvaluatedShardId: __expectString(output.LastEvaluatedShardId),
479
- Shards: output.Shards != null ? de_ShardDescriptionList(output.Shards, context) : undefined,
480
- StreamArn: __expectString(output.StreamArn),
481
- StreamLabel: __expectString(output.StreamLabel),
482
- StreamStatus: __expectString(output.StreamStatus),
483
- StreamViewType: __expectString(output.StreamViewType),
484
- TableName: __expectString(output.TableName),
485
- };
486
- };
487
- const de_StreamList = (output, context) => {
488
- const retVal = (output || [])
489
- .filter((e) => e != null)
490
- .map((entry) => {
491
- if (entry === null) {
492
- return null;
493
- }
494
- return de__Stream(entry, context);
336
+ return take(output, {
337
+ CreationRequestDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
338
+ KeySchema: _json,
339
+ LastEvaluatedShardId: __expectString,
340
+ Shards: _json,
341
+ StreamArn: __expectString,
342
+ StreamLabel: __expectString,
343
+ StreamStatus: __expectString,
344
+ StreamViewType: __expectString,
345
+ TableName: __expectString,
495
346
  });
496
- return retVal;
497
347
  };
498
348
  const de_StreamRecord = (output, context) => {
499
- return {
500
- ApproximateCreationDateTime: output.ApproximateCreationDateTime != null
501
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ApproximateCreationDateTime)))
502
- : undefined,
503
- Keys: output.Keys != null ? de_AttributeMap(output.Keys, context) : undefined,
504
- NewImage: output.NewImage != null ? de_AttributeMap(output.NewImage, context) : undefined,
505
- OldImage: output.OldImage != null ? de_AttributeMap(output.OldImage, context) : undefined,
506
- SequenceNumber: __expectString(output.SequenceNumber),
507
- SizeBytes: __expectLong(output.SizeBytes),
508
- StreamViewType: __expectString(output.StreamViewType),
509
- };
510
- };
511
- const de_StringSetAttributeValue = (output, context) => {
512
- const retVal = (output || [])
513
- .filter((e) => e != null)
514
- .map((entry) => {
515
- if (entry === null) {
516
- return null;
517
- }
518
- return __expectString(entry);
349
+ return take(output, {
350
+ ApproximateCreationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
351
+ Keys: (_) => de_AttributeMap(_, context),
352
+ NewImage: (_) => de_AttributeMap(_, context),
353
+ OldImage: (_) => de_AttributeMap(_, context),
354
+ SequenceNumber: __expectString,
355
+ SizeBytes: __expectLong,
356
+ StreamViewType: __expectString,
519
357
  });
520
- return retVal;
521
- };
522
- const de_TrimmedDataAccessException = (output, context) => {
523
- return {
524
- message: __expectString(output.message),
525
- };
526
358
  };
527
359
  const deserializeMetadata = (output) => ({
528
360
  httpStatusCode: output.statusCode,
@@ -537,6 +369,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
537
369
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
538
370
  };
539
371
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
372
+ const throwDefaultError = withBaseException(__BaseException);
540
373
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
541
374
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
542
375
  const contents = {
@@ -4,72 +4,40 @@ import { GetRecordsCommandInput, GetRecordsCommandOutput } from "./commands/GetR
4
4
  import { GetShardIteratorCommandInput, GetShardIteratorCommandOutput } from "./commands/GetShardIteratorCommand";
5
5
  import { ListStreamsCommandInput, ListStreamsCommandOutput } from "./commands/ListStreamsCommand";
6
6
  import { DynamoDBStreamsClient } from "./DynamoDBStreamsClient";
7
- /**
8
- * @public
9
- * <fullname>Amazon DynamoDB</fullname>
10
- *
11
- * <p>Amazon DynamoDB Streams provides API actions for accessing streams and processing
12
- * stream records. To learn more about application development with Streams, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html">Capturing
13
- * Table Activity with DynamoDB Streams</a> in the Amazon DynamoDB Developer
14
- * Guide.</p>
15
- */
16
- export declare class DynamoDBStreams extends DynamoDBStreamsClient {
7
+ export interface DynamoDBStreams {
17
8
  /**
18
- * @public
19
- * <p>Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.</p>
20
- * <note>
21
- * <p>You can call <code>DescribeStream</code> at a maximum rate of 10 times per second.</p>
22
- * </note>
23
- * <p>Each shard in the stream has a <code>SequenceNumberRange</code> associated with it. If the
24
- * <code>SequenceNumberRange</code> has a <code>StartingSequenceNumber</code> but no
25
- * <code>EndingSequenceNumber</code>, then the shard is still open (able to receive more stream
26
- * records). If both <code>StartingSequenceNumber</code> and <code>EndingSequenceNumber</code>
27
- * are present, then that shard is closed and can no longer receive more data.</p>
9
+ * @see {@link DescribeStreamCommand}
28
10
  */
29
11
  describeStream(args: DescribeStreamCommandInput, options?: __HttpHandlerOptions): Promise<DescribeStreamCommandOutput>;
30
12
  describeStream(args: DescribeStreamCommandInput, cb: (err: any, data?: DescribeStreamCommandOutput) => void): void;
31
13
  describeStream(args: DescribeStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeStreamCommandOutput) => void): void;
32
14
  /**
33
- * @public
34
- * <p>Retrieves the stream records from a given shard.</p>
35
- * <p>Specify a shard iterator using the <code>ShardIterator</code> parameter. The shard iterator
36
- * specifies the position in the shard from which you want to start reading stream records
37
- * sequentially. If there are no stream records available in the portion of the shard that the
38
- * iterator points to, <code>GetRecords</code> returns an empty list. Note that it might take
39
- * multiple calls to get to a portion of the shard that contains stream records.</p>
40
- * <note>
41
- * <p>
42
- * <code>GetRecords</code> can retrieve a maximum of 1 MB of data or 1000 stream records,
43
- * whichever comes first.</p>
44
- * </note>
15
+ * @see {@link GetRecordsCommand}
45
16
  */
46
17
  getRecords(args: GetRecordsCommandInput, options?: __HttpHandlerOptions): Promise<GetRecordsCommandOutput>;
47
18
  getRecords(args: GetRecordsCommandInput, cb: (err: any, data?: GetRecordsCommandOutput) => void): void;
48
19
  getRecords(args: GetRecordsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetRecordsCommandOutput) => void): void;
49
20
  /**
50
- * @public
51
- * <p>Returns a shard iterator. A shard iterator provides information
52
- * about how to retrieve the stream records from within a shard. Use
53
- * the shard iterator in a subsequent
54
- * <code>GetRecords</code> request to read the stream records
55
- * from the shard.</p>
56
- * <note>
57
- * <p>A shard iterator expires 15 minutes after it is returned to the requester.</p>
58
- * </note>
21
+ * @see {@link GetShardIteratorCommand}
59
22
  */
60
23
  getShardIterator(args: GetShardIteratorCommandInput, options?: __HttpHandlerOptions): Promise<GetShardIteratorCommandOutput>;
61
24
  getShardIterator(args: GetShardIteratorCommandInput, cb: (err: any, data?: GetShardIteratorCommandOutput) => void): void;
62
25
  getShardIterator(args: GetShardIteratorCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetShardIteratorCommandOutput) => void): void;
63
26
  /**
64
- * @public
65
- * <p>Returns an array of stream ARNs associated with the current account and endpoint. If the
66
- * <code>TableName</code> parameter is present, then <code>ListStreams</code> will return only the
67
- * streams ARNs for that table.</p>
68
- * <note>
69
- * <p>You can call <code>ListStreams</code> at a maximum rate of 5 times per second.</p>
70
- * </note>
27
+ * @see {@link ListStreamsCommand}
71
28
  */
72
29
  listStreams(args: ListStreamsCommandInput, options?: __HttpHandlerOptions): Promise<ListStreamsCommandOutput>;
73
30
  listStreams(args: ListStreamsCommandInput, cb: (err: any, data?: ListStreamsCommandOutput) => void): void;
74
31
  listStreams(args: ListStreamsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListStreamsCommandOutput) => void): void;
75
32
  }
33
+ /**
34
+ * @public
35
+ * <fullname>Amazon DynamoDB</fullname>
36
+ *
37
+ * <p>Amazon DynamoDB Streams provides API actions for accessing streams and processing
38
+ * stream records. To learn more about application development with Streams, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html">Capturing
39
+ * Table Activity with DynamoDB Streams</a> in the Amazon DynamoDB Developer
40
+ * Guide.</p>
41
+ */
42
+ export declare class DynamoDBStreams extends DynamoDBStreamsClient implements DynamoDBStreams {
43
+ }
@@ -16,7 +16,7 @@ import {
16
16
  ListStreamsCommandOutput,
17
17
  } from "./commands/ListStreamsCommand";
18
18
  import { DynamoDBStreamsClient } from "./DynamoDBStreamsClient";
19
- export declare class DynamoDBStreams extends DynamoDBStreamsClient {
19
+ export interface DynamoDBStreams {
20
20
  describeStream(
21
21
  args: DescribeStreamCommandInput,
22
22
  options?: __HttpHandlerOptions
@@ -70,3 +70,6 @@ export declare class DynamoDBStreams extends DynamoDBStreamsClient {
70
70
  cb: (err: any, data?: ListStreamsCommandOutput) => void
71
71
  ): void;
72
72
  }
73
+ export declare class DynamoDBStreams
74
+ extends DynamoDBStreamsClient
75
+ implements DynamoDBStreams {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-dynamodb-streams",
3
3
  "description": "AWS SDK for JavaScript Dynamodb Streams Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.316.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.316.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.316.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.316.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.316.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.316.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",