diff --git a/index.js b/index.js index 7b9ca4ac..3e6965d9 100644 --- a/index.js +++ b/index.js @@ -198,6 +198,7 @@ const createClient = (profile, userAgent, opt = {}) => { getIV: false, // todo: walk & bike as alternatives? getPolyline: !!opt.polylines // todo: `getConGroups: false` what is this? + // todo: what is getEco, fwrd? } if (profile.journeysNumF && opt.results !== null) query.numF = opt.results if (profile.journeysOutFrwd) query.outFrwd = outFrwd diff --git a/lib/request.js b/lib/request.js index 022d3d69..40b0f611 100644 --- a/lib/request.js +++ b/lib/request.js @@ -35,7 +35,9 @@ const request = (ctx, userAgent, reqData) => { const {profile, opt} = ctx const body = profile.transformReqBody(ctx, { - lang: opt.language || 'en', // todo: is it `eng` actually? + // todo: is it `eng` actually? + // RSAG has `deu` instead of `de` + lang: opt.language || 'en', svcReqL: [reqData] }) if (DEBUG) console.error(JSON.stringify(body)) diff --git a/p/bvg/index.js b/p/bvg/index.js index a37f5463..5b8b278f 100644 --- a/p/bvg/index.js +++ b/p/bvg/index.js @@ -23,6 +23,7 @@ const transformReqBody = (ctx, body) => { return body } +// todo: https://m.tagesspiegel.de/berlin/fahrerlebnis-wie-im-regionalexpress-so-faehrt-es-sich-in-der-neuen-express-s-bahn/25338674.html const parseLineWithMoreDetails = ({parsed}, p) => { parsed.name = p.name.replace(/^(bus|tram)\s+/i, '') const details = parseLineName(parsed.name) diff --git a/p/db/loyalty-cards.js b/p/db/loyalty-cards.js index dfb583e9..a4bdd719 100644 --- a/p/db/loyalty-cards.js +++ b/p/db/loyalty-cards.js @@ -1,5 +1,6 @@ 'use strict' +// todo: generate from https://reiseauskunft.bahn.de/addons/fachkonfig-utf8.cfg ? const c = { NONE: Symbol('no loyaly card'), BAHNCARD: Symbol('Bahncard'), diff --git a/p/vbb/index.js b/p/vbb/index.js index 20c38f6d..5ce8c9c6 100644 --- a/p/vbb/index.js +++ b/p/vbb/index.js @@ -24,6 +24,7 @@ const transformReqBody = (ctx, body) => { return body } +// todo: https://m.tagesspiegel.de/berlin/fahrerlebnis-wie-im-regionalexpress-so-faehrt-es-sich-in-der-neuen-express-s-bahn/25338674.html const parseLineWithMoreDetails = ({parsed}, p) => { parsed.name = p.name.replace(/^(bus|tram)\s+/i, '') const details = parseLineName(parsed.name) diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index 90b4b3ec..43b599bd 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -7,6 +7,7 @@ const DEPARTURE = 'd' // todo: what is d.jny.dirFlg? // todo: d.stbStop.dProgType/d.stbStop.aProgType +// todo: d.stbStop.dProdX/aProdX can be different than d.prodX const createParseArrOrDep = (prefix) => { if (prefix !== ARRIVAL && prefix !== DEPARTURE) throw new Error('invalid prefix') diff --git a/parse/hint.js b/parse/hint.js index 14cdbe46..0288d5e5 100644 --- a/parse/hint.js +++ b/parse/hint.js @@ -23,6 +23,7 @@ const linkTypesByCode = Object.assign(Object.create(null), { // "RES_JNY_DTL" // only shown in journey detail // ] // todo: https://github.com/public-transport/hafas-client/issues/5 +// todo: expose h.type somehow const parseHint = (ctx, h) => { // todo: C diff --git a/parse/location.js b/parse/location.js index f61f2713..232ccb0d 100644 --- a/parse/location.js +++ b/parse/location.js @@ -8,7 +8,10 @@ const ADDRESS = 'A' const leadingZeros = /^0+/ -// todo: what is s.rRefL? +// todo: what is l.wt? is it "weight"? +// - `6733` for 8013074 with p/vmt +// - `3933` for 8012092 with p/vmt +// - `2062` for 8010168 with p/vmt const parseLocation = (ctx, l) => { const {profile, opt} = ctx diff --git a/test/e2e/hvv.js b/test/e2e/hvv.js index c3c9840a..6dfa13be 100644 --- a/test/e2e/hvv.js +++ b/test/e2e/hvv.js @@ -18,8 +18,6 @@ const testDepartures = require('./lib/departures') const testDeparturesInDirection = require('./lib/departures-in-direction') const testArrivals = require('./lib/arrivals') -const isObj = o => o !== null && 'object' === typeof o && !Array.isArray(o) - const when = createWhen('Europe/Berlin', 'de-DE') const cfg = {