@aws-sdk/client-eks-auth 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
@@ -377,6 +377,7 @@ var AssumeRoleForPodIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name(
377
377
  }), "AssumeRoleForPodIdentityResponseFilterSensitiveLog");
378
378
 
379
379
  // src/protocols/Aws_restJson1.ts
380
+ var import_core2 = require("@aws-sdk/core");
380
381
 
381
382
 
382
383
  var se_AssumeRoleForPodIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -402,7 +403,7 @@ var de_AssumeRoleForPodIdentityCommand = /* @__PURE__ */ __name(async (output, c
402
403
  const contents = (0, import_smithy_client.map)({
403
404
  $metadata: deserializeMetadata(output)
404
405
  });
405
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
406
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
406
407
  const doc = (0, import_smithy_client.take)(data, {
407
408
  assumedRoleUser: import_smithy_client._json,
408
409
  audience: import_smithy_client.expectString,
@@ -416,9 +417,9 @@ var de_AssumeRoleForPodIdentityCommand = /* @__PURE__ */ __name(async (output, c
416
417
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
417
418
  const parsedOutput = {
418
419
  ...output,
419
- body: await parseErrorBody(output.body, context)
420
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
420
421
  };
421
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
422
423
  switch (errorCode) {
423
424
  case "AccessDeniedException":
424
425
  case "com.amazonaws.eksauth#AccessDeniedException":
@@ -588,47 +589,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
588
589
  extendedRequestId: output.headers["x-amz-id-2"],
589
590
  cfId: output.headers["x-amz-cf-id"]
590
591
  }), "deserializeMetadata");
591
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
592
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
593
- if (encoded.length) {
594
- return JSON.parse(encoded);
595
- }
596
- return {};
597
- }), "parseBody");
598
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
599
- const value = await parseBody(errorBody, context);
600
- value.message = value.message ?? value.Message;
601
- return value;
602
- }, "parseErrorBody");
603
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
604
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
605
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
606
- let cleanValue = rawValue;
607
- if (typeof cleanValue === "number") {
608
- cleanValue = cleanValue.toString();
609
- }
610
- if (cleanValue.indexOf(",") >= 0) {
611
- cleanValue = cleanValue.split(",")[0];
612
- }
613
- if (cleanValue.indexOf(":") >= 0) {
614
- cleanValue = cleanValue.split(":")[0];
615
- }
616
- if (cleanValue.indexOf("#") >= 0) {
617
- cleanValue = cleanValue.split("#")[1];
618
- }
619
- return cleanValue;
620
- }, "sanitizeErrorCode");
621
- const headerKey = findKey(output.headers, "x-amzn-errortype");
622
- if (headerKey !== void 0) {
623
- return sanitizeErrorCode(output.headers[headerKey]);
624
- }
625
- if (data.code !== void 0) {
626
- return sanitizeErrorCode(data.code);
627
- }
628
- if (data["__type"] !== void 0) {
629
- return sanitizeErrorCode(data["__type"]);
630
- }
631
- }, "loadRestJsonErrorCode");
632
592
 
633
593
  // src/commands/AssumeRoleForPodIdentityCommand.ts
634
594
  var _AssumeRoleForPodIdentityCommand = class _AssumeRoleForPodIdentityCommand 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, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { EKSAuthServiceException as __BaseException } from "../models/EKSAuthServiceException";
@@ -215,43 +216,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
215
216
  value !== "" &&
216
217
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
217
218
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
218
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
219
- if (encoded.length) {
220
- return JSON.parse(encoded);
221
- }
222
- return {};
223
- });
224
- const parseErrorBody = async (errorBody, context) => {
225
- const value = await parseBody(errorBody, context);
226
- value.message = value.message ?? value.Message;
227
- return value;
228
- };
229
- const loadRestJsonErrorCode = (output, data) => {
230
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
231
- const sanitizeErrorCode = (rawValue) => {
232
- let cleanValue = rawValue;
233
- if (typeof cleanValue === "number") {
234
- cleanValue = cleanValue.toString();
235
- }
236
- if (cleanValue.indexOf(",") >= 0) {
237
- cleanValue = cleanValue.split(",")[0];
238
- }
239
- if (cleanValue.indexOf(":") >= 0) {
240
- cleanValue = cleanValue.split(":")[0];
241
- }
242
- if (cleanValue.indexOf("#") >= 0) {
243
- cleanValue = cleanValue.split("#")[1];
244
- }
245
- return cleanValue;
246
- };
247
- const headerKey = findKey(output.headers, "x-amzn-errortype");
248
- if (headerKey !== undefined) {
249
- return sanitizeErrorCode(output.headers[headerKey]);
250
- }
251
- if (data.code !== undefined) {
252
- return sanitizeErrorCode(data.code);
253
- }
254
- if (data["__type"] !== undefined) {
255
- return sanitizeErrorCode(data["__type"]);
256
- }
257
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-eks-auth",
3
3
  "description": "AWS SDK for JavaScript Eks Auth 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-eks-auth",
@@ -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",