refactor(server): config system (#11081)

This commit is contained in:
forehalo
2025-03-27 12:32:28 +00:00
parent 7091111f85
commit 0ea38680fa
274 changed files with 7583 additions and 5841 deletions

View File

@@ -1,12 +1,7 @@
import { Injectable, Logger } from '@nestjs/common';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';
import {
Config,
NotificationNotFound,
PaginationInput,
URLHelper,
} from '../../base';
import { NotificationNotFound, PaginationInput, URLHelper } from '../../base';
import {
DEFAULT_WORKSPACE_NAME,
InvitationNotificationCreate,
@@ -30,8 +25,7 @@ export class NotificationService {
private readonly models: Models,
private readonly docReader: DocReader,
private readonly mailer: Mailer,
private readonly url: URLHelper,
private readonly config: Config
private readonly url: URLHelper
) {}
async cleanExpiredNotifications() {
@@ -100,7 +94,7 @@ export class NotificationService {
private async sendInvitationEmail(input: InvitationNotificationCreate) {
const inviteUrl = this.url.link(`/invite/${input.body.inviteId}`);
if (this.config.node.dev) {
if (env.dev) {
// make it easier to test in dev mode
this.logger.debug(`Invite link: ${inviteUrl}`);
}