@aws-sdk/client-dynamodb-streams 3.523.0 → 3.529.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
@@ -383,7 +383,7 @@ var de_DescribeStreamCommand = /* @__PURE__ */ __name(async (output, context) =>
383
383
  if (output.statusCode >= 300) {
384
384
  return de_CommandError(output, context);
385
385
  }
386
- const data = await parseBody(output.body, context);
386
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
387
387
  let contents = {};
388
388
  contents = de_DescribeStreamOutput(data, context);
389
389
  const response = {
@@ -396,7 +396,7 @@ var de_GetRecordsCommand = /* @__PURE__ */ __name(async (output, context) => {
396
396
  if (output.statusCode >= 300) {
397
397
  return de_CommandError(output, context);
398
398
  }
399
- const data = await parseBody(output.body, context);
399
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
400
400
  let contents = {};
401
401
  contents = de_GetRecordsOutput(data, context);
402
402
  const response = {
@@ -409,7 +409,7 @@ var de_GetShardIteratorCommand = /* @__PURE__ */ __name(async (output, context)
409
409
  if (output.statusCode >= 300) {
410
410
  return de_CommandError(output, context);
411
411
  }
412
- const data = await parseBody(output.body, context);
412
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
413
413
  let contents = {};
414
414
  contents = (0, import_smithy_client._json)(data);
415
415
  const response = {
@@ -422,7 +422,7 @@ var de_ListStreamsCommand = /* @__PURE__ */ __name(async (output, context) => {
422
422
  if (output.statusCode >= 300) {
423
423
  return de_CommandError(output, context);
424
424
  }
425
- const data = await parseBody(output.body, context);
425
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
426
426
  let contents = {};
427
427
  contents = (0, import_smithy_client._json)(data);
428
428
  const response = {
@@ -434,9 +434,9 @@ var de_ListStreamsCommand = /* @__PURE__ */ __name(async (output, context) => {
434
434
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
435
435
  const parsedOutput = {
436
436
  ...output,
437
- body: await parseErrorBody(output.body, context)
437
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
438
438
  };
439
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
440
440
  switch (errorCode) {
441
441
  case "InternalServerError":
442
442
  case "com.amazonaws.dynamodbstreams#InternalServerError":
@@ -640,7 +640,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
640
640
  extendedRequestId: output.headers["x-amz-id-2"],
641
641
  cfId: output.headers["x-amz-cf-id"]
642
642
  }), "deserializeMetadata");
643
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
644
643
  var throwDefaultError = (0, import_smithy_client.withBaseException)(DynamoDBStreamsServiceException);
645
644
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
646
645
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -667,46 +666,6 @@ function sharedHeaders(operation) {
667
666
  };
668
667
  }
669
668
  __name(sharedHeaders, "sharedHeaders");
670
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
671
- if (encoded.length) {
672
- return JSON.parse(encoded);
673
- }
674
- return {};
675
- }), "parseBody");
676
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
677
- const value = await parseBody(errorBody, context);
678
- value.message = value.message ?? value.Message;
679
- return value;
680
- }, "parseErrorBody");
681
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
682
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
683
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
684
- let cleanValue = rawValue;
685
- if (typeof cleanValue === "number") {
686
- cleanValue = cleanValue.toString();
687
- }
688
- if (cleanValue.indexOf(",") >= 0) {
689
- cleanValue = cleanValue.split(",")[0];
690
- }
691
- if (cleanValue.indexOf(":") >= 0) {
692
- cleanValue = cleanValue.split(":")[0];
693
- }
694
- if (cleanValue.indexOf("#") >= 0) {
695
- cleanValue = cleanValue.split("#")[1];
696
- }
697
- return cleanValue;
698
- }, "sanitizeErrorCode");
699
- const headerKey = findKey(output.headers, "x-amzn-errortype");
700
- if (headerKey !== void 0) {
701
- return sanitizeErrorCode(output.headers[headerKey]);
702
- }
703
- if (data.code !== void 0) {
704
- return sanitizeErrorCode(data.code);
705
- }
706
- if (data["__type"] !== void 0) {
707
- return sanitizeErrorCode(data["__type"]);
708
- }
709
- }, "loadRestJsonErrorCode");
710
669
 
711
670
  // src/commands/DescribeStreamCommand.ts
712
671
  var _DescribeStreamCommand = class _DescribeStreamCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,4 +1,4 @@
1
- import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
1
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { DynamoDBStreamsServiceException as __BaseException } from "../models/DynamoDBStreamsServiceException";
@@ -320,43 +320,3 @@ function sharedHeaders(operation) {
320
320
  "x-amz-target": `DynamoDBStreams_20120810.${operation}`,
321
321
  };
322
322
  }
323
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
324
- if (encoded.length) {
325
- return JSON.parse(encoded);
326
- }
327
- return {};
328
- });
329
- const parseErrorBody = async (errorBody, context) => {
330
- const value = await parseBody(errorBody, context);
331
- value.message = value.message ?? value.Message;
332
- return value;
333
- };
334
- const loadRestJsonErrorCode = (output, data) => {
335
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
336
- const sanitizeErrorCode = (rawValue) => {
337
- let cleanValue = rawValue;
338
- if (typeof cleanValue === "number") {
339
- cleanValue = cleanValue.toString();
340
- }
341
- if (cleanValue.indexOf(",") >= 0) {
342
- cleanValue = cleanValue.split(",")[0];
343
- }
344
- if (cleanValue.indexOf(":") >= 0) {
345
- cleanValue = cleanValue.split(":")[0];
346
- }
347
- if (cleanValue.indexOf("#") >= 0) {
348
- cleanValue = cleanValue.split("#")[1];
349
- }
350
- return cleanValue;
351
- };
352
- const headerKey = findKey(output.headers, "x-amzn-errortype");
353
- if (headerKey !== undefined) {
354
- return sanitizeErrorCode(output.headers[headerKey]);
355
- }
356
- if (data.code !== undefined) {
357
- return sanitizeErrorCode(data.code);
358
- }
359
- if (data["__type"] !== undefined) {
360
- return sanitizeErrorCode(data["__type"]);
361
- }
362
- };
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.523.0",
4
+ "version": "3.529.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-dynamodb-streams",
@@ -20,40 +20,40 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.523.0",
24
- "@aws-sdk/core": "3.523.0",
25
- "@aws-sdk/credential-provider-node": "3.523.0",
23
+ "@aws-sdk/client-sts": "3.529.0",
24
+ "@aws-sdk/core": "3.529.0",
25
+ "@aws-sdk/credential-provider-node": "3.529.0",
26
26
  "@aws-sdk/middleware-host-header": "3.523.0",
27
27
  "@aws-sdk/middleware-logger": "3.523.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.523.0",
29
- "@aws-sdk/middleware-user-agent": "3.523.0",
30
- "@aws-sdk/region-config-resolver": "3.523.0",
29
+ "@aws-sdk/middleware-user-agent": "3.525.0",
30
+ "@aws-sdk/region-config-resolver": "3.525.0",
31
31
  "@aws-sdk/types": "3.523.0",
32
- "@aws-sdk/util-endpoints": "3.523.0",
32
+ "@aws-sdk/util-endpoints": "3.525.0",
33
33
  "@aws-sdk/util-user-agent-browser": "3.523.0",
34
- "@aws-sdk/util-user-agent-node": "3.523.0",
35
- "@smithy/config-resolver": "^2.1.3",
36
- "@smithy/core": "^1.3.4",
34
+ "@aws-sdk/util-user-agent-node": "3.525.0",
35
+ "@smithy/config-resolver": "^2.1.4",
36
+ "@smithy/core": "^1.3.5",
37
37
  "@smithy/fetch-http-handler": "^2.4.3",
38
38
  "@smithy/hash-node": "^2.1.3",
39
39
  "@smithy/invalid-dependency": "^2.1.3",
40
40
  "@smithy/middleware-content-length": "^2.1.3",
41
- "@smithy/middleware-endpoint": "^2.4.3",
42
- "@smithy/middleware-retry": "^2.1.3",
41
+ "@smithy/middleware-endpoint": "^2.4.4",
42
+ "@smithy/middleware-retry": "^2.1.4",
43
43
  "@smithy/middleware-serde": "^2.1.3",
44
44
  "@smithy/middleware-stack": "^2.1.3",
45
- "@smithy/node-config-provider": "^2.2.3",
45
+ "@smithy/node-config-provider": "^2.2.4",
46
46
  "@smithy/node-http-handler": "^2.4.1",
47
47
  "@smithy/protocol-http": "^3.2.1",
48
- "@smithy/smithy-client": "^2.4.1",
48
+ "@smithy/smithy-client": "^2.4.2",
49
49
  "@smithy/types": "^2.10.1",
50
50
  "@smithy/url-parser": "^2.1.3",
51
51
  "@smithy/util-base64": "^2.1.1",
52
52
  "@smithy/util-body-length-browser": "^2.1.1",
53
53
  "@smithy/util-body-length-node": "^2.2.1",
54
- "@smithy/util-defaults-mode-browser": "^2.1.3",
55
- "@smithy/util-defaults-mode-node": "^2.2.2",
56
- "@smithy/util-endpoints": "^1.1.3",
54
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
55
+ "@smithy/util-defaults-mode-node": "^2.2.3",
56
+ "@smithy/util-endpoints": "^1.1.4",
57
57
  "@smithy/util-middleware": "^2.1.3",
58
58
  "@smithy/util-retry": "^2.1.3",
59
59
  "@smithy/util-utf8": "^2.1.1",
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");