UNPKG

@elsikora/nestjs-crud-automator

Version:

A library for automating the creation of CRUD operations in NestJS.

17 lines (16 loc) 1.01 kB
import type { Type } from "@nestjs/common"; import type { ObjectLiteral } from "typeorm/index"; import { EApiDtoType, EApiRouteType } from '../../enum/decorator/api/index'; import { IApiEntity } from '../../interface/entity/index'; /** * Creates a base class for list query DTOs with pagination and sorting properties. * Includes limit, orderBy, orderDirection, and page fields with appropriate validation rules * to ensure consistent pagination behavior. * @param {ObjectLiteral} entity - The entity class or prototype * @param {IApiEntity<E>} entityMetadata - The entity metadata containing column information * @param {EApiRouteType} method - The API route type (GET_LIST) * @param {EApiDtoType} dtoType - The type of DTO (QUERY) * @returns {Type<unknown>} A base class for list query DTOs * @template E - The entity type */ export declare function DtoGetGetListQueryBaseClass<E>(entity: ObjectLiteral, entityMetadata: IApiEntity<E>, method: EApiRouteType, dtoType: EApiDtoType): Type<unknown>;