Skip to content

Commit

Permalink
Merging to main
Browse files Browse the repository at this point in the history
  • Loading branch information
AksharaAK committed Jan 27, 2022
2 parents f71c458 + 588921c commit 2b0c8ef
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 227 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ An interface to the deployed EventBridge, allowing events to be injected and int
eventBridge.destroy() - remove infastructure used to track events
```

### Step Functions

An interface to a deployed Step Function, with a function to execute a Step Function until its completion.

#### Static

```
StepFunctions.build() // create a Step Functions Client for executing existing state machines
```

#### Instance

```
stepFunctions.runExecution(stateMachineName, input) // executes state machine until completion
```

## Running with `jest`

### Arguments
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.2.1",
"release-it": "^14.6.1",
"ts-migrate": "^0.1.26",
"release-it": "^14.12.4",
"ts-migrate": "^0.1.27",
"ts-node": "^10.4.0",
"ttypescript": "^1.5.12",
"typescript": "^4.5.2"
Expand Down
5 changes: 1 addition & 4 deletions src/helpers/stepFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export default class StepFunctions {
}

async runExecution(stateMachineName: string, input: any): Promise<any> {
// this.stepFunctions = new AWSStepFunctions();
// this.allStateMachines = await this.stepFunctions
// .listStateMachines()
// .promise();
if (this.allStateMachines === undefined) {
throw new Error(
"The list of state machines is undefined. You might have forgotten to run build()."
Expand Down Expand Up @@ -50,6 +46,7 @@ export default class StepFunctions {
const executionList = await this.stepFunctions
.listExecutions(listExecParams)
.promise();
// Poll until the given execution is no longer running
while (
executionList.executions.filter(
(exec: any) =>
Expand Down
Loading

0 comments on commit 2b0c8ef

Please sign in to comment.