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

main
ts 47 lines 1.54 KB
Raw
1 import type * as b2bi from "@distilled.cloud/aws/b2bi";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Transformer } from "./Transformer.ts";
5
6 export interface GetTransformerJobRequest extends Omit<
7 b2bi.GetTransformerJobRequest,
8 "transformerId"
9 > {}
10
11 /**
12 * Runtime binding for `b2bi:GetTransformerJob`.
13 *
14 * Polls the status of an asynchronous transformer job started with
15 * {@link StartTransformerJob} — `status` progresses from `running` to
16 * `succeeded` (with `outputFiles`) or `failed` (with `message`). Provide the
17 * implementation with `Effect.provide(AWS.B2BI.GetTransformerJobHttp)`.
18 * ### Running Transformer Jobs
19 * **Example:** Poll a Transformer Job Until It Finishes
20 * ```typescript
21 * // init — grants b2bi:GetTransformerJob on the transformer
22 * const getTransformerJob = yield* AWS.B2BI.GetTransformerJob(transformer);
23 *
24 * // runtime
25 * const job = yield* getTransformerJob({ transformerJobId }).pipe(
26 * Effect.repeat({
27 * schedule: Schedule.spaced("2 seconds"),
28 * until: (job) => job.status !== "running",
29 * times: 30,
30 * }),
31 * );
32 * ```
33 *
34 * @binding
35 */
36 export interface GetTransformerJob extends Binding.Service<
37 GetTransformerJob,
38 "AWS.B2BI.GetTransformerJob",
39 (
40 transformer: Transformer,
41 ) => Effect.Effect<
42 (
43 request: GetTransformerJobRequest,
44 ) => Effect.Effect<b2bi.GetTransformerJobResponse, b2bi.GetTransformerJobError>
45 >
46 > {}
47 export const GetTransformerJob = Binding.Service<GetTransformerJob>("AWS.B2BI.GetTransformerJob");