2017-12-18 23:24:11 +01:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
// todo: https://gist.github.com/anonymous/a5fc856bc80ae7364721943243f934f4#file-haf_config_base-properties-L5
|
|
|
|
// todo: https://gist.github.com/anonymous/a5fc856bc80ae7364721943243f934f4#file-haf_config_base-properties-L47-L234
|
|
|
|
|
2017-12-26 00:58:12 +01:00
|
|
|
const createParseBitmask = require('../../parse/products-bitmask')
|
|
|
|
const createFormatBitmask = require('../../format/products-bitmask')
|
|
|
|
|
2017-12-28 15:29:24 +01:00
|
|
|
const products = require('./products')
|
2017-12-26 00:58:12 +01:00
|
|
|
|
2017-12-18 23:24:11 +01:00
|
|
|
const transformReqBody = (body) => {
|
|
|
|
body.client = {type: 'IPA', id: 'OEBB'}
|
|
|
|
// todo: https://gist.github.com/anonymous/a5fc856bc80ae7364721943243f934f4#file-haf_config_base-properties-L33 shows 1.16
|
|
|
|
body.ver = '1.15'
|
|
|
|
body.auth = {type: 'AID', aid: 'OWDL4fE4ixNiPBBm'}
|
|
|
|
|
|
|
|
return body
|
|
|
|
}
|
|
|
|
|
|
|
|
const oebbProfile = {
|
|
|
|
locale: 'de-AT',
|
|
|
|
timezone: 'Europe/Vienna',
|
|
|
|
// todo: there is also https://beta.verkehrsauskunft.at/bin/mgate.exe
|
|
|
|
endpoint: 'http://fahrplan.oebb.at/bin/mgate.exe',
|
2017-12-26 00:58:12 +01:00
|
|
|
transformReqBody,
|
|
|
|
|
2017-12-28 15:29:24 +01:00
|
|
|
products: products.allProducts,
|
2017-12-26 00:58:12 +01:00
|
|
|
|
2017-12-28 15:29:24 +01:00
|
|
|
parseProducts: createParseBitmask(products.bitmasks),
|
2017-12-26 00:58:12 +01:00
|
|
|
|
2017-12-28 15:29:24 +01:00
|
|
|
formatProducts: createFormatBitmask(products)
|
2017-12-18 23:24:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = oebbProfile
|