@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 36 lines 1.33 KB
Raw
1 import type * as aoss from "@distilled.cloud/aws/opensearchserverless";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Collection } from "./Collection.ts";
5
6 /**
7 * Runtime binding for the `GetIndex` operation scoped to one collection
8 * (IAM actions `aoss:GetIndex` + `aoss:APIAccessAll` on the collection ARN).
9 *
10 * Reads an index's schema definition from the bound {@link Collection}. A
11 * missing index surfaces the typed `ResourceNotFoundException`. The calling
12 * principal must also be granted `aoss:DescribeIndex` on the index pattern by
13 * a data {@link AccessPolicy}. Provide the implementation with
14 * `Effect.provide(AWS.OpenSearchServerless.GetIndexHttp)`.
15 * ### Managing Indexes at Runtime
16 * **Example:** Read an index's schema
17 * ```typescript
18 * const getIndex = yield* AWS.OpenSearchServerless.GetIndex(collection);
19 *
20 * const { indexSchema } = yield* getIndex({ indexName: "tenant-42" });
21 * ```
22 *
23 * @binding
24 */
25 export interface GetIndex extends Binding.Service<
26 GetIndex,
27 "AWS.OpenSearchServerless.GetIndex",
28 (
29 collection: Collection,
30 ) => Effect.Effect<
31 (
32 request: Omit<aoss.GetIndexRequest, "id">,
33 ) => Effect.Effect<aoss.GetIndexResponse, aoss.GetIndexError>
34 >
35 > {}
36 export const GetIndex = Binding.Service<GetIndex>("AWS.OpenSearchServerless.GetIndex");