@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 RE2 from "@distilled.cloud/aws/resource-explorer-2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { View } from "./View.ts";
5
6 export interface SearchRequest extends Omit<RE2.SearchInput, "ViewArn"> {}
7
8 /**
9 * Runtime binding for `resource-explorer-2:Search`.
10 *
11 * Bind this operation to a `View` inside a function runtime to get a
12 * callable that automatically injects the view's ARN. Results are the
13 * intersection of the `QueryString` and the view's filter. Provide the
14 * implementation with `Effect.provide(AWS.ResourceExplorer.SearchHttp)`.
15 * ### Searching Resources
16 * **Example:** Search for S3 buckets
17 * ```typescript
18 * const search = yield* AWS.ResourceExplorer.Search(view);
19 *
20 * const results = yield* search({
21 * QueryString: "service:s3",
22 * MaxResults: 50,
23 * });
24 * // results.Resources, results.Count?.TotalResources
25 * ```
26 *
27 * @binding
28 */
29 export interface Search extends Binding.Service<
30 Search,
31 "AWS.ResourceExplorer.Search",
32 <V extends View>(
33 view: V,
34 ) => Effect.Effect<(request: SearchRequest) => Effect.Effect<RE2.SearchOutput, RE2.SearchError>>
35 > {}
36 export const Search = Binding.Service<Search>("AWS.ResourceExplorer.Search");