@meshwatch/backend-core
Version:
Meshwatch backend core services.
26 lines (25 loc) • 1.38 kB
TypeScript
import { CreateTableOutput } from 'aws-sdk/clients/dynamodb';
import { AWSError } from 'aws-sdk/lib/error';
import { PromiseResult } from 'aws-sdk/lib/request';
import { DynamoDBClient, DynamoDBTableClient } from '../../shared/aws/dynamodb';
import { AlertDynamoItem } from '../alerts/types';
import { MonitorDynamoItem } from '../monitors/types';
import { MonitoringHashKey } from './types';
declare abstract class DynamoMonitoringDatasource {
protected readonly dynamoClient: DynamoDBTableClient;
protected readonly dynamoRawClient: DynamoDBClient;
protected readonly tableName: string;
constructor(dynamoClient?: DynamoDBClient);
createTable: () => Promise<PromiseResult<CreateTableOutput, AWSError>>;
static encodeHashKey({ userId }: MonitoringHashKey): string;
static decodeHashKey(hashKey: string): MonitoringHashKey;
private decodeAlertSortKey;
protected alertFromDynamoItem: (Item: AlertDynamoItem) => import("@meshwatch/types/dist/common").WithCreated<import("@meshwatch/types").CreateAlertDTO & {
scheduler: string;
} & {
id: string;
}>;
private decodeMonitorSortKey;
protected monitorFromDynamoItem: (Item: MonitorDynamoItem) => import("@meshwatch/types/dist/common").WithCreated<import("@meshwatch/types").UpdateMonitorDTO>;
}
export default DynamoMonitoringDatasource;