@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
26 lines (25 loc) • 1.5 kB
TypeScript
import { EFilterOperation } from '../../../enum/filter';
import { IApiControllerGetListQueryPlan } from '../../../interface/class/api/controller/get-list/query';
import { IApiEntity } from '../../../interface/entity';
import { Type } from '@nestjs/common';
import { IAuthGuard } from '@nestjs/passport';
import { TApiPropertyDescribeProperties } from '../../../type/decorator/api/property';
/**
* Resolves metadata-backed GET_LIST filter properties for legacy or normalized-plan DTO generation.
* @param {IApiEntity<E>} entityMetadata - Root entity metadata.
* @param {Array<{isPrimary: boolean; metadata: TApiPropertyDescribeProperties; name: keyof E}>} markedProperties - Legacy metadata-visible root properties.
* @param {Type<IAuthGuard>} currentGuard - Active route guard used by legacy visibility checks.
* @param {IApiControllerGetListQueryPlan} queryPlan - Optional normalized typed query plan.
* @returns {Array<object>} Filter properties consumed by the dynamic DTO generator.
* @template E - Root entity type.
*/
export declare function DtoGenerateGetListQueryProperties<E>(entityMetadata: IApiEntity<E>, markedProperties: Array<{
isPrimary: boolean;
metadata: TApiPropertyDescribeProperties;
name: keyof E;
}>, currentGuard?: Type<IAuthGuard>, queryPlan?: IApiControllerGetListQueryPlan): Array<{
allowedOperations?: ReadonlyArray<EFilterOperation>;
entityMetadata: IApiEntity<unknown>;
metadata: TApiPropertyDescribeProperties;
name: string;
}>;