import { SimpleDB } from "aws-sdk"; import { IsotopeDictionary } from "../format"; /** * Isotope client options */ export interface IsotopeClientOptions { consistent?: boolean; } /** * Isotope client item */ export interface IsotopeClientItem { id: string; attrs: IsotopeDictionary; } /** * Isotope client item list */ export interface IsotopeClientItemList { items: IsotopeClientItem[]; next?: string; } /** * Map a dictionary to a list of SimpleDB attributes * * @param dict - Dictionary * * @return SimpleDB attributes */ export declare function mapDictionaryToAttributes(dict: IsotopeDictionary): SimpleDB.ReplaceableAttribute[]; /** * Map a list of SimpleDB attributes to a dictionary * * @param attrs - SimpleDB attributes * * @return Dictionary */ export declare function mapAttributesToDictionary(attrs: SimpleDB.Attribute[]): IsotopeDictionary; /** * Isotope SimpleDB client abstraction */ export declare class IsotopeClient { protected domain: string; /** * Isotope client options */ protected options: Required; /** * SimpleDB instance */ protected simpledb: SimpleDB; /** * Initialize a SimpleDB client * * @param domain - SimpleDB domain name * @param options - Client options * @param simpleDBOptions - Options to pass directly to SimpleDB constructor */ constructor(domain: string, options?: IsotopeClientOptions, simpleDBOptions?: SimpleDB.ClientConfiguration); /** * Create the SimpleDB domain * * @return Promise resolving with no result */ create(): Promise; /** * Destroy the SimpleDB domain * * @return Promise resolving with no result */ destroy(): Promise; /** * Retrieve an item from SimpleDB * * @param id - Identifier * @param names - Attribute names * * @return Promise resolving with item or undefined */ get(id: string, names?: string[]): Promise; /** * Persist an item in SimpleDB * * @param id - Identifier * @param attrs - Attributes * * @return Promise resolving with no result */ put(id: string, attrs: IsotopeDictionary): Promise; /** * Delete an item or specific attributes from SimpleDB * * @param id - Identifier * @param names - Attribute names * * @return Promise resolving with no result */ delete(id: string, names?: string[]): Promise; /** * Retrieve a set of items matching the given SQL query * * @param expr - SQL query expression * @param next - Pagination token * * @return Promise resolving with item list */ select(expr: string, next?: string): Promise; }