mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-10-22 20:56:32 +03:00
update dbnav endpoints, fix tests
This commit is contained in:
parent
31ef3ad56a
commit
f31f56c00d
10 changed files with 2463 additions and 16 deletions
|
@ -48,7 +48,7 @@ Notes:
|
||||||
* routing-search returns polylines (!)
|
* routing-search returns polylines (!)
|
||||||
|
|
||||||
## Vendo/Movas Navigator API
|
## 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:
|
EPs:
|
||||||
* bahnhofstafel/abfahrt
|
* bahnhofstafel/abfahrt
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"journeysEndpoint": "https://app.vendo.noncd.db.de/mob/angebote/fahrplan",
|
"journeysEndpoint": "https://app.services-bahn.de/mob/angebote/fahrplan",
|
||||||
"bestpriceEndpoint": "https://app.vendo.noncd.db.de/mob/angebote/tagesbestpreis",
|
"bestpriceEndpoint": "https://app.services-bahn.de/mob/angebote/tagesbestpreis",
|
||||||
"refreshJourneysEndpointTickets": "https://app.vendo.noncd.db.de/mob/angebote/recon",
|
"refreshJourneysEndpointTickets": "https://app.services-bahn.de/mob/angebote/recon",
|
||||||
"refreshJourneysEndpointPolyline": "https://app.vendo.noncd.db.de/mob/trip/recon",
|
"refreshJourneysEndpointPolyline": "https://app.services-bahn.de/mob/trip/recon",
|
||||||
"locationsEndpoint": "https://app.vendo.noncd.db.de/mob/location/search",
|
"locationsEndpoint": "https://app.services-bahn.de/mob/location/search",
|
||||||
"stopEndpoint": "https://app.vendo.noncd.db.de/mob/location/details/",
|
"stopEndpoint": "https://app.services-bahn.de/mob/location/details/",
|
||||||
"nearbyEndpoint": "https://app.vendo.noncd.db.de/mob/location/nearby",
|
"nearbyEndpoint": "https://app.services-bahn.de/mob/location/nearby",
|
||||||
"tripEndpoint": "https://app.vendo.noncd.db.de/mob/zuglauf/",
|
"tripEndpoint": "https://app.services-bahn.de/mob/zuglauf/",
|
||||||
"boardEndpoint": "https://app.vendo.noncd.db.de/mob/bahnhofstafel/",
|
"boardEndpoint": "https://app.services-bahn.de/mob/bahnhofstafel/",
|
||||||
"defaultLanguage": "en"
|
"defaultLanguage": "en"
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
|
||||||
wunsch: {
|
wunsch: {
|
||||||
abgangsLocationId: from.lid,
|
abgangsLocationId: from.lid,
|
||||||
verkehrsmittel: filters,
|
verkehrsmittel: filters,
|
||||||
|
alternativeHalteBerechnung: true, // what is this?
|
||||||
zeitWunsch: {
|
zeitWunsch: {
|
||||||
reiseDatum: profile.formatTime(profile, when, true),
|
reiseDatum: profile.formatTime(profile, when, true),
|
||||||
zeitPunktArt: outFrwd ? 'ABFAHRT' : 'ANKUNFT',
|
zeitPunktArt: outFrwd ? 'ABFAHRT' : 'ANKUNFT',
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "db-vendo-client",
|
"name": "db-vendo-client",
|
||||||
"version": "6.10.2",
|
"version": "6.10.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "db-vendo-client",
|
"name": "db-vendo-client",
|
||||||
"version": "6.10.2",
|
"version": "6.10.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"content-type": "^1.0.5",
|
"content-type": "^1.0.5",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "db-vendo-client",
|
"name": "db-vendo-client",
|
||||||
"description": "Client for bahn.de public transport APIs.",
|
"description": "Client for bahn.de public transport APIs.",
|
||||||
"version": "6.10.2",
|
"version": "6.10.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
|
||||||
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
|
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
|
||||||
const minute = 60 * 1000;
|
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 when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
|
||||||
|
|
||||||
const cfg = {
|
const cfg = {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {testJourneysWithDetour} from './lib/journeys-with-detour.js';
|
||||||
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
|
const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o);
|
||||||
const minute = 60 * 1000;
|
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 when = createWhen(dbProfile.timezone, dbProfile.locale, T_MOCK);
|
||||||
|
|
||||||
const cfg = {
|
const cfg = {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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 tripIdRis = '20250207-e6b2807e-bb48-39f9-89eb-8491ebc4b32c';
|
||||||
|
|
||||||
const reqDbNavExpected = {
|
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',
|
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: {
|
headers: {
|
||||||
'Accept': 'application/x.db.vendo.mob.zuglauf.v2+json',
|
'Accept': 'application/x.db.vendo.mob.zuglauf.v2+json',
|
||||||
|
|
|
@ -52,6 +52,7 @@ const berlinWienQuery0 = Object.freeze(
|
||||||
verkehrsmittel: [
|
verkehrsmittel: [
|
||||||
'ALL',
|
'ALL',
|
||||||
],
|
],
|
||||||
|
alternativeHalteBerechnung: true,
|
||||||
zeitWunsch: {
|
zeitWunsch: {
|
||||||
reiseDatum: '2024-12-07T23:50:12+01:00',
|
reiseDatum: '2024-12-07T23:50:12+01:00',
|
||||||
zeitPunktArt: 'ABFAHRT',
|
zeitPunktArt: 'ABFAHRT',
|
||||||
|
|
Loading…
Add table
Reference in a new issue