Skip to content

Commit 5090b99

Browse files
committed
rest.exe: add WIP methods as comments
1 parent 91eb85d commit 5090b99

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

rest-exe-example.js

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const {
1313
locations, nearby,
1414
departures, arrivals,
1515
journeys, trip, tripAlternatives
16+
// tripHistory,
17+
// radar,
18+
// remarks, dataInfo
1619
} = createClient(profile, TOKEN, 'hafas-client example')
1720

1821
const berlinOstkreuz = '8011162'
@@ -30,6 +33,7 @@ const somewhereInBerlin = {type: 'location', address: 'foo', latitude: 52.51072,
3033
// .then(journeys => journeys.flatMap(j => [...j.legs, '---']))
3134
// .then(([journey]) => journey.legs.map(l => l.tripId).find(tripId => !!tripId))
3235
// .then(trip)
36+
// .then(tripHistory)
3337
// tripAlternatives()
3438

3539
locations('leopoldplatz ber')
@@ -41,6 +45,14 @@ locations('leopoldplatz ber')
4145
// arrivals(berlinYorckstrS1, {
4246
// remarks: true
4347
// })
48+
// radar({
49+
// north: 52.52411,
50+
// west: 13.41002,
51+
// south: 52.51942,
52+
// east: 13.41709
53+
// })
54+
// remarks()
55+
// dataInfo()
4456

4557
.then(data => console.log(require('util').inspect(data, {depth: null, colors: true})))
4658
.catch((err) => {

rest-exe.js

+39
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,45 @@ const createRestClient = (profile, token, userAgent) => {
348348
return parseTrip(profile, opt, {})(res)
349349
}
350350

351+
// todo: fails with 404
352+
// const tripHistory = async (tripId) => {
353+
// const res = await request('rtarchive', opt, {
354+
// id: tripId,
355+
// date: profile.formatDate(profile, opt.when || Date.now())
356+
// })
357+
// return res
358+
// }
359+
360+
// todo: fails with 404
361+
// const radar = async (bbox) => {
362+
// const res = await request('journeyPos', opt, {
363+
// llLat: bbox.south,
364+
// llLon: bbox.west,
365+
// urLat: bbox.north,
366+
// urLon: bbox.east,
367+
// // todo: operators, products, attributes, lines, jid, infotexts
368+
// // todo: maxJny, time
369+
// date: profile.formatDate(profile, opt.when || Date.now())
370+
// })
371+
// return res
372+
// }
373+
374+
// todo: fails with 404
375+
// const remarks = async () => {
376+
// const res = await request('himSearch', opt, {
377+
// // todo: dateB, dateE, timeB, timeE, himIds, operators, categories
378+
// // todo: channels, companies, metas, himcategory, poly, searchmode
379+
// // todo: minprio, maxprio
380+
// })
381+
// return res
382+
// }
383+
384+
// todo: fails with 404
385+
// const dataInfo = async () => {
386+
// const res = await request('datainfo', opt)
387+
// return res
388+
// }
389+
351390
return {
352391
locations, nearby,
353392
departures, arrivals,

0 commit comments

Comments
 (0)