feat: fetch flow (#1068)

### What problem does this PR solve?
feat: fetch flow #918 
feat: save graph

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-06 11:01:14 +08:00
committed by GitHub
parent b6980d8a16
commit 72c6784ff8
22 changed files with 241 additions and 90 deletions

View File

@ -1,10 +1,13 @@
import { Edge, Node } from 'reactflow';
export type DSLComponents = Record<string, IOperator>;
export interface DSL {
components: DSLComponents;
history: any[];
path: string[];
answer: any[];
history?: any[];
path?: string[];
answer?: any[];
graph?: IGraph;
}
export interface IOperator {
@ -17,3 +20,28 @@ export interface IOperatorNode {
component_name: string;
params: Record<string, unknown>;
}
export interface IGraph {
nodes: Node[];
edges: Edge[];
}
export interface IFlow {
avatar: null;
canvas_type: null;
create_date: string;
create_time: number;
description: null;
dsl: {
answer: any[];
components: DSLComponents;
graph: IGraph;
history: any[];
path: string[];
};
id: string;
title: string;
update_date: string;
update_time: number;
user_id: string;
}