diff --git a/docs/departures.md b/docs/departures.md index 4e7a7f85..be7db3eb 100644 --- a/docs/departures.md +++ b/docs/departures.md @@ -46,7 +46,7 @@ If you pass an object `opt.products`, its fields will partially override the def *Note:* As stated in the [*Friendly Public Transport Format* v2 draft spec](https://github.com/public-transport/friendly-public-transport-format/blob/3bd36faa721e85d9f5ca58fb0f38cdbedb87bbca/spec/readme.md), the `when` field includes the current delay. The `delay` field, if present, expresses how much the former differs from the schedule. -You may pass a departure's `tripId` into [`trip(id, lineName, [opt])`](trip.md) to get details on the whole trip. For the `dbnav` profile HAFAS trip ids will be returned, for the `db` profile, RIS trip ids will be returned, then the `trip()` endpoint support both id types. +You may pass a departure's `tripId` into [`trip(id, lineName, [opt])`](trip.md) to get details on the whole trip. For the `dbnav` profile HAFAS trip ids will be returned, for the `db` profile, RIS trip ids will be returned, then the `trip()` endpoint supports both id types. For `db` profile, cancelled trips will not be contained in the response! diff --git a/docs/journeys.md b/docs/journeys.md index e02a2820..b930f5bd 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -76,8 +76,8 @@ With `opt`, you can override the default options, which look like this: entrances: true, // not supported remarks: true, // parse & expose hints & warnings? scheduledDays: false, // not yet supported - firstClass: true // first or second class for tickets - loyaltyCard: '' // BahnCards etc., see below + firstClass: false, // first or second class for tickets + loyaltyCard: null, // BahnCards etc., see below language: 'en', // language to get results in } ``` @@ -89,10 +89,10 @@ With `opt`, you can override the default options, which look like this: ```js import {createClient} 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/vbb/index.js' +import {profile as dbProfile} from 'db-vendo-client/p/db/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbProfile, userAgent) // Frankfurt to Stuttgart await client.journeys('8000105', '8000096', { @@ -316,4 +316,4 @@ hafas.journeys(from, to, { ## The `routingMode` option -The `routingMode` option is not supported by db-vendo-client. The behavior will be the same as the `HYBRID` mode of hafas-client, i.e. cancelled trains/infeasible journeys will also be contained for informational purpose. \ No newline at end of file +The `routingMode` option is not supported by db-vendo-client. The behavior will be the same as the [`HYBRID` mode of hafas-client](https://github.com/public-transport/hafas-client/blob/main/p/db/readme.md#using-the-routingmode-option), i.e. cancelled trains/infeasible journeys will also be contained for informational purpose. \ No newline at end of file diff --git a/docs/locations.md b/docs/locations.md index 75f17fe4..e1567708 100644 --- a/docs/locations.md +++ b/docs/locations.md @@ -20,14 +20,13 @@ With `opt`, you can override the default options, which look like this: ## Response -As an example, we're going to use the [VBB profile](../p/vbb): ```js import {createClient} from 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/vbb/index.js' +import {profile as dbnavProfile} from 'db-vendo-client/p/dbnav/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbnavProfile, userAgent) await client.locations('Alexanderplatz', {results: 3}) ``` diff --git a/docs/nearby.md b/docs/nearby.md index ef3c8fef..9e0611b4 100644 --- a/docs/nearby.md +++ b/docs/nearby.md @@ -21,14 +21,12 @@ With `opt`, you can override the default options, which look like this: ## Response -As an example, we're going to use the [VBB profile](../p/vbb): - ```js import {createClient} from 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/vbb/index.js' +import {profile as dbProfile} from 'db-vendo-client/p/db/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbProfile, userAgent) await client.nearby({ type: 'location', diff --git a/docs/readme.md b/docs/readme.md index c7818d72..8a4b09f3 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -143,13 +143,10 @@ Each `HafasError` error has the following properties: ## Using `db-vendo-client` from another language -If you want to use `db-vendo-client` to access DB APIs but work with non-Node.js environments, you can use it together with [hafas-rest-api](https://github.com/public-transport/hafas-rest-api) to create a REST API(see the [root readme](https://github.com/public-transport/db-vendo-client/tree/main#usage) and the Docker image). +If you want to use `db-vendo-client` to access DB APIs but work with non-Node.js environments, you can use it together with [hafas-rest-api](https://github.com/public-transport/hafas-rest-api) to create a REST API (see the [root readme](https://github.com/public-transport/db-vendo-client/tree/main#usage) and the Docker image). Or use [`hafas-client-rpc`](https://github.com/derhuerst/hafas-client-rpc) to create a [JSON-RPC](https://www.jsonrpc.org) interface that you can send commands to. -## Writing a profile -Check [the guide](writing-a-profile.md). +## General documentation and notes for DB APIs -## General documentation for `mgate.exe` APIs - -[`hafas-mgate-api.md`](hafas-mgate-api.md) +[`db-apis.md`](db-apis.md) diff --git a/docs/refresh-journey.md b/docs/refresh-journey.md index 99e11787..723fd8eb 100644 --- a/docs/refresh-journey.md +++ b/docs/refresh-journey.md @@ -20,10 +20,10 @@ With `opt`, you can override the default options, which look like this: ```js import {createClient} from 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/vbb/index.js' +import {profile as dbProfile} from 'db-vendo-client/p/db/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbProfile, userAgent) const {journeys} = await client.journeys('8000105', '8000096', {results: 1}) diff --git a/docs/stop.md b/docs/stop.md index 78ca415a..bc826c88 100644 --- a/docs/stop.md +++ b/docs/stop.md @@ -34,14 +34,13 @@ With `opt`, you can override the default options, which look like this: ## Response -As an example, we're going to use the [VBB profile](../p/vbb): ```js import {createClient} from 'hafas-client' -import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js' +import {profile as dbProfile} from 'hafas-client/p/db/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbProfile, userAgent) await client.stop('900000042101') // U Spichernstr. ``` @@ -74,11 +73,6 @@ The result may look like this: product: 'subway', public: true, name: 'U1', - symbol: 'U', - nr: 1, - metro: false, - express: false, - night: false }, // … { @@ -88,21 +82,6 @@ The result may look like this: product: 'bus', public: true, name: 'N9', - symbol: 'N', - nr: 9, - metro: false, - express: false, - night: true } ] } ``` - -If the endpoint returns a list of entrances for a station, the resulting station object will have an `entrances` array looking similar to this: - -```js -[ - {type: 'location', latitude: 47.411069, longitude: 10.277412}, - {type: 'location', latitude: 47.410493, longitude: 10.277223}, - {type: 'location', latitude: 47.410754, longitude: 10.278023} -] -``` diff --git a/docs/trip.md b/docs/trip.md index 9c59f31f..391b1960 100644 --- a/docs/trip.md +++ b/docs/trip.md @@ -6,10 +6,10 @@ Let's say you used [`journeys`](journeys.md) and now want to get more up-to-date ```js import {createClient} from 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/dbnav/index.js' +import {profile as dbnavProfile} from 'db-vendo-client/p/dbnav/index.js' const userAgent = 'link-to-your-project-or-email' // adapt this to your project! -const client = createClient(vbbProfile, userAgent) +const client = createClient(dbnavProfile, userAgent) const {journeys} = client.journeys('8000096', '8000105', {results: 1}) const leg = journeys[0].legs[0] @@ -37,9 +37,9 @@ With `opt`, you can override the default options, which look like this: ```js import {createClient} from 'db-vendo-client' -import {profile as vbbProfile} from 'db-vendo-client/p/dbnav/index.js' +import {profile as dbnavProfile} from 'db-vendo-client/p/dbnav/index.js' -const client = createClient(vbbProfile) +const client = createClient(dbnavProfile) const { trip,