11import { type Node } from "@xyflow/react" ;
22
3- import type { TaskNodeData } from "@/types/taskNode" ;
3+ import type { TaskNodeCreationData } from "@/types/taskNode" ;
44import {
55 type ComponentSpec ,
66 type GraphSpec ,
@@ -13,7 +13,7 @@ import { createTaskNode } from "./createTaskNode";
1313
1414const createNodesFromComponentSpec = (
1515 componentSpec : ComponentSpec ,
16- nodeData : TaskNodeData ,
16+ nodeData : TaskNodeCreationData ,
1717) : Node [ ] => {
1818 if ( ! isGraphImplementation ( componentSpec . implementation ) ) {
1919 return [ ] ;
@@ -27,15 +27,18 @@ const createNodesFromComponentSpec = (
2727 return [ ...taskNodes , ...inputNodes , ...outputNodes ] ;
2828} ;
2929
30- const createTaskNodes = ( graphSpec : GraphSpec , nodeData : TaskNodeData ) => {
30+ const createTaskNodes = (
31+ graphSpec : GraphSpec ,
32+ nodeData : TaskNodeCreationData ,
33+ ) => {
3134 return Object . entries ( graphSpec . tasks ) . map ( ( task ) =>
3235 createTaskNode ( task , nodeData ) ,
3336 ) ;
3437} ;
3538
3639const createInputNodes = (
3740 componentSpec : ComponentSpec ,
38- nodeData : TaskNodeData ,
41+ nodeData : TaskNodeCreationData ,
3942) => {
4043 return ( componentSpec . inputs ?? [ ] ) . map ( ( inputSpec ) =>
4144 createInputNode ( inputSpec , nodeData ) ,
@@ -44,7 +47,7 @@ const createInputNodes = (
4447
4548const createOutputNodes = (
4649 componentSpec : ComponentSpec ,
47- nodeData : TaskNodeData ,
50+ nodeData : TaskNodeCreationData ,
4851) => {
4952 return ( componentSpec . outputs ?? [ ] ) . map ( ( outputSpec ) =>
5053 createOutputNode ( outputSpec , nodeData ) ,
0 commit comments