@codification/cutwater-aws
Version:
A library providing general functionality for TypeScript based AWS projects.
35 lines • 1.51 kB
TypeScript
import { DynamoDB, GetItemInput } from '@aws-sdk/client-dynamodb';
import { Logger } from '@codification/cutwater-logging';
import { ItemRepository } from '@codification/cutwater-repo';
import { AttributeMap } from '../AttributeMap';
import { CompoundItemRepositoryConfig } from './CompoundItemRepositoryConfig';
export declare class CompoundItemRepository<T extends object> implements ItemRepository<T> {
readonly config: CompoundItemRepositoryConfig<T>;
protected readonly LOG: Logger;
protected readonly db: DynamoDB;
constructor(config: CompoundItemRepositoryConfig<T>);
get itemType(): string;
getAll(parentId?: string): Promise<T[]>;
get(id: string): Promise<T | undefined>;
private toId;
private refreshItem;
put(item: T): Promise<T>;
putAll(items: T[]): Promise<T[]>;
remove(id: string): Promise<T | undefined>;
removeAll(ids: string[]): Promise<string[]>;
toItemInput(id: string): GetItemInput;
protected get baseInput(): {
TableName: string;
};
protected attributeMapToItem(map: AttributeMap): T;
protected itemToAttributeMap(item: T): Promise<AttributeMap>;
protected getAllMaps(partitionValue: string, cursor?: string): Promise<AttributeMap[]>;
private batchPutOrDelete;
private removeUnprocessed;
private findWriteRequests;
private toBatchWriteInputItems;
private toWriteRequests;
private toWriteRequest;
private batchWithRetry;
}
//# sourceMappingURL=CompoundItemRespository.d.ts.map