mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Migrate NodeConnectionType to const object type (no-changelog) (#14078)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -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 }}',
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user