import { DynamoEntity } from '../core/entity.js'; import { BaseConfig, BaseResult, BaseCommand } from './index.js'; import { ObjectLikeZodType, EntitySchema } from '../core/index.js'; /** * Configuration for the Get command. * * @template Schema - The Zod schema defining the structure of the entity. */ type GetConfig = BaseConfig & { key: Partial>; consistent?: boolean; }; /** * Result of the Get command. * * @template Schema - The Zod schema defining the structure of the entity. */ type GetResult = BaseResult & { item: EntitySchema | undefined; }; /** * Command to retrieve a single item by primary key from a DynamoDB table. * * @template Schema - The Zod schema defining the structure of the entity. * * @example * ```typescript * import { DynamoTable, DynamoEntity, key, Get } 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(), * }), * partitionKey: user => key('USER', user.userId), * sortKey: () => 'METADATA', * }); * * const getCommand = new Get({ * key: { userId: 'user123' }, * consistent: true, * }); * * const { item } = await userEntity.send(getCommand); * ``` */ declare class Get implements BaseCommand, Schema> { #private; constructor(config: GetConfig); execute(entity: DynamoEntity): Promise>; } export { Get }; export type { GetConfig, GetResult };