UNPKG

arrow-store

Version:
26 lines (25 loc) 1.48 kB
import { DynamoDBSchemaProvider } from "./schemaBuilders"; import { DynamoDB } from "aws-sdk"; import { AttributeValue } from "aws-sdk/clients/dynamodb"; import { ArrowStoreRecord, AttributeDescriptor } from "../types"; export declare type DynamoDBRecordMapper = { toRecord<TRecord>(recordTypeId: string, attributes: DynamoDB.AttributeMap): TRecord; toAttributeMap<TRecord extends ArrowStoreRecord>(recordTypeId: string, record: TRecord): DynamoDB.AttributeMap; toKeyAttribute(primaryKeys: ReadonlyArray<AttributeDescriptor>): DynamoDB.Key; fillRecord(record: {}, recordTypeId: string, itemAttributes: DynamoDB.AttributeMap): void; }; export declare class DefaultDynamoDBRecordMapper implements DynamoDBRecordMapper { private readonly _schemaProvider; constructor(schemaProvider: DynamoDBSchemaProvider); toAttributeMap<TRecord extends ArrowStoreRecord>(recordTypeId: string, record: TRecord): DynamoDB.AttributeMap; toRecord<TRecord>(recordTypeId: string, attributes: DynamoDB.AttributeMap): TRecord; fillRecord(record: {}, recordTypeId: string, itemAttributes: DynamoDB.AttributeMap): void; toKeyAttribute(primaryKeys: ReadonlyArray<AttributeDescriptor>): DynamoDB.Key; static toListAttributeItem(value: any): AttributeValue; private _findAttributeValueInMap; private _initMembers; private _fromAttributeValue; private _evaluate; private _setAttributeValue; private _toAttributeValue; }