trails/apps/journal/app/lib
Ullrich Schäfer a9c0093877
Add Wahoo push action route + OAuth callback resume
Adds /api/sync/push/:provider/:routeId as the user-triggered entry
point for pushing a route. The route action delegates to a new
pushes.server.ts pipeline that:

- resolves the latest route_versions row and uses that GPX (not
  routes.gpx) so the bytes Wahoo gets match the snapshot the user
  sees
- short-circuits on (user, route, version, provider) idempotency:
  a successful prior push returns the existing remote_id without
  re-calling Wahoo
- detects scope_missing before hitting Wahoo and redirects through
  getAuthUrl with a base64url-encoded state carrying pushAfter +
  returnTo
- refreshes tokens once on PushError({ code: "token_expired" }) and
  retries the push, then updates sync_connections in place
- records every outcome in sync_pushes (insert on first attempt,
  update on retry) so the UI can show success/failure state

The OAuth callback handler now decodes the state, resumes a
pushAfter pipeline server-side after exchangeCode, and handles the
?error=access_denied path with a needs_permission notice.

Also flips packages/fit/src/fitsdk.d.ts to a regular .ts side-effect
shim so journal's tsc picks up the @garmin/fitsdk module declaration
when consuming the workspace package via source.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 22:41:24 +02:00
..
notifications Merge /follows/requests into /notifications as a tabbed inbox 2026-04-26 08:24:59 +02:00
sync Add Wahoo push action route + OAuth callback resume 2026-04-30 22:41:24 +02:00
activities.server.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
actor-iri.ts Implement social-feed: local follows + /feed + profile visibility 2026-04-25 22:51:18 +02:00
api-guard.server.ts Implement Journal REST API v1 endpoints 2026-04-13 00:57:27 +02:00
auth.server.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
boss.server.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
canView.test.ts Apply public-content-visibility: visibility flag + public profile 2026-04-19 09:11:39 +02:00
db.ts Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00
demo-bot.integration.test.ts Apply configurable-demo-persona: per-instance demo identity + voice 2026-04-19 10:30:32 +02:00
demo-bot.server.ts Expand Bruno's content pools for more variety 2026-04-26 21:53:50 +02:00
demo-bot.test.ts Apply configurable-demo-persona: per-instance demo identity + voice 2026-04-19 10:30:32 +02:00
email.server.test.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
email.server.ts Add 6-digit login code for mobile authentication 2026-04-15 20:56:42 +02:00
events.server.ts Implement notifications + supporting fixes 2026-04-26 01:28:55 +02:00
explore.integration.test.ts Include the demo persona on /explore so users can follow it 2026-04-26 11:43:24 +02:00
explore.server.ts Include the demo persona on /explore so users can follow it 2026-04-26 11:43:24 +02:00
follow.integration.test.ts Locked-account profiles: private = stub + Pending follow flow 2026-04-25 23:38:26 +02:00
follow.server.ts Merge /follows/requests into /notifications as a tabbed inbox 2026-04-26 08:24:59 +02:00
jwt.server.ts Implement Planner-Journal handoff (Group 9) 2026-03-24 20:22:58 +00:00
legal.ts Apply public-content-visibility: visibility flag + public profile 2026-04-19 09:11:39 +02:00
logger.server.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
metrics.server.ts Fix prom-client double-registration on prod 2026-04-19 10:44:57 +02:00
notifications.integration.test.ts Cursor-based pagination for /notifications 2026-04-26 01:42:32 +02:00
notifications.server.ts Cursor-based pagination for /notifications 2026-04-26 01:42:32 +02:00
oauth.server.test.ts Implement OAuth2 PKCE auth, discovery, and mobile API client 2026-04-13 00:41:40 +02:00
oauth.server.ts Implement Journal REST API v1 endpoints 2026-04-13 00:57:27 +02:00
operator.ts Add legal pages, ToS acceptance, and alpha banner 2026-04-18 00:08:48 +02:00
routes.server.ts Apply public-content-visibility: visibility flag + public profile 2026-04-19 09:11:39 +02:00
sentry.client.ts Stop Sentry on logout; fix E2E + Dockerfile for merged consolidation 2026-04-18 00:40:36 +02:00