@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
22 lines (21 loc) • 1.76 kB
TypeScript
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';
/**
* Applies metadata for NestJS controller methods to enable proper dependency injection.
* Sets up parameter metadata for route arguments including DTOs, headers, IP, and authentication requests.
* @param {object} target - The target controller class
* @param {object} targetPrototype - The prototype of the target controller class
* @param {IApiEntity<E>} entity - The entity metadata for the controller
* @param {IApiControllerProperties<E>} properties - Controller configuration properties
* @param {EApiRouteType} method - The type of route (CREATE, DELETE, GET, etc.)
* @param {string} methodName - The name of the method being configured
* @param {TApiControllerPropertiesRoute<E, typeof method>} routeConfig - Route-specific configuration
* @param {IApiControllerGetListQueryPlan} [queryPlan] - Normalized plan used to resolve the route-scoped dynamic QUERY DTO.
* @returns {void}
* @template E - The entity type
*/
export declare function ApiControllerApplyMetadata<E extends IApiBaseEntity>(target: object, targetPrototype: object, entity: IApiEntity<E>, properties: IApiControllerProperties<E>, method: EApiRouteType, methodName: string, routeConfig: TApiControllerPropertiesRoute<E, typeof method>, queryPlan?: IApiControllerGetListQueryPlan): void;