@aws-sdk/client-kafkaconnect 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 CHANGED
@@ -427,6 +427,7 @@ var DescribeWorkerConfigurationResponseFilterSensitiveLog = /* @__PURE__ */ __na
427
427
  }), "DescribeWorkerConfigurationResponseFilterSensitiveLog");
428
428
 
429
429
  // src/protocols/Aws_restJson1.ts
430
+ var import_core2 = require("@aws-sdk/core");
430
431
 
431
432
 
432
433
  var se_CreateConnectorCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -655,7 +656,7 @@ var de_CreateConnectorCommand = /* @__PURE__ */ __name(async (output, context) =
655
656
  const contents = (0, import_smithy_client.map)({
656
657
  $metadata: deserializeMetadata(output)
657
658
  });
658
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
659
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
659
660
  const doc = (0, import_smithy_client.take)(data, {
660
661
  connectorArn: import_smithy_client.expectString,
661
662
  connectorName: import_smithy_client.expectString,
@@ -671,7 +672,7 @@ var de_CreateCustomPluginCommand = /* @__PURE__ */ __name(async (output, context
671
672
  const contents = (0, import_smithy_client.map)({
672
673
  $metadata: deserializeMetadata(output)
673
674
  });
674
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
675
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
675
676
  const doc = (0, import_smithy_client.take)(data, {
676
677
  customPluginArn: import_smithy_client.expectString,
677
678
  customPluginState: import_smithy_client.expectString,
@@ -688,7 +689,7 @@ var de_CreateWorkerConfigurationCommand = /* @__PURE__ */ __name(async (output,
688
689
  const contents = (0, import_smithy_client.map)({
689
690
  $metadata: deserializeMetadata(output)
690
691
  });
691
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
692
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
692
693
  const doc = (0, import_smithy_client.take)(data, {
693
694
  creationTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
694
695
  latestRevision: (_) => de_WorkerConfigurationRevisionSummary(_, context),
@@ -706,7 +707,7 @@ var de_DeleteConnectorCommand = /* @__PURE__ */ __name(async (output, context) =
706
707
  const contents = (0, import_smithy_client.map)({
707
708
  $metadata: deserializeMetadata(output)
708
709
  });
709
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
710
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
710
711
  const doc = (0, import_smithy_client.take)(data, {
711
712
  connectorArn: import_smithy_client.expectString,
712
713
  connectorState: import_smithy_client.expectString
@@ -721,7 +722,7 @@ var de_DeleteCustomPluginCommand = /* @__PURE__ */ __name(async (output, context
721
722
  const contents = (0, import_smithy_client.map)({
722
723
  $metadata: deserializeMetadata(output)
723
724
  });
724
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
725
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
725
726
  const doc = (0, import_smithy_client.take)(data, {
726
727
  customPluginArn: import_smithy_client.expectString,
727
728
  customPluginState: import_smithy_client.expectString
@@ -736,7 +737,7 @@ var de_DeleteWorkerConfigurationCommand = /* @__PURE__ */ __name(async (output,
736
737
  const contents = (0, import_smithy_client.map)({
737
738
  $metadata: deserializeMetadata(output)
738
739
  });
739
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
740
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
740
741
  const doc = (0, import_smithy_client.take)(data, {
741
742
  workerConfigurationArn: import_smithy_client.expectString,
742
743
  workerConfigurationState: import_smithy_client.expectString
@@ -751,7 +752,7 @@ var de_DescribeConnectorCommand = /* @__PURE__ */ __name(async (output, context)
751
752
  const contents = (0, import_smithy_client.map)({
752
753
  $metadata: deserializeMetadata(output)
753
754
  });
754
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
755
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
755
756
  const doc = (0, import_smithy_client.take)(data, {
756
757
  capacity: import_smithy_client._json,
757
758
  connectorArn: import_smithy_client.expectString,
@@ -781,7 +782,7 @@ var de_DescribeCustomPluginCommand = /* @__PURE__ */ __name(async (output, conte
781
782
  const contents = (0, import_smithy_client.map)({
782
783
  $metadata: deserializeMetadata(output)
783
784
  });
784
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
785
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
785
786
  const doc = (0, import_smithy_client.take)(data, {
786
787
  creationTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
787
788
  customPluginArn: import_smithy_client.expectString,
@@ -801,7 +802,7 @@ var de_DescribeWorkerConfigurationCommand = /* @__PURE__ */ __name(async (output
801
802
  const contents = (0, import_smithy_client.map)({
802
803
  $metadata: deserializeMetadata(output)
803
804
  });
804
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
805
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
805
806
  const doc = (0, import_smithy_client.take)(data, {
806
807
  creationTime: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)),
807
808
  description: import_smithy_client.expectString,
@@ -820,7 +821,7 @@ var de_ListConnectorsCommand = /* @__PURE__ */ __name(async (output, context) =>
820
821
  const contents = (0, import_smithy_client.map)({
821
822
  $metadata: deserializeMetadata(output)
822
823
  });
823
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
824
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
824
825
  const doc = (0, import_smithy_client.take)(data, {
825
826
  connectors: (_) => de___listOfConnectorSummary(_, context),
826
827
  nextToken: import_smithy_client.expectString
@@ -835,7 +836,7 @@ var de_ListCustomPluginsCommand = /* @__PURE__ */ __name(async (output, context)
835
836
  const contents = (0, import_smithy_client.map)({
836
837
  $metadata: deserializeMetadata(output)
837
838
  });
838
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
839
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
839
840
  const doc = (0, import_smithy_client.take)(data, {
840
841
  customPlugins: (_) => de___listOfCustomPluginSummary(_, context),
841
842
  nextToken: import_smithy_client.expectString
@@ -850,7 +851,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
850
851
  const contents = (0, import_smithy_client.map)({
851
852
  $metadata: deserializeMetadata(output)
852
853
  });
853
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
854
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
854
855
  const doc = (0, import_smithy_client.take)(data, {
855
856
  tags: import_smithy_client._json
856
857
  });
@@ -864,7 +865,7 @@ var de_ListWorkerConfigurationsCommand = /* @__PURE__ */ __name(async (output, c
864
865
  const contents = (0, import_smithy_client.map)({
865
866
  $metadata: deserializeMetadata(output)
866
867
  });
867
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
868
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
868
869
  const doc = (0, import_smithy_client.take)(data, {
869
870
  nextToken: import_smithy_client.expectString,
870
871
  workerConfigurations: (_) => de___listOfWorkerConfigurationSummary(_, context)
@@ -899,7 +900,7 @@ var de_UpdateConnectorCommand = /* @__PURE__ */ __name(async (output, context) =
899
900
  const contents = (0, import_smithy_client.map)({
900
901
  $metadata: deserializeMetadata(output)
901
902
  });
902
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
903
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
903
904
  const doc = (0, import_smithy_client.take)(data, {
904
905
  connectorArn: import_smithy_client.expectString,
905
906
  connectorState: import_smithy_client.expectString
@@ -910,9 +911,9 @@ var de_UpdateConnectorCommand = /* @__PURE__ */ __name(async (output, context) =
910
911
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
911
912
  const parsedOutput = {
912
913
  ...output,
913
- body: await parseErrorBody(output.body, context)
914
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
914
915
  };
915
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
916
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
916
917
  switch (errorCode) {
917
918
  case "BadRequestException":
918
919
  case "com.amazonaws.kafkaconnect#BadRequestException":
@@ -1140,53 +1141,12 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1140
1141
  extendedRequestId: output.headers["x-amz-id-2"],
1141
1142
  cfId: output.headers["x-amz-cf-id"]
1142
1143
  }), "deserializeMetadata");
1143
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1144
1144
  var _cNP = "connectorNamePrefix";
1145
1145
  var _cV = "currentVersion";
1146
1146
  var _mR = "maxResults";
1147
1147
  var _nP = "namePrefix";
1148
1148
  var _nT = "nextToken";
1149
1149
  var _tK = "tagKeys";
1150
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1151
- if (encoded.length) {
1152
- return JSON.parse(encoded);
1153
- }
1154
- return {};
1155
- }), "parseBody");
1156
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1157
- const value = await parseBody(errorBody, context);
1158
- value.message = value.message ?? value.Message;
1159
- return value;
1160
- }, "parseErrorBody");
1161
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1162
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1163
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1164
- let cleanValue = rawValue;
1165
- if (typeof cleanValue === "number") {
1166
- cleanValue = cleanValue.toString();
1167
- }
1168
- if (cleanValue.indexOf(",") >= 0) {
1169
- cleanValue = cleanValue.split(",")[0];
1170
- }
1171
- if (cleanValue.indexOf(":") >= 0) {
1172
- cleanValue = cleanValue.split(":")[0];
1173
- }
1174
- if (cleanValue.indexOf("#") >= 0) {
1175
- cleanValue = cleanValue.split("#")[1];
1176
- }
1177
- return cleanValue;
1178
- }, "sanitizeErrorCode");
1179
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1180
- if (headerKey !== void 0) {
1181
- return sanitizeErrorCode(output.headers[headerKey]);
1182
- }
1183
- if (data.code !== void 0) {
1184
- return sanitizeErrorCode(data.code);
1185
- }
1186
- if (data["__type"] !== void 0) {
1187
- return sanitizeErrorCode(data["__type"]);
1188
- }
1189
- }, "loadRestJsonErrorCode");
1190
1150
 
1191
1151
  // src/commands/CreateConnectorCommand.ts
1192
1152
  var _CreateConnectorCommand = class _CreateConnectorCommand 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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { KafkaConnectServiceException as __BaseException } from "../models/KafkaConnectServiceException";
@@ -721,43 +722,3 @@ const _mR = "maxResults";
721
722
  const _nP = "namePrefix";
722
723
  const _nT = "nextToken";
723
724
  const _tK = "tagKeys";
724
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
725
- if (encoded.length) {
726
- return JSON.parse(encoded);
727
- }
728
- return {};
729
- });
730
- const parseErrorBody = async (errorBody, context) => {
731
- const value = await parseBody(errorBody, context);
732
- value.message = value.message ?? value.Message;
733
- return value;
734
- };
735
- const loadRestJsonErrorCode = (output, data) => {
736
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
737
- const sanitizeErrorCode = (rawValue) => {
738
- let cleanValue = rawValue;
739
- if (typeof cleanValue === "number") {
740
- cleanValue = cleanValue.toString();
741
- }
742
- if (cleanValue.indexOf(",") >= 0) {
743
- cleanValue = cleanValue.split(",")[0];
744
- }
745
- if (cleanValue.indexOf(":") >= 0) {
746
- cleanValue = cleanValue.split(":")[0];
747
- }
748
- if (cleanValue.indexOf("#") >= 0) {
749
- cleanValue = cleanValue.split("#")[1];
750
- }
751
- return cleanValue;
752
- };
753
- const headerKey = findKey(output.headers, "x-amzn-errortype");
754
- if (headerKey !== undefined) {
755
- return sanitizeErrorCode(output.headers[headerKey]);
756
- }
757
- if (data.code !== undefined) {
758
- return sanitizeErrorCode(data.code);
759
- }
760
- if (data["__type"] !== undefined) {
761
- return sanitizeErrorCode(data["__type"]);
762
- }
763
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kafkaconnect",
3
3
  "description": "AWS SDK for JavaScript Kafkaconnect Client for Node.js, Browser and React Native",
4
- "version": "3.525.0",
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-kafkaconnect",
@@ -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.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",