@aws-sdk/client-dynamodb-streams 3.310.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.
- package/dist-cjs/protocols/Aws_json1_0.js +65 -238
- package/dist-es/protocols/Aws_json1_0.js +66 -239
- package/package.json +6 -6
|
@@ -6,42 +6,30 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
|
6
6
|
const DynamoDBStreamsServiceException_1 = require("../models/DynamoDBStreamsServiceException");
|
|
7
7
|
const models_0_1 = require("../models/models_0");
|
|
8
8
|
const se_DescribeStreamCommand = async (input, context) => {
|
|
9
|
-
const headers =
|
|
10
|
-
"content-type": "application/x-amz-json-1.0",
|
|
11
|
-
"x-amz-target": "DynamoDBStreams_20120810.DescribeStream",
|
|
12
|
-
};
|
|
9
|
+
const headers = sharedHeaders("DescribeStream");
|
|
13
10
|
let body;
|
|
14
|
-
body = JSON.stringify(
|
|
11
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
15
12
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
16
13
|
};
|
|
17
14
|
exports.se_DescribeStreamCommand = se_DescribeStreamCommand;
|
|
18
15
|
const se_GetRecordsCommand = async (input, context) => {
|
|
19
|
-
const headers =
|
|
20
|
-
"content-type": "application/x-amz-json-1.0",
|
|
21
|
-
"x-amz-target": "DynamoDBStreams_20120810.GetRecords",
|
|
22
|
-
};
|
|
16
|
+
const headers = sharedHeaders("GetRecords");
|
|
23
17
|
let body;
|
|
24
|
-
body = JSON.stringify(
|
|
18
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
25
19
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
26
20
|
};
|
|
27
21
|
exports.se_GetRecordsCommand = se_GetRecordsCommand;
|
|
28
22
|
const se_GetShardIteratorCommand = async (input, context) => {
|
|
29
|
-
const headers =
|
|
30
|
-
"content-type": "application/x-amz-json-1.0",
|
|
31
|
-
"x-amz-target": "DynamoDBStreams_20120810.GetShardIterator",
|
|
32
|
-
};
|
|
23
|
+
const headers = sharedHeaders("GetShardIterator");
|
|
33
24
|
let body;
|
|
34
|
-
body = JSON.stringify(
|
|
25
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
35
26
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
36
27
|
};
|
|
37
28
|
exports.se_GetShardIteratorCommand = se_GetShardIteratorCommand;
|
|
38
29
|
const se_ListStreamsCommand = async (input, context) => {
|
|
39
|
-
const headers =
|
|
40
|
-
"content-type": "application/x-amz-json-1.0",
|
|
41
|
-
"x-amz-target": "DynamoDBStreams_20120810.ListStreams",
|
|
42
|
-
};
|
|
30
|
+
const headers = sharedHeaders("ListStreams");
|
|
43
31
|
let body;
|
|
44
|
-
body = JSON.stringify(
|
|
32
|
+
body = JSON.stringify((0, smithy_client_1._json)(input));
|
|
45
33
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
46
34
|
};
|
|
47
35
|
exports.se_ListStreamsCommand = se_ListStreamsCommand;
|
|
@@ -56,7 +44,7 @@ const de_DescribeStreamCommand = async (output, context) => {
|
|
|
56
44
|
$metadata: deserializeMetadata(output),
|
|
57
45
|
...contents,
|
|
58
46
|
};
|
|
59
|
-
return
|
|
47
|
+
return response;
|
|
60
48
|
};
|
|
61
49
|
exports.de_DescribeStreamCommand = de_DescribeStreamCommand;
|
|
62
50
|
const de_DescribeStreamCommandError = async (output, context) => {
|
|
@@ -74,10 +62,9 @@ const de_DescribeStreamCommandError = async (output, context) => {
|
|
|
74
62
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
75
63
|
default:
|
|
76
64
|
const parsedBody = parsedOutput.body;
|
|
77
|
-
|
|
65
|
+
return throwDefaultError({
|
|
78
66
|
output,
|
|
79
67
|
parsedBody,
|
|
80
|
-
exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
|
|
81
68
|
errorCode,
|
|
82
69
|
});
|
|
83
70
|
}
|
|
@@ -93,7 +80,7 @@ const de_GetRecordsCommand = async (output, context) => {
|
|
|
93
80
|
$metadata: deserializeMetadata(output),
|
|
94
81
|
...contents,
|
|
95
82
|
};
|
|
96
|
-
return
|
|
83
|
+
return response;
|
|
97
84
|
};
|
|
98
85
|
exports.de_GetRecordsCommand = de_GetRecordsCommand;
|
|
99
86
|
const de_GetRecordsCommandError = async (output, context) => {
|
|
@@ -120,10 +107,9 @@ const de_GetRecordsCommandError = async (output, context) => {
|
|
|
120
107
|
throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
|
|
121
108
|
default:
|
|
122
109
|
const parsedBody = parsedOutput.body;
|
|
123
|
-
|
|
110
|
+
return throwDefaultError({
|
|
124
111
|
output,
|
|
125
112
|
parsedBody,
|
|
126
|
-
exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
|
|
127
113
|
errorCode,
|
|
128
114
|
});
|
|
129
115
|
}
|
|
@@ -134,12 +120,12 @@ const de_GetShardIteratorCommand = async (output, context) => {
|
|
|
134
120
|
}
|
|
135
121
|
const data = await parseBody(output.body, context);
|
|
136
122
|
let contents = {};
|
|
137
|
-
contents =
|
|
123
|
+
contents = (0, smithy_client_1._json)(data);
|
|
138
124
|
const response = {
|
|
139
125
|
$metadata: deserializeMetadata(output),
|
|
140
126
|
...contents,
|
|
141
127
|
};
|
|
142
|
-
return
|
|
128
|
+
return response;
|
|
143
129
|
};
|
|
144
130
|
exports.de_GetShardIteratorCommand = de_GetShardIteratorCommand;
|
|
145
131
|
const de_GetShardIteratorCommandError = async (output, context) => {
|
|
@@ -160,10 +146,9 @@ const de_GetShardIteratorCommandError = async (output, context) => {
|
|
|
160
146
|
throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
|
|
161
147
|
default:
|
|
162
148
|
const parsedBody = parsedOutput.body;
|
|
163
|
-
|
|
149
|
+
return throwDefaultError({
|
|
164
150
|
output,
|
|
165
151
|
parsedBody,
|
|
166
|
-
exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
|
|
167
152
|
errorCode,
|
|
168
153
|
});
|
|
169
154
|
}
|
|
@@ -174,12 +159,12 @@ const de_ListStreamsCommand = async (output, context) => {
|
|
|
174
159
|
}
|
|
175
160
|
const data = await parseBody(output.body, context);
|
|
176
161
|
let contents = {};
|
|
177
|
-
contents =
|
|
162
|
+
contents = (0, smithy_client_1._json)(data);
|
|
178
163
|
const response = {
|
|
179
164
|
$metadata: deserializeMetadata(output),
|
|
180
165
|
...contents,
|
|
181
166
|
};
|
|
182
|
-
return
|
|
167
|
+
return response;
|
|
183
168
|
};
|
|
184
169
|
exports.de_ListStreamsCommand = de_ListStreamsCommand;
|
|
185
170
|
const de_ListStreamsCommandError = async (output, context) => {
|
|
@@ -197,17 +182,16 @@ const de_ListStreamsCommandError = async (output, context) => {
|
|
|
197
182
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
198
183
|
default:
|
|
199
184
|
const parsedBody = parsedOutput.body;
|
|
200
|
-
|
|
185
|
+
return throwDefaultError({
|
|
201
186
|
output,
|
|
202
187
|
parsedBody,
|
|
203
|
-
exceptionCtor: DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException,
|
|
204
188
|
errorCode,
|
|
205
189
|
});
|
|
206
190
|
}
|
|
207
191
|
};
|
|
208
192
|
const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
|
|
209
193
|
const body = parsedOutput.body;
|
|
210
|
-
const deserialized =
|
|
194
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
211
195
|
const exception = new models_0_1.ExpiredIteratorException({
|
|
212
196
|
$metadata: deserializeMetadata(parsedOutput),
|
|
213
197
|
...deserialized,
|
|
@@ -216,7 +200,7 @@ const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
|
|
|
216
200
|
};
|
|
217
201
|
const de_InternalServerErrorRes = async (parsedOutput, context) => {
|
|
218
202
|
const body = parsedOutput.body;
|
|
219
|
-
const deserialized =
|
|
203
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
220
204
|
const exception = new models_0_1.InternalServerError({
|
|
221
205
|
$metadata: deserializeMetadata(parsedOutput),
|
|
222
206
|
...deserialized,
|
|
@@ -225,7 +209,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
|
|
|
225
209
|
};
|
|
226
210
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
227
211
|
const body = parsedOutput.body;
|
|
228
|
-
const deserialized =
|
|
212
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
229
213
|
const exception = new models_0_1.LimitExceededException({
|
|
230
214
|
$metadata: deserializeMetadata(parsedOutput),
|
|
231
215
|
...deserialized,
|
|
@@ -234,7 +218,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
|
234
218
|
};
|
|
235
219
|
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
236
220
|
const body = parsedOutput.body;
|
|
237
|
-
const deserialized =
|
|
221
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
238
222
|
const exception = new models_0_1.ResourceNotFoundException({
|
|
239
223
|
$metadata: deserializeMetadata(parsedOutput),
|
|
240
224
|
...deserialized,
|
|
@@ -243,41 +227,13 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
243
227
|
};
|
|
244
228
|
const de_TrimmedDataAccessExceptionRes = async (parsedOutput, context) => {
|
|
245
229
|
const body = parsedOutput.body;
|
|
246
|
-
const deserialized =
|
|
230
|
+
const deserialized = (0, smithy_client_1._json)(body);
|
|
247
231
|
const exception = new models_0_1.TrimmedDataAccessException({
|
|
248
232
|
$metadata: deserializeMetadata(parsedOutput),
|
|
249
233
|
...deserialized,
|
|
250
234
|
});
|
|
251
235
|
return (0, smithy_client_1.decorateServiceException)(exception, body);
|
|
252
236
|
};
|
|
253
|
-
const se_DescribeStreamInput = (input, context) => {
|
|
254
|
-
return {
|
|
255
|
-
...(input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId }),
|
|
256
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
257
|
-
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
const se_GetRecordsInput = (input, context) => {
|
|
261
|
-
return {
|
|
262
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
263
|
-
...(input.ShardIterator != null && { ShardIterator: input.ShardIterator }),
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
const se_GetShardIteratorInput = (input, context) => {
|
|
267
|
-
return {
|
|
268
|
-
...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
|
|
269
|
-
...(input.ShardId != null && { ShardId: input.ShardId }),
|
|
270
|
-
...(input.ShardIteratorType != null && { ShardIteratorType: input.ShardIteratorType }),
|
|
271
|
-
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
const se_ListStreamsInput = (input, context) => {
|
|
275
|
-
return {
|
|
276
|
-
...(input.ExclusiveStartStreamArn != null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }),
|
|
277
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
278
|
-
...(input.TableName != null && { TableName: input.TableName }),
|
|
279
|
-
};
|
|
280
|
-
};
|
|
281
237
|
const de_AttributeMap = (output, context) => {
|
|
282
238
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
283
239
|
if (value === null) {
|
|
@@ -316,7 +272,7 @@ const de_AttributeValue = (output, context) => {
|
|
|
316
272
|
}
|
|
317
273
|
if (output.NS != null) {
|
|
318
274
|
return {
|
|
319
|
-
NS:
|
|
275
|
+
NS: (0, smithy_client_1._json)(output.NS),
|
|
320
276
|
};
|
|
321
277
|
}
|
|
322
278
|
if ((0, smithy_client_1.expectBoolean)(output.NULL) !== undefined) {
|
|
@@ -327,7 +283,7 @@ const de_AttributeValue = (output, context) => {
|
|
|
327
283
|
}
|
|
328
284
|
if (output.SS != null) {
|
|
329
285
|
return {
|
|
330
|
-
SS:
|
|
286
|
+
SS: (0, smithy_client_1._json)(output.SS),
|
|
331
287
|
};
|
|
332
288
|
}
|
|
333
289
|
return { $unknown: Object.entries(output)[0] };
|
|
@@ -336,84 +292,29 @@ const de_BinarySetAttributeValue = (output, context) => {
|
|
|
336
292
|
const retVal = (output || [])
|
|
337
293
|
.filter((e) => e != null)
|
|
338
294
|
.map((entry) => {
|
|
339
|
-
if (entry === null) {
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
295
|
return context.base64Decoder(entry);
|
|
343
296
|
});
|
|
344
297
|
return retVal;
|
|
345
298
|
};
|
|
346
299
|
const de_DescribeStreamOutput = (output, context) => {
|
|
347
|
-
return {
|
|
348
|
-
StreamDescription:
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
const de_ExpiredIteratorException = (output, context) => {
|
|
352
|
-
return {
|
|
353
|
-
message: (0, smithy_client_1.expectString)(output.message),
|
|
354
|
-
};
|
|
300
|
+
return (0, smithy_client_1.take)(output, {
|
|
301
|
+
StreamDescription: (_) => de_StreamDescription(_, context),
|
|
302
|
+
});
|
|
355
303
|
};
|
|
356
304
|
const de_GetRecordsOutput = (output, context) => {
|
|
357
|
-
return {
|
|
358
|
-
NextShardIterator:
|
|
359
|
-
Records:
|
|
360
|
-
};
|
|
361
|
-
};
|
|
362
|
-
const de_GetShardIteratorOutput = (output, context) => {
|
|
363
|
-
return {
|
|
364
|
-
ShardIterator: (0, smithy_client_1.expectString)(output.ShardIterator),
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
const de_Identity = (output, context) => {
|
|
368
|
-
return {
|
|
369
|
-
PrincipalId: (0, smithy_client_1.expectString)(output.PrincipalId),
|
|
370
|
-
Type: (0, smithy_client_1.expectString)(output.Type),
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
const de_InternalServerError = (output, context) => {
|
|
374
|
-
return {
|
|
375
|
-
message: (0, smithy_client_1.expectString)(output.message),
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
const de_KeySchema = (output, context) => {
|
|
379
|
-
const retVal = (output || [])
|
|
380
|
-
.filter((e) => e != null)
|
|
381
|
-
.map((entry) => {
|
|
382
|
-
if (entry === null) {
|
|
383
|
-
return null;
|
|
384
|
-
}
|
|
385
|
-
return de_KeySchemaElement(entry, context);
|
|
305
|
+
return (0, smithy_client_1.take)(output, {
|
|
306
|
+
NextShardIterator: smithy_client_1.expectString,
|
|
307
|
+
Records: (_) => de_RecordList(_, context),
|
|
386
308
|
});
|
|
387
|
-
return retVal;
|
|
388
|
-
};
|
|
389
|
-
const de_KeySchemaElement = (output, context) => {
|
|
390
|
-
return {
|
|
391
|
-
AttributeName: (0, smithy_client_1.expectString)(output.AttributeName),
|
|
392
|
-
KeyType: (0, smithy_client_1.expectString)(output.KeyType),
|
|
393
|
-
};
|
|
394
|
-
};
|
|
395
|
-
const de_LimitExceededException = (output, context) => {
|
|
396
|
-
return {
|
|
397
|
-
message: (0, smithy_client_1.expectString)(output.message),
|
|
398
|
-
};
|
|
399
309
|
};
|
|
400
310
|
const de_ListAttributeValue = (output, context) => {
|
|
401
311
|
const retVal = (output || [])
|
|
402
312
|
.filter((e) => e != null)
|
|
403
313
|
.map((entry) => {
|
|
404
|
-
if (entry === null) {
|
|
405
|
-
return null;
|
|
406
|
-
}
|
|
407
314
|
return de_AttributeValue((0, smithy_client_1.expectUnion)(entry), context);
|
|
408
315
|
});
|
|
409
316
|
return retVal;
|
|
410
317
|
};
|
|
411
|
-
const de_ListStreamsOutput = (output, context) => {
|
|
412
|
-
return {
|
|
413
|
-
LastEvaluatedStreamArn: (0, smithy_client_1.expectString)(output.LastEvaluatedStreamArn),
|
|
414
|
-
Streams: output.Streams != null ? de_StreamList(output.Streams, context) : undefined,
|
|
415
|
-
};
|
|
416
|
-
};
|
|
417
318
|
const de_MapAttributeValue = (output, context) => {
|
|
418
319
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
419
320
|
if (value === null) {
|
|
@@ -423,129 +324,48 @@ const de_MapAttributeValue = (output, context) => {
|
|
|
423
324
|
return acc;
|
|
424
325
|
}, {});
|
|
425
326
|
};
|
|
426
|
-
const de_NumberSetAttributeValue = (output, context) => {
|
|
427
|
-
const retVal = (output || [])
|
|
428
|
-
.filter((e) => e != null)
|
|
429
|
-
.map((entry) => {
|
|
430
|
-
if (entry === null) {
|
|
431
|
-
return null;
|
|
432
|
-
}
|
|
433
|
-
return (0, smithy_client_1.expectString)(entry);
|
|
434
|
-
});
|
|
435
|
-
return retVal;
|
|
436
|
-
};
|
|
437
327
|
const de__Record = (output, context) => {
|
|
438
|
-
return {
|
|
439
|
-
awsRegion:
|
|
440
|
-
dynamodb:
|
|
441
|
-
eventID:
|
|
442
|
-
eventName:
|
|
443
|
-
eventSource:
|
|
444
|
-
eventVersion:
|
|
445
|
-
userIdentity:
|
|
446
|
-
};
|
|
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
|
+
});
|
|
447
337
|
};
|
|
448
338
|
const de_RecordList = (output, context) => {
|
|
449
339
|
const retVal = (output || [])
|
|
450
340
|
.filter((e) => e != null)
|
|
451
341
|
.map((entry) => {
|
|
452
|
-
if (entry === null) {
|
|
453
|
-
return null;
|
|
454
|
-
}
|
|
455
342
|
return de__Record(entry, context);
|
|
456
343
|
});
|
|
457
344
|
return retVal;
|
|
458
345
|
};
|
|
459
|
-
const de_ResourceNotFoundException = (output, context) => {
|
|
460
|
-
return {
|
|
461
|
-
message: (0, smithy_client_1.expectString)(output.message),
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
const de_SequenceNumberRange = (output, context) => {
|
|
465
|
-
return {
|
|
466
|
-
EndingSequenceNumber: (0, smithy_client_1.expectString)(output.EndingSequenceNumber),
|
|
467
|
-
StartingSequenceNumber: (0, smithy_client_1.expectString)(output.StartingSequenceNumber),
|
|
468
|
-
};
|
|
469
|
-
};
|
|
470
|
-
const de_Shard = (output, context) => {
|
|
471
|
-
return {
|
|
472
|
-
ParentShardId: (0, smithy_client_1.expectString)(output.ParentShardId),
|
|
473
|
-
SequenceNumberRange: output.SequenceNumberRange != null ? de_SequenceNumberRange(output.SequenceNumberRange, context) : undefined,
|
|
474
|
-
ShardId: (0, smithy_client_1.expectString)(output.ShardId),
|
|
475
|
-
};
|
|
476
|
-
};
|
|
477
|
-
const de_ShardDescriptionList = (output, context) => {
|
|
478
|
-
const retVal = (output || [])
|
|
479
|
-
.filter((e) => e != null)
|
|
480
|
-
.map((entry) => {
|
|
481
|
-
if (entry === null) {
|
|
482
|
-
return null;
|
|
483
|
-
}
|
|
484
|
-
return de_Shard(entry, context);
|
|
485
|
-
});
|
|
486
|
-
return retVal;
|
|
487
|
-
};
|
|
488
|
-
const de__Stream = (output, context) => {
|
|
489
|
-
return {
|
|
490
|
-
StreamArn: (0, smithy_client_1.expectString)(output.StreamArn),
|
|
491
|
-
StreamLabel: (0, smithy_client_1.expectString)(output.StreamLabel),
|
|
492
|
-
TableName: (0, smithy_client_1.expectString)(output.TableName),
|
|
493
|
-
};
|
|
494
|
-
};
|
|
495
346
|
const de_StreamDescription = (output, context) => {
|
|
496
|
-
return {
|
|
497
|
-
CreationRequestDateTime:
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
StreamViewType: (0, smithy_client_1.expectString)(output.StreamViewType),
|
|
507
|
-
TableName: (0, smithy_client_1.expectString)(output.TableName),
|
|
508
|
-
};
|
|
509
|
-
};
|
|
510
|
-
const de_StreamList = (output, context) => {
|
|
511
|
-
const retVal = (output || [])
|
|
512
|
-
.filter((e) => e != null)
|
|
513
|
-
.map((entry) => {
|
|
514
|
-
if (entry === null) {
|
|
515
|
-
return null;
|
|
516
|
-
}
|
|
517
|
-
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,
|
|
518
357
|
});
|
|
519
|
-
return retVal;
|
|
520
358
|
};
|
|
521
359
|
const de_StreamRecord = (output, context) => {
|
|
522
|
-
return {
|
|
523
|
-
ApproximateCreationDateTime:
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
SizeBytes: (0, smithy_client_1.expectLong)(output.SizeBytes),
|
|
531
|
-
StreamViewType: (0, smithy_client_1.expectString)(output.StreamViewType),
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
const de_StringSetAttributeValue = (output, context) => {
|
|
535
|
-
const retVal = (output || [])
|
|
536
|
-
.filter((e) => e != null)
|
|
537
|
-
.map((entry) => {
|
|
538
|
-
if (entry === null) {
|
|
539
|
-
return null;
|
|
540
|
-
}
|
|
541
|
-
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,
|
|
542
368
|
});
|
|
543
|
-
return retVal;
|
|
544
|
-
};
|
|
545
|
-
const de_TrimmedDataAccessException = (output, context) => {
|
|
546
|
-
return {
|
|
547
|
-
message: (0, smithy_client_1.expectString)(output.message),
|
|
548
|
-
};
|
|
549
369
|
};
|
|
550
370
|
const deserializeMetadata = (output) => ({
|
|
551
371
|
httpStatusCode: output.statusCode,
|
|
@@ -560,6 +380,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
560
380
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
561
381
|
};
|
|
562
382
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
383
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException);
|
|
563
384
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
564
385
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
565
386
|
const contents = {
|
|
@@ -578,6 +399,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
578
399
|
}
|
|
579
400
|
return new protocol_http_1.HttpRequest(contents);
|
|
580
401
|
};
|
|
402
|
+
function sharedHeaders(operation) {
|
|
403
|
+
return {
|
|
404
|
+
"content-type": "application/x-amz-json-1.0",
|
|
405
|
+
"x-amz-target": `DynamoDBStreams_20120810.${operation}`,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
581
408
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
582
409
|
if (encoded.length) {
|
|
583
410
|
return JSON.parse(encoded);
|
|
@@ -1,41 +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,
|
|
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
|
-
const headers =
|
|
7
|
-
"content-type": "application/x-amz-json-1.0",
|
|
8
|
-
"x-amz-target": "DynamoDBStreams_20120810.DescribeStream",
|
|
9
|
-
};
|
|
6
|
+
const headers = sharedHeaders("DescribeStream");
|
|
10
7
|
let body;
|
|
11
|
-
body = JSON.stringify(
|
|
8
|
+
body = JSON.stringify(_json(input));
|
|
12
9
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
10
|
};
|
|
14
11
|
export const se_GetRecordsCommand = async (input, context) => {
|
|
15
|
-
const headers =
|
|
16
|
-
"content-type": "application/x-amz-json-1.0",
|
|
17
|
-
"x-amz-target": "DynamoDBStreams_20120810.GetRecords",
|
|
18
|
-
};
|
|
12
|
+
const headers = sharedHeaders("GetRecords");
|
|
19
13
|
let body;
|
|
20
|
-
body = JSON.stringify(
|
|
14
|
+
body = JSON.stringify(_json(input));
|
|
21
15
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
16
|
};
|
|
23
17
|
export const se_GetShardIteratorCommand = async (input, context) => {
|
|
24
|
-
const headers =
|
|
25
|
-
"content-type": "application/x-amz-json-1.0",
|
|
26
|
-
"x-amz-target": "DynamoDBStreams_20120810.GetShardIterator",
|
|
27
|
-
};
|
|
18
|
+
const headers = sharedHeaders("GetShardIterator");
|
|
28
19
|
let body;
|
|
29
|
-
body = JSON.stringify(
|
|
20
|
+
body = JSON.stringify(_json(input));
|
|
30
21
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
31
22
|
};
|
|
32
23
|
export const se_ListStreamsCommand = async (input, context) => {
|
|
33
|
-
const headers =
|
|
34
|
-
"content-type": "application/x-amz-json-1.0",
|
|
35
|
-
"x-amz-target": "DynamoDBStreams_20120810.ListStreams",
|
|
36
|
-
};
|
|
24
|
+
const headers = sharedHeaders("ListStreams");
|
|
37
25
|
let body;
|
|
38
|
-
body = JSON.stringify(
|
|
26
|
+
body = JSON.stringify(_json(input));
|
|
39
27
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
40
28
|
};
|
|
41
29
|
export const de_DescribeStreamCommand = async (output, context) => {
|
|
@@ -49,7 +37,7 @@ export const de_DescribeStreamCommand = async (output, context) => {
|
|
|
49
37
|
$metadata: deserializeMetadata(output),
|
|
50
38
|
...contents,
|
|
51
39
|
};
|
|
52
|
-
return
|
|
40
|
+
return response;
|
|
53
41
|
};
|
|
54
42
|
const de_DescribeStreamCommandError = async (output, context) => {
|
|
55
43
|
const parsedOutput = {
|
|
@@ -66,10 +54,9 @@ const de_DescribeStreamCommandError = async (output, context) => {
|
|
|
66
54
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
67
55
|
default:
|
|
68
56
|
const parsedBody = parsedOutput.body;
|
|
69
|
-
throwDefaultError({
|
|
57
|
+
return throwDefaultError({
|
|
70
58
|
output,
|
|
71
59
|
parsedBody,
|
|
72
|
-
exceptionCtor: __BaseException,
|
|
73
60
|
errorCode,
|
|
74
61
|
});
|
|
75
62
|
}
|
|
@@ -85,7 +72,7 @@ export const de_GetRecordsCommand = async (output, context) => {
|
|
|
85
72
|
$metadata: deserializeMetadata(output),
|
|
86
73
|
...contents,
|
|
87
74
|
};
|
|
88
|
-
return
|
|
75
|
+
return response;
|
|
89
76
|
};
|
|
90
77
|
const de_GetRecordsCommandError = async (output, context) => {
|
|
91
78
|
const parsedOutput = {
|
|
@@ -111,10 +98,9 @@ const de_GetRecordsCommandError = async (output, context) => {
|
|
|
111
98
|
throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
|
|
112
99
|
default:
|
|
113
100
|
const parsedBody = parsedOutput.body;
|
|
114
|
-
throwDefaultError({
|
|
101
|
+
return throwDefaultError({
|
|
115
102
|
output,
|
|
116
103
|
parsedBody,
|
|
117
|
-
exceptionCtor: __BaseException,
|
|
118
104
|
errorCode,
|
|
119
105
|
});
|
|
120
106
|
}
|
|
@@ -125,12 +111,12 @@ export const de_GetShardIteratorCommand = async (output, context) => {
|
|
|
125
111
|
}
|
|
126
112
|
const data = await parseBody(output.body, context);
|
|
127
113
|
let contents = {};
|
|
128
|
-
contents =
|
|
114
|
+
contents = _json(data);
|
|
129
115
|
const response = {
|
|
130
116
|
$metadata: deserializeMetadata(output),
|
|
131
117
|
...contents,
|
|
132
118
|
};
|
|
133
|
-
return
|
|
119
|
+
return response;
|
|
134
120
|
};
|
|
135
121
|
const de_GetShardIteratorCommandError = async (output, context) => {
|
|
136
122
|
const parsedOutput = {
|
|
@@ -150,10 +136,9 @@ const de_GetShardIteratorCommandError = async (output, context) => {
|
|
|
150
136
|
throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
|
|
151
137
|
default:
|
|
152
138
|
const parsedBody = parsedOutput.body;
|
|
153
|
-
throwDefaultError({
|
|
139
|
+
return throwDefaultError({
|
|
154
140
|
output,
|
|
155
141
|
parsedBody,
|
|
156
|
-
exceptionCtor: __BaseException,
|
|
157
142
|
errorCode,
|
|
158
143
|
});
|
|
159
144
|
}
|
|
@@ -164,12 +149,12 @@ export const de_ListStreamsCommand = async (output, context) => {
|
|
|
164
149
|
}
|
|
165
150
|
const data = await parseBody(output.body, context);
|
|
166
151
|
let contents = {};
|
|
167
|
-
contents =
|
|
152
|
+
contents = _json(data);
|
|
168
153
|
const response = {
|
|
169
154
|
$metadata: deserializeMetadata(output),
|
|
170
155
|
...contents,
|
|
171
156
|
};
|
|
172
|
-
return
|
|
157
|
+
return response;
|
|
173
158
|
};
|
|
174
159
|
const de_ListStreamsCommandError = async (output, context) => {
|
|
175
160
|
const parsedOutput = {
|
|
@@ -186,17 +171,16 @@ const de_ListStreamsCommandError = async (output, context) => {
|
|
|
186
171
|
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
187
172
|
default:
|
|
188
173
|
const parsedBody = parsedOutput.body;
|
|
189
|
-
throwDefaultError({
|
|
174
|
+
return throwDefaultError({
|
|
190
175
|
output,
|
|
191
176
|
parsedBody,
|
|
192
|
-
exceptionCtor: __BaseException,
|
|
193
177
|
errorCode,
|
|
194
178
|
});
|
|
195
179
|
}
|
|
196
180
|
};
|
|
197
181
|
const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
|
|
198
182
|
const body = parsedOutput.body;
|
|
199
|
-
const deserialized =
|
|
183
|
+
const deserialized = _json(body);
|
|
200
184
|
const exception = new ExpiredIteratorException({
|
|
201
185
|
$metadata: deserializeMetadata(parsedOutput),
|
|
202
186
|
...deserialized,
|
|
@@ -205,7 +189,7 @@ const de_ExpiredIteratorExceptionRes = async (parsedOutput, context) => {
|
|
|
205
189
|
};
|
|
206
190
|
const de_InternalServerErrorRes = async (parsedOutput, context) => {
|
|
207
191
|
const body = parsedOutput.body;
|
|
208
|
-
const deserialized =
|
|
192
|
+
const deserialized = _json(body);
|
|
209
193
|
const exception = new InternalServerError({
|
|
210
194
|
$metadata: deserializeMetadata(parsedOutput),
|
|
211
195
|
...deserialized,
|
|
@@ -214,7 +198,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
|
|
|
214
198
|
};
|
|
215
199
|
const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
216
200
|
const body = parsedOutput.body;
|
|
217
|
-
const deserialized =
|
|
201
|
+
const deserialized = _json(body);
|
|
218
202
|
const exception = new LimitExceededException({
|
|
219
203
|
$metadata: deserializeMetadata(parsedOutput),
|
|
220
204
|
...deserialized,
|
|
@@ -223,7 +207,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
|
|
|
223
207
|
};
|
|
224
208
|
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
225
209
|
const body = parsedOutput.body;
|
|
226
|
-
const deserialized =
|
|
210
|
+
const deserialized = _json(body);
|
|
227
211
|
const exception = new ResourceNotFoundException({
|
|
228
212
|
$metadata: deserializeMetadata(parsedOutput),
|
|
229
213
|
...deserialized,
|
|
@@ -232,41 +216,13 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
232
216
|
};
|
|
233
217
|
const de_TrimmedDataAccessExceptionRes = async (parsedOutput, context) => {
|
|
234
218
|
const body = parsedOutput.body;
|
|
235
|
-
const deserialized =
|
|
219
|
+
const deserialized = _json(body);
|
|
236
220
|
const exception = new TrimmedDataAccessException({
|
|
237
221
|
$metadata: deserializeMetadata(parsedOutput),
|
|
238
222
|
...deserialized,
|
|
239
223
|
});
|
|
240
224
|
return __decorateServiceException(exception, body);
|
|
241
225
|
};
|
|
242
|
-
const se_DescribeStreamInput = (input, context) => {
|
|
243
|
-
return {
|
|
244
|
-
...(input.ExclusiveStartShardId != null && { ExclusiveStartShardId: input.ExclusiveStartShardId }),
|
|
245
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
246
|
-
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
const se_GetRecordsInput = (input, context) => {
|
|
250
|
-
return {
|
|
251
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
252
|
-
...(input.ShardIterator != null && { ShardIterator: input.ShardIterator }),
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
const se_GetShardIteratorInput = (input, context) => {
|
|
256
|
-
return {
|
|
257
|
-
...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
|
|
258
|
-
...(input.ShardId != null && { ShardId: input.ShardId }),
|
|
259
|
-
...(input.ShardIteratorType != null && { ShardIteratorType: input.ShardIteratorType }),
|
|
260
|
-
...(input.StreamArn != null && { StreamArn: input.StreamArn }),
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
const se_ListStreamsInput = (input, context) => {
|
|
264
|
-
return {
|
|
265
|
-
...(input.ExclusiveStartStreamArn != null && { ExclusiveStartStreamArn: input.ExclusiveStartStreamArn }),
|
|
266
|
-
...(input.Limit != null && { Limit: input.Limit }),
|
|
267
|
-
...(input.TableName != null && { TableName: input.TableName }),
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
226
|
const de_AttributeMap = (output, context) => {
|
|
271
227
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
272
228
|
if (value === null) {
|
|
@@ -305,7 +261,7 @@ const de_AttributeValue = (output, context) => {
|
|
|
305
261
|
}
|
|
306
262
|
if (output.NS != null) {
|
|
307
263
|
return {
|
|
308
|
-
NS:
|
|
264
|
+
NS: _json(output.NS),
|
|
309
265
|
};
|
|
310
266
|
}
|
|
311
267
|
if (__expectBoolean(output.NULL) !== undefined) {
|
|
@@ -316,7 +272,7 @@ const de_AttributeValue = (output, context) => {
|
|
|
316
272
|
}
|
|
317
273
|
if (output.SS != null) {
|
|
318
274
|
return {
|
|
319
|
-
SS:
|
|
275
|
+
SS: _json(output.SS),
|
|
320
276
|
};
|
|
321
277
|
}
|
|
322
278
|
return { $unknown: Object.entries(output)[0] };
|
|
@@ -325,84 +281,29 @@ const de_BinarySetAttributeValue = (output, context) => {
|
|
|
325
281
|
const retVal = (output || [])
|
|
326
282
|
.filter((e) => e != null)
|
|
327
283
|
.map((entry) => {
|
|
328
|
-
if (entry === null) {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
284
|
return context.base64Decoder(entry);
|
|
332
285
|
});
|
|
333
286
|
return retVal;
|
|
334
287
|
};
|
|
335
288
|
const de_DescribeStreamOutput = (output, context) => {
|
|
336
|
-
return {
|
|
337
|
-
StreamDescription:
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
const de_ExpiredIteratorException = (output, context) => {
|
|
341
|
-
return {
|
|
342
|
-
message: __expectString(output.message),
|
|
343
|
-
};
|
|
289
|
+
return take(output, {
|
|
290
|
+
StreamDescription: (_) => de_StreamDescription(_, context),
|
|
291
|
+
});
|
|
344
292
|
};
|
|
345
293
|
const de_GetRecordsOutput = (output, context) => {
|
|
346
|
-
return {
|
|
347
|
-
NextShardIterator: __expectString
|
|
348
|
-
Records:
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
const de_GetShardIteratorOutput = (output, context) => {
|
|
352
|
-
return {
|
|
353
|
-
ShardIterator: __expectString(output.ShardIterator),
|
|
354
|
-
};
|
|
355
|
-
};
|
|
356
|
-
const de_Identity = (output, context) => {
|
|
357
|
-
return {
|
|
358
|
-
PrincipalId: __expectString(output.PrincipalId),
|
|
359
|
-
Type: __expectString(output.Type),
|
|
360
|
-
};
|
|
361
|
-
};
|
|
362
|
-
const de_InternalServerError = (output, context) => {
|
|
363
|
-
return {
|
|
364
|
-
message: __expectString(output.message),
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
const de_KeySchema = (output, context) => {
|
|
368
|
-
const retVal = (output || [])
|
|
369
|
-
.filter((e) => e != null)
|
|
370
|
-
.map((entry) => {
|
|
371
|
-
if (entry === null) {
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
return de_KeySchemaElement(entry, context);
|
|
294
|
+
return take(output, {
|
|
295
|
+
NextShardIterator: __expectString,
|
|
296
|
+
Records: (_) => de_RecordList(_, context),
|
|
375
297
|
});
|
|
376
|
-
return retVal;
|
|
377
|
-
};
|
|
378
|
-
const de_KeySchemaElement = (output, context) => {
|
|
379
|
-
return {
|
|
380
|
-
AttributeName: __expectString(output.AttributeName),
|
|
381
|
-
KeyType: __expectString(output.KeyType),
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
const de_LimitExceededException = (output, context) => {
|
|
385
|
-
return {
|
|
386
|
-
message: __expectString(output.message),
|
|
387
|
-
};
|
|
388
298
|
};
|
|
389
299
|
const de_ListAttributeValue = (output, context) => {
|
|
390
300
|
const retVal = (output || [])
|
|
391
301
|
.filter((e) => e != null)
|
|
392
302
|
.map((entry) => {
|
|
393
|
-
if (entry === null) {
|
|
394
|
-
return null;
|
|
395
|
-
}
|
|
396
303
|
return de_AttributeValue(__expectUnion(entry), context);
|
|
397
304
|
});
|
|
398
305
|
return retVal;
|
|
399
306
|
};
|
|
400
|
-
const de_ListStreamsOutput = (output, context) => {
|
|
401
|
-
return {
|
|
402
|
-
LastEvaluatedStreamArn: __expectString(output.LastEvaluatedStreamArn),
|
|
403
|
-
Streams: output.Streams != null ? de_StreamList(output.Streams, context) : undefined,
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
307
|
const de_MapAttributeValue = (output, context) => {
|
|
407
308
|
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
408
309
|
if (value === null) {
|
|
@@ -412,129 +313,48 @@ const de_MapAttributeValue = (output, context) => {
|
|
|
412
313
|
return acc;
|
|
413
314
|
}, {});
|
|
414
315
|
};
|
|
415
|
-
const de_NumberSetAttributeValue = (output, context) => {
|
|
416
|
-
const retVal = (output || [])
|
|
417
|
-
.filter((e) => e != null)
|
|
418
|
-
.map((entry) => {
|
|
419
|
-
if (entry === null) {
|
|
420
|
-
return null;
|
|
421
|
-
}
|
|
422
|
-
return __expectString(entry);
|
|
423
|
-
});
|
|
424
|
-
return retVal;
|
|
425
|
-
};
|
|
426
316
|
const de__Record = (output, context) => {
|
|
427
|
-
return {
|
|
428
|
-
awsRegion: __expectString
|
|
429
|
-
dynamodb:
|
|
430
|
-
eventID: __expectString
|
|
431
|
-
eventName: __expectString
|
|
432
|
-
eventSource: __expectString
|
|
433
|
-
eventVersion: __expectString
|
|
434
|
-
userIdentity:
|
|
435
|
-
};
|
|
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
|
+
});
|
|
436
326
|
};
|
|
437
327
|
const de_RecordList = (output, context) => {
|
|
438
328
|
const retVal = (output || [])
|
|
439
329
|
.filter((e) => e != null)
|
|
440
330
|
.map((entry) => {
|
|
441
|
-
if (entry === null) {
|
|
442
|
-
return null;
|
|
443
|
-
}
|
|
444
331
|
return de__Record(entry, context);
|
|
445
332
|
});
|
|
446
333
|
return retVal;
|
|
447
334
|
};
|
|
448
|
-
const de_ResourceNotFoundException = (output, context) => {
|
|
449
|
-
return {
|
|
450
|
-
message: __expectString(output.message),
|
|
451
|
-
};
|
|
452
|
-
};
|
|
453
|
-
const de_SequenceNumberRange = (output, context) => {
|
|
454
|
-
return {
|
|
455
|
-
EndingSequenceNumber: __expectString(output.EndingSequenceNumber),
|
|
456
|
-
StartingSequenceNumber: __expectString(output.StartingSequenceNumber),
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
const de_Shard = (output, context) => {
|
|
460
|
-
return {
|
|
461
|
-
ParentShardId: __expectString(output.ParentShardId),
|
|
462
|
-
SequenceNumberRange: output.SequenceNumberRange != null ? de_SequenceNumberRange(output.SequenceNumberRange, context) : undefined,
|
|
463
|
-
ShardId: __expectString(output.ShardId),
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
const de_ShardDescriptionList = (output, context) => {
|
|
467
|
-
const retVal = (output || [])
|
|
468
|
-
.filter((e) => e != null)
|
|
469
|
-
.map((entry) => {
|
|
470
|
-
if (entry === null) {
|
|
471
|
-
return null;
|
|
472
|
-
}
|
|
473
|
-
return de_Shard(entry, context);
|
|
474
|
-
});
|
|
475
|
-
return retVal;
|
|
476
|
-
};
|
|
477
|
-
const de__Stream = (output, context) => {
|
|
478
|
-
return {
|
|
479
|
-
StreamArn: __expectString(output.StreamArn),
|
|
480
|
-
StreamLabel: __expectString(output.StreamLabel),
|
|
481
|
-
TableName: __expectString(output.TableName),
|
|
482
|
-
};
|
|
483
|
-
};
|
|
484
335
|
const de_StreamDescription = (output, context) => {
|
|
485
|
-
return {
|
|
486
|
-
CreationRequestDateTime:
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
StreamViewType: __expectString(output.StreamViewType),
|
|
496
|
-
TableName: __expectString(output.TableName),
|
|
497
|
-
};
|
|
498
|
-
};
|
|
499
|
-
const de_StreamList = (output, context) => {
|
|
500
|
-
const retVal = (output || [])
|
|
501
|
-
.filter((e) => e != null)
|
|
502
|
-
.map((entry) => {
|
|
503
|
-
if (entry === null) {
|
|
504
|
-
return null;
|
|
505
|
-
}
|
|
506
|
-
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,
|
|
507
346
|
});
|
|
508
|
-
return retVal;
|
|
509
347
|
};
|
|
510
348
|
const de_StreamRecord = (output, context) => {
|
|
511
|
-
return {
|
|
512
|
-
ApproximateCreationDateTime:
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
SizeBytes: __expectLong(output.SizeBytes),
|
|
520
|
-
StreamViewType: __expectString(output.StreamViewType),
|
|
521
|
-
};
|
|
522
|
-
};
|
|
523
|
-
const de_StringSetAttributeValue = (output, context) => {
|
|
524
|
-
const retVal = (output || [])
|
|
525
|
-
.filter((e) => e != null)
|
|
526
|
-
.map((entry) => {
|
|
527
|
-
if (entry === null) {
|
|
528
|
-
return null;
|
|
529
|
-
}
|
|
530
|
-
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,
|
|
531
357
|
});
|
|
532
|
-
return retVal;
|
|
533
|
-
};
|
|
534
|
-
const de_TrimmedDataAccessException = (output, context) => {
|
|
535
|
-
return {
|
|
536
|
-
message: __expectString(output.message),
|
|
537
|
-
};
|
|
538
358
|
};
|
|
539
359
|
const deserializeMetadata = (output) => ({
|
|
540
360
|
httpStatusCode: output.statusCode,
|
|
@@ -549,6 +369,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
549
369
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
550
370
|
};
|
|
551
371
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
372
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
552
373
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
553
374
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
554
375
|
const contents = {
|
|
@@ -567,6 +388,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
567
388
|
}
|
|
568
389
|
return new __HttpRequest(contents);
|
|
569
390
|
};
|
|
391
|
+
function sharedHeaders(operation) {
|
|
392
|
+
return {
|
|
393
|
+
"content-type": "application/x-amz-json-1.0",
|
|
394
|
+
"x-amz-target": `DynamoDBStreams_20120810.${operation}`,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
570
397
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
571
398
|
if (encoded.length) {
|
|
572
399
|
return JSON.parse(encoded);
|
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.
|
|
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.
|
|
24
|
+
"@aws-sdk/client-sts": "3.315.0",
|
|
25
25
|
"@aws-sdk/config-resolver": "3.310.0",
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
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.
|
|
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.
|
|
50
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
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",
|