@aws-sdk/client-sso 3.523.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
@@ -309,6 +309,7 @@ var LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
309
309
  }), "LogoutRequestFilterSensitiveLog");
310
310
 
311
311
  // src/protocols/Aws_restJson1.ts
312
+ var import_core2 = require("@aws-sdk/core");
312
313
 
313
314
 
314
315
  var se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -371,7 +372,7 @@ var de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context
371
372
  const contents = (0, import_smithy_client.map)({
372
373
  $metadata: deserializeMetadata(output)
373
374
  });
374
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
375
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
375
376
  const doc = (0, import_smithy_client.take)(data, {
376
377
  roleCredentials: import_smithy_client._json
377
378
  });
@@ -385,7 +386,7 @@ var de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context)
385
386
  const contents = (0, import_smithy_client.map)({
386
387
  $metadata: deserializeMetadata(output)
387
388
  });
388
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
389
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
389
390
  const doc = (0, import_smithy_client.take)(data, {
390
391
  nextToken: import_smithy_client.expectString,
391
392
  roleList: import_smithy_client._json
@@ -400,7 +401,7 @@ var de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context) => {
400
401
  const contents = (0, import_smithy_client.map)({
401
402
  $metadata: deserializeMetadata(output)
402
403
  });
403
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
404
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
404
405
  const doc = (0, import_smithy_client.take)(data, {
405
406
  accountList: import_smithy_client._json,
406
407
  nextToken: import_smithy_client.expectString
@@ -421,9 +422,9 @@ var de_LogoutCommand = /* @__PURE__ */ __name(async (output, context) => {
421
422
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
422
423
  const parsedOutput = {
423
424
  ...output,
424
- body: await parseErrorBody(output.body, context)
425
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
425
426
  };
426
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
427
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
427
428
  switch (errorCode) {
428
429
  case "InvalidRequestException":
429
430
  case "com.amazonaws.sso#InvalidRequestException":
@@ -505,7 +506,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
505
506
  extendedRequestId: output.headers["x-amz-id-2"],
506
507
  cfId: output.headers["x-amz-cf-id"]
507
508
  }), "deserializeMetadata");
508
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
509
509
  var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
510
510
  var _aI = "accountId";
511
511
  var _aT = "accessToken";
@@ -517,46 +517,6 @@ var _nt = "next_token";
517
517
  var _rN = "roleName";
518
518
  var _rn = "role_name";
519
519
  var _xasbt = "x-amz-sso_bearer_token";
520
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
521
- if (encoded.length) {
522
- return JSON.parse(encoded);
523
- }
524
- return {};
525
- }), "parseBody");
526
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
527
- const value = await parseBody(errorBody, context);
528
- value.message = value.message ?? value.Message;
529
- return value;
530
- }, "parseErrorBody");
531
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
532
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
533
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
534
- let cleanValue = rawValue;
535
- if (typeof cleanValue === "number") {
536
- cleanValue = cleanValue.toString();
537
- }
538
- if (cleanValue.indexOf(",") >= 0) {
539
- cleanValue = cleanValue.split(",")[0];
540
- }
541
- if (cleanValue.indexOf(":") >= 0) {
542
- cleanValue = cleanValue.split(":")[0];
543
- }
544
- if (cleanValue.indexOf("#") >= 0) {
545
- cleanValue = cleanValue.split("#")[1];
546
- }
547
- return cleanValue;
548
- }, "sanitizeErrorCode");
549
- const headerKey = findKey(output.headers, "x-amzn-errortype");
550
- if (headerKey !== void 0) {
551
- return sanitizeErrorCode(output.headers[headerKey]);
552
- }
553
- if (data.code !== void 0) {
554
- return sanitizeErrorCode(data.code);
555
- }
556
- if (data["__type"] !== void 0) {
557
- return sanitizeErrorCode(data["__type"]);
558
- }
559
- }, "loadRestJsonErrorCode");
560
520
 
561
521
  // src/commands/GetRoleCredentialsCommand.ts
562
522
  var _GetRoleCredentialsCommand = class _GetRoleCredentialsCommand 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 { InvalidRequestException, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0";
@@ -212,43 +213,3 @@ const _nt = "next_token";
212
213
  const _rN = "roleName";
213
214
  const _rn = "role_name";
214
215
  const _xasbt = "x-amz-sso_bearer_token";
215
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
216
- if (encoded.length) {
217
- return JSON.parse(encoded);
218
- }
219
- return {};
220
- });
221
- const parseErrorBody = async (errorBody, context) => {
222
- const value = await parseBody(errorBody, context);
223
- value.message = value.message ?? value.Message;
224
- return value;
225
- };
226
- const loadRestJsonErrorCode = (output, data) => {
227
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
228
- const sanitizeErrorCode = (rawValue) => {
229
- let cleanValue = rawValue;
230
- if (typeof cleanValue === "number") {
231
- cleanValue = cleanValue.toString();
232
- }
233
- if (cleanValue.indexOf(",") >= 0) {
234
- cleanValue = cleanValue.split(",")[0];
235
- }
236
- if (cleanValue.indexOf(":") >= 0) {
237
- cleanValue = cleanValue.split(":")[0];
238
- }
239
- if (cleanValue.indexOf("#") >= 0) {
240
- cleanValue = cleanValue.split("#")[1];
241
- }
242
- return cleanValue;
243
- };
244
- const headerKey = findKey(output.headers, "x-amzn-errortype");
245
- if (headerKey !== undefined) {
246
- return sanitizeErrorCode(output.headers[headerKey]);
247
- }
248
- if (data.code !== undefined) {
249
- return sanitizeErrorCode(data.code);
250
- }
251
- if (data["__type"] !== undefined) {
252
- return sanitizeErrorCode(data["__type"]);
253
- }
254
- };
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.523.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-sso",
@@ -20,38 +20,38 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/core": "3.523.0",
23
+ "@aws-sdk/core": "3.529.0",
24
24
  "@aws-sdk/middleware-host-header": "3.523.0",
25
25
  "@aws-sdk/middleware-logger": "3.523.0",
26
26
  "@aws-sdk/middleware-recursion-detection": "3.523.0",
27
- "@aws-sdk/middleware-user-agent": "3.523.0",
28
- "@aws-sdk/region-config-resolver": "3.523.0",
27
+ "@aws-sdk/middleware-user-agent": "3.525.0",
28
+ "@aws-sdk/region-config-resolver": "3.525.0",
29
29
  "@aws-sdk/types": "3.523.0",
30
- "@aws-sdk/util-endpoints": "3.523.0",
30
+ "@aws-sdk/util-endpoints": "3.525.0",
31
31
  "@aws-sdk/util-user-agent-browser": "3.523.0",
32
- "@aws-sdk/util-user-agent-node": "3.523.0",
33
- "@smithy/config-resolver": "^2.1.3",
34
- "@smithy/core": "^1.3.4",
32
+ "@aws-sdk/util-user-agent-node": "3.525.0",
33
+ "@smithy/config-resolver": "^2.1.4",
34
+ "@smithy/core": "^1.3.5",
35
35
  "@smithy/fetch-http-handler": "^2.4.3",
36
36
  "@smithy/hash-node": "^2.1.3",
37
37
  "@smithy/invalid-dependency": "^2.1.3",
38
38
  "@smithy/middleware-content-length": "^2.1.3",
39
- "@smithy/middleware-endpoint": "^2.4.3",
40
- "@smithy/middleware-retry": "^2.1.3",
39
+ "@smithy/middleware-endpoint": "^2.4.4",
40
+ "@smithy/middleware-retry": "^2.1.4",
41
41
  "@smithy/middleware-serde": "^2.1.3",
42
42
  "@smithy/middleware-stack": "^2.1.3",
43
- "@smithy/node-config-provider": "^2.2.3",
43
+ "@smithy/node-config-provider": "^2.2.4",
44
44
  "@smithy/node-http-handler": "^2.4.1",
45
45
  "@smithy/protocol-http": "^3.2.1",
46
- "@smithy/smithy-client": "^2.4.1",
46
+ "@smithy/smithy-client": "^2.4.2",
47
47
  "@smithy/types": "^2.10.1",
48
48
  "@smithy/url-parser": "^2.1.3",
49
49
  "@smithy/util-base64": "^2.1.1",
50
50
  "@smithy/util-body-length-browser": "^2.1.1",
51
51
  "@smithy/util-body-length-node": "^2.2.1",
52
- "@smithy/util-defaults-mode-browser": "^2.1.3",
53
- "@smithy/util-defaults-mode-node": "^2.2.2",
54
- "@smithy/util-endpoints": "^1.1.3",
52
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
53
+ "@smithy/util-defaults-mode-node": "^2.2.3",
54
+ "@smithy/util-endpoints": "^1.1.4",
55
55
  "@smithy/util-middleware": "^2.1.3",
56
56
  "@smithy/util-retry": "^2.1.3",
57
57
  "@smithy/util-utf8": "^2.1.1",
package/dist-cjs/SSO.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");