@aws-sdk/client-cost-optimization-hub 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
@@ -447,7 +447,7 @@ var de_GetPreferencesCommand = /* @__PURE__ */ __name(async (output, context) =>
447
447
  if (output.statusCode >= 300) {
448
448
  return de_CommandError(output, context);
449
449
  }
450
- const data = await parseBody(output.body, context);
450
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
451
451
  let contents = {};
452
452
  contents = (0, import_smithy_client._json)(data);
453
453
  const response = {
@@ -460,7 +460,7 @@ var de_GetRecommendationCommand = /* @__PURE__ */ __name(async (output, context)
460
460
  if (output.statusCode >= 300) {
461
461
  return de_CommandError(output, context);
462
462
  }
463
- const data = await parseBody(output.body, context);
463
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
464
464
  let contents = {};
465
465
  contents = de_GetRecommendationResponse(data, context);
466
466
  const response = {
@@ -473,7 +473,7 @@ var de_ListEnrollmentStatusesCommand = /* @__PURE__ */ __name(async (output, con
473
473
  if (output.statusCode >= 300) {
474
474
  return de_CommandError(output, context);
475
475
  }
476
- const data = await parseBody(output.body, context);
476
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
477
477
  let contents = {};
478
478
  contents = de_ListEnrollmentStatusesResponse(data, context);
479
479
  const response = {
@@ -486,7 +486,7 @@ var de_ListRecommendationsCommand = /* @__PURE__ */ __name(async (output, contex
486
486
  if (output.statusCode >= 300) {
487
487
  return de_CommandError(output, context);
488
488
  }
489
- const data = await parseBody(output.body, context);
489
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
490
490
  let contents = {};
491
491
  contents = de_ListRecommendationsResponse(data, context);
492
492
  const response = {
@@ -499,7 +499,7 @@ var de_ListRecommendationSummariesCommand = /* @__PURE__ */ __name(async (output
499
499
  if (output.statusCode >= 300) {
500
500
  return de_CommandError(output, context);
501
501
  }
502
- const data = await parseBody(output.body, context);
502
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
503
503
  let contents = {};
504
504
  contents = de_ListRecommendationSummariesResponse(data, context);
505
505
  const response = {
@@ -512,7 +512,7 @@ var de_UpdateEnrollmentStatusCommand = /* @__PURE__ */ __name(async (output, con
512
512
  if (output.statusCode >= 300) {
513
513
  return de_CommandError(output, context);
514
514
  }
515
- const data = await parseBody(output.body, context);
515
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
516
516
  let contents = {};
517
517
  contents = (0, import_smithy_client._json)(data);
518
518
  const response = {
@@ -525,7 +525,7 @@ var de_UpdatePreferencesCommand = /* @__PURE__ */ __name(async (output, context)
525
525
  if (output.statusCode >= 300) {
526
526
  return de_CommandError(output, context);
527
527
  }
528
- const data = await parseBody(output.body, context);
528
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
529
529
  let contents = {};
530
530
  contents = (0, import_smithy_client._json)(data);
531
531
  const response = {
@@ -537,9 +537,9 @@ var de_UpdatePreferencesCommand = /* @__PURE__ */ __name(async (output, context)
537
537
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
538
538
  const parsedOutput = {
539
539
  ...output,
540
- body: await parseErrorBody(output.body, context)
540
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
541
541
  };
542
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
542
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
543
543
  switch (errorCode) {
544
544
  case "AccessDeniedException":
545
545
  case "com.amazonaws.costoptimizationhub#AccessDeniedException":
@@ -968,7 +968,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
968
968
  extendedRequestId: output.headers["x-amz-id-2"],
969
969
  cfId: output.headers["x-amz-cf-id"]
970
970
  }), "deserializeMetadata");
971
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
972
971
  var throwDefaultError = (0, import_smithy_client.withBaseException)(CostOptimizationHubServiceException);
973
972
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
974
973
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -995,46 +994,6 @@ function sharedHeaders(operation) {
995
994
  };
996
995
  }
997
996
  __name(sharedHeaders, "sharedHeaders");
998
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
999
- if (encoded.length) {
1000
- return JSON.parse(encoded);
1001
- }
1002
- return {};
1003
- }), "parseBody");
1004
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1005
- const value = await parseBody(errorBody, context);
1006
- value.message = value.message ?? value.Message;
1007
- return value;
1008
- }, "parseErrorBody");
1009
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1010
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1011
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1012
- let cleanValue = rawValue;
1013
- if (typeof cleanValue === "number") {
1014
- cleanValue = cleanValue.toString();
1015
- }
1016
- if (cleanValue.indexOf(",") >= 0) {
1017
- cleanValue = cleanValue.split(",")[0];
1018
- }
1019
- if (cleanValue.indexOf(":") >= 0) {
1020
- cleanValue = cleanValue.split(":")[0];
1021
- }
1022
- if (cleanValue.indexOf("#") >= 0) {
1023
- cleanValue = cleanValue.split("#")[1];
1024
- }
1025
- return cleanValue;
1026
- }, "sanitizeErrorCode");
1027
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1028
- if (headerKey !== void 0) {
1029
- return sanitizeErrorCode(output.headers[headerKey]);
1030
- }
1031
- if (data.code !== void 0) {
1032
- return sanitizeErrorCode(data.code);
1033
- }
1034
- if (data["__type"] !== void 0) {
1035
- return sanitizeErrorCode(data["__type"]);
1036
- }
1037
- }, "loadRestJsonErrorCode");
1038
997
 
1039
998
  // src/commands/GetPreferencesCommand.ts
1040
999
  var _GetPreferencesCommand = class _GetPreferencesCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,4 +1,4 @@
1
- import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
1
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { CostOptimizationHubServiceException as __BaseException } from "../models/CostOptimizationHubServiceException";
@@ -604,43 +604,3 @@ function sharedHeaders(operation) {
604
604
  "x-amz-target": `CostOptimizationHubService.${operation}`,
605
605
  };
606
606
  }
607
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
608
- if (encoded.length) {
609
- return JSON.parse(encoded);
610
- }
611
- return {};
612
- });
613
- const parseErrorBody = async (errorBody, context) => {
614
- const value = await parseBody(errorBody, context);
615
- value.message = value.message ?? value.Message;
616
- return value;
617
- };
618
- const loadRestJsonErrorCode = (output, data) => {
619
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
620
- const sanitizeErrorCode = (rawValue) => {
621
- let cleanValue = rawValue;
622
- if (typeof cleanValue === "number") {
623
- cleanValue = cleanValue.toString();
624
- }
625
- if (cleanValue.indexOf(",") >= 0) {
626
- cleanValue = cleanValue.split(",")[0];
627
- }
628
- if (cleanValue.indexOf(":") >= 0) {
629
- cleanValue = cleanValue.split(":")[0];
630
- }
631
- if (cleanValue.indexOf("#") >= 0) {
632
- cleanValue = cleanValue.split("#")[1];
633
- }
634
- return cleanValue;
635
- };
636
- const headerKey = findKey(output.headers, "x-amzn-errortype");
637
- if (headerKey !== undefined) {
638
- return sanitizeErrorCode(output.headers[headerKey]);
639
- }
640
- if (data.code !== undefined) {
641
- return sanitizeErrorCode(data.code);
642
- }
643
- if (data["__type"] !== undefined) {
644
- return sanitizeErrorCode(data["__type"]);
645
- }
646
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cost-optimization-hub",
3
3
  "description": "AWS SDK for JavaScript Cost Optimization Hub 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-cost-optimization-hub",
@@ -20,40 +20,40 @@
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.523.0",
24
- "@aws-sdk/core": "3.523.0",
25
- "@aws-sdk/credential-provider-node": "3.523.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",
29
- "@aws-sdk/middleware-user-agent": "3.523.0",
30
- "@aws-sdk/region-config-resolver": "3.523.0",
29
+ "@aws-sdk/middleware-user-agent": "3.525.0",
30
+ "@aws-sdk/region-config-resolver": "3.525.0",
31
31
  "@aws-sdk/types": "3.523.0",
32
- "@aws-sdk/util-endpoints": "3.523.0",
32
+ "@aws-sdk/util-endpoints": "3.525.0",
33
33
  "@aws-sdk/util-user-agent-browser": "3.523.0",
34
- "@aws-sdk/util-user-agent-node": "3.523.0",
35
- "@smithy/config-resolver": "^2.1.3",
36
- "@smithy/core": "^1.3.4",
34
+ "@aws-sdk/util-user-agent-node": "3.525.0",
35
+ "@smithy/config-resolver": "^2.1.4",
36
+ "@smithy/core": "^1.3.5",
37
37
  "@smithy/fetch-http-handler": "^2.4.3",
38
38
  "@smithy/hash-node": "^2.1.3",
39
39
  "@smithy/invalid-dependency": "^2.1.3",
40
40
  "@smithy/middleware-content-length": "^2.1.3",
41
- "@smithy/middleware-endpoint": "^2.4.3",
42
- "@smithy/middleware-retry": "^2.1.3",
41
+ "@smithy/middleware-endpoint": "^2.4.4",
42
+ "@smithy/middleware-retry": "^2.1.4",
43
43
  "@smithy/middleware-serde": "^2.1.3",
44
44
  "@smithy/middleware-stack": "^2.1.3",
45
- "@smithy/node-config-provider": "^2.2.3",
45
+ "@smithy/node-config-provider": "^2.2.4",
46
46
  "@smithy/node-http-handler": "^2.4.1",
47
47
  "@smithy/protocol-http": "^3.2.1",
48
- "@smithy/smithy-client": "^2.4.1",
48
+ "@smithy/smithy-client": "^2.4.2",
49
49
  "@smithy/types": "^2.10.1",
50
50
  "@smithy/url-parser": "^2.1.3",
51
51
  "@smithy/util-base64": "^2.1.1",
52
52
  "@smithy/util-body-length-browser": "^2.1.1",
53
53
  "@smithy/util-body-length-node": "^2.2.1",
54
- "@smithy/util-defaults-mode-browser": "^2.1.3",
55
- "@smithy/util-defaults-mode-node": "^2.2.2",
56
- "@smithy/util-endpoints": "^1.1.3",
54
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
55
+ "@smithy/util-defaults-mode-node": "^2.2.3",
56
+ "@smithy/util-endpoints": "^1.1.4",
57
57
  "@smithy/util-middleware": "^2.1.3",
58
58
  "@smithy/util-retry": "^2.1.3",
59
59
  "@smithy/util-utf8": "^2.1.1",
@@ -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");
@@ -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");