index.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { ReactFlowJsonObject, XYPosition } from "reactflow";
  2. import { APIClassType } from "../api/index";
  3. export type FlowType = {
  4. name: string;
  5. id: string;
  6. data: ReactFlowJsonObject | null;
  7. description: string;
  8. status: number;
  9. style?: FlowStyleType;
  10. user_name?: string;
  11. write: boolean;
  12. guide_word: string
  13. is_component?: boolean;
  14. parent?: string;
  15. date_created?: string;
  16. updated_at?: string;
  17. last_tested_version?: string;
  18. avatar_img?: string;
  19. avatar_color?: string;
  20. };
  21. export type NodeType = {
  22. id: string;
  23. type?: string;
  24. position: XYPosition;
  25. data: NodeDataType;
  26. selected?: boolean;
  27. };
  28. export type NodeDataType = {
  29. showNode?: boolean;
  30. type: string;
  31. node?: APIClassType;
  32. id: string;
  33. output_types?: string[];
  34. };
  35. // FlowStyleType is the type of the style object that is used to style the
  36. // Flow card with an emoji and a color.
  37. export type FlowStyleType = {
  38. emoji: string;
  39. color: string;
  40. flow_id: string;
  41. };
  42. export type TweaksType = Array<
  43. {
  44. [key: string]: {
  45. output_key?: string;
  46. };
  47. } & FlowStyleType
  48. >;
  49. // right side
  50. export type sourceHandleType = {
  51. dataType: string;
  52. id: string;
  53. baseClasses: string[];
  54. };
  55. //left side
  56. export type targetHandleType = {
  57. inputTypes?: string[];
  58. type: string;
  59. fieldName: string;
  60. id: string;
  61. proxy?: { field: string; id: string };
  62. };
  63. export type FlowVersionItem = {
  64. create_time: string;
  65. data: null | any; // Replace 'any' with a more specific type if known
  66. description: null | string;
  67. flow_id: string;
  68. id: number;
  69. is_current: number;
  70. is_delete: number;
  71. name: string;
  72. update_time: string;
  73. user_id: null | string;
  74. };