mirror of
https://github.com/hexastack/hexabot
synced 2025-05-31 10:57:06 +00:00
Merge pull request #852 from Hexastack/851-issue---make-logger-part-of-the-base-repository
feat: centrelize logger
This commit is contained in:
commit
a718128186
@ -11,7 +11,6 @@ import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { Subscriber } from '@/chat/schemas/subscriber.schema';
|
||||
import { config } from '@/config';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { BotStatsRepository } from '../repositories/bot-stats.repository';
|
||||
@ -19,10 +18,7 @@ import { BotStats, BotStatsType } from '../schemas/bot-stats.schema';
|
||||
|
||||
@Injectable()
|
||||
export class BotStatsService extends BaseService<BotStats> {
|
||||
constructor(
|
||||
readonly repository: BotStatsRepository,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(readonly repository: BotStatsRepository) {
|
||||
super(repository);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -13,15 +13,11 @@ import { Request } from 'express';
|
||||
import { Session as ExpressSession } from 'express-session';
|
||||
|
||||
import { AppService } from './app.service';
|
||||
import { LoggerService } from './logger/logger.service';
|
||||
import { Roles } from './utils/decorators/roles.decorator';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(
|
||||
private readonly appService: AppService,
|
||||
private readonly logger: LoggerService,
|
||||
) {}
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Roles('public')
|
||||
@Get()
|
||||
|
@ -30,7 +30,6 @@ import { diskStorage, memoryStorage } from 'multer';
|
||||
|
||||
import { config } from '@/config';
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { Roles } from '@/utils/decorators/roles.decorator';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
@ -52,10 +51,7 @@ import { AttachmentAccess, AttachmentCreatedByRef } from '../types';
|
||||
@Controller('attachment')
|
||||
@UseGuards(AttachmentGuard)
|
||||
export class AttachmentController extends BaseController<Attachment> {
|
||||
constructor(
|
||||
private readonly attachmentService: AttachmentService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly attachmentService: AttachmentService) {
|
||||
super(attachmentService);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ import { Injectable, Optional, StreamableFile } from '@nestjs/common';
|
||||
|
||||
import { HelperService } from '@/helper/helper.service';
|
||||
import { HelperType } from '@/helper/types';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { AttachmentMetadataDto } from '../dto/attachment.dto';
|
||||
@ -23,7 +22,6 @@ import { Attachment } from '../schemas/attachment.schema';
|
||||
export class AttachmentService extends BaseService<Attachment> {
|
||||
constructor(
|
||||
readonly repository: AttachmentRepository,
|
||||
private readonly logger: LoggerService,
|
||||
@Optional() private readonly helperService: HelperService,
|
||||
) {
|
||||
super(repository);
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseBlockPlugin } from '@/plugins/base-block-plugin';
|
||||
import { PluginService } from '@/plugins/plugins.service';
|
||||
import { PluginName, PluginType } from '@/plugins/types';
|
||||
@ -57,7 +56,6 @@ export class BlockController extends BaseController<
|
||||
> {
|
||||
constructor(
|
||||
private readonly blockService: BlockService,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly categoryService: CategoryService,
|
||||
private readonly labelService: LabelService,
|
||||
private readonly userService: UserService,
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -38,10 +37,7 @@ import { CategoryService } from '../services/category.service';
|
||||
@UseInterceptors(CsrfInterceptor)
|
||||
@Controller('category')
|
||||
export class CategoryController extends BaseController<Category> {
|
||||
constructor(
|
||||
private readonly categoryService: CategoryService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly categoryService: CategoryService) {
|
||||
super(categoryService);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -41,10 +40,7 @@ import { ContextVarService } from '../services/context-var.service';
|
||||
@UseInterceptors(CsrfInterceptor)
|
||||
@Controller('contextvar')
|
||||
export class ContextVarController extends BaseController<ContextVar> {
|
||||
constructor(
|
||||
private readonly contextVarService: ContextVarService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly contextVarService: ContextVarService) {
|
||||
super(contextVarService);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -49,10 +48,7 @@ export class LabelController extends BaseController<
|
||||
LabelPopulate,
|
||||
LabelFull
|
||||
> {
|
||||
constructor(
|
||||
private readonly labelService: LabelService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly labelService: LabelService) {
|
||||
super(labelService);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import { Request } from 'express'; // Import the Express request and response ty
|
||||
import { ChannelService } from '@/channel/channel.service';
|
||||
import { GenericEventWrapper } from '@/channel/lib/EventWrapper';
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -64,7 +63,6 @@ export class MessageController extends BaseController<
|
||||
private readonly messageService: MessageService,
|
||||
private readonly subscriberService: SubscriberService,
|
||||
private readonly channelService: ChannelService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(messageService);
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { generateInitialsAvatar } from '@/utils/helpers/avatar';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -50,7 +49,6 @@ export class SubscriberController extends BaseController<
|
||||
constructor(
|
||||
private readonly subscriberService: SubscriberService,
|
||||
private readonly attachmentService: AttachmentService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(subscriberService);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||
*/
|
||||
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import {
|
||||
Document,
|
||||
@ -17,7 +17,6 @@ import {
|
||||
UpdateWithAggregationPipeline,
|
||||
} from 'mongoose';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
@ -36,10 +35,7 @@ export class BlockRepository extends BaseRepository<
|
||||
BlockFull,
|
||||
BlockDto
|
||||
> {
|
||||
constructor(
|
||||
@InjectModel(Block.name) readonly model: Model<Block>,
|
||||
@Optional() private readonly logger?: LoggerService,
|
||||
) {
|
||||
constructor(@InjectModel(Block.name) readonly model: Model<Block>) {
|
||||
super(model, Block, BLOCK_POPULATE, BlockFull);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ import { CONSOLE_CHANNEL_NAME } from '@/extensions/channels/console/settings';
|
||||
import { NLU } from '@/helper/types';
|
||||
import { I18nService } from '@/i18n/services/i18n.service';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { PluginService } from '@/plugins/plugins.service';
|
||||
import { PluginType } from '@/plugins/types';
|
||||
import { SettingService } from '@/setting/services/setting.service';
|
||||
@ -52,7 +51,6 @@ export class BlockService extends BaseService<
|
||||
private readonly contentService: ContentService,
|
||||
private readonly settingService: SettingService,
|
||||
private readonly pluginService: PluginService,
|
||||
private readonly logger: LoggerService,
|
||||
protected readonly i18n: I18nService,
|
||||
protected readonly languageService: LanguageService,
|
||||
) {
|
||||
|
@ -9,7 +9,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import EventWrapper from '@/channel/lib/EventWrapper';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { ConversationDto } from '../dto/conversation.dto';
|
||||
@ -36,7 +35,6 @@ export class ConversationService extends BaseService<
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: ConversationRepository,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly contextVarService: ContextVarService,
|
||||
private readonly subscriberService: SubscriberService,
|
||||
) {
|
||||
|
@ -12,7 +12,6 @@ import {
|
||||
Optional,
|
||||
} from '@nestjs/common';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import {
|
||||
SocketGet,
|
||||
@ -36,17 +35,13 @@ export class MessageService extends BaseService<
|
||||
MessagePopulate,
|
||||
MessageFull
|
||||
> {
|
||||
private readonly logger: LoggerService;
|
||||
|
||||
private readonly gateway: WebsocketGateway;
|
||||
|
||||
constructor(
|
||||
private readonly messageRepository: MessageRepository,
|
||||
@Optional() logger?: LoggerService,
|
||||
@Optional() gateway?: WebsocketGateway,
|
||||
) {
|
||||
super(messageRepository);
|
||||
if (logger) this.logger = logger;
|
||||
if (gateway) this.gateway = gateway;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||
import { config } from '@/config';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import {
|
||||
SocketGet,
|
||||
@ -48,7 +47,6 @@ export class SubscriberService extends BaseService<
|
||||
|
||||
constructor(
|
||||
readonly repository: SubscriberRepository,
|
||||
private readonly logger: LoggerService,
|
||||
protected attachmentService: AttachmentService,
|
||||
@Optional() gateway?: WebsocketGateway,
|
||||
) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -22,7 +22,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||
@ -39,10 +38,7 @@ import { ContentTypeService } from '../services/content-type.service';
|
||||
@UseInterceptors(CsrfInterceptor)
|
||||
@Controller('contenttype')
|
||||
export class ContentTypeController extends BaseController<ContentType> {
|
||||
constructor(
|
||||
private readonly contentTypeService: ContentTypeService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly contentTypeService: ContentTypeService) {
|
||||
super(contentTypeService);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||
@ -54,7 +53,6 @@ export class ContentController extends BaseController<
|
||||
constructor(
|
||||
private readonly contentService: ContentService,
|
||||
private readonly contentTypeService: ContentTypeService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(contentService);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -22,7 +22,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||
@ -41,10 +40,7 @@ export class MenuController extends BaseController<
|
||||
MenuPopulate,
|
||||
MenuFull
|
||||
> {
|
||||
constructor(
|
||||
private readonly menuService: MenuService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly menuService: MenuService) {
|
||||
super(menuService);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ import Papa from 'papaparse';
|
||||
|
||||
import { StdOutgoingListMessage } from '@/chat/schemas/types/message';
|
||||
import { ContentOptions } from '@/chat/schemas/types/options';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
@ -31,10 +30,7 @@ export class ContentService extends BaseService<
|
||||
ContentFull,
|
||||
ContentDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: ContentRepository,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(readonly repository: ContentRepository) {
|
||||
super(repository);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -38,10 +37,7 @@ import { LanguageService } from '../services/language.service';
|
||||
@UseInterceptors(CsrfInterceptor)
|
||||
@Controller('language')
|
||||
export class LanguageController extends BaseController<Language> {
|
||||
constructor(
|
||||
private readonly languageService: LanguageService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly languageService: LanguageService) {
|
||||
super(languageService);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -42,7 +41,6 @@ export class TranslationController extends BaseController<Translation> {
|
||||
constructor(
|
||||
private readonly languageService: LanguageService,
|
||||
private readonly translationService: TranslationService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(translationService);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -15,7 +15,6 @@ import {
|
||||
} from '@nestjs/common';
|
||||
import { Cache } from 'cache-manager';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import {
|
||||
DEFAULT_LANGUAGE_CACHE_KEY,
|
||||
LANGUAGES_CACHE_KEY,
|
||||
@ -37,7 +36,6 @@ export class LanguageService extends BaseService<
|
||||
constructor(
|
||||
readonly repository: LanguageRepository,
|
||||
@Inject(CACHE_MANAGER) private readonly cacheManager: Cache,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(repository);
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -51,10 +50,7 @@ export class NlpEntityController extends BaseController<
|
||||
NlpEntityPopulate,
|
||||
NlpEntityFull
|
||||
> {
|
||||
constructor(
|
||||
private readonly nlpEntityService: NlpEntityService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
constructor(private readonly nlpEntityService: NlpEntityService) {
|
||||
super(nlpEntityService);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,6 @@ import { HelperService } from '@/helper/helper.service';
|
||||
import { HelperType } from '@/helper/types';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -68,7 +67,6 @@ export class NlpSampleController extends BaseController<
|
||||
private readonly nlpSampleService: NlpSampleService,
|
||||
private readonly nlpSampleEntityService: NlpSampleEntityService,
|
||||
private readonly nlpEntityService: NlpEntityService,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly languageService: LanguageService,
|
||||
private readonly helperService: HelperService,
|
||||
) {
|
||||
|
@ -23,7 +23,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
@ -53,7 +52,6 @@ export class NlpValueController extends BaseController<
|
||||
constructor(
|
||||
private readonly nlpValueService: NlpValueService,
|
||||
private readonly nlpEntityService: NlpEntityService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(nlpValueService);
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import Papa from 'papaparse';
|
||||
import { Message } from '@/chat/schemas/message.schema';
|
||||
import { Language } from '@/i18n/schemas/language.schema';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||
|
||||
@ -47,7 +46,6 @@ export class NlpSampleService extends BaseService<
|
||||
private readonly nlpSampleEntityService: NlpSampleEntityService,
|
||||
private readonly nlpEntityService: NlpEntityService,
|
||||
private readonly languageService: LanguageService,
|
||||
private readonly logger: LoggerService,
|
||||
) {
|
||||
super(repository);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ import { Cache } from 'cache-manager';
|
||||
|
||||
import { config } from '@/config';
|
||||
import { Config } from '@/config/types';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import {
|
||||
ALLOWED_ORIGINS_CACHE_KEY,
|
||||
SETTING_CACHE_KEY,
|
||||
@ -32,7 +31,6 @@ export class SettingService extends BaseService<Setting> {
|
||||
constructor(
|
||||
readonly repository: SettingRepository,
|
||||
@Inject(CACHE_MANAGER) private readonly cacheManager: Cache,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly seeder: SettingSeeder,
|
||||
) {
|
||||
super(repository);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -21,7 +21,6 @@ import {
|
||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { PopulatePipe } from '@/utils/pipes/populate.pipe';
|
||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||
@ -48,7 +47,6 @@ export class PermissionController extends BaseController<
|
||||
> {
|
||||
constructor(
|
||||
private readonly permissionService: PermissionService,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly roleService: RoleService,
|
||||
private readonly modelService: ModelService,
|
||||
) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -25,7 +25,6 @@ import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||
import { Request } from 'express';
|
||||
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||
@ -49,7 +48,6 @@ export class RoleController extends BaseController<
|
||||
> {
|
||||
constructor(
|
||||
private readonly roleService: RoleService,
|
||||
private readonly logger: LoggerService,
|
||||
private readonly userService: UserService,
|
||||
) {
|
||||
super(roleService);
|
||||
|
@ -38,7 +38,6 @@ import {
|
||||
} from '@/attachment/types';
|
||||
import { config } from '@/config';
|
||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { Roles } from '@/utils/decorators/roles.decorator';
|
||||
import { BaseController } from '@/utils/generics/base-controller';
|
||||
import { generateInitialsAvatar, getBotAvatar } from '@/utils/helpers/avatar';
|
||||
@ -78,7 +77,6 @@ export class ReadOnlyUserController extends BaseController<
|
||||
protected readonly invitationService: InvitationService,
|
||||
protected readonly permissionService: PermissionService,
|
||||
protected readonly attachmentService: AttachmentService,
|
||||
protected readonly logger: LoggerService,
|
||||
protected readonly passwordResetService: PasswordResetService,
|
||||
protected readonly validateAccountService: ValidateAccountService,
|
||||
) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import { CACHE_MANAGER } from '@nestjs/cache-manager';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { JwtModule, JwtService } from '@nestjs/jwt';
|
||||
import { MongooseModule } from '@nestjs/mongoose';
|
||||
import { ISendMailOptions, MailerService } from '@nestjs-modules/mailer';
|
||||
@ -73,7 +72,6 @@ describe('InvitationService', () => {
|
||||
InvitationService,
|
||||
LanguageRepository,
|
||||
LanguageService,
|
||||
Logger,
|
||||
{
|
||||
provide: I18nService,
|
||||
useValue: {
|
||||
|
@ -19,7 +19,6 @@ import { JwtService, JwtSignOptions } from '@nestjs/jwt';
|
||||
import { config } from '@/config';
|
||||
import { I18nService } from '@/i18n/services/i18n.service';
|
||||
import { LanguageService } from '@/i18n/services/language.service';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { InvitationCreateDto } from '../dto/invitation.dto';
|
||||
@ -40,7 +39,6 @@ export class InvitationService extends BaseService<
|
||||
@Inject(InvitationRepository)
|
||||
readonly repository: InvitationRepository,
|
||||
@Inject(JwtService) private readonly jwtService: JwtService,
|
||||
private logger: LoggerService,
|
||||
protected readonly i18n: I18nService,
|
||||
public readonly languageService: LanguageService,
|
||||
@Optional() private readonly mailerService?: MailerService,
|
||||
|
@ -6,8 +6,9 @@
|
||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||
*/
|
||||
|
||||
import { NotFoundException } from '@nestjs/common';
|
||||
import { Inject, NotFoundException } from '@nestjs/common';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { DtoConfig } from '../types/dto.types';
|
||||
@ -25,6 +26,9 @@ export abstract class BaseController<
|
||||
> {
|
||||
eventEmitter: typeof this.service.eventEmitter;
|
||||
|
||||
@Inject(LoggerService)
|
||||
readonly logger: LoggerService;
|
||||
|
||||
constructor(protected readonly service: BaseService<T, P, TFull, Dto>) {
|
||||
this.eventEmitter = service.eventEmitter;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import {
|
||||
UpdateWriteOpResult,
|
||||
} from 'mongoose';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||
@ -83,6 +84,9 @@ export abstract class BaseRepository<
|
||||
@Inject(EventEmitter2)
|
||||
readonly eventEmitter: EventEmitter2;
|
||||
|
||||
@Inject(LoggerService)
|
||||
readonly logger: LoggerService;
|
||||
|
||||
constructor(
|
||||
readonly model: Model<T>,
|
||||
private readonly cls: new () => T,
|
||||
|
@ -6,11 +6,12 @@
|
||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||
*/
|
||||
|
||||
import { ConflictException } from '@nestjs/common';
|
||||
import { ConflictException, Inject } from '@nestjs/common';
|
||||
import { ClassTransformOptions } from 'class-transformer';
|
||||
import { MongoError } from 'mongodb';
|
||||
import { ProjectionType, QueryOptions } from 'mongoose';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||
@ -28,6 +29,9 @@ export abstract class BaseService<
|
||||
> {
|
||||
eventEmitter: typeof this.repository.eventEmitter;
|
||||
|
||||
@Inject(LoggerService)
|
||||
readonly logger: LoggerService;
|
||||
|
||||
constructor(protected readonly repository: BaseRepository<T, P, TFull, Dto>) {
|
||||
this.eventEmitter = repository.eventEmitter;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -10,6 +10,7 @@ import { Module } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { MongooseModule } from '@nestjs/mongoose';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { installDummyFixtures } from '@/utils/test/fixtures/dummy';
|
||||
import { rootMongooseTestModule } from '@/utils/test/test';
|
||||
|
||||
@ -22,6 +23,6 @@ import { DummyService } from './services/dummy.service';
|
||||
rootMongooseTestModule(installDummyFixtures),
|
||||
MongooseModule.forFeature([DummyModel]),
|
||||
],
|
||||
providers: [DummyRepository, DummyService, EventEmitter2],
|
||||
providers: [DummyRepository, DummyService, EventEmitter2, LoggerService],
|
||||
})
|
||||
export class DummyModule {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -16,8 +16,6 @@ import { ModulesContainer } from '@nestjs/core';
|
||||
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
|
||||
import { SocketEventMetadataStorage } from '../storage/socket-event-metadata.storage';
|
||||
import { SocketRequest } from '../utils/socket-request';
|
||||
import { SocketResponse } from '../utils/socket-response';
|
||||
@ -39,7 +37,6 @@ export class SocketEventDispatcherService implements OnModuleInit {
|
||||
constructor(
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
private readonly modulesContainer: ModulesContainer,
|
||||
private readonly logger: LoggerService,
|
||||
) {}
|
||||
|
||||
async handleEvent(
|
||||
|
Loading…
Reference in New Issue
Block a user