feat: BSH-Pegelauswahl und Fix für Eintragstag beim Gezeiten-Abruf

Bei fehlgeschlagenem Auto-Abruf nächste BSH-Stationen anbieten; Reisetag
korrekt aus dem Eintrag parsen und Vergangenheitshinweis anzeigen.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 11:16:01 +02:00
parent 7d6c908f65
commit 4f519e34b4
18 changed files with 807 additions and 75 deletions
+35 -1
View File
@@ -1,4 +1,10 @@
import { fetchBshTidesForCoordinates, MAX_BSH_DISTANCE_KM } from './bshTides.js'
import {
fetchBshTidesForCoordinates,
fetchBshTidesForStation,
listNearbyBshStations,
MAX_BSH_DISTANCE_KM,
type BshStationSuggestion
} from './bshTides.js'
import {
fetchTidesForCoordinates as fetchOpenMeteoTidesForCoordinates,
fetchTidesForPlace as fetchOpenMeteoTidesForPlace,
@@ -43,6 +49,34 @@ export async function fetchTidesForCoordinates(
}
}
export async function listNearbyTideStations(
lat: number,
lon: number,
limit = 8
): Promise<BshStationSuggestion[]> {
try {
return await listNearbyBshStations(lat, lon, limit)
} catch {
return []
}
}
export async function fetchTidesForStation(
stationId: string,
options?: { queryLat?: number; queryLon?: number }
): Promise<TideProviderResult> {
try {
return await fetchBshTidesForStation(stationId, options)
} catch (error: unknown) {
const message = error instanceof Error ? error.message : ''
if (message === 'bsh_invalid_station' || message === 'no_tide_data') {
throw error
}
console.warn('BSH station tide lookup failed:', error)
throw new Error('no_tide_data')
}
}
export async function fetchTidesForPlace(query: string): Promise<TideProviderResult> {
const place = await geocodePlace(query)
if (!place) {