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

main
ts 40 lines 1.5 KB
Raw
1 import type * as schemas from "@distilled.cloud/aws/schemas";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Registry } from "./Registry.ts";
5
6 /**
7 * Runtime binding for `schemas:SearchSchemas`.
8 *
9 * Searches the bound {@link Registry}'s schemas by keyword — matching both
10 * schema names and content — so a function can discover event contracts at
11 * runtime. The registry name is injected from the binding. Provide the
12 * implementation with `Effect.provide(AWS.Schemas.SearchSchemasHttp)`.
13 * ### Searching a Registry
14 * **Example:** Find Schemas By Keyword
15 * ```typescript
16 * // init — bind the operation to the registry
17 * const searchSchemas = yield* AWS.Schemas.SearchSchemas(registry);
18 *
19 * // runtime
20 * const { Schemas } = yield* searchSchemas({ Keywords: "order" });
21 * const names = (Schemas ?? []).map((s) => s.SchemaName);
22 * ```
23 *
24 * @binding
25 */
26 export interface SearchSchemas extends Binding.Service<
27 SearchSchemas,
28 "AWS.Schemas.SearchSchemas",
29 (registry: Registry) => Effect.Effect<
30 (request?: {
31 /** Keywords matched against schema names and content. */
32 Keywords?: string;
33 /** The maximum number of results to return per page. */
34 Limit?: number;
35 /** The pagination token from a previous response. */
36 NextToken?: string;
37 }) => Effect.Effect<schemas.SearchSchemasResponse, schemas.SearchSchemasError>
38 >
39 > {}
40 export const SearchSchemas = Binding.Service<SearchSchemas>("AWS.Schemas.SearchSchemas");