UNPKG

@moicky/dynamodb

Version:

Contains a collection of convenience functions for working with AWS DynamoDB

22 lines (21 loc) 1.1 kB
import { Transaction } from ".."; import { DynamoDBItem } from "../../types"; import { DynamoDBItemKey, ItemWithKey } from "../types"; import { DynamoDBReference, ReferenceMetadata, ResolvedItem } from "./types"; export declare const createReference: (ref: Pick<ReferenceMetadata, "item" | "references" | "onAttribute">, transaction: Transaction) => DynamoDBReference; export declare const createCustomReference: (baseItem: DynamoDBItemKey, references: DynamoDBItemKey, onAttribute?: string) => Promise<{ PK: "dynamodb:reference"; SK: `${string}-${string}-${string}-${string}-${string}`; item: { SK: string | number; PK: string | number; }; references: { SK: string | number; PK: string | number; }; onAttribute: string; }>; export declare const resolveReferences: <T extends DynamoDBItem>(item: T) => Promise<ResolvedItem<T>>; export declare const getDependencies: (item: ItemWithKey) => Promise<ReferenceMetadata[]>; export declare const getResolvedDependencies: <T extends ItemWithKey = ItemWithKey>(item: ItemWithKey) => Promise<T[]>;