wili 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.de.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [English](README.md) | **Deutsch**
8
8
 
9
- Node Wrapper für die Echtzeitdaten-API der Wiener Linien
9
+ Node Wrapper für die Echtzeitdaten-API der Wiener Linien.
10
10
 
11
11
  ## Installation
12
12
 
@@ -28,24 +28,13 @@ const options = {
28
28
  const { trafficInfos } = await wili.trafficInfoList(options);
29
29
  ```
30
30
 
31
- :warning: Für NodeJS-Versionen unterhalb v18, muss die Klasse mit einer `fetch`-Implementierung instanziert werden.
32
-
33
- **Beispiel**
34
-
35
- ```js
36
- import { createWienerLinien } from 'wili';
37
- import fetch from 'isomorphic-fetch';
38
-
39
- const wili = createWienerLinien(fetch);
40
- ```
41
-
42
31
  ## API
43
32
 
44
33
  ### monitor
45
34
 
46
35
  Verwendung: `monitor(rbl, [options])`
47
36
 
48
- Die Monitor Schnittstelle liefert Echtzeiten oder Planzeiten der nächsten 70 Minuten für einen Haltepunkt
37
+ Die Monitor Schnittstelle liefert Echtzeiten oder Planzeiten der nächsten 70 Minuten für einen Haltepunkt.
49
38
 
50
39
  #### Parameter:
51
40
 
@@ -53,19 +42,19 @@ Die Monitor Schnittstelle liefert Echtzeiten oder Planzeiten der nächsten 70 M
53
42
 
54
43
  Typen: `String`, `Integer`, `Array`
55
44
 
56
- RBL Nummer (Rechnergestütztes Betriebsleitsystem), lässt sich [hier](https://till.mabe.at/rbl/?line=214433687&station=231116899) abfragen
45
+ RBL Nummer (Rechnergestütztes Betriebsleitsystem), lässt sich [hier](https://till.mabe.at/rbl/?line=214433687&station=231116899) abfragen.
57
46
 
58
47
  ##### `options.activeTrafficInfo`
59
48
 
60
49
  Typen: `String`, `Array`
61
50
 
62
- Störungstypen: `stoerungkurz`, `stoerunglang` oder `aufzugsinfo`
51
+ Störungstypen: `stoerungkurz`, `stoerunglang` oder `aufzugsinfo`.
63
52
 
64
53
  ### newsList
65
54
 
66
55
  Verwendung: `newsList(options)`
67
56
 
68
- Die Schnittstelle liefert Neuigkeiten wie „Aktuelles“ oder „Aufzugswartungen”
57
+ Die Schnittstelle liefert Neuigkeiten wie „Aktuelles“ oder „Aufzugswartungen”.
69
58
 
70
59
  #### Optionen
71
60
 
@@ -73,25 +62,25 @@ Die Schnittstelle liefert Neuigkeiten wie „Aktuelles“ oder „Aufzugswartung
73
62
 
74
63
  Typen: `String`, `Integer`, `Array`
75
64
 
76
- Name der Linie, z.B. U1, S7, 59A (schreibungsunabhängig)
65
+ Name der Linie, z.B. U1, S7, 59A (schreibungsunabhängig).
77
66
 
78
67
  ##### `options.relatedStop`
79
68
 
80
69
  Typen: `String`, `Integer`, `Array`
81
70
 
82
- Haltepunkt ID der Haltestelle
71
+ Haltepunkt ID der Haltestelle.
83
72
 
84
73
  ##### `options.name`
85
74
 
86
75
  Typen: `String`, `Array`
87
76
 
88
- Name der Nachrichtenkategorie, z.B `news` oder `aufzugsservice`
77
+ Name der Nachrichtenkategorie, z.B `news` oder `aufzugsservice`.
89
78
 
90
79
  ### trafficInfoList
91
80
 
92
81
  Verwendung: `trafficInfoList([options])`
93
82
 
94
- Die Schnittstelle liefert Störungen
83
+ Die Schnittstelle liefert Störungen.
95
84
 
96
85
  #### Optionen
97
86
 
@@ -99,24 +88,20 @@ Die Schnittstelle liefert Störungen
99
88
 
100
89
  Typen: `String`, `Integer`, `Array`
101
90
 
102
- Name der Linie, z.B. U1, S7, 59A (schreibungsunabhängig)
91
+ Name der Linie, z.B. U1, S7, 59A (schreibungsunabhängig).
103
92
 
104
93
  ##### `options.relatedStop`
105
94
 
106
95
  Typen: `String`, `Integer`, `Array`
107
96
 
108
- Haltepunkt ID der Haltestelle
97
+ Haltepunkt ID der Haltestelle.
109
98
 
110
99
  ##### `options.name`
111
100
 
112
101
  Typen: `String`, `Array`
113
102
 
114
- Störungstypen: `stoerungkurz`, `stoerunglang` oder `aufzugsinfo`
103
+ Störungstypen: `stoerungkurz`, `stoerunglang` oder `aufzugsinfo`.
115
104
 
116
105
  ## Lizenz
117
106
 
118
- Diese Software unterliegt den Bestimmungen der [MIT Lizenz](https://opensource.org/licenses/MIT)
119
-
120
- ## Spenden
121
-
122
- Wenn Du mir einen Kaffee oder ein Bier ausgeben möchtest, freue mich über Spenden via [Flattr](https://flattr.com/submit/auto?user_id=idleberg&url=https://github.com/idleberg/node-wili) oder Bitcoin `17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd`
107
+ Diese Software unterliegt den Bestimmungen der [MIT Lizenz](https://opensource.org/licenses/MIT).
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  **English** | [Deutsch](README.de.md)
8
8
 
9
- A Node wrapper for the Wiener Linien public transport API
9
+ A Node wrapper for the Wiener Linien public transport API.
10
10
 
11
11
  ## Installation
12
12
 
@@ -28,17 +28,6 @@ const options = {
28
28
  const { trafficInfos } = await wili.trafficInfoList(options);
29
29
  ```
30
30
 
31
- :warning: For NodeJS versions lower than v18, the class needs to be instantiated with a `fetch`-implementation
32
-
33
- **Example**
34
-
35
- ```js
36
- import { createWienerLinien } from 'wili';
37
- import fetch from 'isomorphic-fetch';
38
-
39
- const wili = createWienerLinien(fetch);
40
- ```
41
-
42
31
  ## API
43
32
 
44
33
  ### monitor
@@ -53,19 +42,19 @@ Returns real-time data for a station, including train information such as identi
53
42
 
54
43
  Type: `String`, `Integer`, `Array`
55
44
 
56
- RBL number (Rechnergestütztes Betriebsleitsystem - computer-aided operations control system), can be found this [website](https://till.mabe.at/rbl/?line=214433687&station=231116899)
45
+ RBL number (Rechnergestütztes Betriebsleitsystem - computer-aided operations control system), can be found this [website](https://till.mabe.at/rbl/?line=214433687&station=231116899).
57
46
 
58
47
  ##### `options.activeTrafficInfo`
59
48
 
60
49
  Type: `String`, `Array`
61
50
 
62
- Disruption type (`stoerungkurz`, `stoerunglang`, or `aufzugsinfo`)
51
+ Disruption type (`stoerungkurz`, `stoerunglang`, or `aufzugsinfo`).
63
52
 
64
53
  ### newsList
65
54
 
66
55
  Usage: `newsList(options)`
67
56
 
68
- Returns news, elevator maintenance and other information
57
+ Returns news, elevator maintenance and other information.
69
58
 
70
59
  #### Options
71
60
 
@@ -73,25 +62,25 @@ Returns news, elevator maintenance and other information
73
62
 
74
63
  Type: `String`, `Integer`, `Array`
75
64
 
76
- Train or bus number, e.g. U1, S7, 59A (case-insensitive)
65
+ Train or bus number, e.g. U1, S7, 59A (case-insensitive).
77
66
 
78
67
  ##### `options.relatedStop`
79
68
 
80
69
  Type: `String`, `Integer`, `Array`
81
70
 
82
- Station ID
71
+ Station ID.
83
72
 
84
73
  ##### `options.name`
85
74
 
86
75
  Type: `String`, `Array`
87
76
 
88
- Information category, e.g `news` or `aufzugsservice`
77
+ Information category, e.g `news` or `aufzugsservice`.
89
78
 
90
79
  ### trafficInfoList
91
80
 
92
81
  Usage: `trafficInfoList([options])`
93
82
 
94
- Returns interruption of operations and elevator outage
83
+ Returns interruption of operations and elevator outage.
95
84
 
96
85
  #### Options
97
86
 
@@ -99,20 +88,20 @@ Returns interruption of operations and elevator outage
99
88
 
100
89
  Type: `String`, `Integer`, `Array`
101
90
 
102
- Train or bus number, e.g. U1, S7, 59A (case-insensitive)
91
+ Train or bus number, e.g. U1, S7, 59A (case-insensitive).
103
92
 
104
93
  ##### `options.relatedStop`
105
94
 
106
95
  Type: `String`, `Integer`, `Array`
107
96
 
108
- Station ID
97
+ Station ID.
109
98
 
110
99
  ##### `options.name`
111
100
 
112
101
  Type: `String`, `Array`
113
102
 
114
- Disruption type (`stoerungkurz`, `stoerunglang`, or `aufzugsinfo`)
103
+ Disruption type (`stoerungkurz`, `stoerunglang`, or `aufzugsinfo`).
115
104
 
116
105
  ## License
117
106
 
118
- This work is licensed under [The MIT License](https://opensource.org/licenses/MIT)
107
+ This work is licensed under [The MIT License](https://opensource.org/licenses/MIT).
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- function e(e=globalThis.fetch){if(typeof e!=`function`)throw TypeError(`The supplied fetch parameter is not a function`);async function t(e,t={}){return await o(`/monitor`,{...t,rbl:e})}async function n(e={}){return await o(`newsList`,e)}async function r(e={}){return await o(`trafficInfoList`,e)}function i(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))if(Array.isArray(r))for(let t of r)n.append(e,String(t));else n.set(e,String(r));return new URL(`https://www.wienerlinien.at/ogd_realtime/${e}?${n.toString()}`)}async function a(e){if(e.ok)return e;throw Error(`HTTP ${e.status}: ${e.statusText} (${e.url})`)}async function o(t,n){return(await(await a(await e(i(t,n).href))).json()).data}return{monitor:t,newsList:n,trafficInfoList:r}}exports.createWienerLinien=e;
1
+ function e(e=globalThis.fetch){if(typeof e!=`function`)throw TypeError(`The supplied fetch parameter is not a function`);e!==globalThis.fetch&&console.warn(`Providing a custom fetch implementation is deprecated and will be removed in future versions.`);async function t(e,t={}){return await o(`/monitor`,{...t,rbl:e})}async function n(e={}){return await o(`newsList`,e)}async function r(e={}){return await o(`trafficInfoList`,e)}function i(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))if(Array.isArray(r))for(let t of r)n.append(e,String(t));else n.set(e,String(r));return new URL(`https://www.wienerlinien.at/ogd_realtime/${e}?${n.toString()}`)}async function a(e){if(e.ok)return e;throw Error(`HTTP ${e.status}: ${e.statusText} (${e.url})`)}async function o(t,n){return(await(await a(await e(i(t,n).href))).json()).data}return{monitor:t,newsList:n,trafficInfoList:r}}exports.createWienerLinien=e;
package/lib/index.d.cts CHANGED
@@ -36,9 +36,9 @@ declare namespace Wili {
36
36
  //#region src/index.d.ts
37
37
  /**
38
38
  * Creates an instance of the WienerLinien API client.
39
- * @param {function} fetchParam - The fetch function to use for making HTTP requests.
40
- * @throws {TypeError} - If the supplied fetch parameter is not a function.
41
- * @returns {Object} - The WienerLinien API client.
39
+ * @param fetchParam The fetch function to use for making HTTP requests.
40
+ * @returns The WienerLinien API client.
41
+ * @throws If the supplied fetch parameter is not a function.
42
42
  */
43
43
  declare function createWienerLinien(fetchParam?: typeof fetch): {
44
44
  monitor: (rbl: Wili.StringNumbers, options?: {}) => Promise<Wili.MonitorResponse>;
package/lib/index.d.ts CHANGED
@@ -36,9 +36,9 @@ declare namespace Wili {
36
36
  //#region src/index.d.ts
37
37
  /**
38
38
  * Creates an instance of the WienerLinien API client.
39
- * @param {function} fetchParam - The fetch function to use for making HTTP requests.
40
- * @throws {TypeError} - If the supplied fetch parameter is not a function.
41
- * @returns {Object} - The WienerLinien API client.
39
+ * @param fetchParam The fetch function to use for making HTTP requests.
40
+ * @returns The WienerLinien API client.
41
+ * @throws If the supplied fetch parameter is not a function.
42
42
  */
43
43
  declare function createWienerLinien(fetchParam?: typeof fetch): {
44
44
  monitor: (rbl: Wili.StringNumbers, options?: {}) => Promise<Wili.MonitorResponse>;
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- function e(e=globalThis.fetch){if(typeof e!=`function`)throw TypeError(`The supplied fetch parameter is not a function`);async function t(e,t={}){return await o(`/monitor`,{...t,rbl:e})}async function n(e={}){return await o(`newsList`,e)}async function r(e={}){return await o(`trafficInfoList`,e)}function i(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))if(Array.isArray(r))for(let t of r)n.append(e,String(t));else n.set(e,String(r));return new URL(`https://www.wienerlinien.at/ogd_realtime/${e}?${n.toString()}`)}async function a(e){if(e.ok)return e;throw Error(`HTTP ${e.status}: ${e.statusText} (${e.url})`)}async function o(t,n){return(await(await a(await e(i(t,n).href))).json()).data}return{monitor:t,newsList:n,trafficInfoList:r}}export{e as createWienerLinien};
1
+ function e(e=globalThis.fetch){if(typeof e!=`function`)throw TypeError(`The supplied fetch parameter is not a function`);e!==globalThis.fetch&&console.warn(`Providing a custom fetch implementation is deprecated and will be removed in future versions.`);async function t(e,t={}){return await o(`/monitor`,{...t,rbl:e})}async function n(e={}){return await o(`newsList`,e)}async function r(e={}){return await o(`trafficInfoList`,e)}function i(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))if(Array.isArray(r))for(let t of r)n.append(e,String(t));else n.set(e,String(r));return new URL(`https://www.wienerlinien.at/ogd_realtime/${e}?${n.toString()}`)}async function a(e){if(e.ok)return e;throw Error(`HTTP ${e.status}: ${e.statusText} (${e.url})`)}async function o(t,n){return(await(await a(await e(i(t,n).href))).json()).data}return{monitor:t,newsList:n,trafficInfoList:r}}export{e as createWienerLinien};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wili",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "A Node client for the Wiener Linien public transport API",
5
5
  "author": "Jan T. Sott",
6
6
  "license": "MIT",