Skip to content

Commit

Permalink
rest.exe: more methods as comments [wip]
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Nov 28, 2020
1 parent db44599 commit 6d310cf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest-exe-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const {
locations, nearby,
departures, arrivals,
journeys, trip, tripAlternatives
// tripHistory,
// radar,
// remarks, dataInfo
} = createClient(profile, TOKEN, 'hafas-client example')

const berlinOstkreuz = '8011162'
Expand Down
39 changes: 39 additions & 0 deletions rest-exe.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,45 @@ const createRestClient = (profile, token, userAgent) => {
return profile.parseTrip(ctx, ctx.res)
}

// todo: fails with 404
// const tripHistory = async (tripId) => {
// const ctx = await request('rtarchive', opt, {
// id: tripId,
// date: profile.formatDate({profile, opt}, opt.when || Date.now())
// })
// return ctx.res
// }

// todo: fails with 404
// const radar = async (bbox) => {
// const ctx = await request('journeyPos', opt, {
// llLat: bbox.south,
// llLon: bbox.west,
// urLat: bbox.north,
// urLon: bbox.east,
// // todo: operators, products, attributes, lines, jid, infotexts
// // todo: maxJny, time
// date: profile.formatDate({profile, opt}, opt.when || Date.now())
// })
// return ctx.res
// }

// todo: fails with 404
// const remarks = async () => {
// const ctx = await request('himSearch', opt, {
// // todo: dateB, dateE, timeB, timeE, himIds, operators, categories
// // todo: channels, companies, metas, himcategory, poly, searchmode
// // todo: minprio, maxprio
// })
// return ctx.res
// }

// todo: fails with 404
// const dataInfo = async () => {
// const ctx = await request('datainfo', opt)
// return ctx.res
// }

const client = {
locations, nearby,
departures, arrivals,
Expand Down

0 comments on commit 6d310cf

Please sign in to comment.