@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 40 lines 1.41 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 GetLogGroupFieldsRequest extends Omit<
7 Logs.GetLogGroupFieldsRequest,
8 "logGroupName" | "logGroupIdentifier"
9 > {}
10
11 /**
12 * Runtime binding for `logs:GetLogGroupFields` (CloudWatch Logs Insights).
13 *
14 * Bind this operation to a `LogGroup` inside a function runtime to discover
15 * the fields present in the group's recent log events (and the percentage of
16 * events each field appears in), automatically injecting the log group name.
17 * Useful for building Insights queries dynamically.
18 * ### Logs Insights
19 * **Example:** Discover Fields in a Log Group
20 * ```typescript
21 * const getLogGroupFields = yield* AWS.Logs.GetLogGroupFields(logGroup);
22 *
23 * const { logGroupFields } = yield* getLogGroupFields();
24 * // e.g. [{ name: "@timestamp", percent: 100 }, { name: "@message", ... }]
25 * ```
26 *
27 * @binding
28 */
29 export interface GetLogGroupFields extends Binding.Service<
30 GetLogGroupFields,
31 "AWS.Logs.GetLogGroupFields",
32 <G extends LogGroup>(
33 logGroup: G,
34 ) => Effect.Effect<
35 (
36 request?: GetLogGroupFieldsRequest,
37 ) => Effect.Effect<Logs.GetLogGroupFieldsResponse, Logs.GetLogGroupFieldsError>
38 >
39 > {}
40 export const GetLogGroupFields = Binding.Service<GetLogGroupFields>("AWS.Logs.GetLogGroupFields");