mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
DB: use JSON base profile
This commit is contained in:
parent
51af991e38
commit
6c4785b05b
3 changed files with 19 additions and 8 deletions
16
p/db/base.json
Normal file
16
p/db/base.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"auth": {
|
||||
"type": "AID",
|
||||
"aid": "n91dB8Z77MLdoR0K"
|
||||
},
|
||||
"salt": "6264493855566A34304B356676787766",
|
||||
"client": {
|
||||
"id": "DB",
|
||||
"v": "16040000",
|
||||
"type": "IPH",
|
||||
"name": "DB Navigator"
|
||||
},
|
||||
"endpoint": "https://reiseauskunft.bahn.de/bin/mgate.exe",
|
||||
"ext": "DB.R19.04.a",
|
||||
"ver": "1.15"
|
||||
}
|
|
@ -17,6 +17,7 @@ const _formatStation = require('../../format/station')
|
|||
const {bike} = require('../../format/filters')
|
||||
|
||||
const products = require('./products')
|
||||
const baseProfile = require('./base.json')
|
||||
const formatLoyaltyCard = require('./loyalty-cards').format
|
||||
|
||||
const transformReqBody = (ctx, body) => {
|
||||
|
@ -25,11 +26,6 @@ const transformReqBody = (ctx, body) => {
|
|||
// see https://pastebin.com/qZ9WS3Cx
|
||||
req.cfg = {...req.cfg, rtMode: 'HYBRID'} // todo: use `REALTIME`?
|
||||
|
||||
body.client = {id: 'DB', v: '16040000', type: 'IPH', name: 'DB Navigator'}
|
||||
body.ext = 'DB.R19.04.a'
|
||||
body.ver = '1.15'
|
||||
body.auth = {type: 'AID', aid: 'n91dB8Z77MLdoR0K'}
|
||||
|
||||
return body
|
||||
}
|
||||
|
||||
|
@ -447,11 +443,9 @@ const formatStation = (id) => {
|
|||
// todo: find option for absolute number of results
|
||||
|
||||
const dbProfile = {
|
||||
...baseProfile,
|
||||
locale: 'de-DE',
|
||||
timezone: 'Europe/Berlin',
|
||||
endpoint: 'https://reiseauskunft.bahn.de/bin/mgate.exe',
|
||||
|
||||
salt: Buffer.from('bdI8UVj40K5fvxwf', 'utf8'),
|
||||
addChecksum: true,
|
||||
|
||||
transformReqBody,
|
||||
|
|
|
@ -22,3 +22,4 @@ ext: .options.ext, \
|
|||
ver: .options.version, \
|
||||
}"
|
||||
|
||||
jq -r --tab "$query" <"$src/de/db-hafas-mgate.json" >../p/db/base.json
|
||||
|
|
Loading…
Add table
Reference in a new issue