@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
19 lines (18 loc) • 1.41 kB
TypeScript
import type { EApiRouteType } from '../../../enum/decorator/api/index';
import type { IApiControllerProperties } from '../../../interface/decorator/api/index';
import type { IApiEntity } from '../../../interface/entity/index';
import type { TApiControllerPropertiesRoute } from '../../../type/decorator/api/controller/index';
/**
* 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
* @returns {void}
* @template E - The entity type
*/
export declare function ApiControllerApplyMetadata<E>(target: object, targetPrototype: object, entity: IApiEntity<E>, properties: IApiControllerProperties<E>, method: EApiRouteType, methodName: string, routeConfig: TApiControllerPropertiesRoute<E, typeof method>): void;