@aws-sdk/client-support 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 +19 -59
- package/dist-es/protocols/Aws_json1_1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -209,6 +209,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
209
209
|
var import_types = require("@smithy/types");
|
|
210
210
|
|
|
211
211
|
// src/protocols/Aws_json1_1.ts
|
|
212
|
+
var import_core2 = require("@aws-sdk/core");
|
|
212
213
|
|
|
213
214
|
|
|
214
215
|
|
|
@@ -499,7 +500,7 @@ var de_AddAttachmentsToSetCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
499
500
|
if (output.statusCode >= 300) {
|
|
500
501
|
return de_CommandError(output, context);
|
|
501
502
|
}
|
|
502
|
-
const data = await
|
|
503
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
503
504
|
let contents = {};
|
|
504
505
|
contents = (0, import_smithy_client._json)(data);
|
|
505
506
|
const response = {
|
|
@@ -512,7 +513,7 @@ var de_AddCommunicationToCaseCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
512
513
|
if (output.statusCode >= 300) {
|
|
513
514
|
return de_CommandError(output, context);
|
|
514
515
|
}
|
|
515
|
-
const data = await
|
|
516
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
516
517
|
let contents = {};
|
|
517
518
|
contents = (0, import_smithy_client._json)(data);
|
|
518
519
|
const response = {
|
|
@@ -525,7 +526,7 @@ var de_CreateCaseCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
525
526
|
if (output.statusCode >= 300) {
|
|
526
527
|
return de_CommandError(output, context);
|
|
527
528
|
}
|
|
528
|
-
const data = await
|
|
529
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
529
530
|
let contents = {};
|
|
530
531
|
contents = (0, import_smithy_client._json)(data);
|
|
531
532
|
const response = {
|
|
@@ -538,7 +539,7 @@ var de_DescribeAttachmentCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
538
539
|
if (output.statusCode >= 300) {
|
|
539
540
|
return de_CommandError(output, context);
|
|
540
541
|
}
|
|
541
|
-
const data = await
|
|
542
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
542
543
|
let contents = {};
|
|
543
544
|
contents = de_DescribeAttachmentResponse(data, context);
|
|
544
545
|
const response = {
|
|
@@ -551,7 +552,7 @@ var de_DescribeCasesCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
551
552
|
if (output.statusCode >= 300) {
|
|
552
553
|
return de_CommandError(output, context);
|
|
553
554
|
}
|
|
554
|
-
const data = await
|
|
555
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
555
556
|
let contents = {};
|
|
556
557
|
contents = (0, import_smithy_client._json)(data);
|
|
557
558
|
const response = {
|
|
@@ -564,7 +565,7 @@ var de_DescribeCommunicationsCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
564
565
|
if (output.statusCode >= 300) {
|
|
565
566
|
return de_CommandError(output, context);
|
|
566
567
|
}
|
|
567
|
-
const data = await
|
|
568
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
568
569
|
let contents = {};
|
|
569
570
|
contents = (0, import_smithy_client._json)(data);
|
|
570
571
|
const response = {
|
|
@@ -577,7 +578,7 @@ var de_DescribeCreateCaseOptionsCommand = /* @__PURE__ */ __name(async (output,
|
|
|
577
578
|
if (output.statusCode >= 300) {
|
|
578
579
|
return de_CommandError(output, context);
|
|
579
580
|
}
|
|
580
|
-
const data = await
|
|
581
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
581
582
|
let contents = {};
|
|
582
583
|
contents = (0, import_smithy_client._json)(data);
|
|
583
584
|
const response = {
|
|
@@ -590,7 +591,7 @@ var de_DescribeServicesCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
590
591
|
if (output.statusCode >= 300) {
|
|
591
592
|
return de_CommandError(output, context);
|
|
592
593
|
}
|
|
593
|
-
const data = await
|
|
594
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
594
595
|
let contents = {};
|
|
595
596
|
contents = (0, import_smithy_client._json)(data);
|
|
596
597
|
const response = {
|
|
@@ -603,7 +604,7 @@ var de_DescribeSeverityLevelsCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
603
604
|
if (output.statusCode >= 300) {
|
|
604
605
|
return de_CommandError(output, context);
|
|
605
606
|
}
|
|
606
|
-
const data = await
|
|
607
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
607
608
|
let contents = {};
|
|
608
609
|
contents = (0, import_smithy_client._json)(data);
|
|
609
610
|
const response = {
|
|
@@ -616,7 +617,7 @@ var de_DescribeSupportedLanguagesCommand = /* @__PURE__ */ __name(async (output,
|
|
|
616
617
|
if (output.statusCode >= 300) {
|
|
617
618
|
return de_CommandError(output, context);
|
|
618
619
|
}
|
|
619
|
-
const data = await
|
|
620
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
620
621
|
let contents = {};
|
|
621
622
|
contents = (0, import_smithy_client._json)(data);
|
|
622
623
|
const response = {
|
|
@@ -629,7 +630,7 @@ var de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = /* @__PURE__ */ __nam
|
|
|
629
630
|
if (output.statusCode >= 300) {
|
|
630
631
|
return de_CommandError(output, context);
|
|
631
632
|
}
|
|
632
|
-
const data = await
|
|
633
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
633
634
|
let contents = {};
|
|
634
635
|
contents = (0, import_smithy_client._json)(data);
|
|
635
636
|
const response = {
|
|
@@ -642,7 +643,7 @@ var de_DescribeTrustedAdvisorCheckResultCommand = /* @__PURE__ */ __name(async (
|
|
|
642
643
|
if (output.statusCode >= 300) {
|
|
643
644
|
return de_CommandError(output, context);
|
|
644
645
|
}
|
|
645
|
-
const data = await
|
|
646
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
646
647
|
let contents = {};
|
|
647
648
|
contents = de_DescribeTrustedAdvisorCheckResultResponse(data, context);
|
|
648
649
|
const response = {
|
|
@@ -655,7 +656,7 @@ var de_DescribeTrustedAdvisorChecksCommand = /* @__PURE__ */ __name(async (outpu
|
|
|
655
656
|
if (output.statusCode >= 300) {
|
|
656
657
|
return de_CommandError(output, context);
|
|
657
658
|
}
|
|
658
|
-
const data = await
|
|
659
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
659
660
|
let contents = {};
|
|
660
661
|
contents = de_DescribeTrustedAdvisorChecksResponse(data, context);
|
|
661
662
|
const response = {
|
|
@@ -668,7 +669,7 @@ var de_DescribeTrustedAdvisorCheckSummariesCommand = /* @__PURE__ */ __name(asyn
|
|
|
668
669
|
if (output.statusCode >= 300) {
|
|
669
670
|
return de_CommandError(output, context);
|
|
670
671
|
}
|
|
671
|
-
const data = await
|
|
672
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
672
673
|
let contents = {};
|
|
673
674
|
contents = de_DescribeTrustedAdvisorCheckSummariesResponse(data, context);
|
|
674
675
|
const response = {
|
|
@@ -681,7 +682,7 @@ var de_RefreshTrustedAdvisorCheckCommand = /* @__PURE__ */ __name(async (output,
|
|
|
681
682
|
if (output.statusCode >= 300) {
|
|
682
683
|
return de_CommandError(output, context);
|
|
683
684
|
}
|
|
684
|
-
const data = await
|
|
685
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
685
686
|
let contents = {};
|
|
686
687
|
contents = (0, import_smithy_client._json)(data);
|
|
687
688
|
const response = {
|
|
@@ -694,7 +695,7 @@ var de_ResolveCaseCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
694
695
|
if (output.statusCode >= 300) {
|
|
695
696
|
return de_CommandError(output, context);
|
|
696
697
|
}
|
|
697
|
-
const data = await
|
|
698
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
698
699
|
let contents = {};
|
|
699
700
|
contents = (0, import_smithy_client._json)(data);
|
|
700
701
|
const response = {
|
|
@@ -706,9 +707,9 @@ var de_ResolveCaseCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
706
707
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
707
708
|
const parsedOutput = {
|
|
708
709
|
...output,
|
|
709
|
-
body: await
|
|
710
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
710
711
|
};
|
|
711
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
712
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
712
713
|
switch (errorCode) {
|
|
713
714
|
case "AttachmentLimitExceeded":
|
|
714
715
|
case "com.amazonaws.support#AttachmentLimitExceeded":
|
|
@@ -977,7 +978,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
977
978
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
978
979
|
cfId: output.headers["x-amz-cf-id"]
|
|
979
980
|
}), "deserializeMetadata");
|
|
980
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
981
981
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(SupportServiceException);
|
|
982
982
|
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
983
983
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -1004,46 +1004,6 @@ function sharedHeaders(operation) {
|
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
1006
1006
|
__name(sharedHeaders, "sharedHeaders");
|
|
1007
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1008
|
-
if (encoded.length) {
|
|
1009
|
-
return JSON.parse(encoded);
|
|
1010
|
-
}
|
|
1011
|
-
return {};
|
|
1012
|
-
}), "parseBody");
|
|
1013
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
1014
|
-
const value = await parseBody(errorBody, context);
|
|
1015
|
-
value.message = value.message ?? value.Message;
|
|
1016
|
-
return value;
|
|
1017
|
-
}, "parseErrorBody");
|
|
1018
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
1019
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
1020
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
1021
|
-
let cleanValue = rawValue;
|
|
1022
|
-
if (typeof cleanValue === "number") {
|
|
1023
|
-
cleanValue = cleanValue.toString();
|
|
1024
|
-
}
|
|
1025
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1026
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1027
|
-
}
|
|
1028
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1029
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1030
|
-
}
|
|
1031
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1032
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1033
|
-
}
|
|
1034
|
-
return cleanValue;
|
|
1035
|
-
}, "sanitizeErrorCode");
|
|
1036
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1037
|
-
if (headerKey !== void 0) {
|
|
1038
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1039
|
-
}
|
|
1040
|
-
if (data.code !== void 0) {
|
|
1041
|
-
return sanitizeErrorCode(data.code);
|
|
1042
|
-
}
|
|
1043
|
-
if (data["__type"] !== void 0) {
|
|
1044
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1045
|
-
}
|
|
1046
|
-
}, "loadRestJsonErrorCode");
|
|
1047
1007
|
|
|
1048
1008
|
// src/commands/AddAttachmentsToSetCommand.ts
|
|
1049
1009
|
var _AddAttachmentsToSetCommand = class _AddAttachmentsToSetCommand 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 { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, limitedParseDouble as __limitedParseDouble, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { AttachmentIdNotFound, AttachmentLimitExceeded, AttachmentSetExpired, AttachmentSetIdNotFound, AttachmentSetSizeLimitExceeded, CaseCreationLimitExceeded, CaseIdNotFound, DescribeAttachmentLimitExceeded, InternalServerError, ThrottlingException, } from "../models/models_0";
|
|
@@ -614,43 +615,3 @@ function sharedHeaders(operation) {
|
|
|
614
615
|
"x-amz-target": `AWSSupport_20130415.${operation}`,
|
|
615
616
|
};
|
|
616
617
|
}
|
|
617
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
618
|
-
if (encoded.length) {
|
|
619
|
-
return JSON.parse(encoded);
|
|
620
|
-
}
|
|
621
|
-
return {};
|
|
622
|
-
});
|
|
623
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
624
|
-
const value = await parseBody(errorBody, context);
|
|
625
|
-
value.message = value.message ?? value.Message;
|
|
626
|
-
return value;
|
|
627
|
-
};
|
|
628
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
629
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
630
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
631
|
-
let cleanValue = rawValue;
|
|
632
|
-
if (typeof cleanValue === "number") {
|
|
633
|
-
cleanValue = cleanValue.toString();
|
|
634
|
-
}
|
|
635
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
636
|
-
cleanValue = cleanValue.split(",")[0];
|
|
637
|
-
}
|
|
638
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
639
|
-
cleanValue = cleanValue.split(":")[0];
|
|
640
|
-
}
|
|
641
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
642
|
-
cleanValue = cleanValue.split("#")[1];
|
|
643
|
-
}
|
|
644
|
-
return cleanValue;
|
|
645
|
-
};
|
|
646
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
647
|
-
if (headerKey !== undefined) {
|
|
648
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
649
|
-
}
|
|
650
|
-
if (data.code !== undefined) {
|
|
651
|
-
return sanitizeErrorCode(data.code);
|
|
652
|
-
}
|
|
653
|
-
if (data["__type"] !== undefined) {
|
|
654
|
-
return sanitizeErrorCode(data["__type"]);
|
|
655
|
-
}
|
|
656
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-support",
|
|
3
3
|
"description": "AWS SDK for JavaScript Support 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-support",
|
|
@@ -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",
|