import { ChartInterface } from '../chart.interface';
import { ConditionalTypes, NodeTypes, TriggerType, WorkflowRunStatusStatus } from './enums';
import { ConditionMapper, ValidationMapper } from './parameter-mapper.interface';
export interface Conditional {
    type: ConditionalTypes;
}
export interface Selectors {
    selector: string;
    items?: NodeSelectors;
}
export interface NodeSelectors {
    [key: string]: Selectors;
}
export interface Node {
    id: string;
    type: NodeTypes;
    position: {
        x: number;
        y: number;
    };
    meta?: Record<string, string | Array<string>>;
    name: string;
}
export interface ActionNode extends Node {
    type: NodeTypes.ACTION;
    action: {
        identifier: string;
        version: string;
    };
    with: NodeSelectors;
}
export interface TriggerNode extends Node {
    type: NodeTypes.TRIGGER;
    trigger: {
        name: string;
        type: TriggerType;
        identifier: string;
    };
}
export interface ConditionalNode extends Node {
    type: NodeTypes.CONDITIONAL;
    condition: Conditional;
    with: ConditionMapper;
}
export interface ValidationNode extends Node {
    type: NodeTypes.VALIDATION;
    with: ValidationMapper;
}
export interface AnnotationNode extends Node {
    type: NodeTypes.ANNOTATION;
}
export interface EndNode extends Node {
    type: NodeTypes.END;
}
export interface PlaceholderNode extends Node {
    type: NodeTypes.PLACEHOLDER;
}
export interface InvisibleNode extends Node {
    type: NodeTypes.INVISIBLE;
}
export type WorkflowNode = ActionNode | ConditionalNode | AnnotationNode | PlaceholderNode | ValidationNode | EndNode | InvisibleNode;
export interface Edge {
    id: string;
    source: {
        nodeId: string;
    };
    target: {
        nodeId: string;
    };
    type: string;
    meta?: Record<string, string | Array<string>>;
}
export interface CreateWorkflowDrawingInterface {
    name: string;
    description: string;
    identifier: string;
    ttl: number;
    trigger: TriggerNode;
    nodes: Array<WorkflowNode>;
    edges: Array<Edge>;
    enabled: boolean;
}
export type WorkflowDrawingChartSubInterface = Pick<ChartInterface, 'id' | 'params' | 'slice_name' | 'supersetId' | 'viz_type'>;
export type WorkflowDrawingPayload = Array<{
    value: string;
    label: string;
    field_type: 'text' | 'string' | 'number' | 'textarea' | 'checkbox' | 'select' | 'cube-select';
    field_options?: Array<{
        dimensions: string;
    }>;
    field_dataset?: string;
}>;
export interface WorkflowDrawing extends CreateWorkflowDrawingInterface {
    id: string;
    createdAt: Date;
    updatedAt: Date;
    version: number;
    triggerChart?: WorkflowDrawingChartSubInterface;
    lastRun?: WorkflowDrawingLastRunInterface;
}
export interface WorkflowDrawingLastRunInterface {
    id: string;
    status: WorkflowRunStatusStatus;
    createdAt: Date;
}
export interface WorkflowDrawingWithPayload extends WorkflowDrawing {
    payload: WorkflowDrawingPayload;
}
