ts-twitch-api 0.2.7 → 0.3.0
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 +155 -6
- package/dist/index.d.cts +513 -47
- package/dist/index.d.ts +513 -47
- package/dist/index.js +155 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1536,7 +1536,7 @@ var TwitchApi = class {
|
|
|
1536
1536
|
*
|
|
1537
1537
|
* @see https://dev.twitch.tv/docs/api/reference#send-a-shoutout
|
|
1538
1538
|
*/
|
|
1539
|
-
|
|
1539
|
+
sendAShoutout: (params, options = {}) => this.callApi({
|
|
1540
1540
|
path: "/chat/shoutouts",
|
|
1541
1541
|
method: "POST",
|
|
1542
1542
|
params,
|
|
@@ -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
|
*
|
|
@@ -1771,6 +1774,66 @@ var TwitchApi = class {
|
|
|
1771
1774
|
params,
|
|
1772
1775
|
options
|
|
1773
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
|
+
}),
|
|
1774
1837
|
/**
|
|
1775
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).
|
|
1776
1839
|
*
|
|
@@ -3091,7 +3154,7 @@ var TwitchApi = class {
|
|
|
3091
3154
|
*
|
|
3092
3155
|
* __Response Codes:__
|
|
3093
3156
|
*
|
|
3094
|
-
*
|
|
3157
|
+
* _200 OK_
|
|
3095
3158
|
*
|
|
3096
3159
|
* _400 Bad Request_
|
|
3097
3160
|
*
|
|
@@ -4492,7 +4555,7 @@ var TwitchApi = class {
|
|
|
4492
4555
|
options
|
|
4493
4556
|
}),
|
|
4494
4557
|
/**
|
|
4495
|
-
*
|
|
4558
|
+
* Warns a user in the specified broadcaster’s chat room, preventing them from chat interaction until the warning is acknowledged. New warnings can be issued to a user when they already have a warning in the channel (new warning will replace old warning).
|
|
4496
4559
|
*
|
|
4497
4560
|
* __Authorization:__
|
|
4498
4561
|
*
|
|
@@ -4549,6 +4612,92 @@ var TwitchApi = class {
|
|
|
4549
4612
|
params,
|
|
4550
4613
|
body,
|
|
4551
4614
|
options
|
|
4615
|
+
}),
|
|
4616
|
+
/**
|
|
4617
|
+
* BETA Adds a suspicious user status to a chatter on the broadcaster’s channel.
|
|
4618
|
+
*
|
|
4619
|
+
* __Authorization:__
|
|
4620
|
+
*
|
|
4621
|
+
* 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 **moderator:manage:suspicious\_users** scope.
|
|
4622
|
+
*
|
|
4623
|
+
* __URL:__
|
|
4624
|
+
*
|
|
4625
|
+
* `POST https://api.twitch.tv/helix/moderation/suspicious_users`
|
|
4626
|
+
*
|
|
4627
|
+
* __Response Codes:__
|
|
4628
|
+
*
|
|
4629
|
+
* _200 OK_
|
|
4630
|
+
*
|
|
4631
|
+
* Successfully applied a suspicious user status.
|
|
4632
|
+
*
|
|
4633
|
+
* _400 Bad Request_
|
|
4634
|
+
*
|
|
4635
|
+
* * Validation errors: Missing required fields.
|
|
4636
|
+
* * The ID in the broadcaster\_id query parameter was not found.
|
|
4637
|
+
* * The status specified was invalid. Must either be ACTIVE\_MONITORING or RESTRICTED
|
|
4638
|
+
* * The status update is not allowed for this user.
|
|
4639
|
+
*
|
|
4640
|
+
* _401 Unauthorized_
|
|
4641
|
+
*
|
|
4642
|
+
* * The Authorization header is required and must specify user access token.
|
|
4643
|
+
* * The user access token must include the **moderator:manage:suspicious\_users** scope.
|
|
4644
|
+
* * The OAuth token is not valid.
|
|
4645
|
+
* * The ID in the Client-Id header must match the Client ID in the OAuth token.
|
|
4646
|
+
*
|
|
4647
|
+
* _403 Forbidden_
|
|
4648
|
+
*
|
|
4649
|
+
* * The user in the moderator\_id query parameter is not one of the broadcaster's moderators.
|
|
4650
|
+
*
|
|
4651
|
+
* @see https://dev.twitch.tv/docs/api/reference#add-suspicious-status-to-chat-user
|
|
4652
|
+
*/
|
|
4653
|
+
addSuspiciousStatusToChatUser: (params, body, options = {}) => this.callApi({
|
|
4654
|
+
path: "/moderation/suspicious_users",
|
|
4655
|
+
method: "POST",
|
|
4656
|
+
params,
|
|
4657
|
+
body,
|
|
4658
|
+
options
|
|
4659
|
+
}),
|
|
4660
|
+
/**
|
|
4661
|
+
* BETA Remove a suspicious user status from a chatter on broadcaster’s channel.
|
|
4662
|
+
*
|
|
4663
|
+
* __Authorization:__
|
|
4664
|
+
*
|
|
4665
|
+
* 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 **moderator:manage:suspicious\_users** scope.
|
|
4666
|
+
*
|
|
4667
|
+
* __URL:__
|
|
4668
|
+
*
|
|
4669
|
+
* `DELETE https://api.twitch.tv/helix/moderation/suspicious_users`
|
|
4670
|
+
*
|
|
4671
|
+
* __Response Codes:__
|
|
4672
|
+
*
|
|
4673
|
+
* _200 OK_
|
|
4674
|
+
*
|
|
4675
|
+
* Successfully removed a suspicious user status.
|
|
4676
|
+
*
|
|
4677
|
+
* _400 Bad Request_
|
|
4678
|
+
*
|
|
4679
|
+
* * Validation errors: Missing required fields.
|
|
4680
|
+
* * The ID in the broadcaster\_id query parameter was not found.
|
|
4681
|
+
* * The status update is not allowed for this user.
|
|
4682
|
+
*
|
|
4683
|
+
* _401 Unauthorized_
|
|
4684
|
+
*
|
|
4685
|
+
* * The Authorization header is required and must specify user access token.
|
|
4686
|
+
* * The user access token must include the **moderator:manage:suspicious\_users** scope.
|
|
4687
|
+
* * The OAuth token is not valid.
|
|
4688
|
+
* * The ID in the Client-Id header must match the Client ID in the OAuth token.
|
|
4689
|
+
*
|
|
4690
|
+
* _403 Forbidden_
|
|
4691
|
+
*
|
|
4692
|
+
* * The user in the moderator\_id query parameter is not one of the broadcaster's moderators.
|
|
4693
|
+
*
|
|
4694
|
+
* @see https://dev.twitch.tv/docs/api/reference#remove-suspicious-status-from-chat-user
|
|
4695
|
+
*/
|
|
4696
|
+
removeSuspiciousStatusFromChatUser: (params, options = {}) => this.callApi({
|
|
4697
|
+
path: "/moderation/suspicious_users",
|
|
4698
|
+
method: "DELETE",
|
|
4699
|
+
params,
|
|
4700
|
+
options
|
|
4552
4701
|
})
|
|
4553
4702
|
};
|
|
4554
4703
|
polls = {
|
|
@@ -4879,7 +5028,7 @@ var TwitchApi = class {
|
|
|
4879
5028
|
*
|
|
4880
5029
|
* @see https://dev.twitch.tv/docs/api/reference#start-a-raid
|
|
4881
5030
|
*/
|
|
4882
|
-
|
|
5031
|
+
startARaid: (params = null, options = {}) => this.callApi({
|
|
4883
5032
|
path: "/raids",
|
|
4884
5033
|
method: "POST",
|
|
4885
5034
|
params,
|
|
@@ -4928,7 +5077,7 @@ var TwitchApi = class {
|
|
|
4928
5077
|
*
|
|
4929
5078
|
* @see https://dev.twitch.tv/docs/api/reference#cancel-a-raid
|
|
4930
5079
|
*/
|
|
4931
|
-
|
|
5080
|
+
cancelARaid: (params, options = {}) => this.callApi({
|
|
4932
5081
|
path: "/raids",
|
|
4933
5082
|
method: "DELETE",
|
|
4934
5083
|
params,
|