feat(FN-1524): add POST /routines/:id/trigger endpoint

- Add POST /routines/:id/trigger as canonical endpoint for manual routine triggers
- Keep POST /routines/:id/run as backward-compatible alias with identical behavior
- Remove duplicate recordRun calls from routine route handlers (persistence handled by RoutineRunner.completeRoutineExecution)
- Update webhook auth to return 401 instead of 403 for missing/invalid signature headers
- Add comprehensive tests for /trigger endpoint and double-persist fix
This commit is contained in:
gsxdsm
2026-04-14 09:39:06 -07:00
parent 4f23883bac
commit 9ce75b227f
3 changed files with 159 additions and 21 deletions

View File

@@ -1783,7 +1783,7 @@ export async function deleteRoutine(id: string): Promise<void> {
}
export function runRoutine(id: string): Promise<RoutineRunResponse> {
return api<RoutineRunResponse>(`/routines/${id}/run`, {
return api<RoutineRunResponse>(`/routines/${id}/trigger`, {
method: "POST",
});
}