db-vendo-client/p/db-busradar-nrw/index.js

99 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2022-05-07 16:17:37 +02:00
// todo: use import assertions once they're supported by Node.js & ESLint
// https://github.com/tc39/proposal-import-assertions
import {createRequire} from 'module'
const require = createRequire(import.meta.url)
2019-08-20 23:47:12 +02:00
const baseProfile = require('./base.json')
2019-08-20 23:47:12 +02:00
// DB Busradar NRW app does not allow selecting specific modes of transport to filter results,
// so the bitmasks had to be determined by querying some stations and looking at the results..
const products = [
{
id: 'national-express',
2019-08-20 23:47:12 +02:00
mode: 'train',
bitmasks: [1],
name: 'InterCityExpress',
short: 'ICE',
default: true
},
{
id: 'national',
mode: 'train',
bitmasks: [2],
name: 'InterCity & EuroCity',
short: 'IC/EC',
default: true
},
// todo: not always true when a station has RE stopping at it
// maybe something else?
2019-08-20 23:47:12 +02:00
{
id: 'regional-express',
2019-08-20 23:47:12 +02:00
mode: 'train',
bitmasks: [4],
name: 'Regionalexpress',
short: 'RE',
default: true
},
// todo: also used for replacement service incl. S-Bahn replacement
2019-08-20 23:47:12 +02:00
{
id: 'regional',
mode: 'train',
bitmasks: [8],
name: 'Regionalzug',
short: 'RB/RE',
default: true
},
{
id: 'suburban',
mode: 'train',
bitmasks: [16],
name: 'S-Bahn',
short: 'S',
default: true
},
{
id: 'bus',
mode: 'bus',
bitmasks: [32],
name: 'Bus',
short: 'Bus',
default: true
},
{
id: 'ferry',
mode: 'watercraft',
bitmasks: [64],
name: 'Ferry',
short: 'F',
default: true
},
// todo: are `128` & `256` unused?
2019-08-20 23:47:12 +02:00
{
id: 'taxi',
mode: 'taxi',
bitmasks: [512],
name: 'AnrufSammelTaxi',
short: 'AST',
default: true
}
]
2022-05-07 16:17:37 +02:00
const profile = {
...baseProfile,
2019-08-20 23:47:12 +02:00
locale: 'de-DE',
timezone: 'Europe/Berlin',
products: products,
refreshJourneyUseOutReconL: true,
2019-12-29 22:16:45 +01:00
journeysOutFrwd: false,
2019-08-20 23:47:12 +02:00
trip: true,
2020-09-16 17:21:59 +02:00
radar: true,
remarks: true, // `.svcResL[0].res.msgL[]` is missing though 🤔
lines: false, // `.svcResL[0].res.lineL[]` is missing 🤔
2019-08-20 23:47:12 +02:00
}
2022-05-07 16:17:37 +02:00
export {
profile,
}