@@ -4,6 +4,7 @@ import WorkflowsSpecification1Element from './elements/WorkflowsSpecification1';
4
4
import WorkflowsSpecElement from './elements/WorkflowsSpec' ;
5
5
import InfoElement from './elements/Info' ;
6
6
import SourceDescriptionElement from './elements/SourceDescription' ;
7
+ import WorkflowElement from './elements/Workflow' ;
7
8
import StepElement from './elements/Step' ;
8
9
import ParameterElement from './elements/Parameter' ;
9
10
import SuccessActionElement from './elements/SuccessAction' ;
@@ -14,6 +15,8 @@ import ReferenceElement from './elements/Reference';
14
15
import JSONSchemaElement from './elements/JSONSchema' ;
15
16
// NCE types
16
17
import SourceDescriptionsElement from './elements/nces/SourceDescriptions' ;
18
+ import WorkflowStepsElement from './elements/nces/WorkflowSteps' ;
19
+ import WorkflowOutputsElement from './elements/nces/WorkflowOutputs' ;
17
20
import StepParametersElement from './elements/nces/StepParameters' ;
18
21
import StepDependsOnElement from './elements/nces/StepDependsOn' ;
19
22
import StepSuccessCriteriaElement from './elements/nces/StepSuccessCriteria' ;
@@ -77,6 +80,38 @@ export const isSourceDescriptionsElement = createPredicate(
77
80
} ,
78
81
) ;
79
82
83
+ export const isWorkflowStepsElement = createPredicate (
84
+ ( { hasBasicElementProps, isElementType, primitiveEq, hasClass } ) => {
85
+ return ( element : unknown ) : element is WorkflowStepsElement =>
86
+ element instanceof WorkflowStepsElement ||
87
+ ( hasBasicElementProps ( element ) &&
88
+ isElementType ( 'array' , element ) &&
89
+ primitiveEq ( 'array' , element ) &&
90
+ hasClass ( 'workflow-steps' , element ) ) ;
91
+ } ,
92
+ ) ;
93
+
94
+ export const isWorkflowOutputsElement = createPredicate (
95
+ ( { hasBasicElementProps, isElementType, primitiveEq, hasClass } ) => {
96
+ return ( element : unknown ) : element is WorkflowOutputsElement =>
97
+ element instanceof WorkflowOutputsElement ||
98
+ ( hasBasicElementProps ( element ) &&
99
+ isElementType ( 'array' , element ) &&
100
+ primitiveEq ( 'array' , element ) &&
101
+ hasClass ( 'workflow-outputs' , element ) ) ;
102
+ } ,
103
+ ) ;
104
+
105
+ export const isWorkflowElement = createPredicate (
106
+ ( { hasBasicElementProps, isElementType, primitiveEq } ) => {
107
+ return ( element : unknown ) : element is WorkflowElement =>
108
+ element instanceof WorkflowElement ||
109
+ ( hasBasicElementProps ( element ) &&
110
+ isElementType ( 'workflow' , element ) &&
111
+ primitiveEq ( 'object' , element ) ) ;
112
+ } ,
113
+ ) ;
114
+
80
115
export const isStepOnSuccessElement = createPredicate (
81
116
( { hasBasicElementProps, isElementType, primitiveEq, hasClass } ) => {
82
117
return ( element : unknown ) : element is StepOnSuccessElement =>
0 commit comments