@aws-sdk/client-dynamodb-streams 3.490.0 → 3.495.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/index.js CHANGED
@@ -1,11 +1,822 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DynamoDBStreamsServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./DynamoDBStreamsClient"), exports);
6
- tslib_1.__exportStar(require("./DynamoDBStreams"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./models"), exports);
9
- require("@aws-sdk/util-endpoints");
10
- var DynamoDBStreamsServiceException_1 = require("./models/DynamoDBStreamsServiceException");
11
- Object.defineProperty(exports, "DynamoDBStreamsServiceException", { enumerable: true, get: function () { return DynamoDBStreamsServiceException_1.DynamoDBStreamsServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ AttributeValue: () => AttributeValue,
25
+ DescribeStreamCommand: () => DescribeStreamCommand,
26
+ DynamoDBStreams: () => DynamoDBStreams,
27
+ DynamoDBStreamsClient: () => DynamoDBStreamsClient,
28
+ DynamoDBStreamsServiceException: () => DynamoDBStreamsServiceException,
29
+ ExpiredIteratorException: () => ExpiredIteratorException,
30
+ GetRecordsCommand: () => GetRecordsCommand,
31
+ GetShardIteratorCommand: () => GetShardIteratorCommand,
32
+ InternalServerError: () => InternalServerError,
33
+ KeyType: () => KeyType,
34
+ LimitExceededException: () => LimitExceededException,
35
+ ListStreamsCommand: () => ListStreamsCommand,
36
+ OperationType: () => OperationType,
37
+ ResourceNotFoundException: () => ResourceNotFoundException,
38
+ ShardIteratorType: () => ShardIteratorType,
39
+ StreamStatus: () => StreamStatus,
40
+ StreamViewType: () => StreamViewType,
41
+ TrimmedDataAccessException: () => TrimmedDataAccessException,
42
+ __Client: () => import_smithy_client.Client
43
+ });
44
+ module.exports = __toCommonJS(src_exports);
45
+
46
+ // src/DynamoDBStreamsClient.ts
47
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
48
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
49
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
50
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
51
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
52
+ var import_config_resolver = require("@smithy/config-resolver");
53
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
54
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
55
+ var import_middleware_retry = require("@smithy/middleware-retry");
56
+
57
+
58
+ // src/endpoint/EndpointParameters.ts
59
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
60
+ return {
61
+ ...options,
62
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
63
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
64
+ defaultSigningName: "dynamodb"
65
+ };
66
+ }, "resolveClientEndpointParameters");
67
+ var commonParams = {
68
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
69
+ Endpoint: { type: "builtInParams", name: "endpoint" },
70
+ Region: { type: "builtInParams", name: "region" },
71
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
72
+ };
73
+
74
+ // src/DynamoDBStreamsClient.ts
75
+ var import_runtimeConfig = require("././runtimeConfig");
76
+
77
+ // src/runtimeExtensions.ts
78
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
79
+ var import_protocol_http = require("@smithy/protocol-http");
80
+ var import_smithy_client = require("@smithy/smithy-client");
81
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
82
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
83
+ const extensionConfiguration = {
84
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
85
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
86
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
87
+ };
88
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
89
+ return {
90
+ ...runtimeConfig,
91
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
92
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
93
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
94
+ };
95
+ }, "resolveRuntimeExtensions");
96
+
97
+ // src/DynamoDBStreamsClient.ts
98
+ var _DynamoDBStreamsClient = class _DynamoDBStreamsClient extends import_smithy_client.Client {
99
+ constructor(...[configuration]) {
100
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
101
+ const _config_1 = resolveClientEndpointParameters(_config_0);
102
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
103
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
104
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
105
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
106
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
107
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
108
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
109
+ super(_config_8);
110
+ this.config = _config_8;
111
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
112
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
113
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
114
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
115
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
116
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
117
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
118
+ }
119
+ /**
120
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
121
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
122
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
123
+ */
124
+ destroy() {
125
+ super.destroy();
126
+ }
127
+ };
128
+ __name(_DynamoDBStreamsClient, "DynamoDBStreamsClient");
129
+ var DynamoDBStreamsClient = _DynamoDBStreamsClient;
130
+
131
+ // src/DynamoDBStreams.ts
132
+
133
+
134
+ // src/commands/DescribeStreamCommand.ts
135
+
136
+ var import_middleware_serde = require("@smithy/middleware-serde");
137
+
138
+ var import_types = require("@smithy/types");
139
+
140
+ // src/protocols/Aws_json1_0.ts
141
+ var import_core = require("@aws-sdk/core");
142
+
143
+
144
+
145
+ // src/models/DynamoDBStreamsServiceException.ts
146
+
147
+ var _DynamoDBStreamsServiceException = class _DynamoDBStreamsServiceException extends import_smithy_client.ServiceException {
148
+ /**
149
+ * @internal
150
+ */
151
+ constructor(options) {
152
+ super(options);
153
+ Object.setPrototypeOf(this, _DynamoDBStreamsServiceException.prototype);
154
+ }
155
+ };
156
+ __name(_DynamoDBStreamsServiceException, "DynamoDBStreamsServiceException");
157
+ var DynamoDBStreamsServiceException = _DynamoDBStreamsServiceException;
158
+
159
+ // src/models/models_0.ts
160
+ var KeyType = {
161
+ HASH: "HASH",
162
+ RANGE: "RANGE"
163
+ };
164
+ var StreamStatus = {
165
+ DISABLED: "DISABLED",
166
+ DISABLING: "DISABLING",
167
+ ENABLED: "ENABLED",
168
+ ENABLING: "ENABLING"
169
+ };
170
+ var StreamViewType = {
171
+ KEYS_ONLY: "KEYS_ONLY",
172
+ NEW_AND_OLD_IMAGES: "NEW_AND_OLD_IMAGES",
173
+ NEW_IMAGE: "NEW_IMAGE",
174
+ OLD_IMAGE: "OLD_IMAGE"
175
+ };
176
+ var _InternalServerError = class _InternalServerError extends DynamoDBStreamsServiceException {
177
+ /**
178
+ * @internal
179
+ */
180
+ constructor(opts) {
181
+ super({
182
+ name: "InternalServerError",
183
+ $fault: "server",
184
+ ...opts
185
+ });
186
+ this.name = "InternalServerError";
187
+ this.$fault = "server";
188
+ Object.setPrototypeOf(this, _InternalServerError.prototype);
189
+ }
190
+ };
191
+ __name(_InternalServerError, "InternalServerError");
192
+ var InternalServerError = _InternalServerError;
193
+ var _ResourceNotFoundException = class _ResourceNotFoundException extends DynamoDBStreamsServiceException {
194
+ /**
195
+ * @internal
196
+ */
197
+ constructor(opts) {
198
+ super({
199
+ name: "ResourceNotFoundException",
200
+ $fault: "client",
201
+ ...opts
202
+ });
203
+ this.name = "ResourceNotFoundException";
204
+ this.$fault = "client";
205
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
206
+ }
207
+ };
208
+ __name(_ResourceNotFoundException, "ResourceNotFoundException");
209
+ var ResourceNotFoundException = _ResourceNotFoundException;
210
+ var _ExpiredIteratorException = class _ExpiredIteratorException extends DynamoDBStreamsServiceException {
211
+ /**
212
+ * @internal
213
+ */
214
+ constructor(opts) {
215
+ super({
216
+ name: "ExpiredIteratorException",
217
+ $fault: "client",
218
+ ...opts
219
+ });
220
+ this.name = "ExpiredIteratorException";
221
+ this.$fault = "client";
222
+ Object.setPrototypeOf(this, _ExpiredIteratorException.prototype);
223
+ }
224
+ };
225
+ __name(_ExpiredIteratorException, "ExpiredIteratorException");
226
+ var ExpiredIteratorException = _ExpiredIteratorException;
227
+ var OperationType = {
228
+ INSERT: "INSERT",
229
+ MODIFY: "MODIFY",
230
+ REMOVE: "REMOVE"
231
+ };
232
+ var _LimitExceededException = class _LimitExceededException extends DynamoDBStreamsServiceException {
233
+ /**
234
+ * @internal
235
+ */
236
+ constructor(opts) {
237
+ super({
238
+ name: "LimitExceededException",
239
+ $fault: "client",
240
+ ...opts
241
+ });
242
+ this.name = "LimitExceededException";
243
+ this.$fault = "client";
244
+ Object.setPrototypeOf(this, _LimitExceededException.prototype);
245
+ }
246
+ };
247
+ __name(_LimitExceededException, "LimitExceededException");
248
+ var LimitExceededException = _LimitExceededException;
249
+ var _TrimmedDataAccessException = class _TrimmedDataAccessException extends DynamoDBStreamsServiceException {
250
+ /**
251
+ * @internal
252
+ */
253
+ constructor(opts) {
254
+ super({
255
+ name: "TrimmedDataAccessException",
256
+ $fault: "client",
257
+ ...opts
258
+ });
259
+ this.name = "TrimmedDataAccessException";
260
+ this.$fault = "client";
261
+ Object.setPrototypeOf(this, _TrimmedDataAccessException.prototype);
262
+ }
263
+ };
264
+ __name(_TrimmedDataAccessException, "TrimmedDataAccessException");
265
+ var TrimmedDataAccessException = _TrimmedDataAccessException;
266
+ var ShardIteratorType = {
267
+ AFTER_SEQUENCE_NUMBER: "AFTER_SEQUENCE_NUMBER",
268
+ AT_SEQUENCE_NUMBER: "AT_SEQUENCE_NUMBER",
269
+ LATEST: "LATEST",
270
+ TRIM_HORIZON: "TRIM_HORIZON"
271
+ };
272
+ var AttributeValue;
273
+ ((AttributeValue3) => {
274
+ AttributeValue3.visit = /* @__PURE__ */ __name((value, visitor) => {
275
+ if (value.S !== void 0)
276
+ return visitor.S(value.S);
277
+ if (value.N !== void 0)
278
+ return visitor.N(value.N);
279
+ if (value.B !== void 0)
280
+ return visitor.B(value.B);
281
+ if (value.SS !== void 0)
282
+ return visitor.SS(value.SS);
283
+ if (value.NS !== void 0)
284
+ return visitor.NS(value.NS);
285
+ if (value.BS !== void 0)
286
+ return visitor.BS(value.BS);
287
+ if (value.M !== void 0)
288
+ return visitor.M(value.M);
289
+ if (value.L !== void 0)
290
+ return visitor.L(value.L);
291
+ if (value.NULL !== void 0)
292
+ return visitor.NULL(value.NULL);
293
+ if (value.BOOL !== void 0)
294
+ return visitor.BOOL(value.BOOL);
295
+ return visitor._(value.$unknown[0], value.$unknown[1]);
296
+ }, "visit");
297
+ })(AttributeValue || (AttributeValue = {}));
298
+
299
+ // src/protocols/Aws_json1_0.ts
300
+ var se_DescribeStreamCommand = /* @__PURE__ */ __name(async (input, context) => {
301
+ const headers = sharedHeaders("DescribeStream");
302
+ let body;
303
+ body = JSON.stringify((0, import_smithy_client._json)(input));
304
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
305
+ }, "se_DescribeStreamCommand");
306
+ var se_GetRecordsCommand = /* @__PURE__ */ __name(async (input, context) => {
307
+ const headers = sharedHeaders("GetRecords");
308
+ let body;
309
+ body = JSON.stringify((0, import_smithy_client._json)(input));
310
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
311
+ }, "se_GetRecordsCommand");
312
+ var se_GetShardIteratorCommand = /* @__PURE__ */ __name(async (input, context) => {
313
+ const headers = sharedHeaders("GetShardIterator");
314
+ let body;
315
+ body = JSON.stringify((0, import_smithy_client._json)(input));
316
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
317
+ }, "se_GetShardIteratorCommand");
318
+ var se_ListStreamsCommand = /* @__PURE__ */ __name(async (input, context) => {
319
+ const headers = sharedHeaders("ListStreams");
320
+ let body;
321
+ body = JSON.stringify((0, import_smithy_client._json)(input));
322
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
323
+ }, "se_ListStreamsCommand");
324
+ var de_DescribeStreamCommand = /* @__PURE__ */ __name(async (output, context) => {
325
+ if (output.statusCode >= 300) {
326
+ return de_DescribeStreamCommandError(output, context);
327
+ }
328
+ const data = await parseBody(output.body, context);
329
+ let contents = {};
330
+ contents = de_DescribeStreamOutput(data, context);
331
+ const response = {
332
+ $metadata: deserializeMetadata(output),
333
+ ...contents
334
+ };
335
+ return response;
336
+ }, "de_DescribeStreamCommand");
337
+ var de_DescribeStreamCommandError = /* @__PURE__ */ __name(async (output, context) => {
338
+ const parsedOutput = {
339
+ ...output,
340
+ body: await parseErrorBody(output.body, context)
341
+ };
342
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
343
+ switch (errorCode) {
344
+ case "InternalServerError":
345
+ case "com.amazonaws.dynamodbstreams#InternalServerError":
346
+ throw await de_InternalServerErrorRes(parsedOutput, context);
347
+ case "ResourceNotFoundException":
348
+ case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
349
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
350
+ default:
351
+ const parsedBody = parsedOutput.body;
352
+ return throwDefaultError({
353
+ output,
354
+ parsedBody,
355
+ errorCode
356
+ });
357
+ }
358
+ }, "de_DescribeStreamCommandError");
359
+ var de_GetRecordsCommand = /* @__PURE__ */ __name(async (output, context) => {
360
+ if (output.statusCode >= 300) {
361
+ return de_GetRecordsCommandError(output, context);
362
+ }
363
+ const data = await parseBody(output.body, context);
364
+ let contents = {};
365
+ contents = de_GetRecordsOutput(data, context);
366
+ const response = {
367
+ $metadata: deserializeMetadata(output),
368
+ ...contents
369
+ };
370
+ return response;
371
+ }, "de_GetRecordsCommand");
372
+ var de_GetRecordsCommandError = /* @__PURE__ */ __name(async (output, context) => {
373
+ const parsedOutput = {
374
+ ...output,
375
+ body: await parseErrorBody(output.body, context)
376
+ };
377
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
378
+ switch (errorCode) {
379
+ case "ExpiredIteratorException":
380
+ case "com.amazonaws.dynamodbstreams#ExpiredIteratorException":
381
+ throw await de_ExpiredIteratorExceptionRes(parsedOutput, context);
382
+ case "InternalServerError":
383
+ case "com.amazonaws.dynamodbstreams#InternalServerError":
384
+ throw await de_InternalServerErrorRes(parsedOutput, context);
385
+ case "LimitExceededException":
386
+ case "com.amazonaws.dynamodbstreams#LimitExceededException":
387
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
388
+ case "ResourceNotFoundException":
389
+ case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
390
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
391
+ case "TrimmedDataAccessException":
392
+ case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
393
+ throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
394
+ default:
395
+ const parsedBody = parsedOutput.body;
396
+ return throwDefaultError({
397
+ output,
398
+ parsedBody,
399
+ errorCode
400
+ });
401
+ }
402
+ }, "de_GetRecordsCommandError");
403
+ var de_GetShardIteratorCommand = /* @__PURE__ */ __name(async (output, context) => {
404
+ if (output.statusCode >= 300) {
405
+ return de_GetShardIteratorCommandError(output, context);
406
+ }
407
+ const data = await parseBody(output.body, context);
408
+ let contents = {};
409
+ contents = (0, import_smithy_client._json)(data);
410
+ const response = {
411
+ $metadata: deserializeMetadata(output),
412
+ ...contents
413
+ };
414
+ return response;
415
+ }, "de_GetShardIteratorCommand");
416
+ var de_GetShardIteratorCommandError = /* @__PURE__ */ __name(async (output, context) => {
417
+ const parsedOutput = {
418
+ ...output,
419
+ body: await parseErrorBody(output.body, context)
420
+ };
421
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ switch (errorCode) {
423
+ case "InternalServerError":
424
+ case "com.amazonaws.dynamodbstreams#InternalServerError":
425
+ throw await de_InternalServerErrorRes(parsedOutput, context);
426
+ case "ResourceNotFoundException":
427
+ case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
428
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
429
+ case "TrimmedDataAccessException":
430
+ case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException":
431
+ throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context);
432
+ default:
433
+ const parsedBody = parsedOutput.body;
434
+ return throwDefaultError({
435
+ output,
436
+ parsedBody,
437
+ errorCode
438
+ });
439
+ }
440
+ }, "de_GetShardIteratorCommandError");
441
+ var de_ListStreamsCommand = /* @__PURE__ */ __name(async (output, context) => {
442
+ if (output.statusCode >= 300) {
443
+ return de_ListStreamsCommandError(output, context);
444
+ }
445
+ const data = await parseBody(output.body, context);
446
+ let contents = {};
447
+ contents = (0, import_smithy_client._json)(data);
448
+ const response = {
449
+ $metadata: deserializeMetadata(output),
450
+ ...contents
451
+ };
452
+ return response;
453
+ }, "de_ListStreamsCommand");
454
+ var de_ListStreamsCommandError = /* @__PURE__ */ __name(async (output, context) => {
455
+ const parsedOutput = {
456
+ ...output,
457
+ body: await parseErrorBody(output.body, context)
458
+ };
459
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
460
+ switch (errorCode) {
461
+ case "InternalServerError":
462
+ case "com.amazonaws.dynamodbstreams#InternalServerError":
463
+ throw await de_InternalServerErrorRes(parsedOutput, context);
464
+ case "ResourceNotFoundException":
465
+ case "com.amazonaws.dynamodbstreams#ResourceNotFoundException":
466
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
467
+ default:
468
+ const parsedBody = parsedOutput.body;
469
+ return throwDefaultError({
470
+ output,
471
+ parsedBody,
472
+ errorCode
473
+ });
474
+ }
475
+ }, "de_ListStreamsCommandError");
476
+ var de_ExpiredIteratorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
477
+ const body = parsedOutput.body;
478
+ const deserialized = (0, import_smithy_client._json)(body);
479
+ const exception = new ExpiredIteratorException({
480
+ $metadata: deserializeMetadata(parsedOutput),
481
+ ...deserialized
482
+ });
483
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
484
+ }, "de_ExpiredIteratorExceptionRes");
485
+ var de_InternalServerErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
486
+ const body = parsedOutput.body;
487
+ const deserialized = (0, import_smithy_client._json)(body);
488
+ const exception = new InternalServerError({
489
+ $metadata: deserializeMetadata(parsedOutput),
490
+ ...deserialized
491
+ });
492
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
493
+ }, "de_InternalServerErrorRes");
494
+ var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
495
+ const body = parsedOutput.body;
496
+ const deserialized = (0, import_smithy_client._json)(body);
497
+ const exception = new LimitExceededException({
498
+ $metadata: deserializeMetadata(parsedOutput),
499
+ ...deserialized
500
+ });
501
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
502
+ }, "de_LimitExceededExceptionRes");
503
+ var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
504
+ const body = parsedOutput.body;
505
+ const deserialized = (0, import_smithy_client._json)(body);
506
+ const exception = new ResourceNotFoundException({
507
+ $metadata: deserializeMetadata(parsedOutput),
508
+ ...deserialized
509
+ });
510
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
511
+ }, "de_ResourceNotFoundExceptionRes");
512
+ var de_TrimmedDataAccessExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
513
+ const body = parsedOutput.body;
514
+ const deserialized = (0, import_smithy_client._json)(body);
515
+ const exception = new TrimmedDataAccessException({
516
+ $metadata: deserializeMetadata(parsedOutput),
517
+ ...deserialized
518
+ });
519
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
520
+ }, "de_TrimmedDataAccessExceptionRes");
521
+ var de_AttributeMap = /* @__PURE__ */ __name((output, context) => {
522
+ return Object.entries(output).reduce((acc, [key, value]) => {
523
+ if (value === null) {
524
+ return acc;
525
+ }
526
+ acc[key] = de_AttributeValue((0, import_core.awsExpectUnion)(value), context);
527
+ return acc;
528
+ }, {});
529
+ }, "de_AttributeMap");
530
+ var de_AttributeValue = /* @__PURE__ */ __name((output, context) => {
531
+ if (output.B != null) {
532
+ return {
533
+ B: context.base64Decoder(output.B)
534
+ };
535
+ }
536
+ if ((0, import_smithy_client.expectBoolean)(output.BOOL) !== void 0) {
537
+ return { BOOL: (0, import_smithy_client.expectBoolean)(output.BOOL) };
538
+ }
539
+ if (output.BS != null) {
540
+ return {
541
+ BS: de_BinarySetAttributeValue(output.BS, context)
542
+ };
543
+ }
544
+ if (output.L != null) {
545
+ return {
546
+ L: de_ListAttributeValue(output.L, context)
547
+ };
548
+ }
549
+ if (output.M != null) {
550
+ return {
551
+ M: de_MapAttributeValue(output.M, context)
552
+ };
553
+ }
554
+ if ((0, import_smithy_client.expectString)(output.N) !== void 0) {
555
+ return { N: (0, import_smithy_client.expectString)(output.N) };
556
+ }
557
+ if (output.NS != null) {
558
+ return {
559
+ NS: (0, import_smithy_client._json)(output.NS)
560
+ };
561
+ }
562
+ if ((0, import_smithy_client.expectBoolean)(output.NULL) !== void 0) {
563
+ return { NULL: (0, import_smithy_client.expectBoolean)(output.NULL) };
564
+ }
565
+ if ((0, import_smithy_client.expectString)(output.S) !== void 0) {
566
+ return { S: (0, import_smithy_client.expectString)(output.S) };
567
+ }
568
+ if (output.SS != null) {
569
+ return {
570
+ SS: (0, import_smithy_client._json)(output.SS)
571
+ };
572
+ }
573
+ return { $unknown: Object.entries(output)[0] };
574
+ }, "de_AttributeValue");
575
+ var de_BinarySetAttributeValue = /* @__PURE__ */ __name((output, context) => {
576
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
577
+ return context.base64Decoder(entry);
578
+ });
579
+ return retVal;
580
+ }, "de_BinarySetAttributeValue");
581
+ var de_DescribeStreamOutput = /* @__PURE__ */ __name((output, context) => {
582
+ return (0, import_smithy_client.take)(output, {
583
+ StreamDescription: (_) => de_StreamDescription(_, context)
584
+ });
585
+ }, "de_DescribeStreamOutput");
586
+ var de_GetRecordsOutput = /* @__PURE__ */ __name((output, context) => {
587
+ return (0, import_smithy_client.take)(output, {
588
+ NextShardIterator: import_smithy_client.expectString,
589
+ Records: (_) => de_RecordList(_, context)
590
+ });
591
+ }, "de_GetRecordsOutput");
592
+ var de_ListAttributeValue = /* @__PURE__ */ __name((output, context) => {
593
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
594
+ return de_AttributeValue((0, import_core.awsExpectUnion)(entry), context);
595
+ });
596
+ return retVal;
597
+ }, "de_ListAttributeValue");
598
+ var de_MapAttributeValue = /* @__PURE__ */ __name((output, context) => {
599
+ return Object.entries(output).reduce((acc, [key, value]) => {
600
+ if (value === null) {
601
+ return acc;
602
+ }
603
+ acc[key] = de_AttributeValue((0, import_core.awsExpectUnion)(value), context);
604
+ return acc;
605
+ }, {});
606
+ }, "de_MapAttributeValue");
607
+ var de__Record = /* @__PURE__ */ __name((output, context) => {
608
+ return (0, import_smithy_client.take)(output, {
609
+ awsRegion: import_smithy_client.expectString,
610
+ dynamodb: (_) => de_StreamRecord(_, context),
611
+ eventID: import_smithy_client.expectString,
612
+ eventName: import_smithy_client.expectString,
613
+ eventSource: import_smithy_client.expectString,
614
+ eventVersion: import_smithy_client.expectString,
615
+ userIdentity: import_smithy_client._json
616
+ });
617
+ }, "de__Record");
618
+ var de_RecordList = /* @__PURE__ */ __name((output, context) => {
619
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
620
+ return de__Record(entry, context);
621
+ });
622
+ return retVal;
623
+ }, "de_RecordList");
624
+ var de_StreamDescription = /* @__PURE__ */ __name((output, context) => {
625
+ return (0, import_smithy_client.take)(output, {
626
+ CreationRequestDateTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
627
+ KeySchema: import_smithy_client._json,
628
+ LastEvaluatedShardId: import_smithy_client.expectString,
629
+ Shards: import_smithy_client._json,
630
+ StreamArn: import_smithy_client.expectString,
631
+ StreamLabel: import_smithy_client.expectString,
632
+ StreamStatus: import_smithy_client.expectString,
633
+ StreamViewType: import_smithy_client.expectString,
634
+ TableName: import_smithy_client.expectString
635
+ });
636
+ }, "de_StreamDescription");
637
+ var de_StreamRecord = /* @__PURE__ */ __name((output, context) => {
638
+ return (0, import_smithy_client.take)(output, {
639
+ ApproximateCreationDateTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
640
+ Keys: (_) => de_AttributeMap(_, context),
641
+ NewImage: (_) => de_AttributeMap(_, context),
642
+ OldImage: (_) => de_AttributeMap(_, context),
643
+ SequenceNumber: import_smithy_client.expectString,
644
+ SizeBytes: import_smithy_client.expectLong,
645
+ StreamViewType: import_smithy_client.expectString
646
+ });
647
+ }, "de_StreamRecord");
648
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
649
+ httpStatusCode: output.statusCode,
650
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
651
+ extendedRequestId: output.headers["x-amz-id-2"],
652
+ cfId: output.headers["x-amz-cf-id"]
653
+ }), "deserializeMetadata");
654
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
655
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(DynamoDBStreamsServiceException);
656
+ var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
657
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
658
+ const contents = {
659
+ protocol,
660
+ hostname,
661
+ port,
662
+ method: "POST",
663
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
664
+ headers
665
+ };
666
+ if (resolvedHostname !== void 0) {
667
+ contents.hostname = resolvedHostname;
668
+ }
669
+ if (body !== void 0) {
670
+ contents.body = body;
671
+ }
672
+ return new import_protocol_http.HttpRequest(contents);
673
+ }, "buildHttpRpcRequest");
674
+ function sharedHeaders(operation) {
675
+ return {
676
+ "content-type": "application/x-amz-json-1.0",
677
+ "x-amz-target": `DynamoDBStreams_20120810.${operation}`
678
+ };
679
+ }
680
+ __name(sharedHeaders, "sharedHeaders");
681
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
682
+ if (encoded.length) {
683
+ return JSON.parse(encoded);
684
+ }
685
+ return {};
686
+ }), "parseBody");
687
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
688
+ const value = await parseBody(errorBody, context);
689
+ value.message = value.message ?? value.Message;
690
+ return value;
691
+ }, "parseErrorBody");
692
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
693
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
694
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
695
+ let cleanValue = rawValue;
696
+ if (typeof cleanValue === "number") {
697
+ cleanValue = cleanValue.toString();
698
+ }
699
+ if (cleanValue.indexOf(",") >= 0) {
700
+ cleanValue = cleanValue.split(",")[0];
701
+ }
702
+ if (cleanValue.indexOf(":") >= 0) {
703
+ cleanValue = cleanValue.split(":")[0];
704
+ }
705
+ if (cleanValue.indexOf("#") >= 0) {
706
+ cleanValue = cleanValue.split("#")[1];
707
+ }
708
+ return cleanValue;
709
+ }, "sanitizeErrorCode");
710
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
711
+ if (headerKey !== void 0) {
712
+ return sanitizeErrorCode(output.headers[headerKey]);
713
+ }
714
+ if (data.code !== void 0) {
715
+ return sanitizeErrorCode(data.code);
716
+ }
717
+ if (data["__type"] !== void 0) {
718
+ return sanitizeErrorCode(data["__type"]);
719
+ }
720
+ }, "loadRestJsonErrorCode");
721
+
722
+ // src/commands/DescribeStreamCommand.ts
723
+ var _DescribeStreamCommand = class _DescribeStreamCommand extends import_smithy_client.Command.classBuilder().ep({
724
+ ...commonParams
725
+ }).m(function(Command, cs, config, o) {
726
+ return [
727
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
728
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
729
+ ];
730
+ }).s("DynamoDBStreams_20120810", "DescribeStream", {}).n("DynamoDBStreamsClient", "DescribeStreamCommand").f(void 0, void 0).ser(se_DescribeStreamCommand).de(de_DescribeStreamCommand).build() {
731
+ };
732
+ __name(_DescribeStreamCommand, "DescribeStreamCommand");
733
+ var DescribeStreamCommand = _DescribeStreamCommand;
734
+
735
+ // src/commands/GetRecordsCommand.ts
736
+
737
+
738
+
739
+
740
+ var _GetRecordsCommand = class _GetRecordsCommand extends import_smithy_client.Command.classBuilder().ep({
741
+ ...commonParams
742
+ }).m(function(Command, cs, config, o) {
743
+ return [
744
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
745
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
746
+ ];
747
+ }).s("DynamoDBStreams_20120810", "GetRecords", {}).n("DynamoDBStreamsClient", "GetRecordsCommand").f(void 0, void 0).ser(se_GetRecordsCommand).de(de_GetRecordsCommand).build() {
748
+ };
749
+ __name(_GetRecordsCommand, "GetRecordsCommand");
750
+ var GetRecordsCommand = _GetRecordsCommand;
751
+
752
+ // src/commands/GetShardIteratorCommand.ts
753
+
754
+
755
+
756
+
757
+ var _GetShardIteratorCommand = class _GetShardIteratorCommand extends import_smithy_client.Command.classBuilder().ep({
758
+ ...commonParams
759
+ }).m(function(Command, cs, config, o) {
760
+ return [
761
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
762
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
763
+ ];
764
+ }).s("DynamoDBStreams_20120810", "GetShardIterator", {}).n("DynamoDBStreamsClient", "GetShardIteratorCommand").f(void 0, void 0).ser(se_GetShardIteratorCommand).de(de_GetShardIteratorCommand).build() {
765
+ };
766
+ __name(_GetShardIteratorCommand, "GetShardIteratorCommand");
767
+ var GetShardIteratorCommand = _GetShardIteratorCommand;
768
+
769
+ // src/commands/ListStreamsCommand.ts
770
+
771
+
772
+
773
+
774
+ var _ListStreamsCommand = class _ListStreamsCommand extends import_smithy_client.Command.classBuilder().ep({
775
+ ...commonParams
776
+ }).m(function(Command, cs, config, o) {
777
+ return [
778
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
779
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
780
+ ];
781
+ }).s("DynamoDBStreams_20120810", "ListStreams", {}).n("DynamoDBStreamsClient", "ListStreamsCommand").f(void 0, void 0).ser(se_ListStreamsCommand).de(de_ListStreamsCommand).build() {
782
+ };
783
+ __name(_ListStreamsCommand, "ListStreamsCommand");
784
+ var ListStreamsCommand = _ListStreamsCommand;
785
+
786
+ // src/DynamoDBStreams.ts
787
+ var commands = {
788
+ DescribeStreamCommand,
789
+ GetRecordsCommand,
790
+ GetShardIteratorCommand,
791
+ ListStreamsCommand
792
+ };
793
+ var _DynamoDBStreams = class _DynamoDBStreams extends DynamoDBStreamsClient {
794
+ };
795
+ __name(_DynamoDBStreams, "DynamoDBStreams");
796
+ var DynamoDBStreams = _DynamoDBStreams;
797
+ (0, import_smithy_client.createAggregatedClient)(commands, DynamoDBStreams);
798
+
799
+ // src/index.ts
800
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
801
+ // Annotate the CommonJS export names for ESM import in node:
802
+ 0 && (module.exports = {
803
+ AttributeValue,
804
+ DescribeStreamCommand,
805
+ DynamoDBStreams,
806
+ DynamoDBStreamsClient,
807
+ DynamoDBStreamsServiceException,
808
+ ExpiredIteratorException,
809
+ GetRecordsCommand,
810
+ GetShardIteratorCommand,
811
+ InternalServerError,
812
+ KeyType,
813
+ LimitExceededException,
814
+ ListStreamsCommand,
815
+ OperationType,
816
+ ResourceNotFoundException,
817
+ ShardIteratorType,
818
+ StreamStatus,
819
+ StreamViewType,
820
+ TrimmedDataAccessException,
821
+ __Client
822
+ });