@aws-sdk/client-swf 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
@@ -261,6 +261,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
261
261
  var import_types = require("@smithy/types");
262
262
 
263
263
  // src/protocols/Aws_json1_0.ts
264
+ var import_core2 = require("@aws-sdk/core");
264
265
 
265
266
 
266
267
 
@@ -878,7 +879,7 @@ var de_CountClosedWorkflowExecutionsCommand = /* @__PURE__ */ __name(async (outp
878
879
  if (output.statusCode >= 300) {
879
880
  return de_CommandError(output, context);
880
881
  }
881
- const data = await parseBody(output.body, context);
882
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
882
883
  let contents = {};
883
884
  contents = (0, import_smithy_client._json)(data);
884
885
  const response = {
@@ -891,7 +892,7 @@ var de_CountOpenWorkflowExecutionsCommand = /* @__PURE__ */ __name(async (output
891
892
  if (output.statusCode >= 300) {
892
893
  return de_CommandError(output, context);
893
894
  }
894
- const data = await parseBody(output.body, context);
895
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
895
896
  let contents = {};
896
897
  contents = (0, import_smithy_client._json)(data);
897
898
  const response = {
@@ -904,7 +905,7 @@ var de_CountPendingActivityTasksCommand = /* @__PURE__ */ __name(async (output,
904
905
  if (output.statusCode >= 300) {
905
906
  return de_CommandError(output, context);
906
907
  }
907
- const data = await parseBody(output.body, context);
908
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
908
909
  let contents = {};
909
910
  contents = (0, import_smithy_client._json)(data);
910
911
  const response = {
@@ -917,7 +918,7 @@ var de_CountPendingDecisionTasksCommand = /* @__PURE__ */ __name(async (output,
917
918
  if (output.statusCode >= 300) {
918
919
  return de_CommandError(output, context);
919
920
  }
920
- const data = await parseBody(output.body, context);
921
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
921
922
  let contents = {};
922
923
  contents = (0, import_smithy_client._json)(data);
923
924
  const response = {
@@ -960,7 +961,7 @@ var de_DescribeActivityTypeCommand = /* @__PURE__ */ __name(async (output, conte
960
961
  if (output.statusCode >= 300) {
961
962
  return de_CommandError(output, context);
962
963
  }
963
- const data = await parseBody(output.body, context);
964
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
964
965
  let contents = {};
965
966
  contents = de_ActivityTypeDetail(data, context);
966
967
  const response = {
@@ -973,7 +974,7 @@ var de_DescribeDomainCommand = /* @__PURE__ */ __name(async (output, context) =>
973
974
  if (output.statusCode >= 300) {
974
975
  return de_CommandError(output, context);
975
976
  }
976
- const data = await parseBody(output.body, context);
977
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
977
978
  let contents = {};
978
979
  contents = (0, import_smithy_client._json)(data);
979
980
  const response = {
@@ -986,7 +987,7 @@ var de_DescribeWorkflowExecutionCommand = /* @__PURE__ */ __name(async (output,
986
987
  if (output.statusCode >= 300) {
987
988
  return de_CommandError(output, context);
988
989
  }
989
- const data = await parseBody(output.body, context);
990
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
990
991
  let contents = {};
991
992
  contents = de_WorkflowExecutionDetail(data, context);
992
993
  const response = {
@@ -999,7 +1000,7 @@ var de_DescribeWorkflowTypeCommand = /* @__PURE__ */ __name(async (output, conte
999
1000
  if (output.statusCode >= 300) {
1000
1001
  return de_CommandError(output, context);
1001
1002
  }
1002
- const data = await parseBody(output.body, context);
1003
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1003
1004
  let contents = {};
1004
1005
  contents = de_WorkflowTypeDetail(data, context);
1005
1006
  const response = {
@@ -1012,7 +1013,7 @@ var de_GetWorkflowExecutionHistoryCommand = /* @__PURE__ */ __name(async (output
1012
1013
  if (output.statusCode >= 300) {
1013
1014
  return de_CommandError(output, context);
1014
1015
  }
1015
- const data = await parseBody(output.body, context);
1016
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1016
1017
  let contents = {};
1017
1018
  contents = de_History(data, context);
1018
1019
  const response = {
@@ -1025,7 +1026,7 @@ var de_ListActivityTypesCommand = /* @__PURE__ */ __name(async (output, context)
1025
1026
  if (output.statusCode >= 300) {
1026
1027
  return de_CommandError(output, context);
1027
1028
  }
1028
- const data = await parseBody(output.body, context);
1029
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1029
1030
  let contents = {};
1030
1031
  contents = de_ActivityTypeInfos(data, context);
1031
1032
  const response = {
@@ -1038,7 +1039,7 @@ var de_ListClosedWorkflowExecutionsCommand = /* @__PURE__ */ __name(async (outpu
1038
1039
  if (output.statusCode >= 300) {
1039
1040
  return de_CommandError(output, context);
1040
1041
  }
1041
- const data = await parseBody(output.body, context);
1042
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1042
1043
  let contents = {};
1043
1044
  contents = de_WorkflowExecutionInfos(data, context);
1044
1045
  const response = {
@@ -1051,7 +1052,7 @@ var de_ListDomainsCommand = /* @__PURE__ */ __name(async (output, context) => {
1051
1052
  if (output.statusCode >= 300) {
1052
1053
  return de_CommandError(output, context);
1053
1054
  }
1054
- const data = await parseBody(output.body, context);
1055
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1055
1056
  let contents = {};
1056
1057
  contents = (0, import_smithy_client._json)(data);
1057
1058
  const response = {
@@ -1064,7 +1065,7 @@ var de_ListOpenWorkflowExecutionsCommand = /* @__PURE__ */ __name(async (output,
1064
1065
  if (output.statusCode >= 300) {
1065
1066
  return de_CommandError(output, context);
1066
1067
  }
1067
- const data = await parseBody(output.body, context);
1068
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1068
1069
  let contents = {};
1069
1070
  contents = de_WorkflowExecutionInfos(data, context);
1070
1071
  const response = {
@@ -1077,7 +1078,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
1077
1078
  if (output.statusCode >= 300) {
1078
1079
  return de_CommandError(output, context);
1079
1080
  }
1080
- const data = await parseBody(output.body, context);
1081
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1081
1082
  let contents = {};
1082
1083
  contents = (0, import_smithy_client._json)(data);
1083
1084
  const response = {
@@ -1090,7 +1091,7 @@ var de_ListWorkflowTypesCommand = /* @__PURE__ */ __name(async (output, context)
1090
1091
  if (output.statusCode >= 300) {
1091
1092
  return de_CommandError(output, context);
1092
1093
  }
1093
- const data = await parseBody(output.body, context);
1094
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1094
1095
  let contents = {};
1095
1096
  contents = de_WorkflowTypeInfos(data, context);
1096
1097
  const response = {
@@ -1103,7 +1104,7 @@ var de_PollForActivityTaskCommand = /* @__PURE__ */ __name(async (output, contex
1103
1104
  if (output.statusCode >= 300) {
1104
1105
  return de_CommandError(output, context);
1105
1106
  }
1106
- const data = await parseBody(output.body, context);
1107
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1107
1108
  let contents = {};
1108
1109
  contents = (0, import_smithy_client._json)(data);
1109
1110
  const response = {
@@ -1116,7 +1117,7 @@ var de_PollForDecisionTaskCommand = /* @__PURE__ */ __name(async (output, contex
1116
1117
  if (output.statusCode >= 300) {
1117
1118
  return de_CommandError(output, context);
1118
1119
  }
1119
- const data = await parseBody(output.body, context);
1120
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1120
1121
  let contents = {};
1121
1122
  contents = de_DecisionTask(data, context);
1122
1123
  const response = {
@@ -1129,7 +1130,7 @@ var de_RecordActivityTaskHeartbeatCommand = /* @__PURE__ */ __name(async (output
1129
1130
  if (output.statusCode >= 300) {
1130
1131
  return de_CommandError(output, context);
1131
1132
  }
1132
- const data = await parseBody(output.body, context);
1133
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1133
1134
  let contents = {};
1134
1135
  contents = (0, import_smithy_client._json)(data);
1135
1136
  const response = {
@@ -1232,7 +1233,7 @@ var de_StartWorkflowExecutionCommand = /* @__PURE__ */ __name(async (output, con
1232
1233
  if (output.statusCode >= 300) {
1233
1234
  return de_CommandError(output, context);
1234
1235
  }
1235
- const data = await parseBody(output.body, context);
1236
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1236
1237
  let contents = {};
1237
1238
  contents = (0, import_smithy_client._json)(data);
1238
1239
  const response = {
@@ -1304,9 +1305,9 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
1304
1305
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1305
1306
  const parsedOutput = {
1306
1307
  ...output,
1307
- body: await parseErrorBody(output.body, context)
1308
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1308
1309
  };
1309
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1310
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1310
1311
  switch (errorCode) {
1311
1312
  case "OperationNotPermittedFault":
1312
1313
  case "com.amazonaws.swf#OperationNotPermittedFault":
@@ -1667,7 +1668,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1667
1668
  extendedRequestId: output.headers["x-amz-id-2"],
1668
1669
  cfId: output.headers["x-amz-cf-id"]
1669
1670
  }), "deserializeMetadata");
1670
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1671
1671
  var throwDefaultError = (0, import_smithy_client.withBaseException)(SWFServiceException);
1672
1672
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1673
1673
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1694,46 +1694,6 @@ function sharedHeaders(operation) {
1694
1694
  };
1695
1695
  }
1696
1696
  __name(sharedHeaders, "sharedHeaders");
1697
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1698
- if (encoded.length) {
1699
- return JSON.parse(encoded);
1700
- }
1701
- return {};
1702
- }), "parseBody");
1703
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1704
- const value = await parseBody(errorBody, context);
1705
- value.message = value.message ?? value.Message;
1706
- return value;
1707
- }, "parseErrorBody");
1708
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1709
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1710
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1711
- let cleanValue = rawValue;
1712
- if (typeof cleanValue === "number") {
1713
- cleanValue = cleanValue.toString();
1714
- }
1715
- if (cleanValue.indexOf(",") >= 0) {
1716
- cleanValue = cleanValue.split(",")[0];
1717
- }
1718
- if (cleanValue.indexOf(":") >= 0) {
1719
- cleanValue = cleanValue.split(":")[0];
1720
- }
1721
- if (cleanValue.indexOf("#") >= 0) {
1722
- cleanValue = cleanValue.split("#")[1];
1723
- }
1724
- return cleanValue;
1725
- }, "sanitizeErrorCode");
1726
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1727
- if (headerKey !== void 0) {
1728
- return sanitizeErrorCode(output.headers[headerKey]);
1729
- }
1730
- if (data.code !== void 0) {
1731
- return sanitizeErrorCode(data.code);
1732
- }
1733
- if (data["__type"] !== void 0) {
1734
- return sanitizeErrorCode(data["__type"]);
1735
- }
1736
- }, "loadRestJsonErrorCode");
1737
1697
 
1738
1698
  // src/commands/CountClosedWorkflowExecutionsCommand.ts
1739
1699
  var _CountClosedWorkflowExecutionsCommand = class _CountClosedWorkflowExecutionsCommand 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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { DefaultUndefinedFault, DomainAlreadyExistsFault, DomainDeprecatedFault, LimitExceededFault, OperationNotPermittedFault, TooManyTagsFault, TypeAlreadyExistsFault, TypeDeprecatedFault, UnknownResourceFault, WorkflowExecutionAlreadyStartedFault, } from "../models/models_0";
@@ -1051,43 +1052,3 @@ function sharedHeaders(operation) {
1051
1052
  "x-amz-target": `SimpleWorkflowService.${operation}`,
1052
1053
  };
1053
1054
  }
1054
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1055
- if (encoded.length) {
1056
- return JSON.parse(encoded);
1057
- }
1058
- return {};
1059
- });
1060
- const parseErrorBody = async (errorBody, context) => {
1061
- const value = await parseBody(errorBody, context);
1062
- value.message = value.message ?? value.Message;
1063
- return value;
1064
- };
1065
- const loadRestJsonErrorCode = (output, data) => {
1066
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1067
- const sanitizeErrorCode = (rawValue) => {
1068
- let cleanValue = rawValue;
1069
- if (typeof cleanValue === "number") {
1070
- cleanValue = cleanValue.toString();
1071
- }
1072
- if (cleanValue.indexOf(",") >= 0) {
1073
- cleanValue = cleanValue.split(",")[0];
1074
- }
1075
- if (cleanValue.indexOf(":") >= 0) {
1076
- cleanValue = cleanValue.split(":")[0];
1077
- }
1078
- if (cleanValue.indexOf("#") >= 0) {
1079
- cleanValue = cleanValue.split("#")[1];
1080
- }
1081
- return cleanValue;
1082
- };
1083
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1084
- if (headerKey !== undefined) {
1085
- return sanitizeErrorCode(output.headers[headerKey]);
1086
- }
1087
- if (data.code !== undefined) {
1088
- return sanitizeErrorCode(data.code);
1089
- }
1090
- if (data["__type"] !== undefined) {
1091
- return sanitizeErrorCode(data["__type"]);
1092
- }
1093
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-swf",
3
3
  "description": "AWS SDK for JavaScript Swf 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-swf",
@@ -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",