2020-02-06 16:25:21 +01:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const products = require('./products')
|
|
|
|
|
|
|
|
const transformReqBody = (ctx, body) => {
|
|
|
|
body.client = {type: 'IPA', id: 'VSN', name: 'vsn', v: '5030100', os: 'iOS 13.3'}
|
|
|
|
body.ver = '1.24'
|
|
|
|
body.auth = {type: 'AID', aid: 'Mpf5UPC0DmzV8jkg'}
|
|
|
|
body.lang = 'de'
|
|
|
|
|
|
|
|
return body
|
|
|
|
}
|
|
|
|
|
2020-02-07 02:31:51 +01:00
|
|
|
const formatRefreshJourneyReq = (ctx, refreshToken) => {
|
|
|
|
const {profile, opt} = ctx
|
|
|
|
|
|
|
|
return {
|
|
|
|
meth: 'Reconstruction',
|
|
|
|
req: {
|
|
|
|
outReconL: [{ctx: refreshToken}],
|
|
|
|
getIST: true, // todo: make an option
|
|
|
|
getPasslist: !!opt.stopovers,
|
|
|
|
getPolyline: !!opt.polylines,
|
|
|
|
getTariff: !!opt.tickets
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-06 16:25:21 +01:00
|
|
|
const vsnProfile = {
|
|
|
|
locale: 'de-DE',
|
|
|
|
timezone: 'Europe/Berlin',
|
|
|
|
endpoint: 'https://fahrplaner.vsninfo.de/hafas/mgate.exe',
|
|
|
|
|
|
|
|
// https://gist.github.com/n0emis/3b6887572793f4f54da9d83b30548332#file-haf_config_base-properties-L31
|
|
|
|
// https://runkit.com/derhuerst/hafas-decrypt-encrypted-mac-salt
|
|
|
|
salt: Buffer.from('535033316d4275665379434c6d4e7870', 'hex'),
|
|
|
|
addMicMac: true,
|
|
|
|
|
|
|
|
transformReqBody,
|
2020-02-07 02:31:51 +01:00
|
|
|
formatRefreshJourneyReq,
|
2020-02-06 16:25:21 +01:00
|
|
|
|
|
|
|
products: products,
|
|
|
|
|
|
|
|
trip: true,
|
|
|
|
radar: true,
|
|
|
|
refreshJourney: true,
|
|
|
|
reachableFrom: true,
|
|
|
|
|
|
|
|
departuresGetPasslist: false,
|
|
|
|
departuresStbFltrEquiv: false
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = vsnProfile
|