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

main
ts 41 lines 1.17 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 DeleteItemRequest extends Omit<DynamoDB.DeleteItemInput, "TableName"> {}
7
8 /**
9 * Runtime binding for `dynamodb:DeleteItem`.
10 *
11 * Bind this operation to a `Table` inside a function runtime to get a callable
12 * that deletes a single item by key, automatically injecting the table name.
13 * Provide the `DeleteItemHttp` layer on the Function to satisfy the binding.
14 * ### Writing Data
15 * **Example:** Delete an Item by Key
16 * ```typescript
17 * const deleteItem = yield* AWS.DynamoDB.DeleteItem(table);
18 *
19 * yield* deleteItem({
20 * Key: {
21 * pk: { S: "user#123" },
22 * sk: { S: "profile" },
23 * },
24 * });
25 * ```
26 *
27 * @binding
28 */
29 export interface DeleteItem extends Binding.Service<
30 DeleteItem,
31 "AWS.DynamoDB.DeleteItem",
32 <T extends Table>(
33 table: T,
34 ) => Effect.Effect<
35 (
36 request: DeleteItemRequest,
37 ) => Effect.Effect<DynamoDB.DeleteItemOutput, DynamoDB.DeleteItemError>
38 >
39 > {}
40
41 export const DeleteItem = Binding.Service<DeleteItem>("AWS.DynamoDB.DeleteItem");