mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Use an IoC container to manage singleton classes [Part-2] (no-changelog) (#5690)
* use typedi for UserManagementMailer * use typedi for SamlService * fix typos * use typedi for Queue * use typedi for License * convert some more code to use typedi
This commit is contained in:
committed by
GitHub
parent
c07f838ce6
commit
9bd7529193
@@ -3,7 +3,7 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type { INode, WebhookHttpMethod } from 'n8n-workflow';
|
||||
import { NodeHelpers, Workflow, LoggerProxy as Logger } from 'n8n-workflow';
|
||||
|
||||
import { Service } from 'typedi';
|
||||
import type express from 'express';
|
||||
|
||||
import * as Db from '@/Db';
|
||||
@@ -13,9 +13,11 @@ import { NodeTypes } from '@/NodeTypes';
|
||||
import type { IExecutionResponse, IResponseCallbackData, IWorkflowDb } from '@/Interfaces';
|
||||
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
|
||||
import { getWorkflowOwner } from '@/UserManagement/UserManagementHelper';
|
||||
import { Container } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export class WaitingWebhooks {
|
||||
constructor(private nodeTypes: NodeTypes) {}
|
||||
|
||||
async executeWebhook(
|
||||
httpMethod: WebhookHttpMethod,
|
||||
fullPath: string,
|
||||
@@ -79,14 +81,13 @@ export class WaitingWebhooks {
|
||||
|
||||
const { workflowData } = fullExecutionData;
|
||||
|
||||
const nodeTypes = Container.get(NodeTypes);
|
||||
const workflow = new Workflow({
|
||||
id: workflowData.id!.toString(),
|
||||
name: workflowData.name,
|
||||
nodes: workflowData.nodes,
|
||||
connections: workflowData.connections,
|
||||
active: workflowData.active,
|
||||
nodeTypes,
|
||||
nodeTypes: this.nodeTypes,
|
||||
staticData: workflowData.staticData,
|
||||
settings: workflowData.settings,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user