mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge pull request #294 from Hexastack/293-issue-refactor-mongoose-types
refactor(api): mongoose types
This commit is contained in:
commit
2ea9a66ec6
@ -7,9 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
export enum BotStatsType {
|
export enum BotStatsType {
|
||||||
outgoing = 'outgoing',
|
outgoing = 'outgoing',
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { FileFieldsInterceptor } from '@nestjs/platform-express';
|
import { FileFieldsInterceptor } from '@nestjs/platform-express';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
import { diskStorage, memoryStorage } from 'multer';
|
import { diskStorage, memoryStorage } from 'multer';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
@ -37,6 +36,7 @@ import { DeleteResult } from '@/utils/generics/base-repository';
|
|||||||
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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { AttachmentDownloadDto } from '../dto/attachment.dto';
|
import { AttachmentDownloadDto } from '../dto/attachment.dto';
|
||||||
import { Attachment } from '../schemas/attachment.schema';
|
import { Attachment } from '../schemas/attachment.schema';
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { FileType } from '@/chat/schemas/types/attachment';
|
import { FileType } from '@/chat/schemas/types/attachment';
|
||||||
import { config } from '@/config';
|
import { config } from '@/config';
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { buildURL } from '@/utils/helpers/URL';
|
import { buildURL } from '@/utils/helpers/URL';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { MIME_REGEX } from '../utilities';
|
import { MIME_REGEX } from '../utilities';
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -33,6 +32,7 @@ import { BaseController } from '@/utils/generics/base-controller';
|
|||||||
import { DeleteResult } from '@/utils/generics/base-repository';
|
import { DeleteResult } from '@/utils/generics/base-repository';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { BlockCreateDto, BlockUpdateDto } from '../dto/block.dto';
|
import { BlockCreateDto, BlockUpdateDto } from '../dto/block.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -30,6 +29,7 @@ import { DeleteResult } from '@/utils/generics/base-repository';
|
|||||||
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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { CategoryCreateDto, CategoryUpdateDto } from '../dto/category.dto';
|
import { CategoryCreateDto, CategoryUpdateDto } from '../dto/category.dto';
|
||||||
import { Category } from '../schemas/category.schema';
|
import { Category } from '../schemas/category.schema';
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -30,6 +29,7 @@ import { DeleteResult } from '@/utils/generics/base-repository';
|
|||||||
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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ContextVarCreateDto,
|
ContextVarCreateDto,
|
||||||
|
@ -14,13 +14,12 @@ import {
|
|||||||
HttpCode,
|
HttpCode,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
Param,
|
Param,
|
||||||
Post,
|
|
||||||
Patch,
|
Patch,
|
||||||
|
Post,
|
||||||
Query,
|
Query,
|
||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -29,6 +28,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { LabelCreateDto, LabelUpdateDto } from '../dto/label.dto';
|
import { LabelCreateDto, LabelUpdateDto } from '../dto/label.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { Request } from 'express'; // Import the Express request and response types
|
import { Request } from 'express'; // Import the Express request and response types
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { ChannelService } from '@/channel/channel.service';
|
import { ChannelService } from '@/channel/channel.service';
|
||||||
import { GenericEventWrapper } from '@/channel/lib/EventWrapper';
|
import { GenericEventWrapper } from '@/channel/lib/EventWrapper';
|
||||||
@ -33,6 +32,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { MessageCreateDto } from '../dto/message.dto';
|
import { MessageCreateDto } from '../dto/message.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -18,7 +18,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -29,6 +28,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { SubscriberUpdateDto } from '../dto/subscriber.dto';
|
import { SubscriberUpdateDto } from '../dto/subscriber.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -13,7 +13,6 @@ import {
|
|||||||
Document,
|
Document,
|
||||||
Model,
|
Model,
|
||||||
Query,
|
Query,
|
||||||
TFilterQuery,
|
|
||||||
Types,
|
Types,
|
||||||
UpdateQuery,
|
UpdateQuery,
|
||||||
UpdateWithAggregationPipeline,
|
UpdateWithAggregationPipeline,
|
||||||
@ -21,6 +20,7 @@ import {
|
|||||||
|
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
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 { BlockCreateDto, BlockUpdateDto } from '../dto/block.dto';
|
import { BlockCreateDto, BlockUpdateDto } from '../dto/block.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { ForbiddenException, Injectable, Optional } from '@nestjs/common';
|
import { ForbiddenException, Injectable, Optional } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Category } from '../schemas/category.schema';
|
import { Category } from '../schemas/category.schema';
|
||||||
import { BlockService } from '../services/block.service';
|
import { BlockService } from '../services/block.service';
|
||||||
|
@ -14,9 +14,10 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { ContextVar } from '../schemas/context-var.schema';
|
import { ContextVar } from '../schemas/context-var.schema';
|
||||||
import { BlockService } from '../services/block.service';
|
import { BlockService } from '../services/block.service';
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Label,
|
Label,
|
||||||
|
@ -13,12 +13,12 @@ import {
|
|||||||
Document,
|
Document,
|
||||||
Model,
|
Model,
|
||||||
Query,
|
Query,
|
||||||
TFilterQuery,
|
|
||||||
UpdateQuery,
|
UpdateQuery,
|
||||||
UpdateWithAggregationPipeline,
|
UpdateWithAggregationPipeline,
|
||||||
} from 'mongoose';
|
} from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { SubscriberUpdateDto } from '../dto/subscriber.dto';
|
import { SubscriberUpdateDto } from '../dto/subscriber.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -8,11 +8,14 @@
|
|||||||
|
|
||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Transform, Type } from 'class-transformer';
|
import { Exclude, Transform, Type } from 'class-transformer';
|
||||||
import { Schema as MongooseSchema, THydratedDocument } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { isValidMessage } from '../validation-rules/is-message';
|
import { isValidMessage } from '../validation-rules/is-message';
|
||||||
import { isPatternList } from '../validation-rules/is-pattern-list';
|
import { isPatternList } from '../validation-rules/is-pattern-list';
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
export class Category extends BaseSchema {
|
export class Category extends BaseSchema {
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
export class ContextVar extends BaseSchema {
|
export class ContextVar extends BaseSchema {
|
||||||
|
@ -6,12 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Block } from './block.schema';
|
import { Block } from './block.schema';
|
||||||
import { Subscriber } from './subscriber.schema';
|
import { Subscriber } from './subscriber.schema';
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Type } from 'class-transformer';
|
import { Exclude, Type } from 'class-transformer';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Subscriber } from './subscriber.schema';
|
import { Subscriber } from './subscriber.schema';
|
||||||
|
|
||||||
|
@ -6,15 +6,18 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
||||||
import { User } from '@/user/schemas/user.schema';
|
import { User } from '@/user/schemas/user.schema';
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Label } from './label.schema';
|
import { Label } from './label.schema';
|
||||||
import { ChannelData } from './types/channel';
|
import { ChannelData } from './types/channel';
|
||||||
|
@ -20,7 +20,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -28,6 +27,7 @@ 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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ContentTypeCreateDto,
|
ContentTypeCreateDto,
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { BadRequestException } from '@nestjs/common/exceptions';
|
import { BadRequestException } from '@nestjs/common/exceptions';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
import Papa from 'papaparse';
|
import Papa from 'papaparse';
|
||||||
|
|
||||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||||
@ -36,6 +35,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { ContentCreateDto, ContentUpdateDto } from '../dto/content.dto';
|
import { ContentCreateDto, ContentUpdateDto } from '../dto/content.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -14,13 +14,12 @@ import {
|
|||||||
InternalServerErrorException,
|
InternalServerErrorException,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
Param,
|
Param,
|
||||||
Post,
|
|
||||||
Patch,
|
Patch,
|
||||||
|
Post,
|
||||||
Query,
|
Query,
|
||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -28,6 +27,7 @@ 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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { MenuCreateDto, MenuQueryDto } from '../dto/menu.dto';
|
import { MenuCreateDto, MenuQueryDto } from '../dto/menu.dto';
|
||||||
import { Menu, MenuFull, MenuPopulate, MenuStub } from '../schemas/menu.schema';
|
import { Menu, MenuFull, MenuPopulate, MenuStub } from '../schemas/menu.schema';
|
||||||
|
@ -9,10 +9,11 @@
|
|||||||
import { ForbiddenException, Injectable, Optional } from '@nestjs/common';
|
import { ForbiddenException, Injectable, Optional } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BlockService } from '@/chat/services/block.service';
|
import { BlockService } from '@/chat/services/block.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 { ContentType } from '../schemas/content-type.schema';
|
import { ContentType } from '../schemas/content-type.schema';
|
||||||
import { Content } from '../schemas/content.schema';
|
import { Content } from '../schemas/content.schema';
|
||||||
|
@ -14,12 +14,12 @@ import {
|
|||||||
HydratedDocument,
|
HydratedDocument,
|
||||||
Model,
|
Model,
|
||||||
Query,
|
Query,
|
||||||
TFilterQuery,
|
|
||||||
UpdateQuery,
|
UpdateQuery,
|
||||||
UpdateWithAggregationPipeline,
|
UpdateWithAggregationPipeline,
|
||||||
} from 'mongoose';
|
} from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Content,
|
Content,
|
||||||
|
@ -6,13 +6,16 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { MenuType } from './types/menu';
|
import { MenuType } from './types/menu';
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
||||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||||
@ -16,6 +15,7 @@ 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 { 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 { ContentRepository } from '../repositories/content.repository';
|
import { ContentRepository } from '../repositories/content.repository';
|
||||||
import {
|
import {
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -30,6 +29,7 @@ import { DeleteResult } from '@/utils/generics/base-repository';
|
|||||||
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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { LanguageCreateDto, LanguageUpdateDto } from '../dto/language.dto';
|
import { LanguageCreateDto, LanguageUpdateDto } from '../dto/language.dto';
|
||||||
import { Language } from '../schemas/language.schema';
|
import { Language } from '../schemas/language.schema';
|
||||||
|
@ -21,7 +21,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -31,6 +30,7 @@ import { DeleteResult } from '@/utils/generics/base-repository';
|
|||||||
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';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { TranslationUpdateDto } from '../dto/translation.dto';
|
import { TranslationUpdateDto } from '../dto/translation.dto';
|
||||||
import { Translation } from '../schemas/translation.schema';
|
import { Translation } from '../schemas/translation.schema';
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Language } from '../schemas/language.schema';
|
import { Language } from '../schemas/language.schema';
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
export class Language extends BaseSchema {
|
export class Language extends BaseSchema {
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
export class Translation extends BaseSchema {
|
export class Translation extends BaseSchema {
|
||||||
|
@ -23,7 +23,6 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -33,6 +32,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpEntityCreateDto } from '../dto/nlp-entity.dto';
|
import { NlpEntityCreateDto } from '../dto/nlp-entity.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -29,7 +29,6 @@ import {
|
|||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { Response } from 'express';
|
import { Response } from 'express';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
import Papa from 'papaparse';
|
import Papa from 'papaparse';
|
||||||
|
|
||||||
import { AttachmentService } from '@/attachment/services/attachment.service';
|
import { AttachmentService } from '@/attachment/services/attachment.service';
|
||||||
@ -44,6 +43,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpSampleCreateDto, NlpSampleDto } from '../dto/nlp-sample.dto';
|
import { NlpSampleCreateDto, NlpSampleDto } from '../dto/nlp-sample.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -7,21 +7,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
BadRequestException,
|
||||||
Body,
|
Body,
|
||||||
Controller,
|
Controller,
|
||||||
Delete,
|
Delete,
|
||||||
Get,
|
Get,
|
||||||
Param,
|
|
||||||
Post,
|
|
||||||
Patch,
|
|
||||||
HttpCode,
|
HttpCode,
|
||||||
Query,
|
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
|
Param,
|
||||||
|
Patch,
|
||||||
|
Post,
|
||||||
|
Query,
|
||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
BadRequestException,
|
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -31,6 +30,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpValueCreateDto, NlpValueUpdateDto } from '../dto/nlp-value.dto';
|
import { NlpValueCreateDto, NlpValueUpdateDto } from '../dto/nlp-value.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NLP_ENTITY_POPULATE,
|
NLP_ENTITY_POPULATE,
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NLP_SAMPLE_POPULATE,
|
NLP_SAMPLE_POPULATE,
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Document, Model, Query, TFilterQuery } from 'mongoose';
|
import { Document, Model, Query } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
import { BaseRepository, DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NLP_VALUE_POPULATE,
|
NLP_VALUE_POPULATE,
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Type } from 'class-transformer';
|
import { Exclude, Type } from 'class-transformer';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Lookup } from '../dto/nlp-entity.dto';
|
import { Lookup } from '../dto/nlp-entity.dto';
|
||||||
|
|
||||||
|
@ -6,12 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpEntity } from './nlp-entity.schema';
|
import { NlpEntity } from './nlp-entity.schema';
|
||||||
import { NlpSample } from './nlp-sample.schema';
|
import { NlpSample } from './nlp-sample.schema';
|
||||||
|
@ -8,12 +8,15 @@
|
|||||||
|
|
||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Transform, Type } from 'class-transformer';
|
import { Exclude, Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { Language } from '@/i18n/schemas/language.schema';
|
import { Language } from '@/i18n/schemas/language.schema';
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpSampleEntity } from './nlp-sample-entity.schema';
|
import { NlpSampleEntity } from './nlp-sample-entity.schema';
|
||||||
import { NlpSampleState } from './types';
|
import { NlpSampleState } from './types';
|
||||||
|
@ -6,13 +6,16 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { NlpEntity, NlpEntityFull } from './nlp-entity.schema';
|
import { NlpEntity, NlpEntityFull } from './nlp-entity.schema';
|
||||||
import { NlpValueMap } from './types';
|
import { NlpValueMap } from './types';
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
|
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { OnEvent } from '@nestjs/event-emitter';
|
import { OnEvent } from '@nestjs/event-emitter';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
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 { 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 { NlpSampleCreateDto } from '../dto/nlp-sample.dto';
|
import { NlpSampleCreateDto } from '../dto/nlp-sample.dto';
|
||||||
import { NlpSampleRepository } from '../repositories/nlp-sample.repository';
|
import { NlpSampleRepository } from '../repositories/nlp-sample.repository';
|
||||||
|
@ -17,13 +17,13 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
import { QuerySortDto } from '@/utils/pagination/pagination-query.dto';
|
import { QuerySortDto } from '@/utils/pagination/pagination-query.dto';
|
||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Setting } from '../schemas/setting.schema';
|
import { Setting } from '../schemas/setting.schema';
|
||||||
import { SettingService } from '../services/setting.service';
|
import { SettingService } from '../services/setting.service';
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Controller, Get, Query } from '@nestjs/common';
|
import { Controller, Get, Query } from '@nestjs/common';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
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 { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Model,
|
Model,
|
||||||
|
@ -19,13 +19,13 @@ import {
|
|||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { PermissionCreateDto } from '../dto/permission.dto';
|
import { PermissionCreateDto } from '../dto/permission.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -10,20 +10,19 @@ import {
|
|||||||
Body,
|
Body,
|
||||||
Controller,
|
Controller,
|
||||||
Delete,
|
Delete,
|
||||||
|
ForbiddenException,
|
||||||
Get,
|
Get,
|
||||||
HttpCode,
|
HttpCode,
|
||||||
NotFoundException,
|
NotFoundException,
|
||||||
Param,
|
Param,
|
||||||
Post,
|
|
||||||
Patch,
|
Patch,
|
||||||
|
Post,
|
||||||
Query,
|
Query,
|
||||||
UseInterceptors,
|
|
||||||
ForbiddenException,
|
|
||||||
Req,
|
Req,
|
||||||
|
UseInterceptors,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
import { CsrfInterceptor } from '@/interceptors/csrf.interceptor';
|
||||||
import { LoggerService } from '@/logger/logger.service';
|
import { LoggerService } from '@/logger/logger.service';
|
||||||
@ -32,6 +31,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { RoleCreateDto, RoleUpdateDto } from '../dto/role.dto';
|
import { RoleCreateDto, RoleUpdateDto } from '../dto/role.dto';
|
||||||
import { Role, RoleFull, RolePopulate, RoleStub } from '../schemas/role.schema';
|
import { Role, RoleFull, RolePopulate, RoleStub } from '../schemas/role.schema';
|
||||||
|
@ -26,7 +26,6 @@ import {
|
|||||||
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
import { CsrfCheck } from '@tekuconcept/nestjs-csrf';
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { Session as ExpressSession } from 'express-session';
|
import { Session as ExpressSession } from 'express-session';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
|
||||||
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';
|
||||||
@ -38,6 +37,7 @@ import { PageQueryDto } from '@/utils/pagination/pagination-query.dto';
|
|||||||
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
import { PageQueryPipe } from '@/utils/pagination/pagination-query.pipe';
|
||||||
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';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { InvitationCreateDto } from '../dto/invitation.dto';
|
import { InvitationCreateDto } from '../dto/invitation.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||||
import { InjectModel } from '@nestjs/mongoose';
|
import { InjectModel } from '@nestjs/mongoose';
|
||||||
import { Model, TFilterQuery } from 'mongoose';
|
import { Model } from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Invitation,
|
Invitation,
|
||||||
|
@ -13,12 +13,12 @@ import {
|
|||||||
Document,
|
Document,
|
||||||
Model,
|
Model,
|
||||||
Query,
|
Query,
|
||||||
TFilterQuery,
|
|
||||||
UpdateQuery,
|
UpdateQuery,
|
||||||
UpdateWithAggregationPipeline,
|
UpdateWithAggregationPipeline,
|
||||||
} from 'mongoose';
|
} from 'mongoose';
|
||||||
|
|
||||||
import { BaseRepository } from '@/utils/generics/base-repository';
|
import { BaseRepository } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { UserEditProfileDto } from '../dto/user.dto';
|
import { UserEditProfileDto } from '../dto/user.dto';
|
||||||
import {
|
import {
|
||||||
|
@ -6,13 +6,16 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
import { isEmail } from '@/utils/validation-rules/is-email';
|
import { isEmail } from '@/utils/validation-rules/is-email';
|
||||||
|
|
||||||
import { Role } from './role.schema';
|
import { Role } from './role.schema';
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Type } from 'class-transformer';
|
import { Exclude, Type } from 'class-transformer';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { TRelation } from '../types/index.type';
|
import { TRelation } from '../types/index.type';
|
||||||
|
|
||||||
|
@ -6,13 +6,16 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { THydratedDocument, Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Action } from '../types/action.type';
|
import { Action } from '../types/action.type';
|
||||||
|
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
* 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 { Prop, Schema, SchemaFactory, ModelDefinition } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Exclude, Type } from 'class-transformer';
|
import { Exclude, Type } from 'class-transformer';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { Permission } from './permission.schema';
|
import { Permission } from './permission.schema';
|
||||||
import { User } from './user.schema';
|
import { User } from './user.schema';
|
||||||
|
@ -8,12 +8,15 @@
|
|||||||
|
|
||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { Schema as MongooseSchema, THydratedDocument } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
import { Attachment } from '@/attachment/schemas/attachment.schema';
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { TFilterPopulateFields } from '@/utils/types/filter.types';
|
import {
|
||||||
|
TFilterPopulateFields,
|
||||||
|
THydratedDocument,
|
||||||
|
} from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { UserProvider } from '../types/user-provider.type';
|
import { UserProvider } from '../types/user-provider.type';
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NotFoundException } from '@nestjs/common';
|
import { NotFoundException } from '@nestjs/common';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { TValidateProps } from '../types/filter.types';
|
import { TValidateProps } from '../types/filter.types';
|
||||||
|
|
||||||
|
@ -19,11 +19,12 @@ import {
|
|||||||
Model,
|
Model,
|
||||||
Query,
|
Query,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
TFilterQuery,
|
|
||||||
UpdateQuery,
|
UpdateQuery,
|
||||||
UpdateWithAggregationPipeline,
|
UpdateWithAggregationPipeline,
|
||||||
} from 'mongoose';
|
} from 'mongoose';
|
||||||
|
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||||
|
|
||||||
import { BaseSchema } from './base-schema';
|
import { BaseSchema } from './base-schema';
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
import { ConflictException } from '@nestjs/common';
|
import { ConflictException } from '@nestjs/common';
|
||||||
import { ClassTransformOptions } from 'class-transformer';
|
import { ClassTransformOptions } from 'class-transformer';
|
||||||
import { MongoError } from 'mongodb';
|
import { MongoError } from 'mongodb';
|
||||||
import { TFilterQuery } from 'mongoose';
|
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
import { PageQueryDto, QuerySortDto } from '../pagination/pagination-query.dto';
|
||||||
|
|
||||||
|
@ -7,13 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Injectable,
|
|
||||||
PipeTransform,
|
|
||||||
ArgumentMetadata,
|
ArgumentMetadata,
|
||||||
|
Injectable,
|
||||||
Logger,
|
Logger,
|
||||||
|
PipeTransform,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import escapeRegExp from 'lodash/escapeRegExp';
|
import escapeRegExp from 'lodash/escapeRegExp';
|
||||||
import { TFilterQuery, Types } from 'mongoose';
|
import { Types } from 'mongoose';
|
||||||
|
|
||||||
|
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TFilterNestedKeysOfType,
|
TFilterNestedKeysOfType,
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
* 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 { Prop, SchemaFactory, Schema } from '@nestjs/mongoose';
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
import { THydratedDocument } from 'mongoose';
|
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
@Schema({ timestamps: true })
|
@Schema({ timestamps: true })
|
||||||
export class Dummy extends BaseSchema {
|
export class Dummy extends BaseSchema {
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
* 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 { HydratedDocument, QuerySelector, RootQuerySelector } from 'mongoose';
|
||||||
|
|
||||||
export type TFilterKeysOfType<T, U> = {
|
export type TFilterKeysOfType<T, U> = {
|
||||||
[K in keyof T]: T[K] extends U ? K : never;
|
[K in keyof T]: T[K] extends U ? K : never;
|
||||||
}[keyof T];
|
}[keyof T];
|
||||||
@ -105,3 +107,20 @@ export type TTransformFieldProps = {
|
|||||||
context?: TContext;
|
context?: TContext;
|
||||||
operator?: TOperator;
|
operator?: TOperator;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* mongoose */
|
||||||
|
type TOmitId<T> = Omit<T, 'id'>;
|
||||||
|
type TReplaceId<T> = TOmitId<T> & { _id?: string };
|
||||||
|
|
||||||
|
// Enforce the typing with an alternative type to FilterQuery compatible with mongoose: version 8.0.0
|
||||||
|
export type TFilterQuery<T, S = TReplaceId<T>> = (
|
||||||
|
| RecursivePartial<{
|
||||||
|
[P in keyof S]?:
|
||||||
|
| (S[P] extends string ? S[P] | RegExp : S[P])
|
||||||
|
| QuerySelector<S[P]>;
|
||||||
|
}>
|
||||||
|
| Partial<ObjectWithNestedKeys<S>>
|
||||||
|
) &
|
||||||
|
WithoutGenericAny<RootQuerySelector<S>>;
|
||||||
|
|
||||||
|
export type THydratedDocument<T> = TOmitId<HydratedDocument<T>>;
|
||||||
|
8
api/types/event-emitter.d.ts
vendored
8
api/types/event-emitter.d.ts
vendored
@ -8,12 +8,7 @@
|
|||||||
|
|
||||||
import { type OnEventOptions } from '@nestjs/event-emitter/dist/interfaces';
|
import { type OnEventOptions } from '@nestjs/event-emitter/dist/interfaces';
|
||||||
import type { Listener, OnOptions } from 'eventemitter2';
|
import type { Listener, OnOptions } from 'eventemitter2';
|
||||||
import type {
|
import type { Document, Query } from 'mongoose';
|
||||||
Document,
|
|
||||||
Query,
|
|
||||||
TFilterQuery,
|
|
||||||
THydratedDocument,
|
|
||||||
} from 'mongoose';
|
|
||||||
import { type Socket } from 'socket.io';
|
import { type Socket } from 'socket.io';
|
||||||
|
|
||||||
import { type BotStats } from '@/analytics/schemas/bot-stats.schema';
|
import { type BotStats } from '@/analytics/schemas/bot-stats.schema';
|
||||||
@ -49,6 +44,7 @@ import { type Permission } from '@/user/schemas/permission.schema';
|
|||||||
import { type Role } from '@/user/schemas/role.schema';
|
import { type Role } from '@/user/schemas/role.schema';
|
||||||
import { type User } from '@/user/schemas/user.schema';
|
import { type User } from '@/user/schemas/user.schema';
|
||||||
import { EHook, type DeleteResult } from '@/utils/generics/base-repository';
|
import { EHook, type DeleteResult } from '@/utils/generics/base-repository';
|
||||||
|
import { TFilterQuery, THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
import '@nestjs/event-emitter';
|
import '@nestjs/event-emitter';
|
||||||
/**
|
/**
|
||||||
|
32
api/types/mongoose.d.ts
vendored
32
api/types/mongoose.d.ts
vendored
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
|
||||||
* 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 {
|
|
||||||
ObjectWithNestedKeys,
|
|
||||||
RecursivePartial,
|
|
||||||
WithoutGenericAny,
|
|
||||||
} from '@/utils/types/filter.types';
|
|
||||||
import 'mongoose';
|
|
||||||
|
|
||||||
declare module 'mongoose' {
|
|
||||||
type TOmitId<T> = Omit<T, 'id'>;
|
|
||||||
type TReplaceId<T> = TOmitId<T> & { _id?: string };
|
|
||||||
|
|
||||||
// Enforce the typing with an alternative type to FilterQuery compatible with mongoose: version 8.0.0
|
|
||||||
type TFilterQuery<T, S = TReplaceId<T>> = (
|
|
||||||
| RecursivePartial<{
|
|
||||||
[P in keyof S]?:
|
|
||||||
| (S[P] extends string ? S[P] | RegExp : S[P])
|
|
||||||
| QuerySelector<S[P]>;
|
|
||||||
}>
|
|
||||||
| Partial<ObjectWithNestedKeys<S>>
|
|
||||||
) &
|
|
||||||
WithoutGenericAny<RootQuerySelector<S>>;
|
|
||||||
|
|
||||||
type THydratedDocument<T> = TOmitId<HydratedDocument<T>>;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user