refactor(core): Move execution engine code out of n8n-workflow (no-changelog) (#12147)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-12 13:54:44 +01:00
committed by GitHub
parent 73f0c4cca9
commit 5a055ed526
44 changed files with 1995 additions and 1795 deletions

View File

@@ -1,5 +1,4 @@
import type express from 'express';
import * as NodeExecuteFunctions from 'n8n-core';
import { InstanceSettings } from 'n8n-core';
import { WebhookPathTakenError, Workflow } from 'n8n-workflow';
import type {
@@ -25,6 +24,7 @@ import * as WebhookHelpers from '@/webhooks/webhook-helpers';
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';
import type { WorkflowRequest } from '@/workflows/workflow.request';
import { WebhookService } from './webhook.service';
import type {
IWebhookResponseCallbackData,
IWebhookManager,
@@ -44,6 +44,7 @@ export class TestWebhooks implements IWebhookManager {
private readonly registrations: TestWebhookRegistrationsService,
private readonly instanceSettings: InstanceSettings,
private readonly publisher: Publisher,
private readonly webhookService: WebhookService,
) {}
private timeouts: { [webhookKey: string]: NodeJS.Timeout } = {};
@@ -314,7 +315,7 @@ export class TestWebhooks implements IWebhookManager {
*/
await this.registrations.register(registration);
await workflow.createWebhookIfNotExists(webhook, NodeExecuteFunctions, 'manual', 'manual');
await this.webhookService.createWebhookIfNotExists(workflow, webhook, 'manual', 'manual');
cacheableWebhook.staticData = workflow.staticData;
@@ -431,7 +432,7 @@ export class TestWebhooks implements IWebhookManager {
if (staticData) workflow.staticData = staticData;
await workflow.deleteWebhook(webhook, NodeExecuteFunctions, 'internal', 'update');
await this.webhookService.deleteWebhook(workflow, webhook, 'internal', 'update');
}
await this.registrations.deregisterAll();