import { DynamoEntity } from '../core/entity.js'; import { ObjectLikeZodType, EntitySchema } from '../core/index.js'; import { GetConfig } from './get.js'; import { Projection } from '../projections/index.js'; import { BaseResult, BaseCommand } from './index.js'; /** * Configuration for the ProjectedGet command. * * @template Schema - The Zod schema defining the structure of the entity. * @template ProjectionSchema - The Zod schema defining the structure of the projected attributes. */ type ProjectedGetConfig = GetConfig & { projection: Projection; projectionSchema: ProjectionSchema; }; /** * Result of the ProjectedGet command. * * @template ProjectionSchema - The Zod schema defining the structure of the projected attributes. */ type ProjectedGetResult = BaseResult & { item: EntitySchema | undefined; }; /** * Command to retrieve specific attributes of a single item by primary key. * * @template Schema - The Zod schema defining the structure of the entity. * @template ProjectionSchema - The Zod schema defining the structure of the projected attributes. * * @example * ```typescript * import { DynamoTable, DynamoEntity, key, ProjectedGet } from 'dynamo-document-builder'; * * const table = new DynamoTable({ * tableName: 'ExampleTable', * documentClient, * }); * * const userEntity = new DynamoEntity({ * table, * schema: z.object({ * userId: z.string(), * name: z.string(), * email: z.string(), * age: z.number(), * }), * partitionKey: user => key('USER', user.userId), * sortKey: () => 'METADATA', * }); * * const projectedGetCommand = new ProjectedGet({ * key: { userId: 'user123' }, * projection: ['name', 'email'], * projectionSchema: z.object({ * name: z.string(), * email: z.string(), * }), * consistent: true, * }); * * const { item } = await userEntity.send(projectedGetCommand); * ``` */ declare class ProjectedGet implements BaseCommand, Schema> { #private; constructor(config: ProjectedGetConfig); execute(entity: DynamoEntity): Promise>; } export { ProjectedGet }; export type { ProjectedGetConfig, ProjectedGetResult };