UNPKG

@elsikora/nestjs-crud-automator

Version:

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

22 lines (21 loc) 1.67 kB
import { EApiRouteType } from '../../../../enum/decorator/api'; import { IApiBaseEntity } from '../../../../interface/api-base-entity.interface'; import { IApiControllerGetListQueryPlan } from '../../../../interface/class/api/controller/get-list/query'; import { IApiControllerProperties } from '../../../../interface/decorator/api'; import { IApiEntity } from '../../../../interface/entity'; import { TApiControllerPropertiesRoute } from '../../../../type/decorator/api/controller'; /** * Generates and registers Swagger documentation for DTOs. * Creates or uses existing DTOs for request, query, body, and response, * and ensures they're properly registered with Swagger for API documentation. * @param {object} target - The target controller class * @param {IApiEntity<E>} entity - The entity definition * @param {IApiControllerProperties<E>} properties - Controller configuration properties * @param {EApiRouteType} method - The type of route (CREATE, DELETE, GET, etc.) * @param {TApiControllerPropertiesRoute<E, typeof method>} routeConfig - Route-specific configuration * @param {IApiEntity<E>} entityMetadata - The entity metadata containing column information * @param {IApiControllerGetListQueryPlan} [queryPlan] - Route-scoped plan used by dynamic QUERY DTO generation. * @returns {void} * @template E - The entity type */ export declare function ApiControllerWriteDtoSwagger<E extends IApiBaseEntity>(target: object, entity: IApiEntity<E>, properties: IApiControllerProperties<E>, method: EApiRouteType, routeConfig: TApiControllerPropertiesRoute<E, typeof method>, entityMetadata: IApiEntity<E>, queryPlan?: IApiControllerGetListQueryPlan): void;