ts-twitch-api 0.2.6 → 0.2.8
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 +154 -2
- package/dist/index.d.cts +412 -32
- package/dist/index.d.ts +412 -32
- package/dist/index.js +154 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1677,7 +1677,7 @@ var TwitchApi = class {
|
|
|
1677
1677
|
/**
|
|
1678
1678
|
* Creates a clip from the broadcaster’s stream.
|
|
1679
1679
|
*
|
|
1680
|
-
* This API captures up to 90 seconds of the broadcaster’s stream. The 90 seconds spans the point in the stream from when you called the API. For example, if you call the API at the 4:00 minute mark, the API captures from approximately the
|
|
1680
|
+
* This API captures up to 90 seconds of the broadcaster’s stream. The 90 seconds spans the point in the stream from when you called the API. For example, if you call the API at the 4:00 minute mark, the API captures from approximately the 2:35 mark to approximately the 4:05 minute mark. Twitch tries its best to capture 90 seconds of the stream, but the actual length may be less. This may occur if you begin capturing the clip near the beginning or end of the stream.
|
|
1681
1681
|
*
|
|
1682
1682
|
* By default, Twitch publishes up to the last 30 seconds of the 90 seconds window and provides a default title for the clip. To specify the title and the portion of the 90 seconds window that’s used for the clip, use the URL in the response’s `edit_url` field. You can specify a clip that’s from 5 seconds to 60 seconds in length. The URL is valid for up to 24 hours or until the clip is published, whichever comes first.
|
|
1683
1683
|
*
|
|
@@ -1701,6 +1701,8 @@ var TwitchApi = class {
|
|
|
1701
1701
|
*
|
|
1702
1702
|
* * The _broadcaster\_id_ query parameter is required.
|
|
1703
1703
|
* * The ID in the _broadcaster\_id_ query parameter was not found.
|
|
1704
|
+
* * The category is not clippable.
|
|
1705
|
+
* * The title did not pass AutoMod checks.
|
|
1704
1706
|
*
|
|
1705
1707
|
* _401 Unauthorized_
|
|
1706
1708
|
*
|
|
@@ -1713,6 +1715,7 @@ var TwitchApi = class {
|
|
|
1713
1715
|
*
|
|
1714
1716
|
* * The broadcaster has restricted the ability to capture clips to followers and/or subscribers only.
|
|
1715
1717
|
* * The specified broadcaster has not enabled clips on their channel.
|
|
1718
|
+
* * The user is banned or timed out from the broadcaster’s channel.
|
|
1716
1719
|
*
|
|
1717
1720
|
* _404 Not Found_
|
|
1718
1721
|
*
|
|
@@ -1770,6 +1773,112 @@ var TwitchApi = class {
|
|
|
1770
1773
|
path: "/clips",
|
|
1771
1774
|
params,
|
|
1772
1775
|
options
|
|
1776
|
+
}),
|
|
1777
|
+
/**
|
|
1778
|
+
* BETA Creates a clip from a broadcaster’s VOD on behalf of the broadcaster or an editor of the channel. Since a live stream is actively creating a VOD, this endpoint can also be used to create a clip from earlier in the current stream.
|
|
1779
|
+
*
|
|
1780
|
+
* The duration of a clip can be from 5 seconds to 60 seconds in length, with a default of 30 seconds if not specified.
|
|
1781
|
+
*
|
|
1782
|
+
* `vod_offset` indicates where the clip will end. In other words, the clip will start at (`vod_offset` \- `duration`) and end at `vod_offset`. This means that the value of `vod_offset` must greater than or equal to the value of `duration`.
|
|
1783
|
+
*
|
|
1784
|
+
* The URL in the response’s `edit_url` field allows you to edit the clip’s title, feature the clip, create a portrait version of the clip, download the clip media, and share the clip directly to social platforms.
|
|
1785
|
+
*
|
|
1786
|
+
* __Authorization:__
|
|
1787
|
+
*
|
|
1788
|
+
* 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.
|
|
1789
|
+
*
|
|
1790
|
+
* __URL:__
|
|
1791
|
+
*
|
|
1792
|
+
* `POST https://api.twitch.tv/helix/videos/clips`
|
|
1793
|
+
*
|
|
1794
|
+
* __Response Codes:__
|
|
1795
|
+
*
|
|
1796
|
+
* _202 Accepted_
|
|
1797
|
+
*
|
|
1798
|
+
* Successfully started the clip process.
|
|
1799
|
+
*
|
|
1800
|
+
* _400 Bad Request_
|
|
1801
|
+
*
|
|
1802
|
+
* * Validation errors: Invalid source type, missing required fields.
|
|
1803
|
+
* * The broadcaster\_id query parameter is required.
|
|
1804
|
+
* * The ID in the broadcaster\_id query parameter was not found.
|
|
1805
|
+
* * The category is not clippable.
|
|
1806
|
+
* * The title did not pass AutoMod checks.
|
|
1807
|
+
* * Broadcaster is banned.
|
|
1808
|
+
*
|
|
1809
|
+
* _401 Unauthorized_
|
|
1810
|
+
*
|
|
1811
|
+
* * The Authorization header is required and must specify user access token.
|
|
1812
|
+
* * The user access token must include the **editor:manage:clips** or **channel:manage:clips** scope.
|
|
1813
|
+
* * The OAuth token is not valid.
|
|
1814
|
+
* * The ID in the Client-Id header must match the Client ID in the OAuth token.
|
|
1815
|
+
*
|
|
1816
|
+
* _403 Forbidden_
|
|
1817
|
+
*
|
|
1818
|
+
* * The broadcaster has restricted the ability to capture clips to followers and/or subscribers only.
|
|
1819
|
+
* * The specified broadcaster has not enabled clips on their channel.
|
|
1820
|
+
* * The user defined by the _editor\_id_ is not authorized to create Clips.
|
|
1821
|
+
* * The user is banned or timed out from the broadcaster's channel.
|
|
1822
|
+
*
|
|
1823
|
+
* _404 Not Found_
|
|
1824
|
+
*
|
|
1825
|
+
* * The broadcaster in the _broadcaster\_id_ query parameter must be broadcasting live.
|
|
1826
|
+
* * The VOD is not found..
|
|
1827
|
+
* * The _broadcaster\_id_ or the _editor\_id_ does not exist.
|
|
1828
|
+
*
|
|
1829
|
+
* @see https://dev.twitch.tv/docs/api/reference#create-clip-from-vod
|
|
1830
|
+
*/
|
|
1831
|
+
createClipFromVOD: (params, options = {}) => this.callApi({
|
|
1832
|
+
path: "/videos/clips",
|
|
1833
|
+
method: "POST",
|
|
1834
|
+
params,
|
|
1835
|
+
options
|
|
1836
|
+
}),
|
|
1837
|
+
/**
|
|
1838
|
+
* 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).
|
|
1839
|
+
*
|
|
1840
|
+
* **Rate Limits**: Limited to 100 requests per minute.
|
|
1841
|
+
*
|
|
1842
|
+
* __Authorization:__
|
|
1843
|
+
*
|
|
1844
|
+
* 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.
|
|
1845
|
+
*
|
|
1846
|
+
* __URL:__
|
|
1847
|
+
*
|
|
1848
|
+
* `GET https://api.twitch.tv/helix/clips/downloads`
|
|
1849
|
+
*
|
|
1850
|
+
* __Response Codes:__
|
|
1851
|
+
*
|
|
1852
|
+
* _200 OK_
|
|
1853
|
+
*
|
|
1854
|
+
* Successfully retrieved the clip download URL(s).
|
|
1855
|
+
*
|
|
1856
|
+
* _400 Bad Request_
|
|
1857
|
+
*
|
|
1858
|
+
* The ID in the broadcaster\_id, editor\_id, or clip\_id query parameter is not valid.
|
|
1859
|
+
*
|
|
1860
|
+
* _401 Unauthorized_
|
|
1861
|
+
*
|
|
1862
|
+
* * The OAuth token is not valid.
|
|
1863
|
+
* * The Authorization header is required and must contain a user access token or app access token.
|
|
1864
|
+
* * The access token must include the editor:manage:clips or channel:manage:clips scope
|
|
1865
|
+
* * The access token is not valid
|
|
1866
|
+
* * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
|
|
1867
|
+
*
|
|
1868
|
+
* _403 Forbidden_
|
|
1869
|
+
*
|
|
1870
|
+
* The user is not an editor for the specified broadcaster.
|
|
1871
|
+
*
|
|
1872
|
+
* _500 Internal Server Error_
|
|
1873
|
+
*
|
|
1874
|
+
* Internal Server Error.
|
|
1875
|
+
*
|
|
1876
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-clips-download
|
|
1877
|
+
*/
|
|
1878
|
+
getClipsDownload: (params, options = {}) => this.callApi({
|
|
1879
|
+
path: "/clips/downloads",
|
|
1880
|
+
params,
|
|
1881
|
+
options
|
|
1773
1882
|
})
|
|
1774
1883
|
};
|
|
1775
1884
|
conduits = {
|
|
@@ -3325,6 +3434,8 @@ var TwitchApi = class {
|
|
|
3325
3434
|
};
|
|
3326
3435
|
hypeTrain = {
|
|
3327
3436
|
/**
|
|
3437
|
+
* 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).
|
|
3438
|
+
*
|
|
3328
3439
|
* Gets information about the broadcaster’s current or most recent Hype Train event.
|
|
3329
3440
|
*
|
|
3330
3441
|
* 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)).
|
|
@@ -3359,7 +3470,7 @@ var TwitchApi = class {
|
|
|
3359
3470
|
options
|
|
3360
3471
|
}),
|
|
3361
3472
|
/**
|
|
3362
|
-
*
|
|
3473
|
+
* NEW Get the status of a Hype Train for the specified broadcaster.
|
|
3363
3474
|
*
|
|
3364
3475
|
* __Authorization:__
|
|
3365
3476
|
*
|
|
@@ -5767,6 +5878,47 @@ var TwitchApi = class {
|
|
|
5767
5878
|
params,
|
|
5768
5879
|
options
|
|
5769
5880
|
}),
|
|
5881
|
+
/**
|
|
5882
|
+
* NEW Gets the authorization scopes that the specified user(s) have granted the application.
|
|
5883
|
+
*
|
|
5884
|
+
* __Authorization:__
|
|
5885
|
+
*
|
|
5886
|
+
* Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens).
|
|
5887
|
+
*
|
|
5888
|
+
* __URL:__
|
|
5889
|
+
*
|
|
5890
|
+
* `GET https://api.twitch.tv/helix/authorization/users`
|
|
5891
|
+
*
|
|
5892
|
+
* __Response Codes:__
|
|
5893
|
+
*
|
|
5894
|
+
* _200 OK_
|
|
5895
|
+
*
|
|
5896
|
+
* Successfully retrieved user authorization.
|
|
5897
|
+
*
|
|
5898
|
+
* _400 Bad Request_
|
|
5899
|
+
*
|
|
5900
|
+
* Request is malformed - invalid parameters or missing parameters.
|
|
5901
|
+
*
|
|
5902
|
+
* _401 Unauthorized_
|
|
5903
|
+
*
|
|
5904
|
+
* * The access token is not valid.
|
|
5905
|
+
* * Authorization header is required and must specify an app access token.
|
|
5906
|
+
*
|
|
5907
|
+
* _403 Forbidden_
|
|
5908
|
+
*
|
|
5909
|
+
* The client-id in the header must match the client ID in the access token.
|
|
5910
|
+
*
|
|
5911
|
+
* _500 Internal Server Error_
|
|
5912
|
+
*
|
|
5913
|
+
* Internal Server Error.
|
|
5914
|
+
*
|
|
5915
|
+
* @see https://dev.twitch.tv/docs/api/reference#get-authorization-by-user
|
|
5916
|
+
*/
|
|
5917
|
+
getAuthorizationByUser: (params, options = {}) => this.callApi({
|
|
5918
|
+
path: "/authorization/users",
|
|
5919
|
+
params,
|
|
5920
|
+
options
|
|
5921
|
+
}),
|
|
5770
5922
|
/**
|
|
5771
5923
|
* 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)
|
|
5772
5924
|
*
|