UNPKG

@deliverr/serverless-offline-step-functions

Version:

Serverless Offline Plugin to Support Step Functions for Local Development

136 lines (135 loc) 4.28 kB
import type { StateMachineDefinition } from './StateMachineDescription'; import { StateType } from '../stateTasks/StateType'; import { StatesErrors } from './StatesErrors'; export declare type StateInfo = { handlerPath: string; handlerName: string; environment: Record<string, string> | undefined; }; declare type CommonStateDefinition = { Type: StateType; Next?: string; End: boolean; Comment?: string; InputPath?: string; OutputPath?: string; }; export declare type FailStateDefinition = { Type: StateType; Comment?: string; Cause?: string; Error?: string; }; export declare type SucceedStateDefinition = { Type: StateType; }; export declare type ChoiceRule = { Variable: string; Next: string; And?: ChoiceRule[]; BooleanEquals?: boolean; BooleanEqualsPath?: string; IsBoolean?: boolean; IsNull?: boolean; IsPresent?: boolean; IsString?: boolean; IsTimestamp?: boolean; Not?: ChoiceRule; NumericEquals?: number; NumericEqualsPath?: string; NumericGreaterThan?: number; NumericGreaterThanPath?: string; NumericGreaterThanEquals?: number; NumericGreaterThanEqualsPath?: string; NumericLessThan?: number; NumericLessThanPath?: string; NumericLessThanEquals?: number; NumericLessThanEqualsPath?: string; Or?: ChoiceRule[]; StringEquals?: string; StringEqualsPath?: string; StringGreaterThan?: string; StringGreaterThanPath?: string; StringGreaterThanEquals?: string; StringGreaterThanEqualsPath?: string; StringLessThan?: string; StringLessThanPath?: string; StringLessThanEquals?: string; StringLessThanEqualsPath?: string; StringMatches?: string; TimestampEquals?: string; TimestampEqualsPath?: string; TimestampGreaterThan?: string; TimestampGreaterThanPath?: string; TimestampGreaterThanEquals?: string; TimestampGreaterThanEqualsPath?: string; TimestampLessThan?: string; TimestampLessThanPath?: string; TimestampLessThanEquals?: string; TimestampLessThanEqualsPath?: string; }; export declare type ChoiceStateDefinition = CommonStateDefinition & { Choices: ChoiceRule[]; Default?: string; }; export declare type PassStateDefinition = CommonStateDefinition & { Result?: Record<any, unknown>; ResultPath?: string; Parameters?: string; }; export declare type TaskRetryRule = { ErrorEquals: StatesErrors[]; IntervalSeconds?: number; MaxAttempts?: number; BackoffRate?: number; }; export declare type TaskCatchRule = { ErrorEquals: StatesErrors[]; Next: string; ResultPath?: string; }; declare type LambdaTaskStateParameters = { FunctionName?: string | { 'Fn::GetAtt': [string, string]; }; Payload?: Record<string, unknown>; }; export declare type PayloadTemplateType = LambdaTaskStateParameters & Record<string, unknown>; export declare type ResultSelectorType = Record<string, string>; export declare type TaskStateDefinition = CommonStateDefinition & { Resource?: string; Parameters?: PayloadTemplateType; ResultPath?: string; ResultSelector?: ResultSelectorType; Retry?: TaskRetryRule[]; Catch?: TaskCatchRule[]; TimeoutSeconds?: number; TimeoutSecondsPath?: string; HeartbeatSeconds?: number; HeartbeatSecondsPath?: string; }; export declare type MapStateDefinition = CommonStateDefinition & { Iterator: StateMachineDefinition; ItemsPath?: string; Parameters?: PayloadTemplateType; MaxConcurrency?: number; ResultPath?: string; ResultSelector?: ResultSelectorType; Retry?: TaskRetryRule[]; Catch?: TaskCatchRule[]; }; export declare type WaitStateDefinition = CommonStateDefinition & { Seconds?: number; Timestamp?: string; SecondsPath?: string; TimestampPath?: string; }; export declare type ParallelStateDefinition = CommonStateDefinition & { Branches: StateMachineDefinition[]; ResultPath?: string; ResultSelector?: ResultSelectorType; Retry?: TaskRetryRule[]; Catch?: TaskCatchRule[]; }; export declare type StateDefinition = PassStateDefinition | MapStateDefinition | TaskStateDefinition | FailStateDefinition | SucceedStateDefinition | ChoiceStateDefinition; export {};