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

main
ts 52 lines 1.83 KB
Raw
1 import type * as Credentials from "@distilled.cloud/aws/Credentials";
2 import type * as SigV4 from "@distilled.cloud/aws/SigV4";
3 import * as Binding from "alchemy/Binding";
4 import type { SourceError } from "effect/ConfigProvider";
5 import type * as Effect from "effect/Effect";
6 import type { IngestRequest, PipelineIngestError } from "./BindingHttp.ts";
7 import type { Pipeline } from "./Pipeline.ts";
8
9 export type { IngestRequest } from "./BindingHttp.ts";
10 export { PipelineIngestError } from "./BindingHttp.ts";
11
12 /**
13 * Runtime binding for the `osis:Ingest` data plane.
14 *
15 * Sends events into the bound {@link Pipeline}'s ingest endpoint — the
16 * pipeline's actual data plane. There is no SDK operation for ingestion;
17 * each batch is a SigV4-signed HTTP POST (service `"osis"`) to the
18 * pipeline's ingest endpoint URL, made with the host Function's own
19 * credentials. The endpoint and pipeline name are injected from the binding;
20 * pass the source `path` configured on the pipeline's `http` source and the
21 * batch of events. Provide the implementation with
22 * `Effect.provide(AWS.OSIS.IngestHttp)`.
23 * ### Ingesting Data
24 * **Example:** Send a Batch of Log Events
25 * ```typescript
26 * // init — bind the data plane to the pipeline
27 * const ingest = yield* AWS.OSIS.Ingest(pipeline);
28 *
29 * // runtime — path must match the pipeline config's http source path
30 * yield* ingest({
31 * path: "/logs/ingest",
32 * events: [{ message: "hello", level: "info" }],
33 * });
34 * ```
35 *
36 * @binding
37 */
38 export interface Ingest extends Binding.Service<
39 Ingest,
40 "AWS.OSIS.Ingest",
41 (
42 pipeline: Pipeline,
43 ) => Effect.Effect<
44 (
45 request: IngestRequest,
46 ) => Effect.Effect<
47 void,
48 PipelineIngestError | Credentials.CredentialsError | SourceError | SigV4.SigningError
49 >
50 >
51 > {}
52 export const Ingest = Binding.Service<Ingest>("AWS.OSIS.Ingest");