refactor(core): Use IWorkflowBase over WorkflowEntity in most places (#13225)

This commit is contained in:
Tomi Turtiainen
2025-02-13 10:54:11 +02:00
committed by GitHub
parent 11cf1cd23a
commit f001edb2a2
54 changed files with 190 additions and 192 deletions

View File

@@ -7,13 +7,13 @@ import type {
IWorkflowExecuteAdditionalData,
IHttpRequestMethods,
IRunData,
IWorkflowBase,
} from 'n8n-workflow';
import { TEST_WEBHOOK_TIMEOUT } from '@/constants';
import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { WebhookNotFoundError } from '@/errors/response-errors/webhook-not-found.error';
import { WorkflowMissingIdError } from '@/errors/workflow-missing-id.error';
import type { IWorkflowDb } from '@/interfaces';
import { NodeTypes } from '@/node-types';
import { Push } from '@/push';
import { Publisher } from '@/scaling/pubsub/publisher.service';
@@ -217,7 +217,7 @@ export class TestWebhooks implements IWebhookManager {
*/
async needsWebhook(options: {
userId: string;
workflowEntity: IWorkflowDb;
workflowEntity: IWorkflowBase;
additionalData: IWorkflowExecuteAdditionalData;
runData?: IRunData;
pushRef?: string;
@@ -434,9 +434,10 @@ export class TestWebhooks implements IWebhookManager {
}
/**
* Convert a `WorkflowEntity` from `typeorm` to a temporary `Workflow` from `n8n-workflow`.
* Convert a `IWorkflowBase` interface (e.g. `WorkflowEntity`) to a temporary
* `Workflow` from `n8n-workflow`.
*/
toWorkflow(workflowEntity: IWorkflowDb) {
toWorkflow(workflowEntity: IWorkflowBase) {
return new Workflow({
id: workflowEntity.id,
name: workflowEntity.name,