update dbnav endpoints, fix tests

This commit is contained in:
Traines 2025-10-21 17:25:40 +00:00
parent 31ef3ad56a
commit f31f56c00d
10 changed files with 2463 additions and 16 deletions

View file

@ -48,7 +48,7 @@ Notes:
* routing-search returns polylines (!)
## Vendo/Movas Navigator API
https://app.vendo.noncd.db.de/mob/
https://app.vendo.noncd.db.de/mob/ and/or https://app.services-bahn.de/
EPs:
* bahnhofstafel/abfahrt

View file

@ -1,12 +1,12 @@
{
"journeysEndpoint": "https://app.vendo.noncd.db.de/mob/angebote/fahrplan",
"bestpriceEndpoint": "https://app.vendo.noncd.db.de/mob/angebote/tagesbestpreis",
"refreshJourneysEndpointTickets": "https://app.vendo.noncd.db.de/mob/angebote/recon",
"refreshJourneysEndpointPolyline": "https://app.vendo.noncd.db.de/mob/trip/recon",
"locationsEndpoint": "https://app.vendo.noncd.db.de/mob/location/search",
"stopEndpoint": "https://app.vendo.noncd.db.de/mob/location/details/",
"nearbyEndpoint": "https://app.vendo.noncd.db.de/mob/location/nearby",
"tripEndpoint": "https://app.vendo.noncd.db.de/mob/zuglauf/",
"boardEndpoint": "https://app.vendo.noncd.db.de/mob/bahnhofstafel/",
"journeysEndpoint": "https://app.services-bahn.de/mob/angebote/fahrplan",
"bestpriceEndpoint": "https://app.services-bahn.de/mob/angebote/tagesbestpreis",
"refreshJourneysEndpointTickets": "https://app.services-bahn.de/mob/angebote/recon",
"refreshJourneysEndpointPolyline": "https://app.services-bahn.de/mob/trip/recon",
"locationsEndpoint": "https://app.services-bahn.de/mob/location/search",
"stopEndpoint": "https://app.services-bahn.de/mob/location/details/",
"nearbyEndpoint": "https://app.services-bahn.de/mob/location/nearby",
"tripEndpoint": "https://app.services-bahn.de/mob/zuglauf/",
"boardEndpoint": "https://app.services-bahn.de/mob/bahnhofstafel/",
"defaultLanguage": "en"
}

View file

@ -53,6 +53,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
wunsch: {
abgangsLocationId: from.lid,
verkehrsmittel: filters,
alternativeHalteBerechnung: true, // what is this?
zeitWunsch: {
reiseDatum: profile.formatTime(profile, when, true),
zeitPunktArt: outFrwd ? 'ABFAHRT' : 'ANKUNFT',

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "db-vendo-client",
"version": "6.10.2",
"version": "6.10.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "db-vendo-client",
"version": "6.10.2",
"version": "6.10.3",
"license": "ISC",
"dependencies": {
"content-type": "^1.0.5",

View file

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

View file

@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
const minute = 60 * 1000;
const T_MOCK = 1747040400 * 1000; // 2025-05-12T08:00:00+01:00
const T_MOCK = 1764831628 * 1000; // Thu Dec 04 2025 07:00:28 GMT+0000
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
const cfg = {

View file

@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
const minute = 60 * 1000;
const T_MOCK = 1747040400 * 1000; // 2025-05-12T08:00:00+01:00
const T_MOCK = 1764831628 * 1000; // Thu Dec 04 2025 07:00:28 GMT+0000
const when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
const cfg = {

File diff suppressed because one or more lines are too long

View file

@ -17,7 +17,7 @@ const tripIdHafas = '2|#VN#1#ST#1738783727#PI#0#ZI#222242#TA#0#DA#70225#1S#80002
const tripIdRis = '20250207-e6b2807e-bb48-39f9-89eb-8491ebc4b32c';
const reqDbNavExpected = {
endpoint: 'https://app.vendo.noncd.db.de/mob/zuglauf/',
endpoint: 'https://app.services-bahn.de/mob/zuglauf/',
path: '2%7C%23VN%231%23ST%231738783727%23PI%230%23ZI%23222242%23TA%230%23DA%2370225%231S%238000237%231T%231317%23LS%238000261%23LT%232002%23PU%2380%23RT%231%23CA%23ICE%23ZE%231007%23ZB%23ICE%201007%23PC%230%23FR%238000237%23FT%231317%23TO%238000261%23TT%232002%23',
headers: {
'Accept': 'application/x.db.vendo.mob.zuglauf.v2+json',

View file

@ -52,6 +52,7 @@ const berlinWienQuery0 = Object.freeze(
verkehrsmittel: [
'ALL',
],
alternativeHalteBerechnung: true,
zeitWunsch: {
reiseDatum: '2024-12-07T23:50:12+01:00',
zeitPunktArt: 'ABFAHRT',