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

main
ts 36 lines 1.05 KB
Raw
1 import * as DynamoDB from "@distilled.cloud/aws/dynamodb";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Table } from "./Table.ts";
5
6 export interface ScanRequest extends Omit<DynamoDB.ScanInput, "TableName"> {}
7
8 /**
9 * Runtime binding for `dynamodb:Scan`.
10 *
11 * Bind this operation to a `Table` inside a function runtime to get a callable
12 * that scans the full table, automatically injecting the table name. Provide
13 * the `ScanHttp` layer on the Function to satisfy the binding.
14 * ### Reading Data
15 * **Example:** Scan a Table
16 * ```typescript
17 * const scan = yield* AWS.DynamoDB.Scan(table);
18 *
19 * const response = yield* scan({});
20 * const items = response.Items;
21 * const count = response.Count;
22 * ```
23 *
24 * @binding
25 */
26 export interface Scan extends Binding.Service<
27 Scan,
28 "AWS.DynamoDB.Scan",
29 <T extends Table>(
30 table: T,
31 ) => Effect.Effect<
32 (request: ScanRequest) => Effect.Effect<DynamoDB.ScanOutput, DynamoDB.ScanError>
33 >
34 > {}
35
36 export const Scan = Binding.Service<Scan>("AWS.DynamoDB.Scan");