@aws-sdk/client-internetmonitor 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 CHANGED
@@ -219,6 +219,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
219
219
  var import_types = require("@smithy/types");
220
220
 
221
221
  // src/protocols/Aws_restJson1.ts
222
+ var import_core2 = require("@aws-sdk/core");
222
223
 
223
224
 
224
225
  var import_uuid = require("uuid");
@@ -689,7 +690,7 @@ var de_CreateMonitorCommand = /* @__PURE__ */ __name(async (output, context) =>
689
690
  const contents = (0, import_smithy_client.map)({
690
691
  $metadata: deserializeMetadata(output)
691
692
  });
692
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
693
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
693
694
  const doc = (0, import_smithy_client.take)(data, {
694
695
  Arn: import_smithy_client.expectString,
695
696
  Status: import_smithy_client.expectString
@@ -714,7 +715,7 @@ var de_GetHealthEventCommand = /* @__PURE__ */ __name(async (output, context) =>
714
715
  const contents = (0, import_smithy_client.map)({
715
716
  $metadata: deserializeMetadata(output)
716
717
  });
717
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
718
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
718
719
  const doc = (0, import_smithy_client.take)(data, {
719
720
  CreatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
720
721
  EndedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
@@ -738,7 +739,7 @@ var de_GetMonitorCommand = /* @__PURE__ */ __name(async (output, context) => {
738
739
  const contents = (0, import_smithy_client.map)({
739
740
  $metadata: deserializeMetadata(output)
740
741
  });
741
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
742
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
742
743
  const doc = (0, import_smithy_client.take)(data, {
743
744
  CreatedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
744
745
  HealthEventsConfig: (_) => de_HealthEventsConfig(_, context),
@@ -764,7 +765,7 @@ var de_GetQueryResultsCommand = /* @__PURE__ */ __name(async (output, context) =
764
765
  const contents = (0, import_smithy_client.map)({
765
766
  $metadata: deserializeMetadata(output)
766
767
  });
767
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
768
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
768
769
  const doc = (0, import_smithy_client.take)(data, {
769
770
  Data: import_smithy_client._json,
770
771
  Fields: import_smithy_client._json,
@@ -780,7 +781,7 @@ var de_GetQueryStatusCommand = /* @__PURE__ */ __name(async (output, context) =>
780
781
  const contents = (0, import_smithy_client.map)({
781
782
  $metadata: deserializeMetadata(output)
782
783
  });
783
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
784
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
784
785
  const doc = (0, import_smithy_client.take)(data, {
785
786
  Status: import_smithy_client.expectString
786
787
  });
@@ -794,7 +795,7 @@ var de_ListHealthEventsCommand = /* @__PURE__ */ __name(async (output, context)
794
795
  const contents = (0, import_smithy_client.map)({
795
796
  $metadata: deserializeMetadata(output)
796
797
  });
797
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
798
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
798
799
  const doc = (0, import_smithy_client.take)(data, {
799
800
  HealthEvents: (_) => de_HealthEventList(_, context),
800
801
  NextToken: import_smithy_client.expectString
@@ -809,7 +810,7 @@ var de_ListMonitorsCommand = /* @__PURE__ */ __name(async (output, context) => {
809
810
  const contents = (0, import_smithy_client.map)({
810
811
  $metadata: deserializeMetadata(output)
811
812
  });
812
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
813
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
813
814
  const doc = (0, import_smithy_client.take)(data, {
814
815
  Monitors: import_smithy_client._json,
815
816
  NextToken: import_smithy_client.expectString
@@ -824,7 +825,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
824
825
  const contents = (0, import_smithy_client.map)({
825
826
  $metadata: deserializeMetadata(output)
826
827
  });
827
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
828
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
828
829
  const doc = (0, import_smithy_client.take)(data, {
829
830
  Tags: import_smithy_client._json
830
831
  });
@@ -838,7 +839,7 @@ var de_StartQueryCommand = /* @__PURE__ */ __name(async (output, context) => {
838
839
  const contents = (0, import_smithy_client.map)({
839
840
  $metadata: deserializeMetadata(output)
840
841
  });
841
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
842
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
842
843
  const doc = (0, import_smithy_client.take)(data, {
843
844
  QueryId: import_smithy_client.expectString
844
845
  });
@@ -882,7 +883,7 @@ var de_UpdateMonitorCommand = /* @__PURE__ */ __name(async (output, context) =>
882
883
  const contents = (0, import_smithy_client.map)({
883
884
  $metadata: deserializeMetadata(output)
884
885
  });
885
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
886
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
886
887
  const doc = (0, import_smithy_client.take)(data, {
887
888
  MonitorArn: import_smithy_client.expectString,
888
889
  Status: import_smithy_client.expectString
@@ -893,9 +894,9 @@ var de_UpdateMonitorCommand = /* @__PURE__ */ __name(async (output, context) =>
893
894
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
894
895
  const parsedOutput = {
895
896
  ...output,
896
- body: await parseErrorBody(output.body, context)
897
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
897
898
  };
898
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
899
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
899
900
  switch (errorCode) {
900
901
  case "AccessDeniedException":
901
902
  case "com.amazonaws.internetmonitor#AccessDeniedException":
@@ -1193,7 +1194,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1193
1194
  extendedRequestId: output.headers["x-amz-id-2"],
1194
1195
  cfId: output.headers["x-amz-cf-id"]
1195
1196
  }), "deserializeMetadata");
1196
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1197
1197
  var _ES = "EventStatus";
1198
1198
  var _ET = "EndTime";
1199
1199
  var _MR = "MaxResults";
@@ -1202,46 +1202,6 @@ var _NT = "NextToken";
1202
1202
  var _ST = "StartTime";
1203
1203
  var _TK = "TagKeys";
1204
1204
  var _tK = "tagKeys";
1205
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1206
- if (encoded.length) {
1207
- return JSON.parse(encoded);
1208
- }
1209
- return {};
1210
- }), "parseBody");
1211
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1212
- const value = await parseBody(errorBody, context);
1213
- value.message = value.message ?? value.Message;
1214
- return value;
1215
- }, "parseErrorBody");
1216
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1217
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1218
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1219
- let cleanValue = rawValue;
1220
- if (typeof cleanValue === "number") {
1221
- cleanValue = cleanValue.toString();
1222
- }
1223
- if (cleanValue.indexOf(",") >= 0) {
1224
- cleanValue = cleanValue.split(",")[0];
1225
- }
1226
- if (cleanValue.indexOf(":") >= 0) {
1227
- cleanValue = cleanValue.split(":")[0];
1228
- }
1229
- if (cleanValue.indexOf("#") >= 0) {
1230
- cleanValue = cleanValue.split("#")[1];
1231
- }
1232
- return cleanValue;
1233
- }, "sanitizeErrorCode");
1234
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1235
- if (headerKey !== void 0) {
1236
- return sanitizeErrorCode(output.headers[headerKey]);
1237
- }
1238
- if (data.code !== void 0) {
1239
- return sanitizeErrorCode(data.code);
1240
- }
1241
- if (data["__type"] !== void 0) {
1242
- return sanitizeErrorCode(data["__type"]);
1243
- }
1244
- }, "loadRestJsonErrorCode");
1245
1205
 
1246
1206
  // src/commands/CreateMonitorCommand.ts
1247
1207
  var _CreateMonitorCommand = class _CreateMonitorCommand 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 { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
@@ -719,43 +720,3 @@ const _NT = "NextToken";
719
720
  const _ST = "StartTime";
720
721
  const _TK = "TagKeys";
721
722
  const _tK = "tagKeys";
722
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
723
- if (encoded.length) {
724
- return JSON.parse(encoded);
725
- }
726
- return {};
727
- });
728
- const parseErrorBody = async (errorBody, context) => {
729
- const value = await parseBody(errorBody, context);
730
- value.message = value.message ?? value.Message;
731
- return value;
732
- };
733
- const loadRestJsonErrorCode = (output, data) => {
734
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
735
- const sanitizeErrorCode = (rawValue) => {
736
- let cleanValue = rawValue;
737
- if (typeof cleanValue === "number") {
738
- cleanValue = cleanValue.toString();
739
- }
740
- if (cleanValue.indexOf(",") >= 0) {
741
- cleanValue = cleanValue.split(",")[0];
742
- }
743
- if (cleanValue.indexOf(":") >= 0) {
744
- cleanValue = cleanValue.split(":")[0];
745
- }
746
- if (cleanValue.indexOf("#") >= 0) {
747
- cleanValue = cleanValue.split("#")[1];
748
- }
749
- return cleanValue;
750
- };
751
- const headerKey = findKey(output.headers, "x-amzn-errortype");
752
- if (headerKey !== undefined) {
753
- return sanitizeErrorCode(output.headers[headerKey]);
754
- }
755
- if (data.code !== undefined) {
756
- return sanitizeErrorCode(data.code);
757
- }
758
- if (data["__type"] !== undefined) {
759
- return sanitizeErrorCode(data["__type"]);
760
- }
761
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-internetmonitor",
3
3
  "description": "AWS SDK for JavaScript Internetmonitor Client for Node.js, Browser and React Native",
4
- "version": "3.525.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-internetmonitor",
@@ -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.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",