@moicky/dynamodb
Version:
Contains a collection of convenience functions for working with AWS DynamoDB
35 lines (34 loc) • 1.67 kB
TypeScript
export declare function stripKey(key: Record<string, any>, args?: {
TableName?: string;
}): Record<string, import("@aws-sdk/client-dynamodb").AttributeValue>;
export declare function splitEvery<T>(items: T[], limit?: number): T[][];
export declare function getAttributeValues(key: Record<string, any>, { attributesToGet, prefix, }?: {
attributesToGet?: string[];
prefix?: string;
}): Record<string, import("@aws-sdk/client-dynamodb").AttributeValue>;
export declare function getAttributeNames(key: Record<string, any>, { attributesToGet, prefix, }?: {
attributesToGet?: string[];
prefix?: string;
}): Record<string, string>;
export declare function getAttributesFromExpression(expression: string, prefix?: string): string[];
export declare class ExpressionAttributes {
ExpressionAttributeValues: Record<string, any>;
ExpressionAttributeNames: Record<string, string>;
nameMapping: Record<string, string>;
valueMapping: Record<string, any>;
nameCounter: number;
valueCounter: number;
constructor(ExpressionAttributeValues?: Record<string, any>, ExpressionAttributeNames?: Record<string, string>);
appendNames(names: string[]): void;
appendValues(values: Record<string, any>): void;
appendBoth(values: Record<string, any>): void;
getAttributes(): {
ExpressionAttributeValues: Record<string, import("@aws-sdk/client-dynamodb").AttributeValue>;
ExpressionAttributeNames: Record<string, string>;
};
getName(attributeName: string): string;
getValue(attributeName: string): any;
}
export declare const getItemKey: (item: Record<string, any>, args?: {
TableName?: string;
}) => string;