From 1b03b2eb0fa83146c23e2dc7ae54d3fa02702899 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sat, 7 Mar 2020 00:35:32 +0100 Subject: [PATCH] INSA: v1.21, enable reachableFrom() --- p/insa/example.js | 14 +++++++++----- p/insa/index.js | 8 ++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/p/insa/example.js b/p/insa/example.js index 45c0c20a..624eec3b 100644 --- a/p/insa/example.js +++ b/p/insa/example.js @@ -5,6 +5,13 @@ const insaProfile = require('.') const client = createClient(insaProfile, 'hafas-client-example') +const hellestr1 = { + type: 'location', + id: '980801263', + address: 'Magdeburg - Leipziger Straße, Hellestraße 1', + latitude: 52.116706, longitude: 11.621821 +} + // from Magdeburg-Neustadt to Magdeburg-Buckau client.journeys('008010226', '008013456', {results: 1}) // client.departures('008010226', { duration: 5 }) @@ -12,17 +19,14 @@ client.journeys('008010226', '008013456', {results: 1}) // client.locations('Magdeburg Hbf', {results: 2}) // client.locations('Kunstmuseum Kloster Unser Lieben Frauen Magdeburg', {results: 2}) // client.stop('008010226') // Magdeburg-Neustadt -// client.nearby({ -// type: 'location', -// latitude: 52.148842, -// longitude: 11.641705 -// }, {distance: 200}) +// client.nearby(hellestr1) // client.radar({ // north: 52.148364, // west: 11.600826, // south: 52.108486, // east: 11.651451 // }, {results: 10}) +// client.reachableFrom(hellestr1, {maxDuration: 10}) // .then(({journeys}) => { // const [journey] = journeys diff --git a/p/insa/index.js b/p/insa/index.js index 17aa7262..e86e9cf2 100644 --- a/p/insa/index.js +++ b/p/insa/index.js @@ -10,8 +10,8 @@ const transformReqBody = (ctx, body) => { name: 'nasaPROD', os: 'iPhone OS 11.2.5' } - body.ver = '1.11' - body.auth = {aid: "nasa-apps"} + body.ver = '1.21' + body.auth = {type: 'AID', aid: "nasa-apps"} body.lang = 'en' // todo: `de`? return body @@ -27,8 +27,8 @@ const insaProfile = { trip: true, radar: true, - refreshJourney: false - // todo: upgrade to version `1.13` in order to enable `reachableFrom: true` + refreshJourney: false, + reachableFrom: true, } module.exports = insaProfile;