1.0.21 • Published 3 years ago

aws-sf-choice v1.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago
For using aws stepfunction choice json pattern

aws-sf-choice is json-condition pattern as aws asl pattern

aws stepfunction choice document:

https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html

Features

The following comparison operators are supported:

  • And
  • BooleanEquals,BooleanEqualsPath
  • IsBoolean
  • IsNull
  • IsNumeric
  • IsPresent
  • IsString
  • IsTimestamp
  • Not
  • NumericEquals,NumericEqualsPath
  • NumericGreaterThan,NumericGreaterThanPath
  • NumericGreaterThanEquals,NumericGreaterThanEqualsPath
  • NumericLessThan,NumericLessThanPath
  • NumericLessThanEquals,NumericLessThanEqualsPath
  • Or
  • StringEquals,StringEqualsPath
  • StringGreaterThan,StringGreaterThanPath
  • StringGreaterThanEquals,StringGreaterThanEqualsPath
  • StringLessThan,StringLessThanPath
  • StringLessThanEquals,StringLessThanEqualsPath
  • TimestampEquals,TimestampEqualsPath
  • TimestampGreaterThan,TimestampGreaterThanPath
  • TimestampGreaterThanEquals,TimestampGreaterThanEqualsPath
  • TimestampLessThan,TimestampLessThanPath
  • TimestampLessThanEquals,TimestampLessThanEqualsPath

Install

npm install aws-sf-choice

Useage

import {Choice } from 'aws-sf-choice'

let sampleCondition = {
 Type: "Choice",
    Choices: [
      {
        Variable: "$.r",
        IsPresent: true,
        Next: "nextState1"
      },
      { 
        Not:{
          Variable: "$.r",
          IsTimestamp: true,
        },
        Next: "nextState2",
      }
    ],
    Default: "DefaultState"
}

let sampleData = {
    r : "this is sample text",
    rr : 2
}

let choice = new Choice(sampleCondition,sampleData) // fist is condition , second is data
choice.start()
    .then(r=>{
        console.log("next state is : ",r)
    })

start() method is promise function you could get next state by await

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago