@aws-sdk/client-ebs 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
@@ -213,6 +213,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
213
213
  var import_types = require("@smithy/types");
214
214
 
215
215
  // src/protocols/Aws_restJson1.ts
216
+ var import_core2 = require("@aws-sdk/core");
216
217
 
217
218
 
218
219
  var import_uuid = require("uuid");
@@ -567,7 +568,7 @@ var de_CompleteSnapshotCommand = /* @__PURE__ */ __name(async (output, context)
567
568
  const contents = (0, import_smithy_client.map)({
568
569
  $metadata: deserializeMetadata(output)
569
570
  });
570
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
571
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
571
572
  const doc = (0, import_smithy_client.take)(data, {
572
573
  Status: import_smithy_client.expectString
573
574
  });
@@ -596,7 +597,7 @@ var de_ListChangedBlocksCommand = /* @__PURE__ */ __name(async (output, context)
596
597
  const contents = (0, import_smithy_client.map)({
597
598
  $metadata: deserializeMetadata(output)
598
599
  });
599
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
600
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
600
601
  const doc = (0, import_smithy_client.take)(data, {
601
602
  BlockSize: import_smithy_client.expectInt32,
602
603
  ChangedBlocks: import_smithy_client._json,
@@ -614,7 +615,7 @@ var de_ListSnapshotBlocksCommand = /* @__PURE__ */ __name(async (output, context
614
615
  const contents = (0, import_smithy_client.map)({
615
616
  $metadata: deserializeMetadata(output)
616
617
  });
617
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
618
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
618
619
  const doc = (0, import_smithy_client.take)(data, {
619
620
  BlockSize: import_smithy_client.expectInt32,
620
621
  Blocks: import_smithy_client._json,
@@ -644,7 +645,7 @@ var de_StartSnapshotCommand = /* @__PURE__ */ __name(async (output, context) =>
644
645
  const contents = (0, import_smithy_client.map)({
645
646
  $metadata: deserializeMetadata(output)
646
647
  });
647
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
648
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
648
649
  const doc = (0, import_smithy_client.take)(data, {
649
650
  BlockSize: import_smithy_client.expectInt32,
650
651
  Description: import_smithy_client.expectString,
@@ -664,9 +665,9 @@ var de_StartSnapshotCommand = /* @__PURE__ */ __name(async (output, context) =>
664
665
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
665
666
  const parsedOutput = {
666
667
  ...output,
667
- body: await parseErrorBody(output.body, context)
668
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
668
669
  };
669
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
670
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
670
671
  switch (errorCode) {
671
672
  case "AccessDeniedException":
672
673
  case "com.amazonaws.ebs#AccessDeniedException":
@@ -817,7 +818,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
817
818
  extendedRequestId: output.headers["x-amz-id-2"],
818
819
  cfId: output.headers["x-amz-cf-id"]
819
820
  }), "deserializeMetadata");
820
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
821
821
  var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
822
822
  var _BT = "BlockToken";
823
823
  var _C = "Checksum";
@@ -841,46 +841,6 @@ var _xaca = "x-amz-checksum-algorithm";
841
841
  var _xacam = "x-amz-checksum-aggregation-method";
842
842
  var _xadl = "x-amz-data-length";
843
843
  var _xap = "x-amz-progress";
844
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
845
- if (encoded.length) {
846
- return JSON.parse(encoded);
847
- }
848
- return {};
849
- }), "parseBody");
850
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
851
- const value = await parseBody(errorBody, context);
852
- value.message = value.message ?? value.Message;
853
- return value;
854
- }, "parseErrorBody");
855
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
856
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
857
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
858
- let cleanValue = rawValue;
859
- if (typeof cleanValue === "number") {
860
- cleanValue = cleanValue.toString();
861
- }
862
- if (cleanValue.indexOf(",") >= 0) {
863
- cleanValue = cleanValue.split(",")[0];
864
- }
865
- if (cleanValue.indexOf(":") >= 0) {
866
- cleanValue = cleanValue.split(":")[0];
867
- }
868
- if (cleanValue.indexOf("#") >= 0) {
869
- cleanValue = cleanValue.split("#")[1];
870
- }
871
- return cleanValue;
872
- }, "sanitizeErrorCode");
873
- const headerKey = findKey(output.headers, "x-amzn-errortype");
874
- if (headerKey !== void 0) {
875
- return sanitizeErrorCode(output.headers[headerKey]);
876
- }
877
- if (data.code !== void 0) {
878
- return sanitizeErrorCode(data.code);
879
- }
880
- if (data["__type"] !== void 0) {
881
- return sanitizeErrorCode(data["__type"]);
882
- }
883
- }, "loadRestJsonErrorCode");
884
844
 
885
845
  // src/commands/CompleteSnapshotCommand.ts
886
846
  var _CompleteSnapshotCommand = class _CompleteSnapshotCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,3 +1,4 @@
1
+ import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
1
2
  import { requestBuilder as rb } from "@smithy/core";
2
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
@@ -384,43 +385,3 @@ const _xaca = "x-amz-checksum-algorithm";
384
385
  const _xacam = "x-amz-checksum-aggregation-method";
385
386
  const _xadl = "x-amz-data-length";
386
387
  const _xap = "x-amz-progress";
387
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
388
- if (encoded.length) {
389
- return JSON.parse(encoded);
390
- }
391
- return {};
392
- });
393
- const parseErrorBody = async (errorBody, context) => {
394
- const value = await parseBody(errorBody, context);
395
- value.message = value.message ?? value.Message;
396
- return value;
397
- };
398
- const loadRestJsonErrorCode = (output, data) => {
399
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
400
- const sanitizeErrorCode = (rawValue) => {
401
- let cleanValue = rawValue;
402
- if (typeof cleanValue === "number") {
403
- cleanValue = cleanValue.toString();
404
- }
405
- if (cleanValue.indexOf(",") >= 0) {
406
- cleanValue = cleanValue.split(",")[0];
407
- }
408
- if (cleanValue.indexOf(":") >= 0) {
409
- cleanValue = cleanValue.split(":")[0];
410
- }
411
- if (cleanValue.indexOf("#") >= 0) {
412
- cleanValue = cleanValue.split("#")[1];
413
- }
414
- return cleanValue;
415
- };
416
- const headerKey = findKey(output.headers, "x-amzn-errortype");
417
- if (headerKey !== undefined) {
418
- return sanitizeErrorCode(output.headers[headerKey]);
419
- }
420
- if (data.code !== undefined) {
421
- return sanitizeErrorCode(data.code);
422
- }
423
- if (data["__type"] !== undefined) {
424
- return sanitizeErrorCode(data["__type"]);
425
- }
426
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ebs",
3
3
  "description": "AWS SDK for JavaScript Ebs 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-ebs",
@@ -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-stream": "^2.1.3",
package/dist-cjs/EBS.js DELETED
@@ -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");
@@ -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");