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 scheduler from "@distilled.cloud/aws/scheduler"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { ScheduleGroup } from "./ScheduleGroup.ts"; |
| 5 | |
| 6 | export interface GetScheduleRequest extends Omit<scheduler.GetScheduleInput, "GroupName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `scheduler:GetSchedule`. |
| 10 | * |
| 11 | * Pairs with {@link CreateSchedule} for the dynamic-scheduling pattern: a |
| 12 | * deployed Lambda inspects schedules it minted at runtime (is the reminder |
| 13 | * still pending?). Optionally scoped to a `ScheduleGroup`; without one it |
| 14 | * covers the default group. |
| 15 | * ### Reading Schedules At Runtime |
| 16 | * **Example:** Check A Pending Reminder |
| 17 | * ```typescript |
| 18 | * const getSchedule = yield* AWS.Scheduler.GetSchedule(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const schedule = yield* getSchedule({ Name: `reminder-${userId}` }); |
| 22 | * console.log(schedule.State, schedule.ScheduleExpression); |
| 23 | * ``` |
| 24 | * |
| 25 | * **Example:** Scope Reads To A Schedule Group |
| 26 | * ```typescript |
| 27 | * const getSchedule = yield* AWS.Scheduler.GetSchedule(group); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface GetSchedule extends Binding.Service< |
| 33 | GetSchedule, |
| 34 | "AWS.Scheduler.GetSchedule", |
| 35 | ( |
| 36 | group?: ScheduleGroup, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: GetScheduleRequest, |
| 40 | ) => Effect.Effect<scheduler.GetScheduleOutput, scheduler.GetScheduleError> |
| 41 | > |
| 42 | > {} |
| 43 | export const GetSchedule = Binding.Service<GetSchedule>("AWS.Scheduler.GetSchedule"); |