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