UNPKG

cloudrx

Version:

TypeScript library for streaming cloud provider events using RxJS with automatic persistence and replay capabilities

47 lines 1.76 kB
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; import { CloudProvider, CloudOptions, Streamed, Matcher } from '../base'; import { Observable } from 'rxjs'; import { _Record, DynamoDBStreamsClient, Shard } from '@aws-sdk/client-dynamodb-streams'; import { TranslateConfig } from '@aws-sdk/lib-dynamodb'; export type DynamoDBOptions = CloudOptions & { client?: DynamoDBClient; hashKey?: string; rangeKey?: string; ttlAttribute?: string; pollInterval?: number; }; export type DynamoDBStreamedData<T> = Streamed<T, string>; export type DynamoDBStoredData<T> = { [x: string]: string | number | T; data: T; timestamp: number; expires?: number; }; export declare class DynamoDB extends CloudProvider<_Record, NonNullable<_Record['dynamodb']>['SequenceNumber']> { private static shards; private _client; private _streamClient?; private _hashKey; private _rangeKey; private _ttlAttribute; private _pollInterval; private _tableArn?; private _streamArn?; readonly translation: TranslateConfig; constructor(id: string, opts?: DynamoDBOptions); get client(): DynamoDBClient; get tableName(): string; get tableArn(): string; get hashKey(): string; get rangeKey(): string; get ttlAttribute(): string; get pollInterval(): number; get streamClient(): DynamoDBStreamsClient; get streamArn(): string; get shards(): Observable<Shard>; protected _init(): Observable<this>; protected _stream(all: boolean): Observable<_Record[]>; protected _store<T>(item: T): Observable<Matcher<_Record>>; protected _unmarshall<T>(event: _Record): Streamed<T, NonNullable<_Record['dynamodb']>['SequenceNumber']>; } //# sourceMappingURL=provider.d.ts.map