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

main
ts 41 lines 1.43 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 `UpdateIndex` operation scoped to one collection
8 * (IAM actions `aoss:UpdateIndex` + `aoss:APIAccessAll` on the collection ARN).
9 *
10 * Updates an index's schema in the bound {@link Collection} — add new fields
11 * or change field mappings at runtime. The calling principal must also be
12 * granted `aoss:UpdateIndex` on the index pattern by a data
13 * {@link AccessPolicy}. Provide the implementation with
14 * `Effect.provide(AWS.OpenSearchServerless.UpdateIndexHttp)`.
15 * ### Managing Indexes at Runtime
16 * **Example:** Add a field to an index
17 * ```typescript
18 * const updateIndex = yield* AWS.OpenSearchServerless.UpdateIndex(collection);
19 *
20 * yield* updateIndex({
21 * indexName: "tenant-42",
22 * indexSchema: {
23 * mappings: { properties: { title: { type: "text" } } },
24 * },
25 * });
26 * ```
27 *
28 * @binding
29 */
30 export interface UpdateIndex extends Binding.Service<
31 UpdateIndex,
32 "AWS.OpenSearchServerless.UpdateIndex",
33 (
34 collection: Collection,
35 ) => Effect.Effect<
36 (
37 request: Omit<aoss.UpdateIndexRequest, "id">,
38 ) => Effect.Effect<aoss.UpdateIndexResponse, aoss.UpdateIndexError>
39 >
40 > {}
41 export const UpdateIndex = Binding.Service<UpdateIndex>("AWS.OpenSearchServerless.UpdateIndex");