import { NodeTypes, TriggerType } from './enums';
import { ConditionMapper, NodeMapper, ValidationMapper } from './parameter-mapper.interface';
import { NodeSelectors, WorkflowDrawing } from './workflow-drawing.interface';
export interface StoredInterface {
    id: string;
    createdAt: Date;
    updatedAt: Date;
}
export interface TriggerInterface {
    name: string;
    type: TriggerType;
    identifier: string;
    expression?: string;
}
export interface WorkflowDefinitionStepBase {
    name: string;
    identifier: string;
    requires: Array<string>;
    operationIdentifier: string;
    operationVersion?: string;
    type: NodeTypes;
    with: NodeMapper;
}
export type BaseWorkflowDefinitionStep = WorkflowDefinitionStepBase & StoredInterface;
export interface ActionStep extends WorkflowDefinitionStepBase {
    type: NodeTypes.ACTION;
    with: NodeSelectors;
    operationVersion: string;
}
export interface ConditionalStep extends WorkflowDefinitionStepBase {
    type: NodeTypes.CONDITIONAL;
    with: ConditionMapper;
}
export interface ValidationStep extends WorkflowDefinitionStepBase {
    type: NodeTypes.VALIDATION;
    with: ValidationMapper;
}
export interface PlaceholderStep extends WorkflowDefinitionStepBase {
    type: NodeTypes.PLACEHOLDER;
    with: object;
}
export type WorkflowDefinitionStep = ActionStep | ConditionalStep | ValidationStep | PlaceholderStep;
export interface CreateWorkflowDefinition {
    identifier: string;
    name: string;
    ttl: number;
    triggerName: string;
    triggerType: TriggerType;
    triggerIdentifier: string;
    semanticIdentifier: string;
    steps: Array<WorkflowDefinitionStepBase>;
    enabled: boolean;
    workflowDrawing?: WorkflowDrawing;
    trigger?: TriggerInterface;
}
export interface WorkflowDefinition extends CreateWorkflowDefinition, StoredInterface {
    steps: Array<WorkflowDefinitionStepBase>;
    tenantIdentifier: string;
}
/**
 * TODO: set this later as WorkflowDefinition
 * However if i do that right now, compilation fails
 */
export interface BetterWorkflowDefinition extends WorkflowDefinition {
    steps: Array<WorkflowDefinitionStep & StoredInterface>;
}
