@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 44 lines 1.34 KB
Raw
1 import type * as kendra from "@distilled.cloud/aws/kendra";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Index } from "./SearchIndex.ts";
5
6 /**
7 * `GetSnapshots` request with `IndexId` injected from the bound index.
8 */
9 export interface GetSnapshotsRequest extends Omit<kendra.GetSnapshotsRequest, "IndexId"> {}
10
11 /**
12 * Runtime binding for the `GetSnapshots` operation (IAM action
13 * `kendra:GetSnapshots`), scoped to one {@link Index}.
14 *
15 * Fetches search-analytics metric snapshots for the index (click-through
16 * rate, zero-result queries, top queries, …) over a time interval.
17 * Provide the implementation with
18 * `Effect.provide(AWS.Kendra.GetSnapshotsHttp)`.
19 *
20 * ### Search Analytics
21 * **Example:** Fetch Search Metrics
22 * ```typescript
23 * const getSnapshots = yield* AWS.Kendra.GetSnapshots(index);
24 *
25 * const metrics = yield* getSnapshots({
26 * Interval: "ONE_WEEK_AGO",
27 * MetricType: "QUERIES_BY_COUNT",
28 * });
29 * ```
30 *
31 * @binding
32 */
33 export interface GetSnapshots extends Binding.Service<
34 GetSnapshots,
35 "AWS.Kendra.GetSnapshots",
36 (
37 index: Index,
38 ) => Effect.Effect<
39 (
40 request: GetSnapshotsRequest,
41 ) => Effect.Effect<kendra.GetSnapshotsResponse, kendra.GetSnapshotsError>
42 >
43 > {}
44 export const GetSnapshots = Binding.Service<GetSnapshots>("AWS.Kendra.GetSnapshots");