/** * Dynamo gateway interface file. */ import { DocumentClient, Key } from "aws-sdk/clients/dynamodb"; import { Observable } from "rxjs"; /** * Get the attribute to get an item of dynamo table * @param TableName - Name of the table * @param Key - Table primary key */ export interface IGetitemParams { TableName: string; Key: Key; } /** * Query data in Dynamo Gateway * @param TableName - Name of the table * @param IndexName - Name of the index * @param Key condition expression * @param Expression Attributes Values */ export interface IQueryInput { TableName: string; IndexName: string; KeyConditionExpression: string; ExpressionAttributeValues: { [key: string]: string }; } /** * Gateway logic to connect to Dynamo. */ export interface IDynamoGateway { /** * Get a table item from dynamo * @param table - table name * @param key - object with the key filter */ getItem(table: string, key: object): Observable; /** * Put an item in dynamo table * @param data - to save in table * @param table - name of the dynamo table */ put(data: object, table: string): Observable; /** * Query an expression in dynamo tables using the right client * @params IQueryInput - expression to search */ query(params: DocumentClient.QueryInput): Observable; }