mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +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:
@@ -29,7 +29,9 @@ import {
|
||||
ITaskDataConnections,
|
||||
IWorkflowDataProxyAdditionalKeys,
|
||||
IWorkflowExecuteAdditionalData,
|
||||
NodeApiError,
|
||||
NodeHelpers,
|
||||
NodeOperationError,
|
||||
NodeParameterValue,
|
||||
Workflow,
|
||||
WorkflowExecuteMode,
|
||||
@@ -37,6 +39,7 @@ import {
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
IExecuteData,
|
||||
IExecuteSingleFunctions,
|
||||
IN8nRequestOperations,
|
||||
INodeProperties,
|
||||
@@ -77,6 +80,7 @@ export class RoutingNode {
|
||||
inputData: ITaskDataConnections,
|
||||
runIndex: number,
|
||||
nodeType: INodeType,
|
||||
executeData: IExecuteData,
|
||||
nodeExecuteFunctions: INodeExecuteFunctions,
|
||||
credentialsDecrypted?: ICredentialsDecrypted,
|
||||
): Promise<INodeExecutionData[][] | null | undefined> {
|
||||
@@ -97,6 +101,7 @@ export class RoutingNode {
|
||||
inputData,
|
||||
this.node,
|
||||
this.additionalData,
|
||||
executeData,
|
||||
this.mode,
|
||||
);
|
||||
|
||||
@@ -119,6 +124,7 @@ export class RoutingNode {
|
||||
this.node,
|
||||
i,
|
||||
this.additionalData,
|
||||
executeData,
|
||||
this.mode,
|
||||
);
|
||||
|
||||
@@ -145,6 +151,7 @@ export class RoutingNode {
|
||||
value,
|
||||
i,
|
||||
runIndex,
|
||||
executeData,
|
||||
{ $credentials: credentials },
|
||||
true,
|
||||
) as string;
|
||||
@@ -160,6 +167,7 @@ export class RoutingNode {
|
||||
value,
|
||||
i,
|
||||
runIndex,
|
||||
executeData,
|
||||
{ $credentials: credentials },
|
||||
true,
|
||||
) as string | NodeParameterValue;
|
||||
@@ -198,7 +206,7 @@ export class RoutingNode {
|
||||
returnData.push({ json: {}, error: error.message });
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
throw new NodeApiError(this.node, error, { runIndex, itemIndex: i });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,9 +262,10 @@ export class RoutingNode {
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
throw new NodeOperationError(
|
||||
this.node,
|
||||
`The rootProperty "${action.properties.property}" could not be found on item.`,
|
||||
{ runIndex, itemIndex },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -269,6 +278,7 @@ export class RoutingNode {
|
||||
value,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ $response: responseData, $value: parameterValue },
|
||||
false,
|
||||
) as IDataObject,
|
||||
@@ -315,6 +325,7 @@ export class RoutingNode {
|
||||
propertyValue,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{
|
||||
$response: responseData,
|
||||
$responseItem: item.json,
|
||||
@@ -338,6 +349,7 @@ export class RoutingNode {
|
||||
destinationProperty,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ $response: responseData, $value: parameterValue },
|
||||
false,
|
||||
) as string;
|
||||
@@ -512,8 +524,10 @@ export class RoutingNode {
|
||||
| IDataObject[]
|
||||
| undefined;
|
||||
if (tempResponseValue === undefined) {
|
||||
throw new Error(
|
||||
throw new NodeOperationError(
|
||||
this.node,
|
||||
`The rootProperty "${properties.rootProperty}" could not be found on item.`,
|
||||
{ runIndex, itemIndex },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -546,6 +560,7 @@ export class RoutingNode {
|
||||
parameterValue: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[],
|
||||
itemIndex: number,
|
||||
runIndex: number,
|
||||
executeData: IExecuteData,
|
||||
additionalKeys?: IWorkflowDataProxyAdditionalKeys,
|
||||
returnObjectAsString = false,
|
||||
): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | string {
|
||||
@@ -560,6 +575,7 @@ export class RoutingNode {
|
||||
this.mode,
|
||||
this.additionalData.timezone,
|
||||
additionalKeys ?? {},
|
||||
executeData,
|
||||
returnObjectAsString,
|
||||
);
|
||||
}
|
||||
@@ -617,6 +633,7 @@ export class RoutingNode {
|
||||
propertyValue,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ ...additionalKeys, $value: parameterValue },
|
||||
true,
|
||||
) as string;
|
||||
@@ -633,6 +650,7 @@ export class RoutingNode {
|
||||
propertyName,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
additionalKeys,
|
||||
true,
|
||||
) as string;
|
||||
@@ -647,6 +665,7 @@ export class RoutingNode {
|
||||
valueString,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ ...additionalKeys, $value: value },
|
||||
true,
|
||||
) as string;
|
||||
@@ -680,6 +699,7 @@ export class RoutingNode {
|
||||
paginateValue,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ ...additionalKeys, $value: parameterValue },
|
||||
true,
|
||||
) as string;
|
||||
@@ -701,6 +721,7 @@ export class RoutingNode {
|
||||
maxResultsValue,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{ ...additionalKeys, $value: parameterValue },
|
||||
true,
|
||||
) as string;
|
||||
|
||||
Reference in New Issue
Block a user