mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Use an IoC container to manage singleton classes [Part-1] (no-changelog) (#5509)
* add typedi * convert ActiveWorkflowRunner into an injectable service * convert ExternalHooks into an injectable service * convert InternalHooks into an injectable service * convert LoadNodesAndCredentials into an injectable service * convert NodeTypes and CredentialTypes into an injectable service * convert ActiveExecutions into an injectable service * convert WaitTracker into an injectable service * convert Push into an injectable service * convert ActiveWebhooks and TestWebhooks into an injectable services * handle circular references, and log errors when a circular dependency is found
This commit is contained in:
committed by
GitHub
parent
aca94bb995
commit
52f740b9e8
@@ -32,7 +32,6 @@ import type {
|
||||
IHttpRequestHelper,
|
||||
INodeTypeData,
|
||||
INodeTypes,
|
||||
ICredentialTypes,
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
ICredentialsHelper,
|
||||
@@ -54,6 +53,7 @@ import { CredentialTypes } from '@/CredentialTypes';
|
||||
import { CredentialsOverwrites } from '@/CredentialsOverwrites';
|
||||
import { whereClause } from './UserManagement/UserManagementHelper';
|
||||
import { RESPONSE_ERROR_MESSAGES } from './constants';
|
||||
import { Container } from 'typedi';
|
||||
|
||||
const mockNode = {
|
||||
name: '',
|
||||
@@ -87,8 +87,8 @@ const mockNodeTypes: INodeTypes = {
|
||||
export class CredentialsHelper extends ICredentialsHelper {
|
||||
constructor(
|
||||
encryptionKey: string,
|
||||
private credentialTypes: ICredentialTypes = CredentialTypes(),
|
||||
private nodeTypes: INodeTypes = NodeTypes(),
|
||||
private credentialTypes = Container.get(CredentialTypes),
|
||||
private nodeTypes = Container.get(NodeTypes),
|
||||
) {
|
||||
super(encryptionKey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user