version bump, docs

This commit is contained in:
Traines 2025-01-20 20:30:58 +00:00
parent 76d6121f88
commit ff559c83dd
5 changed files with 15 additions and 9 deletions

View file

@ -69,6 +69,7 @@ Notes:
* does not contain machine-readable cancelled info in the boards (only "Halt entfällt" string), but contains relevant remarks
* loadFactor only on journeys (?)
* polylines only for zuglauf and trip/recon
* limited remarks on boards
## Vendo/Movas bahn.de API
https://int.bahn.de/web/api/

View file

@ -1,6 +1,8 @@
# `db-vendo-client` documentation
**[API documentation](api.md)**
**[JS API documentation](api.md)**
[REST API OpenAPI schema](openapi.yaml) ([open in Swagger Editor](https://editor.swagger.io/?url=https://raw.githubusercontent.com/public-transport/db-vendo-client/refs/heads/main/docs/openapi.yaml))
## Migrating from an old (v5) `hafas-client` version

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "db-vendo-client",
"version": "6.3.3",
"version": "6.3.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "db-vendo-client",
"version": "6.3.3",
"version": "6.3.4",
"license": "ISC",
"dependencies": {
"@derhuerst/round-robin-scheduler": "^1.0.4",

View file

@ -1,7 +1,7 @@
{
"name": "db-vendo-client",
"description": "Client for bahn.de public transport APIs.",
"version": "6.3.3",
"version": "6.3.4",
"type": "module",
"main": "index.js",
"files": [

View file

@ -1,6 +1,6 @@
# db-vendo-client
**A client for the new "vendo"/"movas" bahn.de APIs, a drop-in replacement for [hafas-client](https://github.com/public-transport/hafas-client/).**
**A client for the new "vendo"/"movas" Deutsche Bahn APIs, a drop-in replacement for [hafas-client](https://github.com/public-transport/hafas-client/).**
![ISC-licensed](https://img.shields.io/github/license/public-transport/db-vendo-client.svg)
[![support Jannis via GitHub Sponsors](https://img.shields.io/badge/support%20Jannis-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
@ -26,8 +26,8 @@ Depending on the configured profile, db-vendo-client will use multiple different
| ------------- | ------------- | ------------- |
| no API key required | ✅ | ✅ |
| max duration boards | 12h | 1h |
| remarks | not for boards | (still no `remarks()` endpoint) |
| cancelled trips | not contained in boards | contained with cancelled flag |
| remarks | not for boards | only limited remarks for boards (still no `remarks()` endpoint) |
| cancelled trips | contained with cancelled flag in journeys, not contained in boards | contained with cancelled flag |
| tickets | only for `refreshJourney()`, mutually exclusive with polylines | only for `refreshJourney()`, mutually exclusive with polylines |
| polylines | only for `refreshJourney()` (mutually exclusive with tickets) and for `trip()` (only for HAFAS trip ids) | only for `refreshJourney()/trip()`, mutually exclusive with tickets |
| trip ids used | HAFAS trip ids for journeys, RIS trip ids for boards (static on train splits?) | HAFAS trip ids |
@ -42,7 +42,7 @@ Also consult the **[documentation](docs/readme.md)**.
## Background
After DB has switched to the new "vendo"/"movas" platform for bahn.de and DB Navigator, the old [HAFAS](https://de.wikipedia.org/wiki/HAFAS) API (see [hafas-client](https://github.com/public-transport/hafas-client/)) seems to become less and less reliable (server unreachable, missing prices, etc.) This project aims to enable easy switching to the new APIs. However, not all information will be available from the new APIs.
After DB has switched to the new "vendo"/"movas" platform for bahn.de and DB Navigator, the old [HAFAS](https://de.wikipedia.org/wiki/HAFAS) API (see [hafas-client](https://github.com/public-transport/hafas-client/)) seems now to have been shut off. This project aims to enable easy switching to the new APIs. However, not all information will be available from the new APIs.
Actually, db-vendo-client is a wrapper around multiple different APIs, currently the bahn.de API for route planning and the regio-guide RIS API for boards for the `db` profile and the DB Navigator API for the `dbnav` profile. See some [notes about the various new APIs at DB](docs/db-apis.md).
@ -67,10 +67,13 @@ docker run \
```
You may want to generate a client for your programming language for this REST API using the [OpenAPI schema](docs/openapi.yaml) ([open in Swagger Editor](https://editor.swagger.io/?url=https://raw.githubusercontent.com/public-transport/db-vendo-client/refs/heads/main/docs/openapi.yaml)). Note
that this to be seen more as a starting point for implementation, e.g. some profile-specific details like tickets are missing from this API definition.
that this is to be seen more as a starting point for implementation, e.g. some profile-specific details like tickets are missing from this API definition.
There are [community-maintained TypeScript typings available as `@types/hafas-client`](https://www.npmjs.com/package/@types/hafas-client).
> [!IMPORTANT]
> Depending on your use case, it is very important that you employ caching, either with a simple [HTTP proxy cache](https://github.com/traines-source/time-space-train-planner/blob/master/deployments/nginx-cache.conf) in front of the REST API or by using [cached-hafas-client](https://github.com/public-transport/cached-hafas-client) (where, of course, you can just drop in a `db-vendo-client` instead of a `hafas-client` instance). Also see [db-rest](https://github.com/derhuerst/db-rest), which does this and some more plumbing.
## Related Projects
- [hafas-client](https://github.com/public-transport/hafas-client/) including further related projects