From ca6f75501caf920561ebef4acb2dd36a3a763a6a Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 18 Nov 2021 18:29:25 +0100 Subject: [PATCH] add todos; add @MTRNord as contributor --- format/radar-req.js | 5 ++++- index.js | 1 + package.json | 3 ++- parse/hint.js | 1 + parse/journey-leg.js | 8 ++++++-- parse/journey.js | 7 +++++-- parse/location.js | 3 +++ 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/format/radar-req.js b/format/radar-req.js index b9bc5f8b..a5b015d3 100644 --- a/format/radar-req.js +++ b/format/radar-req.js @@ -18,7 +18,10 @@ const formatRadarReq = (ctx, north, west, south, east) => { jnyFltrL: [ profile.formatProductsFilter(ctx, opt.products || {}) ], - trainPosMode: 'CALC' // todo: what is this? what about realtime? + // todo: what is this? what about realtime? + // - CALC + // - CALC_REPORT (as seen in the INSA Young app) + trainPosMode: 'CALC', } } } diff --git a/index.js b/index.js index d0ad7418..0b0ff1ae 100644 --- a/index.js +++ b/index.js @@ -477,6 +477,7 @@ const createClient = (profile, userAgent, opt = {}) => { } const trip = (id, lineName, opt = {}) => { + // todo [breaking]: remove lineName param, not needed anymore if (!isNonEmptyString(id)) { throw new TypeError('id must be a non-empty string.') } diff --git a/package.json b/package.json index 8f3b151f..557b75bd 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "em0lar ", "Adrian Böhme (https://github.com/Adwirawien)", "Yureka ", - "Kristjan Esperanto (https://github.com/KristjanESPERANTO)" + "Kristjan Esperanto (https://github.com/KristjanESPERANTO)", + "Marcel Radzio " ], "homepage": "https://github.com/public-transport/hafas-client/tree/5.21.0", "repository": "public-transport/hafas-client", diff --git a/parse/hint.js b/parse/hint.js index f2667991..b5270374 100644 --- a/parse/hint.js +++ b/parse/hint.js @@ -26,6 +26,7 @@ const linkTypesByCode = Object.assign(Object.create(null), { // todo: https://github.com/public-transport/hafas-client/issues/5 // todo: expose h.type somehow // todo: https://github.com/KDE/kpublictransport/blob/39ac8f9586b9300fa8a9ba0dec010e96fab9ab08/src/lib/backends/hafasmgateparser.cpp#L56-L72 +// todo: h.sty const parseHint = (ctx, h) => { // todo: C diff --git a/parse/journey-leg.js b/parse/journey-leg.js index 6203f2d2..92708522 100644 --- a/parse/journey-leg.js +++ b/parse/journey-leg.js @@ -42,13 +42,14 @@ const applyRemarks = (leg, refs) => { } // todo: pt.status, pt.isPartCncl -// todo: pt.isRchbl, pt.chRatingRT, pt.chgDurR, pt.minChg -// todo: pt.dep.dProgType, pt.arr.dProgType +// todo: pt.chRatingRT, pt.chgDurR, pt.minChg // todo: what is pt.jny.dirFlg? // todo: what is pt.recState? // todo: what is `sty: 'UNDEF'`? // todo: pt.prodL // todo: pt.parJnyL (list of coupled trains) +// todo: pt.planrtTS +// todo: what is pt.jny.lPassSt? const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg const {profile, opt} = ctx @@ -68,12 +69,14 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg const dep = profile.parseWhen(ctx, date, pt.dep.dTimeS, pt.dep.dTimeR, pt.dep.dTZOffset, pt.dep.dCncl) res.departure = dep.when res.plannedDeparture = dep.plannedWhen + // todo: pt.dep.dProgType res.departureDelay = dep.delay if (dep.prognosedWhen) res.prognosedDeparture = dep.prognosedWhen const arr = profile.parseWhen(ctx, date, pt.arr.aTimeS, pt.arr.aTimeR, pt.arr.aTZOffset, pt.arr.aCncl) res.arrival = arr.when res.plannedArrival = arr.plannedWhen + // todo: pt.arr.aProgType res.arrivalDelay = arr.delay if (arr.prognosedWhen) res.prognosedArrival = arr.prognosedWhen @@ -132,6 +135,7 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg if (opt.remarks && Array.isArray(pt.jny.msgL)) { // todo: apply leg-wide remarks if `opt.stopovers` is false applyRemarks(res, pt.jny.msgL) + // todo: parse & use `code: EXTERNAL_ID` remarks? } // filter stations the train passes without stopping, as this doesn't comply with fptf (yet) diff --git a/parse/journey.js b/parse/journey.js index f198347d..55e789c2 100644 --- a/parse/journey.js +++ b/parse/journey.js @@ -22,15 +22,18 @@ const parseScheduledDays = (sDaysB, year, profile) => { return res } -// todo: c.conSubscr +// todo: c.conSubscr (e.g. `F`) // todo: c.trfRes x vbb-parse-ticket // todo: c.sotRating, c.isSotCon, c.sotCtxt // todo: c.showARSLink // todo: c.useableTime -// todo: c.cksum +// todo: c.cksum (e.g. `b3a94228_3`), c.cksumDti (e.g. `c2717eb3_3`) // todo: c.isNotRdbl // todo: c.badSecRefX // todo: c.bfATS, c.bfIOSTS +// todo: c.recState (e.g. `U`) +// todo: c.intvlSubscr (e.g. `F`) + const parseJourney = (ctx, j) => { // j = raw jouney const {profile, opt} = ctx diff --git a/parse/location.js b/parse/location.js index 2636c50b..9c15bb6a 100644 --- a/parse/location.js +++ b/parse/location.js @@ -13,6 +13,9 @@ const leadingZeros = /^0+/ // - `6733` for 8013074 with p/vmt // - `3933` for 8012092 with p/vmt // - `2062` for 8010168 with p/vmt +// todo: l.gidL (e.g. `["A×de:15088:8013414"]`) +// todo: `i` param in `lid` (e.g. `A=1@O=Zöberitz@X=12033455@Y=51504612@U=80@L=8013414@i=A×de:15088:8013414@`) + const parseLocation = (ctx, l) => { const {profile, opt} = ctx