Skip to content

Commit

Permalink
feat(client-sfn): Add support for variables and JSONata in TestState,…
Browse files Browse the repository at this point in the history
… GetExecutionHistory, DescribeStateMachine, and DescribeStateMachineForExecution
  • Loading branch information
awstools committed Nov 22, 2024
1 parent f082da5 commit c9c278a
Show file tree
Hide file tree
Showing 8 changed files with 471 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export interface DescribeStateMachineCommandOutput extends DescribeStateMachineO
* // kmsDataKeyReusePeriodSeconds: Number("int"),
* // type: "AWS_OWNED_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
* // },
* // variableReferences: { // VariableReferences
* // "<keys>": [ // VariableNameList
* // "STRING_VALUE",
* // ],
* // },
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ export interface DescribeStateMachineForExecutionCommandOutput
* // kmsDataKeyReusePeriodSeconds: Number("int"),
* // type: "AWS_OWNED_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
* // },
* // variableReferences: { // VariableReferences
* // "<keys>": [ // VariableNameList
* // "STRING_VALUE",
* // ],
* // },
* // };
*
* ```
Expand Down
14 changes: 13 additions & 1 deletion clients/client-sfn/src/commands/GetExecutionHistoryCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
* // events: [ // HistoryEventList // required
* // { // HistoryEvent
* // timestamp: new Date("TIMESTAMP"), // required
* // type: "ActivityFailed" || "ActivityScheduled" || "ActivityScheduleFailed" || "ActivityStarted" || "ActivitySucceeded" || "ActivityTimedOut" || "ChoiceStateEntered" || "ChoiceStateExited" || "ExecutionAborted" || "ExecutionFailed" || "ExecutionStarted" || "ExecutionSucceeded" || "ExecutionTimedOut" || "FailStateEntered" || "LambdaFunctionFailed" || "LambdaFunctionScheduled" || "LambdaFunctionScheduleFailed" || "LambdaFunctionStarted" || "LambdaFunctionStartFailed" || "LambdaFunctionSucceeded" || "LambdaFunctionTimedOut" || "MapIterationAborted" || "MapIterationFailed" || "MapIterationStarted" || "MapIterationSucceeded" || "MapStateAborted" || "MapStateEntered" || "MapStateExited" || "MapStateFailed" || "MapStateStarted" || "MapStateSucceeded" || "ParallelStateAborted" || "ParallelStateEntered" || "ParallelStateExited" || "ParallelStateFailed" || "ParallelStateStarted" || "ParallelStateSucceeded" || "PassStateEntered" || "PassStateExited" || "SucceedStateEntered" || "SucceedStateExited" || "TaskFailed" || "TaskScheduled" || "TaskStarted" || "TaskStartFailed" || "TaskStateAborted" || "TaskStateEntered" || "TaskStateExited" || "TaskSubmitFailed" || "TaskSubmitted" || "TaskSucceeded" || "TaskTimedOut" || "WaitStateAborted" || "WaitStateEntered" || "WaitStateExited" || "MapRunAborted" || "MapRunFailed" || "MapRunStarted" || "MapRunSucceeded" || "ExecutionRedriven" || "MapRunRedriven", // required
* // type: "ActivityFailed" || "ActivityScheduled" || "ActivityScheduleFailed" || "ActivityStarted" || "ActivitySucceeded" || "ActivityTimedOut" || "ChoiceStateEntered" || "ChoiceStateExited" || "ExecutionAborted" || "ExecutionFailed" || "ExecutionStarted" || "ExecutionSucceeded" || "ExecutionTimedOut" || "FailStateEntered" || "LambdaFunctionFailed" || "LambdaFunctionScheduled" || "LambdaFunctionScheduleFailed" || "LambdaFunctionStarted" || "LambdaFunctionStartFailed" || "LambdaFunctionSucceeded" || "LambdaFunctionTimedOut" || "MapIterationAborted" || "MapIterationFailed" || "MapIterationStarted" || "MapIterationSucceeded" || "MapStateAborted" || "MapStateEntered" || "MapStateExited" || "MapStateFailed" || "MapStateStarted" || "MapStateSucceeded" || "ParallelStateAborted" || "ParallelStateEntered" || "ParallelStateExited" || "ParallelStateFailed" || "ParallelStateStarted" || "ParallelStateSucceeded" || "PassStateEntered" || "PassStateExited" || "SucceedStateEntered" || "SucceedStateExited" || "TaskFailed" || "TaskScheduled" || "TaskStarted" || "TaskStartFailed" || "TaskStateAborted" || "TaskStateEntered" || "TaskStateExited" || "TaskSubmitFailed" || "TaskSubmitted" || "TaskSucceeded" || "TaskTimedOut" || "WaitStateAborted" || "WaitStateEntered" || "WaitStateExited" || "MapRunAborted" || "MapRunFailed" || "MapRunStarted" || "MapRunSucceeded" || "ExecutionRedriven" || "MapRunRedriven" || "EvaluationFailed", // required
* // id: Number("long"), // required
* // previousEventId: Number("long"),
* // activityFailedEventDetails: { // ActivityFailedEventDetails
Expand Down Expand Up @@ -230,6 +230,12 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
* // name: "STRING_VALUE", // required
* // output: "STRING_VALUE",
* // outputDetails: "<HistoryEventExecutionDataDetails>",
* // assignedVariables: { // AssignedVariables
* // "<keys>": "STRING_VALUE",
* // },
* // assignedVariablesDetails: { // AssignedVariablesDetails
* // truncated: true || false,
* // },
* // },
* // mapRunStartedEventDetails: { // MapRunStartedEventDetails
* // mapRunArn: "STRING_VALUE",
Expand All @@ -242,6 +248,12 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
* // mapRunArn: "STRING_VALUE",
* // redriveCount: Number("int"),
* // },
* // evaluationFailedEventDetails: { // EvaluationFailedEventDetails
* // error: "STRING_VALUE",
* // cause: "STRING_VALUE",
* // location: "STRING_VALUE",
* // state: "STRING_VALUE", // required
* // },
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
5 changes: 4 additions & 1 deletion clients/client-sfn/src/commands/TestStateCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
* const client = new SFNClient(config);
* const input = { // TestStateInput
* definition: "STRING_VALUE", // required
* roleArn: "STRING_VALUE", // required
* roleArn: "STRING_VALUE",
* input: "STRING_VALUE",
* inspectionLevel: "INFO" || "DEBUG" || "TRACE",
* revealSecrets: true || false,
* variables: "STRING_VALUE",
* };
* const command = new TestStateCommand(input);
* const response = await client.send(command);
Expand All @@ -104,6 +105,7 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
* // cause: "STRING_VALUE",
* // inspectionData: { // InspectionData
* // input: "STRING_VALUE",
* // afterArguments: "STRING_VALUE",
* // afterInputPath: "STRING_VALUE",
* // afterParameters: "STRING_VALUE",
* // result: "STRING_VALUE",
Expand All @@ -123,6 +125,7 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
* // headers: "STRING_VALUE",
* // body: "STRING_VALUE",
* // },
* // variables: "STRING_VALUE",
* // },
* // nextState: "STRING_VALUE",
* // status: "SUCCEEDED" || "FAILED" || "RETRIABLE" || "CAUGHT_ERROR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ValidateStateMachineDefinitionInput,
ValidateStateMachineDefinitionInputFilterSensitiveLog,
ValidateStateMachineDefinitionOutput,
ValidateStateMachineDefinitionOutputFilterSensitiveLog,
} from "../models/models_0";
import {
de_ValidateStateMachineDefinitionCommand,
Expand Down Expand Up @@ -37,26 +38,37 @@ export interface ValidateStateMachineDefinitionCommandOutput
__MetadataBearer {}

/**
* <p>Validates the syntax of a state machine definition.</p>
* <p>You can validate that a state machine definition is correct without
* creating a state machine resource. Step Functions will implicitly perform the same
* syntax check when you invoke <code>CreateStateMachine</code> and
* <code>UpdateStateMachine</code>. State machine definitions are specified using a
* JSON-based, structured language. For more information on Amazon States Language see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL). </p>
* <p>Validates the syntax of a state machine definition specified in <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL), a
* JSON-based, structured language.</p>
* <p>You can validate that a state machine definition is correct without creating a state
* machine resource.</p>
* <p>Suggested uses for <code>ValidateStateMachineDefinition</code>:</p>
* <ul>
* <li>
* <p>Integrate automated checks into your code review or Continuous Integration
* (CI) process to validate state machine definitions before starting
* (CI) process to check state machine definitions before starting
* deployments.</p>
* </li>
* <li>
* <p>Run the validation from a Git pre-commit hook to check your state machine
* definitions before committing them to your source repository.</p>
* <p>Run validation from a Git pre-commit hook to verify the definition before
* committing to your source repository.</p>
* </li>
* </ul>
* <p>Validation will look for problems in your state machine definition and return a
* <b>result</b> and a list of <b>diagnostic
* elements</b>.</p>
* <p>The <b>result</b> value will be <code>OK</code> when your
* workflow definition can be successfully created or updated. Note the result can be
* <code>OK</code> even when diagnostic warnings are present in the response. The
* <b>result</b> value will be <code>FAIL</code> when the
* workflow definition contains errors that would prevent you from creating or updating
* your state machine. </p>
* <p>The list of <a href="https://docs.aws.amazon.com/step-functions/latest/apireference/API_ValidateStateMachineDefinitionDiagnostic.html">ValidateStateMachineDefinitionDiagnostic</a> data elements can contain zero or more <b>WARNING</b> and/or <b>ERROR</b> elements.</p>
* <note>
* <p>Errors found in the state machine definition will be returned in the response as a list of <b>diagnostic elements</b>, rather than raise an exception.</p>
* <p>The <b>ValidateStateMachineDefinition API</b> might add
* new diagnostics in the future, adjust diagnostic codes, or change the message
* wording. Your automated processes should only rely on the value of the <b>result</b> field value (OK, FAIL). Do <b>not</b> rely on the exact order, count, or
* wording of diagnostic messages.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down Expand Up @@ -118,7 +130,7 @@ export class ValidateStateMachineDefinitionCommand extends $Command
})
.s("AWSStepFunctions", "ValidateStateMachineDefinition", {})
.n("SFNClient", "ValidateStateMachineDefinitionCommand")
.f(ValidateStateMachineDefinitionInputFilterSensitiveLog, void 0)
.f(ValidateStateMachineDefinitionInputFilterSensitiveLog, ValidateStateMachineDefinitionOutputFilterSensitiveLog)
.ser(se_ValidateStateMachineDefinitionCommand)
.de(de_ValidateStateMachineDefinitionCommand)
.build() {
Expand Down
Loading

0 comments on commit c9c278a

Please sign in to comment.