mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
refactor: Use NodeConnectionType consistently across the code base (no-changelog) (#10595)
This commit is contained in:
@@ -38,7 +38,6 @@ import { extension, lookup } from 'mime-types';
|
||||
import type {
|
||||
BinaryHelperFunctions,
|
||||
CloseFunction,
|
||||
ConnectionTypes,
|
||||
ContextType,
|
||||
EventNamesAiNodesType,
|
||||
FieldType,
|
||||
@@ -105,6 +104,7 @@ import type {
|
||||
SchedulingFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
ExpressionError,
|
||||
LoggerProxy as Logger,
|
||||
NodeApiError,
|
||||
@@ -2623,13 +2623,13 @@ const addExecutionDataFunctions = async (
|
||||
nodeName: string,
|
||||
data: INodeExecutionData[][] | ExecutionBaseError,
|
||||
runExecutionData: IRunExecutionData,
|
||||
connectionType: ConnectionTypes,
|
||||
connectionType: NodeConnectionType,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
sourceNodeName: string,
|
||||
sourceNodeRunIndex: number,
|
||||
currentNodeRunIndex: number,
|
||||
): Promise<void> => {
|
||||
if (connectionType === 'main') {
|
||||
if (connectionType === NodeConnectionType.Main) {
|
||||
throw new ApplicationError('Setting type is not supported for main connection', {
|
||||
extra: { type },
|
||||
});
|
||||
@@ -2732,7 +2732,7 @@ async function getInputConnectionData(
|
||||
executeData: IExecuteData | undefined,
|
||||
mode: WorkflowExecuteMode,
|
||||
closeFunctions: CloseFunction[],
|
||||
inputName: ConnectionTypes,
|
||||
inputName: NodeConnectionType,
|
||||
itemIndex: number,
|
||||
): Promise<unknown> {
|
||||
const node = this.getNode();
|
||||
@@ -3676,7 +3676,7 @@ export function getExecuteFunctions(
|
||||
},
|
||||
|
||||
async getInputConnectionData(
|
||||
inputName: ConnectionTypes,
|
||||
inputName: NodeConnectionType,
|
||||
itemIndex: number,
|
||||
): Promise<unknown> {
|
||||
return await getInputConnectionData.call(
|
||||
@@ -3817,7 +3817,7 @@ export function getExecuteFunctions(
|
||||
},
|
||||
|
||||
addInputData(
|
||||
connectionType: ConnectionTypes,
|
||||
connectionType: NodeConnectionType,
|
||||
data: INodeExecutionData[][] | ExecutionBaseError,
|
||||
): { index: number } {
|
||||
const nodeName = this.getNode().name;
|
||||
@@ -3847,7 +3847,7 @@ export function getExecuteFunctions(
|
||||
return { index: currentNodeRunIndex };
|
||||
},
|
||||
addOutputData(
|
||||
connectionType: ConnectionTypes,
|
||||
connectionType: NodeConnectionType,
|
||||
currentNodeRunIndex: number,
|
||||
data: INodeExecutionData[][] | ExecutionBaseError,
|
||||
): void {
|
||||
@@ -4238,7 +4238,7 @@ export function getExecuteWebhookFunctions(
|
||||
return additionalData.httpRequest.headers;
|
||||
},
|
||||
async getInputConnectionData(
|
||||
inputName: ConnectionTypes,
|
||||
inputName: NodeConnectionType,
|
||||
itemIndex: number,
|
||||
): Promise<unknown> {
|
||||
// To be able to use expressions like "$json.sessionId" set the
|
||||
|
||||
@@ -623,7 +623,11 @@ export class WorkflowExecute {
|
||||
|
||||
// Check if any of the parent nodes does not have any inputs. That
|
||||
// would mean that it has to get added to the list of nodes to process.
|
||||
const parentNodes = workflow.getParentNodes(inputData.node, 'main', -1);
|
||||
const parentNodes = workflow.getParentNodes(
|
||||
inputData.node,
|
||||
NodeConnectionType.Main,
|
||||
-1,
|
||||
);
|
||||
let nodeToAdd: string | undefined = inputData.node;
|
||||
parentNodes.push(inputData.node);
|
||||
parentNodes.reverse();
|
||||
@@ -988,7 +992,11 @@ export class WorkflowExecute {
|
||||
connectionIndex++
|
||||
) {
|
||||
if (
|
||||
workflow.getHighestNode(executionNode.name, 'main', connectionIndex).length === 0
|
||||
workflow.getHighestNode(
|
||||
executionNode.name,
|
||||
NodeConnectionType.Main,
|
||||
connectionIndex,
|
||||
).length === 0
|
||||
) {
|
||||
// If there is no valid incoming node (if all are disabled)
|
||||
// then ignore that it has inputs and simply execute it as it is without
|
||||
|
||||
Reference in New Issue
Block a user