@aws-sdk/client-rum 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 +12 -52
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -213,6 +213,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
213
213
|
var import_types = require("@smithy/types");
|
|
214
214
|
|
|
215
215
|
// src/protocols/Aws_restJson1.ts
|
|
216
|
+
var import_core2 = require("@aws-sdk/core");
|
|
216
217
|
|
|
217
218
|
|
|
218
219
|
|
|
@@ -667,7 +668,7 @@ var de_BatchCreateRumMetricDefinitionsCommand = /* @__PURE__ */ __name(async (ou
|
|
|
667
668
|
const contents = (0, import_smithy_client.map)({
|
|
668
669
|
$metadata: deserializeMetadata(output)
|
|
669
670
|
});
|
|
670
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
671
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
671
672
|
const doc = (0, import_smithy_client.take)(data, {
|
|
672
673
|
Errors: import_smithy_client._json,
|
|
673
674
|
MetricDefinitions: import_smithy_client._json
|
|
@@ -682,7 +683,7 @@ var de_BatchDeleteRumMetricDefinitionsCommand = /* @__PURE__ */ __name(async (ou
|
|
|
682
683
|
const contents = (0, import_smithy_client.map)({
|
|
683
684
|
$metadata: deserializeMetadata(output)
|
|
684
685
|
});
|
|
685
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
686
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
686
687
|
const doc = (0, import_smithy_client.take)(data, {
|
|
687
688
|
Errors: import_smithy_client._json,
|
|
688
689
|
MetricDefinitionIds: import_smithy_client._json
|
|
@@ -697,7 +698,7 @@ var de_BatchGetRumMetricDefinitionsCommand = /* @__PURE__ */ __name(async (outpu
|
|
|
697
698
|
const contents = (0, import_smithy_client.map)({
|
|
698
699
|
$metadata: deserializeMetadata(output)
|
|
699
700
|
});
|
|
700
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
701
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
701
702
|
const doc = (0, import_smithy_client.take)(data, {
|
|
702
703
|
MetricDefinitions: import_smithy_client._json,
|
|
703
704
|
NextToken: import_smithy_client.expectString
|
|
@@ -712,7 +713,7 @@ var de_CreateAppMonitorCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
712
713
|
const contents = (0, import_smithy_client.map)({
|
|
713
714
|
$metadata: deserializeMetadata(output)
|
|
714
715
|
});
|
|
715
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
716
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
716
717
|
const doc = (0, import_smithy_client.take)(data, {
|
|
717
718
|
Id: import_smithy_client.expectString
|
|
718
719
|
});
|
|
@@ -746,7 +747,7 @@ var de_GetAppMonitorCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
746
747
|
const contents = (0, import_smithy_client.map)({
|
|
747
748
|
$metadata: deserializeMetadata(output)
|
|
748
749
|
});
|
|
749
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
750
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
750
751
|
const doc = (0, import_smithy_client.take)(data, {
|
|
751
752
|
AppMonitor: (_) => de_AppMonitor(_, context)
|
|
752
753
|
});
|
|
@@ -760,7 +761,7 @@ var de_GetAppMonitorDataCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
760
761
|
const contents = (0, import_smithy_client.map)({
|
|
761
762
|
$metadata: deserializeMetadata(output)
|
|
762
763
|
});
|
|
763
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
764
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
764
765
|
const doc = (0, import_smithy_client.take)(data, {
|
|
765
766
|
Events: import_smithy_client._json,
|
|
766
767
|
NextToken: import_smithy_client.expectString
|
|
@@ -775,7 +776,7 @@ var de_ListAppMonitorsCommand = /* @__PURE__ */ __name(async (output, context) =
|
|
|
775
776
|
const contents = (0, import_smithy_client.map)({
|
|
776
777
|
$metadata: deserializeMetadata(output)
|
|
777
778
|
});
|
|
778
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
779
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
779
780
|
const doc = (0, import_smithy_client.take)(data, {
|
|
780
781
|
AppMonitorSummaries: import_smithy_client._json,
|
|
781
782
|
NextToken: import_smithy_client.expectString
|
|
@@ -790,7 +791,7 @@ var de_ListRumMetricsDestinationsCommand = /* @__PURE__ */ __name(async (output,
|
|
|
790
791
|
const contents = (0, import_smithy_client.map)({
|
|
791
792
|
$metadata: deserializeMetadata(output)
|
|
792
793
|
});
|
|
793
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
794
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
794
795
|
const doc = (0, import_smithy_client.take)(data, {
|
|
795
796
|
Destinations: import_smithy_client._json,
|
|
796
797
|
NextToken: import_smithy_client.expectString
|
|
@@ -805,7 +806,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
|
|
|
805
806
|
const contents = (0, import_smithy_client.map)({
|
|
806
807
|
$metadata: deserializeMetadata(output)
|
|
807
808
|
});
|
|
808
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await
|
|
809
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
809
810
|
const doc = (0, import_smithy_client.take)(data, {
|
|
810
811
|
ResourceArn: import_smithy_client.expectString,
|
|
811
812
|
Tags: import_smithy_client._json
|
|
@@ -876,9 +877,9 @@ var de_UpdateRumMetricDefinitionCommand = /* @__PURE__ */ __name(async (output,
|
|
|
876
877
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
877
878
|
const parsedOutput = {
|
|
878
879
|
...output,
|
|
879
|
-
body: await
|
|
880
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
880
881
|
};
|
|
881
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
882
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
882
883
|
switch (errorCode) {
|
|
883
884
|
case "AccessDeniedException":
|
|
884
885
|
case "com.amazonaws.rum#AccessDeniedException":
|
|
@@ -1072,7 +1073,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
1072
1073
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1073
1074
|
cfId: output.headers["x-amz-cf-id"]
|
|
1074
1075
|
}), "deserializeMetadata");
|
|
1075
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
1076
1076
|
var _D = "Destination";
|
|
1077
1077
|
var _DA = "DestinationArn";
|
|
1078
1078
|
var _MDI = "MetricDefinitionIds";
|
|
@@ -1087,46 +1087,6 @@ var _nT = "nextToken";
|
|
|
1087
1087
|
var _rAS = "retryAfterSeconds";
|
|
1088
1088
|
var _ra = "retry-after";
|
|
1089
1089
|
var _tK = "tagKeys";
|
|
1090
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1091
|
-
if (encoded.length) {
|
|
1092
|
-
return JSON.parse(encoded);
|
|
1093
|
-
}
|
|
1094
|
-
return {};
|
|
1095
|
-
}), "parseBody");
|
|
1096
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
1097
|
-
const value = await parseBody(errorBody, context);
|
|
1098
|
-
value.message = value.message ?? value.Message;
|
|
1099
|
-
return value;
|
|
1100
|
-
}, "parseErrorBody");
|
|
1101
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
1102
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
1103
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
1104
|
-
let cleanValue = rawValue;
|
|
1105
|
-
if (typeof cleanValue === "number") {
|
|
1106
|
-
cleanValue = cleanValue.toString();
|
|
1107
|
-
}
|
|
1108
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1109
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1110
|
-
}
|
|
1111
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1112
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1113
|
-
}
|
|
1114
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1115
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1116
|
-
}
|
|
1117
|
-
return cleanValue;
|
|
1118
|
-
}, "sanitizeErrorCode");
|
|
1119
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1120
|
-
if (headerKey !== void 0) {
|
|
1121
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1122
|
-
}
|
|
1123
|
-
if (data.code !== void 0) {
|
|
1124
|
-
return sanitizeErrorCode(data.code);
|
|
1125
|
-
}
|
|
1126
|
-
if (data["__type"] !== void 0) {
|
|
1127
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1128
|
-
}
|
|
1129
|
-
}, "loadRestJsonErrorCode");
|
|
1130
1090
|
|
|
1131
1091
|
// src/commands/BatchCreateRumMetricDefinitionsCommand.ts
|
|
1132
1092
|
var _BatchCreateRumMetricDefinitionsCommand = class _BatchCreateRumMetricDefinitionsCommand 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 { requestBuilder as rb } from "@smithy/core";
|
|
2
3
|
import { isValidHostname as __isValidHostname, } from "@smithy/protocol-http";
|
|
3
4
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, limitedParseDouble as __limitedParseDouble, map, serializeFloat as __serializeFloat, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
|
|
@@ -689,43 +690,3 @@ const _nT = "nextToken";
|
|
|
689
690
|
const _rAS = "retryAfterSeconds";
|
|
690
691
|
const _ra = "retry-after";
|
|
691
692
|
const _tK = "tagKeys";
|
|
692
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
693
|
-
if (encoded.length) {
|
|
694
|
-
return JSON.parse(encoded);
|
|
695
|
-
}
|
|
696
|
-
return {};
|
|
697
|
-
});
|
|
698
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
699
|
-
const value = await parseBody(errorBody, context);
|
|
700
|
-
value.message = value.message ?? value.Message;
|
|
701
|
-
return value;
|
|
702
|
-
};
|
|
703
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
704
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
705
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
706
|
-
let cleanValue = rawValue;
|
|
707
|
-
if (typeof cleanValue === "number") {
|
|
708
|
-
cleanValue = cleanValue.toString();
|
|
709
|
-
}
|
|
710
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
711
|
-
cleanValue = cleanValue.split(",")[0];
|
|
712
|
-
}
|
|
713
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
714
|
-
cleanValue = cleanValue.split(":")[0];
|
|
715
|
-
}
|
|
716
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
717
|
-
cleanValue = cleanValue.split("#")[1];
|
|
718
|
-
}
|
|
719
|
-
return cleanValue;
|
|
720
|
-
};
|
|
721
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
722
|
-
if (headerKey !== undefined) {
|
|
723
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
724
|
-
}
|
|
725
|
-
if (data.code !== undefined) {
|
|
726
|
-
return sanitizeErrorCode(data.code);
|
|
727
|
-
}
|
|
728
|
-
if (data["__type"] !== undefined) {
|
|
729
|
-
return sanitizeErrorCode(data["__type"]);
|
|
730
|
-
}
|
|
731
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-rum",
|
|
3
3
|
"description": "AWS SDK for JavaScript Rum Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
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-rum",
|
|
@@ -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.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",
|