From 47a77d7dd2948a6fe1b2670cc051419c4fcb9623 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 24 Aug 2018 19:28:31 +0200 Subject: [PATCH] CMTA: enable feature flags, minor changes --- p/cmta/example.js | 3 +++ p/cmta/index.js | 13 ++++++++++--- p/cmta/readme.md | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/p/cmta/example.js b/p/cmta/example.js index 3faaa1d4..ae086e8f 100644 --- a/p/cmta/example.js +++ b/p/cmta/example.js @@ -27,6 +27,9 @@ client.journeys('000002370', '000005919', {results: 1, polylines: true}) // const leg = journey.legs[0] // return client.trip(leg.id, leg.line.name, {polyline: true}) // }) +// .then(([journey]) => { +// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true}) +// }) .then((data) => { console.log(require('util').inspect(data, {depth: null})) diff --git a/p/cmta/index.js b/p/cmta/index.js index aed3f1da..9405cd14 100644 --- a/p/cmta/index.js +++ b/p/cmta/index.js @@ -3,10 +3,16 @@ const products = require('./products') 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.ver = '1.13' body.auth = {type: 'AID', aid: 'weblwemrcrlwemlcri'} + // todo: `body.id = 'ztgcgxywk88bgm88'` return body } @@ -19,8 +25,9 @@ const cmtaProfile = { products, - journeyLeg: true, - radar: true + trip: true, + radar: true, + refreshJourney: true } module.exports = cmtaProfile diff --git a/p/cmta/readme.md b/p/cmta/readme.md index 901f4336..a51193d5 100644 --- a/p/cmta/readme.md +++ b/p/cmta/readme.md @@ -1,6 +1,6 @@ # 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