@aws-sdk/client-amplifybackend 3.180.0 → 3.181.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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **clients:** make parseErrorBody async ([#3999](https://github.com/aws/aws-sdk-js-v3/issues/3999)) ([2558c93](https://github.com/aws/aws-sdk-js-v3/commit/2558c93c050357ac6dc47aa0452b15b12ebfd676))
12
+ * **clients:** populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/issues/3995)) ([02e47f1](https://github.com/aws/aws-sdk-js-v3/commit/02e47f14397ae0a5d2e2883350d038b307fdcdb4))
13
+
14
+
15
+
16
+
17
+
6
18
  # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
7
19
 
8
20
  **Note:** Version bump only for package @aws-sdk/client-amplifybackend
@@ -774,7 +774,7 @@ exports.deserializeAws_restJson1CloneBackendCommand = deserializeAws_restJson1Cl
774
774
  const deserializeAws_restJson1CloneBackendCommandError = async (output, context) => {
775
775
  const parsedOutput = {
776
776
  ...output,
777
- body: await parseBody(output.body, context),
777
+ body: await parseErrorBody(output.body, context),
778
778
  };
779
779
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
780
780
  switch (errorCode) {
@@ -832,7 +832,7 @@ exports.deserializeAws_restJson1CreateBackendCommand = deserializeAws_restJson1C
832
832
  const deserializeAws_restJson1CreateBackendCommandError = async (output, context) => {
833
833
  const parsedOutput = {
834
834
  ...output,
835
- body: await parseBody(output.body, context),
835
+ body: await parseErrorBody(output.body, context),
836
836
  };
837
837
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
838
838
  switch (errorCode) {
@@ -890,7 +890,7 @@ exports.deserializeAws_restJson1CreateBackendAPICommand = deserializeAws_restJso
890
890
  const deserializeAws_restJson1CreateBackendAPICommandError = async (output, context) => {
891
891
  const parsedOutput = {
892
892
  ...output,
893
- body: await parseBody(output.body, context),
893
+ body: await parseErrorBody(output.body, context),
894
894
  };
895
895
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
896
896
  switch (errorCode) {
@@ -948,7 +948,7 @@ exports.deserializeAws_restJson1CreateBackendAuthCommand = deserializeAws_restJs
948
948
  const deserializeAws_restJson1CreateBackendAuthCommandError = async (output, context) => {
949
949
  const parsedOutput = {
950
950
  ...output,
951
- body: await parseBody(output.body, context),
951
+ body: await parseErrorBody(output.body, context),
952
952
  };
953
953
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
954
954
  switch (errorCode) {
@@ -1000,7 +1000,7 @@ exports.deserializeAws_restJson1CreateBackendConfigCommand = deserializeAws_rest
1000
1000
  const deserializeAws_restJson1CreateBackendConfigCommandError = async (output, context) => {
1001
1001
  const parsedOutput = {
1002
1002
  ...output,
1003
- body: await parseBody(output.body, context),
1003
+ body: await parseErrorBody(output.body, context),
1004
1004
  };
1005
1005
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1006
1006
  switch (errorCode) {
@@ -1052,7 +1052,7 @@ exports.deserializeAws_restJson1CreateBackendStorageCommand = deserializeAws_res
1052
1052
  const deserializeAws_restJson1CreateBackendStorageCommandError = async (output, context) => {
1053
1053
  const parsedOutput = {
1054
1054
  ...output,
1055
- body: await parseBody(output.body, context),
1055
+ body: await parseErrorBody(output.body, context),
1056
1056
  };
1057
1057
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
1058
  switch (errorCode) {
@@ -1104,7 +1104,7 @@ exports.deserializeAws_restJson1CreateTokenCommand = deserializeAws_restJson1Cre
1104
1104
  const deserializeAws_restJson1CreateTokenCommandError = async (output, context) => {
1105
1105
  const parsedOutput = {
1106
1106
  ...output,
1107
- body: await parseBody(output.body, context),
1107
+ body: await parseErrorBody(output.body, context),
1108
1108
  };
1109
1109
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1110
1110
  switch (errorCode) {
@@ -1162,7 +1162,7 @@ exports.deserializeAws_restJson1DeleteBackendCommand = deserializeAws_restJson1D
1162
1162
  const deserializeAws_restJson1DeleteBackendCommandError = async (output, context) => {
1163
1163
  const parsedOutput = {
1164
1164
  ...output,
1165
- body: await parseBody(output.body, context),
1165
+ body: await parseErrorBody(output.body, context),
1166
1166
  };
1167
1167
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1168
1168
  switch (errorCode) {
@@ -1220,7 +1220,7 @@ exports.deserializeAws_restJson1DeleteBackendAPICommand = deserializeAws_restJso
1220
1220
  const deserializeAws_restJson1DeleteBackendAPICommandError = async (output, context) => {
1221
1221
  const parsedOutput = {
1222
1222
  ...output,
1223
- body: await parseBody(output.body, context),
1223
+ body: await parseErrorBody(output.body, context),
1224
1224
  };
1225
1225
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1226
1226
  switch (errorCode) {
@@ -1278,7 +1278,7 @@ exports.deserializeAws_restJson1DeleteBackendAuthCommand = deserializeAws_restJs
1278
1278
  const deserializeAws_restJson1DeleteBackendAuthCommandError = async (output, context) => {
1279
1279
  const parsedOutput = {
1280
1280
  ...output,
1281
- body: await parseBody(output.body, context),
1281
+ body: await parseErrorBody(output.body, context),
1282
1282
  };
1283
1283
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1284
1284
  switch (errorCode) {
@@ -1330,7 +1330,7 @@ exports.deserializeAws_restJson1DeleteBackendStorageCommand = deserializeAws_res
1330
1330
  const deserializeAws_restJson1DeleteBackendStorageCommandError = async (output, context) => {
1331
1331
  const parsedOutput = {
1332
1332
  ...output,
1333
- body: await parseBody(output.body, context),
1333
+ body: await parseErrorBody(output.body, context),
1334
1334
  };
1335
1335
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1336
1336
  switch (errorCode) {
@@ -1373,7 +1373,7 @@ exports.deserializeAws_restJson1DeleteTokenCommand = deserializeAws_restJson1Del
1373
1373
  const deserializeAws_restJson1DeleteTokenCommandError = async (output, context) => {
1374
1374
  const parsedOutput = {
1375
1375
  ...output,
1376
- body: await parseBody(output.body, context),
1376
+ body: await parseErrorBody(output.body, context),
1377
1377
  };
1378
1378
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1379
1379
  switch (errorCode) {
@@ -1431,7 +1431,7 @@ exports.deserializeAws_restJson1GenerateBackendAPIModelsCommand = deserializeAws
1431
1431
  const deserializeAws_restJson1GenerateBackendAPIModelsCommandError = async (output, context) => {
1432
1432
  const parsedOutput = {
1433
1433
  ...output,
1434
- body: await parseBody(output.body, context),
1434
+ body: await parseErrorBody(output.body, context),
1435
1435
  };
1436
1436
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1437
1437
  switch (errorCode) {
@@ -1492,7 +1492,7 @@ exports.deserializeAws_restJson1GetBackendCommand = deserializeAws_restJson1GetB
1492
1492
  const deserializeAws_restJson1GetBackendCommandError = async (output, context) => {
1493
1493
  const parsedOutput = {
1494
1494
  ...output,
1495
- body: await parseBody(output.body, context),
1495
+ body: await parseErrorBody(output.body, context),
1496
1496
  };
1497
1497
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1498
1498
  switch (errorCode) {
@@ -1547,7 +1547,7 @@ exports.deserializeAws_restJson1GetBackendAPICommand = deserializeAws_restJson1G
1547
1547
  const deserializeAws_restJson1GetBackendAPICommandError = async (output, context) => {
1548
1548
  const parsedOutput = {
1549
1549
  ...output,
1550
- body: await parseBody(output.body, context),
1550
+ body: await parseErrorBody(output.body, context),
1551
1551
  };
1552
1552
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1553
1553
  switch (errorCode) {
@@ -1593,7 +1593,7 @@ exports.deserializeAws_restJson1GetBackendAPIModelsCommand = deserializeAws_rest
1593
1593
  const deserializeAws_restJson1GetBackendAPIModelsCommandError = async (output, context) => {
1594
1594
  const parsedOutput = {
1595
1595
  ...output,
1596
- body: await parseBody(output.body, context),
1596
+ body: await parseErrorBody(output.body, context),
1597
1597
  };
1598
1598
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1599
1599
  switch (errorCode) {
@@ -1648,7 +1648,7 @@ exports.deserializeAws_restJson1GetBackendAuthCommand = deserializeAws_restJson1
1648
1648
  const deserializeAws_restJson1GetBackendAuthCommandError = async (output, context) => {
1649
1649
  const parsedOutput = {
1650
1650
  ...output,
1651
- body: await parseBody(output.body, context),
1651
+ body: await parseErrorBody(output.body, context),
1652
1652
  };
1653
1653
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1654
1654
  switch (errorCode) {
@@ -1712,7 +1712,7 @@ exports.deserializeAws_restJson1GetBackendJobCommand = deserializeAws_restJson1G
1712
1712
  const deserializeAws_restJson1GetBackendJobCommandError = async (output, context) => {
1713
1713
  const parsedOutput = {
1714
1714
  ...output,
1715
- body: await parseBody(output.body, context),
1715
+ body: await parseErrorBody(output.body, context),
1716
1716
  };
1717
1717
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1718
1718
  switch (errorCode) {
@@ -1764,7 +1764,7 @@ exports.deserializeAws_restJson1GetBackendStorageCommand = deserializeAws_restJs
1764
1764
  const deserializeAws_restJson1GetBackendStorageCommandError = async (output, context) => {
1765
1765
  const parsedOutput = {
1766
1766
  ...output,
1767
- body: await parseBody(output.body, context),
1767
+ body: await parseErrorBody(output.body, context),
1768
1768
  };
1769
1769
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1770
1770
  switch (errorCode) {
@@ -1816,7 +1816,7 @@ exports.deserializeAws_restJson1GetTokenCommand = deserializeAws_restJson1GetTok
1816
1816
  const deserializeAws_restJson1GetTokenCommandError = async (output, context) => {
1817
1817
  const parsedOutput = {
1818
1818
  ...output,
1819
- body: await parseBody(output.body, context),
1819
+ body: await parseErrorBody(output.body, context),
1820
1820
  };
1821
1821
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1822
1822
  switch (errorCode) {
@@ -1874,7 +1874,7 @@ exports.deserializeAws_restJson1ImportBackendAuthCommand = deserializeAws_restJs
1874
1874
  const deserializeAws_restJson1ImportBackendAuthCommandError = async (output, context) => {
1875
1875
  const parsedOutput = {
1876
1876
  ...output,
1877
- body: await parseBody(output.body, context),
1877
+ body: await parseErrorBody(output.body, context),
1878
1878
  };
1879
1879
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1880
1880
  switch (errorCode) {
@@ -1926,7 +1926,7 @@ exports.deserializeAws_restJson1ImportBackendStorageCommand = deserializeAws_res
1926
1926
  const deserializeAws_restJson1ImportBackendStorageCommandError = async (output, context) => {
1927
1927
  const parsedOutput = {
1928
1928
  ...output,
1929
- body: await parseBody(output.body, context),
1929
+ body: await parseErrorBody(output.body, context),
1930
1930
  };
1931
1931
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1932
1932
  switch (errorCode) {
@@ -1972,7 +1972,7 @@ exports.deserializeAws_restJson1ListBackendJobsCommand = deserializeAws_restJson
1972
1972
  const deserializeAws_restJson1ListBackendJobsCommandError = async (output, context) => {
1973
1973
  const parsedOutput = {
1974
1974
  ...output,
1975
- body: await parseBody(output.body, context),
1975
+ body: await parseErrorBody(output.body, context),
1976
1976
  };
1977
1977
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1978
1978
  switch (errorCode) {
@@ -2018,7 +2018,7 @@ exports.deserializeAws_restJson1ListS3BucketsCommand = deserializeAws_restJson1L
2018
2018
  const deserializeAws_restJson1ListS3BucketsCommandError = async (output, context) => {
2019
2019
  const parsedOutput = {
2020
2020
  ...output,
2021
- body: await parseBody(output.body, context),
2021
+ body: await parseErrorBody(output.body, context),
2022
2022
  };
2023
2023
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2024
2024
  switch (errorCode) {
@@ -2073,7 +2073,7 @@ exports.deserializeAws_restJson1RemoveAllBackendsCommand = deserializeAws_restJs
2073
2073
  const deserializeAws_restJson1RemoveAllBackendsCommandError = async (output, context) => {
2074
2074
  const parsedOutput = {
2075
2075
  ...output,
2076
- body: await parseBody(output.body, context),
2076
+ body: await parseErrorBody(output.body, context),
2077
2077
  };
2078
2078
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2079
2079
  switch (errorCode) {
@@ -2116,7 +2116,7 @@ exports.deserializeAws_restJson1RemoveBackendConfigCommand = deserializeAws_rest
2116
2116
  const deserializeAws_restJson1RemoveBackendConfigCommandError = async (output, context) => {
2117
2117
  const parsedOutput = {
2118
2118
  ...output,
2119
- body: await parseBody(output.body, context),
2119
+ body: await parseErrorBody(output.body, context),
2120
2120
  };
2121
2121
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2122
2122
  switch (errorCode) {
@@ -2174,7 +2174,7 @@ exports.deserializeAws_restJson1UpdateBackendAPICommand = deserializeAws_restJso
2174
2174
  const deserializeAws_restJson1UpdateBackendAPICommandError = async (output, context) => {
2175
2175
  const parsedOutput = {
2176
2176
  ...output,
2177
- body: await parseBody(output.body, context),
2177
+ body: await parseErrorBody(output.body, context),
2178
2178
  };
2179
2179
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2180
2180
  switch (errorCode) {
@@ -2232,7 +2232,7 @@ exports.deserializeAws_restJson1UpdateBackendAuthCommand = deserializeAws_restJs
2232
2232
  const deserializeAws_restJson1UpdateBackendAuthCommandError = async (output, context) => {
2233
2233
  const parsedOutput = {
2234
2234
  ...output,
2235
- body: await parseBody(output.body, context),
2235
+ body: await parseErrorBody(output.body, context),
2236
2236
  };
2237
2237
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2238
2238
  switch (errorCode) {
@@ -2284,7 +2284,7 @@ exports.deserializeAws_restJson1UpdateBackendConfigCommand = deserializeAws_rest
2284
2284
  const deserializeAws_restJson1UpdateBackendConfigCommandError = async (output, context) => {
2285
2285
  const parsedOutput = {
2286
2286
  ...output,
2287
- body: await parseBody(output.body, context),
2287
+ body: await parseErrorBody(output.body, context),
2288
2288
  };
2289
2289
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2290
2290
  switch (errorCode) {
@@ -2348,7 +2348,7 @@ exports.deserializeAws_restJson1UpdateBackendJobCommand = deserializeAws_restJso
2348
2348
  const deserializeAws_restJson1UpdateBackendJobCommandError = async (output, context) => {
2349
2349
  const parsedOutput = {
2350
2350
  ...output,
2351
- body: await parseBody(output.body, context),
2351
+ body: await parseErrorBody(output.body, context),
2352
2352
  };
2353
2353
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2354
2354
  switch (errorCode) {
@@ -2400,7 +2400,7 @@ exports.deserializeAws_restJson1UpdateBackendStorageCommand = deserializeAws_res
2400
2400
  const deserializeAws_restJson1UpdateBackendStorageCommandError = async (output, context) => {
2401
2401
  const parsedOutput = {
2402
2402
  ...output,
2403
- body: await parseBody(output.body, context),
2403
+ body: await parseErrorBody(output.body, context),
2404
2404
  };
2405
2405
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2406
2406
  switch (errorCode) {
@@ -3188,6 +3188,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
3188
3188
  }
3189
3189
  return {};
3190
3190
  });
3191
+ const parseErrorBody = async (errorBody, context) => {
3192
+ var _a;
3193
+ const value = await parseBody(errorBody, context);
3194
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
3195
+ return value;
3196
+ };
3191
3197
  const loadRestJsonErrorCode = (output, data) => {
3192
3198
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
3193
3199
  const sanitizeErrorCode = (rawValue) => {
@@ -865,7 +865,7 @@ var deserializeAws_restJson1CloneBackendCommandError = function (output, context
865
865
  case 0:
866
866
  _a = [__assign({}, output)];
867
867
  _c = {};
868
- return [4, parseBody(output.body, context)];
868
+ return [4, parseErrorBody(output.body, context)];
869
869
  case 1:
870
870
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
871
871
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -948,7 +948,7 @@ var deserializeAws_restJson1CreateBackendCommandError = function (output, contex
948
948
  case 0:
949
949
  _a = [__assign({}, output)];
950
950
  _c = {};
951
- return [4, parseBody(output.body, context)];
951
+ return [4, parseErrorBody(output.body, context)];
952
952
  case 1:
953
953
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
954
954
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1031,7 +1031,7 @@ var deserializeAws_restJson1CreateBackendAPICommandError = function (output, con
1031
1031
  case 0:
1032
1032
  _a = [__assign({}, output)];
1033
1033
  _c = {};
1034
- return [4, parseBody(output.body, context)];
1034
+ return [4, parseErrorBody(output.body, context)];
1035
1035
  case 1:
1036
1036
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1037
1037
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1114,7 +1114,7 @@ var deserializeAws_restJson1CreateBackendAuthCommandError = function (output, co
1114
1114
  case 0:
1115
1115
  _a = [__assign({}, output)];
1116
1116
  _c = {};
1117
- return [4, parseBody(output.body, context)];
1117
+ return [4, parseErrorBody(output.body, context)];
1118
1118
  case 1:
1119
1119
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1120
1120
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1191,7 +1191,7 @@ var deserializeAws_restJson1CreateBackendConfigCommandError = function (output,
1191
1191
  case 0:
1192
1192
  _a = [__assign({}, output)];
1193
1193
  _c = {};
1194
- return [4, parseBody(output.body, context)];
1194
+ return [4, parseErrorBody(output.body, context)];
1195
1195
  case 1:
1196
1196
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1197
1197
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1268,7 +1268,7 @@ var deserializeAws_restJson1CreateBackendStorageCommandError = function (output,
1268
1268
  case 0:
1269
1269
  _a = [__assign({}, output)];
1270
1270
  _c = {};
1271
- return [4, parseBody(output.body, context)];
1271
+ return [4, parseErrorBody(output.body, context)];
1272
1272
  case 1:
1273
1273
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1274
1274
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1345,7 +1345,7 @@ var deserializeAws_restJson1CreateTokenCommandError = function (output, context)
1345
1345
  case 0:
1346
1346
  _a = [__assign({}, output)];
1347
1347
  _c = {};
1348
- return [4, parseBody(output.body, context)];
1348
+ return [4, parseErrorBody(output.body, context)];
1349
1349
  case 1:
1350
1350
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1351
1351
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1428,7 +1428,7 @@ var deserializeAws_restJson1DeleteBackendCommandError = function (output, contex
1428
1428
  case 0:
1429
1429
  _a = [__assign({}, output)];
1430
1430
  _c = {};
1431
- return [4, parseBody(output.body, context)];
1431
+ return [4, parseErrorBody(output.body, context)];
1432
1432
  case 1:
1433
1433
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1434
1434
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1511,7 +1511,7 @@ var deserializeAws_restJson1DeleteBackendAPICommandError = function (output, con
1511
1511
  case 0:
1512
1512
  _a = [__assign({}, output)];
1513
1513
  _c = {};
1514
- return [4, parseBody(output.body, context)];
1514
+ return [4, parseErrorBody(output.body, context)];
1515
1515
  case 1:
1516
1516
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1517
1517
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1594,7 +1594,7 @@ var deserializeAws_restJson1DeleteBackendAuthCommandError = function (output, co
1594
1594
  case 0:
1595
1595
  _a = [__assign({}, output)];
1596
1596
  _c = {};
1597
- return [4, parseBody(output.body, context)];
1597
+ return [4, parseErrorBody(output.body, context)];
1598
1598
  case 1:
1599
1599
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1600
1600
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1671,7 +1671,7 @@ var deserializeAws_restJson1DeleteBackendStorageCommandError = function (output,
1671
1671
  case 0:
1672
1672
  _a = [__assign({}, output)];
1673
1673
  _c = {};
1674
- return [4, parseBody(output.body, context)];
1674
+ return [4, parseErrorBody(output.body, context)];
1675
1675
  case 1:
1676
1676
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1677
1677
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1739,7 +1739,7 @@ var deserializeAws_restJson1DeleteTokenCommandError = function (output, context)
1739
1739
  case 0:
1740
1740
  _a = [__assign({}, output)];
1741
1741
  _c = {};
1742
- return [4, parseBody(output.body, context)];
1742
+ return [4, parseErrorBody(output.body, context)];
1743
1743
  case 1:
1744
1744
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1745
1745
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1822,7 +1822,7 @@ var deserializeAws_restJson1GenerateBackendAPIModelsCommandError = function (out
1822
1822
  case 0:
1823
1823
  _a = [__assign({}, output)];
1824
1824
  _c = {};
1825
- return [4, parseBody(output.body, context)];
1825
+ return [4, parseErrorBody(output.body, context)];
1826
1826
  case 1:
1827
1827
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1828
1828
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1908,7 +1908,7 @@ var deserializeAws_restJson1GetBackendCommandError = function (output, context)
1908
1908
  case 0:
1909
1909
  _a = [__assign({}, output)];
1910
1910
  _c = {};
1911
- return [4, parseBody(output.body, context)];
1911
+ return [4, parseErrorBody(output.body, context)];
1912
1912
  case 1:
1913
1913
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1914
1914
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -1988,7 +1988,7 @@ var deserializeAws_restJson1GetBackendAPICommandError = function (output, contex
1988
1988
  case 0:
1989
1989
  _a = [__assign({}, output)];
1990
1990
  _c = {};
1991
- return [4, parseBody(output.body, context)];
1991
+ return [4, parseErrorBody(output.body, context)];
1992
1992
  case 1:
1993
1993
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1994
1994
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2059,7 +2059,7 @@ var deserializeAws_restJson1GetBackendAPIModelsCommandError = function (output,
2059
2059
  case 0:
2060
2060
  _a = [__assign({}, output)];
2061
2061
  _c = {};
2062
- return [4, parseBody(output.body, context)];
2062
+ return [4, parseErrorBody(output.body, context)];
2063
2063
  case 1:
2064
2064
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2065
2065
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2139,7 +2139,7 @@ var deserializeAws_restJson1GetBackendAuthCommandError = function (output, conte
2139
2139
  case 0:
2140
2140
  _a = [__assign({}, output)];
2141
2141
  _c = {};
2142
- return [4, parseBody(output.body, context)];
2142
+ return [4, parseErrorBody(output.body, context)];
2143
2143
  case 1:
2144
2144
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2145
2145
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2228,7 +2228,7 @@ var deserializeAws_restJson1GetBackendJobCommandError = function (output, contex
2228
2228
  case 0:
2229
2229
  _a = [__assign({}, output)];
2230
2230
  _c = {};
2231
- return [4, parseBody(output.body, context)];
2231
+ return [4, parseErrorBody(output.body, context)];
2232
2232
  case 1:
2233
2233
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2234
2234
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2305,7 +2305,7 @@ var deserializeAws_restJson1GetBackendStorageCommandError = function (output, co
2305
2305
  case 0:
2306
2306
  _a = [__assign({}, output)];
2307
2307
  _c = {};
2308
- return [4, parseBody(output.body, context)];
2308
+ return [4, parseErrorBody(output.body, context)];
2309
2309
  case 1:
2310
2310
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2311
2311
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2382,7 +2382,7 @@ var deserializeAws_restJson1GetTokenCommandError = function (output, context) {
2382
2382
  case 0:
2383
2383
  _a = [__assign({}, output)];
2384
2384
  _c = {};
2385
- return [4, parseBody(output.body, context)];
2385
+ return [4, parseErrorBody(output.body, context)];
2386
2386
  case 1:
2387
2387
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2388
2388
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2465,7 +2465,7 @@ var deserializeAws_restJson1ImportBackendAuthCommandError = function (output, co
2465
2465
  case 0:
2466
2466
  _a = [__assign({}, output)];
2467
2467
  _c = {};
2468
- return [4, parseBody(output.body, context)];
2468
+ return [4, parseErrorBody(output.body, context)];
2469
2469
  case 1:
2470
2470
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2471
2471
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2542,7 +2542,7 @@ var deserializeAws_restJson1ImportBackendStorageCommandError = function (output,
2542
2542
  case 0:
2543
2543
  _a = [__assign({}, output)];
2544
2544
  _c = {};
2545
- return [4, parseBody(output.body, context)];
2545
+ return [4, parseErrorBody(output.body, context)];
2546
2546
  case 1:
2547
2547
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2548
2548
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2613,7 +2613,7 @@ var deserializeAws_restJson1ListBackendJobsCommandError = function (output, cont
2613
2613
  case 0:
2614
2614
  _a = [__assign({}, output)];
2615
2615
  _c = {};
2616
- return [4, parseBody(output.body, context)];
2616
+ return [4, parseErrorBody(output.body, context)];
2617
2617
  case 1:
2618
2618
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2619
2619
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2684,7 +2684,7 @@ var deserializeAws_restJson1ListS3BucketsCommandError = function (output, contex
2684
2684
  case 0:
2685
2685
  _a = [__assign({}, output)];
2686
2686
  _c = {};
2687
- return [4, parseBody(output.body, context)];
2687
+ return [4, parseErrorBody(output.body, context)];
2688
2688
  case 1:
2689
2689
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2690
2690
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2764,7 +2764,7 @@ var deserializeAws_restJson1RemoveAllBackendsCommandError = function (output, co
2764
2764
  case 0:
2765
2765
  _a = [__assign({}, output)];
2766
2766
  _c = {};
2767
- return [4, parseBody(output.body, context)];
2767
+ return [4, parseErrorBody(output.body, context)];
2768
2768
  case 1:
2769
2769
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2770
2770
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2832,7 +2832,7 @@ var deserializeAws_restJson1RemoveBackendConfigCommandError = function (output,
2832
2832
  case 0:
2833
2833
  _a = [__assign({}, output)];
2834
2834
  _c = {};
2835
- return [4, parseBody(output.body, context)];
2835
+ return [4, parseErrorBody(output.body, context)];
2836
2836
  case 1:
2837
2837
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2838
2838
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2915,7 +2915,7 @@ var deserializeAws_restJson1UpdateBackendAPICommandError = function (output, con
2915
2915
  case 0:
2916
2916
  _a = [__assign({}, output)];
2917
2917
  _c = {};
2918
- return [4, parseBody(output.body, context)];
2918
+ return [4, parseErrorBody(output.body, context)];
2919
2919
  case 1:
2920
2920
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
2921
2921
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -2998,7 +2998,7 @@ var deserializeAws_restJson1UpdateBackendAuthCommandError = function (output, co
2998
2998
  case 0:
2999
2999
  _a = [__assign({}, output)];
3000
3000
  _c = {};
3001
- return [4, parseBody(output.body, context)];
3001
+ return [4, parseErrorBody(output.body, context)];
3002
3002
  case 1:
3003
3003
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3004
3004
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -3075,7 +3075,7 @@ var deserializeAws_restJson1UpdateBackendConfigCommandError = function (output,
3075
3075
  case 0:
3076
3076
  _a = [__assign({}, output)];
3077
3077
  _c = {};
3078
- return [4, parseBody(output.body, context)];
3078
+ return [4, parseErrorBody(output.body, context)];
3079
3079
  case 1:
3080
3080
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3081
3081
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -3164,7 +3164,7 @@ var deserializeAws_restJson1UpdateBackendJobCommandError = function (output, con
3164
3164
  case 0:
3165
3165
  _a = [__assign({}, output)];
3166
3166
  _c = {};
3167
- return [4, parseBody(output.body, context)];
3167
+ return [4, parseErrorBody(output.body, context)];
3168
3168
  case 1:
3169
3169
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3170
3170
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -3241,7 +3241,7 @@ var deserializeAws_restJson1UpdateBackendStorageCommandError = function (output,
3241
3241
  case 0:
3242
3242
  _a = [__assign({}, output)];
3243
3243
  _c = {};
3244
- return [4, parseBody(output.body, context)];
3244
+ return [4, parseErrorBody(output.body, context)];
3245
3245
  case 1:
3246
3246
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
3247
3247
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -3918,6 +3918,19 @@ var parseBody = function (streamBody, context) {
3918
3918
  return {};
3919
3919
  });
3920
3920
  };
3921
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
3922
+ var value;
3923
+ var _a;
3924
+ return __generator(this, function (_b) {
3925
+ switch (_b.label) {
3926
+ case 0: return [4, parseBody(errorBody, context)];
3927
+ case 1:
3928
+ value = _b.sent();
3929
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
3930
+ return [2, value];
3931
+ }
3932
+ });
3933
+ }); };
3921
3934
  var loadRestJsonErrorCode = function (output, data) {
3922
3935
  var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
3923
3936
  var sanitizeErrorCode = function (rawValue) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-amplifybackend",
3
3
  "description": "AWS SDK for JavaScript Amplifybackend Client for Node.js, Browser and React Native",
4
- "version": "3.180.0",
4
+ "version": "3.181.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -19,9 +19,9 @@
19
19
  "dependencies": {
20
20
  "@aws-crypto/sha256-browser": "2.0.0",
21
21
  "@aws-crypto/sha256-js": "2.0.0",
22
- "@aws-sdk/client-sts": "3.180.0",
22
+ "@aws-sdk/client-sts": "3.181.0",
23
23
  "@aws-sdk/config-resolver": "3.178.0",
24
- "@aws-sdk/credential-provider-node": "3.180.0",
24
+ "@aws-sdk/credential-provider-node": "3.181.0",
25
25
  "@aws-sdk/fetch-http-handler": "3.178.0",
26
26
  "@aws-sdk/hash-node": "3.178.0",
27
27
  "@aws-sdk/invalid-dependency": "3.178.0",