ts-twitch-api 0.2.5 → 0.2.7
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 +141 -3
- package/dist/index.d.cts +517 -31
- package/dist/index.d.ts +517 -31
- package/dist/index.js +141 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1519,6 +1519,11 @@ var TwitchApi = class {
|
|
|
1519
1519
|
/**
|
|
1520
1520
|
* NEW Sends a message to the broadcaster’s chat room.
|
|
1521
1521
|
*
|
|
1522
|
+
* **NOTE:** When sending messages to a Shared Chat session, behaviors differ depending on your authentication token type:
|
|
1523
|
+
*
|
|
1524
|
+
* * When using an _App Access Token_, messages will only be sent to the source channel (defined by the `broadcaster_id` parameter) by default starting on May 19, 2025\. Messages can be sent to all channels by using the `for_source_only` parameter and setting it to `false`.
|
|
1525
|
+
* * When using a _User Access Token_, messages will be sent to all channels in the shared chat session, including the source channel. This behavior cannot be changed with this token type.
|
|
1526
|
+
*
|
|
1522
1527
|
* __Authorization:__
|
|
1523
1528
|
*
|
|
1524
1529
|
* 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) that includes the `user:write:chat` scope. If app access token used, then additionally requires `user:bot` scope from chatting user, and either `channel:bot` scope from broadcaster or moderator status.
|
|
@@ -1541,6 +1546,7 @@ var TwitchApi = class {
|
|
|
1541
1546
|
* * The ID in the _sender\_id_ query parameter is not valid.
|
|
1542
1547
|
* * The _text_ query parameter is required.
|
|
1543
1548
|
* * The ID in the _reply\_parent\_message\_id_ query parameter is not valid.
|
|
1549
|
+
* * Cannot set \*for\_source\_only\* if User Access Token is used.
|
|
1544
1550
|
*
|
|
1545
1551
|
* _401 Unauthorized_
|
|
1546
1552
|
*
|
|
@@ -1738,6 +1744,52 @@ var TwitchApi = class {
|
|
|
1738
1744
|
path: "/clips",
|
|
1739
1745
|
params,
|
|
1740
1746
|
options
|
|
1747
|
+
}),
|
|
1748
|
+
/**
|
|
1749
|
+
* NEW Provides URLs to download the video file(s) for the specified clips. For information about clips, see [How to use clips](https://help.twitch.tv/s/article/how-to-use-clips).
|
|
1750
|
+
*
|
|
1751
|
+
* **Rate Limits**: Limited to 100 requests per minute.
|
|
1752
|
+
*
|
|
1753
|
+
* __Authorization:__
|
|
1754
|
+
*
|
|
1755
|
+
* 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) that includes the `editor:manage:clips` or `channel:manage:clips` scope.
|
|
1756
|
+
*
|
|
1757
|
+
* __URL:__
|
|
1758
|
+
*
|
|
1759
|
+
* `GET https://api.twitch.tv/helix/clips/downloads`
|
|
1760
|
+
*
|
|
1761
|
+
* __Response Codes:__
|
|
1762
|
+
*
|
|
1763
|
+
* _200 OK_
|
|
1764
|
+
*
|
|
1765
|
+
* Successfully retrieved the clip download URL(s).
|
|
1766
|
+
*
|
|
1767
|
+
* _400 Bad Request_
|
|
1768
|
+
*
|
|
1769
|
+
* The ID in the broadcaster\_id, editor\_id, or clip\_id query parameter is not valid.
|
|
1770
|
+
*
|
|
1771
|
+
* _401 Unauthorized_
|
|
1772
|
+
*
|
|
1773
|
+
* * The OAuth token is not valid.
|
|
1774
|
+
* * The Authorization header is required and must contain a user access token or app access token.
|
|
1775
|
+
* * The access token must include the editor:manage:clips or channel:manage:clips scope
|
|
1776
|
+
* * The access token is not valid
|
|
1777
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
1778
|
+
*
|
|
1779
|
+
* _403 Forbidden_
|
|
1780
|
+
*
|
|
1781
|
+
* The user is not an editor for the specified broadcaster.
|
|
1782
|
+
*
|
|
1783
|
+
* _500 Internal Server Error_
|
|
1784
|
+
*
|
|
1785
|
+
* Internal Server Error.
|
|
1786
|
+
*
|
|
1787
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-clips-download
|
|
1788
|
+
*/
|
|
1789
|
+
getClipsDownload: (params, options = {}) => this.callApi({
|
|
1790
|
+
path: "/clips/downloads",
|
|
1791
|
+
params,
|
|
1792
|
+
options
|
|
1741
1793
|
})
|
|
1742
1794
|
};
|
|
1743
1795
|
conduits = {
|
|
@@ -2014,7 +2066,7 @@ var TwitchApi = class {
|
|
|
2014
2066
|
*
|
|
2015
2067
|
* __Authorization:__
|
|
2016
2068
|
*
|
|
2017
|
-
* 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). The
|
|
2069
|
+
* 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). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/docs/companies/) that holds ownership of the game.
|
|
2018
2070
|
*
|
|
2019
2071
|
* __URL:__
|
|
2020
2072
|
*
|
|
@@ -2066,7 +2118,7 @@ var TwitchApi = class {
|
|
|
2066
2118
|
*
|
|
2067
2119
|
* __Authorization:__
|
|
2068
2120
|
*
|
|
2069
|
-
* 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). The
|
|
2121
|
+
* 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). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/docs/companies/) that holds ownership of the game.
|
|
2070
2122
|
*
|
|
2071
2123
|
* __URL:__
|
|
2072
2124
|
*
|
|
@@ -2717,7 +2769,7 @@ var TwitchApi = class {
|
|
|
2717
2769
|
*
|
|
2718
2770
|
* __Request Query Parameters:__
|
|
2719
2771
|
*
|
|
2720
|
-
* Use the _status_, _type_, and
|
|
2772
|
+
* Use the _status_, _type_, _user\_id_, and _subscription\_id_ query parameters to filter the list of subscriptions that are returned. The filters are mutually exclusive; the request fails if you specify more than one filter.
|
|
2721
2773
|
*
|
|
2722
2774
|
* __URL:__
|
|
2723
2775
|
*
|
|
@@ -3293,6 +3345,8 @@ var TwitchApi = class {
|
|
|
3293
3345
|
};
|
|
3294
3346
|
hypeTrain = {
|
|
3295
3347
|
/**
|
|
3348
|
+
* DEPRECATED Scheduled for removal on December 4, 2025\. Use “Get Hype Train Status” instead. See [announcement](https://discuss.dev.twitch.com/t/legacy-get-hype-train-events-api-and-eventsub-hype-train-v1-subscription-types-deprecation-and-withdrawal-timeline/64299).
|
|
3349
|
+
*
|
|
3296
3350
|
* Gets information about the broadcaster’s current or most recent Hype Train event.
|
|
3297
3351
|
*
|
|
3298
3352
|
* Instead of polling for events, consider [subscribing](https://dev.twitch.tv/docs/eventsub/manage-subscriptions) to Hype Train events ([Begin](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype%5Ftrainbegin), [Progress](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype%5Ftrainprogress), [End](https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelhype%5Ftrainend)).
|
|
@@ -3325,6 +3379,45 @@ var TwitchApi = class {
|
|
|
3325
3379
|
path: "/hypetrain/events",
|
|
3326
3380
|
params,
|
|
3327
3381
|
options
|
|
3382
|
+
}),
|
|
3383
|
+
/**
|
|
3384
|
+
* NEW Get the status of a Hype Train for the specified broadcaster.
|
|
3385
|
+
*
|
|
3386
|
+
* __Authorization:__
|
|
3387
|
+
*
|
|
3388
|
+
* * Requires an [user access token](https://dev.twitch.tv/docs/authentication/#user-access-tokens).
|
|
3389
|
+
* * Requires OAuth Scope: `channel:read:hype_train`.
|
|
3390
|
+
* * Requires that `broadcaster_id` and `user_id` match in the User-Access token.
|
|
3391
|
+
*
|
|
3392
|
+
* __URL:__
|
|
3393
|
+
*
|
|
3394
|
+
* `GET https://api.twitch.tv/helix/hypetrain/status`
|
|
3395
|
+
*
|
|
3396
|
+
* __Response Codes:__
|
|
3397
|
+
*
|
|
3398
|
+
* _200 OK_
|
|
3399
|
+
*
|
|
3400
|
+
* Successfully retrieved the status object.
|
|
3401
|
+
*
|
|
3402
|
+
* _400 Bad Request_
|
|
3403
|
+
*
|
|
3404
|
+
* The ID in the `broadcaster_id` query parameter is not valid.
|
|
3405
|
+
*
|
|
3406
|
+
* _401 Unauthorized_
|
|
3407
|
+
*
|
|
3408
|
+
* * The OAuth token is not valid.
|
|
3409
|
+
* * The Authorization header is required and must contain a user access token.
|
|
3410
|
+
*
|
|
3411
|
+
* _500 Internal Server Error_
|
|
3412
|
+
*
|
|
3413
|
+
* Internal Server Error.
|
|
3414
|
+
*
|
|
3415
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-hype-train-status
|
|
3416
|
+
*/
|
|
3417
|
+
getHypeTrainStatus: (params, options = {}) => this.callApi({
|
|
3418
|
+
path: "/hypetrain/status",
|
|
3419
|
+
params,
|
|
3420
|
+
options
|
|
3328
3421
|
})
|
|
3329
3422
|
};
|
|
3330
3423
|
moderation = {
|
|
@@ -5684,6 +5777,10 @@ var TwitchApi = class {
|
|
|
5684
5777
|
* * The access token is not valid.
|
|
5685
5778
|
* * The ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
5686
5779
|
*
|
|
5780
|
+
* _429 Too Many Requests_
|
|
5781
|
+
*
|
|
5782
|
+
* The app exceeded the number of requests that it may make.
|
|
5783
|
+
*
|
|
5687
5784
|
* @see https://dev.twitch.tv/docs/api/reference#update-user
|
|
5688
5785
|
*/
|
|
5689
5786
|
updateUser: (params = null, options = {}) => this.callApi({
|
|
@@ -5692,6 +5789,47 @@ var TwitchApi = class {
|
|
|
5692
5789
|
params,
|
|
5693
5790
|
options
|
|
5694
5791
|
}),
|
|
5792
|
+
/**
|
|
5793
|
+
* NEW Gets the authorization scopes that the specified user(s) have granted the application.
|
|
5794
|
+
*
|
|
5795
|
+
* __Authorization:__
|
|
5796
|
+
*
|
|
5797
|
+
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens).
|
|
5798
|
+
*
|
|
5799
|
+
* __URL:__
|
|
5800
|
+
*
|
|
5801
|
+
* `GET https://api.twitch.tv/helix/authorization/users`
|
|
5802
|
+
*
|
|
5803
|
+
* __Response Codes:__
|
|
5804
|
+
*
|
|
5805
|
+
* _200 OK_
|
|
5806
|
+
*
|
|
5807
|
+
* Successfully retrieved user authorization.
|
|
5808
|
+
*
|
|
5809
|
+
* _400 Bad Request_
|
|
5810
|
+
*
|
|
5811
|
+
* Request is malformed - invalid parameters or missing parameters.
|
|
5812
|
+
*
|
|
5813
|
+
* _401 Unauthorized_
|
|
5814
|
+
*
|
|
5815
|
+
* * The access token is not valid.
|
|
5816
|
+
* * Authorization header is required and must specify an app access token.
|
|
5817
|
+
*
|
|
5818
|
+
* _403 Forbidden_
|
|
5819
|
+
*
|
|
5820
|
+
* The client-id in the header must match the client ID in the access token.
|
|
5821
|
+
*
|
|
5822
|
+
* _500 Internal Server Error_
|
|
5823
|
+
*
|
|
5824
|
+
* Internal Server Error.
|
|
5825
|
+
*
|
|
5826
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-authorization-by-user
|
|
5827
|
+
*/
|
|
5828
|
+
getAuthorizationByUser: (params, options = {}) => this.callApi({
|
|
5829
|
+
path: "/authorization/users",
|
|
5830
|
+
params,
|
|
5831
|
+
options
|
|
5832
|
+
}),
|
|
5695
5833
|
/**
|
|
5696
5834
|
* Gets the list of users that the broadcaster has blocked. [Read More](https://help.twitch.tv/s/article/how-to-manage-harassment-in-chat?language=en%5FUS#BlockWhispersandMessagesfromStrangers)
|
|
5697
5835
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-twitch-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Very simple TwitchApi class and TypeScript interfaces for all Twitch API endpoints",
|
|
5
5
|
"author": "DmitryScaletta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"type": "module",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"tsup": "
|
|
34
|
-
"typescript": "^5.
|
|
32
|
+
"@types/node": "^24.10.1",
|
|
33
|
+
"tsup": "8.5.1",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "pnpm build:src && tsup",
|