@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
15 lines (14 loc) • 892 B
TypeScript
import type { Type } from "@nestjs/common";
import { EApiDtoType, EApiRouteType } from '../../enum/decorator/api/index';
import { IApiEntity } from '../../interface/entity/index';
/**
* Creates a simple relationship DTO containing only an ID field.
* Used for representing related entities in API responses with minimal information.
* @param {IApiEntity<E>} entity - The entity metadata
* @param {EApiRouteType} method - The API route type (CREATE, DELETE, GET, etc.)
* @param {EApiDtoType} dtoType - The type of DTO (REQUEST, RESPONSE, etc.)
* @param {string} propertyName - The name of the relation property
* @returns {Type<unknown>} A generated DTO class for relation representation
* @template E - The entity type
*/
export declare function DtoGenerateRelationResponse<E>(entity: IApiEntity<E>, method: EApiRouteType, dtoType: EApiDtoType, propertyName: string): Type<unknown>;