@elsikora/nestjs-crud-automator
Version:
A library for automating the creation of CRUD operations in NestJS.
13 lines (12 loc) • 888 B
TypeScript
import type { IApiEntity } from '../../../interface/entity/index';
import type { IApiControllerPrimaryColumn } from '../../../interface/utility/index';
import type { DeepPartial } from "typeorm";
/**
* Extracts the primary key column and its value from an entity's metadata.
* Used for CRUD operations that need to identify records by primary key.
* @param {DeepPartial<E> | Partial<E>} parameters - The request parameters containing the primary key value
* @param {IApiEntity<E>} entityMetadata - The entity metadata containing column information
* @returns {IApiControllerPrimaryColumn<E> | undefined} The primary key information or undefined if no primary key is found
* @template E - The entity type
*/
export declare function ApiControllerGetPrimaryColumn<E>(parameters: DeepPartial<E> | Partial<E>, entityMetadata: IApiEntity<E>): IApiControllerPrimaryColumn<E> | undefined;