0.5.3 • Published 10 months ago

@sei-atl/step-function-executor v0.5.3

Weekly downloads
23
License
ISC
Repository
-
Last release
10 months ago

step-function-executor

Use this utility to execute serverless Step Functions locally!

Installation

This module is installed via npm:

npm install --save-dev step-function-executor

Example Usage:

let { Serverless } = require('step-function-executor');

let serverless = new Serverless({ verbose: true });
serverless.load('../serverless.yml', {
  stage: 'test'
}).then(() => {
  let event = {
    context: {
      myParam: 'myValue'
    }
  };
  let context = {};
  serverless
    .getStepFunction()
    .execute(event, context)
  .then(event => {
    console.log('Ending event state:', JSON.stringify(event, null, 2));
  });
});

Documentation

Create a new instance of a Serverless object:

new Serverless(options);
NameTypeRequiredDefaultDescription
optionsobjectfalseoptional parameters
options.verbosebooleanfalsefalseset to true to log extra information during execution

Load the serverless.yml configuration file:

[Promise] load(configPath, opt, replace)

Return value: a Promise of a serverless instance loaded from the serverless.yml config file

Parameters: Name | Type | Required | Default | Description ------------ | ------------- | ------------- | ------------- | ------------- configPath | string | true | | Relative path to the serverless.yml file to load opt | object | false | | Serverless variable options ${opt:var} replace | object | false | | Optionally replace other items within the serverless.yml before loading


Gets a step function by name, or first available, as defined by the serverless.yml config file.

[StepFunction] getStepFunction(name)

Return value: The step function Throws:

  • ItemNotFoundException: thrown if no step function was found
  • IllegalStateException: thrown if getStepFunction() is called before load()

Parameters: Name | Type | Require | Default | Description ------------ | ------------- | ------------- | ------------- | ------------- name | string | false | | If provided, retrieves the step function with the provided name. If not provided, retrieves the first step function that is defined.

Changelog

Licensing

step-function-executor is licensed under the MIT License.

All files located in the node_modules and external directories are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms in the MIT License.

0.5.3

10 months ago

0.5.0

11 months ago

0.5.2

10 months ago

0.5.1

11 months ago

0.4.0

2 years ago

0.3.0

5 years ago

0.3.1

5 years ago

0.2.20

5 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago