@aws-sdk/client-sfn 3.310.0 → 3.312.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.
@@ -7,210 +7,147 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const SFNServiceException_1 = require("../models/SFNServiceException");
9
9
  const se_CreateActivityCommand = async (input, context) => {
10
- const headers = {
11
- "content-type": "application/x-amz-json-1.0",
12
- "x-amz-target": "AWSStepFunctions.CreateActivity",
13
- };
10
+ const headers = sharedHeaders("CreateActivity");
14
11
  let body;
15
12
  body = JSON.stringify(se_CreateActivityInput(input, context));
16
13
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
14
  };
18
15
  exports.se_CreateActivityCommand = se_CreateActivityCommand;
19
16
  const se_CreateStateMachineCommand = async (input, context) => {
20
- const headers = {
21
- "content-type": "application/x-amz-json-1.0",
22
- "x-amz-target": "AWSStepFunctions.CreateStateMachine",
23
- };
17
+ const headers = sharedHeaders("CreateStateMachine");
24
18
  let body;
25
19
  body = JSON.stringify(se_CreateStateMachineInput(input, context));
26
20
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
21
  };
28
22
  exports.se_CreateStateMachineCommand = se_CreateStateMachineCommand;
29
23
  const se_DeleteActivityCommand = async (input, context) => {
30
- const headers = {
31
- "content-type": "application/x-amz-json-1.0",
32
- "x-amz-target": "AWSStepFunctions.DeleteActivity",
33
- };
24
+ const headers = sharedHeaders("DeleteActivity");
34
25
  let body;
35
26
  body = JSON.stringify(se_DeleteActivityInput(input, context));
36
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
37
28
  };
38
29
  exports.se_DeleteActivityCommand = se_DeleteActivityCommand;
39
30
  const se_DeleteStateMachineCommand = async (input, context) => {
40
- const headers = {
41
- "content-type": "application/x-amz-json-1.0",
42
- "x-amz-target": "AWSStepFunctions.DeleteStateMachine",
43
- };
31
+ const headers = sharedHeaders("DeleteStateMachine");
44
32
  let body;
45
33
  body = JSON.stringify(se_DeleteStateMachineInput(input, context));
46
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
35
  };
48
36
  exports.se_DeleteStateMachineCommand = se_DeleteStateMachineCommand;
49
37
  const se_DescribeActivityCommand = async (input, context) => {
50
- const headers = {
51
- "content-type": "application/x-amz-json-1.0",
52
- "x-amz-target": "AWSStepFunctions.DescribeActivity",
53
- };
38
+ const headers = sharedHeaders("DescribeActivity");
54
39
  let body;
55
40
  body = JSON.stringify(se_DescribeActivityInput(input, context));
56
41
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
57
42
  };
58
43
  exports.se_DescribeActivityCommand = se_DescribeActivityCommand;
59
44
  const se_DescribeExecutionCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.0",
62
- "x-amz-target": "AWSStepFunctions.DescribeExecution",
63
- };
45
+ const headers = sharedHeaders("DescribeExecution");
64
46
  let body;
65
47
  body = JSON.stringify(se_DescribeExecutionInput(input, context));
66
48
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
49
  };
68
50
  exports.se_DescribeExecutionCommand = se_DescribeExecutionCommand;
69
51
  const se_DescribeMapRunCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.0",
72
- "x-amz-target": "AWSStepFunctions.DescribeMapRun",
73
- };
52
+ const headers = sharedHeaders("DescribeMapRun");
74
53
  let body;
75
54
  body = JSON.stringify(se_DescribeMapRunInput(input, context));
76
55
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
56
  };
78
57
  exports.se_DescribeMapRunCommand = se_DescribeMapRunCommand;
79
58
  const se_DescribeStateMachineCommand = async (input, context) => {
80
- const headers = {
81
- "content-type": "application/x-amz-json-1.0",
82
- "x-amz-target": "AWSStepFunctions.DescribeStateMachine",
83
- };
59
+ const headers = sharedHeaders("DescribeStateMachine");
84
60
  let body;
85
61
  body = JSON.stringify(se_DescribeStateMachineInput(input, context));
86
62
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
87
63
  };
88
64
  exports.se_DescribeStateMachineCommand = se_DescribeStateMachineCommand;
89
65
  const se_DescribeStateMachineForExecutionCommand = async (input, context) => {
90
- const headers = {
91
- "content-type": "application/x-amz-json-1.0",
92
- "x-amz-target": "AWSStepFunctions.DescribeStateMachineForExecution",
93
- };
66
+ const headers = sharedHeaders("DescribeStateMachineForExecution");
94
67
  let body;
95
68
  body = JSON.stringify(se_DescribeStateMachineForExecutionInput(input, context));
96
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
97
70
  };
98
71
  exports.se_DescribeStateMachineForExecutionCommand = se_DescribeStateMachineForExecutionCommand;
99
72
  const se_GetActivityTaskCommand = async (input, context) => {
100
- const headers = {
101
- "content-type": "application/x-amz-json-1.0",
102
- "x-amz-target": "AWSStepFunctions.GetActivityTask",
103
- };
73
+ const headers = sharedHeaders("GetActivityTask");
104
74
  let body;
105
75
  body = JSON.stringify(se_GetActivityTaskInput(input, context));
106
76
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
107
77
  };
108
78
  exports.se_GetActivityTaskCommand = se_GetActivityTaskCommand;
109
79
  const se_GetExecutionHistoryCommand = async (input, context) => {
110
- const headers = {
111
- "content-type": "application/x-amz-json-1.0",
112
- "x-amz-target": "AWSStepFunctions.GetExecutionHistory",
113
- };
80
+ const headers = sharedHeaders("GetExecutionHistory");
114
81
  let body;
115
82
  body = JSON.stringify(se_GetExecutionHistoryInput(input, context));
116
83
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
117
84
  };
118
85
  exports.se_GetExecutionHistoryCommand = se_GetExecutionHistoryCommand;
119
86
  const se_ListActivitiesCommand = async (input, context) => {
120
- const headers = {
121
- "content-type": "application/x-amz-json-1.0",
122
- "x-amz-target": "AWSStepFunctions.ListActivities",
123
- };
87
+ const headers = sharedHeaders("ListActivities");
124
88
  let body;
125
89
  body = JSON.stringify(se_ListActivitiesInput(input, context));
126
90
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
127
91
  };
128
92
  exports.se_ListActivitiesCommand = se_ListActivitiesCommand;
129
93
  const se_ListExecutionsCommand = async (input, context) => {
130
- const headers = {
131
- "content-type": "application/x-amz-json-1.0",
132
- "x-amz-target": "AWSStepFunctions.ListExecutions",
133
- };
94
+ const headers = sharedHeaders("ListExecutions");
134
95
  let body;
135
96
  body = JSON.stringify(se_ListExecutionsInput(input, context));
136
97
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
137
98
  };
138
99
  exports.se_ListExecutionsCommand = se_ListExecutionsCommand;
139
100
  const se_ListMapRunsCommand = async (input, context) => {
140
- const headers = {
141
- "content-type": "application/x-amz-json-1.0",
142
- "x-amz-target": "AWSStepFunctions.ListMapRuns",
143
- };
101
+ const headers = sharedHeaders("ListMapRuns");
144
102
  let body;
145
103
  body = JSON.stringify(se_ListMapRunsInput(input, context));
146
104
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
105
  };
148
106
  exports.se_ListMapRunsCommand = se_ListMapRunsCommand;
149
107
  const se_ListStateMachinesCommand = async (input, context) => {
150
- const headers = {
151
- "content-type": "application/x-amz-json-1.0",
152
- "x-amz-target": "AWSStepFunctions.ListStateMachines",
153
- };
108
+ const headers = sharedHeaders("ListStateMachines");
154
109
  let body;
155
110
  body = JSON.stringify(se_ListStateMachinesInput(input, context));
156
111
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
157
112
  };
158
113
  exports.se_ListStateMachinesCommand = se_ListStateMachinesCommand;
159
114
  const se_ListTagsForResourceCommand = async (input, context) => {
160
- const headers = {
161
- "content-type": "application/x-amz-json-1.0",
162
- "x-amz-target": "AWSStepFunctions.ListTagsForResource",
163
- };
115
+ const headers = sharedHeaders("ListTagsForResource");
164
116
  let body;
165
117
  body = JSON.stringify(se_ListTagsForResourceInput(input, context));
166
118
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
167
119
  };
168
120
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
169
121
  const se_SendTaskFailureCommand = async (input, context) => {
170
- const headers = {
171
- "content-type": "application/x-amz-json-1.0",
172
- "x-amz-target": "AWSStepFunctions.SendTaskFailure",
173
- };
122
+ const headers = sharedHeaders("SendTaskFailure");
174
123
  let body;
175
124
  body = JSON.stringify(se_SendTaskFailureInput(input, context));
176
125
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
177
126
  };
178
127
  exports.se_SendTaskFailureCommand = se_SendTaskFailureCommand;
179
128
  const se_SendTaskHeartbeatCommand = async (input, context) => {
180
- const headers = {
181
- "content-type": "application/x-amz-json-1.0",
182
- "x-amz-target": "AWSStepFunctions.SendTaskHeartbeat",
183
- };
129
+ const headers = sharedHeaders("SendTaskHeartbeat");
184
130
  let body;
185
131
  body = JSON.stringify(se_SendTaskHeartbeatInput(input, context));
186
132
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
187
133
  };
188
134
  exports.se_SendTaskHeartbeatCommand = se_SendTaskHeartbeatCommand;
189
135
  const se_SendTaskSuccessCommand = async (input, context) => {
190
- const headers = {
191
- "content-type": "application/x-amz-json-1.0",
192
- "x-amz-target": "AWSStepFunctions.SendTaskSuccess",
193
- };
136
+ const headers = sharedHeaders("SendTaskSuccess");
194
137
  let body;
195
138
  body = JSON.stringify(se_SendTaskSuccessInput(input, context));
196
139
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
197
140
  };
198
141
  exports.se_SendTaskSuccessCommand = se_SendTaskSuccessCommand;
199
142
  const se_StartExecutionCommand = async (input, context) => {
200
- const headers = {
201
- "content-type": "application/x-amz-json-1.0",
202
- "x-amz-target": "AWSStepFunctions.StartExecution",
203
- };
143
+ const headers = sharedHeaders("StartExecution");
204
144
  let body;
205
145
  body = JSON.stringify(se_StartExecutionInput(input, context));
206
146
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
207
147
  };
208
148
  exports.se_StartExecutionCommand = se_StartExecutionCommand;
209
149
  const se_StartSyncExecutionCommand = async (input, context) => {
210
- const headers = {
211
- "content-type": "application/x-amz-json-1.0",
212
- "x-amz-target": "AWSStepFunctions.StartSyncExecution",
213
- };
150
+ const headers = sharedHeaders("StartSyncExecution");
214
151
  let body;
215
152
  body = JSON.stringify(se_StartSyncExecutionInput(input, context));
216
153
  let { hostname: resolvedHostname } = await context.endpoint();
@@ -224,50 +161,35 @@ const se_StartSyncExecutionCommand = async (input, context) => {
224
161
  };
225
162
  exports.se_StartSyncExecutionCommand = se_StartSyncExecutionCommand;
226
163
  const se_StopExecutionCommand = async (input, context) => {
227
- const headers = {
228
- "content-type": "application/x-amz-json-1.0",
229
- "x-amz-target": "AWSStepFunctions.StopExecution",
230
- };
164
+ const headers = sharedHeaders("StopExecution");
231
165
  let body;
232
166
  body = JSON.stringify(se_StopExecutionInput(input, context));
233
167
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
234
168
  };
235
169
  exports.se_StopExecutionCommand = se_StopExecutionCommand;
236
170
  const se_TagResourceCommand = async (input, context) => {
237
- const headers = {
238
- "content-type": "application/x-amz-json-1.0",
239
- "x-amz-target": "AWSStepFunctions.TagResource",
240
- };
171
+ const headers = sharedHeaders("TagResource");
241
172
  let body;
242
173
  body = JSON.stringify(se_TagResourceInput(input, context));
243
174
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
244
175
  };
245
176
  exports.se_TagResourceCommand = se_TagResourceCommand;
246
177
  const se_UntagResourceCommand = async (input, context) => {
247
- const headers = {
248
- "content-type": "application/x-amz-json-1.0",
249
- "x-amz-target": "AWSStepFunctions.UntagResource",
250
- };
178
+ const headers = sharedHeaders("UntagResource");
251
179
  let body;
252
180
  body = JSON.stringify(se_UntagResourceInput(input, context));
253
181
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
254
182
  };
255
183
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
256
184
  const se_UpdateMapRunCommand = async (input, context) => {
257
- const headers = {
258
- "content-type": "application/x-amz-json-1.0",
259
- "x-amz-target": "AWSStepFunctions.UpdateMapRun",
260
- };
185
+ const headers = sharedHeaders("UpdateMapRun");
261
186
  let body;
262
187
  body = JSON.stringify(se_UpdateMapRunInput(input, context));
263
188
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
264
189
  };
265
190
  exports.se_UpdateMapRunCommand = se_UpdateMapRunCommand;
266
191
  const se_UpdateStateMachineCommand = async (input, context) => {
267
- const headers = {
268
- "content-type": "application/x-amz-json-1.0",
269
- "x-amz-target": "AWSStepFunctions.UpdateStateMachine",
270
- };
192
+ const headers = sharedHeaders("UpdateStateMachine");
271
193
  let body;
272
194
  body = JSON.stringify(se_UpdateStateMachineInput(input, context));
273
195
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -2654,6 +2576,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
2654
2576
  }
2655
2577
  return new protocol_http_1.HttpRequest(contents);
2656
2578
  };
2579
+ function sharedHeaders(operation) {
2580
+ return {
2581
+ "content-type": "application/x-amz-json-1.0",
2582
+ "x-amz-target": `AWSStepFunctions.${operation}`,
2583
+ };
2584
+ }
2657
2585
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2658
2586
  if (encoded.length) {
2659
2587
  return JSON.parse(encoded);
@@ -3,190 +3,127 @@ import { decorateServiceException as __decorateServiceException, expectBoolean a
3
3
  import { ActivityDoesNotExist, ActivityLimitExceeded, ActivityWorkerLimitExceeded, ExecutionAlreadyExists, ExecutionDoesNotExist, ExecutionLimitExceeded, InvalidArn, InvalidDefinition, InvalidExecutionInput, InvalidLoggingConfiguration, InvalidName, InvalidOutput, InvalidToken, InvalidTracingConfiguration, MissingRequiredParameter, ResourceNotFound, StateMachineAlreadyExists, StateMachineDeleting, StateMachineDoesNotExist, StateMachineLimitExceeded, StateMachineTypeNotSupported, TaskDoesNotExist, TaskTimedOut, TooManyTags, ValidationException, } from "../models/models_0";
4
4
  import { SFNServiceException as __BaseException } from "../models/SFNServiceException";
5
5
  export const se_CreateActivityCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.0",
8
- "x-amz-target": "AWSStepFunctions.CreateActivity",
9
- };
6
+ const headers = sharedHeaders("CreateActivity");
10
7
  let body;
11
8
  body = JSON.stringify(se_CreateActivityInput(input, context));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_CreateStateMachineCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.0",
17
- "x-amz-target": "AWSStepFunctions.CreateStateMachine",
18
- };
12
+ const headers = sharedHeaders("CreateStateMachine");
19
13
  let body;
20
14
  body = JSON.stringify(se_CreateStateMachineInput(input, context));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_DeleteActivityCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.0",
26
- "x-amz-target": "AWSStepFunctions.DeleteActivity",
27
- };
18
+ const headers = sharedHeaders("DeleteActivity");
28
19
  let body;
29
20
  body = JSON.stringify(se_DeleteActivityInput(input, context));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_DeleteStateMachineCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.0",
35
- "x-amz-target": "AWSStepFunctions.DeleteStateMachine",
36
- };
24
+ const headers = sharedHeaders("DeleteStateMachine");
37
25
  let body;
38
26
  body = JSON.stringify(se_DeleteStateMachineInput(input, context));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const se_DescribeActivityCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.0",
44
- "x-amz-target": "AWSStepFunctions.DescribeActivity",
45
- };
30
+ const headers = sharedHeaders("DescribeActivity");
46
31
  let body;
47
32
  body = JSON.stringify(se_DescribeActivityInput(input, context));
48
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
34
  };
50
35
  export const se_DescribeExecutionCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.0",
53
- "x-amz-target": "AWSStepFunctions.DescribeExecution",
54
- };
36
+ const headers = sharedHeaders("DescribeExecution");
55
37
  let body;
56
38
  body = JSON.stringify(se_DescribeExecutionInput(input, context));
57
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
40
  };
59
41
  export const se_DescribeMapRunCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.0",
62
- "x-amz-target": "AWSStepFunctions.DescribeMapRun",
63
- };
42
+ const headers = sharedHeaders("DescribeMapRun");
64
43
  let body;
65
44
  body = JSON.stringify(se_DescribeMapRunInput(input, context));
66
45
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
46
  };
68
47
  export const se_DescribeStateMachineCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.0",
71
- "x-amz-target": "AWSStepFunctions.DescribeStateMachine",
72
- };
48
+ const headers = sharedHeaders("DescribeStateMachine");
73
49
  let body;
74
50
  body = JSON.stringify(se_DescribeStateMachineInput(input, context));
75
51
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
52
  };
77
53
  export const se_DescribeStateMachineForExecutionCommand = async (input, context) => {
78
- const headers = {
79
- "content-type": "application/x-amz-json-1.0",
80
- "x-amz-target": "AWSStepFunctions.DescribeStateMachineForExecution",
81
- };
54
+ const headers = sharedHeaders("DescribeStateMachineForExecution");
82
55
  let body;
83
56
  body = JSON.stringify(se_DescribeStateMachineForExecutionInput(input, context));
84
57
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
58
  };
86
59
  export const se_GetActivityTaskCommand = async (input, context) => {
87
- const headers = {
88
- "content-type": "application/x-amz-json-1.0",
89
- "x-amz-target": "AWSStepFunctions.GetActivityTask",
90
- };
60
+ const headers = sharedHeaders("GetActivityTask");
91
61
  let body;
92
62
  body = JSON.stringify(se_GetActivityTaskInput(input, context));
93
63
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
64
  };
95
65
  export const se_GetExecutionHistoryCommand = async (input, context) => {
96
- const headers = {
97
- "content-type": "application/x-amz-json-1.0",
98
- "x-amz-target": "AWSStepFunctions.GetExecutionHistory",
99
- };
66
+ const headers = sharedHeaders("GetExecutionHistory");
100
67
  let body;
101
68
  body = JSON.stringify(se_GetExecutionHistoryInput(input, context));
102
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
70
  };
104
71
  export const se_ListActivitiesCommand = async (input, context) => {
105
- const headers = {
106
- "content-type": "application/x-amz-json-1.0",
107
- "x-amz-target": "AWSStepFunctions.ListActivities",
108
- };
72
+ const headers = sharedHeaders("ListActivities");
109
73
  let body;
110
74
  body = JSON.stringify(se_ListActivitiesInput(input, context));
111
75
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
76
  };
113
77
  export const se_ListExecutionsCommand = async (input, context) => {
114
- const headers = {
115
- "content-type": "application/x-amz-json-1.0",
116
- "x-amz-target": "AWSStepFunctions.ListExecutions",
117
- };
78
+ const headers = sharedHeaders("ListExecutions");
118
79
  let body;
119
80
  body = JSON.stringify(se_ListExecutionsInput(input, context));
120
81
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
121
82
  };
122
83
  export const se_ListMapRunsCommand = async (input, context) => {
123
- const headers = {
124
- "content-type": "application/x-amz-json-1.0",
125
- "x-amz-target": "AWSStepFunctions.ListMapRuns",
126
- };
84
+ const headers = sharedHeaders("ListMapRuns");
127
85
  let body;
128
86
  body = JSON.stringify(se_ListMapRunsInput(input, context));
129
87
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
130
88
  };
131
89
  export const se_ListStateMachinesCommand = async (input, context) => {
132
- const headers = {
133
- "content-type": "application/x-amz-json-1.0",
134
- "x-amz-target": "AWSStepFunctions.ListStateMachines",
135
- };
90
+ const headers = sharedHeaders("ListStateMachines");
136
91
  let body;
137
92
  body = JSON.stringify(se_ListStateMachinesInput(input, context));
138
93
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
139
94
  };
140
95
  export const se_ListTagsForResourceCommand = async (input, context) => {
141
- const headers = {
142
- "content-type": "application/x-amz-json-1.0",
143
- "x-amz-target": "AWSStepFunctions.ListTagsForResource",
144
- };
96
+ const headers = sharedHeaders("ListTagsForResource");
145
97
  let body;
146
98
  body = JSON.stringify(se_ListTagsForResourceInput(input, context));
147
99
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
148
100
  };
149
101
  export const se_SendTaskFailureCommand = async (input, context) => {
150
- const headers = {
151
- "content-type": "application/x-amz-json-1.0",
152
- "x-amz-target": "AWSStepFunctions.SendTaskFailure",
153
- };
102
+ const headers = sharedHeaders("SendTaskFailure");
154
103
  let body;
155
104
  body = JSON.stringify(se_SendTaskFailureInput(input, context));
156
105
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
157
106
  };
158
107
  export const se_SendTaskHeartbeatCommand = async (input, context) => {
159
- const headers = {
160
- "content-type": "application/x-amz-json-1.0",
161
- "x-amz-target": "AWSStepFunctions.SendTaskHeartbeat",
162
- };
108
+ const headers = sharedHeaders("SendTaskHeartbeat");
163
109
  let body;
164
110
  body = JSON.stringify(se_SendTaskHeartbeatInput(input, context));
165
111
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
166
112
  };
167
113
  export const se_SendTaskSuccessCommand = async (input, context) => {
168
- const headers = {
169
- "content-type": "application/x-amz-json-1.0",
170
- "x-amz-target": "AWSStepFunctions.SendTaskSuccess",
171
- };
114
+ const headers = sharedHeaders("SendTaskSuccess");
172
115
  let body;
173
116
  body = JSON.stringify(se_SendTaskSuccessInput(input, context));
174
117
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
175
118
  };
176
119
  export const se_StartExecutionCommand = async (input, context) => {
177
- const headers = {
178
- "content-type": "application/x-amz-json-1.0",
179
- "x-amz-target": "AWSStepFunctions.StartExecution",
180
- };
120
+ const headers = sharedHeaders("StartExecution");
181
121
  let body;
182
122
  body = JSON.stringify(se_StartExecutionInput(input, context));
183
123
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
184
124
  };
185
125
  export const se_StartSyncExecutionCommand = async (input, context) => {
186
- const headers = {
187
- "content-type": "application/x-amz-json-1.0",
188
- "x-amz-target": "AWSStepFunctions.StartSyncExecution",
189
- };
126
+ const headers = sharedHeaders("StartSyncExecution");
190
127
  let body;
191
128
  body = JSON.stringify(se_StartSyncExecutionInput(input, context));
192
129
  let { hostname: resolvedHostname } = await context.endpoint();
@@ -199,46 +136,31 @@ export const se_StartSyncExecutionCommand = async (input, context) => {
199
136
  return buildHttpRpcRequest(context, headers, "/", resolvedHostname, body);
200
137
  };
201
138
  export const se_StopExecutionCommand = async (input, context) => {
202
- const headers = {
203
- "content-type": "application/x-amz-json-1.0",
204
- "x-amz-target": "AWSStepFunctions.StopExecution",
205
- };
139
+ const headers = sharedHeaders("StopExecution");
206
140
  let body;
207
141
  body = JSON.stringify(se_StopExecutionInput(input, context));
208
142
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
209
143
  };
210
144
  export const se_TagResourceCommand = async (input, context) => {
211
- const headers = {
212
- "content-type": "application/x-amz-json-1.0",
213
- "x-amz-target": "AWSStepFunctions.TagResource",
214
- };
145
+ const headers = sharedHeaders("TagResource");
215
146
  let body;
216
147
  body = JSON.stringify(se_TagResourceInput(input, context));
217
148
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
218
149
  };
219
150
  export const se_UntagResourceCommand = async (input, context) => {
220
- const headers = {
221
- "content-type": "application/x-amz-json-1.0",
222
- "x-amz-target": "AWSStepFunctions.UntagResource",
223
- };
151
+ const headers = sharedHeaders("UntagResource");
224
152
  let body;
225
153
  body = JSON.stringify(se_UntagResourceInput(input, context));
226
154
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
227
155
  };
228
156
  export const se_UpdateMapRunCommand = async (input, context) => {
229
- const headers = {
230
- "content-type": "application/x-amz-json-1.0",
231
- "x-amz-target": "AWSStepFunctions.UpdateMapRun",
232
- };
157
+ const headers = sharedHeaders("UpdateMapRun");
233
158
  let body;
234
159
  body = JSON.stringify(se_UpdateMapRunInput(input, context));
235
160
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
236
161
  };
237
162
  export const se_UpdateStateMachineCommand = async (input, context) => {
238
- const headers = {
239
- "content-type": "application/x-amz-json-1.0",
240
- "x-amz-target": "AWSStepFunctions.UpdateStateMachine",
241
- };
163
+ const headers = sharedHeaders("UpdateStateMachine");
242
164
  let body;
243
165
  body = JSON.stringify(se_UpdateStateMachineInput(input, context));
244
166
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -2598,6 +2520,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
2598
2520
  }
2599
2521
  return new __HttpRequest(contents);
2600
2522
  };
2523
+ function sharedHeaders(operation) {
2524
+ return {
2525
+ "content-type": "application/x-amz-json-1.0",
2526
+ "x-amz-target": `AWSStepFunctions.${operation}`,
2527
+ };
2528
+ }
2601
2529
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2602
2530
  if (encoded.length) {
2603
2531
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sfn",
3
3
  "description": "AWS SDK for JavaScript Sfn Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.312.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.312.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
26
  "@aws-sdk/credential-provider-node": "3.310.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",