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.cjs
CHANGED
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
TwitchApi: () => TwitchApi
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
|
|
27
27
|
// twitch-api.ts
|
|
28
28
|
var BASE_URL = "https://api.twitch.tv/helix";
|
|
@@ -1363,6 +1363,43 @@ var TwitchApi = class {
|
|
|
1363
1363
|
body,
|
|
1364
1364
|
options
|
|
1365
1365
|
}),
|
|
1366
|
+
/**
|
|
1367
|
+
* NEW Retrieves the active shared chat session for a channel.
|
|
1368
|
+
*
|
|
1369
|
+
* __Authorization:__
|
|
1370
|
+
*
|
|
1371
|
+
* 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).
|
|
1372
|
+
*
|
|
1373
|
+
* __URL:__
|
|
1374
|
+
*
|
|
1375
|
+
* `GET https://api.twitch.tv/helix/shared_chat/session`
|
|
1376
|
+
*
|
|
1377
|
+
* __Response Codes:__
|
|
1378
|
+
*
|
|
1379
|
+
* _200 OK_
|
|
1380
|
+
*
|
|
1381
|
+
* Successfully retrieved the shared chat session. Returns an empty array if the broadcaster\_id in the request isn’t in a shared chat session.
|
|
1382
|
+
*
|
|
1383
|
+
* _400 Bad Request_
|
|
1384
|
+
*
|
|
1385
|
+
* The ID in the `broadcaster_id` query parameter is not valid.
|
|
1386
|
+
*
|
|
1387
|
+
* _401 Unauthorized_
|
|
1388
|
+
*
|
|
1389
|
+
* * The OAuth token is not valid.
|
|
1390
|
+
* * The Authorization header is required and must contain a user access token.
|
|
1391
|
+
*
|
|
1392
|
+
* _500 Internal Server Error_
|
|
1393
|
+
*
|
|
1394
|
+
* Internal Server Error.
|
|
1395
|
+
*
|
|
1396
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-shared-chat-session
|
|
1397
|
+
*/
|
|
1398
|
+
getSharedChatSession: (params, options = {}) => this.callApi({
|
|
1399
|
+
path: "/shared_chat/session",
|
|
1400
|
+
params,
|
|
1401
|
+
options
|
|
1402
|
+
}),
|
|
1366
1403
|
/**
|
|
1367
1404
|
* NEW Retrieves emotes available to the user across all channels.
|
|
1368
1405
|
*
|
|
@@ -1404,6 +1441,8 @@ var TwitchApi = class {
|
|
|
1404
1441
|
/**
|
|
1405
1442
|
* Sends an announcement to the broadcaster’s chat room.
|
|
1406
1443
|
*
|
|
1444
|
+
* **Rate Limits**: One announcement may be sent every 2 seconds.
|
|
1445
|
+
*
|
|
1407
1446
|
* __Authorization:__
|
|
1408
1447
|
*
|
|
1409
1448
|
* Requires a [user access token](https://dev.twitch.tv/docs/authentication#user-access-tokens) that includes the **moderator:manage:announcements** scope.
|
|
@@ -1432,6 +1471,10 @@ var TwitchApi = class {
|
|
|
1432
1471
|
* * The OAuth token is not valid.
|
|
1433
1472
|
* * The client ID specified in the Client-Id header does not match the client ID specified in the OAuth token.
|
|
1434
1473
|
*
|
|
1474
|
+
* _429 Too Many Requests_
|
|
1475
|
+
*
|
|
1476
|
+
* The sender has exceeded the number of announcements they may send to this **broadcaster\_id** within a given window.
|
|
1477
|
+
*
|
|
1435
1478
|
* @see https://dev.twitch.tv/docs/api/reference#send-chat-announcement
|
|
1436
1479
|
*/
|
|
1437
1480
|
sendChatAnnouncement: (params, body, options = {}) => this.callApi({
|
|
@@ -1446,7 +1489,7 @@ var TwitchApi = class {
|
|
|
1446
1489
|
*
|
|
1447
1490
|
* 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)
|
|
1448
1491
|
*
|
|
1449
|
-
* **Rate Limits
|
|
1492
|
+
* **Rate Limits**: The broadcaster may send a Shoutout once every 2 minutes. They may send the same broadcaster a Shoutout once every 60 minutes.
|
|
1450
1493
|
*
|
|
1451
1494
|
* 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.
|
|
1452
1495
|
*
|
|
@@ -1680,6 +1723,8 @@ var TwitchApi = class {
|
|
|
1680
1723
|
/**
|
|
1681
1724
|
* 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).
|
|
1682
1725
|
*
|
|
1726
|
+
* 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.
|
|
1727
|
+
*
|
|
1683
1728
|
* __Authorization:__
|
|
1684
1729
|
*
|
|
1685
1730
|
* 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).
|
|
@@ -1723,7 +1768,7 @@ var TwitchApi = class {
|
|
|
1723
1768
|
};
|
|
1724
1769
|
conduits = {
|
|
1725
1770
|
/**
|
|
1726
|
-
* NEW Gets the [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events) for a client ID.
|
|
1771
|
+
* NEW Gets the [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/) for a client ID.
|
|
1727
1772
|
*
|
|
1728
1773
|
* __Authorization:__
|
|
1729
1774
|
*
|
|
@@ -1750,7 +1795,7 @@ var TwitchApi = class {
|
|
|
1750
1795
|
options
|
|
1751
1796
|
}),
|
|
1752
1797
|
/**
|
|
1753
|
-
* NEW Creates a new [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1798
|
+
* NEW Creates a new [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1754
1799
|
*
|
|
1755
1800
|
* __Authorization:__
|
|
1756
1801
|
*
|
|
@@ -1787,7 +1832,7 @@ var TwitchApi = class {
|
|
|
1787
1832
|
options
|
|
1788
1833
|
}),
|
|
1789
1834
|
/**
|
|
1790
|
-
* 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.
|
|
1835
|
+
* 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.
|
|
1791
1836
|
*
|
|
1792
1837
|
* __Authorization:__
|
|
1793
1838
|
*
|
|
@@ -1826,7 +1871,7 @@ var TwitchApi = class {
|
|
|
1826
1871
|
options
|
|
1827
1872
|
}),
|
|
1828
1873
|
/**
|
|
1829
|
-
* 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).
|
|
1874
|
+
* 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).
|
|
1830
1875
|
*
|
|
1831
1876
|
* __Authorization:__
|
|
1832
1877
|
*
|
|
@@ -1864,7 +1909,7 @@ var TwitchApi = class {
|
|
|
1864
1909
|
options
|
|
1865
1910
|
}),
|
|
1866
1911
|
/**
|
|
1867
|
-
* NEW Gets a lists of all shards for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1912
|
+
* NEW Gets a lists of all shards for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1868
1913
|
*
|
|
1869
1914
|
* __Authorization:__
|
|
1870
1915
|
*
|
|
@@ -1901,7 +1946,7 @@ var TwitchApi = class {
|
|
|
1901
1946
|
options
|
|
1902
1947
|
}),
|
|
1903
1948
|
/**
|
|
1904
|
-
* NEW Updates shard(s) for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events).
|
|
1949
|
+
* NEW Updates shard(s) for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events/).
|
|
1905
1950
|
*
|
|
1906
1951
|
* **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.
|
|
1907
1952
|
*
|
|
@@ -2593,7 +2638,7 @@ var TwitchApi = class {
|
|
|
2593
2638
|
*
|
|
2594
2639
|
* 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.
|
|
2595
2640
|
*
|
|
2596
|
-
* 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.
|
|
2641
|
+
* 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.
|
|
2597
2642
|
*
|
|
2598
2643
|
* __URL:__
|
|
2599
2644
|
*
|
|
@@ -2692,7 +2737,7 @@ var TwitchApi = class {
|
|
|
2692
2737
|
*
|
|
2693
2738
|
* __Authorization:__
|
|
2694
2739
|
*
|
|
2695
|
-
* 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.
|
|
2740
|
+
* 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.
|
|
2696
2741
|
*
|
|
2697
2742
|
* 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.
|
|
2698
2743
|
*
|
|
@@ -3719,7 +3764,7 @@ var TwitchApi = class {
|
|
|
3719
3764
|
*
|
|
3720
3765
|
* __Authorization:__
|
|
3721
3766
|
*
|
|
3722
|
-
* * Requires a user access token that includes the **moderator:manage:unban
|
|
3767
|
+
* * Requires a user access token that includes the **moderator:manage:unban\_requests** scope.
|
|
3723
3768
|
* * Query parameter `moderator_id` must match the `user_id` in the[user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
3724
3769
|
*
|
|
3725
3770
|
* __URL:__
|
|
@@ -5175,6 +5220,10 @@ var TwitchApi = class {
|
|
|
5175
5220
|
* * The access token is not valid.
|
|
5176
5221
|
* * The client ID specified in the Client-Id header must match the client ID specified in the access token.
|
|
5177
5222
|
*
|
|
5223
|
+
* _403 Forbidden_
|
|
5224
|
+
*
|
|
5225
|
+
* The user must complete additional steps in order to stream. Present the user with the returned error message.
|
|
5226
|
+
*
|
|
5178
5227
|
* @see https://dev.twitch.tv/docs/api/reference#get-stream-key
|
|
5179
5228
|
*/
|
|
5180
5229
|
getStreamKey: (params, options = {}) => this.callApi({
|