@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, 06:00 UTC

main
ts 40 lines 1.27 KB
Raw
1 import type * as amplify from "@distilled.cloud/aws/amplify";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { App } from "./App.ts";
5
6 export interface GetJobRequest extends Omit<amplify.GetJobRequest, "appId"> {}
7
8 /**
9 * Runtime binding for `amplify:GetJob`.
10 *
11 * Bind an {@link App} in the function's init phase to get a callable that
12 * reads a build job — its summary and per-step logs/status — for one of the
13 * app's branches. Provide the implementation with
14 * `Effect.provide(AWS.Amplify.GetJobHttp)`.
15 * ### Observing Jobs
16 * **Example:** Poll a Job Until It Settles
17 * ```typescript
18 * // init — bind the operation to the app
19 * const getJob = yield* AWS.Amplify.GetJob(app);
20 *
21 * // runtime — read the job's current status
22 * const { job } = yield* getJob({ branchName: "main", jobId: "42" });
23 * if (job.summary.status === "FAILED") {
24 * yield* Effect.log(`build failed: ${job.summary.jobId}`);
25 * }
26 * ```
27 *
28 * @binding
29 */
30 export interface GetJob extends Binding.Service<
31 GetJob,
32 "AWS.Amplify.GetJob",
33 (
34 app: App,
35 ) => Effect.Effect<
36 (request: GetJobRequest) => Effect.Effect<amplify.GetJobResult, amplify.GetJobError>
37 >
38 > {}
39
40 export const GetJob = Binding.Service<GetJob>("AWS.Amplify.GetJob");