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

main
ts 44 lines 1.46 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 StartJobRequest extends Omit<amplify.StartJobRequest, "appId"> {}
7
8 /**
9 * Runtime binding for `amplify:StartJob`.
10 *
11 * Bind an {@link App} in the function's init phase to get a callable that
12 * starts a build/deploy job for one of the app's branches — the app id is
13 * injected automatically and `amplify:StartJob` is granted on the app's jobs.
14 * Provide the implementation with `Effect.provide(AWS.Amplify.StartJobHttp)`.
15 *
16 * The canonical use is a webhook Lambda that rebuilds the site when upstream
17 * content changes (a CMS publish, a data refresh, etc.).
18 * ### Starting Jobs
19 * **Example:** Rebuild a Branch on Content Change
20 * ```typescript
21 * // init — bind the operation to the app
22 * const startJob = yield* AWS.Amplify.StartJob(app);
23 *
24 * // runtime — kick off a release of the main branch
25 * const { jobSummary } = yield* startJob({
26 * branchName: "main",
27 * jobType: "RELEASE",
28 * jobReason: "CMS content published",
29 * });
30 * ```
31 *
32 * @binding
33 */
34 export interface StartJob extends Binding.Service<
35 StartJob,
36 "AWS.Amplify.StartJob",
37 (
38 app: App,
39 ) => Effect.Effect<
40 (request: StartJobRequest) => Effect.Effect<amplify.StartJobResult, amplify.StartJobError>
41 >
42 > {}
43
44 export const StartJob = Binding.Service<StartJob>("AWS.Amplify.StartJob");