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

main
ts 36 lines 1.25 KB
Raw
1 import type * as kvs from "@distilled.cloud/aws/cloudfront-keyvaluestore";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { KeyValueStore } from "./KeyValueStore.ts";
5
6 export interface GetKeyRequest extends Omit<kvs.GetKeyRequest, "KvsARN"> {}
7
8 /**
9 * Runtime binding for `cloudfront-keyvaluestore:GetKey`.
10 *
11 * Reads a single key's value from the bound KeyValueStore's data plane.
12 * Values are sensitive — distilled decodes them as `Redacted<string>`;
13 * unwrap with `Redacted.value`. Provide the implementation with
14 * `Effect.provide(AWS.CloudFront.GetKeyHttp)`.
15 * ### Reading KeyValueStore Data
16 * **Example:** Read a Key
17 * ```typescript
18 * // init — bind the operation to the store
19 * const getKey = yield* CloudFront.GetKey(store);
20 *
21 * // runtime
22 * const res = yield* getKey({ Key: "routes:/about" });
23 * const value = typeof res.Value === "string" ? res.Value : Redacted.value(res.Value);
24 * ```
25 *
26 * @binding
27 */
28 export interface GetKey extends Binding.Service<
29 GetKey,
30 "AWS.CloudFront.GetKey",
31 (
32 store: KeyValueStore,
33 ) => Effect.Effect<(request: GetKeyRequest) => Effect.Effect<kvs.GetKeyResponse, kvs.GetKeyError>>
34 > {}
35
36 export const GetKey = Binding.Service<GetKey>("AWS.CloudFront.GetKey");