mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parent
3791ec25e2
commit
d8805d9ea3
100 changed files with 150 additions and 150 deletions
|
@ -44,7 +44,7 @@ If you pass an object `opt.products`, its fields will partially override the def
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ As an example, we're going to use the [*Deutsche Bahn* profile](../p/db):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {dbProfile} from 'hafas-client/p/db.js'
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
const berlinSüdkreuz = '8011113'
|
const berlinSüdkreuz = '8011113'
|
||||||
const münchenHbf = '8000261'
|
const münchenHbf = '8000261'
|
||||||
|
|
|
@ -86,7 +86,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} 'hafas-client'
|
import {createClient} 'hafas-client'
|
||||||
import {vbbProfile} 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ As an example, we're going to use the [SVV profile](../p/svv):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {svvProfile} from 'hafas-client/p/svv.js'
|
import {profileas svvProfile} from 'hafas-client/p/svv/index.js'
|
||||||
|
|
||||||
const client = createClient(svvProfile, 'my-awesome-program')
|
const client = createClient(svvProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ There's opt-in support for throttling requests to the endpoint.
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {withThrottling} from 'hafas-client/throttle.js'
|
import {withThrottling} from 'hafas-client/throttle.js'
|
||||||
import {dbProfile} from 'hafas-client/p/db.js'
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
// create a throttled HAFAS client with Deutsche Bahn profile
|
// create a throttled HAFAS client with Deutsche Bahn profile
|
||||||
const client = createClient(withThrottling(dbProfile), 'my-awesome-program')
|
const client = createClient(withThrottling(dbProfile), 'my-awesome-program')
|
||||||
|
@ -37,7 +37,7 @@ There's opt-in support for retrying failed requests to the endpoint.
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {withRetrying} from 'hafas-client/retry.js'
|
import {withRetrying} from 'hafas-client/retry.js'
|
||||||
import {dbProfile} from 'hafas-client/p/db.js'
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
// create a client with Deutsche Bahn profile that will retry on HAFAS errors
|
// create a client with Deutsche Bahn profile that will retry on HAFAS errors
|
||||||
const client = createClient(withRetrying(dbProfile), 'my-awesome-program')
|
const client = createClient(withRetrying(dbProfile), 'my-awesome-program')
|
||||||
|
@ -86,12 +86,12 @@ You can use `profile.logRequest` and `profile.logResponse` to process the raw [F
|
||||||
As an example, we can implement a custom logger:
|
As an example, we can implement a custom logger:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const createClient = require('hafas-client')
|
import {createClient} from 'hafas-client'
|
||||||
const dbProfile = require('hafas-client/p/db')
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
const logRequest = (ctx, fetchRequest, requestId) => {
|
const logRequest = (ctx, fetchRequest, requestId) => {
|
||||||
// ctx looks just like with the other profile.* hooks:
|
// ctx looks just like with the other profile.* hooks:
|
||||||
const {profile, opt} = ctx
|
const {dbProfile, opt} = ctx
|
||||||
|
|
||||||
console.debug(requestId, fetchRequest.headers, fetchRequest.body + '')
|
console.debug(requestId, fetchRequest.headers, fetchRequest.body + '')
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile)
|
const client = createClient(vbbProfile)
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ As an example, we're going to use the [SVV profile](../p/svv):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {svvProfile} from 'hafas-client/p/svv.js'
|
import {profile as svvProfile} from 'hafas-client/p/svv/index.js'
|
||||||
|
|
||||||
const client = createClient(svvProfile, 'my-awesome-program')
|
const client = createClient(svvProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ As an example, we're going to use the [SVV profile](../p/svv):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {svvProfile} from 'hafas-client/p/svv.js'
|
import {profile as svvProfile} from 'hafas-client/p/svv/index.js'
|
||||||
|
|
||||||
const client = createClient(svvProfile, 'my-awesome-program')
|
const client = createClient(svvProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Let's say you used [`journeys`](journeys.md) and now want to get more up-to-date
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb/index.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile)
|
const client = createClient(vbbProfile)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ As an example, we're going to use the [VBB profile](../p/vbb):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as avvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(avvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const rwth = '1057'
|
const rwth = '1057'
|
||||||
const kronenberg = '1397'
|
const kronenberg = '1397'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {avvProfile} from 'hafas-client/p/avv/index.js'
|
import {profile as avvProfile} from 'hafas-client/p/avv/index.js'
|
||||||
|
|
||||||
// create a client with AVV profile
|
// create a client with AVV profile
|
||||||
const client = createClient(avvProfile, 'my-awesome-program')
|
const client = createClient(avvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as bartProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(bartProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const fremont = '100013296'
|
const fremont = '100013296'
|
||||||
const embarcadero = '100013295'
|
const embarcadero = '100013295'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {bartProfile} from 'hafas-client/p/bart/index.js'
|
import {profile as bartProfile} from 'hafas-client/p/bart/index.js'
|
||||||
|
|
||||||
// create a client with BART profile
|
// create a client with BART profile
|
||||||
const client = createClient(bartProfile, 'my-awesome-program')
|
const client = createClient(bartProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as blsProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(blsProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const bernDennigkofengässli = '8590093'
|
const bernDennigkofengässli = '8590093'
|
||||||
const münsingenSpital = '8578932'
|
const münsingenSpital = '8578932'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {blsProfile} from 'hafas-client/p/bls/index.js'
|
import {profile as blsProfile} from 'hafas-client/p/bls/index.js'
|
||||||
|
|
||||||
// create a client with BLS profile
|
// create a client with BLS profile
|
||||||
const client = createClient(blsProfile, 'my-awesome-program')
|
const client = createClient(blsProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as bvgProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(bvgProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Hauptbahnhof to Charlottenburg
|
// Hauptbahnhof to Charlottenburg
|
||||||
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {bvgProfile} from 'hafas-client/p/bvg/index.js'
|
import {profile as bvgProfile} from 'hafas-client/p/bvg/index.js'
|
||||||
|
|
||||||
// create a client with BVG profile
|
// create a client with BVG profile
|
||||||
const client = createClient(bvgProfile, 'my-awesome-program')
|
const client = createClient(bvgProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as cflProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(cflProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const mersch = '9864348'
|
const mersch = '9864348'
|
||||||
const bruxellesCentral = '8800003'
|
const bruxellesCentral = '8800003'
|
||||||
|
|
|
@ -6,10 +6,10 @@ The [*Société Nationale des Chemins de Fer Luxembourgeois (CFL)*](https://en.w
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {cflProfile} from 'hafas-client/p/cfl/index.js'
|
import {profile as cflProfile} from 'hafas-client/p/cfl/index.js'
|
||||||
|
|
||||||
// create a client with CFL profile
|
// create a client with CFL profile
|
||||||
const client = createClient(cflProfile)
|
const client = createClient(cflProfile, 'my-awesome-program')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as cmtaProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(cmtaProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Broadie Oaks to Domain
|
// Broadie Oaks to Domain
|
||||||
client.journeys('000002370', '000005919', {results: 1, polylines: true})
|
client.journeys('000002370', '000005919', {results: 1, polylines: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {cmtaProfile} from 'hafas-client/p/cmta/index.js'
|
import {profile as cmtaProfile} from 'hafas-client/p/cmta/index.js'
|
||||||
|
|
||||||
// create a client with CMTA profile
|
// create a client with CMTA profile
|
||||||
const client = createClient(cmtaProfile, 'my-awesome-program')
|
const client = createClient(cmtaProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as dartProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(dartProfile, 'hafas-client example')
|
||||||
|
|
||||||
const mlkJrPkwyAdamsAveDsm2055 = '100002702'
|
const mlkJrPkwyAdamsAveDsm2055 = '100002702'
|
||||||
const se5thStEHackleyAveDsm2294 = '100004972'
|
const se5thStEHackleyAveDsm2294 = '100004972'
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {dartProfile} from 'hafas-client/p/dart/index.js'
|
import {profile as dartProfile} from 'hafas-client/p/dart/index.js'
|
||||||
|
|
||||||
// create a client with DART profile
|
// create a client with DART profile
|
||||||
const client = createClient(dartProfile, 'my-awesome-program')
|
const client = createClient(dartProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as dbbusradarnrwProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(dbbusradarnrwProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Hagen Bauhaus to Schwerte Bahnhof
|
// Hagen Bauhaus to Schwerte Bahnhof
|
||||||
// returns hafas error PARSE
|
// returns hafas error PARSE
|
||||||
|
|
|
@ -12,7 +12,7 @@ This profile adapts `hafas-client` to the HAFAS endpoint used by the application
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {dbbusradarnrwProfile} from 'hafas-client/p/db-busradar-nrw/index.js'
|
import {profile as dbbusradarnrwProfile} from 'hafas-client/p/db-busradar-nrw/index.js'
|
||||||
|
|
||||||
// create a client with DB Busradar NRW profile
|
// create a client with DB Busradar NRW profile
|
||||||
const client = createClient(dbbusradarnrwProfile, 'my-awesome-program')
|
const client = createClient(dbbusradarnrwProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as dbProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(dbProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Berlin Jungfernheide to München Hbf
|
// Berlin Jungfernheide to München Hbf
|
||||||
client.journeys('8011167', '8000261', {results: 1, tickets: true})
|
client.journeys('8011167', '8000261', {results: 1, tickets: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {dbProfile} from 'hafas-client/p/db/index.js'
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
// create a client with DB profile
|
// create a client with DB profile
|
||||||
const client = createClient(dbProfile, 'my-awesome-program')
|
const client = createClient(dbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as insaProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(insaProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const hellestr1 = {
|
const hellestr1 = {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
|
|
|
@ -6,7 +6,7 @@ The [Nahverkehr Sachsen-Anhalt (NASA)](https://de.wikipedia.org/wiki/Nahverkehrs
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {insaProfile} from 'hafas-client/p/insa/index.js'
|
import {profile as insaProfile} from 'hafas-client/p/insa/index.js'
|
||||||
|
|
||||||
// create a client with INSA profile
|
// create a client with INSA profile
|
||||||
const client = createClient(insaProfile, 'my-awesome-program')
|
const client = createClient(insaProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as invgProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(invgProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const ingolstadtHbf = '8000183'
|
const ingolstadtHbf = '8000183'
|
||||||
const audiParkplatz = '84999'
|
const audiParkplatz = '84999'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {invgProfile} from 'hafas-client/p/invg/index.js'
|
import {profile as invgProfile} from 'hafas-client/p/invg/index.js'
|
||||||
|
|
||||||
// create a client with INVG profile
|
// create a client with INVG profile
|
||||||
const client = createClient(invgProfile, 'my-awesome-program')
|
const client = createClient(invgProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as irishProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(irishProfile, 'hafas-client example')
|
||||||
|
|
||||||
// from Dublin to Belfast Central
|
// from Dublin to Belfast Central
|
||||||
client.journeys('9909002', '9990840', {results: 1})
|
client.journeys('9909002', '9990840', {results: 1})
|
||||||
|
|
|
@ -6,7 +6,7 @@ The [*Iarnród Éireann* (Irish Rail)](https://en.wikipedia.org/wiki/Iarnród_É
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {irishProfile} from 'hafas-client/p/irish-rail/index.js'
|
import {profile as irishProfile} from 'hafas-client/p/irish-rail/index.js'
|
||||||
|
|
||||||
// create a client with Irish Rail profile
|
// create a client with Irish Rail profile
|
||||||
const client = createClient(irishProfile, 'my-awesome-program')
|
const client = createClient(irishProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as ivbProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(ivbProfile, 'hafas-client example')
|
||||||
|
|
||||||
const innsbruckGriesauweg = '476162400'
|
const innsbruckGriesauweg = '476162400'
|
||||||
const völsWest = '476431800'
|
const völsWest = '476431800'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {ivbProfile} from 'hafas-client/p/ivb/index.js'
|
import {profile as ivbProfile} from 'hafas-client/p/ivb/index.js'
|
||||||
|
|
||||||
// create a client with IVB profile
|
// create a client with IVB profile
|
||||||
const client = createClient(ivbProfile, 'my-awesome-program')
|
const client = createClient(ivbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as kvbProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(kvbProfile, 'hafas-client example')
|
||||||
|
|
||||||
const heumarkt = '900000001'
|
const heumarkt = '900000001'
|
||||||
const poststr = '900000003'
|
const poststr = '900000003'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {kvbProfile} from 'hafas-client/p/kvb/index.js'
|
import {profile as kvbProfile} from 'hafas-client/p/kvb/index.js'
|
||||||
|
|
||||||
// create a client with KVB profile
|
// create a client with KVB profile
|
||||||
const client = createClient(kvbProfile, 'my-awesome-program')
|
const client = createClient(kvbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as mobilNrwProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(mobilNrwProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const soest = '8000076'
|
const soest = '8000076'
|
||||||
const aachenHbf = '8000001'
|
const aachenHbf = '8000001'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {mobilNrwProfile} from 'hafas-client/p/mobil-nrw/index.js'
|
import {profile as mobilNrwProfile} from 'hafas-client/p/mobil-nrw/index.js'
|
||||||
|
|
||||||
// create a client with mobil.nrw profile
|
// create a client with mobil.nrw profile
|
||||||
const client = createClient(mobilNrwProfile)
|
const client = createClient(mobilNrwProfile)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as mobiliteitluProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(mobiliteitluProfile, 'hafas-client example')
|
||||||
|
|
||||||
const mersch = '160904011'
|
const mersch = '160904011'
|
||||||
const luxembourgCentral = '200405060'
|
const luxembourgCentral = '200405060'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {mobiliteitProfile} from 'hafas-client/p/mobiliteit-lu/index.js'
|
import {profile as mobiliteitProfile} from 'hafas-client/p/mobiliteit-lu/index.js'
|
||||||
|
|
||||||
// create a client with mobiliteit.lu profile
|
// create a client with mobiliteit.lu profile
|
||||||
const client = createClient(mobiliteitProfile, 'my-awesome-program')
|
const client = createClient(mobiliteitProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as nahshProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(nahshProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Flensburg Hbf to Kiel Hbf
|
// Flensburg Hbf to Kiel Hbf
|
||||||
client.journeys('8000103', '8000199', {results: 10, tickets: true})
|
client.journeys('8000103', '8000199', {results: 10, tickets: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {nahshProfile} from 'hafas-client/p/nahsh/index.js'
|
import {profile as nahshProfile} from 'hafas-client/p/nahsh/index.js'
|
||||||
|
|
||||||
// create a client with NAH.SH profile
|
// create a client with NAH.SH profile
|
||||||
const client = createClient(nahshProfile, 'my-awesome-program')
|
const client = createClient(nahshProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as nvvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(nvvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Scheidemannplatz to Auestadion
|
// Scheidemannplatz to Auestadion
|
||||||
client.journeys('2200073', '2200042', {results: 1, polylines: true})
|
client.journeys('2200073', '2200042', {results: 1, polylines: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {nvvProfile} from 'hafas-client/p/nvv/index.js'
|
import {profile as nvvProfile} from 'hafas-client/p/nvv/index.js'
|
||||||
|
|
||||||
// create a client with NVV profile
|
// create a client with NVV profile
|
||||||
const client = createClient(nvvProfile, 'my-awesome-program')
|
const client = createClient(nvvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as oebbProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(oebbProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Wien Westbahnhof to Salzburg Hbf
|
// Wien Westbahnhof to Salzburg Hbf
|
||||||
client.journeys('1291501', '8100002', {results: 1})
|
client.journeys('1291501', '8100002', {results: 1})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {oebbProfile} from 'hafas-client/p/oebb/index.js'
|
import {profile as oebbProfile} from 'hafas-client/p/oebb/index.js'
|
||||||
|
|
||||||
// create a client with ÖBB profile
|
// create a client with ÖBB profile
|
||||||
const client = createClient(oebbProfile, 'my-awesome-program')
|
const client = createClient(oebbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as ooevvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(ooevvProfile, 'hafas-client example')
|
||||||
|
|
||||||
const linzTheatergasse = '444670100'
|
const linzTheatergasse = '444670100'
|
||||||
const amstettenStadtbad = '431507400'
|
const amstettenStadtbad = '431507400'
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {oövvProfile} from 'hafas-client/p/ooevv/index.js'
|
import {profile as ooevvProfile} from 'hafas-client/p/ooevv/index.js'
|
||||||
|
|
||||||
// create a client with OÖVV profile
|
// create a client with OÖVV profile
|
||||||
const client = createClient(oövvProfile, 'my-awesome-program')
|
const client = createClient(ooevvProfile, 'my-awesome-program')
|
||||||
```
|
```
|
||||||
|
|
||||||
Check out the [code examples](example.js).
|
Check out the [code examples](example.js).
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as pkpProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(pkpProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const wrocławGł = '5100069'
|
const wrocławGł = '5100069'
|
||||||
const krakówGł = '5100028'
|
const krakówGł = '5100028'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {pkpProfile} from 'hafas-client/p/pkp/index.js'
|
import {profile as pkpProfile} from 'hafas-client/p/pkp/index.js'
|
||||||
|
|
||||||
// create a client with PKP profile
|
// create a client with PKP profile
|
||||||
const client = createClient(pkpProfile, 'my-awesome-program')
|
const client = createClient(pkpProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as rejseplanenProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(rejseplanenProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// from København Central to Aalborg
|
// from København Central to Aalborg
|
||||||
// client.journeys('8600626', '8600020', {results: 1})
|
// client.journeys('8600626', '8600020', {results: 1})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {rejseplanenProfile} from 'hafas-client/p/rejseplanen/index.js'
|
import {profile as rejseplanenProfile} from 'hafas-client/p/rejseplanen/index.js'
|
||||||
|
|
||||||
// create a client with Rejseplanen profile
|
// create a client with Rejseplanen profile
|
||||||
const client = createClient(rejseplanenProfile)
|
const client = createClient(rejseplanenProfile)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as rmvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(rmvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const marburgHbf = '3010011'
|
const marburgHbf = '3010011'
|
||||||
const mainzGonsenheim = '3011332'
|
const mainzGonsenheim = '3011332'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {rmvProfile} from 'hafas-client/p/rmv/index.js'
|
import {profile as rmvProfile} from 'hafas-client/p/rmv/index.js'
|
||||||
|
|
||||||
// create a client with RMV profile
|
// create a client with RMV profile
|
||||||
const client = createClient(rmvProfile, 'my-awesome-program')
|
const client = createClient(rmvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as rsagProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(rsagProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const rostockHbf = '8010304'
|
const rostockHbf = '8010304'
|
||||||
const güstrow = '8010153'
|
const güstrow = '8010153'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {rsagProfile} from 'hafas-client/p/rsag/index.js'
|
import {profile as rsagProfile} from 'hafas-client/p/rsag/index.js'
|
||||||
|
|
||||||
// create a client with RSAG profile
|
// create a client with RSAG profile
|
||||||
const client = createClient(rsagProfile, 'my-awesome-program')
|
const client = createClient(rsagProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as saarfahrplanProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(saarfahrplanProfile, 'hafas-client-example')
|
||||||
|
|
||||||
client.journeys('15541', '10609', {results: 1})
|
client.journeys('15541', '10609', {results: 1})
|
||||||
// .then(({journeys}) => {
|
// .then(({journeys}) => {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {saarfahrplanProfile} from 'hafas-client/p/saarfahrplan/index.js'
|
import {profile as saarfahrplanProfile} from 'hafas-client/p/saarfahrplan/index.js'
|
||||||
|
|
||||||
// create a client with Saarfahrplan profile
|
// create a client with Saarfahrplan profile
|
||||||
const client = createClient(saarfahrplanProfile, 'my-awesome-program')
|
const client = createClient(saarfahrplanProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as salzburgProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(salzburgProfile, 'hafas-client example')
|
||||||
|
|
||||||
const salzburgGaswerkgasse = '455001300'
|
const salzburgGaswerkgasse = '455001300'
|
||||||
const oberndorfKrankenhaus = '455110200'
|
const oberndorfKrankenhaus = '455110200'
|
||||||
|
|
|
@ -6,7 +6,7 @@ The government of [Salzburg](https://en.wikipedia.org/wiki/Salzburg) operates a
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {salzburgProfile} from 'hafas-client/p/salzburg/index.js'
|
import {profile as salzburgProfile} from 'hafas-client/p/salzburg/index.js'
|
||||||
|
|
||||||
// create a client with Salzburg profile
|
// create a client with Salzburg profile
|
||||||
const client = createClient(salzburgProfile, 'my-awesome-program')
|
const client = createClient(salzburgProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as sMuenchenProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(sMuenchenProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Mittersendling to Charlottenburg
|
// Mittersendling to Charlottenburg
|
||||||
// client.journeys('8004154', '0621790', {results: 1, polylines: true})
|
// client.journeys('8004154', '0621790', {results: 1, polylines: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {sMuenchenProfile} from 'hafas-client/p/sbahn-muenchen/index.js'
|
import {profile as sMuenchenProfile} from 'hafas-client/p/sbahn-muenchen/index.js'
|
||||||
|
|
||||||
// create a client with S-Bahn München profile
|
// create a client with S-Bahn München profile
|
||||||
const client = createClient(sMuenchenProfile, 'my-awesome-program')
|
const client = createClient(sMuenchenProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as sncbProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(sncbProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const gentStPieters = '8892007'
|
const gentStPieters = '8892007'
|
||||||
const bruxellesMidi = '8814001'
|
const bruxellesMidi = '8814001'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {sncbProfile} from 'hafas-client/p/sncb/index.js'
|
import {profile as sncbProfile} from 'hafas-client/p/sncb/index.js'
|
||||||
|
|
||||||
// create a client with SNCB profile
|
// create a client with SNCB profile
|
||||||
const client = createClient(sncbProfile, 'my-awesome-program')
|
const client = createClient(sncbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as stvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(stvProfile, 'hafas-client example')
|
||||||
|
|
||||||
const grazSonnenhang = '460413500'
|
const grazSonnenhang = '460413500'
|
||||||
const grazHödlweg = '460415400'
|
const grazHödlweg = '460415400'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {stvProfile} from 'hafas-client/p/stv/index.js'
|
import {profile as stvProfile} from 'hafas-client/p/stv/index.js'
|
||||||
|
|
||||||
// create a client with STV profile
|
// create a client with STV profile
|
||||||
const client = createClient(stvProfile, 'my-awesome-program')
|
const client = createClient(stvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as svvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(svvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const sam = '455086100'
|
const sam = '455086100'
|
||||||
const volksgarten = '455082100'
|
const volksgarten = '455082100'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {svvProfile} from 'hafas-client/p/svv/index.js'
|
import {profile as svvProfile} from 'hafas-client/p/svv/index.js'
|
||||||
|
|
||||||
// create a client with SVV profile
|
// create a client with SVV profile
|
||||||
const client = createClient(svvProfile, 'my-awesome-program')
|
const client = createClient(svvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as tpgProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(tpgProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const miremont = '100449'
|
const miremont = '100449'
|
||||||
const moillebeau = '100451'
|
const moillebeau = '100451'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {tpgProfile} from 'hafas-client/p/tpg/index.js'
|
import {profile as tpgProfile} from 'hafas-client/p/tpg/index.js'
|
||||||
|
|
||||||
// create a client with TPG profile
|
// create a client with TPG profile
|
||||||
const client = createClient(tpgProfile, 'my-awesome-program')
|
const client = createClient(tpgProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vbnProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vbnProfile, 'hafas-client-example')
|
||||||
|
|
||||||
// Hauptbahnhof to Charlottenburg
|
// Hauptbahnhof to Charlottenburg
|
||||||
// client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
// client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbbProfile} from 'hafas-client/p/vbb/index.js'
|
import {profile as vbbProfile} from 'hafas-client/p/vbb/index.js'
|
||||||
|
|
||||||
// create a client with VBB profile
|
// create a client with VBB profile
|
||||||
const client = createClient(vbbProfile, 'my-awesome-program')
|
const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vbnProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vbnProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const bremerhavenHbf = '9014418'
|
const bremerhavenHbf = '9014418'
|
||||||
const verden = '9093627'
|
const verden = '9093627'
|
||||||
|
|
|
@ -6,7 +6,7 @@ The [*Verkehrsverbund Bremen/Niedersachsen (VBN)*](https://de.wikipedia.org/wiki
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vbnProfile} from 'hafas-client/p/vbn/index.js'
|
import {profile as vbnProfile} from 'hafas-client/p/vbn/index.js'
|
||||||
|
|
||||||
// create a client with VBN profile
|
// create a client with VBN profile
|
||||||
const client = createClient(vbnProfile, 'my-awesome-program')
|
const client = createClient(vbnProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vkgProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vkgProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const spittalMittelschule = '420512200'
|
const spittalMittelschule = '420512200'
|
||||||
const klagenfurtSteingasse = '420649500'
|
const klagenfurtSteingasse = '420649500'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vkgProfile} from 'hafas-client/p/vkg/index.js'
|
import {profile as vkgProfile} from 'hafas-client/p/vkg/index.js'
|
||||||
|
|
||||||
// create a client with VKG profile
|
// create a client with VKG profile
|
||||||
const client = createClient(vkgProfile, 'my-awesome-program')
|
const client = createClient(vkgProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vmtProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vmtProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const jena = '190014'
|
const jena = '190014'
|
||||||
const gothaZOB = '167280'
|
const gothaZOB = '167280'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vmtProfile} from 'hafas-client/p/vmt/index.js'
|
import {profile as vmtProfile} from 'hafas-client/p/vmt/index.js'
|
||||||
|
|
||||||
// create a client with VMT profile
|
// create a client with VMT profile
|
||||||
const client = createClient(vmtProfile, 'my-awesome-program')
|
const client = createClient(vmtProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vorProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(vorProfile, 'hafas-client example')
|
||||||
|
|
||||||
const stPöltenLinzerTor = '431277900'
|
const stPöltenLinzerTor = '431277900'
|
||||||
const eisenstadtSchlossplatz = '415003300'
|
const eisenstadtSchlossplatz = '415003300'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vorProfile} from 'hafas-client/p/vor/index.js'
|
import {profile as vorProfile} from 'hafas-client/p/vor/index.js'
|
||||||
|
|
||||||
// create a client with VOR profile
|
// create a client with VOR profile
|
||||||
const client = createClient(vorProfile, 'my-awesome-program')
|
const client = createClient(vorProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vosProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vosProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const saarplatz = '9071733'
|
const saarplatz = '9071733'
|
||||||
const finkenweg = '9071574'
|
const finkenweg = '9071574'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vosProfile} from 'hafas-client/p/vos/index.js'
|
import {profile as vosProfile} from 'hafas-client/p/vos/index.js'
|
||||||
|
|
||||||
// create a client with VOS profile
|
// create a client with VOS profile
|
||||||
const client = createClient(vosProfile, 'my-awesome-program')
|
const client = createClient(vosProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vrnProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vrnProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const ludwigshafen = '8000236'
|
const ludwigshafen = '8000236'
|
||||||
const meckesheim = '8003932'
|
const meckesheim = '8003932'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vrnProfile} from 'hafas-client/p/vrn/index.js'
|
import {profile as vrnProfile} from 'hafas-client/p/vrn/index.js'
|
||||||
|
|
||||||
// create a client with VRN profile
|
// create a client with VRN profile
|
||||||
const client = createClient(vrnProfile, 'my-awesome-program')
|
const client = createClient(vrnProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vsnProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vsnProfile, 'hafas-client-example')
|
||||||
|
|
||||||
client.journeys('9033961', '9033962', {results: 1, polylines: true})
|
client.journeys('9033961', '9033962', {results: 1, polylines: true})
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
## Usage
|
## Usage
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vsnProfile} from 'hafas-client/p/vsn/index.js'
|
import {profile as vsnProfile} from 'hafas-client/p/vsn/index.js'
|
||||||
|
|
||||||
// create a client with VSN profile
|
// create a client with VSN profile
|
||||||
const client = createClient(vsnProfile, 'my-awesome-program')
|
const client = createClient(vsnProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vvtProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(vvtProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const innsbruckMitterweg = '476152300'
|
const innsbruckMitterweg = '476152300'
|
||||||
const kufsteinListstr = '476603100'
|
const kufsteinListstr = '476603100'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vvtProfile} from 'hafas-client/p/vvt/index.js'
|
import {profile as vvtProfile} from 'hafas-client/p/vvt/index.js'
|
||||||
|
|
||||||
// create a client with VVT profile
|
// create a client with VVT profile
|
||||||
const client = createClient(vvtProfile, 'my-awesome-program')
|
const client = createClient(vvtProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as vvvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client example')
|
const client = createClient(vvvProfile, 'hafas-client example')
|
||||||
|
|
||||||
const bregenzLandeskrankenhaus = '480195700'
|
const bregenzLandeskrankenhaus = '480195700'
|
||||||
const bludenzGymnasium = '480031300'
|
const bludenzGymnasium = '480031300'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {vvvProfile} from 'hafas-client/p/vvv/index.js'
|
import {profile as vvvProfile} from 'hafas-client/p/vvv/index.js'
|
||||||
|
|
||||||
// create a client with VVV profile
|
// create a client with VVV profile
|
||||||
const client = createClient(vvvProfile, 'my-awesome-program')
|
const client = createClient(vvvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import {inspect} from 'util'
|
import {inspect} from 'util'
|
||||||
import {createClient} from '../../index.js'
|
import {createClient} from '../../index.js'
|
||||||
import {profile} from './index.js'
|
import {profile as zvvProfile} from './index.js'
|
||||||
|
|
||||||
const client = createClient(profile, 'hafas-client-example')
|
const client = createClient(zvvProfile, 'hafas-client-example')
|
||||||
|
|
||||||
const bürkliplatz = '8591105'
|
const bürkliplatz = '8591105'
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {zvvProfile} from 'hafas-client/p/zvv/index.js'
|
import {profile as zvvProfile} from 'hafas-client/p/zvv/index.js'
|
||||||
|
|
||||||
// create a client with ZVV profile
|
// create a client with ZVV profile
|
||||||
const client = createClient(zvvProfile, 'my-awesome-program')
|
const client = createClient(zvvProfile, 'my-awesome-program')
|
||||||
|
|
|
@ -50,7 +50,7 @@ Pick the [profile](p/readme.md) for the HAFAS endpoint covering the area you wan
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import {createClient} from 'hafas-client'
|
import {createClient} from 'hafas-client'
|
||||||
import {dbProfile} from 'hafas-client/p/db/index.js'
|
import {profile as dbProfile} from 'hafas-client/p/db/index.js'
|
||||||
|
|
||||||
// create a client with the Deutsche Bahn profile
|
// create a client with the Deutsche Bahn profile
|
||||||
const client = createClient(dbProfile, 'my-awesome-program')
|
const client = createClient(dbProfile, 'my-awesome-program')
|
||||||
|
|
Loading…
Add table
Reference in a new issue