Skip to content

Commit

Permalink
find-unknown-fields: basic journeys() schema, VBB & DB queries
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed May 27, 2019
1 parent 8e7fa83 commit b9b4c46
Show file tree
Hide file tree
Showing 2 changed files with 1,514 additions and 1 deletion.
34 changes: 33 additions & 1 deletion find-unknown-fields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,40 @@
const Ajv = require('ajv')
const omit = require('lodash/omit')
const createClient = require('..')
const vbbProfile = require('../p/vbb')
const bvgProfile = require('../p/bvg')
const dbProfile = require('../p/db')
const journeysSchema = require('./journeys.schema.json')
// todo: https://github.com/epoberezkin/ajv#formats
// todo: https://github.com/epoberezkin/ajv#combining-schemas-with-ref

const tasks = []
const fetchJourneys = (from, to) => (client) => {
return client.journeys(from, to, {
results: 3, tickets: true, stopovers: true, remarks: true, polylines: true
})
}
const tasks = [
[
vbbProfile,
fetchJourneys('900000175013', '900000087171'), // Risaer Str. to TXL
journeysSchema
],
[
bvgProfile,
fetchJourneys('900000175013', '900000087171'), // Risaer Str. to TXL
journeysSchema
],
[
dbProfile,
// Siegessäule Berlin to München Hbf
fetchJourneys({
type: 'location', id: '991668043', poi: true,
name: 'Berlin, Siegessäule (Tourismus)',
latitude: 52.515189, longitude: 13.350123
}, '8000261'),
journeysSchema
]
]

const userAgent = 'hafas-client find-unknown-fields'
const fetchResponse = (profile, query) => {
Expand Down
Loading

0 comments on commit b9b4c46

Please sign in to comment.