mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
db: support for polylines
This commit is contained in:
parent
2b55f7148f
commit
911a6d371e
3 changed files with 29 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"journeysEndpoint": "https://int.bahn.de/web/api/angebote/fahrplan",
|
"journeysEndpoint": "https://int.bahn.de/web/api/angebote/fahrplan",
|
||||||
"refreshJourneysEndpoint": "https://int.bahn.de/web/api/angebote/recon",
|
"refreshJourneysEndpointTickets": "https://int.bahn.de/web/api/angebote/recon",
|
||||||
|
"refreshJourneysEndpointPolyline": "https://int.bahn.de/web/api/reiseloesung/verbindung",
|
||||||
"locationsEndpoint": "https://int.bahn.de/web/api/reiseloesung/orte",
|
"locationsEndpoint": "https://int.bahn.de/web/api/reiseloesung/orte",
|
||||||
"nearbyEndpoint": "https://int.bahn.de/web/api/reiseloesung/orte/nearby",
|
"nearbyEndpoint": "https://int.bahn.de/web/api/reiseloesung/orte/nearby",
|
||||||
"tripEndpoint": "https://int.bahn.de/web/api/reiseloesung/fahrt",
|
"tripEndpoint": "https://int.bahn.de/web/api/reiseloesung/fahrt",
|
||||||
|
|
|
@ -44,19 +44,30 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
|
||||||
};
|
};
|
||||||
// TODO poly conditional other endpoint
|
// TODO poly conditional other endpoint
|
||||||
const formatRefreshJourneyReq = (ctx, refreshToken) => {
|
const formatRefreshJourneyReq = (ctx, refreshToken) => {
|
||||||
const {profile} = ctx;
|
const {profile, opt} = ctx;
|
||||||
let query = {
|
if (opt.tickets) {
|
||||||
ctxRecon: refreshToken,
|
let query = {
|
||||||
deutschlandTicketVorhanden: false,
|
ctxRecon: refreshToken,
|
||||||
nurDeutschlandTicketVerbindungen: false,
|
deutschlandTicketVorhanden: false,
|
||||||
reservierungsKontingenteVorhanden: false,
|
nurDeutschlandTicketVerbindungen: false,
|
||||||
};
|
reservierungsKontingenteVorhanden: false,
|
||||||
query = Object.assign(query, profile.formatTravellers(ctx));
|
};
|
||||||
return {
|
query = Object.assign(query, profile.formatTravellers(ctx));
|
||||||
endpoint: profile.refreshJourneysEndpoint,
|
return {
|
||||||
body: query,
|
endpoint: profile.refreshJourneysEndpointTickets,
|
||||||
method: 'post',
|
body: query,
|
||||||
};
|
method: 'post',
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
endpoint: profile.refreshJourneysEndpointPolyline,
|
||||||
|
body: {
|
||||||
|
ctxRecon: refreshToken,
|
||||||
|
poly: true,
|
||||||
|
},
|
||||||
|
method: 'post',
|
||||||
|
};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
This is a very early version. What works:
|
This is a very early version. What works:
|
||||||
|
|
||||||
* `journeys()`, `refreshJourney()` including tickets
|
* `journeys()`, `refreshJourney()` including tickets
|
||||||
* `locations()`, `nearby()`
|
* `locations()`, `nearby()`, `stop()`
|
||||||
* `departures()`, `arrivals()` boards
|
* `departures()`, `arrivals()` boards
|
||||||
* `trip()`
|
* `trip()`
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ Depending on the configured profile, db-vendo-client will use multiple different
|
||||||
| max duration boards | 12h | 1h |
|
| max duration boards | 12h | 1h |
|
||||||
| remarks | not for boards | ✅ (still no `remarks()` endpoint) |
|
| remarks | not for boards | ✅ (still no `remarks()` endpoint) |
|
||||||
| cancelled trips | not contained in boards | contained with cancelled flag |
|
| cancelled trips | not contained in boards | contained with cancelled flag |
|
||||||
| tickets | only for `refreshJourney()` | only for `refreshJourney()`, mutually exclusive with polylines |
|
| tickets | only for `refreshJourney()`, mutually exclusive with polylines | only for `refreshJourney()`, mutually exclusive with polylines |
|
||||||
| polylines | only for `trip()` | only for `refreshJourney()/trip()`, mutually exclusive with tickets |
|
| 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 |
|
| trip ids used | HAFAS trip ids for journeys, RIS trip ids for boards (static on train splits?) | HAFAS trip ids |
|
||||||
| line.id/fahrtNr used | unreliable/route id for journeys/`trip()`, actual fahrtNr for boards | actual fahrtNr for journeys, unreliable/route id for boards and `trip()` |
|
| line.id/fahrtNr used | unreliable/route id for journeys/`trip()`, actual fahrtNr for boards | actual fahrtNr for journeys, unreliable/route id for boards and `trip()` |
|
||||||
| adminCode/operator | adminCode only for boards | only for journeys |
|
| adminCode/operator | adminCode only for boards | only for journeys |
|
||||||
|
|
Loading…
Add table
Reference in a new issue