diff --git a/docs/readme.md b/docs/readme.md
index 7e20f141..f416f487 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -11,6 +11,7 @@
- [`nearby(location, [opt])`](nearby.md) – show stations & POIs around
- [`radar(north, west, south, east, [opt])`](radar.md) – find all vehicles currently in a certain area
- [`reachableFrom(address, [opt])`](reachable-from.md) – get all stations reachable from an address within `n` minutes
+- [`remarks([opt])`](remarks.md) – get all remarks
- [`serverInfo([opt])`](server-info.md) – fetch meta information from HAFAS
## Migrating from an old `hafas-client` version
diff --git a/docs/remarks.md b/docs/remarks.md
new file mode 100644
index 00000000..cc72fd7d
--- /dev/null
+++ b/docs/remarks.md
@@ -0,0 +1,142 @@
+# `remarks([opt])`
+
+**Fetches all remarks known to the HAFAS endpoint**, e.g. warnings about disruptions, planned construction work, and general notices about the operating situation.
+
+With `opt`, you can override the default options, which look like this:
+
+```js
+{
+ results: 100, // maximum number of remarks
+ // filter by time
+ from: Date.now(),
+ to: null,
+ products: null, // filter by affected products
+ language: 'en', // depends on the profile
+}
+```
+
+## Example
+
+As an example, we're going to use the [SVV profile](../p/svv):
+
+```js
+const createClient = require('hafas-client')
+const svvProfile = require('hafas-client/p/svv')
+
+const client = createClient(svvProfile, 'my-awesome-program')
+
+console.log(await client.remarks())
+```
+
+```js
+[
+ {
+ id: 'HIM_FREETEXT_110342',
+ type: 'warning',
+ summary: 'Bus will be running at different times',
+ text: 'Due to operational changes, this bus will be running at different times. We apologise for any inconvenience this may cause.',
+ priority: 50,
+ company: 'KGÖVV',
+ validFrom: '2020-07-04T00:00:00+02:00',
+ validUntil: '2020-08-09T23:59:00+02:00',
+ modified: '2020-07-01T14:39:12+02:00',
+ products: {
+ 'bahn-s-bahn': true,
+ 'u-bahn': true,
+ strassenbahn: true,
+ fernbus: true,
+ regionalbus: true,
+ stadtbus: true,
+ 'seilbahn-zahnradbahn': true,
+ schiff: true,
+ },
+ categories: [1],
+ icon: {type: 'HIM1', title: null},
+ },
+ // …
+ {
+ id: 'HIM_FREETEXT_110235',
+ type: 'warning',
+ summary: 'Linie 7 - Umleitungen',
+ text: 'Aufgrund einer Baustelle gibt es bei der Linie 7 umfangreiche Umleitungen.',
+ priority: 100,
+ company: 'VOR',
+ validFrom: '2020-07-13T00:00:00+02:00',
+ validUntil: '2020-08-31T23:59:00+02:00',
+ modified: '2020-06-30T12:37:38+02:00',
+ affectedLines: [{
+ type: 'line',
+ id: '7',
+ name: '7',
+ public: true,
+ }],
+ products: {
+ 'bahn-s-bahn': true,
+ 'u-bahn': true,
+ strassenbahn: true,
+ fernbus: true,
+ regionalbus: true,
+ stadtbus: true,
+ 'seilbahn-zahnradbahn': false,
+ schiff: true,
+ },
+ categories: [1],
+ icon: {type: 'HIM1', title: null},
+ },
+ // …
+ {
+ id: 'HIM_FREETEXT_106619',
+ type: 'warning',
+ summary: 'Stop Bad Hall Bahnhofstraße can not be approached',
+ text: 'The stop at Bad Hall Bahnhofstraße can not be approached during 21.04.-24.07.2020. Please use alternatively the stop at Bad Hall Busterminal (Abzw Bahnhofstraße).',
+ priority: 100,
+ company: 'OÖVG',
+ validFrom: '2020-04-21T00:00:00+02:00',
+ validUntil: '2020-07-24T23:59:00+02:00',
+ modified: '2020-07-08T12:52:13+02:00',
+ affectedLines: [{
+ type: 'line',
+ id: '452',
+ name: '452',
+ public: true,
+ }],
+ products: {
+ 'bahn-s-bahn': false,
+ 'u-bahn': false,
+ strassenbahn: false,
+ fernbus: false,
+ regionalbus: true,
+ stadtbus: false,
+ 'seilbahn-zahnradbahn': false,
+ schiff: false
+ },
+ categories: [1],
+ icon: {type: 'HIM1', title: null},
+ },
+ // …
+ {
+ id: 'HIM_FREETEXT_106671',
+ type: 'warning',
+ summary: 'Neue Haltestellennamen',
+ text: 'Im Zuge der Neuordnung der Regionalbusverkehre werden mit 6.7.2020 neue Fahrpläne und Liniennummern wirksam und dadurch können sich mitunter die Haltestellennamen verändern.',
+ priority: 100,
+ company: 'VOR',
+ validFrom: '2020-04-21T00:00:00+02:00',
+ validUntil: '2020-09-30T23:59:00+02:00',
+ modified: '2020-04-21T13:20:41+02:00',
+ products: {
+ 'bahn-s-bahn': true,
+ 'u-bahn': true,
+ strassenbahn: true,
+ fernbus: true,
+ regionalbus: true,
+ stadtbus: true,
+ 'seilbahn-zahnradbahn': false,
+ schiff: true,
+ },
+ categories: [4],
+ icon: {type: 'HIM4', title: null},
+ },
+ // …
+]
+```
diff --git a/format/remarks-req.js b/format/remarks-req.js
new file mode 100644
index 00000000..a1bfec72
--- /dev/null
+++ b/format/remarks-req.js
@@ -0,0 +1,34 @@
+'use strict'
+
+const formatRemarksReq = (ctx) => {
+ const {profile, opt} = ctx
+
+ const himFltrL = []
+ // todo: https://github.com/marudor/BahnhofsAbfahrten/blob/95fef0217d01344642dd423457473fe9b8b6056e/src/types/HAFAS/index.ts#L76-L91
+ if (opt.products) {
+ himFltrL.push(profile.formatProductsFilter(ctx, opt.products))
+ }
+
+ const req = {
+ getPolyline: !!opt.polylines,
+ himFltrL,
+ }
+ // todo: stLoc, dirLoc
+ // todo: comp, dept, onlyHimId, onlyToday
+ // todo: dailyB, dailyE
+ // see https://github.com/marudor/BahnhofsAbfahrten/blob/46a74957d68edc15713112df44e1a25150f5a178/src/types/HAFAS/HimSearch.ts#L3-L18
+
+ if (opt.results !== null) req.maxNum = opt.results
+ if (opt.from !== null) {
+ req.dateB = profile.formatDate(profile, opt.from)
+ req.timeB = profile.formatTime(profile, opt.from)
+ }
+ if (opt.to !== null) {
+ req.dateE = profile.formatDate(profile, opt.to)
+ req.timeE = profile.formatTime(profile, opt.to)
+ }
+
+ return {meth: 'HimSearch', req}
+}
+
+module.exports = formatRemarksReq
diff --git a/index.js b/index.js
index 4faa8902..a5c15de8 100644
--- a/index.js
+++ b/index.js
@@ -22,6 +22,12 @@ const validateLocation = (loc, name = 'location') => {
}
}
+const validateWhen = (when, name = 'when') => {
+ if (Number.isNaN(+when)) {
+ throw new TypeError(name + ' is invalid')
+ }
+}
+
const createClient = (profile, userAgent, opt = {}) => {
profile = Object.assign({}, defaultProfile, profile)
validateProfile(profile)
@@ -468,6 +474,34 @@ const createClient = (profile, userAgent, opt = {}) => {
})
}
+ const remarks = async (opt = {}) => {
+ opt = {
+ results: 100, // maximum number of remarks
+ // filter by time
+ from: Date.now(),
+ to: null,
+ products: null, // filter by affected products
+ ...opt
+ }
+
+ if (opt.from !== null) {
+ opt.from = new Date(opt.from)
+ validateWhen(opt.from, 'opt.from')
+ }
+ if (opt.to !== null) {
+ opt.to = new Date(opt.to)
+ validateWhen(opt.to, 'opt.to')
+ }
+
+ const req = profile.formatRemarksReq({profile, opt})
+ const {
+ res, common,
+ } = await profile.request({profile, opt}, userAgent, req)
+
+ const ctx = {profile, opt, common, res}
+ return res.msgL.map(w => profile.parseWarning(ctx, w))
+ }
+
const serverInfo = async (opt = {}) => {
const {res, common} = await profile.request({profile, opt}, userAgent, {
meth: 'ServerInfo',
@@ -494,6 +528,7 @@ const createClient = (profile, userAgent, opt = {}) => {
locations,
stop,
nearby,
+ remarks,
serverInfo,
}
if (profile.trip) client.trip = trip
diff --git a/lib/default-profile.js b/lib/default-profile.js
index cfb2099d..f194d813 100644
--- a/lib/default-profile.js
+++ b/lib/default-profile.js
@@ -10,6 +10,7 @@ const formatTripReq = require('../format/trip-req')
const formatRadarReq = require('../format/radar-req')
const formatReachableFromReq = require('../format/reachable-from-req')
const formatRefreshJourneyReq = require('../format/refresh-journey-req')
+const formatRemarksReq = require('../format/remarks-req')
const parseDateTime = require('../parse/date-time')
const parsePlatform = require('../parse/platform')
@@ -62,6 +63,7 @@ const defaultProfile = {
formatRadarReq,
formatReachableFromReq,
formatRefreshJourneyReq,
+ formatRemarksReq,
transformJourneysQuery: id,
parseDateTime,
diff --git a/test/fixtures/vsn-remarks.js b/test/fixtures/vsn-remarks.js
new file mode 100644
index 00000000..1943a5cb
--- /dev/null
+++ b/test/fixtures/vsn-remarks.js
@@ -0,0 +1,332 @@
+'use strict'
+
+module.exports = [
+ {
+ id: 'HIM_FREETEXT_14164',
+ type: 'warning',
+ summary: 'Hinweis zum Flughafenbus X15',
+ text: 'Der Flughafenbus X15 ist eine Linie der Regionalverkehr Münsterland GmbH (RVM). Es gilt der Westfalentarif. Infos gibt es online unter www.rvm-online.de sowie telefonisch unter der Rufnummer 0180 650 40 30.',
+ icon: { type: 'HIM0', title: null },
+ priority: 6,
+ company: 'VOS',
+ products: {
+ nationalExpress: true,
+ national: true,
+ regionalExpress: true,
+ regional: true,
+ suburban: true,
+ bus: true,
+ ferry: true,
+ subway: true,
+ tram: true,
+ anrufSammelTaxi: true
+ },
+ categories: [ 0 ],
+ edges: [
+ {
+ icoCrd: { x: 7875575, y: 52201492 },
+ icon: null,
+ fromLoc: null,
+ toLoc: null
+ }
+ ],
+ events: [
+ {
+ fromLoc: null,
+ toLoc: null,
+ start: '2020-02-03T11:11:00+01:00',
+ end: '2020-12-13T00:00:00+01:00',
+ sections: []
+ }
+ ],
+ affectedLines: [
+ {
+ type: 'line',
+ id: 'bus-x15',
+ fahrtNr: null,
+ name: 'Bus X15',
+ public: true
+ }
+ ],
+ validFrom: '2020-02-03T11:11:00+01:00',
+ validUntil: '2020-12-13T00:00:00+01:00',
+ modified: '2020-02-03T11:24:29+01:00'
+ },
+ {
+ id: 'HIM_FREETEXT_9156',
+ type: 'warning',
+ summary: 'Sperrung Weserbrücke Lauenförde-Beverungen',
+ text: 'Aufgrund der Sperrung können die Haltestellen in Beverungen nicht bedient werden.\n' +
+ 'Lauenförde-Beverungen\n' +
+ 'Baustellenfahrplan Linie 556',
+ icon: { type: 'HIM0', title: null },
+ priority: 6,
+ company: 'VSN',
+ products: {
+ nationalExpress: true,
+ national: true,
+ regionalExpress: true,
+ regional: true,
+ suburban: true,
+ bus: true,
+ ferry: true,
+ subway: true,
+ tram: true,
+ anrufSammelTaxi: true
+ },
+ categories: [ 0 ],
+ edges: [
+ {
+ icoCrd: { x: 9395422, y: 51748714 },
+ icon: null,
+ fromLoc: null,
+ toLoc: null
+ }
+ ],
+ events: [
+ {
+ fromLoc: null,
+ toLoc: null,
+ start: '2019-12-15T00:00:00+01:00',
+ end: '2020-12-12T23:59:00+01:00',
+ sections: []
+ }
+ ],
+ affectedLines: [
+ {
+ type: 'line',
+ id: 'bus-554',
+ fahrtNr: null,
+ name: 'Bus 554',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-556',
+ fahrtNr: null,
+ name: 'Bus 556',
+ public: true
+ }
+ ],
+ validFrom: '2019-12-15T00:00:00+01:00',
+ validUntil: '2020-12-12T23:59:00+01:00',
+ modified: '2019-12-09T13:55:14+01:00'
+ },
+ {
+ id: 'HIM_FREETEXT_9155',
+ type: 'warning',
+ summary: 'Sperrung Weserbrücke Lauenförde-Beverungen',
+ text: 'Aufgrund der Sperrung können die Haltestellen in Beverungen nicht bedient werden.\n' +
+ 'Lauenförde-Beverungen\n' +
+ 'Baustellenfahrplan Linie 554',
+ icon: { type: 'HIM0', title: null },
+ priority: 6,
+ company: 'VSN',
+ products: {
+ nationalExpress: true,
+ national: true,
+ regionalExpress: true,
+ regional: true,
+ suburban: true,
+ bus: true,
+ ferry: true,
+ subway: true,
+ tram: true,
+ anrufSammelTaxi: true
+ },
+ categories: [ 0 ],
+ edges: [
+ {
+ icoCrd: { x: 9435051, y: 51783147 },
+ icon: null,
+ fromLoc: null,
+ toLoc: null
+ }
+ ],
+ events: [
+ {
+ fromLoc: null,
+ toLoc: null,
+ start: '2019-12-15T00:00:00+01:00',
+ end: '2020-12-12T23:59:00+01:00',
+ sections: []
+ }
+ ],
+ affectedLines: [
+ {
+ type: 'line',
+ id: 'bus-509',
+ fahrtNr: null,
+ name: 'Bus 509',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-554',
+ fahrtNr: null,
+ name: 'Bus 554',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-556',
+ fahrtNr: null,
+ name: 'Bus 556',
+ public: true
+ }
+ ],
+ validFrom: '2019-12-15T00:00:00+01:00',
+ validUntil: '2020-12-12T23:59:00+01:00',
+ modified: '2019-12-09T13:55:45+01:00'
+ },
+ {
+ id: 'HIM_FREETEXT_14527',
+ type: 'warning',
+ summary: 'Verlegung einer Stromleitung in der Lindenstraße (Umleitung verschoben)',
+ text: 'Betrifft die Linien 91, 92, 94, N7\n' +
+ '\n' +
+ 'Beginn der Umleitung verschoben auf voraussichtlich 16. März bis Juni 2020\n' +
+ '\n' +
+ 'Die Bauarbeiten sollten ursprünglich bereits am 2. März beginnen. Ab diesem Datum wurde auch die Umleitung der Buslinien geplant. Bitte beachten Sie, dass die Fahrpläne an den Haltestellen sowie die Fahrplanauskunft im Internet ab 2. März den Bauplan anzeigen, obwohl die Busse bis zum Beginn der Bauarbeiten noch in der regulären Linienführung fahren.\n' +
+ '\n' +
+ 'Umleitung ab Baubeginn:\n' +
+ 'Die Linien 91, 92, 94 und N7 werden in Richtung Vegesack zwischen (H) Bf Blumenthal und (H) Bremer Vulkan über die Straßen Zur Westpier und Am Werfttor umgeleitet.\n' +
+ '\n' +
+ 'Haltestellenänderungen in Richtung Vegesack:\n' +
+ '(H) Wätjens Park > verlegt vor die Kreuzung Lüssumer Str./Zur Westpier\n' +
+ '(H) Margaretenallee > entfällt \n',
+ icon: { type: 'HIM0', title: null },
+ priority: 6,
+ company: 'BSAG',
+ products: {
+ nationalExpress: false,
+ national: false,
+ regionalExpress: false,
+ regional: false,
+ suburban: false,
+ bus: true,
+ ferry: false,
+ subway: false,
+ tram: false,
+ anrufSammelTaxi: false
+ },
+ categories: [ 0 ],
+ events: [
+ {
+ fromLoc: null,
+ toLoc: null,
+ start: '2020-02-21T11:31:00+01:00',
+ end: '2020-06-30T23:59:00+02:00',
+ sections: []
+ }
+ ],
+ affectedLines: [
+ {
+ type: 'line',
+ id: 'bus-91',
+ fahrtNr: null,
+ name: 'Bus 91',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-92',
+ fahrtNr: null,
+ name: 'Bus 92',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-94',
+ fahrtNr: null,
+ name: 'Bus 94',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-n7',
+ fahrtNr: null,
+ name: 'Bus N7',
+ public: true
+ }
+ ],
+ validFrom: '2020-02-21T11:31:00+01:00',
+ validUntil: '2020-06-30T23:59:00+02:00',
+ modified: '2020-02-21T11:34:47+01:00'
+ },
+ {
+ id: 'HIM_FREETEXT_14525',
+ type: 'warning',
+ summary: 'Verlegung einer Stromleitung in der Lindenstraße',
+ text: 'Betrifft die Linien 91, 92, 94, N7\n' +
+ '\n' +
+ 'Beginn der Umleitung verschoben auf voraussichtlich 16. März bis Juni 2020\n' +
+ '\n' +
+ 'Die Bauarbeiten sollten ursprünglich bereits am 2. März beginnen. Ab diesem Datum wurde auch die Umleitung der Buslinien geplant. Bitte beachten Sie, dass die Fahrpläne an den Haltestellen sowie die Fahrplanauskunft im Internet ab 2. März den Bauplan anzeigen, obwohl die Busse bis zum Beginn der Bauarbeiten noch in der regulären Linienführung fahren.\n' +
+ '\n' +
+ 'Umleitung ab Baubeginn:\n' +
+ 'Die Linien 91, 92, 94 und N7 werden in Richtung Vegesack zwischen (H) Bf Blumenthal und (H) Bremer Vulkan über die Straßen Zur Westpier und Am Werfttor umgeleitet.\n' +
+ '\n' +
+ 'Haltestellenänderungen in Richtung Vegesack:\n' +
+ '(H) Wätjens Park > verlegt vor die Kreuzung Lüssumer Str./Zur Westpier\n' +
+ '(H) Margaretenallee > entfällt \n',
+ icon: { type: 'HIM0', title: null },
+ priority: 6,
+ company: 'BSAG',
+ products: {
+ nationalExpress: false,
+ national: false,
+ regionalExpress: false,
+ regional: false,
+ suburban: false,
+ bus: true,
+ ferry: false,
+ subway: false,
+ tram: false,
+ anrufSammelTaxi: false
+ },
+ categories: [ 0 ],
+ events: [
+ {
+ fromLoc: null,
+ toLoc: null,
+ start: '2020-02-21T11:01:00+01:00',
+ end: '2020-06-30T23:59:00+02:00',
+ sections: []
+ }
+ ],
+ affectedLines: [
+ {
+ type: 'line',
+ id: 'bus-91',
+ fahrtNr: null,
+ name: 'Bus 91',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-92',
+ fahrtNr: null,
+ name: 'Bus 92',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-94',
+ fahrtNr: null,
+ name: 'Bus 94',
+ public: true
+ },
+ {
+ type: 'line',
+ id: 'bus-n7',
+ fahrtNr: null,
+ name: 'Bus N7',
+ public: true
+ }
+ ],
+ validFrom: '2020-02-21T11:01:00+01:00',
+ validUntil: '2020-06-30T23:59:00+02:00',
+ modified: '2020-02-21T13:31:05+01:00'
+ }
+]
diff --git a/test/fixtures/vsn-remarks.json b/test/fixtures/vsn-remarks.json
new file mode 100644
index 00000000..aab24169
--- /dev/null
+++ b/test/fixtures/vsn-remarks.json
@@ -0,0 +1,346 @@
+{
+ "common": {
+ "locL": [
+ {
+ "lid": "A=1@O=Bremen Vereinsstraße@X=8606263@Y=53176363@U=80@L=9014254@",
+ "type": "S",
+ "name": "Bremen Vereinsstraße",
+ "icoX": 1,
+ "extId": "9014254",
+ "state": "F",
+ "crd": {
+ "x": 8606263,
+ "y": 53176363,
+ "layerX": 0,
+ "crdSysX": 0
+ },
+ "meta": true,
+ "pCls": 32,
+ "isMainMast": true
+ }
+ ],
+ "prodL": [
+ {
+ "pid": "L::5::Bus::B1477578485::VOSRVM_X15::*",
+ "name": "Bus X15"
+ },
+ {
+ "pid": "L::5::Bus::B2667014228::de:VBN-VSN:554::*",
+ "name": "Bus 554"
+ },
+ {
+ "pid": "L::5::Bus::B2667014228::de:VBN-VSN:556::*",
+ "name": "Bus 556"
+ },
+ {
+ "pid": "L::5::Bus::B2667014228::de:VBN-VSN:509::*",
+ "name": "Bus 509"
+ },
+ {
+ "pid": "L::5::Bus::B3542973073::de:VBN:91::*",
+ "name": "Bus 91"
+ },
+ {
+ "pid": "L::5::Bus::B3542973073::de:VBN:92::*",
+ "name": "Bus 92"
+ },
+ {
+ "pid": "L::5::Bus::B3542973073::de:VBN:94::*",
+ "name": "Bus 94"
+ },
+ {
+ "pid": "L::5::Bus::B3542973073::de:VBN:N7::*",
+ "name": "Bus N7"
+ }
+ ],
+ "polyL": [],
+ "layerL": [
+ {
+ "id": "standard",
+ "name": "standard",
+ "index": 0,
+ "annoCnt": 0
+ }
+ ],
+ "crdSysL": [
+ {
+ "id": "standard",
+ "index": 0,
+ "type": "WGS84"
+ }
+ ],
+ "opL": [],
+ "remL": [],
+ "icoL": [
+ {
+ "res": "HIM0"
+ },
+ {
+ "res": "prod_bus",
+ "fg": {
+ "r": 255,
+ "g": 255,
+ "b": 255
+ },
+ "bg": {
+ "r": 0,
+ "g": 92,
+ "b": 169
+ }
+ }
+ ],
+ "himMsgEdgeL": [
+ {
+ "icoCrd": {
+ "x": 7875575,
+ "y": 52201492
+ }
+ },
+ {
+ "icoCrd": {
+ "x": 9395422,
+ "y": 51748714
+ }
+ },
+ {
+ "icoCrd": {
+ "x": 9435051,
+ "y": 51783147
+ }
+ }
+ ],
+ "himMsgEventL": [
+ {
+ "fDate": "20200203",
+ "fTime": "111100",
+ "tDate": "20201213",
+ "tTime": "000000"
+ },
+ {
+ "fDate": "20191215",
+ "fTime": "000000",
+ "tDate": "20201212",
+ "tTime": "235900"
+ },
+ {
+ "fDate": "20200221",
+ "fTime": "113100",
+ "tDate": "20200630",
+ "tTime": "235900"
+ },
+ {
+ "fDate": "20200221",
+ "fTime": "110100",
+ "tDate": "20200630",
+ "tTime": "235900"
+ }
+ ],
+ "himMsgCatL": [
+ {
+ "id": 0
+ }
+ ]
+ },
+ "msgL": [
+ {
+ "hid": "HIM_FREETEXT_14164",
+ "act": true,
+ "head": "Hinweis zum Flughafenbus X15",
+ "lead": "Der Flughafenbus X15 ist eine Linie der Regionalverkehr Münsterland GmbH (RVM). Es gilt der Westfalentarif. Infos gibt es online unter www.rvm-online.de sowie telefonisch unter der Rufnummer 0180 650 40 30.",
+ "text": "Der Flughafenbus X15 ist eine Linie der Regionalverkehr Münsterland GmbH (RVM). Es gilt der Westfalentarif. Infos gibt es online unter www.rvm-online.de sowie telefonisch unter der Rufnummer 0180 650 40 30.",
+ "icoX": 0,
+ "prio": 6,
+ "prod": 16383,
+ "affProdRefL": [
+ 0
+ ],
+ "lModDate": "20200203",
+ "lModTime": "112429",
+ "sDate": "20200203",
+ "sTime": "111100",
+ "eDate": "20201213",
+ "eTime": "000000",
+ "sDaily": "000000",
+ "eDaily": "235900",
+ "comp": "VOS",
+ "catRefL": [
+ 0
+ ],
+ "pubChL": [
+ {
+ "name": "timetable",
+ "fDate": "20200203",
+ "fTime": "111100",
+ "tDate": "20201231",
+ "tTime": "235900"
+ }
+ ],
+ "edgeRefL": [
+ 0
+ ],
+ "eventRefL": [
+ 0
+ ]
+ },
+ {
+ "hid": "HIM_FREETEXT_9156",
+ "act": true,
+ "head": "Sperrung Weserbrücke Lauenförde-Beverungen",
+ "text": "Aufgrund der Sperrung können die Haltestellen in Beverungen nicht bedient werden.
Lauenförde-Beverungen
Baustellenfahrplan Linie 556",
+ "icoX": 0,
+ "prio": 6,
+ "prod": 16383,
+ "affProdRefL": [
+ 1,
+ 2
+ ],
+ "lModDate": "20191209",
+ "lModTime": "135514",
+ "sDate": "20191215",
+ "sTime": "000000",
+ "eDate": "20201212",
+ "eTime": "235900",
+ "sDaily": "000000",
+ "eDaily": "235900",
+ "comp": "VSN",
+ "catRefL": [
+ 0
+ ],
+ "pubChL": [
+ {
+ "name": "timetable",
+ "fDate": "20190522",
+ "fTime": "100100",
+ "tDate": "20201212",
+ "tTime": "235900"
+ }
+ ],
+ "edgeRefL": [
+ 1
+ ],
+ "eventRefL": [
+ 1
+ ]
+ },
+ {
+ "hid": "HIM_FREETEXT_9155",
+ "act": true,
+ "head": "Sperrung Weserbrücke Lauenförde-Beverungen",
+ "text": "Aufgrund der Sperrung können die Haltestellen in Beverungen nicht bedient werden.
Lauenförde-Beverungen
Baustellenfahrplan Linie 554",
+ "icoX": 0,
+ "prio": 6,
+ "prod": 16383,
+ "affProdRefL": [
+ 3,
+ 1,
+ 2
+ ],
+ "lModDate": "20191209",
+ "lModTime": "135545",
+ "sDate": "20191215",
+ "sTime": "000000",
+ "eDate": "20201212",
+ "eTime": "235900",
+ "sDaily": "000000",
+ "eDaily": "235900",
+ "comp": "VSN",
+ "catRefL": [
+ 0
+ ],
+ "pubChL": [
+ {
+ "name": "timetable",
+ "fDate": "20190522",
+ "fTime": "100100",
+ "tDate": "20201212",
+ "tTime": "235900"
+ }
+ ],
+ "edgeRefL": [
+ 2
+ ],
+ "eventRefL": [
+ 1
+ ]
+ },
+ {
+ "hid": "HIM_FREETEXT_14527",
+ "act": true,
+ "head": "Verlegung einer Stromleitung in der Lindenstraße (Umleitung verschoben)",
+ "text": "Betrifft die Linien 91, 92, 94, N7
Beginn der Umleitung verschoben auf voraussichtlich 16. März bis Juni 2020
Die Bauarbeiten sollten ursprünglich bereits am 2. März beginnen. Ab diesem Datum wurde auch die Umleitung der Buslinien geplant. Bitte beachten Sie, dass die Fahrpläne an den Haltestellen sowie die Fahrplanauskunft im Internet ab 2. März den Bauplan anzeigen, obwohl die Busse bis zum Beginn der Bauarbeiten noch in der regulären Linienführung fahren.
Umleitung ab Baubeginn:
Die Linien 91, 92, 94 und N7 werden in Richtung Vegesack zwischen (H) Bf Blumenthal und (H) Bremer Vulkan über die Straßen Zur Westpier und Am Werfttor umgeleitet.
Haltestellenänderungen in Richtung Vegesack:
(H) Wätjens Park > verlegt vor die Kreuzung Lüssumer Str./Zur Westpier
(H) Margaretenallee > entfällt
",
+ "icoX": 0,
+ "prio": 6,
+ "prod": 32,
+ "affProdRefL": [
+ 4,
+ 5,
+ 6,
+ 7
+ ],
+ "lModDate": "20200221",
+ "lModTime": "113447",
+ "sDate": "20200221",
+ "sTime": "113100",
+ "eDate": "20200630",
+ "eTime": "235900",
+ "sDaily": "000000",
+ "eDaily": "235900",
+ "comp": "BSAG",
+ "catRefL": [
+ 0
+ ],
+ "pubChL": [
+ {
+ "name": "TIMETABLE",
+ "fDate": "20200221",
+ "fTime": "113100",
+ "tDate": "20200630",
+ "tTime": "235900"
+ }
+ ],
+ "eventRefL": [
+ 2
+ ]
+ },
+ {
+ "hid": "HIM_FREETEXT_14525",
+ "act": true,
+ "head": "Verlegung einer Stromleitung in der Lindenstraße",
+ "text": "Betrifft die Linien 91, 92, 94, N7
Beginn der Umleitung verschoben auf voraussichtlich 16. März bis Juni 2020
Die Bauarbeiten sollten ursprünglich bereits am 2. März beginnen. Ab diesem Datum wurde auch die Umleitung der Buslinien geplant. Bitte beachten Sie, dass die Fahrpläne an den Haltestellen sowie die Fahrplanauskunft im Internet ab 2. März den Bauplan anzeigen, obwohl die Busse bis zum Beginn der Bauarbeiten noch in der regulären Linienführung fahren.
Umleitung ab Baubeginn:
Die Linien 91, 92, 94 und N7 werden in Richtung Vegesack zwischen (H) Bf Blumenthal und (H) Bremer Vulkan über die Straßen Zur Westpier und Am Werfttor umgeleitet.
Haltestellenänderungen in Richtung Vegesack:
(H) Wätjens Park > verlegt vor die Kreuzung Lüssumer Str./Zur Westpier
(H) Margaretenallee > entfällt
",
+ "icoX": 0,
+ "prio": 6,
+ "tLocX": 0,
+ "prod": 32,
+ "affProdRefL": [
+ 4,
+ 5,
+ 6,
+ 7
+ ],
+ "lModDate": "20200221",
+ "lModTime": "133105",
+ "sDate": "20200221",
+ "sTime": "110100",
+ "eDate": "20200630",
+ "eTime": "235900",
+ "sDaily": "000000",
+ "eDaily": "235900",
+ "comp": "BSAG",
+ "catRefL": [
+ 0
+ ],
+ "pubChL": [
+ {
+ "name": "timetable",
+ "fDate": "20200221",
+ "fTime": "110100",
+ "tDate": "20200630",
+ "tTime": "235900"
+ }
+ ],
+ "eventRefL": [
+ 3
+ ]
+ }
+ ]
+}
diff --git a/test/index.js b/test/index.js
index d93151f3..e77fd930 100644
--- a/test/index.js
+++ b/test/index.js
@@ -14,6 +14,7 @@ require('./vbb-departures')
require('./bvg-radar')
require('./oebb-trip')
require('./rejseplanen-trip')
+require('./vsn-remarks')
require('./db-netz-remarks')
require('./vsn-departures')
diff --git a/test/vsn-remarks.js b/test/vsn-remarks.js
new file mode 100644
index 00000000..3a02d6a8
--- /dev/null
+++ b/test/vsn-remarks.js
@@ -0,0 +1,27 @@
+'use strict'
+
+const test = require('tape')
+
+const createClient = require('..')
+const rawProfile = require('../p/vsn')
+const res = require('./fixtures/vsn-remarks.json')
+const expected = require('./fixtures/vsn-remarks.js')
+
+const client = createClient(rawProfile, 'public-transport/hafas-client:test')
+const {profile} = client
+
+const opt = {
+ results: 100, // maximum number of remarks
+ // filter by time
+ from: Date.now(), to: null,
+ products: null, // filter by affected products
+}
+
+test('parses a remarks() response correctly (VSN)', (t) => {
+ const common = profile.parseCommon({profile, opt, res})
+ const ctx = {profile, opt, common, res}
+ const warnings = res.msgL.map(w => profile.parseWarning(ctx, w))
+
+ t.deepEqual(warnings, expected)
+ t.end()
+})
diff --git a/tools/debug-cli/cli.js b/tools/debug-cli/cli.js
index eb9105a0..2149c71d 100755
--- a/tools/debug-cli/cli.js
+++ b/tools/debug-cli/cli.js
@@ -39,6 +39,7 @@ const parseArgs = [
['radar', 1, parseJsObject],
['reachableFrom', 0, parseJsObject],
['reachableFrom', 1, parseJsObject],
+ ['remarks', 0, parseJsObject],
['serverInfo', 0, parseJsObject],
]