mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
* parse bahn.de boards * add optional chaining in line.js * unit tests for bahn.de boards * fix product check in line.js for bahn.de boards * add integration tests for bahn.de boards * allow letting hafas decide the amount of vias * split dbweb and dbregioguide profiles; add db profile * commit location-filter.js (forgot that in the last commit) * simplify how db profile works * remove `ezGleis` from coalesce for scheduled platform * un-break parsing of remarks * determine fahrtNr by removing all non-digits * employ enrichStations for board stop property * prevent timeouts in dbweb e2e test from calling `end()` twice * use promises in dbweb e2e tests when waiting for enrichStations to work * replace vias option with stopovers option for dbweb profile; enrich stations when only name is known * change dbweb-departures test covering enrichStation feature for stop and stopovers * remove check for not existing option * move verkehrsmittel.name in front of verkehrsmittel.langText when parsing name in line.js
474 lines
11 KiB
JavaScript
474 lines
11 KiB
JavaScript
const dbwebTrip = {
|
|
trip: {
|
|
id: 'foo',
|
|
origin: {
|
|
type: 'station',
|
|
id: '8004168',
|
|
name: 'München Flughafen Terminal',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004168',
|
|
latitude: 48.353732,
|
|
longitude: 11.785973,
|
|
},
|
|
},
|
|
destination: {
|
|
type: 'station',
|
|
id: '8000284',
|
|
name: 'Nürnberg Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000284',
|
|
latitude: 49.445615,
|
|
longitude: 11.082989,
|
|
},
|
|
},
|
|
departure: '2025-01-17T15:16:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:16:00+01:00',
|
|
departureDelay: null,
|
|
arrival: '2025-01-17T17:49:00+01:00',
|
|
plannedArrival: '2025-01-17T17:49:00+01:00',
|
|
arrivalDelay: null,
|
|
line: {
|
|
type: 'line',
|
|
id: 'ag-84100',
|
|
fahrtNr: '84100',
|
|
name: 'ag 84100',
|
|
productName: undefined,
|
|
product: undefined,
|
|
mode: undefined,
|
|
public: true,
|
|
operator: null,
|
|
},
|
|
direction: null,
|
|
arrivalPlatform: '13',
|
|
plannedArrivalPlatform: '13',
|
|
departurePlatform: '1',
|
|
plannedDeparturePlatform: '1',
|
|
stopovers: [
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004168',
|
|
name: 'München Flughafen Terminal',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004168',
|
|
latitude: 48.353732,
|
|
longitude: 11.785973,
|
|
},
|
|
},
|
|
arrival: null,
|
|
plannedArrival: null,
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '1',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '1',
|
|
departure: '2025-01-17T15:16:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:16:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '1',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '1',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004167',
|
|
name: 'München Flughafen Besucherpark',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004167',
|
|
latitude: 48.352095,
|
|
longitude: 11.764183,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T15:18:00+01:00',
|
|
plannedArrival: '2025-01-17T15:18:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '1',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '1',
|
|
departure: '2025-01-17T15:18:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:18:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '1',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '1',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8002078',
|
|
name: 'Freising',
|
|
location: {
|
|
type: 'location',
|
|
id: '8002078',
|
|
latitude: 48.395199,
|
|
longitude: 11.744542,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T15:28:00+01:00',
|
|
plannedArrival: '2025-01-17T15:28:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '4',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '4',
|
|
departure: '2025-01-17T15:29:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:29:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '4',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '4',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004084',
|
|
name: 'Moosburg',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004084',
|
|
latitude: 48.470331,
|
|
longitude: 11.930385,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T15:37:00+01:00',
|
|
plannedArrival: '2025-01-17T15:37:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '1',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '1',
|
|
departure: '2025-01-17T15:38:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:38:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '1',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '1',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8000217',
|
|
name: 'Landshut(Bay)Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000217',
|
|
latitude: 48.547494,
|
|
longitude: 12.135932,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T15:50:00+01:00',
|
|
plannedArrival: '2025-01-17T15:50:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '5',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '5',
|
|
departure: '2025-01-17T15:53:00+01:00',
|
|
plannedDeparture: '2025-01-17T15:53:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '5',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '5',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8001835',
|
|
name: 'Ergoldsbach',
|
|
location: {
|
|
type: 'location',
|
|
id: '8001835',
|
|
latitude: 48.693865,
|
|
longitude: 12.201877,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:05:00+01:00',
|
|
plannedArrival: '2025-01-17T16:05:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '1',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '1',
|
|
departure: '2025-01-17T16:06:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:06:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '1',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '1',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8000688',
|
|
name: 'Neufahrn(Niederbay)',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000688',
|
|
latitude: 48.729885,
|
|
longitude: 12.19046,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:09:00+01:00',
|
|
plannedArrival: '2025-01-17T16:09:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T16:10:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:10:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8001679',
|
|
name: 'Eggmühl',
|
|
location: {
|
|
type: 'location',
|
|
id: '8001679',
|
|
latitude: 48.836497,
|
|
longitude: 12.18219,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:19:00+01:00',
|
|
plannedArrival: '2025-01-17T16:19:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '3',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '3',
|
|
departure: '2025-01-17T16:20:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:20:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '3',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '3',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8002506',
|
|
name: 'Hagelstadt',
|
|
location: {
|
|
type: 'location',
|
|
id: '8002506',
|
|
latitude: 48.895862,
|
|
longitude: 12.21483,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:25:00+01:00',
|
|
plannedArrival: '2025-01-17T16:25:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T16:26:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:26:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8003357',
|
|
name: 'Köfering',
|
|
location: {
|
|
type: 'location',
|
|
id: '8003357',
|
|
latitude: 48.93172,
|
|
longitude: 12.208753,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:29:00+01:00',
|
|
plannedArrival: '2025-01-17T16:29:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T16:30:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:30:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004592',
|
|
name: 'Obertraubling',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004592',
|
|
latitude: 48.967533,
|
|
longitude: 12.169992,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:33:00+01:00',
|
|
plannedArrival: '2025-01-17T16:33:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T16:34:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:34:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8000309',
|
|
name: 'Regensburg Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000309',
|
|
latitude: 49.01167,
|
|
longitude: 12.099615,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T16:41:00+01:00',
|
|
plannedArrival: '2025-01-17T16:41:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '5',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '5',
|
|
departure: '2025-01-17T16:45:00+01:00',
|
|
plannedDeparture: '2025-01-17T16:45:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '5',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '5',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8000882',
|
|
name: 'Beratzhausen',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000882',
|
|
latitude: 49.092843,
|
|
longitude: 11.807853,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T17:02:00+01:00',
|
|
plannedArrival: '2025-01-17T17:02:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T17:02:00+01:00',
|
|
plannedDeparture: '2025-01-17T17:02:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004755',
|
|
name: 'Parsberg',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004755',
|
|
latitude: 49.164352,
|
|
longitude: 11.723354,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T17:08:00+01:00',
|
|
plannedArrival: '2025-01-17T17:08:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '2',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '2',
|
|
departure: '2025-01-17T17:09:00+01:00',
|
|
plannedDeparture: '2025-01-17T17:09:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '2',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '2',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8004305',
|
|
name: 'Neumarkt(Oberpf)',
|
|
location: {
|
|
type: 'location',
|
|
id: '8004305',
|
|
latitude: 49.27322,
|
|
longitude: 11.456986,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T17:25:00+01:00',
|
|
plannedArrival: '2025-01-17T17:25:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '1',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '1',
|
|
departure: '2025-01-17T17:26:00+01:00',
|
|
plannedDeparture: '2025-01-17T17:26:00+01:00',
|
|
departureDelay: null,
|
|
departurePlatform: '1',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '1',
|
|
remarks: [],
|
|
},
|
|
{
|
|
stop: {
|
|
type: 'station',
|
|
id: '8000284',
|
|
name: 'Nürnberg Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000284',
|
|
latitude: 49.445615,
|
|
longitude: 11.082989,
|
|
},
|
|
},
|
|
arrival: '2025-01-17T17:49:00+01:00',
|
|
plannedArrival: '2025-01-17T17:49:00+01:00',
|
|
arrivalDelay: null,
|
|
arrivalPlatform: '13',
|
|
arrivalPrognosisType: null,
|
|
plannedArrivalPlatform: '13',
|
|
departure: null,
|
|
plannedDeparture: null,
|
|
departureDelay: null,
|
|
departurePlatform: '13',
|
|
departurePrognosisType: null,
|
|
plannedDeparturePlatform: '13',
|
|
remarks: [],
|
|
},
|
|
],
|
|
remarks: [],
|
|
cancelled: false,
|
|
},
|
|
realtimeDataUpdatedAt: null,
|
|
};
|
|
|
|
export {
|
|
dbwebTrip,
|
|
};
|