UNPKG

@elsikora/nestjs-crud-automator

Version:

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

39 lines (38 loc) 2.97 kB
import { EApiDtoType, EApiRouteType } from '../../../../enum/decorator/api'; import { IApiBaseEntity } from '../../../../interface/api-base-entity.interface'; import { IApiControllerGetListQueryPlan } from '../../../../interface/class/api/controller/get-list/query'; import { IApiControllerIdentityPlan } from '../../../../interface/class/api/controller/identity-plan.interface'; import { IApiControllerReadPlan } from '../../../../interface/class/api/controller/read'; import { IApiControllerProperties } from '../../../../interface/decorator/api'; import { IApiEntity } from '../../../../interface/entity'; import { Type } from '@nestjs/common'; import { TApiControllerPropertiesRoute } from '../../../../type/decorator/api/controller'; /** * Resolves a DTO class for a generated controller route. * Prefers an explicitly configured DTO and falls back to auto-generation. * @param {IApiControllerProperties<E>} properties - Controller configuration * @param {IApiEntity<E>} entity - Entity metadata * @param {R} method - Route type * @param {EApiDtoType} dtoType - DTO kind to resolve * @param {TApiControllerPropertiesRoute<E, R>} routeConfig - Route-specific configuration * @param {IApiControllerGetListQueryPlan} [queryPlan] - Route-scoped plan for dynamic GET_LIST QUERY DTO generation. * @returns {Type<unknown> | undefined} -The resolved DTO class or undefined if no DTO is configured * @template E - Entity type * @template R - Route type */ export declare function ApiControllerGetDto<E extends IApiBaseEntity, R extends EApiRouteType>(properties: IApiControllerProperties<E>, entity: IApiEntity<E>, method: R, dtoType: EApiDtoType, routeConfig: TApiControllerPropertiesRoute<E, R>, queryPlan?: IApiControllerGetListQueryPlan): Type<unknown> | undefined; /** * Resolves a route DTO while applying an internal compiled read plan. * @template E - Entity type * @template R - Route type * @param {IApiControllerProperties<E>} properties - Controller properties * @param {IApiEntity<E>} entity - Entity metadata * @param {R} method - Route method * @param {EApiDtoType} dtoType - DTO kind to resolve * @param {TApiControllerPropertiesRoute<E, R>} routeConfig - Route-specific configuration * @param {IApiControllerGetListQueryPlan} [queryPlan] - Route-scoped GET_LIST QUERY plan. * @param {IApiControllerReadPlan} [readPlan] - Internal route-scoped PARAMETERS plan. * @param {IApiControllerIdentityPlan} [identityPlan] - Internal GET identity alias plan. * @returns {Type<unknown> | undefined} Resolved DTO class or undefined. */ export declare function ApiControllerGetDtoWithReadPlan<E extends IApiBaseEntity, R extends EApiRouteType>(properties: IApiControllerProperties<E>, entity: IApiEntity<E>, method: R, dtoType: EApiDtoType, routeConfig: TApiControllerPropertiesRoute<E, R>, queryPlan?: IApiControllerGetListQueryPlan, readPlan?: IApiControllerReadPlan, identityPlan?: IApiControllerIdentityPlan): Type<unknown> | undefined;