@aws-sdk/client-auto-scaling-plans 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 +9 -49
- package/dist-es/protocols/Aws_json1_1.js +1 -40
- package/package.json +4 -4
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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,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.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
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",
|