@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 46 lines 1.59 KB
Raw
1 import type * as xray from "@distilled.cloud/aws/xray";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 export interface GetInsightSummariesRequest extends xray.GetInsightSummariesRequest {}
6
7 /**
8 * Retrieve the summaries of all insights in a group (by name or ARN)
9 * matching the provided state and time filters.
10 *
11 * Bind the operation in the function's init phase to get a runtime callable;
12 * provide the implementation with `Effect.provide(XRay.GetInsightSummariesHttp)`.
13 * The action is account-scoped: X-Ray does not support resource-level
14 * permissions for `xray:GetInsightSummaries`, so the binding grants it on `*`.
15 * ### Insights
16 * **Example:** List recent insights for a group
17 * ```typescript
18 * import * as XRay from "@alchemy.run/aws/XRay";
19 *
20 * // init — grants xray:GetInsightSummaries
21 * const getInsightSummaries = yield* XRay.GetInsightSummaries();
22 *
23 * // runtime
24 * const now = yield* Effect.sync(() => Date.now());
25 * const result = yield* getInsightSummaries({
26 * GroupName: group.groupName,
27 * StartTime: new Date(now - 24 * 60 * 60 * 1000),
28 * EndTime: new Date(now),
29 * });
30 * const insights = result.InsightSummaries ?? [];
31 * ```
32 *
33 * @binding
34 */
35 export interface GetInsightSummaries extends Binding.Service<
36 GetInsightSummaries,
37 "AWS.XRay.GetInsightSummaries",
38 () => Effect.Effect<
39 (
40 request: GetInsightSummariesRequest,
41 ) => Effect.Effect<xray.GetInsightSummariesResult, xray.GetInsightSummariesError>
42 >
43 > {}
44 export const GetInsightSummaries = Binding.Service<GetInsightSummaries>(
45 "AWS.XRay.GetInsightSummaries",
46 );