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:
कारतोफ्फेलस्क्रिप्ट™
2023-03-16 15:34:13 +01:00
committed by GitHub
parent c07f838ce6
commit 9bd7529193
39 changed files with 154 additions and 178 deletions

View File

@@ -7,7 +7,7 @@ import type { Role } from '@db/entities/Role';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type * as UserManagementMailer from '@/UserManagement/email/UserManagementMailer';
import type { UserManagementMailer } from '@/UserManagement/email';
import type { Risk } from '@/audit/types';
@@ -26,10 +26,10 @@ export type AuthenticatedRequest<
> = express.Request<RouteParams, ResponseBody, RequestBody, RequestQuery> & {
user: User;
globalMemberRole?: Role;
mailer?: UserManagementMailer.UserManagementMailer;
mailer?: UserManagementMailer;
};
export type PaginatatedRequest = AuthenticatedRequest<
export type PaginatedRequest = AuthenticatedRequest<
{},
{},
{},

View File

@@ -2,7 +2,7 @@
import type express from 'express';
import type { AuthenticatedRequest, PaginatatedRequest } from '../../../types';
import type { AuthenticatedRequest, PaginatedRequest } from '../../../types';
import { decodeCursor } from '../services/pagination.service';
export const authorize =
@@ -22,7 +22,7 @@ export const authorize =
};
export const validCursor = (
req: PaginatatedRequest,
req: PaginatedRequest,
res: express.Response,
next: express.NextFunction,
): express.Response | void => {