@aws-sdk/client-ebs 3.525.0 → 3.529.1
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 +7 -47
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
4
|
+
"version": "3.529.1",
|
|
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,9 +20,9 @@
|
|
|
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.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.529.1",
|
|
24
|
+
"@aws-sdk/core": "3.529.1",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.529.1",
|
|
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",
|