(input: CreateCronInput)
| 312 | } |
| 313 | |
| 314 | export async function createCron(input: CreateCronInput): Promise<CreateCronResult> { |
| 315 | const jobInput: CreateScheduledJobInput = { |
| 316 | project_slug: input.project_slug, |
| 317 | agent_id: input.agent_full_id, |
| 318 | name: input.cron_name, |
| 319 | cron_expr: input.schedule.expr, |
| 320 | message: input.message, |
| 321 | enabled: true, |
| 322 | }; |
| 323 | const job = createScheduledJob(jobInput); |
| 324 | return { |
| 325 | id: job.id, |
| 326 | name: `${input.project_slug}/${input.agent_slug}/${input.cron_name}`, |
| 327 | }; |
| 328 | } |
| 329 | |
| 330 | /** Bucket occurrences into day-aligned arrays starting at `startOfFirstDay`. */ |
| 331 | export function groupOccurrencesByDay( |
no test coverage detected