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

main
ts 44 lines 1.54 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 UpdateKeysRequest extends Omit<kvs.UpdateKeysRequest, "KvsARN"> {}
7
8 /**
9 * Runtime binding for `cloudfront-keyvaluestore:UpdateKeys`.
10 *
11 * Puts and/or deletes multiple keys in the bound KeyValueStore's data plane
12 * as a single all-or-nothing batch. Writes use optimistic concurrency: pass
13 * the store's current `ETag` as `IfMatch` (from
14 * {@link DescribeKeyValueStore} or a previous write's response). Provide the
15 * implementation with `Effect.provide(AWS.CloudFront.UpdateKeysHttp)`.
16 * ### Writing KeyValueStore Data
17 * **Example:** Batch Put + Delete
18 * ```typescript
19 * // init — bind the operations to the store
20 * const describeStore = yield* CloudFront.DescribeKeyValueStore(store);
21 * const updateKeys = yield* CloudFront.UpdateKeys(store);
22 *
23 * // runtime
24 * const meta = yield* describeStore({});
25 * yield* updateKeys({
26 * IfMatch: meta.ETag,
27 * Puts: [{ Key: "routes:/", Value: "/index.html" }],
28 * Deletes: [{ Key: "routes:/legacy" }],
29 * });
30 * ```
31 *
32 * @binding
33 */
34 export interface UpdateKeys extends Binding.Service<
35 UpdateKeys,
36 "AWS.CloudFront.UpdateKeys",
37 (
38 store: KeyValueStore,
39 ) => Effect.Effect<
40 (request: UpdateKeysRequest) => Effect.Effect<kvs.UpdateKeysResponse, kvs.UpdateKeysError>
41 >
42 > {}
43
44 export const UpdateKeys = Binding.Service<UpdateKeys>("AWS.CloudFront.UpdateKeys");