diff --git a/src/types/sfn.type.ts b/src/types/sfn.type.ts index 938b2f9..465d241 100644 --- a/src/types/sfn.type.ts +++ b/src/types/sfn.type.ts @@ -14,85 +14,133 @@ export interface FailState { export type MapState = | { - Type: 'Map' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - MaxConcurrency?: number - ItemsPath?: string - Iterator: StateMachine - End: boolean - } + Type: 'Map' + Comment?: string + InputPath?: string + OutputPath?: string + ItemProcessor: { + ItemProcessor: { + ProcessorConfig: { + Mode: string + ExecutionType: string + } + StartAt: string, + States: TaskState + } + } + ItemReader?: { + ReaderConfig?: unknown + Resource?: string, + Parameters?: unknown + } + ItemSelector?: unknown + ItemBatcher?: unknown + MaxConcurrencyPath?: string + Label?: string + ToleratedFailurePercentage?: number + ToleratedFailurePercentagePath?: string + ToleratedFailureCount?: number + ToleratedFailureCountPath?: string + ResultWriter?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + MaxConcurrency?: number + ItemsPath?: string + Iterator: StateMachine + End: boolean + } | { - Type: 'Map' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - MaxConcurrency?: number - ItemsPath?: string - Iterator: StateMachine - Next: string - } + Type: 'Map' + Comment?: string + InputPath?: string + OutputPath?: string + ItemProcessor: { + ItemProcessor: { + ProcessorConfig: { + Mode: string + ExecutionType: string + } + StartAt: string, + States: TaskState + } + } + ItemReader?: { + ReaderConfig?: unknown + Resource?: string, + Parameters?: unknown + } + ItemSelector?: unknown + ItemBatcher?: unknown + MaxConcurrencyPath?: string + Label?: string + ToleratedFailurePercentage?: number + ToleratedFailurePercentagePath?: string + ToleratedFailureCount?: number + ToleratedFailureCountPath?: string + ResultWriter?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + MaxConcurrency?: number + ItemsPath?: string + Iterator: StateMachine + Next: string + } export type ParallelState = | { - Type: 'Parallel' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - Branches: [StateMachine, ...StateMachine[]] - End: boolean - } + Type: 'Parallel' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + Branches: [StateMachine, ...StateMachine[]] + End: boolean + } | { - Type: 'Parallel' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - Branches: [StateMachine, ...StateMachine[]] - Next: string - } + Type: 'Parallel' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + Branches: [StateMachine, ...StateMachine[]] + Next: string + } export type PassState = | { - Type: 'Pass' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - Result?: unknown - End: boolean - } + Type: 'Pass' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + Result?: unknown + End: boolean + } | { - Type: 'Pass' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - Result?: unknown - Next: string - } + Type: 'Pass' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + Result?: unknown + Next: string + } export type State = TaskState | ParallelState | MapState | PassState | WaitState | ChoiceState | SucceedState | FailState @@ -101,8 +149,8 @@ export interface StateMachine { StartAt: string States: { [k: string]: - | (TaskState | ParallelState | MapState | PassState | WaitState | ChoiceState | SucceedState | FailState) - | undefined + | (TaskState | ParallelState | MapState | PassState | WaitState | ChoiceState | SucceedState | FailState) + | undefined } TimeoutSeconds?: number } @@ -127,52 +175,52 @@ export interface SucceedState { export type TaskState = | { - Type: 'Task' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - Resource: string - TimeoutSeconds?: number - HeartbeatSeconds?: number - TimeoutSecondsPath?: string - HeartbeatSecondsPath?: string - End: boolean - } + Type: 'Task' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + Resource: string + TimeoutSeconds?: number + HeartbeatSeconds?: number + TimeoutSecondsPath?: string + HeartbeatSecondsPath?: string + End: boolean + } | { - Type: 'Task' - Comment?: string - InputPath?: string - OutputPath?: string - ResultPath?: string - Parameters?: unknown - ResultSelector?: unknown - Retry?: [RetryOptions, ...RetryOptions[]] - Catch?: [CatchOptions, ...CatchOptions[]] - Resource: string - TimeoutSeconds?: number - HeartbeatSeconds?: number - TimeoutSecondsPath?: string - HeartbeatSecondsPath?: string - Next: string - } + Type: 'Task' + Comment?: string + InputPath?: string + OutputPath?: string + ResultPath?: string + Parameters?: unknown + ResultSelector?: unknown + Retry?: [RetryOptions, ...RetryOptions[]] + Catch?: [CatchOptions, ...CatchOptions[]] + Resource: string + TimeoutSeconds?: number + HeartbeatSeconds?: number + TimeoutSecondsPath?: string + HeartbeatSecondsPath?: string + Next: string + } export type WaitState = | { - Type: 'Wait' - Comment?: string - InputPath?: string - OutputPath?: string - End: boolean - } + Type: 'Wait' + Comment?: string + InputPath?: string + OutputPath?: string + End: boolean + } | { - Type: 'Wait' - Comment?: string - InputPath?: string - OutputPath?: string - Next: string - } + Type: 'Wait' + Comment?: string + InputPath?: string + OutputPath?: string + Next: string + }