Fitness Refresh
Refresh every Garmin and Zwift data source in one ordered run, so a downstream consumer always reads a complete, current local day.
WHAT IT DOES
Garmin and Zwift each publish on their own schedules, so a consumer that runs in between sees a half-populated day. This extension is the single ordered entry point that runs them all, in the one order that matters: it derives the Garmin device capability map first, because a health sync run without it silently drops the device-gated metrics — sleep, stress, body battery and the sleep score — then syncs wellness and weight/body composition for the last few local days through today, the day's activities, your Zwift ride history, and the ranked event calendar. Running hourly, a weigh-in recorded during the day reaches the diary the same day. Every step is idempotent, so it is safe to re-run. It is read-only with respect to your diary: it only writes data, and anything you run afterwards reads it.
INSTALL
swamp extension pull @svendowideit/fitness-refreshDEPENDENCIES
@svendowideit/garmin and @svendowideit/zwift, pulled automatically by the
single install above. This extension ships only a workflow that invokes
their sync workflows; it declares no models of its own. Garmin credentials
live in the garmin-secrets vault and Zwift credentials in zwift-secrets,
exactly as those extensions document.
RUN
# Sync everything for the local day, in order. Idempotent — run it as
# often as you like; each step re-establishes its own auth session.
swamp workflow run @svendowideit/fitness-refresh
# A different timezone than the author's, so "today" and the ride/event
# bucketing match where you are.
swamp workflow run @svendowideit/fitness-refresh \
--input timezone=Europe/London
# Widen the wellness window when you have been away (capped at 14 days).
swamp workflow run @svendowideit/fitness-refresh --input healthDays=7CONFIGURE
timezone (default Australia/Brisbane) defines "today" for the syncs and
buckets ride and event times; set your own. healthDays (default 3) is the
local wellness window through today (capped at 14). bodyDays (default 3)
is the local weight/body-composition window through today (capped at 14).
forceRefresh (default true) makes the Garmin syncs re-read Garmin rather
than serve the day's first cached list — without it a repeat run misses a
ride finished since the morning. The remaining inputs are instance names —
sessionName, devicesName, healthName, activitiesName, bodyName,
riderName, eventsName, recommenderName — for when you renamed a model.
Schedule a custom time with the trigger: it fires hourly at :30 while
swamp serve runs.
UPGRADE
fitness-refresh installs nothing on the host, so there is no in-place rebuild to run. Upgrade by updating the extension; the new workflow simply takes effect on the next scheduled pass, and because every step is idempotent it re-runs each source cleanly.
swamp extension update @svendowideit/fitness-refreshWHAT IT INSTALLS
Nothing on the host. It writes swamp data through the Garmin and Zwift
models it calls. One cron trigger is registered while swamp serve runs:
30 * * * * (hourly at :30, host-local) — timed a quarter-hour before the
diary's own :45 refresh so a consumer always reads a freshly synced day.
Remove or disable the trigger if you prefer to invoke it by hand.
Refresh every Garmin and Zwift data source in one run, so a downstream consumer (the diary) reads a complete, current local day. Garmin and Zwift each expose their data through several workflows on their own schedules, and a consumer that runs between them sees a half-populated day. This workflow is the single ordered entry point that runs them all for the local calendar day: 1. garmin-devices-sync derive the device capability map — without it the health sync sil
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License1/2partial
no SPDX license declared
- Verified public repository2/2earned