diff --git a/api-docs.js b/api-docs.js index 6b7d62e..52a4990 100644 --- a/api-docs.js +++ b/api-docs.js @@ -50,7 +50,7 @@ Uses [\`hafasClient.departures()\`](https://github.com/public-transport/hafas-cl Works like [\`/stops/:id/departures\`](#get-stopsiddepartures), except that it uses [\`hafasClient.arrivals()\`](https://github.com/public-transport/hafas-client/blob/5/docs/arrivals.md) to **arrivals at a stop/station**. `, '/stations': `\ -If the \`query\` parameter is used, it will use [\`db-stations-autocomplete\`](https://npmjs.com/package/db-stations-autocomplete) to autocomplete *Deutsche Bahn*-operated stops/stations. Otherwise, it will filter the stops/stations in [\`db-stations\`](https://npmjs.com/package/db-stations). +If the \`query\` parameter is used, it will use [\`db-stations-autocomplete@2\`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0) to autocomplete *Deutsche Bahn*-operated stops/stations. Otherwise, it will filter the stops/stations in [\`db-stations@3\`](https://github.com/derhuerst/db-stations/tree/3.0.1). Instead of receiving a JSON response, you can request [newline-delimited JSON](http://ndjson.org) by sending \`Accept: application/x-ndjson\`. `, diff --git a/docs/api.md b/docs/api.md index 03251b2..f1bdffb 100644 --- a/docs/api.md +++ b/docs/api.md @@ -466,7 +466,7 @@ curl "https://v5.db.transport.rest/trips/$(echo $trip_id | url-encode)" -s | jq ## `GET /stations` -If the `query` parameter is used, it will use [`db-stations-autocomplete`](https://npmjs.com/package/db-stations-autocomplete) to autocomplete *Deutsche Bahn*-operated stops/stations. Otherwise, it will filter the stops/stations in [`db-stations`](https://npmjs.com/package/db-stations). +If the `query` parameter is used, it will use [`db-stations-autocomplete@2`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0) to autocomplete *Deutsche Bahn*-operated stops/stations. Otherwise, it will filter the stops/stations in [`db-stations@3`](https://github.com/derhuerst/db-stations/tree/3.0.1). Instead of receiving a JSON response, you can request [newline-delimited JSON](http://ndjson.org) by sending `Accept: application/x-ndjson`. @@ -474,7 +474,7 @@ Instead of receiving a JSON response, you can request [newline-delimited JSON](h parameter | description | type | default value ----------|-------------|------|-------------- -`query` | Find stations by name using [`db-stations-autocomplete`](https://npmjs.com/package/db-stations-autocomplete). | string | – +`query` | Find stations by name using [`db-stations-autocomplete@2`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0). | string | – `limit` | *If `query` is used:* Return at most `n` stations. | number | `3` `fuzzy` | *If `query` is used:* Find stations despite typos. | boolean | `false` `completion` | *If `query` is used:* Autocomplete stations. | boolean | `true` diff --git a/routes/station.js b/routes/station.js index 7f005c5..dd9c473 100644 --- a/routes/station.js +++ b/routes/station.js @@ -30,7 +30,7 @@ stationRoute.openapiPaths = { get: { summary: 'Returns a stop/station from `db-stations`.', description: `\ -Returns a stop/station from [\`db-stations\`](https://npmjs.com/package/db-stations).`, +Returns a stop/station from [\`db-stations@3\`](https://github.com/derhuerst/db-stations/tree/3.0.1).`, parameters: [{ name: 'id', in: 'path', @@ -42,7 +42,7 @@ Returns a stop/station from [\`db-stations\`](https://npmjs.com/package/db-stati }], responses: { '2XX': { - description: 'A stop/station, in the [`db-stations` format](https://github.com/derhuerst/db-stations/blob/master/readme.md).', + description: 'A stop/station, in the [`db-stations@3` format](https://github.com/derhuerst/db-stations/blob/3.0.1/readme.md).', content: { 'application/json': { schema: { diff --git a/routes/stations.js b/routes/stations.js index 6a8d32f..a169ff8 100644 --- a/routes/stations.js +++ b/routes/stations.js @@ -114,13 +114,13 @@ stationsRoute.openapiPaths = { get: { summary: 'Autocompletes stops/stations by name or filters stops/stations.', description: `\ -If the \`query\` parameter is used, it will use [\`db-stations-autocomplete\`](https://npmjs.com/package/db-stations-autocomplete) to autocomplete *Deutsche Bahn*-operated stops/stations by name. Otherwise, it will filter the stops/stations in [\`db-stations\`](https://npmjs.com/package/db-stations). +If the \`query\` parameter is used, it will use [\`db-stations-autocomplete@2\`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0) to autocomplete *Deutsche Bahn*-operated stops/stations by name. Otherwise, it will filter the stops/stations in [\`db-stations@3\`](https://github.com/derhuerst/db-stations/tree/3.0.1). Instead of receiving a JSON response, you can request [newline-delimited JSON](http://ndjson.org) by sending \`Accept: application/x-ndjson\`.`, parameters: [{ name: 'query', in: 'query', - description: 'Find stations by name using [`db-stations-autocomplete`](https://npmjs.com/package/db-stations-autocomplete).', + description: 'Find stations by name using [`db-stations-autocomplete@2`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0).', schema: { type: 'string', }, @@ -151,7 +151,7 @@ Instead of receiving a JSON response, you can request [newline-delimited JSON](h }], responses: { '2XX': { - description: 'An array of stops/stations, in the [`db-stations` format](https://github.com/derhuerst/db-stations/blob/master/readme.md).', + description: 'An array of stops/stations, in the [`db-stations@3` format](https://github.com/derhuerst/db-stations/blob/3.0.1/readme.md).', content: { 'application/json': { schema: { @@ -169,7 +169,7 @@ Instead of receiving a JSON response, you can request [newline-delimited JSON](h stationsRoute.queryParameters = { query: { - description: 'Find stations by name using [`db-stations-autocomplete`](https://npmjs.com/package/db-stations-autocomplete).', + description: 'Find stations by name using [`db-stations-autocomplete@2`](https://github.com/derhuerst/db-stations-autocomplete/tree/2.2.0).', type: 'string', defaultStr: '–', },