@aws-sdk/client-oam 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 CHANGED
@@ -208,6 +208,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
208
208
  var import_types = require("@smithy/types");
209
209
 
210
210
  // src/protocols/Aws_restJson1.ts
211
+ var import_core2 = require("@aws-sdk/core");
211
212
 
212
213
 
213
214
 
@@ -619,7 +620,7 @@ var de_CreateLinkCommand = /* @__PURE__ */ __name(async (output, context) => {
619
620
  const contents = (0, import_smithy_client.map)({
620
621
  $metadata: deserializeMetadata(output)
621
622
  });
622
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
623
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
623
624
  const doc = (0, import_smithy_client.take)(data, {
624
625
  Arn: import_smithy_client.expectString,
625
626
  Id: import_smithy_client.expectString,
@@ -639,7 +640,7 @@ var de_CreateSinkCommand = /* @__PURE__ */ __name(async (output, context) => {
639
640
  const contents = (0, import_smithy_client.map)({
640
641
  $metadata: deserializeMetadata(output)
641
642
  });
642
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
643
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
643
644
  const doc = (0, import_smithy_client.take)(data, {
644
645
  Arn: import_smithy_client.expectString,
645
646
  Id: import_smithy_client.expectString,
@@ -676,7 +677,7 @@ var de_GetLinkCommand = /* @__PURE__ */ __name(async (output, context) => {
676
677
  const contents = (0, import_smithy_client.map)({
677
678
  $metadata: deserializeMetadata(output)
678
679
  });
679
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
680
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
680
681
  const doc = (0, import_smithy_client.take)(data, {
681
682
  Arn: import_smithy_client.expectString,
682
683
  Id: import_smithy_client.expectString,
@@ -696,7 +697,7 @@ var de_GetSinkCommand = /* @__PURE__ */ __name(async (output, context) => {
696
697
  const contents = (0, import_smithy_client.map)({
697
698
  $metadata: deserializeMetadata(output)
698
699
  });
699
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
700
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
700
701
  const doc = (0, import_smithy_client.take)(data, {
701
702
  Arn: import_smithy_client.expectString,
702
703
  Id: import_smithy_client.expectString,
@@ -713,7 +714,7 @@ var de_GetSinkPolicyCommand = /* @__PURE__ */ __name(async (output, context) =>
713
714
  const contents = (0, import_smithy_client.map)({
714
715
  $metadata: deserializeMetadata(output)
715
716
  });
716
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
717
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
717
718
  const doc = (0, import_smithy_client.take)(data, {
718
719
  Policy: import_smithy_client.expectString,
719
720
  SinkArn: import_smithy_client.expectString,
@@ -729,7 +730,7 @@ var de_ListAttachedLinksCommand = /* @__PURE__ */ __name(async (output, context)
729
730
  const contents = (0, import_smithy_client.map)({
730
731
  $metadata: deserializeMetadata(output)
731
732
  });
732
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
733
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
733
734
  const doc = (0, import_smithy_client.take)(data, {
734
735
  Items: import_smithy_client._json,
735
736
  NextToken: import_smithy_client.expectString
@@ -744,7 +745,7 @@ var de_ListLinksCommand = /* @__PURE__ */ __name(async (output, context) => {
744
745
  const contents = (0, import_smithy_client.map)({
745
746
  $metadata: deserializeMetadata(output)
746
747
  });
747
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
748
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
748
749
  const doc = (0, import_smithy_client.take)(data, {
749
750
  Items: import_smithy_client._json,
750
751
  NextToken: import_smithy_client.expectString
@@ -759,7 +760,7 @@ var de_ListSinksCommand = /* @__PURE__ */ __name(async (output, context) => {
759
760
  const contents = (0, import_smithy_client.map)({
760
761
  $metadata: deserializeMetadata(output)
761
762
  });
762
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
763
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
763
764
  const doc = (0, import_smithy_client.take)(data, {
764
765
  Items: import_smithy_client._json,
765
766
  NextToken: import_smithy_client.expectString
@@ -774,7 +775,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
774
775
  const contents = (0, import_smithy_client.map)({
775
776
  $metadata: deserializeMetadata(output)
776
777
  });
777
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
778
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
778
779
  const doc = (0, import_smithy_client.take)(data, {
779
780
  Tags: import_smithy_client._json
780
781
  });
@@ -788,7 +789,7 @@ var de_PutSinkPolicyCommand = /* @__PURE__ */ __name(async (output, context) =>
788
789
  const contents = (0, import_smithy_client.map)({
789
790
  $metadata: deserializeMetadata(output)
790
791
  });
791
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
792
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
792
793
  const doc = (0, import_smithy_client.take)(data, {
793
794
  Policy: import_smithy_client.expectString,
794
795
  SinkArn: import_smithy_client.expectString,
@@ -824,7 +825,7 @@ var de_UpdateLinkCommand = /* @__PURE__ */ __name(async (output, context) => {
824
825
  const contents = (0, import_smithy_client.map)({
825
826
  $metadata: deserializeMetadata(output)
826
827
  });
827
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
828
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
828
829
  const doc = (0, import_smithy_client.take)(data, {
829
830
  Arn: import_smithy_client.expectString,
830
831
  Id: import_smithy_client.expectString,
@@ -840,9 +841,9 @@ var de_UpdateLinkCommand = /* @__PURE__ */ __name(async (output, context) => {
840
841
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
841
842
  const parsedOutput = {
842
843
  ...output,
843
- body: await parseErrorBody(output.body, context)
844
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
844
845
  };
845
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
846
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
846
847
  switch (errorCode) {
847
848
  case "ConflictException":
848
849
  case "com.amazonaws.oam#ConflictException":
@@ -1000,51 +1001,10 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1000
1001
  extendedRequestId: output.headers["x-amz-id-2"],
1001
1002
  cfId: output.headers["x-amz-cf-id"]
1002
1003
  }), "deserializeMetadata");
1003
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1004
1004
  var _TK = "TagKeys";
1005
1005
  var _aET = "amznErrorType";
1006
1006
  var _tK = "tagKeys";
1007
1007
  var _xae = "x-amzn-errortype";
1008
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1009
- if (encoded.length) {
1010
- return JSON.parse(encoded);
1011
- }
1012
- return {};
1013
- }), "parseBody");
1014
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1015
- const value = await parseBody(errorBody, context);
1016
- value.message = value.message ?? value.Message;
1017
- return value;
1018
- }, "parseErrorBody");
1019
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1020
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1021
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1022
- let cleanValue = rawValue;
1023
- if (typeof cleanValue === "number") {
1024
- cleanValue = cleanValue.toString();
1025
- }
1026
- if (cleanValue.indexOf(",") >= 0) {
1027
- cleanValue = cleanValue.split(",")[0];
1028
- }
1029
- if (cleanValue.indexOf(":") >= 0) {
1030
- cleanValue = cleanValue.split(":")[0];
1031
- }
1032
- if (cleanValue.indexOf("#") >= 0) {
1033
- cleanValue = cleanValue.split("#")[1];
1034
- }
1035
- return cleanValue;
1036
- }, "sanitizeErrorCode");
1037
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1038
- if (headerKey !== void 0) {
1039
- return sanitizeErrorCode(output.headers[headerKey]);
1040
- }
1041
- if (data.code !== void 0) {
1042
- return sanitizeErrorCode(data.code);
1043
- }
1044
- if (data["__type"] !== void 0) {
1045
- return sanitizeErrorCode(data["__type"]);
1046
- }
1047
- }, "loadRestJsonErrorCode");
1048
1008
 
1049
1009
  // src/commands/CreateLinkCommand.ts
1050
1010
  var _CreateLinkCommand = class _CreateLinkCommand 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, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { ConflictException, InternalServiceFault, InvalidParameterException, MissingRequiredParameterException, ResourceNotFoundException, ServiceQuotaExceededException, TooManyTagsException, ValidationException, } from "../models/models_0";
@@ -604,43 +605,3 @@ const _TK = "TagKeys";
604
605
  const _aET = "amznErrorType";
605
606
  const _tK = "tagKeys";
606
607
  const _xae = "x-amzn-errortype";
607
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
608
- if (encoded.length) {
609
- return JSON.parse(encoded);
610
- }
611
- return {};
612
- });
613
- const parseErrorBody = async (errorBody, context) => {
614
- const value = await parseBody(errorBody, context);
615
- value.message = value.message ?? value.Message;
616
- return value;
617
- };
618
- const loadRestJsonErrorCode = (output, data) => {
619
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
620
- const sanitizeErrorCode = (rawValue) => {
621
- let cleanValue = rawValue;
622
- if (typeof cleanValue === "number") {
623
- cleanValue = cleanValue.toString();
624
- }
625
- if (cleanValue.indexOf(",") >= 0) {
626
- cleanValue = cleanValue.split(",")[0];
627
- }
628
- if (cleanValue.indexOf(":") >= 0) {
629
- cleanValue = cleanValue.split(":")[0];
630
- }
631
- if (cleanValue.indexOf("#") >= 0) {
632
- cleanValue = cleanValue.split("#")[1];
633
- }
634
- return cleanValue;
635
- };
636
- const headerKey = findKey(output.headers, "x-amzn-errortype");
637
- if (headerKey !== undefined) {
638
- return sanitizeErrorCode(output.headers[headerKey]);
639
- }
640
- if (data.code !== undefined) {
641
- return sanitizeErrorCode(data.code);
642
- }
643
- if (data["__type"] !== undefined) {
644
- return sanitizeErrorCode(data["__type"]);
645
- }
646
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-oam",
3
3
  "description": "AWS SDK for JavaScript Oam Client for Node.js, Browser and React Native",
4
- "version": "3.525.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-oam",
@@ -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.525.0",
24
- "@aws-sdk/core": "3.525.0",
25
- "@aws-sdk/credential-provider-node": "3.525.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",