refactor(core): Remove NodeExecutionOutput. Add execution hints directly to the context (#13111)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-02-10 16:51:01 +01:00
committed by GitHub
parent 5dddf772cf
commit dbb9475b7b
17 changed files with 103 additions and 171 deletions

View File

@@ -10,12 +10,7 @@ import type {
JsonObject,
NodeExecutionHint,
} from 'n8n-workflow';
import {
NodeConnectionType,
NodeApiError,
NodeOperationError,
NodeExecutionOutput,
} from 'n8n-workflow';
import { NodeConnectionType, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import { calendarFields, calendarOperations } from './CalendarDescription';
@@ -811,7 +806,7 @@ export class GoogleCalendar implements INodeType {
}
if (hints.length) {
return new NodeExecutionOutput([nodeExecutionData], hints);
this.addExecutionHints(...hints);
}
return [nodeExecutionData];

View File

@@ -1,6 +1,6 @@
import type { MockProxy } from 'jest-mock-extended';
import { mock } from 'jest-mock-extended';
import type { INode, IExecuteFunctions, IDataObject, NodeExecutionOutput } from 'n8n-workflow';
import type { INode, IExecuteFunctions, IDataObject } from 'n8n-workflow';
import * as genericFunctions from '../../GenericFunctions';
import { GoogleCalendar } from '../../GoogleCalendar.node';
@@ -207,15 +207,13 @@ describe('Google Calendar Node', () => {
},
];
const result = await googleCalendar.execute.call(mockExecuteFunctions);
await googleCalendar.execute.call(mockExecuteFunctions);
expect((result as NodeExecutionOutput).getHints()).toEqual([
{
message:
"Some events repeat far into the future. To return less of them, add a 'Before' date or change the 'Recurring Event Handling' option.",
location: 'outputPane',
},
]);
expect(mockExecuteFunctions.addExecutionHints).toHaveBeenCalledWith({
message:
"Some events repeat far into the future. To return less of them, add a 'Before' date or change the 'Recurring Event Handling' option.",
location: 'outputPane',
});
});
});
});