import type * as keyspacesstreams from "@distilled.cloud/aws/keyspacesstreams"; import type * as Effect from "effect/Effect"; import * as Binding from "../../Binding.ts"; import type { Table } from "./Table.ts"; export interface ListTableStreamsRequest extends Omit { } /** * The typed client returned by binding {@link TableStreams} to a `Table`. * `listStreams` automatically injects the table's keyspace and table name; * the remaining operations traverse a stream by ARN / shard iterator * obtained from prior calls. */ export interface TableStreamsClient { /** * List the CDC streams of the bound table (the stream with the greatest * `streamLabel` is the current one — also exposed as the table's * `latestStreamArn` attribute). */ listStreams: (request?: ListTableStreamsRequest) => Effect.Effect; /** * Describe a stream: status, view type, retention, and shard composition. */ getStream: (request: keyspacesstreams.GetStreamInput) => Effect.Effect; /** * Obtain an iterator positioned in a shard (`TRIM_HORIZON`, `LATEST`, * `AT_SEQUENCE_NUMBER`, or `AFTER_SEQUENCE_NUMBER`). */ getShardIterator: (request: keyspacesstreams.GetShardIteratorInput) => Effect.Effect; /** * Read change records from a shard iterator. */ getRecords: (request: keyspacesstreams.GetRecordsInput) => Effect.Effect; } /** * Runtime binding for the Amazon Keyspaces CDC streams data-plane API * (`cassandra:ListStreams` / `GetStream` / `GetShardIterator` / * `GetRecords`). * * Bind this to a `Table` whose `cdcSpecification` is enabled to get a typed * client for traversing the table's change-data-capture stream. * ### Reading Change Data * **Example:** Traverse the Latest Stream * ```typescript * const streams = yield* AWS.Keyspaces.TableStreams(table); * * const { streams: available } = yield* streams.listStreams(); * const streamArn = available![0].streamArn; * * const stream = yield* streams.getStream({ streamArn }); * const { shardIterator } = yield* streams.getShardIterator({ * streamArn, * shardId: stream.shards![0].shardId!, * shardIteratorType: "TRIM_HORIZON", * }); * * const { changeRecords } = yield* streams.getRecords({ * shardIterator: shardIterator!, * }); * ``` * * @binding */ export interface TableStreams extends Binding.Service(table: T) => Effect.Effect> { } export declare const TableStreams: TableStreams; //# sourceMappingURL=TableStreams.d.ts.map