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.js CHANGED
@@ -1651,7 +1651,7 @@ var TwitchApi = class {
1651
1651
  /**
1652
1652
  * Creates a clip from the broadcaster’s stream.
1653
1653
  *
1654
- * 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 3: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.
1654
+ * 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.
1655
1655
  *
1656
1656
  * 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.
1657
1657
  *
@@ -1675,6 +1675,8 @@ var TwitchApi = class {
1675
1675
  *
1676
1676
  * * The _broadcaster\_id_ query parameter is required.
1677
1677
  * * The ID in the _broadcaster\_id_ query parameter was not found.
1678
+ * * The category is not clippable.
1679
+ * * The title did not pass AutoMod checks.
1678
1680
  *
1679
1681
  * _401 Unauthorized_
1680
1682
  *
@@ -1687,6 +1689,7 @@ var TwitchApi = class {
1687
1689
  *
1688
1690
  * * The broadcaster has restricted the ability to capture clips to followers and/or subscribers only.
1689
1691
  * * The specified broadcaster has not enabled clips on their channel.
1692
+ * * The user is banned or timed out from the broadcaster’s channel.
1690
1693
  *
1691
1694
  * _404 Not Found_
1692
1695
  *
@@ -1744,6 +1747,112 @@ var TwitchApi = class {
1744
1747
  path: "/clips",
1745
1748
  params,
1746
1749
  options
1750
+ }),
1751
+ /**
1752
+ * 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.
1753
+ *
1754
+ * The duration of a clip can be from 5 seconds to 60 seconds in length, with a default of 30 seconds if not specified.
1755
+ *
1756
+ * `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`.
1757
+ *
1758
+ * 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.
1759
+ *
1760
+ * __Authorization:__
1761
+ *
1762
+ * 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.
1763
+ *
1764
+ * __URL:__
1765
+ *
1766
+ * `POST https://api.twitch.tv/helix/videos/clips`
1767
+ *
1768
+ * __Response Codes:__
1769
+ *
1770
+ * _202 Accepted_
1771
+ *
1772
+ * Successfully started the clip process.
1773
+ *
1774
+ * _400 Bad Request_
1775
+ *
1776
+ * * Validation errors: Invalid source type, missing required fields.
1777
+ * * The broadcaster\_id query parameter is required.
1778
+ * * The ID in the broadcaster\_id query parameter was not found.
1779
+ * * The category is not clippable.
1780
+ * * The title did not pass AutoMod checks.
1781
+ * * Broadcaster is banned.
1782
+ *
1783
+ * _401 Unauthorized_
1784
+ *
1785
+ * * The Authorization header is required and must specify user access token.
1786
+ * * The user access token must include the **editor:manage:clips** or **channel:manage:clips** scope.
1787
+ * * The OAuth token is not valid.
1788
+ * * The ID in the Client-Id header must match the Client ID in the OAuth token.
1789
+ *
1790
+ * _403 Forbidden_
1791
+ *
1792
+ * * The broadcaster has restricted the ability to capture clips to followers and/or subscribers only.
1793
+ * * The specified broadcaster has not enabled clips on their channel.
1794
+ * * The user defined by the _editor\_id_ is not authorized to create Clips.
1795
+ * * The user is banned or timed out from the broadcaster's channel.
1796
+ *
1797
+ * _404 Not Found_
1798
+ *
1799
+ * * The broadcaster in the _broadcaster\_id_ query parameter must be broadcasting live.
1800
+ * * The VOD is not found..
1801
+ * * The _broadcaster\_id_ or the _editor\_id_ does not exist.
1802
+ *
1803
+ * @see https://dev.twitch.tv/docs/api/reference#create-clip-from-vod
1804
+ */
1805
+ createClipFromVOD: (params, options = {}) => this.callApi({
1806
+ path: "/videos/clips",
1807
+ method: "POST",
1808
+ params,
1809
+ options
1810
+ }),
1811
+ /**
1812
+ * 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).
1813
+ *
1814
+ * **Rate Limits**: Limited to 100 requests per minute.
1815
+ *
1816
+ * __Authorization:__
1817
+ *
1818
+ * 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.
1819
+ *
1820
+ * __URL:__
1821
+ *
1822
+ * `GET https://api.twitch.tv/helix/clips/downloads`
1823
+ *
1824
+ * __Response Codes:__
1825
+ *
1826
+ * _200 OK_
1827
+ *
1828
+ * Successfully retrieved the clip download URL(s).
1829
+ *
1830
+ * _400 Bad Request_
1831
+ *
1832
+ * The ID in the broadcaster\_id, editor\_id, or clip\_id query parameter is not valid.
1833
+ *
1834
+ * _401 Unauthorized_
1835
+ *
1836
+ * * The OAuth token is not valid.
1837
+ * * The Authorization header is required and must contain a user access token or app access token.
1838
+ * * The access token must include the editor:manage:clips or channel:manage:clips scope
1839
+ * * The access token is not valid
1840
+ * * The client ID specified in the Client-Id header does not match the client ID specified in the access token.
1841
+ *
1842
+ * _403 Forbidden_
1843
+ *
1844
+ * The user is not an editor for the specified broadcaster.
1845
+ *
1846
+ * _500 Internal Server Error_
1847
+ *
1848
+ * Internal Server Error.
1849
+ *
1850
+ * @see https://dev.twitch.tv/docs/api/reference#get-clips-download
1851
+ */
1852
+ getClipsDownload: (params, options = {}) => this.callApi({
1853
+ path: "/clips/downloads",
1854
+ params,
1855
+ options
1747
1856
  })
1748
1857
  };
1749
1858
  conduits = {
@@ -3299,6 +3408,8 @@ var TwitchApi = class {
3299
3408
  };
3300
3409
  hypeTrain = {
3301
3410
  /**
3411
+ * 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).
3412
+ *
3302
3413
  * Gets information about the broadcaster’s current or most recent Hype Train event.
3303
3414
  *
3304
3415
  * 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)).
@@ -3333,7 +3444,7 @@ var TwitchApi = class {
3333
3444
  options
3334
3445
  }),
3335
3446
  /**
3336
- * BETA Get the status of a Hype Train for the specified broadcaster.
3447
+ * NEW Get the status of a Hype Train for the specified broadcaster.
3337
3448
  *
3338
3449
  * __Authorization:__
3339
3450
  *
@@ -5741,6 +5852,47 @@ var TwitchApi = class {
5741
5852
  params,
5742
5853
  options
5743
5854
  }),
5855
+ /**
5856
+ * NEW Gets the authorization scopes that the specified user(s) have granted the application.
5857
+ *
5858
+ * __Authorization:__
5859
+ *
5860
+ * Requires an [app access token](https://dev.twitch.tv/docs/authentication#app-access-tokens).
5861
+ *
5862
+ * __URL:__
5863
+ *
5864
+ * `GET https://api.twitch.tv/helix/authorization/users`
5865
+ *
5866
+ * __Response Codes:__
5867
+ *
5868
+ * _200 OK_
5869
+ *
5870
+ * Successfully retrieved user authorization.
5871
+ *
5872
+ * _400 Bad Request_
5873
+ *
5874
+ * Request is malformed - invalid parameters or missing parameters.
5875
+ *
5876
+ * _401 Unauthorized_
5877
+ *
5878
+ * * The access token is not valid.
5879
+ * * Authorization header is required and must specify an app access token.
5880
+ *
5881
+ * _403 Forbidden_
5882
+ *
5883
+ * The client-id in the header must match the client ID in the access token.
5884
+ *
5885
+ * _500 Internal Server Error_
5886
+ *
5887
+ * Internal Server Error.
5888
+ *
5889
+ * @see https://dev.twitch.tv/docs/api/reference#get-authorization-by-user
5890
+ */
5891
+ getAuthorizationByUser: (params, options = {}) => this.callApi({
5892
+ path: "/authorization/users",
5893
+ params,
5894
+ options
5895
+ }),
5744
5896
  /**
5745
5897
  * 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)
5746
5898
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-twitch-api",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
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": "^24.3.0",
33
- "tsup": "^8.5.0",
34
- "typescript": "^5.9.2"
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",