@aws-sdk/client-dax 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
@@ -235,6 +235,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
235
235
  var import_types = require("@smithy/types");
236
236
 
237
237
  // src/protocols/Aws_json1_1.ts
238
+ var import_core2 = require("@aws-sdk/core");
238
239
 
239
240
 
240
241
 
@@ -872,7 +873,7 @@ var de_CreateClusterCommand = /* @__PURE__ */ __name(async (output, context) =>
872
873
  if (output.statusCode >= 300) {
873
874
  return de_CommandError(output, context);
874
875
  }
875
- const data = await parseBody(output.body, context);
876
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
876
877
  let contents = {};
877
878
  contents = de_CreateClusterResponse(data, context);
878
879
  const response = {
@@ -885,7 +886,7 @@ var de_CreateParameterGroupCommand = /* @__PURE__ */ __name(async (output, conte
885
886
  if (output.statusCode >= 300) {
886
887
  return de_CommandError(output, context);
887
888
  }
888
- const data = await parseBody(output.body, context);
889
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
889
890
  let contents = {};
890
891
  contents = (0, import_smithy_client._json)(data);
891
892
  const response = {
@@ -898,7 +899,7 @@ var de_CreateSubnetGroupCommand = /* @__PURE__ */ __name(async (output, context)
898
899
  if (output.statusCode >= 300) {
899
900
  return de_CommandError(output, context);
900
901
  }
901
- const data = await parseBody(output.body, context);
902
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
902
903
  let contents = {};
903
904
  contents = (0, import_smithy_client._json)(data);
904
905
  const response = {
@@ -911,7 +912,7 @@ var de_DecreaseReplicationFactorCommand = /* @__PURE__ */ __name(async (output,
911
912
  if (output.statusCode >= 300) {
912
913
  return de_CommandError(output, context);
913
914
  }
914
- const data = await parseBody(output.body, context);
915
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
915
916
  let contents = {};
916
917
  contents = de_DecreaseReplicationFactorResponse(data, context);
917
918
  const response = {
@@ -924,7 +925,7 @@ var de_DeleteClusterCommand = /* @__PURE__ */ __name(async (output, context) =>
924
925
  if (output.statusCode >= 300) {
925
926
  return de_CommandError(output, context);
926
927
  }
927
- const data = await parseBody(output.body, context);
928
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
928
929
  let contents = {};
929
930
  contents = de_DeleteClusterResponse(data, context);
930
931
  const response = {
@@ -937,7 +938,7 @@ var de_DeleteParameterGroupCommand = /* @__PURE__ */ __name(async (output, conte
937
938
  if (output.statusCode >= 300) {
938
939
  return de_CommandError(output, context);
939
940
  }
940
- const data = await parseBody(output.body, context);
941
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
941
942
  let contents = {};
942
943
  contents = (0, import_smithy_client._json)(data);
943
944
  const response = {
@@ -950,7 +951,7 @@ var de_DeleteSubnetGroupCommand = /* @__PURE__ */ __name(async (output, context)
950
951
  if (output.statusCode >= 300) {
951
952
  return de_CommandError(output, context);
952
953
  }
953
- const data = await parseBody(output.body, context);
954
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
954
955
  let contents = {};
955
956
  contents = (0, import_smithy_client._json)(data);
956
957
  const response = {
@@ -963,7 +964,7 @@ var de_DescribeClustersCommand = /* @__PURE__ */ __name(async (output, context)
963
964
  if (output.statusCode >= 300) {
964
965
  return de_CommandError(output, context);
965
966
  }
966
- const data = await parseBody(output.body, context);
967
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
967
968
  let contents = {};
968
969
  contents = de_DescribeClustersResponse(data, context);
969
970
  const response = {
@@ -976,7 +977,7 @@ var de_DescribeDefaultParametersCommand = /* @__PURE__ */ __name(async (output,
976
977
  if (output.statusCode >= 300) {
977
978
  return de_CommandError(output, context);
978
979
  }
979
- const data = await parseBody(output.body, context);
980
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
980
981
  let contents = {};
981
982
  contents = (0, import_smithy_client._json)(data);
982
983
  const response = {
@@ -989,7 +990,7 @@ var de_DescribeEventsCommand = /* @__PURE__ */ __name(async (output, context) =>
989
990
  if (output.statusCode >= 300) {
990
991
  return de_CommandError(output, context);
991
992
  }
992
- const data = await parseBody(output.body, context);
993
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
993
994
  let contents = {};
994
995
  contents = de_DescribeEventsResponse(data, context);
995
996
  const response = {
@@ -1002,7 +1003,7 @@ var de_DescribeParameterGroupsCommand = /* @__PURE__ */ __name(async (output, co
1002
1003
  if (output.statusCode >= 300) {
1003
1004
  return de_CommandError(output, context);
1004
1005
  }
1005
- const data = await parseBody(output.body, context);
1006
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1006
1007
  let contents = {};
1007
1008
  contents = (0, import_smithy_client._json)(data);
1008
1009
  const response = {
@@ -1015,7 +1016,7 @@ var de_DescribeParametersCommand = /* @__PURE__ */ __name(async (output, context
1015
1016
  if (output.statusCode >= 300) {
1016
1017
  return de_CommandError(output, context);
1017
1018
  }
1018
- const data = await parseBody(output.body, context);
1019
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1019
1020
  let contents = {};
1020
1021
  contents = (0, import_smithy_client._json)(data);
1021
1022
  const response = {
@@ -1028,7 +1029,7 @@ var de_DescribeSubnetGroupsCommand = /* @__PURE__ */ __name(async (output, conte
1028
1029
  if (output.statusCode >= 300) {
1029
1030
  return de_CommandError(output, context);
1030
1031
  }
1031
- const data = await parseBody(output.body, context);
1032
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1032
1033
  let contents = {};
1033
1034
  contents = (0, import_smithy_client._json)(data);
1034
1035
  const response = {
@@ -1041,7 +1042,7 @@ var de_IncreaseReplicationFactorCommand = /* @__PURE__ */ __name(async (output,
1041
1042
  if (output.statusCode >= 300) {
1042
1043
  return de_CommandError(output, context);
1043
1044
  }
1044
- const data = await parseBody(output.body, context);
1045
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1045
1046
  let contents = {};
1046
1047
  contents = de_IncreaseReplicationFactorResponse(data, context);
1047
1048
  const response = {
@@ -1054,7 +1055,7 @@ var de_ListTagsCommand = /* @__PURE__ */ __name(async (output, context) => {
1054
1055
  if (output.statusCode >= 300) {
1055
1056
  return de_CommandError(output, context);
1056
1057
  }
1057
- const data = await parseBody(output.body, context);
1058
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1058
1059
  let contents = {};
1059
1060
  contents = (0, import_smithy_client._json)(data);
1060
1061
  const response = {
@@ -1067,7 +1068,7 @@ var de_RebootNodeCommand = /* @__PURE__ */ __name(async (output, context) => {
1067
1068
  if (output.statusCode >= 300) {
1068
1069
  return de_CommandError(output, context);
1069
1070
  }
1070
- const data = await parseBody(output.body, context);
1071
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1071
1072
  let contents = {};
1072
1073
  contents = de_RebootNodeResponse(data, context);
1073
1074
  const response = {
@@ -1080,7 +1081,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
1080
1081
  if (output.statusCode >= 300) {
1081
1082
  return de_CommandError(output, context);
1082
1083
  }
1083
- const data = await parseBody(output.body, context);
1084
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1084
1085
  let contents = {};
1085
1086
  contents = (0, import_smithy_client._json)(data);
1086
1087
  const response = {
@@ -1093,7 +1094,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
1093
1094
  if (output.statusCode >= 300) {
1094
1095
  return de_CommandError(output, context);
1095
1096
  }
1096
- const data = await parseBody(output.body, context);
1097
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1097
1098
  let contents = {};
1098
1099
  contents = (0, import_smithy_client._json)(data);
1099
1100
  const response = {
@@ -1106,7 +1107,7 @@ var de_UpdateClusterCommand = /* @__PURE__ */ __name(async (output, context) =>
1106
1107
  if (output.statusCode >= 300) {
1107
1108
  return de_CommandError(output, context);
1108
1109
  }
1109
- const data = await parseBody(output.body, context);
1110
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1110
1111
  let contents = {};
1111
1112
  contents = de_UpdateClusterResponse(data, context);
1112
1113
  const response = {
@@ -1119,7 +1120,7 @@ var de_UpdateParameterGroupCommand = /* @__PURE__ */ __name(async (output, conte
1119
1120
  if (output.statusCode >= 300) {
1120
1121
  return de_CommandError(output, context);
1121
1122
  }
1122
- const data = await parseBody(output.body, context);
1123
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1123
1124
  let contents = {};
1124
1125
  contents = (0, import_smithy_client._json)(data);
1125
1126
  const response = {
@@ -1132,7 +1133,7 @@ var de_UpdateSubnetGroupCommand = /* @__PURE__ */ __name(async (output, context)
1132
1133
  if (output.statusCode >= 300) {
1133
1134
  return de_CommandError(output, context);
1134
1135
  }
1135
- const data = await parseBody(output.body, context);
1136
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1136
1137
  let contents = {};
1137
1138
  contents = (0, import_smithy_client._json)(data);
1138
1139
  const response = {
@@ -1144,9 +1145,9 @@ var de_UpdateSubnetGroupCommand = /* @__PURE__ */ __name(async (output, context)
1144
1145
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1145
1146
  const parsedOutput = {
1146
1147
  ...output,
1147
- body: await parseErrorBody(output.body, context)
1148
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1148
1149
  };
1149
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1150
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1150
1151
  switch (errorCode) {
1151
1152
  case "ClusterAlreadyExistsFault":
1152
1153
  case "com.amazonaws.dax#ClusterAlreadyExistsFault":
@@ -1598,7 +1599,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1598
1599
  extendedRequestId: output.headers["x-amz-id-2"],
1599
1600
  cfId: output.headers["x-amz-cf-id"]
1600
1601
  }), "deserializeMetadata");
1601
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1602
1602
  var throwDefaultError = (0, import_smithy_client.withBaseException)(DAXServiceException);
1603
1603
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1604
1604
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1625,46 +1625,6 @@ function sharedHeaders(operation) {
1625
1625
  };
1626
1626
  }
1627
1627
  __name(sharedHeaders, "sharedHeaders");
1628
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1629
- if (encoded.length) {
1630
- return JSON.parse(encoded);
1631
- }
1632
- return {};
1633
- }), "parseBody");
1634
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1635
- const value = await parseBody(errorBody, context);
1636
- value.message = value.message ?? value.Message;
1637
- return value;
1638
- }, "parseErrorBody");
1639
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1640
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1641
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1642
- let cleanValue = rawValue;
1643
- if (typeof cleanValue === "number") {
1644
- cleanValue = cleanValue.toString();
1645
- }
1646
- if (cleanValue.indexOf(",") >= 0) {
1647
- cleanValue = cleanValue.split(",")[0];
1648
- }
1649
- if (cleanValue.indexOf(":") >= 0) {
1650
- cleanValue = cleanValue.split(":")[0];
1651
- }
1652
- if (cleanValue.indexOf("#") >= 0) {
1653
- cleanValue = cleanValue.split("#")[1];
1654
- }
1655
- return cleanValue;
1656
- }, "sanitizeErrorCode");
1657
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1658
- if (headerKey !== void 0) {
1659
- return sanitizeErrorCode(output.headers[headerKey]);
1660
- }
1661
- if (data.code !== void 0) {
1662
- return sanitizeErrorCode(data.code);
1663
- }
1664
- if (data["__type"] !== void 0) {
1665
- return sanitizeErrorCode(data["__type"]);
1666
- }
1667
- }, "loadRestJsonErrorCode");
1668
1628
 
1669
1629
  // src/commands/CreateClusterCommand.ts
1670
1630
  var _CreateClusterCommand = class _CreateClusterCommand 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, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { DAXServiceException as __BaseException } from "../models/DAXServiceException";
@@ -890,43 +891,3 @@ function sharedHeaders(operation) {
890
891
  "x-amz-target": `AmazonDAXV3.${operation}`,
891
892
  };
892
893
  }
893
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
894
- if (encoded.length) {
895
- return JSON.parse(encoded);
896
- }
897
- return {};
898
- });
899
- const parseErrorBody = async (errorBody, context) => {
900
- const value = await parseBody(errorBody, context);
901
- value.message = value.message ?? value.Message;
902
- return value;
903
- };
904
- const loadRestJsonErrorCode = (output, data) => {
905
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
906
- const sanitizeErrorCode = (rawValue) => {
907
- let cleanValue = rawValue;
908
- if (typeof cleanValue === "number") {
909
- cleanValue = cleanValue.toString();
910
- }
911
- if (cleanValue.indexOf(",") >= 0) {
912
- cleanValue = cleanValue.split(",")[0];
913
- }
914
- if (cleanValue.indexOf(":") >= 0) {
915
- cleanValue = cleanValue.split(":")[0];
916
- }
917
- if (cleanValue.indexOf("#") >= 0) {
918
- cleanValue = cleanValue.split("#")[1];
919
- }
920
- return cleanValue;
921
- };
922
- const headerKey = findKey(output.headers, "x-amzn-errortype");
923
- if (headerKey !== undefined) {
924
- return sanitizeErrorCode(output.headers[headerKey]);
925
- }
926
- if (data.code !== undefined) {
927
- return sanitizeErrorCode(data.code);
928
- }
929
- if (data["__type"] !== undefined) {
930
- return sanitizeErrorCode(data["__type"]);
931
- }
932
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-dax",
3
3
  "description": "AWS SDK for JavaScript Dax 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-dax",
@@ -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",