ts-twitch-api 0.1.0 → 0.1.2

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.md CHANGED
@@ -10,10 +10,6 @@ Very simple `TwitchApi` class and TypeScript interfaces for all Twitch API endpo
10
10
  * _Response Body_
11
11
  * Includes descriptions for the fields
12
12
 
13
- ## TODO
14
-
15
- * Pass RequestInit object
16
-
17
13
  ## Installation
18
14
 
19
15
  ```bash
@@ -88,4 +84,15 @@ const streams = await twitchApi.streams.getStreams(
88
84
  if (streams.ok) {
89
85
  console.log(streams.data);
90
86
  }
87
+
88
+ // pass fetch options via RequestInit object
89
+ const ac = new AbortController();
90
+ const users = twitchApi.users.getUsers(
91
+ { id: ['1', '2'] },
92
+ null,
93
+ null,
94
+ { signal: ac.signal },
95
+ );
96
+
97
+ ac.abort();
91
98
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-twitch-api",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Very simple TwitchApi class and TypeScript interfaces for all Twitch API endpoints",
5
5
  "author": "DmitryScaletta",
6
6
  "license": "MIT",
@@ -19,13 +19,13 @@
19
19
  "twitch-api.generated.ts"
20
20
  ],
21
21
  "type": "module",
22
+ "scripts": {
23
+ "build": "node --import tsx ./scripts/build.ts",
24
+ "gen": "pnpm dlx openapi-typescript https://github.com/DmitryScaletta/twitch-api-swagger/raw/main/openapi.json --output twitch-api.generated.ts"
25
+ },
22
26
  "devDependencies": {
23
27
  "@types/node": "^20.11.2",
24
28
  "tsx": "^4.7.0",
25
29
  "typescript": "^5.3.3"
26
- },
27
- "scripts": {
28
- "build": "node --import tsx ./scripts/build.ts",
29
- "gen": "pnpm dlx openapi-typescript https://github.com/DmitryScaletta/twitch-api-swagger/raw/main/openapi.json --output twitch-api.generated.ts"
30
30
  }
31
- }
31
+ }