-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a265f65
commit b074714
Showing
9 changed files
with
343 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: getFareZone | ||
menu: NSR | ||
route: /nsr/getFareZone | ||
--- | ||
|
||
# getFareZone | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.FareZone> | ||
``` | ||
|
||
`getFareZone` finds a FareZone by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const fareZone = await service.nsr.getFareZone('MOR:FareZone:411') | ||
console.log(fareZone) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: getGroupOfStopPlaces | ||
menu: NSR | ||
route: /nsr/getGroupOfStopPlaces | ||
--- | ||
|
||
# getGroupOfStopPlaces | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.GroupOfStopPlace> | ||
``` | ||
|
||
`getGroupOfStopPlaces` finds a GroupOfStopPlaces by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const groupOfStopPlaces = await service.nsr.getGroupOfStopPlaces( | ||
'NSR:GroupOfStopPlaces:1', | ||
) | ||
console.log(groupOfStopPlaces) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: getParking | ||
menu: NSR | ||
route: /nsr/getParking | ||
--- | ||
|
||
# getParking | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.Parking> | ||
``` | ||
|
||
`getParking` finds a Parking by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const parking = await service.nsr.getParking('NSR:Parking:41') | ||
console.log(parking) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: getQuay | ||
menu: NSR | ||
route: /nsr/getQuay | ||
--- | ||
|
||
# getQuay | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.Quay> | ||
``` | ||
|
||
`getQuay` finds a Quay by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const quay = await service.nsr.getQuay('NSR:Quay:1') | ||
console.log(quay) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: getStopPlace | ||
menu: NSR | ||
route: /nsr/getStopPlace | ||
--- | ||
|
||
# getStopPlace | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.StopPlace> | ||
``` | ||
|
||
`getStopPlace` finds a StopPlace by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const stopPlace = await service.nsr.getStopPlace('NSR:StopPlace:337') | ||
console.log(stopPlace) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: getStopPlaceForQuay | ||
menu: NSR | ||
route: /nsr/getStopPlaceForQuay | ||
--- | ||
|
||
# getStopPlaceForQuay | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.StopPlaceForQuay> | ||
``` | ||
|
||
`getStopPlaceForQuay` finds the StopPlace that a Quay belongs to by the quay's ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const stopPlace = await service.nsr.getStopPlaceForQuay('NSR:Quay:1') | ||
console.log(stopPlace) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: getTariffZone | ||
menu: NSR | ||
route: /nsr/getTariffZone | ||
--- | ||
|
||
# getTariffZone | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.TariffZone> | ||
``` | ||
|
||
`getTariffZone` finds a TariffZone by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const tariffZone = await service.nsr.getTariffZone( | ||
'NOR:TariffZone:4020', | ||
) | ||
console.log(tariffZone) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: getTopographicPlace | ||
menu: NSR | ||
route: /nsr/getTopographicPlace | ||
--- | ||
|
||
# getTopographicPlace | ||
|
||
```typescript | ||
(id: string, options?: RequestOptions) => Promise<NsrTypes.TopographicPlace> | ||
``` | ||
|
||
`getTopographicPlace` finds a TopographicPlace by its ID. Throws an error if no match. | ||
|
||
### options (`RequestOptions`) [Optional] | ||
|
||
An object containing a subset of `RequestInit` options that's applied to the request. | ||
|
||
| Key | Type | Description | | ||
| :-------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `signal` | `AbortSignal` | Allows you to communicate with a fetch request and abort it if desired. [Read more](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | | ||
| `headers` | `HeadersInit` | Add custom HTTP headers to the fetch request if desired. | | ||
|
||
## Example | ||
|
||
```javascript | ||
import createEnturService from '@entur/sdk' | ||
// or: const createEnturService = require('@entur/sdk').default | ||
|
||
const service = createEnturService({ | ||
clientName: 'awesomecompany-awesomeapp', | ||
}) | ||
|
||
async function example() { | ||
try { | ||
const topographicPlace = await service.nsr.getTopographicPlace( | ||
'KVE:TopographicPlace:5402', | ||
) | ||
console.log(topographicPlace) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ export default { | |
'Entur SDK', | ||
'Getting Started', | ||
'Geocoder', | ||
'NSR', | ||
'Travel', | ||
'Departures', | ||
'Places', | ||
|