import { IConfiguration, IHasId, IHasVersion, IHasMetadata } from './index'; export const read = ({ client, tableName }: IConfiguration) => async (item: IHasId): Promise => { const response = await client.get({ TableName: tableName, Key: { id: item.id } }) .promise(); if (response.Item == null) { throw new Error(`Key not found ${item.id}`); } return response.Item; };