@aws-sdk/client-mq 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
@@ -221,6 +221,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
221
221
  var import_types = require("@smithy/types");
222
222
 
223
223
  // src/protocols/Aws_restJson1.ts
224
+ var import_core2 = require("@aws-sdk/core");
224
225
 
225
226
 
226
227
  var import_uuid = require("uuid");
@@ -752,7 +753,7 @@ var de_CreateBrokerCommand = /* @__PURE__ */ __name(async (output, context) => {
752
753
  const contents = (0, import_smithy_client.map)({
753
754
  $metadata: deserializeMetadata(output)
754
755
  });
755
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
756
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
756
757
  const doc = (0, import_smithy_client.take)(data, {
757
758
  BrokerArn: [, import_smithy_client.expectString, `brokerArn`],
758
759
  BrokerId: [, import_smithy_client.expectString, `brokerId`]
@@ -767,7 +768,7 @@ var de_CreateConfigurationCommand = /* @__PURE__ */ __name(async (output, contex
767
768
  const contents = (0, import_smithy_client.map)({
768
769
  $metadata: deserializeMetadata(output)
769
770
  });
770
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
771
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
771
772
  const doc = (0, import_smithy_client.take)(data, {
772
773
  Arn: [, import_smithy_client.expectString, `arn`],
773
774
  AuthenticationStrategy: [, import_smithy_client.expectString, `authenticationStrategy`],
@@ -806,7 +807,7 @@ var de_DeleteBrokerCommand = /* @__PURE__ */ __name(async (output, context) => {
806
807
  const contents = (0, import_smithy_client.map)({
807
808
  $metadata: deserializeMetadata(output)
808
809
  });
809
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
810
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
810
811
  const doc = (0, import_smithy_client.take)(data, {
811
812
  BrokerId: [, import_smithy_client.expectString, `brokerId`]
812
813
  });
@@ -840,7 +841,7 @@ var de_DescribeBrokerCommand = /* @__PURE__ */ __name(async (output, context) =>
840
841
  const contents = (0, import_smithy_client.map)({
841
842
  $metadata: deserializeMetadata(output)
842
843
  });
843
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
844
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
844
845
  const doc = (0, import_smithy_client.take)(data, {
845
846
  ActionsRequired: [, (_) => de___listOfActionRequired(_, context), `actionsRequired`],
846
847
  AuthenticationStrategy: [, import_smithy_client.expectString, `authenticationStrategy`],
@@ -890,7 +891,7 @@ var de_DescribeBrokerEngineTypesCommand = /* @__PURE__ */ __name(async (output,
890
891
  const contents = (0, import_smithy_client.map)({
891
892
  $metadata: deserializeMetadata(output)
892
893
  });
893
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
894
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
894
895
  const doc = (0, import_smithy_client.take)(data, {
895
896
  BrokerEngineTypes: [, (_) => de___listOfBrokerEngineType(_, context), `brokerEngineTypes`],
896
897
  MaxResults: [, import_smithy_client.expectInt32, `maxResults`],
@@ -906,7 +907,7 @@ var de_DescribeBrokerInstanceOptionsCommand = /* @__PURE__ */ __name(async (outp
906
907
  const contents = (0, import_smithy_client.map)({
907
908
  $metadata: deserializeMetadata(output)
908
909
  });
909
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
910
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
910
911
  const doc = (0, import_smithy_client.take)(data, {
911
912
  BrokerInstanceOptions: [, (_) => de___listOfBrokerInstanceOption(_, context), `brokerInstanceOptions`],
912
913
  MaxResults: [, import_smithy_client.expectInt32, `maxResults`],
@@ -922,7 +923,7 @@ var de_DescribeConfigurationCommand = /* @__PURE__ */ __name(async (output, cont
922
923
  const contents = (0, import_smithy_client.map)({
923
924
  $metadata: deserializeMetadata(output)
924
925
  });
925
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
926
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
926
927
  const doc = (0, import_smithy_client.take)(data, {
927
928
  Arn: [, import_smithy_client.expectString, `arn`],
928
929
  AuthenticationStrategy: [, import_smithy_client.expectString, `authenticationStrategy`],
@@ -945,7 +946,7 @@ var de_DescribeConfigurationRevisionCommand = /* @__PURE__ */ __name(async (outp
945
946
  const contents = (0, import_smithy_client.map)({
946
947
  $metadata: deserializeMetadata(output)
947
948
  });
948
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
949
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
949
950
  const doc = (0, import_smithy_client.take)(data, {
950
951
  ConfigurationId: [, import_smithy_client.expectString, `configurationId`],
951
952
  Created: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `created`],
@@ -962,7 +963,7 @@ var de_DescribeUserCommand = /* @__PURE__ */ __name(async (output, context) => {
962
963
  const contents = (0, import_smithy_client.map)({
963
964
  $metadata: deserializeMetadata(output)
964
965
  });
965
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
966
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
966
967
  const doc = (0, import_smithy_client.take)(data, {
967
968
  BrokerId: [, import_smithy_client.expectString, `brokerId`],
968
969
  ConsoleAccess: [, import_smithy_client.expectBoolean, `consoleAccess`],
@@ -981,7 +982,7 @@ var de_ListBrokersCommand = /* @__PURE__ */ __name(async (output, context) => {
981
982
  const contents = (0, import_smithy_client.map)({
982
983
  $metadata: deserializeMetadata(output)
983
984
  });
984
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
985
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
985
986
  const doc = (0, import_smithy_client.take)(data, {
986
987
  BrokerSummaries: [, (_) => de___listOfBrokerSummary(_, context), `brokerSummaries`],
987
988
  NextToken: [, import_smithy_client.expectString, `nextToken`]
@@ -996,7 +997,7 @@ var de_ListConfigurationRevisionsCommand = /* @__PURE__ */ __name(async (output,
996
997
  const contents = (0, import_smithy_client.map)({
997
998
  $metadata: deserializeMetadata(output)
998
999
  });
999
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1000
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1000
1001
  const doc = (0, import_smithy_client.take)(data, {
1001
1002
  ConfigurationId: [, import_smithy_client.expectString, `configurationId`],
1002
1003
  MaxResults: [, import_smithy_client.expectInt32, `maxResults`],
@@ -1013,7 +1014,7 @@ var de_ListConfigurationsCommand = /* @__PURE__ */ __name(async (output, context
1013
1014
  const contents = (0, import_smithy_client.map)({
1014
1015
  $metadata: deserializeMetadata(output)
1015
1016
  });
1016
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1017
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1017
1018
  const doc = (0, import_smithy_client.take)(data, {
1018
1019
  Configurations: [, (_) => de___listOfConfiguration(_, context), `configurations`],
1019
1020
  MaxResults: [, import_smithy_client.expectInt32, `maxResults`],
@@ -1029,7 +1030,7 @@ var de_ListTagsCommand = /* @__PURE__ */ __name(async (output, context) => {
1029
1030
  const contents = (0, import_smithy_client.map)({
1030
1031
  $metadata: deserializeMetadata(output)
1031
1032
  });
1032
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1033
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1033
1034
  const doc = (0, import_smithy_client.take)(data, {
1034
1035
  Tags: [, import_smithy_client._json, `tags`]
1035
1036
  });
@@ -1043,7 +1044,7 @@ var de_ListUsersCommand = /* @__PURE__ */ __name(async (output, context) => {
1043
1044
  const contents = (0, import_smithy_client.map)({
1044
1045
  $metadata: deserializeMetadata(output)
1045
1046
  });
1046
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1047
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1047
1048
  const doc = (0, import_smithy_client.take)(data, {
1048
1049
  BrokerId: [, import_smithy_client.expectString, `brokerId`],
1049
1050
  MaxResults: [, import_smithy_client.expectInt32, `maxResults`],
@@ -1060,7 +1061,7 @@ var de_PromoteCommand = /* @__PURE__ */ __name(async (output, context) => {
1060
1061
  const contents = (0, import_smithy_client.map)({
1061
1062
  $metadata: deserializeMetadata(output)
1062
1063
  });
1063
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1064
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1064
1065
  const doc = (0, import_smithy_client.take)(data, {
1065
1066
  BrokerId: [, import_smithy_client.expectString, `brokerId`]
1066
1067
  });
@@ -1084,7 +1085,7 @@ var de_UpdateBrokerCommand = /* @__PURE__ */ __name(async (output, context) => {
1084
1085
  const contents = (0, import_smithy_client.map)({
1085
1086
  $metadata: deserializeMetadata(output)
1086
1087
  });
1087
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1088
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1088
1089
  const doc = (0, import_smithy_client.take)(data, {
1089
1090
  AuthenticationStrategy: [, import_smithy_client.expectString, `authenticationStrategy`],
1090
1091
  AutoMinorVersionUpgrade: [, import_smithy_client.expectBoolean, `autoMinorVersionUpgrade`],
@@ -1115,7 +1116,7 @@ var de_UpdateConfigurationCommand = /* @__PURE__ */ __name(async (output, contex
1115
1116
  const contents = (0, import_smithy_client.map)({
1116
1117
  $metadata: deserializeMetadata(output)
1117
1118
  });
1118
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1119
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1119
1120
  const doc = (0, import_smithy_client.take)(data, {
1120
1121
  Arn: [, import_smithy_client.expectString, `arn`],
1121
1122
  Created: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `created`],
@@ -1140,9 +1141,9 @@ var de_UpdateUserCommand = /* @__PURE__ */ __name(async (output, context) => {
1140
1141
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1141
1142
  const parsedOutput = {
1142
1143
  ...output,
1143
- body: await parseErrorBody(output.body, context)
1144
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1144
1145
  };
1145
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1146
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1146
1147
  switch (errorCode) {
1147
1148
  case "BadRequestException":
1148
1149
  case "com.amazonaws.mq#BadRequestException":
@@ -1553,7 +1554,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1553
1554
  extendedRequestId: output.headers["x-amz-id-2"],
1554
1555
  cfId: output.headers["x-amz-cf-id"]
1555
1556
  }), "deserializeMetadata");
1556
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1557
1557
  var _ET = "EngineType";
1558
1558
  var _HIT = "HostInstanceType";
1559
1559
  var _MR = "MaxResults";
@@ -1566,46 +1566,6 @@ var _mR = "maxResults";
1566
1566
  var _nT = "nextToken";
1567
1567
  var _sT = "storageType";
1568
1568
  var _tK = "tagKeys";
1569
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1570
- if (encoded.length) {
1571
- return JSON.parse(encoded);
1572
- }
1573
- return {};
1574
- }), "parseBody");
1575
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1576
- const value = await parseBody(errorBody, context);
1577
- value.message = value.message ?? value.Message;
1578
- return value;
1579
- }, "parseErrorBody");
1580
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1581
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1582
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1583
- let cleanValue = rawValue;
1584
- if (typeof cleanValue === "number") {
1585
- cleanValue = cleanValue.toString();
1586
- }
1587
- if (cleanValue.indexOf(",") >= 0) {
1588
- cleanValue = cleanValue.split(",")[0];
1589
- }
1590
- if (cleanValue.indexOf(":") >= 0) {
1591
- cleanValue = cleanValue.split(":")[0];
1592
- }
1593
- if (cleanValue.indexOf("#") >= 0) {
1594
- cleanValue = cleanValue.split("#")[1];
1595
- }
1596
- return cleanValue;
1597
- }, "sanitizeErrorCode");
1598
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1599
- if (headerKey !== void 0) {
1600
- return sanitizeErrorCode(output.headers[headerKey]);
1601
- }
1602
- if (data.code !== void 0) {
1603
- return sanitizeErrorCode(data.code);
1604
- }
1605
- if (data["__type"] !== void 0) {
1606
- return sanitizeErrorCode(data["__type"]);
1607
- }
1608
- }, "loadRestJsonErrorCode");
1609
1569
 
1610
1570
  // src/commands/CreateBrokerCommand.ts
1611
1571
  var _CreateBrokerCommand = class _CreateBrokerCommand 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, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
@@ -1175,43 +1176,3 @@ const _mR = "maxResults";
1175
1176
  const _nT = "nextToken";
1176
1177
  const _sT = "storageType";
1177
1178
  const _tK = "tagKeys";
1178
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1179
- if (encoded.length) {
1180
- return JSON.parse(encoded);
1181
- }
1182
- return {};
1183
- });
1184
- const parseErrorBody = async (errorBody, context) => {
1185
- const value = await parseBody(errorBody, context);
1186
- value.message = value.message ?? value.Message;
1187
- return value;
1188
- };
1189
- const loadRestJsonErrorCode = (output, data) => {
1190
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1191
- const sanitizeErrorCode = (rawValue) => {
1192
- let cleanValue = rawValue;
1193
- if (typeof cleanValue === "number") {
1194
- cleanValue = cleanValue.toString();
1195
- }
1196
- if (cleanValue.indexOf(",") >= 0) {
1197
- cleanValue = cleanValue.split(",")[0];
1198
- }
1199
- if (cleanValue.indexOf(":") >= 0) {
1200
- cleanValue = cleanValue.split(":")[0];
1201
- }
1202
- if (cleanValue.indexOf("#") >= 0) {
1203
- cleanValue = cleanValue.split("#")[1];
1204
- }
1205
- return cleanValue;
1206
- };
1207
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1208
- if (headerKey !== undefined) {
1209
- return sanitizeErrorCode(output.headers[headerKey]);
1210
- }
1211
- if (data.code !== undefined) {
1212
- return sanitizeErrorCode(data.code);
1213
- }
1214
- if (data["__type"] !== undefined) {
1215
- return sanitizeErrorCode(data["__type"]);
1216
- }
1217
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-mq",
3
3
  "description": "AWS SDK for JavaScript Mq 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-mq",
@@ -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",