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

main
ts 46 lines 1.63 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 GetInsightImpactGraphRequest extends xray.GetInsightImpactGraphRequest {}
6
7 /**
8 * Retrieve a structural service graph filtered by insight — which
9 * services the insight's anomaly impacted over a time window.
10 *
11 * Bind the operation in the function's init phase to get a runtime callable;
12 * provide the implementation with `Effect.provide(XRay.GetInsightImpactGraphHttp)`.
13 * The action is account-scoped: X-Ray does not support resource-level
14 * permissions for `xray:GetInsightImpactGraph`, so the binding grants it on `*`.
15 * ### Insights
16 * **Example:** Graph the services an insight impacted
17 * ```typescript
18 * import * as XRay from "@alchemy.run/aws/XRay";
19 *
20 * // init — grants xray:GetInsightImpactGraph
21 * const getInsightImpactGraph = yield* XRay.GetInsightImpactGraph();
22 *
23 * // runtime
24 * const now = yield* Effect.sync(() => Date.now());
25 * const graph = yield* getInsightImpactGraph({
26 * InsightId: insightId,
27 * StartTime: new Date(now - 60 * 60 * 1000),
28 * EndTime: new Date(now),
29 * });
30 * const services = graph.Services ?? [];
31 * ```
32 *
33 * @binding
34 */
35 export interface GetInsightImpactGraph extends Binding.Service<
36 GetInsightImpactGraph,
37 "AWS.XRay.GetInsightImpactGraph",
38 () => Effect.Effect<
39 (
40 request: GetInsightImpactGraphRequest,
41 ) => Effect.Effect<xray.GetInsightImpactGraphResult, xray.GetInsightImpactGraphError>
42 >
43 > {}
44 export const GetInsightImpactGraph = Binding.Service<GetInsightImpactGraph>(
45 "AWS.XRay.GetInsightImpactGraph",
46 );