mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Add support for pairedItem (beta) (#3012)
* ✨ Add pairedItem support * 👕 Fix lint issue * 🐛 Fix resolution in frontend * 🐛 Fix resolution issue * 🐛 Fix resolution in frontend * 🐛 Fix another resolution issue in frontend * ⚡ Try to automatically add pairedItem data if possible * ⚡ Cleanup * ⚡ Display expression errors in editor UI * 🐛 Fix issue that it did not display errors in production * 🐛 Fix auto-fix of missing pairedItem data * 🐛 Fix frontend resolution for not executed nodes * ⚡ Fail execution on pairedItem resolve issue and display information about itemIndex and runIndex * ⚡ Allow that pairedItem is only set to number if runIndex is 0 * ✨ Improve Expression Errors * ⚡ Remove no longer needed code * ⚡ Make errors more helpful * ⚡ Add additional errors * 👕 Fix lint issue * ⚡ Add pairedItem support to core nodes * ⚡ Improve support in Merge-Node * ⚡ Fix issue with not correctly converted incoming pairedItem data * 🐛 Fix frontend resolve issue * 🐛 Fix frontend parameter name display issue * ⚡ Improve errors * 👕 Fix lint issue * ⚡ Improve errors * ⚡ Make it possible to display parameter name in error messages * ⚡ Improve error messages * ⚡ Fix error message * ⚡ Improve error messages * ⚡ Add another error message * ⚡ Simplify
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
ICredentialsEncrypted,
|
||||
ICredentialsHelper,
|
||||
IDataObject,
|
||||
IExecuteData,
|
||||
IExecuteFunctions,
|
||||
IExecuteResponsePromiseData,
|
||||
IExecuteSingleFunctions,
|
||||
@@ -146,6 +147,7 @@ export function getNodeParameter(
|
||||
mode: WorkflowExecuteMode,
|
||||
timezone: string,
|
||||
additionalKeys: IWorkflowDataProxyAdditionalKeys,
|
||||
executeData: IExecuteData,
|
||||
fallbackValue?: any,
|
||||
): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | object {
|
||||
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
||||
@@ -189,6 +191,7 @@ export function getExecuteFunctions(
|
||||
node: INode,
|
||||
itemIndex: number,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
executeData: IExecuteData,
|
||||
mode: WorkflowExecuteMode,
|
||||
): IExecuteFunctions {
|
||||
return ((workflow, runExecutionData, connectionInputData, inputData, node) => {
|
||||
@@ -272,6 +275,9 @@ export function getExecuteFunctions(
|
||||
getTimezone: (): string => {
|
||||
return additionalData.timezone;
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
},
|
||||
getWorkflow: () => {
|
||||
return {
|
||||
id: workflow.id,
|
||||
@@ -291,6 +297,7 @@ export function getExecuteFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
executeData,
|
||||
);
|
||||
return dataProxy.getDataProxy();
|
||||
},
|
||||
@@ -375,6 +382,7 @@ export function getExecuteSingleFunctions(
|
||||
node: INode,
|
||||
itemIndex: number,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
executeData: IExecuteData,
|
||||
mode: WorkflowExecuteMode,
|
||||
): IExecuteSingleFunctions {
|
||||
return ((workflow, runExecutionData, connectionInputData, inputData, node, itemIndex) => {
|
||||
@@ -431,6 +439,9 @@ export function getExecuteSingleFunctions(
|
||||
getTimezone: (): string => {
|
||||
return additionalData.timezone;
|
||||
},
|
||||
getExecuteData: (): IExecuteData => {
|
||||
return executeData;
|
||||
},
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
@@ -473,6 +484,7 @@ export function getExecuteSingleFunctions(
|
||||
mode,
|
||||
additionalData.timezone,
|
||||
{},
|
||||
executeData,
|
||||
);
|
||||
return dataProxy.getDataProxy();
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
INodeExecuteFunctions,
|
||||
IN8nRequestOperations,
|
||||
INodeCredentialDescription,
|
||||
IExecuteData,
|
||||
} from '../src';
|
||||
|
||||
import * as Helpers from './Helpers';
|
||||
@@ -657,6 +658,11 @@ describe('RoutingNode', () => {
|
||||
node,
|
||||
itemIndex,
|
||||
additionalData,
|
||||
{
|
||||
node,
|
||||
data: {},
|
||||
source: null,
|
||||
},
|
||||
mode,
|
||||
);
|
||||
|
||||
@@ -1636,6 +1642,12 @@ describe('RoutingNode', () => {
|
||||
mode,
|
||||
);
|
||||
|
||||
const executeData = {
|
||||
data: {},
|
||||
node,
|
||||
source: null,
|
||||
} as IExecuteData;
|
||||
|
||||
// @ts-ignore
|
||||
const nodeExecuteFunctions: INodeExecuteFunctions = {
|
||||
getExecuteFunctions: () => {
|
||||
@@ -1648,6 +1660,7 @@ describe('RoutingNode', () => {
|
||||
node,
|
||||
itemIndex,
|
||||
additionalData,
|
||||
executeData,
|
||||
mode,
|
||||
);
|
||||
},
|
||||
@@ -1661,6 +1674,7 @@ describe('RoutingNode', () => {
|
||||
node,
|
||||
itemIndex,
|
||||
additionalData,
|
||||
executeData,
|
||||
mode,
|
||||
);
|
||||
},
|
||||
@@ -1670,6 +1684,7 @@ describe('RoutingNode', () => {
|
||||
inputData,
|
||||
runIndex,
|
||||
nodeType,
|
||||
executeData,
|
||||
nodeExecuteFunctions,
|
||||
);
|
||||
|
||||
|
||||
@@ -1243,6 +1243,7 @@ describe('Workflow', () => {
|
||||
],
|
||||
],
|
||||
},
|
||||
source: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -94,6 +94,7 @@ describe('WorkflowDataProxy', () => {
|
||||
],
|
||||
],
|
||||
},
|
||||
source: [],
|
||||
},
|
||||
],
|
||||
Rename: [
|
||||
@@ -122,6 +123,7 @@ describe('WorkflowDataProxy', () => {
|
||||
],
|
||||
],
|
||||
},
|
||||
source: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user