2021-01-15 01:17:15 +01:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const createClient = require('../..')
|
|
|
|
const vosProfile = require('.')
|
|
|
|
|
|
|
|
const client = createClient(vosProfile, 'hafas-client-example')
|
|
|
|
|
|
|
|
const spittalMittelschule = '420512200'
|
|
|
|
const klagenfurtSteingasse = '420649500'
|
|
|
|
|
|
|
|
// client.journeys(spittalMittelschule, klagenfurtSteingasse, {results: 1, stopovers: true})
|
|
|
|
|
|
|
|
// .then(({journeys}) => {
|
|
|
|
// const [journey] = journeys
|
|
|
|
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then(({journeys}) => {
|
|
|
|
// const [journey] = journeys
|
|
|
|
// const leg = journey.legs[0]
|
2021-12-29 21:33:42 +01:00
|
|
|
// return client.trip(leg.tripId, {polyline: true})
|
2021-01-15 01:17:15 +01:00
|
|
|
// })
|
|
|
|
|
|
|
|
// client.departures(spittalMittelschule, {duration: 1})
|
|
|
|
// client.arrivals(spittalMittelschule, {duration: 10, linesOfStops: true})
|
|
|
|
|
|
|
|
client.locations('steingasse', {results: 3})
|
|
|
|
// client.stop(spittalMittelschule, {linesOfStops: true})
|
|
|
|
// client.nearby({
|
|
|
|
// type: 'location',
|
|
|
|
// latitude: 46.617968,
|
|
|
|
// longitude: 14.297595,
|
|
|
|
// }, {distance: 500})
|
|
|
|
// client.reachableFrom({
|
|
|
|
// type: 'location',
|
|
|
|
// id: '980025809',
|
|
|
|
// address: 'Eckengasse 9, 9020 Klagenfurt am Wörthersee',
|
|
|
|
// latitude: 46.617968,
|
|
|
|
// longitude: 14.297595,
|
|
|
|
// }, {
|
|
|
|
// maxDuration: 8,
|
|
|
|
// })
|
|
|
|
|
|
|
|
.then((data) => {
|
|
|
|
console.log(require('util').inspect(data, {depth: null, colors: true}))
|
|
|
|
})
|
|
|
|
.catch(console.error)
|