ts-twitch-api 0.2.4 → 0.2.5
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/dist/index.cjs +62 -13
- package/dist/index.d.cts +423 -1440
- package/dist/index.d.ts +423 -1440
- package/dist/index.js +59 -10
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -1337,6 +1337,43 @@ var TwitchApi = class {
|
|
|
1337
1337
|
body,
|
|
1338
1338
|
options
|
|
1339
1339
|
}),
|
|
1340
|
+
/**
|
|
1341
|
+
* NEW Retrieves the active shared chat session for a channel.
|
|
1342
|
+
*
|
|
1343
|
+
* __Authorization:__
|
|
1344
|
+
*
|
|
1345
|
+
* Requires an [app access token](https://dev.twitch.tv/docs/cli/token-command/#app-access-token) or [user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
1346
|
+
*
|
|
1347
|
+
* __URL:__
|
|
1348
|
+
*
|
|
1349
|
+
* `GET https://api.twitch.tv/helix/shared_chat/session`
|
|
1350
|
+
*
|
|
1351
|
+
* __Response Codes:__
|
|
1352
|
+
*
|
|
1353
|
+
* _200 OK_
|
|
1354
|
+
*
|
|
1355
|
+
* Successfully retrieved the shared chat session. Returns an empty array if the broadcaster\_id in the request isn’t in a shared chat session.
|
|
1356
|
+
*
|
|
1357
|
+
* _400 Bad Request_
|
|
1358
|
+
*
|
|
1359
|
+
* The ID in the `broadcaster_id` query parameter is not valid.
|
|
1360
|
+
*
|
|
1361
|
+
* _401 Unauthorized_
|
|
1362
|
+
*
|
|
1363
|
+
* * The OAuth token is not valid.
|
|
1364
|
+
* * The Authorization header is required and must contain a user access token.
|
|
1365
|
+
*
|
|
1366
|
+
* _500 Internal Server Error_
|
|
1367
|
+
*
|
|
1368
|
+
* Internal Server Error.
|
|
1369
|
+
*
|
|
1370
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-shared-chat-session
|
|
1371
|
+
*/
|
|
1372
|
+
getSharedChatSession: (params, options = {}) => this.callApi({
|
|
1373
|
+
path: "/shared_chat/session",
|
|
1374
|
+
params,
|
|
1375
|
+
options
|
|
1376
|
+
}),
|
|
1340
1377
|
/**
|
|
1341
1378
|
* NEW Retrieves emotes available to the user across all channels.
|
|
1342
1379
|
*
|
|
@@ -1378,6 +1415,8 @@ var TwitchApi = class {
|
|
|
1378
1415
|
/**
|
|
1379
1416
|
* Sends an announcement to the broadcaster’s chat room.
|
|
1380
1417
|
*
|
|
1418
|
+
* **Rate Limits**: One announcement may be sent every 2 seconds.
|
|
1419
|
+
*
|
|
1381
1420
|
* __Authorization:__
|
|
1382
1421
|
*
|
|
1383
1422
|
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:announcements** scope.
|
|
@@ -1406,6 +1445,10 @@ var TwitchApi = class {
|
|
|
1406
1445
|
* * The OAuth token is not valid.
|
|
1407
1446
|
* * The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
|
|
1408
1447
|
*
|
|
1448
|
+
* _429 Too Many Requests_
|
|
1449
|
+
*
|
|
1450
|
+
* The sender has exceeded the number of announcements they may send to this **broadcaster\_id** within a given window.
|
|
1451
|
+
*
|
|
1409
1452
|
* @see https://dev.twitch.tv/docs/api/reference#send-chat-announcement
|
|
1410
1453
|
*/
|
|
1411
1454
|
sendChatAnnouncement: (params, body, options = {}) => this.callApi({
|
|
@@ -1420,7 +1463,7 @@ var TwitchApi = class {
|
|
|
1420
1463
|
*
|
|
1421
1464
|
* Twitch’s Shoutout feature is a great way for you to show support for other broadcasters and help them grow. Viewers who do not follow the other broadcaster will see a pop-up Follow button in your chat that they can click to follow the other broadcaster. [Learn More](https://help.twitch.tv/s/article/shoutouts)
|
|
1422
1465
|
*
|
|
1423
|
-
* **Rate Limits
|
|
1466
|
+
* **Rate Limits**: The broadcaster may send a Shoutout once every 2 minutes. They may send the same broadcaster a Shoutout once every 60 minutes.
|
|
1424
1467
|
*
|
|
1425
1468
|
* To receive notifications when a Shoutout is sent or received, subscribe to the [channel.shoutout.create](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutcreate) and [channel.shoutout.receive](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelshoutoutreceive) subscription types. The **channel.shoutout.create** event includes cooldown periods that indicate when the broadcaster may send another Shoutout without exceeding the endpoint’s rate limit.
|
|
1426
1469
|
*
|
|
@@ -1654,6 +1697,8 @@ var TwitchApi = class {
|
|
|
1654
1697
|
/**
|
|
1655
1698
|
* Gets one or more video clips that were captured from streams. For information about clips, see [How to use clips](https://help.twitch.tv/s/article/how-to-use-clips).
|
|
1656
1699
|
*
|
|
1700
|
+
* When using pagination for clips, note that the maximum number of results returned over multiple requests will be approximately 1,000\. If additional results are necessary, paginate over different query parameters such as multiple `started_at` and `ended_at` timeframes to refine the search.
|
|
1701
|
+
*
|
|
1657
1702
|
* __Authorization:__
|
|
1658
1703
|
*
|
|
1659
1704
|
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens) or [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens).
|
|
@@ -1697,7 +1742,7 @@ var TwitchApi = class {
|
|
|
1697
1742
|
};
|
|
1698
1743
|
conduits = {
|
|
1699
1744
|
/**
|
|
1700
|
-
* NEW Gets the [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) for a client ID.
|
|
1745
|
+
* NEW Gets the [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) for a client ID.
|
|
1701
1746
|
*
|
|
1702
1747
|
* __Authorization:__
|
|
1703
1748
|
*
|
|
@@ -1724,7 +1769,7 @@ var TwitchApi = class {
|
|
|
1724
1769
|
options
|
|
1725
1770
|
}),
|
|
1726
1771
|
/**
|
|
1727
|
-
* NEW Creates a new [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1772
|
+
* NEW Creates a new [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1728
1773
|
*
|
|
1729
1774
|
* __Authorization:__
|
|
1730
1775
|
*
|
|
@@ -1761,7 +1806,7 @@ var TwitchApi = class {
|
|
|
1761
1806
|
options
|
|
1762
1807
|
}),
|
|
1763
1808
|
/**
|
|
1764
|
-
* NEW Updates a [conduit’s](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) shard count. To delete shards, update the count to a lower number, and the shards above the count will be deleted. For example, if the existing shard count is 100, by resetting shard count to 50, shards 50-99 are disabled.
|
|
1809
|
+
* NEW Updates a [conduit’s](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) shard count. To delete shards, update the count to a lower number, and the shards above the count will be deleted. For example, if the existing shard count is 100, by resetting shard count to 50, shards 50-99 are disabled.
|
|
1765
1810
|
*
|
|
1766
1811
|
* __Authorization:__
|
|
1767
1812
|
*
|
|
@@ -1800,7 +1845,7 @@ var TwitchApi = class {
|
|
|
1800
1845
|
options
|
|
1801
1846
|
}),
|
|
1802
1847
|
/**
|
|
1803
|
-
* NEW Deletes a specified [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/). Note that it may take some time for Eventsub subscriptions on a deleted [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) to show as disabled when calling [Get Eventsub Subscriptions](https://dev.twitch.tv/docs/api/reference/#get-eventsub-subscriptions).
|
|
1848
|
+
* NEW Deletes a specified [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/). Note that it may take some time for Eventsub subscriptions on a deleted [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) to show as disabled when calling [Get Eventsub Subscriptions](https://dev.twitch.tv/docs/api/reference/#get-eventsub-subscriptions).
|
|
1804
1849
|
*
|
|
1805
1850
|
* __Authorization:__
|
|
1806
1851
|
*
|
|
@@ -1838,7 +1883,7 @@ var TwitchApi = class {
|
|
|
1838
1883
|
options
|
|
1839
1884
|
}),
|
|
1840
1885
|
/**
|
|
1841
|
-
* NEW Gets a lists of all shards for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1886
|
+
* NEW Gets a lists of all shards for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1842
1887
|
*
|
|
1843
1888
|
* __Authorization:__
|
|
1844
1889
|
*
|
|
@@ -1875,7 +1920,7 @@ var TwitchApi = class {
|
|
|
1875
1920
|
options
|
|
1876
1921
|
}),
|
|
1877
1922
|
/**
|
|
1878
|
-
* NEW Updates shard(s) for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1923
|
+
* NEW Updates shard(s) for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1879
1924
|
*
|
|
1880
1925
|
* **NOTE:** Shard IDs are indexed starting at 0, so a conduit with a `shard_count` of 5 will have shards with IDs 0 through 4.
|
|
1881
1926
|
*
|
|
@@ -2567,7 +2612,7 @@ var TwitchApi = class {
|
|
|
2567
2612
|
*
|
|
2568
2613
|
* If you use [WebSockets to receive events](https://dev.twitch.tv/docs/eventsub/handling-websocket-events), the request must specify a user access token. The request will fail if you use an app access token. If the subscription type requires user authorization, the token must include the required scope. However, if the subscription type doesn’t include user authorization, the token may include any scopes or no scopes.
|
|
2569
2614
|
*
|
|
2570
|
-
* If you use [Conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) to receive events, the request must specify an app access token. The request will fail if you use a user access token.
|
|
2615
|
+
* If you use [Conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) to receive events, the request must specify an app access token. The request will fail if you use a user access token.
|
|
2571
2616
|
*
|
|
2572
2617
|
* __URL:__
|
|
2573
2618
|
*
|
|
@@ -2666,7 +2711,7 @@ var TwitchApi = class {
|
|
|
2666
2711
|
*
|
|
2667
2712
|
* __Authorization:__
|
|
2668
2713
|
*
|
|
2669
|
-
* If you use [Webhooks](https://dev.twitch.tv/docs/eventsub/handling-webhook-events) or [Conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) to receive events, the request must specify an app access token. The request will fail if you use a user access token.
|
|
2714
|
+
* If you use [Webhooks](https://dev.twitch.tv/docs/eventsub/handling-webhook-events) or [Conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) to receive events, the request must specify an app access token. The request will fail if you use a user access token.
|
|
2670
2715
|
*
|
|
2671
2716
|
* If you use [WebSockets to receive events](https://dev.twitch.tv/docs/eventsub/handling-websocket-events), the request must specify a user access token. The request will fail if you use an app access token. The token may include any scopes.
|
|
2672
2717
|
*
|
|
@@ -3693,7 +3738,7 @@ var TwitchApi = class {
|
|
|
3693
3738
|
*
|
|
3694
3739
|
* __Authorization:__
|
|
3695
3740
|
*
|
|
3696
|
-
* * Requires a user access token that includes the **moderator:manage:unban
|
|
3741
|
+
* * Requires a user access token that includes the **moderator:manage:unban\_requests** scope.
|
|
3697
3742
|
* * Query parameter `moderator_id` must match the `user_id` in the[user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
3698
3743
|
*
|
|
3699
3744
|
* __URL:__
|
|
@@ -5149,6 +5194,10 @@ var TwitchApi = class {
|
|
|
5149
5194
|
* * The access token is not valid.
|
|
5150
5195
|
* * The client ID specified in the Client-Id header must match the client ID specified in the access token.
|
|
5151
5196
|
*
|
|
5197
|
+
* _403 Forbidden_
|
|
5198
|
+
*
|
|
5199
|
+
* The user must complete additional steps in order to stream. Present the user with the returned error message.
|
|
5200
|
+
*
|
|
5152
5201
|
* @see https://dev.twitch.tv/docs/api/reference#get-stream-key
|
|
5153
5202
|
*/
|
|
5154
5203
|
getStreamKey: (params, options = {}) => this.callApi({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-twitch-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Very simple TwitchApi class and TypeScript interfaces for all Twitch API endpoints",
|
|
5
5
|
"author": "DmitryScaletta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,14 +29,13 @@
|
|
|
29
29
|
],
|
|
30
30
|
"type": "module",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"tsup": "^8.
|
|
34
|
-
"
|
|
35
|
-
"typescript": "^5.4.2"
|
|
32
|
+
"@types/node": "^22.13.5",
|
|
33
|
+
"tsup": "^8.3.6",
|
|
34
|
+
"typescript": "^5.7.3"
|
|
36
35
|
},
|
|
37
36
|
"scripts": {
|
|
38
37
|
"build": "pnpm build:src && tsup",
|
|
39
|
-
"build:src": "node
|
|
38
|
+
"build:src": "node ./scripts/build.ts",
|
|
40
39
|
"gen": "pnpm dlx openapi-typescript@6 https://github.com/DmitryScaletta/twitch-api-swagger/raw/main/openapi.json --output twitch-api.generated.ts"
|
|
41
40
|
}
|
|
42
41
|
}
|