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 synthetics from "@distilled.cloud/aws/synthetics"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Canary } from "./Canary.ts"; |
| 5 | |
| 6 | export interface GetCanaryRunsRequest extends Omit<synthetics.GetCanaryRunsRequest, "Name"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `synthetics:GetCanaryRuns` — list the run results |
| 10 | * (status, timeline, artifact location) of the bound {@link Canary}; the |
| 11 | * canary name is injected automatically. |
| 12 | * |
| 13 | * Provide `Synthetics.GetCanaryRunsHttp` on the hosting Lambda Function to |
| 14 | * satisfy the requirement. |
| 15 | * ### Reading Canary Runs |
| 16 | * **Example:** List Recent Runs |
| 17 | * ```typescript |
| 18 | * // init — grants synthetics:GetCanaryRuns on the canary |
| 19 | * const getCanaryRuns = yield* AWS.Synthetics.GetCanaryRuns(canary); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { CanaryRuns } = yield* getCanaryRuns({ MaxResults: 10 }); |
| 23 | * const failed = CanaryRuns?.filter((run) => run.Status?.State === "FAILED"); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetCanaryRuns extends Binding.Service< |
| 29 | GetCanaryRuns, |
| 30 | "AWS.Synthetics.GetCanaryRuns", |
| 31 | ( |
| 32 | canary: Canary, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetCanaryRunsRequest, |
| 36 | ) => Effect.Effect<synthetics.GetCanaryRunsResponse, synthetics.GetCanaryRunsError> |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const GetCanaryRuns = Binding.Service<GetCanaryRuns>("AWS.Synthetics.GetCanaryRuns"); |