refactor(core): Make workflow services injectable (no-changelog) (#8033)

Refactor static workflow service classes into DI-compatible classes

Context: https://n8nio.slack.com/archives/C069HS026UF/p1702466571648889

Up next:
- Inject dependencies into workflow services
- Consolidate workflow controllers into one
- Make workflow controller injectable
- Inject dependencies into workflow controller

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2023-12-15 12:59:56 +01:00
committed by GitHub
parent 2da15d0264
commit 1e7a309e63
13 changed files with 125 additions and 80 deletions

View File

@@ -7,7 +7,7 @@ import type { TagEntity } from '@db/entities/TagEntity';
import type { User } from '@db/entities/User';
import { SharedWorkflowRepository } from '@db/repositories/sharedWorkflow.repository';
import { WorkflowHistoryRepository } from '@db/repositories/workflowHistory.repository';
import type { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
import { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
import { randomApiKey } from '../shared/random';
import * as utils from '../shared/utils/';
@@ -43,7 +43,10 @@ beforeAll(async () => {
});
await utils.initNodeTypes();
workflowRunner = await utils.initActiveWorkflowRunner();
workflowRunner = Container.get(ActiveWorkflowRunner);
await workflowRunner.init();
});
beforeEach(async () => {