-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtypes.ts
47 lines (45 loc) · 1.61 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export type State = Record<string, unknown>;
export type States = Record<string, State>;
export type StateMachine = {
QueryLanguage?: string | null;
States: States;
};
export enum StateMachineErrorCode {
BranchOutboundTransitionTarget = "BRANCH_OUTBOUND_TRANSITION_TARGET",
DuplicateStateNames = "DUPLICATE_STATE_NAMES",
DuplicateFieldName = "DUPLICATE_FIELD_NAME",
InvalidJsonPath = "INVALID_JSON_PATH",
MapOutboundTransitionTarget = "MAP_OUTBOUND_TRANSITION_TARGET",
MissingTerminalState = "MISSING_TERMINAL_STATE",
MissingTransitionTarget = "MISSING_TRANSITION_TARGET",
SchemaValidationFailed = "SCHEMA_VALIDATION_FAILED",
TerminalStateWithNextError = "TERMINAL_STATE_WITH_NEXT",
WaitDurationError = "WAIT_DURATION",
TaskTimeoutError = "TASK_TIMEOUT",
TaskHeartbeatError = "TASK_HEARTBEAT",
MapItemProcessorError = "MAP_ITEM_PROCESSOR",
MapItemSelectorError = "MAP_ITEM_SELECTOR",
MapItemBatcherError = "MAP_ITEM_BATCHER",
MapToleratedFailureError = "MAP_TOLERATED_FAILURE",
MapMaxConcurrencyError = "MAP_CONCURRENCY_ERROR",
MapItemReaderMaxItemsError = "MAP_ITEMREADER_MAXITEM",
FailCauseProperty = "FAIL_CAUSE_PROPERTY",
FailErrorProperty = "FAIL_ERROR_PROPERTY",
QueryLanguageFieldError = "QUERY_LANGUAGE_FIELD",
}
export type StateMachineError = {
"Error code": StateMachineErrorCode;
Message: string;
schemaError?: {
instancePath: string;
schemaPath: string;
};
};
export interface ValidationOptions {
readonly checkPaths: boolean;
readonly checkArn: boolean;
}
export type AslChecker = (
definition: StateMachine,
options: ValidationOptions
) => StateMachineError[];