@aws-sdk/client-sso 3.178.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,26 @@
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
+
18
+ # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
19
+
20
+ **Note:** Version bump only for package @aws-sdk/client-sso
21
+
22
+
23
+
24
+
25
+
6
26
  # [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23)
7
27
 
8
28
  **Note:** Version bump only for package @aws-sdk/client-sso
@@ -110,7 +110,7 @@ exports.deserializeAws_restJson1GetRoleCredentialsCommand = deserializeAws_restJ
110
110
  const deserializeAws_restJson1GetRoleCredentialsCommandError = async (output, context) => {
111
111
  const parsedOutput = {
112
112
  ...output,
113
- body: await parseBody(output.body, context),
113
+ body: await parseErrorBody(output.body, context),
114
114
  };
115
115
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
116
116
  switch (errorCode) {
@@ -156,7 +156,7 @@ exports.deserializeAws_restJson1ListAccountRolesCommand = deserializeAws_restJso
156
156
  const deserializeAws_restJson1ListAccountRolesCommandError = async (output, context) => {
157
157
  const parsedOutput = {
158
158
  ...output,
159
- body: await parseBody(output.body, context),
159
+ body: await parseErrorBody(output.body, context),
160
160
  };
161
161
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
162
162
  switch (errorCode) {
@@ -202,7 +202,7 @@ exports.deserializeAws_restJson1ListAccountsCommand = deserializeAws_restJson1Li
202
202
  const deserializeAws_restJson1ListAccountsCommandError = async (output, context) => {
203
203
  const parsedOutput = {
204
204
  ...output,
205
- body: await parseBody(output.body, context),
205
+ body: await parseErrorBody(output.body, context),
206
206
  };
207
207
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
208
208
  switch (errorCode) {
@@ -242,7 +242,7 @@ exports.deserializeAws_restJson1LogoutCommand = deserializeAws_restJson1LogoutCo
242
242
  const deserializeAws_restJson1LogoutCommandError = async (output, context) => {
243
243
  const parsedOutput = {
244
244
  ...output,
245
- body: await parseBody(output.body, context),
245
+ body: await parseErrorBody(output.body, context),
246
246
  };
247
247
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
248
248
  switch (errorCode) {
@@ -384,6 +384,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
384
384
  }
385
385
  return {};
386
386
  });
387
+ const parseErrorBody = async (errorBody, context) => {
388
+ var _a;
389
+ const value = await parseBody(errorBody, context);
390
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
391
+ return value;
392
+ };
387
393
  const loadRestJsonErrorCode = (output, data) => {
388
394
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
389
395
  const sanitizeErrorCode = (rawValue) => {
@@ -142,7 +142,7 @@ var deserializeAws_restJson1GetRoleCredentialsCommandError = function (output, c
142
142
  case 0:
143
143
  _a = [__assign({}, output)];
144
144
  _c = {};
145
- return [4, parseBody(output.body, context)];
145
+ return [4, parseErrorBody(output.body, context)];
146
146
  case 1:
147
147
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
148
148
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -213,7 +213,7 @@ var deserializeAws_restJson1ListAccountRolesCommandError = function (output, con
213
213
  case 0:
214
214
  _a = [__assign({}, output)];
215
215
  _c = {};
216
- return [4, parseBody(output.body, context)];
216
+ return [4, parseErrorBody(output.body, context)];
217
217
  case 1:
218
218
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
219
219
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -284,7 +284,7 @@ var deserializeAws_restJson1ListAccountsCommandError = function (output, context
284
284
  case 0:
285
285
  _a = [__assign({}, output)];
286
286
  _c = {};
287
- return [4, parseBody(output.body, context)];
287
+ return [4, parseErrorBody(output.body, context)];
288
288
  case 1:
289
289
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
290
290
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -347,7 +347,7 @@ var deserializeAws_restJson1LogoutCommandError = function (output, context) { re
347
347
  case 0:
348
348
  _a = [__assign({}, output)];
349
349
  _c = {};
350
- return [4, parseBody(output.body, context)];
350
+ return [4, parseErrorBody(output.body, context)];
351
351
  case 1:
352
352
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
353
353
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
@@ -506,6 +506,19 @@ var parseBody = function (streamBody, context) {
506
506
  return {};
507
507
  });
508
508
  };
509
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
510
+ var value;
511
+ var _a;
512
+ return __generator(this, function (_b) {
513
+ switch (_b.label) {
514
+ case 0: return [4, parseBody(errorBody, context)];
515
+ case 1:
516
+ value = _b.sent();
517
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
518
+ return [2, value];
519
+ }
520
+ });
521
+ }); };
509
522
  var loadRestJsonErrorCode = function (output, data) {
510
523
  var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
511
524
  var sanitizeErrorCode = function (rawValue) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sso",
3
3
  "description": "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
4
- "version": "3.178.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",
@@ -34,15 +34,15 @@
34
34
  "@aws-sdk/node-config-provider": "3.178.0",
35
35
  "@aws-sdk/node-http-handler": "3.178.0",
36
36
  "@aws-sdk/protocol-http": "3.178.0",
37
- "@aws-sdk/smithy-client": "3.178.0",
37
+ "@aws-sdk/smithy-client": "3.180.0",
38
38
  "@aws-sdk/types": "3.178.0",
39
39
  "@aws-sdk/url-parser": "3.178.0",
40
40
  "@aws-sdk/util-base64-browser": "3.170.0",
41
41
  "@aws-sdk/util-base64-node": "3.170.0",
42
42
  "@aws-sdk/util-body-length-browser": "3.170.0",
43
43
  "@aws-sdk/util-body-length-node": "3.170.0",
44
- "@aws-sdk/util-defaults-mode-browser": "3.178.0",
45
- "@aws-sdk/util-defaults-mode-node": "3.178.0",
44
+ "@aws-sdk/util-defaults-mode-browser": "3.180.0",
45
+ "@aws-sdk/util-defaults-mode-node": "3.180.0",
46
46
  "@aws-sdk/util-user-agent-browser": "3.178.0",
47
47
  "@aws-sdk/util-user-agent-node": "3.178.0",
48
48
  "@aws-sdk/util-utf8-browser": "3.170.0",