1.0.21 • Published 2 years ago

aws-sf-choice v1.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago