@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 38 lines 1.25 KB
Raw
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 /**
7 * Runtime binding for `synthetics:StartCanary` — start the bound
8 * {@link Canary} running on its configured schedule (e.g. trigger an
9 * on-demand smoke test after a deployment); the canary name is injected
10 * automatically.
11 *
12 * Provide `Synthetics.StartCanaryHttp` on the hosting Lambda Function to
13 * satisfy the requirement.
14 * ### Controlling the Canary
15 * **Example:** Start the Canary
16 * ```typescript
17 * // init — grants synthetics:StartCanary on the canary
18 * const startCanary = yield* AWS.Synthetics.StartCanary(canary);
19 *
20 * // runtime — a ConflictException means it is already starting/running
21 * yield* startCanary().pipe(
22 * Effect.catchTag("ConflictException", () => Effect.void),
23 * );
24 * ```
25 *
26 * @binding
27 */
28 export interface StartCanary extends Binding.Service<
29 StartCanary,
30 "AWS.Synthetics.StartCanary",
31 (
32 canary: Canary,
33 ) => Effect.Effect<
34 () => Effect.Effect<synthetics.StartCanaryResponse, synthetics.StartCanaryError>
35 >
36 > {}
37
38 export const StartCanary = Binding.Service<StartCanary>("AWS.Synthetics.StartCanary");