@aws-sdk/client-auto-scaling-plans 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
@@ -205,6 +205,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
205
205
  var import_types = require("@smithy/types");
206
206
 
207
207
  // src/protocols/Aws_json1_1.ts
208
+ var import_core2 = require("@aws-sdk/core");
208
209
 
209
210
 
210
211
 
@@ -455,7 +456,7 @@ var de_CreateScalingPlanCommand = /* @__PURE__ */ __name(async (output, context)
455
456
  if (output.statusCode >= 300) {
456
457
  return de_CommandError(output, context);
457
458
  }
458
- const data = await parseBody(output.body, context);
459
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
459
460
  let contents = {};
460
461
  contents = (0, import_smithy_client._json)(data);
461
462
  const response = {
@@ -468,7 +469,7 @@ var de_DeleteScalingPlanCommand = /* @__PURE__ */ __name(async (output, context)
468
469
  if (output.statusCode >= 300) {
469
470
  return de_CommandError(output, context);
470
471
  }
471
- const data = await parseBody(output.body, context);
472
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
472
473
  let contents = {};
473
474
  contents = (0, import_smithy_client._json)(data);
474
475
  const response = {
@@ -481,7 +482,7 @@ var de_DescribeScalingPlanResourcesCommand = /* @__PURE__ */ __name(async (outpu
481
482
  if (output.statusCode >= 300) {
482
483
  return de_CommandError(output, context);
483
484
  }
484
- const data = await parseBody(output.body, context);
485
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
485
486
  let contents = {};
486
487
  contents = de_DescribeScalingPlanResourcesResponse(data, context);
487
488
  const response = {
@@ -494,7 +495,7 @@ var de_DescribeScalingPlansCommand = /* @__PURE__ */ __name(async (output, conte
494
495
  if (output.statusCode >= 300) {
495
496
  return de_CommandError(output, context);
496
497
  }
497
- const data = await parseBody(output.body, context);
498
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
498
499
  let contents = {};
499
500
  contents = de_DescribeScalingPlansResponse(data, context);
500
501
  const response = {
@@ -507,7 +508,7 @@ var de_GetScalingPlanResourceForecastDataCommand = /* @__PURE__ */ __name(async
507
508
  if (output.statusCode >= 300) {
508
509
  return de_CommandError(output, context);
509
510
  }
510
- const data = await parseBody(output.body, context);
511
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
511
512
  let contents = {};
512
513
  contents = de_GetScalingPlanResourceForecastDataResponse(data, context);
513
514
  const response = {
@@ -520,7 +521,7 @@ var de_UpdateScalingPlanCommand = /* @__PURE__ */ __name(async (output, context)
520
521
  if (output.statusCode >= 300) {
521
522
  return de_CommandError(output, context);
522
523
  }
523
- const data = await parseBody(output.body, context);
524
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
524
525
  let contents = {};
525
526
  contents = (0, import_smithy_client._json)(data);
526
527
  const response = {
@@ -532,9 +533,9 @@ var de_UpdateScalingPlanCommand = /* @__PURE__ */ __name(async (output, context)
532
533
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
533
534
  const parsedOutput = {
534
535
  ...output,
535
- body: await parseErrorBody(output.body, context)
536
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
536
537
  };
537
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
538
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
538
539
  switch (errorCode) {
539
540
  case "ConcurrentUpdateException":
540
541
  case "com.amazonaws.autoscalingplans#ConcurrentUpdateException":
@@ -808,7 +809,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
808
809
  extendedRequestId: output.headers["x-amz-id-2"],
809
810
  cfId: output.headers["x-amz-cf-id"]
810
811
  }), "deserializeMetadata");
811
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
812
812
  var throwDefaultError = (0, import_smithy_client.withBaseException)(AutoScalingPlansServiceException);
813
813
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
814
814
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -835,46 +835,6 @@ function sharedHeaders(operation) {
835
835
  };
836
836
  }
837
837
  __name(sharedHeaders, "sharedHeaders");
838
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
839
- if (encoded.length) {
840
- return JSON.parse(encoded);
841
- }
842
- return {};
843
- }), "parseBody");
844
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
845
- const value = await parseBody(errorBody, context);
846
- value.message = value.message ?? value.Message;
847
- return value;
848
- }, "parseErrorBody");
849
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
850
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
851
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
852
- let cleanValue = rawValue;
853
- if (typeof cleanValue === "number") {
854
- cleanValue = cleanValue.toString();
855
- }
856
- if (cleanValue.indexOf(",") >= 0) {
857
- cleanValue = cleanValue.split(",")[0];
858
- }
859
- if (cleanValue.indexOf(":") >= 0) {
860
- cleanValue = cleanValue.split(":")[0];
861
- }
862
- if (cleanValue.indexOf("#") >= 0) {
863
- cleanValue = cleanValue.split("#")[1];
864
- }
865
- return cleanValue;
866
- }, "sanitizeErrorCode");
867
- const headerKey = findKey(output.headers, "x-amzn-errortype");
868
- if (headerKey !== void 0) {
869
- return sanitizeErrorCode(output.headers[headerKey]);
870
- }
871
- if (data.code !== void 0) {
872
- return sanitizeErrorCode(data.code);
873
- }
874
- if (data["__type"] !== void 0) {
875
- return sanitizeErrorCode(data["__type"]);
876
- }
877
- }, "loadRestJsonErrorCode");
878
838
 
879
839
  // src/commands/CreateScalingPlanCommand.ts
880
840
  var _CreateScalingPlanCommand = class _CreateScalingPlanCommand 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, expectLong as __expectLong, 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 { AutoScalingPlansServiceException as __BaseException } from "../models/AutoScalingPlansServiceException";
@@ -437,43 +438,3 @@ function sharedHeaders(operation) {
437
438
  "x-amz-target": `AnyScaleScalingPlannerFrontendService.${operation}`,
438
439
  };
439
440
  }
440
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
441
- if (encoded.length) {
442
- return JSON.parse(encoded);
443
- }
444
- return {};
445
- });
446
- const parseErrorBody = async (errorBody, context) => {
447
- const value = await parseBody(errorBody, context);
448
- value.message = value.message ?? value.Message;
449
- return value;
450
- };
451
- const loadRestJsonErrorCode = (output, data) => {
452
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
453
- const sanitizeErrorCode = (rawValue) => {
454
- let cleanValue = rawValue;
455
- if (typeof cleanValue === "number") {
456
- cleanValue = cleanValue.toString();
457
- }
458
- if (cleanValue.indexOf(",") >= 0) {
459
- cleanValue = cleanValue.split(",")[0];
460
- }
461
- if (cleanValue.indexOf(":") >= 0) {
462
- cleanValue = cleanValue.split(":")[0];
463
- }
464
- if (cleanValue.indexOf("#") >= 0) {
465
- cleanValue = cleanValue.split("#")[1];
466
- }
467
- return cleanValue;
468
- };
469
- const headerKey = findKey(output.headers, "x-amzn-errortype");
470
- if (headerKey !== undefined) {
471
- return sanitizeErrorCode(output.headers[headerKey]);
472
- }
473
- if (data.code !== undefined) {
474
- return sanitizeErrorCode(data.code);
475
- }
476
- if (data["__type"] !== undefined) {
477
- return sanitizeErrorCode(data["__type"]);
478
- }
479
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-auto-scaling-plans",
3
3
  "description": "AWS SDK for JavaScript Auto Scaling Plans 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-auto-scaling-plans",
@@ -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");