Skip to content

Commit

Permalink
hafas-client@6 💥📝
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Dec 19, 2022
1 parent 0e43ec2 commit 6439a56
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import createClient from 'hafas-client'
import dbProfile from 'hafas-client/p/db/index.js'
import {createClient} from 'hafas-client'
import {profile as dbProfile} from 'hafas-client/p/db/index.js'

const defaults = {
profile: dbProfile,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"node": ">=18"
},
"dependencies": {
"hafas-client": "^5.0.1"
"hafas-client": "^6.0.1"
},
"devDependencies": {
"eslint": "^8.30.0"
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**A client for the German Railways (DB).** It acts as a consistent and straightforward interface on top of a verbose API.

This project is actually a thin wrapper around [`hafas-client@5`](https://github.com/public-transport/hafas-client/tree/5#hafas-client). [Its docs](https://github.com/public-transport/hafas-client/tree/5/docs) document the API in general.
This project is actually a thin wrapper around [`hafas-client@6`](https://github.com/public-transport/hafas-client/blob/6/readme.md). [Its docs](https://github.com/public-transport/hafas-client/blob/6/docs/readme.md) document the API in general.

![db-rest architecture diagram](https://rawgit.com/derhuerst/db-rest/master/architecture.svg)

Expand All @@ -21,7 +21,7 @@ npm install db-hafas

## API

Check [the docs for `hafas-client@5`](https://github.com/public-transport/hafas-client/tree/5/docs) as well as [its DB-specific customisations](https://github.com/public-transport/hafas-client/blob/5/p/db/readme.md).
Check [the docs for `hafas-client@6`](https://github.com/public-transport/hafas-client/tree/6/docs) as well as [its DB-specific customisations](https://github.com/public-transport/hafas-client/blob/6/p/db/readme.md).


## Getting Started
Expand All @@ -32,7 +32,7 @@ import {createDbHafas} from 'db-hafas'
const hafas = createDbHafas('my-awesome-program')
```

As an example, we will search for a route from *Berlin Jungfernheide* to *München Hbf*. To get the station IDs, use [`locations(query, [opt])`](https://github.com/public-transport/hafas-client/blob/5/docs/locations.md).
As an example, we will search for a route from *Berlin Jungfernheide* to *München Hbf*. To get the station IDs, use [`locations(query, [opt])`](https://github.com/public-transport/hafas-client/blob/6/docs/locations.md).

```javascript
// Berlin Jungfernheide to München Hbf
Expand Down Expand Up @@ -153,7 +153,7 @@ The output will be an array of [`journey` objects in the *Friendly Public Transp
- [db-prices](https://github.com/juliuste/db-prices) – Find the cheapest routes using the DB Sparpreise API.
- [db-stations](https://github.com/derhuerst/db-stations) – An offline list of all DB stations.

Also check [`hafas-client`'s related projects](https://github.com/public-transport/hafas-client/blob/5/readme.md#related-projects).
Also check [`hafas-client`'s related projects](https://github.com/public-transport/hafas-client/blob/6/readme.md#related-projects).


## Contributing
Expand Down
6 changes: 3 additions & 3 deletions retry.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createClient from 'hafas-client'
import withRetrying from 'hafas-client/retry.js'
import dbProfile from 'hafas-client/p/db/index.js'
import {createClient} from 'hafas-client'
import {withRetrying} from 'hafas-client/retry.js'
import {profile as dbProfile} from 'hafas-client/p/db/index.js'

const createRetryingClient = (userAgent, opt = {}) => {
const {retryOpts} = {retryOpts: {}, ...opt}
Expand Down
6 changes: 3 additions & 3 deletions throttle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createClient from 'hafas-client'
import withThrottling from 'hafas-client/throttle.js'
import dbProfile from 'hafas-client/p/db/index.js'
import {createClient} from 'hafas-client'
import {withThrottling} from 'hafas-client/throttle.js'
import {profile as dbProfile} from 'hafas-client/p/db/index.js'

const createThrottledClient = (userAgent, opt = {}) => {
const {
Expand Down

0 comments on commit 6439a56

Please sign in to comment.