refactor: Migrate NodeConnectionType to const object type (no-changelog) (#14078)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Alex Grozav
2025-03-21 14:01:26 +02:00
committed by GitHub
parent 7e8179b848
commit 8215e0b59f
703 changed files with 3104 additions and 3018 deletions

View File

@@ -1,5 +1,5 @@
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
import { NodeConnectionType, type INodeTypeDescription } from 'n8n-workflow';
import { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow';
import * as mode from './mode';
import { configuredInputs } from '../helpers/utils';
@@ -14,7 +14,7 @@ export const versionDescription: INodeTypeDescription = {
name: 'Merge',
},
inputs: `={{(${configuredInputs})($parameter)}}`,
outputs: [NodeConnectionType.Main],
outputs: [NodeConnectionTypes.Main],
// If mode is chooseBranch data from both branches is required
// to continue, else data from any input suffices
requiredInputs: '={{ $parameter["mode"] === "chooseBranch" ? [0, 1] : 1 }}',

View File

@@ -12,7 +12,7 @@ import type {
INodeParameters,
IPairedItemData,
} from 'n8n-workflow';
import { ApplicationError, NodeConnectionType, NodeHelpers } from 'n8n-workflow';
import { ApplicationError, NodeConnectionTypes, NodeHelpers } from 'n8n-workflow';
import { fuzzyCompare, preparePairedItemDataArray } from '@utils/utilities';
@@ -364,7 +364,7 @@ export function addSourceField(data: INodeExecutionData[], sourceField: string)
export const configuredInputs = (parameters: INodeParameters) => {
return Array.from({ length: (parameters.numberInputs as number) || 2 }, (_, i) => ({
type: `${NodeConnectionType.Main}`,
type: 'main',
displayName: `Input ${(i + 1).toString()}`,
}));
};
@@ -373,7 +373,7 @@ export function getNodeInputsData(this: IExecuteFunctions) {
const returnData: INodeExecutionData[][] = [];
const inputs = NodeHelpers.getConnectionTypes(this.getNodeInputs()).filter(
(type) => type === NodeConnectionType.Main,
(type) => type === NodeConnectionTypes.Main,
);
for (let i = 0; i < inputs.length; i++) {