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
291 lines
11 KiB
JavaScript
291 lines
11 KiB
JavaScript
const dbJourney = {
|
|
journey: {
|
|
type: 'journey',
|
|
legs: [
|
|
{
|
|
origin: {
|
|
type: 'station',
|
|
id: '8011160',
|
|
name: 'Berlin Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8011160',
|
|
latitude: 52.525589,
|
|
longitude: 13.369549,
|
|
},
|
|
},
|
|
destination: {
|
|
type: 'station',
|
|
id: '8000080',
|
|
name: 'Dortmund Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000080',
|
|
latitude: 51.517899,
|
|
longitude: 7.459294,
|
|
},
|
|
},
|
|
departure: '2024-12-18T00:22:00+01:00',
|
|
plannedDeparture: '2024-12-18T00:22:00+01:00',
|
|
departureDelay: null,
|
|
arrival: '2024-12-18T05:21:00+01:00',
|
|
plannedArrival: '2024-12-18T05:21:00+01:00',
|
|
arrivalDelay: null,
|
|
tripId: '2|#VN#1#ST#1733173731#PI#1#ZI#153019#TA#0#DA#181224#1S#8010255#1T#11#LS#8500010#LT#1048#PU#81#RT#1#CA#ICE#ZE#101#ZB#ICE 101#PC#0#FR#8010255#FT#11#TO#8500010#TT#1048#',
|
|
line: {
|
|
type: 'line',
|
|
id: 'ice-101',
|
|
fahrtNr: '101',
|
|
name: 'ICE 101',
|
|
public: true,
|
|
productName: 'ICE',
|
|
mode: 'train',
|
|
product: 'nationalExpress',
|
|
operator: {
|
|
type: 'operator',
|
|
id: 'db-fernverkehr-ag',
|
|
name: 'DB Fernverkehr AG',
|
|
},
|
|
},
|
|
direction: 'KÖLN',
|
|
arrivalPlatform: '16',
|
|
plannedArrivalPlatform: '16',
|
|
departurePlatform: '13',
|
|
plannedDeparturePlatform: '13',
|
|
remarks: [
|
|
{
|
|
text: 'Bicycles conveyed - subject to reservation',
|
|
type: 'hint',
|
|
code: 'bicycle-conveyance-reservation',
|
|
summary: 'bicycles conveyed, subject to reservation',
|
|
},
|
|
{
|
|
text: 'Number of bicycles conveyed limited',
|
|
type: 'hint',
|
|
code: 'bicycle-conveyance',
|
|
summary: 'bicycles conveyed',
|
|
},
|
|
{
|
|
text: 'Komfort Check-in possible (visit bahn.de/kci for more information)',
|
|
type: 'hint',
|
|
code: 'komfort-checkin',
|
|
summary: 'Komfort-Checkin available',
|
|
},
|
|
{
|
|
text: 'vehicle-mounted access aid',
|
|
type: 'hint',
|
|
code: 'boarding-ramp',
|
|
summary: 'vehicle-mounted boarding ramp available',
|
|
},
|
|
{
|
|
code: 'text.journeystop.product.or.direction.changes.journey.message',
|
|
summary: 'From Minden(Westf) as ICE 101 heading towards Basel SBB',
|
|
text: 'From Minden(Westf) as ICE 101 heading towards Basel SBB',
|
|
type: 'hint',
|
|
},
|
|
],
|
|
loadFactor: 'low-to-medium',
|
|
},
|
|
{
|
|
origin: {
|
|
type: 'station',
|
|
id: '8000080',
|
|
name: 'Dortmund Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000080',
|
|
latitude: 51.517899,
|
|
longitude: 7.459294,
|
|
},
|
|
},
|
|
destination: {
|
|
type: 'station',
|
|
id: '8000080',
|
|
name: 'Dortmund Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000080',
|
|
latitude: 51.517899,
|
|
longitude: 7.459294,
|
|
},
|
|
},
|
|
departure: '2024-12-18T05:21:00+01:00',
|
|
plannedDeparture: '2024-12-18T05:21:00+01:00',
|
|
departureDelay: null,
|
|
arrival: '2024-12-18T05:21:00+01:00',
|
|
plannedArrival: '2024-12-18T05:21:00+01:00',
|
|
arrivalDelay: null,
|
|
public: true,
|
|
walking: true,
|
|
distance: null,
|
|
},
|
|
{
|
|
origin: {
|
|
type: 'station',
|
|
id: '8000080',
|
|
name: 'Dortmund Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000080',
|
|
latitude: 51.517899,
|
|
longitude: 7.459294,
|
|
},
|
|
},
|
|
destination: {
|
|
type: 'station',
|
|
id: '8000207',
|
|
name: 'Köln Hbf',
|
|
location: {
|
|
type: 'location',
|
|
id: '8000207',
|
|
latitude: 50.943029,
|
|
longitude: 6.95873,
|
|
},
|
|
},
|
|
departure: '2024-12-18T05:36:00+01:00',
|
|
plannedDeparture: '2024-12-18T05:36:00+01:00',
|
|
departureDelay: null,
|
|
arrival: '2024-12-18T06:47:00+01:00',
|
|
plannedArrival: '2024-12-18T06:47:00+01:00',
|
|
arrivalDelay: null,
|
|
tripId: '2|#VN#1#ST#1733173731#PI#1#ZI#154039#TA#0#DA#181224#1S#8000080#1T#536#LS#8000096#LT#1024#PU#81#RT#1#CA#IC#ZE#2040#ZB#IC 2040#PC#1#FR#8000080#FT#536#TO#8000096#TT#1024#',
|
|
line: {
|
|
type: 'line',
|
|
id: 'ic-2040',
|
|
fahrtNr: '2040',
|
|
name: 'IC 2040',
|
|
public: true,
|
|
productName: 'IC',
|
|
mode: 'train',
|
|
product: 'national',
|
|
operator: {
|
|
type: 'operator',
|
|
id: 'db-fernverkehr-ag',
|
|
name: 'DB Fernverkehr AG',
|
|
},
|
|
},
|
|
direction: 'Stuttgart Hbf',
|
|
arrivalPlatform: '7 D-G',
|
|
plannedArrivalPlatform: '7 D-G',
|
|
departurePlatform: '11',
|
|
plannedDeparturePlatform: '11',
|
|
remarks: [
|
|
{
|
|
text: 'Bicycles conveyed - subject to reservation',
|
|
type: 'hint',
|
|
code: 'bicycle-conveyance-reservation',
|
|
summary: 'bicycles conveyed, subject to reservation',
|
|
},
|
|
{
|
|
text: 'Number of bicycles conveyed limited',
|
|
type: 'hint',
|
|
code: 'bicycle-conveyance',
|
|
summary: 'bicycles conveyed',
|
|
},
|
|
{
|
|
text: 'Komfort Check-in possible (visit bahn.de/kci for more information)',
|
|
type: 'hint',
|
|
code: 'komfort-checkin',
|
|
summary: 'Komfort-Checkin available',
|
|
},
|
|
{
|
|
code: 'RZ',
|
|
summary: 'Einstieg mit Rollstuhl stufenfrei',
|
|
text: 'Einstieg mit Rollstuhl stufenfrei',
|
|
type: 'hint',
|
|
},
|
|
{
|
|
text: 'Intercity 2: visit www.bahn.de/ic2 for more information',
|
|
type: 'hint',
|
|
code: 'intercity-2',
|
|
summary: 'Intercity 2',
|
|
},
|
|
],
|
|
loadFactor: 'low-to-medium',
|
|
},
|
|
],
|
|
refreshToken: 'T$A=1@O=Berlin Hbf@X=13369549@Y=52525589@L=8011160@a=128@$A=1@O=Dortmund Hbf@X=7459294@Y=51517899@L=8000080@a=128@$202412180022$202412180521$ICE 101$$1$$$$$$§T$A=1@O=Dortmund Hbf@X=7459294@Y=51517899@L=8000080@a=128@$A=1@O=Köln Hbf@X=6958730@Y=50943029@L=8000207@a=128@$202412180536$202412180647$IC 2040$$1$$$$$$',
|
|
remarks: [],
|
|
price: {
|
|
amount: 27.99,
|
|
currency: 'EUR',
|
|
hint: null,
|
|
},
|
|
tickets: [
|
|
{
|
|
name: 'Super Sparpreis',
|
|
priceObj: {
|
|
amount: 2799,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Train-specific travel. No cancellations',
|
|
addDataTicketDetails: 'You can use all trains indicated on your ticket. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket, see there. Your ticket cannot be cancelled.',
|
|
firstClass: false,
|
|
partialFare: false,
|
|
},
|
|
{
|
|
name: 'Super Sparpreis',
|
|
priceObj: {
|
|
amount: 3599,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Train-specific travel. No cancellations. No access to the DB Lounge',
|
|
addDataTicketDetails: 'You can use all trains indicated on your ticket. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket, see there. Your ticket cannot be cancelled. Your ticket does not entitle you to use the DB Lounge.',
|
|
addDataTravelInfo: 'Travel 1st class',
|
|
firstClass: true,
|
|
partialFare: false,
|
|
},
|
|
{
|
|
name: 'Sparpreis',
|
|
priceObj: {
|
|
amount: 3499,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Train-specific travel. Cancellation subject to a fee before first day of validity',
|
|
addDataTicketDetails: 'You can use all trains indicated on your ticket. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket, see there. You can cancel your ticket up to and including 17.12.2024 for a fee of EUR 10,00. You will receive a voucher for the remaining amount. No cancellation thereafter.',
|
|
firstClass: false,
|
|
partialFare: false,
|
|
},
|
|
{
|
|
name: 'Sparpreis',
|
|
priceObj: {
|
|
amount: 4499,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Train-specific travel. Cancellation subject to a fee before first day of validity. No access to the DB Lounge',
|
|
addDataTicketDetails: 'You can use all trains indicated on your ticket. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket, see there. You can cancel your ticket up to and including 17.12.2024 for a fee of EUR 10,00. You will receive a voucher for the remaining amount. No cancellation thereafter. Your ticket does not entitle you to use the DB Lounge.',
|
|
addDataTravelInfo: 'Travel 1st class',
|
|
firstClass: true,
|
|
partialFare: false,
|
|
},
|
|
{
|
|
name: 'Flexpreis',
|
|
priceObj: {
|
|
amount: 13280,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Unrestricted choice of trains. Cancellation free of charge before first day of validity. City-Ticket',
|
|
addDataTicketDetails: 'Your ICE ticket lets you take any type of train. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket; see there. You can cancel your ticket free of charge up to and including 17.12.2024. After that, cancellation is available for a fee of EUR 19,00. Your ticket includes a City-Ticket for Berlin, Tarifbereiche A und B and Köln, Stadtgebiet Köln (Tarifgebiet 2100). The City-Ticket is valid in conjunction with your long-distance ticket only when you use it for connecting services in local or regional rail passenger transport (e.g. S-Bahn, RE and RB trains) as part of the through ticket. The City-Ticket is issued together with your Super Sparpreis or Sparpreis ticket, depending on the journey you have booked.',
|
|
firstClass: false,
|
|
partialFare: false,
|
|
},
|
|
{
|
|
name: 'Flexpreis',
|
|
priceObj: {
|
|
amount: 23910,
|
|
currency: 'EUR',
|
|
},
|
|
addDataTicketInfo: 'Unrestricted choice of trains. Cancellation free of charge before first day of validity. City-Ticket. Access to the DB Lounge. Seat included',
|
|
addDataTicketDetails: 'Your ICE ticket lets you take any type of train. Your ticket constitutes a continuous contract of carriage in each direction (through ticket). Should you make a passenger rights claim, the ticket will be considered in its entirety. Special rules apply to tickets including City-Ticket; see there. You can cancel your ticket free of charge up to and including 17.12.2024. After that, cancellation is available for a fee of EUR 19,00. Your ticket includes a City-Ticket for Berlin, Tarifbereiche A und B and Köln, Stadtgebiet Köln (Tarifgebiet 2100). The City-Ticket is valid in conjunction with your long-distance ticket only when you use it for connecting services in local or regional rail passenger transport (e.g. S-Bahn, RE and RB trains) as part of the through ticket. The City-Ticket is issued together with your Super Sparpreis or Sparpreis ticket, depending on the journey you have booked. Your ticket entitles you to use the DB Lounge. Your ticket includes a free seat reservation.',
|
|
addDataTravelInfo: 'Travel 1st class',
|
|
firstClass: true,
|
|
partialFare: false,
|
|
},
|
|
],
|
|
},
|
|
realtimeDataUpdatedAt: null,
|
|
};
|
|
|
|
export {
|
|
dbJourney,
|
|
};
|