@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 46 lines 1.39 KB
Raw
1 import * as Kinesis from "@distilled.cloud/aws/kinesis";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Stream } from "./Stream.ts";
5
6 export interface GetShardIteratorRequest extends Omit<
7 Kinesis.GetShardIteratorInput,
8 "StreamName" | "StreamARN"
9 > {}
10
11 /**
12 * Runtime binding for `kinesis:GetShardIterator`.
13 *
14 * Bind this operation to a `Stream` to obtain a shard iterator — the starting
15 * position for reading records with `AWS.Kinesis.GetRecords`. The stream name
16 * is injected automatically. Provide the implementation with
17 * `Effect.provide(AWS.Kinesis.GetShardIteratorHttp)`.
18 * ### Reading Records
19 * **Example:** Obtain an Iterator for the Latest Position
20 * ```typescript
21 * // init
22 * const getShardIterator = yield* AWS.Kinesis.GetShardIterator(stream);
23 *
24 * // runtime
25 * const iterator = yield* getShardIterator({
26 * ShardId: shardId,
27 * ShardIteratorType: "LATEST",
28 * });
29 * // pass iterator.ShardIterator to getRecords
30 * ```
31 *
32 * @binding
33 */
34 export interface GetShardIterator extends Binding.Service<
35 GetShardIterator,
36 "AWS.Kinesis.GetShardIterator",
37 (
38 stream: Stream,
39 ) => Effect.Effect<
40 (
41 request: GetShardIteratorRequest,
42 ) => Effect.Effect<Kinesis.GetShardIteratorOutput, Kinesis.GetShardIteratorError>
43 >
44 > {}
45
46 export const GetShardIterator = Binding.Service<GetShardIterator>("AWS.Kinesis.GetShardIterator");