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
| 1 | import type * as glue from "@distilled.cloud/aws/glue"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Job } from "./Job.ts"; |
| 5 | |
| 6 | export interface StartJobRunRequest extends Omit<glue.StartJobRunRequest, "JobName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Starts a run of a Glue job definition. |
| 10 | * |
| 11 | * Grants `glue:StartJobRun` and `glue:GetJobRun` on the bound job. Returns the |
| 12 | * `JobRunId`; poll `getJobRun` for the run's terminal state (`SUCCEEDED`, |
| 13 | * `FAILED`, `TIMEOUT`, …). |
| 14 | * ### Running Jobs |
| 15 | * Provide the `StartJobRunHttp` implementation layer on the Function effect |
| 16 | * (`.pipe(Effect.provide(AWS.Glue.StartJobRunHttp))`), bind the job in the |
| 17 | * init phase, then start runs at runtime. |
| 18 | * |
| 19 | * **Example:** Start a job run from a handler |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const startJobRun = yield* AWS.Glue.StartJobRun(job); |
| 23 | * |
| 24 | * return { |
| 25 | * fetch: Effect.gen(function* () { |
| 26 | * // runtime |
| 27 | * const { JobRunId } = yield* startJobRun({ |
| 28 | * Arguments: { "--input": "s3://my-bucket/input/" }, |
| 29 | * }); |
| 30 | * return HttpServerResponse.json({ JobRunId }); |
| 31 | * }), |
| 32 | * }; |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface StartJobRun extends Binding.Service< |
| 38 | StartJobRun, |
| 39 | "AWS.Glue.StartJobRun", |
| 40 | ( |
| 41 | job: Job, |
| 42 | ) => Effect.Effect< |
| 43 | (request?: StartJobRunRequest) => Effect.Effect<glue.StartJobRunResponse, glue.StartJobRunError> |
| 44 | > |
| 45 | > {} |
| 46 | |
| 47 | export const StartJobRun = Binding.Service<StartJobRun>("AWS.Glue.StartJobRun"); |