@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.22 KB
Raw
1 import type * as datazone from "@distilled.cloud/aws/datazone";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Domain } from "./Domain.ts";
5
6 export interface SearchRequest extends Omit<datazone.SearchInput, "domainIdentifier"> {}
7
8 /**
9 * Runtime binding for `datazone:Search`.
10 *
11 * Searches the bound domain's inventory — assets, glossaries, and data products visible to the calling project. The domain id is injected from the binding.
12 * Provide the implementation with
13 * `Effect.provide(AWS.DataZone.SearchHttp)`.
14 * ### Searching the Catalog
15 * **Example:** Search Assets by Text
16 * ```typescript
17 * // init — bind the operation to the domain
18 * const search = yield* AWS.DataZone.Search(domain);
19 *
20 * // runtime
21 * const result = yield* search({ searchScope: "ASSET", searchText: "orders" });
22 * const names = result.items?.map((i) => i.assetItem?.name);
23 * ```
24 *
25 * @binding
26 */
27 export interface Search extends Binding.Service<
28 Search,
29 "AWS.DataZone.Search",
30 (
31 domain: Domain,
32 ) => Effect.Effect<
33 (request: SearchRequest) => Effect.Effect<datazone.SearchOutput, datazone.SearchError>
34 >
35 > {}
36 export const Search = Binding.Service<Search>("AWS.DataZone.Search");