@aws-sdk/client-application-auto-scaling 3.525.0 → 3.529.1

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
@@ -215,6 +215,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
215
215
  var import_types = require("@smithy/types");
216
216
 
217
217
  // src/protocols/Aws_json1_1.ts
218
+ var import_core2 = require("@aws-sdk/core");
218
219
 
219
220
 
220
221
 
@@ -576,7 +577,7 @@ var de_DeleteScalingPolicyCommand = /* @__PURE__ */ __name(async (output, contex
576
577
  if (output.statusCode >= 300) {
577
578
  return de_CommandError(output, context);
578
579
  }
579
- const data = await parseBody(output.body, context);
580
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
580
581
  let contents = {};
581
582
  contents = (0, import_smithy_client._json)(data);
582
583
  const response = {
@@ -589,7 +590,7 @@ var de_DeleteScheduledActionCommand = /* @__PURE__ */ __name(async (output, cont
589
590
  if (output.statusCode >= 300) {
590
591
  return de_CommandError(output, context);
591
592
  }
592
- const data = await parseBody(output.body, context);
593
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
593
594
  let contents = {};
594
595
  contents = (0, import_smithy_client._json)(data);
595
596
  const response = {
@@ -602,7 +603,7 @@ var de_DeregisterScalableTargetCommand = /* @__PURE__ */ __name(async (output, c
602
603
  if (output.statusCode >= 300) {
603
604
  return de_CommandError(output, context);
604
605
  }
605
- const data = await parseBody(output.body, context);
606
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
606
607
  let contents = {};
607
608
  contents = (0, import_smithy_client._json)(data);
608
609
  const response = {
@@ -615,7 +616,7 @@ var de_DescribeScalableTargetsCommand = /* @__PURE__ */ __name(async (output, co
615
616
  if (output.statusCode >= 300) {
616
617
  return de_CommandError(output, context);
617
618
  }
618
- const data = await parseBody(output.body, context);
619
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
619
620
  let contents = {};
620
621
  contents = de_DescribeScalableTargetsResponse(data, context);
621
622
  const response = {
@@ -628,7 +629,7 @@ var de_DescribeScalingActivitiesCommand = /* @__PURE__ */ __name(async (output,
628
629
  if (output.statusCode >= 300) {
629
630
  return de_CommandError(output, context);
630
631
  }
631
- const data = await parseBody(output.body, context);
632
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
632
633
  let contents = {};
633
634
  contents = de_DescribeScalingActivitiesResponse(data, context);
634
635
  const response = {
@@ -641,7 +642,7 @@ var de_DescribeScalingPoliciesCommand = /* @__PURE__ */ __name(async (output, co
641
642
  if (output.statusCode >= 300) {
642
643
  return de_CommandError(output, context);
643
644
  }
644
- const data = await parseBody(output.body, context);
645
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
645
646
  let contents = {};
646
647
  contents = de_DescribeScalingPoliciesResponse(data, context);
647
648
  const response = {
@@ -654,7 +655,7 @@ var de_DescribeScheduledActionsCommand = /* @__PURE__ */ __name(async (output, c
654
655
  if (output.statusCode >= 300) {
655
656
  return de_CommandError(output, context);
656
657
  }
657
- const data = await parseBody(output.body, context);
658
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
658
659
  let contents = {};
659
660
  contents = de_DescribeScheduledActionsResponse(data, context);
660
661
  const response = {
@@ -667,7 +668,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
667
668
  if (output.statusCode >= 300) {
668
669
  return de_CommandError(output, context);
669
670
  }
670
- const data = await parseBody(output.body, context);
671
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
671
672
  let contents = {};
672
673
  contents = (0, import_smithy_client._json)(data);
673
674
  const response = {
@@ -680,7 +681,7 @@ var de_PutScalingPolicyCommand = /* @__PURE__ */ __name(async (output, context)
680
681
  if (output.statusCode >= 300) {
681
682
  return de_CommandError(output, context);
682
683
  }
683
- const data = await parseBody(output.body, context);
684
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
684
685
  let contents = {};
685
686
  contents = (0, import_smithy_client._json)(data);
686
687
  const response = {
@@ -693,7 +694,7 @@ var de_PutScheduledActionCommand = /* @__PURE__ */ __name(async (output, context
693
694
  if (output.statusCode >= 300) {
694
695
  return de_CommandError(output, context);
695
696
  }
696
- const data = await parseBody(output.body, context);
697
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
697
698
  let contents = {};
698
699
  contents = (0, import_smithy_client._json)(data);
699
700
  const response = {
@@ -706,7 +707,7 @@ var de_RegisterScalableTargetCommand = /* @__PURE__ */ __name(async (output, con
706
707
  if (output.statusCode >= 300) {
707
708
  return de_CommandError(output, context);
708
709
  }
709
- const data = await parseBody(output.body, context);
710
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
710
711
  let contents = {};
711
712
  contents = (0, import_smithy_client._json)(data);
712
713
  const response = {
@@ -719,7 +720,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
719
720
  if (output.statusCode >= 300) {
720
721
  return de_CommandError(output, context);
721
722
  }
722
- const data = await parseBody(output.body, context);
723
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
723
724
  let contents = {};
724
725
  contents = (0, import_smithy_client._json)(data);
725
726
  const response = {
@@ -732,7 +733,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
732
733
  if (output.statusCode >= 300) {
733
734
  return de_CommandError(output, context);
734
735
  }
735
- const data = await parseBody(output.body, context);
736
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
736
737
  let contents = {};
737
738
  contents = (0, import_smithy_client._json)(data);
738
739
  const response = {
@@ -744,9 +745,9 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
744
745
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
745
746
  const parsedOutput = {
746
747
  ...output,
747
- body: await parseErrorBody(output.body, context)
748
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
748
749
  };
749
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
750
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
750
751
  switch (errorCode) {
751
752
  case "ConcurrentUpdateException":
752
753
  case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException":
@@ -1064,7 +1065,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1064
1065
  extendedRequestId: output.headers["x-amz-id-2"],
1065
1066
  cfId: output.headers["x-amz-cf-id"]
1066
1067
  }), "deserializeMetadata");
1067
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1068
1068
  var throwDefaultError = (0, import_smithy_client.withBaseException)(ApplicationAutoScalingServiceException);
1069
1069
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1070
1070
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1091,46 +1091,6 @@ function sharedHeaders(operation) {
1091
1091
  };
1092
1092
  }
1093
1093
  __name(sharedHeaders, "sharedHeaders");
1094
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1095
- if (encoded.length) {
1096
- return JSON.parse(encoded);
1097
- }
1098
- return {};
1099
- }), "parseBody");
1100
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1101
- const value = await parseBody(errorBody, context);
1102
- value.message = value.message ?? value.Message;
1103
- return value;
1104
- }, "parseErrorBody");
1105
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1106
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1107
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1108
- let cleanValue = rawValue;
1109
- if (typeof cleanValue === "number") {
1110
- cleanValue = cleanValue.toString();
1111
- }
1112
- if (cleanValue.indexOf(",") >= 0) {
1113
- cleanValue = cleanValue.split(",")[0];
1114
- }
1115
- if (cleanValue.indexOf(":") >= 0) {
1116
- cleanValue = cleanValue.split(":")[0];
1117
- }
1118
- if (cleanValue.indexOf("#") >= 0) {
1119
- cleanValue = cleanValue.split("#")[1];
1120
- }
1121
- return cleanValue;
1122
- }, "sanitizeErrorCode");
1123
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1124
- if (headerKey !== void 0) {
1125
- return sanitizeErrorCode(output.headers[headerKey]);
1126
- }
1127
- if (data.code !== void 0) {
1128
- return sanitizeErrorCode(data.code);
1129
- }
1130
- if (data["__type"] !== void 0) {
1131
- return sanitizeErrorCode(data["__type"]);
1132
- }
1133
- }, "loadRestJsonErrorCode");
1134
1094
 
1135
1095
  // src/commands/DeleteScalingPolicyCommand.ts
1136
1096
  var _DeleteScalingPolicyCommand = class _DeleteScalingPolicyCommand 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 { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
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, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { ApplicationAutoScalingServiceException as __BaseException } from "../models/ApplicationAutoScalingServiceException";
@@ -610,43 +611,3 @@ function sharedHeaders(operation) {
610
611
  "x-amz-target": `AnyScaleFrontendService.${operation}`,
611
612
  };
612
613
  }
613
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
614
- if (encoded.length) {
615
- return JSON.parse(encoded);
616
- }
617
- return {};
618
- });
619
- const parseErrorBody = async (errorBody, context) => {
620
- const value = await parseBody(errorBody, context);
621
- value.message = value.message ?? value.Message;
622
- return value;
623
- };
624
- const loadRestJsonErrorCode = (output, data) => {
625
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
626
- const sanitizeErrorCode = (rawValue) => {
627
- let cleanValue = rawValue;
628
- if (typeof cleanValue === "number") {
629
- cleanValue = cleanValue.toString();
630
- }
631
- if (cleanValue.indexOf(",") >= 0) {
632
- cleanValue = cleanValue.split(",")[0];
633
- }
634
- if (cleanValue.indexOf(":") >= 0) {
635
- cleanValue = cleanValue.split(":")[0];
636
- }
637
- if (cleanValue.indexOf("#") >= 0) {
638
- cleanValue = cleanValue.split("#")[1];
639
- }
640
- return cleanValue;
641
- };
642
- const headerKey = findKey(output.headers, "x-amzn-errortype");
643
- if (headerKey !== undefined) {
644
- return sanitizeErrorCode(output.headers[headerKey]);
645
- }
646
- if (data.code !== undefined) {
647
- return sanitizeErrorCode(data.code);
648
- }
649
- if (data["__type"] !== undefined) {
650
- return sanitizeErrorCode(data["__type"]);
651
- }
652
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-application-auto-scaling",
3
3
  "description": "AWS SDK for JavaScript Application Auto Scaling Client for Node.js, Browser and React Native",
4
- "version": "3.525.0",
4
+ "version": "3.529.1",
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-application-auto-scaling",
@@ -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.1",
24
+ "@aws-sdk/core": "3.529.1",
25
+ "@aws-sdk/credential-provider-node": "3.529.1",
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",