refactor: Use NodeConnectionType consistently across the code base (no-changelog) (#10595)

This commit is contained in:
Ricardo Espinoza
2024-08-29 09:55:53 -04:00
committed by GitHub
parent 1491cbd228
commit c4eb3746d7
521 changed files with 2259 additions and 1999 deletions

View File

@@ -35,7 +35,6 @@ import type {
IWorkflowExecuteAdditionalData,
NodeParameterValue,
ResourceMapperValue,
ConnectionTypes,
INodeTypeDescription,
INodeOutputConfiguration,
INodeInputConfiguration,
@@ -1245,8 +1244,8 @@ export function getNodeWebhookUrl(
}
export function getConnectionTypes(
connections: Array<ConnectionTypes | INodeInputConfiguration | INodeOutputConfiguration>,
): ConnectionTypes[] {
connections: Array<NodeConnectionType | INodeInputConfiguration | INodeOutputConfiguration>,
): NodeConnectionType[] {
return connections
.map((connection) => {
if (typeof connection === 'string') {
@@ -1261,7 +1260,7 @@ export function getNodeInputs(
workflow: Workflow,
node: INode,
nodeTypeData: INodeTypeDescription,
): Array<ConnectionTypes | INodeInputConfiguration> {
): Array<NodeConnectionType | INodeInputConfiguration> {
if (Array.isArray(nodeTypeData?.inputs)) {
return nodeTypeData.inputs;
}
@@ -1273,7 +1272,7 @@ export function getNodeInputs(
nodeTypeData.inputs,
'internal',
{},
) || []) as ConnectionTypes[];
) || []) as NodeConnectionType[];
} catch (e) {
console.warn('Could not calculate inputs dynamically for node: ', node.name);
return [];
@@ -1353,8 +1352,8 @@ export function getNodeOutputs(
workflow: Workflow,
node: INode,
nodeTypeData: INodeTypeDescription,
): Array<ConnectionTypes | INodeOutputConfiguration> {
let outputs: Array<ConnectionTypes | INodeOutputConfiguration> = [];
): Array<NodeConnectionType | INodeOutputConfiguration> {
let outputs: Array<NodeConnectionType | INodeOutputConfiguration> = [];
if (Array.isArray(nodeTypeData.outputs)) {
outputs = nodeTypeData.outputs;
@@ -1366,7 +1365,7 @@ export function getNodeOutputs(
nodeTypeData.outputs,
'internal',
{},
) || []) as ConnectionTypes[];
) || []) as NodeConnectionType[];
} catch (e) {
console.warn('Could not calculate outputs dynamically for node: ', node.name);
}
@@ -1389,7 +1388,7 @@ export function getNodeOutputs(
...outputs,
{
category: 'error',
type: 'main',
type: NodeConnectionType.Main,
displayName: 'Error',
},
];