@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 45 lines 1.42 KB
Raw
1 import type * as kv from "@distilled.cloud/aws/kinesis-video";
2 import type * as kvam from "@distilled.cloud/aws/kinesis-video-archived-media";
3 import * as Binding from "alchemy/Binding";
4 import type * as Effect from "effect/Effect";
5 import type { Stream } from "./Stream.ts";
6
7 export interface GetClipRequest extends Omit<kvam.GetClipInput, "StreamName" | "StreamARN"> {}
8
9 /**
10 * Runtime binding for `kinesisvideo:GetClip` (archived media data plane).
11 *
12 * Bind this operation to a `Stream` inside a function runtime to get a
13 * callable that resolves the per-stream data endpoint (`GetDataEndpoint`)
14 * and downloads an MP4 clip covering the requested fragment range. The
15 * response `Payload` is a streaming body.
16 * ### Reading Media
17 * **Example:** Download a Clip
18 * ```typescript
19 * // init
20 * const getClip = yield* AWS.KinesisVideo.GetClip(stream);
21 *
22 * // runtime
23 * const clip = yield* getClip({
24 * ClipFragmentSelector: {
25 * FragmentSelectorType: "SERVER_TIMESTAMP",
26 * TimestampRange: { StartTimestamp: start, EndTimestamp: end },
27 * },
28 * });
29 * ```
30 *
31 * @binding
32 */
33 export interface GetClip extends Binding.Service<
34 GetClip,
35 "AWS.KinesisVideo.GetClip",
36 <S extends Stream>(
37 stream: S,
38 ) => Effect.Effect<
39 (
40 request: GetClipRequest,
41 ) => Effect.Effect<kvam.GetClipOutput, kvam.GetClipError | kv.GetDataEndpointError>
42 >
43 > {}
44
45 export const GetClip = Binding.Service<GetClip>("AWS.KinesisVideo.GetClip");