UNPKG

amazon-qldb-kvs-nodejs

Version:

A helper module, simplifying basic interactions with Amazon Quantum Ledger Database for Node.js through a simple key-value store interface.

26 lines (25 loc) 1.69 kB
import { TransactionExecutor } from "amazon-qldb-driver-nodejs"; import { dom } from "ion-js"; import { ValueHolder } from "@aws-sdk/client-qldb-session"; /** * Gets a document version by Id and Block Sequence Number * @param txn The {@linkcode TransactionExecutor} for lambda execute. * @param {string} tableName The name of a table. * @param {string} documentId An Id of the document, generated by QLDB. Can be retrieved through Utils.getDocumentIdsAndVersions function. * @param {number} blockSequenceNo A Block Sequence Number. Can be retrieved through GetMetadata.lookupBlockAddressAndDocIdForKey * @returns An ION document. * @throws Error: If error happen during the process. */ export declare function getDocumentRevisionByIdAndBlock(txn: TransactionExecutor, tableName: string, documentId: string, blockAddress: ValueHolder): Promise<dom.Value>; /** * Gets all document versions for a specific key * @param txn The {@linkcode TransactionExecutor} for lambda execute. * @param {string} tableName The name of a table. * @param {string} keyAttributeName A keyAttributeName to query. * @param {string} keyAttributeValue The key of the given keyAttributeName. * @param {string} fromDateISO OPTIONAL String, containing a from date and time to query revisions history from. * @param {string} toDateISO OPTIONAL String, containing a to date and time to query revisions history to. * @returns An ION document. * @throws Error: If error happen during the process. */ export declare function getDocumentHistory(txn: TransactionExecutor, tableName: string, keyAttributeName: string, keyAttributeValue: string, fromDateISO?: string, toDateISO?: string): Promise<dom.Value[]>;