@aws-sdk/client-pi 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 +16 -56
- package/dist-es/protocols/Aws_json1_1.js +1 -40
- package/package.json +4 -4
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
|
|
|
@@ -438,7 +439,7 @@ var de_CreatePerformanceAnalysisReportCommand = /* @__PURE__ */ __name(async (ou
|
|
|
438
439
|
if (output.statusCode >= 300) {
|
|
439
440
|
return de_CommandError(output, context);
|
|
440
441
|
}
|
|
441
|
-
const data = await
|
|
442
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
442
443
|
let contents = {};
|
|
443
444
|
contents = (0, import_smithy_client._json)(data);
|
|
444
445
|
const response = {
|
|
@@ -451,7 +452,7 @@ var de_DeletePerformanceAnalysisReportCommand = /* @__PURE__ */ __name(async (ou
|
|
|
451
452
|
if (output.statusCode >= 300) {
|
|
452
453
|
return de_CommandError(output, context);
|
|
453
454
|
}
|
|
454
|
-
const data = await
|
|
455
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
455
456
|
let contents = {};
|
|
456
457
|
contents = (0, import_smithy_client._json)(data);
|
|
457
458
|
const response = {
|
|
@@ -464,7 +465,7 @@ var de_DescribeDimensionKeysCommand = /* @__PURE__ */ __name(async (output, cont
|
|
|
464
465
|
if (output.statusCode >= 300) {
|
|
465
466
|
return de_CommandError(output, context);
|
|
466
467
|
}
|
|
467
|
-
const data = await
|
|
468
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
468
469
|
let contents = {};
|
|
469
470
|
contents = de_DescribeDimensionKeysResponse(data, context);
|
|
470
471
|
const response = {
|
|
@@ -477,7 +478,7 @@ var de_GetDimensionKeyDetailsCommand = /* @__PURE__ */ __name(async (output, con
|
|
|
477
478
|
if (output.statusCode >= 300) {
|
|
478
479
|
return de_CommandError(output, context);
|
|
479
480
|
}
|
|
480
|
-
const data = await
|
|
481
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
481
482
|
let contents = {};
|
|
482
483
|
contents = (0, import_smithy_client._json)(data);
|
|
483
484
|
const response = {
|
|
@@ -490,7 +491,7 @@ var de_GetPerformanceAnalysisReportCommand = /* @__PURE__ */ __name(async (outpu
|
|
|
490
491
|
if (output.statusCode >= 300) {
|
|
491
492
|
return de_CommandError(output, context);
|
|
492
493
|
}
|
|
493
|
-
const data = await
|
|
494
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
494
495
|
let contents = {};
|
|
495
496
|
contents = de_GetPerformanceAnalysisReportResponse(data, context);
|
|
496
497
|
const response = {
|
|
@@ -503,7 +504,7 @@ var de_GetResourceMetadataCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
503
504
|
if (output.statusCode >= 300) {
|
|
504
505
|
return de_CommandError(output, context);
|
|
505
506
|
}
|
|
506
|
-
const data = await
|
|
507
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
507
508
|
let contents = {};
|
|
508
509
|
contents = (0, import_smithy_client._json)(data);
|
|
509
510
|
const response = {
|
|
@@ -516,7 +517,7 @@ var de_GetResourceMetricsCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
516
517
|
if (output.statusCode >= 300) {
|
|
517
518
|
return de_CommandError(output, context);
|
|
518
519
|
}
|
|
519
|
-
const data = await
|
|
520
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
520
521
|
let contents = {};
|
|
521
522
|
contents = de_GetResourceMetricsResponse(data, context);
|
|
522
523
|
const response = {
|
|
@@ -529,7 +530,7 @@ var de_ListAvailableResourceDimensionsCommand = /* @__PURE__ */ __name(async (ou
|
|
|
529
530
|
if (output.statusCode >= 300) {
|
|
530
531
|
return de_CommandError(output, context);
|
|
531
532
|
}
|
|
532
|
-
const data = await
|
|
533
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
533
534
|
let contents = {};
|
|
534
535
|
contents = (0, import_smithy_client._json)(data);
|
|
535
536
|
const response = {
|
|
@@ -542,7 +543,7 @@ var de_ListAvailableResourceMetricsCommand = /* @__PURE__ */ __name(async (outpu
|
|
|
542
543
|
if (output.statusCode >= 300) {
|
|
543
544
|
return de_CommandError(output, context);
|
|
544
545
|
}
|
|
545
|
-
const data = await
|
|
546
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
546
547
|
let contents = {};
|
|
547
548
|
contents = (0, import_smithy_client._json)(data);
|
|
548
549
|
const response = {
|
|
@@ -555,7 +556,7 @@ var de_ListPerformanceAnalysisReportsCommand = /* @__PURE__ */ __name(async (out
|
|
|
555
556
|
if (output.statusCode >= 300) {
|
|
556
557
|
return de_CommandError(output, context);
|
|
557
558
|
}
|
|
558
|
-
const data = await
|
|
559
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
559
560
|
let contents = {};
|
|
560
561
|
contents = de_ListPerformanceAnalysisReportsResponse(data, context);
|
|
561
562
|
const response = {
|
|
@@ -568,7 +569,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
568
569
|
if (output.statusCode >= 300) {
|
|
569
570
|
return de_CommandError(output, context);
|
|
570
571
|
}
|
|
571
|
-
const data = await
|
|
572
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
572
573
|
let contents = {};
|
|
573
574
|
contents = (0, import_smithy_client._json)(data);
|
|
574
575
|
const response = {
|
|
@@ -581,7 +582,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
581
582
|
if (output.statusCode >= 300) {
|
|
582
583
|
return de_CommandError(output, context);
|
|
583
584
|
}
|
|
584
|
-
const data = await
|
|
585
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
585
586
|
let contents = {};
|
|
586
587
|
contents = (0, import_smithy_client._json)(data);
|
|
587
588
|
const response = {
|
|
@@ -594,7 +595,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
594
595
|
if (output.statusCode >= 300) {
|
|
595
596
|
return de_CommandError(output, context);
|
|
596
597
|
}
|
|
597
|
-
const data = await
|
|
598
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
598
599
|
let contents = {};
|
|
599
600
|
contents = (0, import_smithy_client._json)(data);
|
|
600
601
|
const response = {
|
|
@@ -606,9 +607,9 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
606
607
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
607
608
|
const parsedOutput = {
|
|
608
609
|
...output,
|
|
609
|
-
body: await
|
|
610
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
610
611
|
};
|
|
611
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
612
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
612
613
|
switch (errorCode) {
|
|
613
614
|
case "InternalServiceError":
|
|
614
615
|
case "com.amazonaws.pi#InternalServiceError":
|
|
@@ -849,7 +850,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
849
850
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
850
851
|
cfId: output.headers["x-amz-cf-id"]
|
|
851
852
|
}), "deserializeMetadata");
|
|
852
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
853
853
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(PIServiceException);
|
|
854
854
|
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
855
855
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -876,46 +876,6 @@ function sharedHeaders(operation) {
|
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
878
|
__name(sharedHeaders, "sharedHeaders");
|
|
879
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
880
|
-
if (encoded.length) {
|
|
881
|
-
return JSON.parse(encoded);
|
|
882
|
-
}
|
|
883
|
-
return {};
|
|
884
|
-
}), "parseBody");
|
|
885
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
886
|
-
const value = await parseBody(errorBody, context);
|
|
887
|
-
value.message = value.message ?? value.Message;
|
|
888
|
-
return value;
|
|
889
|
-
}, "parseErrorBody");
|
|
890
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
891
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
892
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
893
|
-
let cleanValue = rawValue;
|
|
894
|
-
if (typeof cleanValue === "number") {
|
|
895
|
-
cleanValue = cleanValue.toString();
|
|
896
|
-
}
|
|
897
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
898
|
-
cleanValue = cleanValue.split(",")[0];
|
|
899
|
-
}
|
|
900
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
901
|
-
cleanValue = cleanValue.split(":")[0];
|
|
902
|
-
}
|
|
903
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
904
|
-
cleanValue = cleanValue.split("#")[1];
|
|
905
|
-
}
|
|
906
|
-
return cleanValue;
|
|
907
|
-
}, "sanitizeErrorCode");
|
|
908
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
909
|
-
if (headerKey !== void 0) {
|
|
910
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
911
|
-
}
|
|
912
|
-
if (data.code !== void 0) {
|
|
913
|
-
return sanitizeErrorCode(data.code);
|
|
914
|
-
}
|
|
915
|
-
if (data["__type"] !== void 0) {
|
|
916
|
-
return sanitizeErrorCode(data["__type"]);
|
|
917
|
-
}
|
|
918
|
-
}, "loadRestJsonErrorCode");
|
|
919
879
|
|
|
920
880
|
// src/commands/CreatePerformanceAnalysisReportCommand.ts
|
|
921
881
|
var _CreatePerformanceAnalysisReportCommand = class _CreatePerformanceAnalysisReportCommand 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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { InternalServiceError, InvalidArgumentException, NotAuthorizedException, } from "../models/models_0";
|
|
@@ -535,43 +536,3 @@ function sharedHeaders(operation) {
|
|
|
535
536
|
"x-amz-target": `PerformanceInsightsv20180227.${operation}`,
|
|
536
537
|
};
|
|
537
538
|
}
|
|
538
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
539
|
-
if (encoded.length) {
|
|
540
|
-
return JSON.parse(encoded);
|
|
541
|
-
}
|
|
542
|
-
return {};
|
|
543
|
-
});
|
|
544
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
545
|
-
const value = await parseBody(errorBody, context);
|
|
546
|
-
value.message = value.message ?? value.Message;
|
|
547
|
-
return value;
|
|
548
|
-
};
|
|
549
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
550
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
551
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
552
|
-
let cleanValue = rawValue;
|
|
553
|
-
if (typeof cleanValue === "number") {
|
|
554
|
-
cleanValue = cleanValue.toString();
|
|
555
|
-
}
|
|
556
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
557
|
-
cleanValue = cleanValue.split(",")[0];
|
|
558
|
-
}
|
|
559
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
560
|
-
cleanValue = cleanValue.split(":")[0];
|
|
561
|
-
}
|
|
562
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
563
|
-
cleanValue = cleanValue.split("#")[1];
|
|
564
|
-
}
|
|
565
|
-
return cleanValue;
|
|
566
|
-
};
|
|
567
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
568
|
-
if (headerKey !== undefined) {
|
|
569
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
570
|
-
}
|
|
571
|
-
if (data.code !== undefined) {
|
|
572
|
-
return sanitizeErrorCode(data.code);
|
|
573
|
-
}
|
|
574
|
-
if (data["__type"] !== undefined) {
|
|
575
|
-
return sanitizeErrorCode(data["__type"]);
|
|
576
|
-
}
|
|
577
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-pi",
|
|
3
3
|
"description": "AWS SDK for JavaScript Pi 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-pi",
|
|
@@ -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",
|