rename privacy "private" → "unlisted"; enable GPS for unlisted

- "unlisted" = not shown in the public feed, but GPS track, timeseries
  and detail JSON are all accessible by direct URL (security by obscurity)
- "private" accepted as legacy alias everywhere (backward compat with
  existing data on disk)
- New writes from Strava sync / ZIP upload / sidecar use "unlisted"
- Only "no_gps" now suppresses the GPS track
- isUnlisted() helper in format.ts used by all Svelte/Astro components
- SCHEMA.md and CLAUDE.md document the privacy model and the distinction
  between "unlisted" and "no_gps"
This commit is contained in:
Davide Scaini
2026-04-13 18:49:20 +02:00
parent 2ebfc7046d
commit 5ad3aee8f6
23 changed files with 489 additions and 38 deletions
+7 -1
View File
@@ -1,4 +1,10 @@
import type { Sport } from './types';
import type { Privacy, Sport } from './types';
/** True for "unlisted" activities (and the legacy "private" alias).
* Use this everywhere instead of comparing against 'private' directly. */
export function isUnlisted(privacy: Privacy | string | null | undefined): boolean {
return privacy === 'unlisted' || privacy === 'private';
}
export function formatDistance(m: number | null, unit: 'metric' | 'imperial' = 'metric'): string {
if (m == null) return '—';
+3 -1
View File
@@ -2,7 +2,9 @@
export type Sport = "cycling" | "running" | "hiking" | "walking" | "swimming" | "skiing" | "other";
export type SubSport = "road" | "mountain" | "gravel" | "indoor" | "trail" | "track" | "nordic" | "alpine" | "open_water" | "pool" | null;
export type Privacy = "public" | "blur_start" | "no_gps" | "private";
/** "unlisted" = not shown in the public feed; GPS track still published (security by obscurity).
* "private" is the legacy alias for "unlisted" — accepted when reading old data. */
export type Privacy = "public" | "blur_start" | "no_gps" | "unlisted" | "private";
/** [duration_s, avg_watts] pairs, sorted by duration ascending. */
export type MmpCurve = [number, number][];