CMTA: enable feature flags, minor changes

This commit is contained in:
Jannis R 2018-08-24 19:28:31 +02:00 committed by Jannis Redmann
parent 77994bc5d1
commit 47a77d7dd2
3 changed files with 14 additions and 4 deletions

View file

@ -27,6 +27,9 @@ client.journeys('000002370', '000005919', {results: 1, polylines: true})
// const leg = journey.legs[0] // const leg = journey.legs[0]
// return client.trip(leg.id, leg.line.name, {polyline: true}) // return client.trip(leg.id, leg.line.name, {polyline: true})
// }) // })
// .then(([journey]) => {
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
// })
.then((data) => { .then((data) => {
console.log(require('util').inspect(data, {depth: null})) console.log(require('util').inspect(data, {depth: null}))

View file

@ -3,10 +3,16 @@
const products = require('./products') const products = require('./products')
const transformReqBody = (body) => { const transformReqBody = (body) => {
body.client = {type: 'WEB', id: 'CMTA', name: 'webapp', l: ''} body.client = {
type: 'WEB',
id: 'CMTA',
name: 'webapp',
l: '' // todo: what is this?
}
body.ext = 'SBB.TZT.1' body.ext = 'SBB.TZT.1'
body.ver = '1.13' body.ver = '1.13'
body.auth = {type: 'AID', aid: 'weblwemrcrlwemlcri'} body.auth = {type: 'AID', aid: 'weblwemrcrlwemlcri'}
// todo: `body.id = 'ztgcgxywk88bgm88'`
return body return body
} }
@ -19,8 +25,9 @@ const cmtaProfile = {
products, products,
journeyLeg: true, trip: true,
radar: true radar: true,
refreshJourney: true
} }
module.exports = cmtaProfile module.exports = cmtaProfile

View file

@ -1,6 +1,6 @@
# CMTA profile for `hafas-client` # CMTA profile for `hafas-client`
[*Capital Metropolitan Transportation Authority (CMTA)*](https://en.wikipedia.org/wiki/Capital_Metropolitan_Transportation_Authority) or CapMetro is a public transportation provider serving [Austin, Texas](https://en.wikipedia.org/wiki/Austin,_Texas) metropolitan area. This profile adds *CMTA*-specific customizations to `hafas-client`. [*Capital Metropolitan Transportation Authority (CMTA)* or *CapMetro*](https://en.wikipedia.org/wiki/Capital_Metropolitan_Transportation_Authority) is a public transportation provider serving [Austin, Texas](https://en.wikipedia.org/wiki/Austin,_Texas) metropolitan area. This profile adds *CMTA*-specific customizations to `hafas-client`.
## Usage ## Usage