mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: update DTO type naming
This commit is contained in:
@@ -148,6 +148,6 @@ export class BlockUpdateDto extends PartialType(
|
||||
trigger_channels?: string[];
|
||||
}
|
||||
|
||||
export type BlockDTOMapActions = DtoConfig<{
|
||||
export type BlockDto = DtoConfig<{
|
||||
create: BlockCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -42,6 +42,6 @@ export class CategoryCreateDto {
|
||||
|
||||
export class CategoryUpdateDto extends PartialType(CategoryCreateDto) {}
|
||||
|
||||
export type CategoryDTOMapActions = DtoConfig<{
|
||||
export type CategoryDto = DtoConfig<{
|
||||
create: CategoryCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -30,6 +30,6 @@ export class ContextVarCreateDto {
|
||||
|
||||
export class ContextVarUpdateDto extends PartialType(ContextVarCreateDto) {}
|
||||
|
||||
export type ContextVarDTOMapActions = DtoConfig<{
|
||||
export type ContextVarDto = DtoConfig<{
|
||||
create: ContextVarCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -58,6 +58,6 @@ export class ConversationCreateDto {
|
||||
next?: string[];
|
||||
}
|
||||
|
||||
export type ConversationDtoMapActions = DtoConfig<{
|
||||
export type ConversationDto = DtoConfig<{
|
||||
create: ConversationCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -42,6 +42,6 @@ export class LabelCreateDto {
|
||||
|
||||
export class LabelUpdateDto extends PartialType(LabelCreateDto) {}
|
||||
|
||||
export type LabelDtoMapActions = DtoConfig<{
|
||||
export type LabelDto = DtoConfig<{
|
||||
create: LabelCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -116,6 +116,6 @@ export class SubscriberCreateDto {
|
||||
|
||||
export class SubscriberUpdateDto extends PartialType(SubscriberCreateDto) {}
|
||||
|
||||
export type UserDtoMapActions = DtoConfig<{
|
||||
export type UserDto = DtoConfig<{
|
||||
create: SubscriberCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -22,11 +22,7 @@ import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import {
|
||||
BlockCreateDto,
|
||||
BlockDTOMapActions,
|
||||
BlockUpdateDto,
|
||||
} from '../dto/block.dto';
|
||||
import { BlockCreateDto, BlockDto, BlockUpdateDto } from '../dto/block.dto';
|
||||
import {
|
||||
Block,
|
||||
BLOCK_POPULATE,
|
||||
@@ -39,7 +35,7 @@ export class BlockRepository extends BaseRepository<
|
||||
Block,
|
||||
BlockPopulate,
|
||||
BlockFull,
|
||||
BlockDTOMapActions
|
||||
BlockDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { CategoryDTOMapActions } from '../dto/category.dto';
|
||||
import { CategoryDto } from '../dto/category.dto';
|
||||
import { Category } from '../schemas/category.schema';
|
||||
import { BlockService } from '../services/block.service';
|
||||
|
||||
@@ -23,7 +23,7 @@ export class CategoryRepository extends BaseRepository<
|
||||
Category,
|
||||
never,
|
||||
never,
|
||||
CategoryDTOMapActions
|
||||
CategoryDto
|
||||
> {
|
||||
private readonly blockService: BlockService;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { ContextVarDTOMapActions } from '../dto/context-var.dto';
|
||||
import { ContextVarDto } from '../dto/context-var.dto';
|
||||
import { ContextVar } from '../schemas/context-var.schema';
|
||||
import { BlockService } from '../services/block.service';
|
||||
|
||||
@@ -28,7 +28,7 @@ export class ContextVarRepository extends BaseRepository<
|
||||
ContextVar,
|
||||
never,
|
||||
never,
|
||||
ContextVarDTOMapActions
|
||||
ContextVarDto
|
||||
> {
|
||||
private readonly blockService: BlockService;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Model } from 'mongoose';
|
||||
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
|
||||
import { ConversationDtoMapActions } from '../dto/conversation.dto';
|
||||
import { ConversationDto } from '../dto/conversation.dto';
|
||||
import {
|
||||
Conversation,
|
||||
CONVERSATION_POPULATE,
|
||||
@@ -26,7 +26,7 @@ export class ConversationRepository extends BaseRepository<
|
||||
Conversation,
|
||||
ConversationPopulate,
|
||||
ConversationFull,
|
||||
ConversationDtoMapActions
|
||||
ConversationDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { LabelDtoMapActions } from '../dto/label.dto';
|
||||
import { LabelDto } from '../dto/label.dto';
|
||||
import {
|
||||
Label,
|
||||
LABEL_POPULATE,
|
||||
@@ -28,7 +28,7 @@ export class LabelRepository extends BaseRepository<
|
||||
Label,
|
||||
LabelPopulate,
|
||||
LabelFull,
|
||||
LabelDtoMapActions
|
||||
LabelDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { SubscriberUpdateDto, UserDtoMapActions } from '../dto/subscriber.dto';
|
||||
import { SubscriberUpdateDto, UserDto } from '../dto/subscriber.dto';
|
||||
import {
|
||||
Subscriber,
|
||||
SUBSCRIBER_POPULATE,
|
||||
@@ -34,7 +34,7 @@ export class SubscriberRepository extends BaseRepository<
|
||||
Subscriber,
|
||||
SubscriberPopulate,
|
||||
SubscriberFull,
|
||||
UserDtoMapActions
|
||||
UserDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { CategoryDTOMapActions } from '../dto/category.dto';
|
||||
import { CategoryDto } from '../dto/category.dto';
|
||||
import { CategoryRepository } from '../repositories/category.repository';
|
||||
import { Category } from '../schemas/category.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class CategorySeeder extends BaseSeeder<
|
||||
Category,
|
||||
never,
|
||||
never,
|
||||
CategoryDTOMapActions
|
||||
CategoryDto
|
||||
> {
|
||||
constructor(private readonly categoryRepository: CategoryRepository) {
|
||||
super(categoryRepository);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { ContextVarDTOMapActions } from '../dto/context-var.dto';
|
||||
import { ContextVarDto } from '../dto/context-var.dto';
|
||||
import { ContextVarRepository } from '../repositories/context-var.repository';
|
||||
import { ContextVar } from '../schemas/context-var.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class ContextVarSeeder extends BaseSeeder<
|
||||
ContextVar,
|
||||
never,
|
||||
never,
|
||||
ContextVarDTOMapActions
|
||||
ContextVarDto
|
||||
> {
|
||||
constructor(private readonly contextVarRepository: ContextVarRepository) {
|
||||
super(contextVarRepository);
|
||||
|
||||
@@ -22,7 +22,7 @@ import { SettingService } from '@/setting/services/setting.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import { getRandom } from '@/utils/helpers/safeRandom';
|
||||
|
||||
import { BlockDTOMapActions } from '../dto/block.dto';
|
||||
import { BlockDto } from '../dto/block.dto';
|
||||
import { BlockRepository } from '../repositories/block.repository';
|
||||
import { Block, BlockFull, BlockPopulate } from '../schemas/block.schema';
|
||||
import { Context } from '../schemas/types/context';
|
||||
@@ -40,7 +40,7 @@ export class BlockService extends BaseService<
|
||||
Block,
|
||||
BlockPopulate,
|
||||
BlockFull,
|
||||
BlockDTOMapActions
|
||||
BlockDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: BlockRepository,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { CategoryDTOMapActions } from '../dto/category.dto';
|
||||
import { CategoryDto } from '../dto/category.dto';
|
||||
import { CategoryRepository } from '../repositories/category.repository';
|
||||
import { Category } from '../schemas/category.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class CategoryService extends BaseService<
|
||||
Category,
|
||||
never,
|
||||
never,
|
||||
CategoryDTOMapActions
|
||||
CategoryDto
|
||||
> {
|
||||
constructor(readonly repository: CategoryRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { ContextVarDTOMapActions } from '../dto/context-var.dto';
|
||||
import { ContextVarDto } from '../dto/context-var.dto';
|
||||
import { ContextVarRepository } from '../repositories/context-var.repository';
|
||||
import { Block, BlockFull } from '../schemas/block.schema';
|
||||
import { ContextVar } from '../schemas/context-var.schema';
|
||||
@@ -20,7 +20,7 @@ export class ContextVarService extends BaseService<
|
||||
ContextVar,
|
||||
never,
|
||||
never,
|
||||
ContextVarDTOMapActions
|
||||
ContextVarDto
|
||||
> {
|
||||
constructor(readonly repository: ContextVarRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -12,7 +12,7 @@ import EventWrapper from '@/channel/lib/EventWrapper';
|
||||
import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { ConversationDtoMapActions } from '../dto/conversation.dto';
|
||||
import { ConversationDto } from '../dto/conversation.dto';
|
||||
import { VIEW_MORE_PAYLOAD } from '../helpers/constants';
|
||||
import { ConversationRepository } from '../repositories/conversation.repository';
|
||||
import { Block, BlockFull } from '../schemas/block.schema';
|
||||
@@ -32,7 +32,7 @@ export class ConversationService extends BaseService<
|
||||
Conversation,
|
||||
ConversationPopulate,
|
||||
ConversationFull,
|
||||
ConversationDtoMapActions
|
||||
ConversationDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: ConversationRepository,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { LabelDtoMapActions } from '../dto/label.dto';
|
||||
import { LabelDto } from '../dto/label.dto';
|
||||
import { LabelRepository } from '../repositories/label.repository';
|
||||
import { Label, LabelFull, LabelPopulate } from '../schemas/label.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class LabelService extends BaseService<
|
||||
Label,
|
||||
LabelPopulate,
|
||||
LabelFull,
|
||||
LabelDtoMapActions
|
||||
LabelDto
|
||||
> {
|
||||
constructor(readonly repository: LabelRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -28,7 +28,7 @@ import { SocketRequest } from '@/websocket/utils/socket-request';
|
||||
import { SocketResponse } from '@/websocket/utils/socket-response';
|
||||
import { WebsocketGateway } from '@/websocket/websocket.gateway';
|
||||
|
||||
import { SubscriberUpdateDto, UserDtoMapActions } from '../dto/subscriber.dto';
|
||||
import { SubscriberUpdateDto, UserDto } from '../dto/subscriber.dto';
|
||||
import { SubscriberRepository } from '../repositories/subscriber.repository';
|
||||
import {
|
||||
Subscriber,
|
||||
@@ -41,7 +41,7 @@ export class SubscriberService extends BaseService<
|
||||
Subscriber,
|
||||
SubscriberPopulate,
|
||||
SubscriberFull,
|
||||
UserDtoMapActions
|
||||
UserDto
|
||||
> {
|
||||
private readonly gateway: WebsocketGateway;
|
||||
|
||||
|
||||
@@ -36,6 +36,6 @@ export class ContentCreateDto {
|
||||
|
||||
export class ContentUpdateDto extends PartialType(ContentCreateDto) {}
|
||||
|
||||
export type ContentDTOMapActions = DtoConfig<{
|
||||
export type ContentDto = DtoConfig<{
|
||||
create: ContentCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -58,6 +58,6 @@ export class ContentTypeCreateDto {
|
||||
|
||||
export class ContentTypeUpdateDto extends PartialType(ContentTypeCreateDto) {}
|
||||
|
||||
export type ContentTypeDtoMapActions = DtoConfig<{
|
||||
export type ContentTypeDto = DtoConfig<{
|
||||
create: ContentTypeCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -55,6 +55,6 @@ export class MenuCreateDto {
|
||||
|
||||
export class MenuQueryDto extends PartialType(MenuCreateDto) {}
|
||||
|
||||
export type MenuDTOMapActions = DtoConfig<{
|
||||
export type MenuDto = DtoConfig<{
|
||||
create: MenuCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -15,7 +15,7 @@ import { BlockService } from '@/chat/services/block.service';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { ContentTypeDtoMapActions } from '../dto/contentType.dto';
|
||||
import { ContentTypeDto } from '../dto/contentType.dto';
|
||||
import { ContentType } from '../schemas/content-type.schema';
|
||||
import { Content } from '../schemas/content.schema';
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ContentTypeRepository extends BaseRepository<
|
||||
ContentType,
|
||||
never,
|
||||
never,
|
||||
ContentTypeDtoMapActions
|
||||
ContentTypeDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { ContentDTOMapActions } from '../dto/content.dto';
|
||||
import { ContentDto } from '../dto/content.dto';
|
||||
import {
|
||||
Content,
|
||||
CONTENT_POPULATE,
|
||||
@@ -34,7 +34,7 @@ export class ContentRepository extends BaseRepository<
|
||||
Content,
|
||||
ContentPopulate,
|
||||
ContentFull,
|
||||
ContentDTOMapActions
|
||||
ContentDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Model } from 'mongoose';
|
||||
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
|
||||
import { MenuDTOMapActions } from '../dto/menu.dto';
|
||||
import { MenuDto } from '../dto/menu.dto';
|
||||
import {
|
||||
Menu,
|
||||
MENU_POPULATE,
|
||||
@@ -28,7 +28,7 @@ export class MenuRepository extends BaseRepository<
|
||||
Menu,
|
||||
MenuPopulate,
|
||||
MenuFull,
|
||||
MenuDTOMapActions
|
||||
MenuDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { ContentTypeDtoMapActions } from '../dto/contentType.dto';
|
||||
import { ContentTypeDto } from '../dto/contentType.dto';
|
||||
import { ContentTypeRepository } from '../repositories/content-type.repository';
|
||||
import { ContentType } from '../schemas/content-type.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class ContentTypeService extends BaseService<
|
||||
ContentType,
|
||||
never,
|
||||
never,
|
||||
ContentTypeDtoMapActions
|
||||
ContentTypeDto
|
||||
> {
|
||||
constructor(readonly repository: ContentTypeRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -19,7 +19,7 @@ import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { ContentDTOMapActions } from '../dto/content.dto';
|
||||
import { ContentDto } from '../dto/content.dto';
|
||||
import { ContentRepository } from '../repositories/content.repository';
|
||||
import {
|
||||
Content,
|
||||
@@ -32,7 +32,7 @@ export class ContentService extends BaseService<
|
||||
Content,
|
||||
ContentPopulate,
|
||||
ContentFull,
|
||||
ContentDTOMapActions
|
||||
ContentDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: ContentRepository,
|
||||
|
||||
@@ -20,7 +20,7 @@ import { MENU_CACHE_KEY } from '@/utils/constants/cache';
|
||||
import { Cacheable } from '@/utils/decorators/cacheable.decorator';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { MenuCreateDto, MenuDTOMapActions } from '../dto/menu.dto';
|
||||
import { MenuCreateDto, MenuDto } from '../dto/menu.dto';
|
||||
import { MenuRepository } from '../repositories/menu.repository';
|
||||
import { Menu, MenuFull, MenuPopulate } from '../schemas/menu.schema';
|
||||
import { AnyMenu, MenuTree, MenuType } from '../schemas/types/menu';
|
||||
@@ -30,7 +30,7 @@ export class MenuService extends BaseService<
|
||||
Menu,
|
||||
MenuPopulate,
|
||||
MenuFull,
|
||||
MenuDTOMapActions
|
||||
MenuDto
|
||||
> {
|
||||
private RootSymbol: symbol = Symbol('RootMenu');
|
||||
|
||||
|
||||
@@ -35,6 +35,6 @@ export class LanguageCreateDto {
|
||||
|
||||
export class LanguageUpdateDto extends PartialType(LanguageCreateDto) {}
|
||||
|
||||
export type LanguageDTOMapActions = DtoConfig<{
|
||||
export type LanguageDto = DtoConfig<{
|
||||
create: LanguageCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { LanguageDTOMapActions } from '../dto/language.dto';
|
||||
import { LanguageDto } from '../dto/language.dto';
|
||||
import { Language } from '../schemas/language.schema';
|
||||
|
||||
@Injectable()
|
||||
@@ -22,7 +22,7 @@ export class LanguageRepository extends BaseRepository<
|
||||
Language,
|
||||
never,
|
||||
never,
|
||||
LanguageDTOMapActions
|
||||
LanguageDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { LanguageDTOMapActions } from '../dto/language.dto';
|
||||
import { LanguageDto } from '../dto/language.dto';
|
||||
import { LanguageRepository } from '../repositories/language.repository';
|
||||
import { Language } from '../schemas/language.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class LanguageSeeder extends BaseSeeder<
|
||||
Language,
|
||||
never,
|
||||
never,
|
||||
LanguageDTOMapActions
|
||||
LanguageDto
|
||||
> {
|
||||
constructor(private readonly languageRepository: LanguageRepository) {
|
||||
super(languageRepository);
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
import { Cacheable } from '@/utils/decorators/cacheable.decorator';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { LanguageDTOMapActions } from '../dto/language.dto';
|
||||
import { LanguageDto } from '../dto/language.dto';
|
||||
import { LanguageRepository } from '../repositories/language.repository';
|
||||
import { Language } from '../schemas/language.schema';
|
||||
|
||||
@@ -30,7 +30,7 @@ export class LanguageService extends BaseService<
|
||||
Language,
|
||||
never,
|
||||
never,
|
||||
LanguageDTOMapActions
|
||||
LanguageDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: LanguageRepository,
|
||||
|
||||
@@ -49,6 +49,6 @@ export class NlpEntityCreateDto {
|
||||
builtin?: boolean;
|
||||
}
|
||||
|
||||
export type NlpEntityDTOMapActions = DtoConfig<{
|
||||
export type NlpEntityDto = DtoConfig<{
|
||||
create: NlpEntityCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -65,6 +65,6 @@ export class NlpSampleDto extends NlpSampleCreateDto {
|
||||
|
||||
export class NlpSampleUpdateDto extends PartialType(NlpSampleCreateDto) {}
|
||||
|
||||
export type NlpSampleDTOMapActions = DtoConfig<{
|
||||
export type TNlpSampleDto = DtoConfig<{
|
||||
create: NlpSampleCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -54,6 +54,6 @@ export class NlpValueCreateDto {
|
||||
|
||||
export class NlpValueUpdateDto extends PartialType(NlpValueCreateDto) {}
|
||||
|
||||
export type NlpValueDTOMapActions = DtoConfig<{
|
||||
export type NlpValueDto = DtoConfig<{
|
||||
create: NlpValueCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { NlpEntityDTOMapActions } from '../dto/nlp-entity.dto';
|
||||
import { NlpEntityDto } from '../dto/nlp-entity.dto';
|
||||
import {
|
||||
NLP_ENTITY_POPULATE,
|
||||
NlpEntity,
|
||||
@@ -31,7 +31,7 @@ export class NlpEntityRepository extends BaseRepository<
|
||||
NlpEntity,
|
||||
NlpEntityPopulate,
|
||||
NlpEntityFull,
|
||||
NlpEntityDTOMapActions
|
||||
NlpEntityDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { NlpSampleDTOMapActions } from '../dto/nlp-sample.dto';
|
||||
import { TNlpSampleDto } from '../dto/nlp-sample.dto';
|
||||
import {
|
||||
NLP_SAMPLE_POPULATE,
|
||||
NlpSample,
|
||||
@@ -29,7 +29,7 @@ export class NlpSampleRepository extends BaseRepository<
|
||||
NlpSample,
|
||||
NlpSamplePopulate,
|
||||
NlpSampleFull,
|
||||
NlpSampleDTOMapActions
|
||||
TNlpSampleDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Document, Model, Query } from 'mongoose';
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { NlpValueDTOMapActions } from '../dto/nlp-value.dto';
|
||||
import { NlpValueDto } from '../dto/nlp-value.dto';
|
||||
import {
|
||||
NLP_VALUE_POPULATE,
|
||||
NlpValue,
|
||||
@@ -30,7 +30,7 @@ export class NlpValueRepository extends BaseRepository<
|
||||
NlpValue,
|
||||
NlpValuePopulate,
|
||||
NlpValueFull,
|
||||
NlpValueDTOMapActions
|
||||
NlpValueDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { NlpEntityDTOMapActions } from '../dto/nlp-entity.dto';
|
||||
import { NlpEntityDto } from '../dto/nlp-entity.dto';
|
||||
import { NlpEntityRepository } from '../repositories/nlp-entity.repository';
|
||||
import {
|
||||
NlpEntity,
|
||||
@@ -23,7 +23,7 @@ export class NlpEntitySeeder extends BaseSeeder<
|
||||
NlpEntity,
|
||||
NlpEntityPopulate,
|
||||
NlpEntityFull,
|
||||
NlpEntityDTOMapActions
|
||||
NlpEntityDto
|
||||
> {
|
||||
constructor(nlpEntityRepository: NlpEntityRepository) {
|
||||
super(nlpEntityRepository);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { NlpValueCreateDto, NlpValueDTOMapActions } from '../dto/nlp-value.dto';
|
||||
import { NlpValueCreateDto, NlpValueDto } from '../dto/nlp-value.dto';
|
||||
import { NlpEntityRepository } from '../repositories/nlp-entity.repository';
|
||||
import { NlpValueRepository } from '../repositories/nlp-value.repository';
|
||||
import {
|
||||
@@ -24,7 +24,7 @@ export class NlpValueSeeder extends BaseSeeder<
|
||||
NlpValue,
|
||||
NlpValuePopulate,
|
||||
NlpValueFull,
|
||||
NlpValueDTOMapActions
|
||||
NlpValueDto
|
||||
> {
|
||||
constructor(
|
||||
nlpValueRepository: NlpValueRepository,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { Lookup, NlpEntityDTOMapActions } from '../dto/nlp-entity.dto';
|
||||
import { Lookup, NlpEntityDto } from '../dto/nlp-entity.dto';
|
||||
import { NlpEntityRepository } from '../repositories/nlp-entity.repository';
|
||||
import {
|
||||
NlpEntity,
|
||||
@@ -26,7 +26,7 @@ export class NlpEntityService extends BaseService<
|
||||
NlpEntity,
|
||||
NlpEntityPopulate,
|
||||
NlpEntityFull,
|
||||
NlpEntityDTOMapActions
|
||||
NlpEntityDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: NlpEntityRepository,
|
||||
|
||||
@@ -21,10 +21,7 @@ import { LoggerService } from '@/logger/logger.service';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||
|
||||
import {
|
||||
NlpSampleCreateDto,
|
||||
NlpSampleDTOMapActions,
|
||||
} from '../dto/nlp-sample.dto';
|
||||
import { NlpSampleCreateDto, TNlpSampleDto } from '../dto/nlp-sample.dto';
|
||||
import { NlpSampleRepository } from '../repositories/nlp-sample.repository';
|
||||
import {
|
||||
NlpSample,
|
||||
@@ -41,7 +38,7 @@ export class NlpSampleService extends BaseService<
|
||||
NlpSample,
|
||||
NlpSamplePopulate,
|
||||
NlpSampleFull,
|
||||
NlpSampleDTOMapActions
|
||||
TNlpSampleDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: NlpSampleRepository,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import {
|
||||
NlpValueCreateDto,
|
||||
NlpValueDTOMapActions,
|
||||
NlpValueDto,
|
||||
NlpValueUpdateDto,
|
||||
} from '../dto/nlp-value.dto';
|
||||
import { NlpValueRepository } from '../repositories/nlp-value.repository';
|
||||
@@ -32,7 +32,7 @@ export class NlpValueService extends BaseService<
|
||||
NlpValue,
|
||||
NlpValuePopulate,
|
||||
NlpValueFull,
|
||||
NlpValueDTOMapActions
|
||||
NlpValueDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: NlpValueRepository,
|
||||
|
||||
@@ -42,6 +42,6 @@ export class PermissionCreateDto {
|
||||
relation?: TRelation;
|
||||
}
|
||||
|
||||
export type PermissionDTOMapActions = DtoConfig<{
|
||||
export type PermissionDto = DtoConfig<{
|
||||
create: PermissionCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -29,6 +29,6 @@ export class RoleCreateDto {
|
||||
|
||||
export class RoleUpdateDto extends PartialType(RoleCreateDto) {}
|
||||
|
||||
export type RoleDTOMapActions = DtoConfig<{
|
||||
export type RoleDto = DtoConfig<{
|
||||
create: RoleCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -109,6 +109,6 @@ export class UserResetPasswordDto extends PickType(UserCreateDto, [
|
||||
|
||||
export class UserRequestResetDto extends PickType(UserCreateDto, ['email']) {}
|
||||
|
||||
export type UserDtoMapActions = DtoConfig<{
|
||||
export type UserDto = DtoConfig<{
|
||||
create: UserCreateDto;
|
||||
}>;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Model } from 'mongoose';
|
||||
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
|
||||
import { PermissionDTOMapActions } from '../dto/permission.dto';
|
||||
import { PermissionDto } from '../dto/permission.dto';
|
||||
import {
|
||||
Permission,
|
||||
PERMISSION_POPULATE,
|
||||
@@ -26,7 +26,7 @@ export class PermissionRepository extends BaseRepository<
|
||||
Permission,
|
||||
PermissionPopulate,
|
||||
PermissionFull,
|
||||
PermissionDTOMapActions
|
||||
PermissionDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Model } from 'mongoose';
|
||||
|
||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||
|
||||
import { RoleDTOMapActions } from '../dto/role.dto';
|
||||
import { RoleDto } from '../dto/role.dto';
|
||||
import { Permission } from '../schemas/permission.schema';
|
||||
import {
|
||||
Role,
|
||||
@@ -27,7 +27,7 @@ export class RoleRepository extends BaseRepository<
|
||||
Role,
|
||||
RolePopulate,
|
||||
RoleFull,
|
||||
RoleDTOMapActions
|
||||
RoleDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { UserDtoMapActions, UserEditProfileDto } from '../dto/user.dto';
|
||||
import { UserDto, UserEditProfileDto } from '../dto/user.dto';
|
||||
import {
|
||||
User,
|
||||
USER_POPULATE,
|
||||
@@ -35,7 +35,7 @@ export class UserRepository extends BaseRepository<
|
||||
User,
|
||||
UserPopulate,
|
||||
UserFull,
|
||||
UserDtoMapActions
|
||||
UserDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { PermissionDTOMapActions } from '../dto/permission.dto';
|
||||
import { PermissionDto } from '../dto/permission.dto';
|
||||
import { PermissionRepository } from '../repositories/permission.repository';
|
||||
import {
|
||||
Permission,
|
||||
@@ -23,7 +23,7 @@ export class PermissionSeeder extends BaseSeeder<
|
||||
Permission,
|
||||
PermissionPopulate,
|
||||
PermissionFull,
|
||||
PermissionDTOMapActions
|
||||
PermissionDto
|
||||
> {
|
||||
constructor(private readonly permissionRepository: PermissionRepository) {
|
||||
super(permissionRepository);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseSeeder } from '@/utils/generics/base-seeder';
|
||||
|
||||
import { RoleDTOMapActions } from '../dto/role.dto';
|
||||
import { RoleDto } from '../dto/role.dto';
|
||||
import { RoleRepository } from '../repositories/role.repository';
|
||||
import { Role, RoleFull, RolePopulate } from '../schemas/role.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class RoleSeeder extends BaseSeeder<
|
||||
Role,
|
||||
RolePopulate,
|
||||
RoleFull,
|
||||
RoleDTOMapActions
|
||||
RoleDto
|
||||
> {
|
||||
constructor(private readonly roleRepository: RoleRepository) {
|
||||
super(roleRepository);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { PERMISSION_CACHE_KEY } from '@/utils/constants/cache';
|
||||
import { Cacheable } from '@/utils/decorators/cacheable.decorator';
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { PermissionDTOMapActions } from '../dto/permission.dto';
|
||||
import { PermissionDto } from '../dto/permission.dto';
|
||||
import { PermissionRepository } from '../repositories/permission.repository';
|
||||
import {
|
||||
Permission,
|
||||
@@ -29,7 +29,7 @@ export class PermissionService extends BaseService<
|
||||
Permission,
|
||||
PermissionPopulate,
|
||||
PermissionFull,
|
||||
PermissionDTOMapActions
|
||||
PermissionDto
|
||||
> {
|
||||
constructor(
|
||||
readonly repository: PermissionRepository,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { RoleDTOMapActions } from '../dto/role.dto';
|
||||
import { RoleDto } from '../dto/role.dto';
|
||||
import { RoleRepository } from '../repositories/role.repository';
|
||||
import { Role, RoleFull, RolePopulate } from '../schemas/role.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class RoleService extends BaseService<
|
||||
Role,
|
||||
RolePopulate,
|
||||
RoleFull,
|
||||
RoleDTOMapActions
|
||||
RoleDto
|
||||
> {
|
||||
constructor(readonly repository: RoleRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { BaseService } from '@/utils/generics/base-service';
|
||||
|
||||
import { UserDtoMapActions } from '../dto/user.dto';
|
||||
import { UserDto } from '../dto/user.dto';
|
||||
import { UserRepository } from '../repositories/user.repository';
|
||||
import { User, UserFull, UserPopulate } from '../schemas/user.schema';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class UserService extends BaseService<
|
||||
User,
|
||||
UserPopulate,
|
||||
UserFull,
|
||||
UserDtoMapActions
|
||||
UserDto
|
||||
> {
|
||||
constructor(readonly repository: UserRepository) {
|
||||
super(repository);
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||
import { DtoActions, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
import { DtoAction, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
|
||||
import { BaseSchema } from './base-schema';
|
||||
import { LifecycleHookManager } from './lifecycle-hook-manager';
|
||||
@@ -456,7 +456,7 @@ export abstract class BaseRepository<
|
||||
return await this.model.countDocuments(criteria).exec();
|
||||
}
|
||||
|
||||
async create(dto: DtoInfer<DtoActions.Create, DTOCruds, U>): Promise<T> {
|
||||
async create(dto: DtoInfer<DtoAction.Create, DTOCruds, U>): Promise<T> {
|
||||
const doc = await this.model.create(dto);
|
||||
|
||||
return plainToClass(
|
||||
@@ -467,7 +467,7 @@ export abstract class BaseRepository<
|
||||
}
|
||||
|
||||
async createMany(
|
||||
dtoArray: DtoInfer<DtoActions.Create, DTOCruds, U>[],
|
||||
dtoArray: DtoInfer<DtoAction.Create, DTOCruds, U>[],
|
||||
): Promise<T[]> {
|
||||
const docs = await this.model.create(dtoArray);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import { FlattenMaps } from 'mongoose';
|
||||
|
||||
import { DtoActions, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
import { DtoAction, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
|
||||
import { BaseRepository } from './base-repository';
|
||||
import { BaseSchema } from './base-schema';
|
||||
@@ -33,7 +33,7 @@ export abstract class BaseSeeder<
|
||||
}
|
||||
|
||||
async seed<D extends Omit<T, keyof BaseSchema>>(
|
||||
models: DtoInfer<DtoActions.Create, DTOCruds, D>[],
|
||||
models: DtoInfer<DtoAction.Create, DTOCruds, D>[],
|
||||
): Promise<boolean> {
|
||||
if (await this.isEmpty()) {
|
||||
await this.repository.createMany(models);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ProjectionType, QueryOptions } from 'mongoose';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||
import { DtoActions, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
import { DtoAction, DtoInfer, DtoProps } from '../types/dto.types';
|
||||
|
||||
import { BaseRepository } from './base-repository';
|
||||
import { BaseSchema } from './base-schema';
|
||||
@@ -145,7 +145,7 @@ export abstract class BaseService<
|
||||
}
|
||||
|
||||
async create<D extends Omit<T, keyof BaseSchema>>(
|
||||
dto: DtoInfer<DtoActions.Create, DTOCruds, D>,
|
||||
dto: DtoInfer<DtoAction.Create, DTOCruds, D>,
|
||||
): Promise<T> {
|
||||
try {
|
||||
return await this.repository.create(dto);
|
||||
@@ -161,7 +161,7 @@ export abstract class BaseService<
|
||||
|
||||
async findOneOrCreate<D extends Omit<T, keyof BaseSchema>>(
|
||||
criteria: string | TFilterQuery<T>,
|
||||
dto: DtoInfer<DtoActions.Create, DTOCruds, D>,
|
||||
dto: DtoInfer<DtoAction.Create, DTOCruds, D>,
|
||||
): Promise<T> {
|
||||
const result = await this.findOne(criteria);
|
||||
if (!result) {
|
||||
@@ -171,7 +171,7 @@ export abstract class BaseService<
|
||||
}
|
||||
|
||||
async createMany<D extends Omit<T, keyof BaseSchema>>(
|
||||
dtoArray: DtoInfer<DtoActions.Create, DTOCruds, D>[],
|
||||
dtoArray: DtoInfer<DtoAction.Create, DTOCruds, D>[],
|
||||
): Promise<T[]> {
|
||||
return await this.repository.createMany(dtoArray);
|
||||
}
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
* 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).
|
||||
*/
|
||||
|
||||
export enum DtoActions {
|
||||
export enum DtoAction {
|
||||
Create = 'create',
|
||||
Read = 'read',
|
||||
Update = 'update',
|
||||
Delete = 'delete',
|
||||
}
|
||||
|
||||
export type DtoConfig<T extends Partial<Record<DtoActions, object>>> = T;
|
||||
export type DtoConfig<T extends Partial<Record<DtoAction, object>>> = T;
|
||||
|
||||
export type DtoProps<T extends Record<string, unknown>> = {
|
||||
[K in DtoActions]?: T[K];
|
||||
[K in DtoAction]?: T[K];
|
||||
};
|
||||
|
||||
export type DtoInfer<K extends keyof DTO, DTO, T> = DTO[K] extends object
|
||||
|
||||
Reference in New Issue
Block a user