@aws-sdk/client-s3outposts 3.525.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 +7 -47
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -198,6 +198,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
198
198
|
var import_types = require("@smithy/types");
|
|
199
199
|
|
|
200
200
|
// src/protocols/Aws_restJson1.ts
|
|
201
|
+
var import_core2 = require("@aws-sdk/core");
|
|
201
202
|
|
|
202
203
|
|
|
203
204
|
|
|
@@ -430,7 +431,7 @@ var de_CreateEndpointCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
430
431
|
const contents = (0, import_smithy_client.map)({
|
|
431
432
|
$metadata: deserializeMetadata(output)
|
|
432
433
|
});
|
|
433
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
434
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
434
435
|
const doc = (0, import_smithy_client.take)(data, {
|
|
435
436
|
EndpointArn: import_smithy_client.expectString
|
|
436
437
|
});
|
|
@@ -454,7 +455,7 @@ var de_ListEndpointsCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
454
455
|
const contents = (0, import_smithy_client.map)({
|
|
455
456
|
$metadata: deserializeMetadata(output)
|
|
456
457
|
});
|
|
457
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
458
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
458
459
|
const doc = (0, import_smithy_client.take)(data, {
|
|
459
460
|
Endpoints: (_) => de_Endpoints(_, context),
|
|
460
461
|
NextToken: import_smithy_client.expectString
|
|
@@ -469,7 +470,7 @@ var de_ListOutpostsWithS3Command = /* @__PURE__ */ __name(async (output, context
|
|
|
469
470
|
const contents = (0, import_smithy_client.map)({
|
|
470
471
|
$metadata: deserializeMetadata(output)
|
|
471
472
|
});
|
|
472
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
473
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
473
474
|
const doc = (0, import_smithy_client.take)(data, {
|
|
474
475
|
NextToken: import_smithy_client.expectString,
|
|
475
476
|
Outposts: import_smithy_client._json
|
|
@@ -484,7 +485,7 @@ var de_ListSharedEndpointsCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
484
485
|
const contents = (0, import_smithy_client.map)({
|
|
485
486
|
$metadata: deserializeMetadata(output)
|
|
486
487
|
});
|
|
487
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
488
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
488
489
|
const doc = (0, import_smithy_client.take)(data, {
|
|
489
490
|
Endpoints: (_) => de_Endpoints(_, context),
|
|
490
491
|
NextToken: import_smithy_client.expectString
|
|
@@ -495,9 +496,9 @@ var de_ListSharedEndpointsCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
495
496
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
496
497
|
const parsedOutput = {
|
|
497
498
|
...output,
|
|
498
|
-
body: await
|
|
499
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
499
500
|
};
|
|
500
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
501
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
501
502
|
switch (errorCode) {
|
|
502
503
|
case "AccessDeniedException":
|
|
503
504
|
case "com.amazonaws.s3outposts#AccessDeniedException":
|
|
@@ -649,7 +650,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
649
650
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
650
651
|
cfId: output.headers["x-amz-cf-id"]
|
|
651
652
|
}), "deserializeMetadata");
|
|
652
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
653
653
|
var _EI = "EndpointId";
|
|
654
654
|
var _MR = "MaxResults";
|
|
655
655
|
var _NT = "NextToken";
|
|
@@ -658,46 +658,6 @@ var _eI = "endpointId";
|
|
|
658
658
|
var _mR = "maxResults";
|
|
659
659
|
var _nT = "nextToken";
|
|
660
660
|
var _oI = "outpostId";
|
|
661
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
662
|
-
if (encoded.length) {
|
|
663
|
-
return JSON.parse(encoded);
|
|
664
|
-
}
|
|
665
|
-
return {};
|
|
666
|
-
}), "parseBody");
|
|
667
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
668
|
-
const value = await parseBody(errorBody, context);
|
|
669
|
-
value.message = value.message ?? value.Message;
|
|
670
|
-
return value;
|
|
671
|
-
}, "parseErrorBody");
|
|
672
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
673
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
674
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
675
|
-
let cleanValue = rawValue;
|
|
676
|
-
if (typeof cleanValue === "number") {
|
|
677
|
-
cleanValue = cleanValue.toString();
|
|
678
|
-
}
|
|
679
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
680
|
-
cleanValue = cleanValue.split(",")[0];
|
|
681
|
-
}
|
|
682
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
683
|
-
cleanValue = cleanValue.split(":")[0];
|
|
684
|
-
}
|
|
685
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
686
|
-
cleanValue = cleanValue.split("#")[1];
|
|
687
|
-
}
|
|
688
|
-
return cleanValue;
|
|
689
|
-
}, "sanitizeErrorCode");
|
|
690
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
691
|
-
if (headerKey !== void 0) {
|
|
692
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
693
|
-
}
|
|
694
|
-
if (data.code !== void 0) {
|
|
695
|
-
return sanitizeErrorCode(data.code);
|
|
696
|
-
}
|
|
697
|
-
if (data["__type"] !== void 0) {
|
|
698
|
-
return sanitizeErrorCode(data["__type"]);
|
|
699
|
-
}
|
|
700
|
-
}, "loadRestJsonErrorCode");
|
|
701
661
|
|
|
702
662
|
// src/commands/CreateEndpointCommand.ts
|
|
703
663
|
var _CreateEndpointCommand = class _CreateEndpointCommand 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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { AccessDeniedException, ConflictException, InternalServerException, OutpostOfflineException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
@@ -310,43 +311,3 @@ const _eI = "endpointId";
|
|
|
310
311
|
const _mR = "maxResults";
|
|
311
312
|
const _nT = "nextToken";
|
|
312
313
|
const _oI = "outpostId";
|
|
313
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
314
|
-
if (encoded.length) {
|
|
315
|
-
return JSON.parse(encoded);
|
|
316
|
-
}
|
|
317
|
-
return {};
|
|
318
|
-
});
|
|
319
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
320
|
-
const value = await parseBody(errorBody, context);
|
|
321
|
-
value.message = value.message ?? value.Message;
|
|
322
|
-
return value;
|
|
323
|
-
};
|
|
324
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
325
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
326
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
327
|
-
let cleanValue = rawValue;
|
|
328
|
-
if (typeof cleanValue === "number") {
|
|
329
|
-
cleanValue = cleanValue.toString();
|
|
330
|
-
}
|
|
331
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
332
|
-
cleanValue = cleanValue.split(",")[0];
|
|
333
|
-
}
|
|
334
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
335
|
-
cleanValue = cleanValue.split(":")[0];
|
|
336
|
-
}
|
|
337
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
338
|
-
cleanValue = cleanValue.split("#")[1];
|
|
339
|
-
}
|
|
340
|
-
return cleanValue;
|
|
341
|
-
};
|
|
342
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
343
|
-
if (headerKey !== undefined) {
|
|
344
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
345
|
-
}
|
|
346
|
-
if (data.code !== undefined) {
|
|
347
|
-
return sanitizeErrorCode(data.code);
|
|
348
|
-
}
|
|
349
|
-
if (data["__type"] !== undefined) {
|
|
350
|
-
return sanitizeErrorCode(data["__type"]);
|
|
351
|
-
}
|
|
352
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-s3outposts",
|
|
3
3
|
"description": "AWS SDK for JavaScript S3outposts Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
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-s3outposts",
|
|
@@ -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.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",
|