@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, 04:45 UTC

main
ts 38 lines 1.35 KB
Raw
1 import type * as Logs from "@distilled.cloud/aws/cloudwatch-logs";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { LogGroup } from "./LogGroup.ts";
5
6 export interface GetLogRecordRequest extends Logs.GetLogRecordRequest {}
7
8 /**
9 * Runtime binding for `logs:GetLogRecord` (CloudWatch Logs Insights).
10 *
11 * Bind this operation to the `LogGroup` an Insights query ran against to
12 * fetch the complete log record behind a query-result row: every row returned
13 * by {@link import("./GetQueryResults.ts").GetQueryResults} carries a `@ptr`
14 * field that identifies the record.
15 * ### Logs Insights
16 * **Example:** Fetch the Full Record Behind a Query Result
17 * ```typescript
18 * const getLogRecord = yield* AWS.Logs.GetLogRecord(logGroup);
19 *
20 * const ptr = row.find((field) => field.field === "@ptr")?.value;
21 * const { logRecord } = yield* getLogRecord({ logRecordPointer: ptr! });
22 * // logRecord["@message"] is the full unparsed log line
23 * ```
24 *
25 * @binding
26 */
27 export interface GetLogRecord extends Binding.Service<
28 GetLogRecord,
29 "AWS.Logs.GetLogRecord",
30 <G extends LogGroup>(
31 logGroup: G,
32 ) => Effect.Effect<
33 (
34 request: GetLogRecordRequest,
35 ) => Effect.Effect<Logs.GetLogRecordResponse, Logs.GetLogRecordError>
36 >
37 > {}
38 export const GetLogRecord = Binding.Service<GetLogRecord>("AWS.Logs.GetLogRecord");