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

main
ts 43 lines 1.39 KB
Raw
1 import type * as Firehose from "@distilled.cloud/aws/firehose";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { DeliveryStream } from "./DeliveryStream.ts";
5
6 export interface PutRecordRequest extends Omit<Firehose.PutRecordInput, "DeliveryStreamName"> {}
7
8 /**
9 * Writes a single data record into a Firehose delivery stream.
10 *
11 * Grants `firehose:PutRecord` on the bound delivery stream. The data blob
12 * can be up to 1,000 KiB; Firehose buffers records before delivering them to
13 * the destination, so use a delimiter (e.g. `\n`) to disambiguate records.
14 * ### Putting Records
15 * **Example:** Put a record from a handler
16 * ```typescript
17 * // init
18 * const putRecord = yield* AWS.Firehose.PutRecord(deliveryStream);
19 *
20 * return {
21 * fetch: Effect.gen(function* () {
22 * // runtime
23 * const response = yield* putRecord({
24 * Record: { Data: new TextEncoder().encode("hello\n") },
25 * });
26 * return HttpServerResponse.json({ recordId: response.RecordId });
27 * }),
28 * };
29 * ```
30 *
31 * @binding
32 */
33 export interface PutRecord extends Binding.Service<
34 PutRecord,
35 "AWS.Firehose.PutRecord",
36 (
37 deliveryStream: DeliveryStream,
38 ) => Effect.Effect<
39 (request: PutRecordRequest) => Effect.Effect<Firehose.PutRecordOutput, Firehose.PutRecordError>
40 >
41 > {}
42
43 export const PutRecord = Binding.Service<PutRecord>("AWS.Firehose.PutRecord");