@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 38 lines 1.35 KB
Raw
1 import type * as transfer from "@distilled.cloud/aws/transfer";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { User } from "./User.ts";
5
6 /**
7 * Runtime binding for `transfer:DescribeUser`.
8 *
9 * Reads the bound {@link User}'s live configuration — home directory, role,
10 * POSIX profile, and the SSH public keys currently registered (including
11 * their `SshPublicKeyId`s, which {@link DeleteSshPublicKey} needs). The
12 * `ServerId` and `UserName` are injected from the binding. Provide the
13 * implementation with `Effect.provide(AWS.Transfer.DescribeUserHttp)`.
14 * ### Managing Users at Runtime
15 * **Example:** Read the User's SSH Keys
16 * ```typescript
17 * // init — bind the operation to the user
18 * const describeUser = yield* AWS.Transfer.DescribeUser(user);
19 *
20 * // runtime
21 * const { User } = yield* describeUser();
22 * const keyIds = (User.SshPublicKeys ?? []).map((k) => k.SshPublicKeyId);
23 * ```
24 *
25 * @binding
26 */
27 export interface DescribeUser extends Binding.Service<
28 DescribeUser,
29 "AWS.Transfer.DescribeUser",
30 (
31 user: User,
32 ) => Effect.Effect<
33 (
34 request?: Omit<transfer.DescribeUserRequest, "ServerId" | "UserName">,
35 ) => Effect.Effect<transfer.DescribeUserResponse, transfer.DescribeUserError>
36 >
37 > {}
38 export const DescribeUser = Binding.Service<DescribeUser>("AWS.Transfer.DescribeUser");