1- import { store } from 'app/store/store' ;
21import {
32 SchedulerParam ,
43 zBaseModel ,
@@ -10,14 +9,14 @@ import { keyBy } from 'lodash-es';
109import { OpenAPIV3 } from 'openapi-types' ;
1110import { RgbaColor } from 'react-colorful' ;
1211import { Node } from 'reactflow' ;
13- import { JsonObject } from 'type-fest' ;
1412import { Graph , ImageDTO , _InputField , _OutputField } from 'services/api/types' ;
1513import {
1614 AnyInvocationType ,
1715 AnyResult ,
1816 ProgressImage ,
1917} from 'services/events/types' ;
2018import { O } from 'ts-toolbelt' ;
19+ import { JsonObject } from 'type-fest' ;
2120import { z } from 'zod' ;
2221
2322export type NonNullableGraph = O . Required < Graph , 'nodes' | 'edges' > ;
@@ -936,22 +935,10 @@ export const zWorkflow = z.object({
936935} ) ;
937936
938937export const zValidatedWorkflow = zWorkflow . transform ( ( workflow ) => {
939- const nodeTemplates = store . getState ( ) . nodes . nodeTemplates ;
940938 const { nodes, edges } = workflow ;
941939 const warnings : WorkflowWarning [ ] = [ ] ;
942940 const invocationNodes = nodes . filter ( isWorkflowInvocationNode ) ;
943941 const keyedNodes = keyBy ( invocationNodes , 'id' ) ;
944- invocationNodes . forEach ( ( node , i ) => {
945- const nodeTemplate = nodeTemplates [ node . data . type ] ;
946- if ( ! nodeTemplate ) {
947- warnings . push ( {
948- message : `Node "${ node . data . label || node . data . id } " skipped` ,
949- issues : [ `Unable to find template for type "${ node . data . type } "` ] ,
950- data : node ,
951- } ) ;
952- delete nodes [ i ] ;
953- }
954- } ) ;
955942 edges . forEach ( ( edge , i ) => {
956943 const sourceNode = keyedNodes [ edge . source ] ;
957944 const targetNode = keyedNodes [ edge . target ] ;
0 commit comments