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

main
ts 35 lines 1.25 KB
Raw
1 import type * as appsync from "@distilled.cloud/aws/appsync";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { GraphqlApi } from "./GraphqlApi.ts";
5
6 /**
7 * Runtime binding for `appsync:FlushApiCache` — flush a {@link GraphqlApi}'s
8 * server-side cache from a Lambda (or other AWS runtime), e.g. after
9 * writing to the underlying data store out of band.
10 *
11 * Fails with the typed `NotFoundException` when the API has no cache
12 * provisioned. Provide `AppSync.FlushApiCacheHttp` on the hosting
13 * function's Effect to implement the binding.
14 *
15 * ### Flushing the API Cache
16 * **Example:** Invalidate cached resolver results after an out-of-band write
17 * ```typescript
18 * const flushCache = yield* AppSync.FlushApiCache(api);
19 *
20 * yield* flushCache().pipe(
21 * // no cache provisioned — nothing to flush
22 * Effect.catchTag("NotFoundException", () => Effect.void),
23 * );
24 * ```
25 *
26 * @binding
27 */
28 export interface FlushApiCache extends Binding.Service<
29 FlushApiCache,
30 "AWS.AppSync.FlushApiCache",
31 (
32 api: GraphqlApi,
33 ) => Effect.Effect<() => Effect.Effect<appsync.FlushApiCacheResponse, appsync.FlushApiCacheError>>
34 > {}
35 export const FlushApiCache = Binding.Service<FlushApiCache>("AWS.AppSync.FlushApiCache");