@distilled.cloud/twitch 0.0.0 → 1.0.0-rc.22

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.
Files changed (214) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +79 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +31 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +49 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +46 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +50 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/ads.d.ts +75 -0
  26. package/lib/services/ads.d.ts.map +1 -0
  27. package/lib/services/ads.js +2 -0
  28. package/lib/services/ads.js.map +1 -0
  29. package/lib/services/analytics.d.ts +90 -0
  30. package/lib/services/analytics.d.ts.map +1 -0
  31. package/lib/services/analytics.js +2 -0
  32. package/lib/services/analytics.js.map +1 -0
  33. package/lib/services/bits.d.ts +284 -0
  34. package/lib/services/bits.d.ts.map +1 -0
  35. package/lib/services/bits.js +2 -0
  36. package/lib/services/bits.js.map +1 -0
  37. package/lib/services/ccls.d.ts +26 -0
  38. package/lib/services/ccls.d.ts.map +1 -0
  39. package/lib/services/ccls.js +2 -0
  40. package/lib/services/ccls.js.map +1 -0
  41. package/lib/services/channel_points.d.ts +416 -0
  42. package/lib/services/channel_points.d.ts.map +1 -0
  43. package/lib/services/channel_points.js +2 -0
  44. package/lib/services/channel_points.js.map +1 -0
  45. package/lib/services/channels.d.ts +173 -0
  46. package/lib/services/channels.d.ts.map +1 -0
  47. package/lib/services/channels.js +2 -0
  48. package/lib/services/channels.js.map +1 -0
  49. package/lib/services/charity.d.ts +97 -0
  50. package/lib/services/charity.d.ts.map +1 -0
  51. package/lib/services/charity.js +2 -0
  52. package/lib/services/charity.js.map +1 -0
  53. package/lib/services/chat.d.ts +638 -0
  54. package/lib/services/chat.d.ts.map +1 -0
  55. package/lib/services/chat.js +33 -0
  56. package/lib/services/chat.js.map +1 -0
  57. package/lib/services/clips.d.ts +153 -0
  58. package/lib/services/clips.d.ts.map +1 -0
  59. package/lib/services/clips.js +2 -0
  60. package/lib/services/clips.js.map +1 -0
  61. package/lib/services/conduits.d.ts +172 -0
  62. package/lib/services/conduits.d.ts.map +1 -0
  63. package/lib/services/conduits.js +2 -0
  64. package/lib/services/conduits.js.map +1 -0
  65. package/lib/services/entitlements.d.ts +76 -0
  66. package/lib/services/entitlements.d.ts.map +1 -0
  67. package/lib/services/entitlements.js +2 -0
  68. package/lib/services/entitlements.js.map +1 -0
  69. package/lib/services/eventsub.d.ts +158 -0
  70. package/lib/services/eventsub.d.ts.map +1 -0
  71. package/lib/services/eventsub.js +2 -0
  72. package/lib/services/eventsub.js.map +1 -0
  73. package/lib/services/extensions.d.ts +497 -0
  74. package/lib/services/extensions.d.ts.map +1 -0
  75. package/lib/services/extensions.js +2 -0
  76. package/lib/services/extensions.js.map +1 -0
  77. package/lib/services/games.d.ts +57 -0
  78. package/lib/services/games.d.ts.map +1 -0
  79. package/lib/services/games.js +2 -0
  80. package/lib/services/games.js.map +1 -0
  81. package/lib/services/goals.d.ts +37 -0
  82. package/lib/services/goals.d.ts.map +1 -0
  83. package/lib/services/goals.js +2 -0
  84. package/lib/services/goals.js.map +1 -0
  85. package/lib/services/guest_star.d.ts +314 -0
  86. package/lib/services/guest_star.d.ts.map +1 -0
  87. package/lib/services/guest_star.js +2 -0
  88. package/lib/services/guest_star.js.map +1 -0
  89. package/lib/services/hype_train.d.ts +91 -0
  90. package/lib/services/hype_train.d.ts.map +1 -0
  91. package/lib/services/hype_train.js +2 -0
  92. package/lib/services/hype_train.js.map +1 -0
  93. package/lib/services/index.d.ts +30 -0
  94. package/lib/services/index.d.ts.map +1 -0
  95. package/lib/services/index.js +29 -0
  96. package/lib/services/moderation.d.ts +731 -0
  97. package/lib/services/moderation.d.ts.map +1 -0
  98. package/lib/services/moderation.js +41 -0
  99. package/lib/services/moderation.js.map +1 -0
  100. package/lib/services/polls.d.ts +173 -0
  101. package/lib/services/polls.d.ts.map +1 -0
  102. package/lib/services/polls.js +2 -0
  103. package/lib/services/polls.js.map +1 -0
  104. package/lib/services/predictions.d.ts +221 -0
  105. package/lib/services/predictions.d.ts.map +1 -0
  106. package/lib/services/predictions.js +2 -0
  107. package/lib/services/predictions.js.map +1 -0
  108. package/lib/services/raids.d.ts +34 -0
  109. package/lib/services/raids.d.ts.map +1 -0
  110. package/lib/services/raids.js +2 -0
  111. package/lib/services/raids.js.map +1 -0
  112. package/lib/services/schedule.d.ts +223 -0
  113. package/lib/services/schedule.d.ts.map +1 -0
  114. package/lib/services/schedule.js +2 -0
  115. package/lib/services/schedule.js.map +1 -0
  116. package/lib/services/search.d.ts +89 -0
  117. package/lib/services/search.d.ts.map +1 -0
  118. package/lib/services/search.js +2 -0
  119. package/lib/services/search.js.map +1 -0
  120. package/lib/services/streams.d.ts +235 -0
  121. package/lib/services/streams.d.ts.map +1 -0
  122. package/lib/services/streams.js +2 -0
  123. package/lib/services/streams.js.map +1 -0
  124. package/lib/services/subscriptions.d.ts +96 -0
  125. package/lib/services/subscriptions.d.ts.map +1 -0
  126. package/lib/services/subscriptions.js +2 -0
  127. package/lib/services/subscriptions.js.map +1 -0
  128. package/lib/services/teams.d.ts +90 -0
  129. package/lib/services/teams.d.ts.map +1 -0
  130. package/lib/services/teams.js +2 -0
  131. package/lib/services/teams.js.map +1 -0
  132. package/lib/services/users.d.ts +324 -0
  133. package/lib/services/users.d.ts.map +1 -0
  134. package/lib/services/users.js +2 -0
  135. package/lib/services/users.js.map +1 -0
  136. package/lib/services/videos.d.ts +101 -0
  137. package/lib/services/videos.d.ts.map +1 -0
  138. package/lib/services/videos.js +2 -0
  139. package/lib/services/videos.js.map +1 -0
  140. package/lib/services/whispers.d.ts +17 -0
  141. package/lib/services/whispers.d.ts.map +1 -0
  142. package/lib/services/whispers.js +2 -0
  143. package/lib/services/whispers.js.map +1 -0
  144. package/lib/services.lazy/ads.js +1 -0
  145. package/lib/services.lazy/analytics.js +1 -0
  146. package/lib/services.lazy/bits.js +1 -0
  147. package/lib/services.lazy/ccls.js +1 -0
  148. package/lib/services.lazy/channel_points.js +1 -0
  149. package/lib/services.lazy/channels.js +1 -0
  150. package/lib/services.lazy/charity.js +1 -0
  151. package/lib/services.lazy/chat.js +3 -0
  152. package/lib/services.lazy/clips.js +1 -0
  153. package/lib/services.lazy/conduits.js +1 -0
  154. package/lib/services.lazy/entitlements.js +1 -0
  155. package/lib/services.lazy/eventsub.js +1 -0
  156. package/lib/services.lazy/extensions.js +1 -0
  157. package/lib/services.lazy/games.js +1 -0
  158. package/lib/services.lazy/goals.js +1 -0
  159. package/lib/services.lazy/guest_star.js +1 -0
  160. package/lib/services.lazy/hype_train.js +1 -0
  161. package/lib/services.lazy/index.js +3 -0
  162. package/lib/services.lazy/moderation.js +3 -0
  163. package/lib/services.lazy/polls.js +1 -0
  164. package/lib/services.lazy/predictions.js +1 -0
  165. package/lib/services.lazy/raids.js +1 -0
  166. package/lib/services.lazy/schedule.js +1 -0
  167. package/lib/services.lazy/search.js +1 -0
  168. package/lib/services.lazy/streams.js +1 -0
  169. package/lib/services.lazy/subscriptions.js +1 -0
  170. package/lib/services.lazy/teams.js +1 -0
  171. package/lib/services.lazy/users.js +1 -0
  172. package/lib/services.lazy/videos.js +1 -0
  173. package/lib/services.lazy/whispers.js +1 -0
  174. package/lib/traits.d.ts +10 -0
  175. package/lib/traits.d.ts.map +1 -0
  176. package/lib/traits.js +1 -0
  177. package/package.json +82 -2
  178. package/src/credentials.ts +79 -0
  179. package/src/errors.ts +78 -0
  180. package/src/index.ts +45 -0
  181. package/src/pagination.ts +9 -0
  182. package/src/protocol.ts +43 -0
  183. package/src/retry.ts +69 -0
  184. package/src/services/ads.ts +228 -0
  185. package/src/services/analytics.ts +253 -0
  186. package/src/services/bits.ts +631 -0
  187. package/src/services/ccls.ts +96 -0
  188. package/src/services/channel_points.ts +804 -0
  189. package/src/services/channels.ts +471 -0
  190. package/src/services/charity.ts +250 -0
  191. package/src/services/chat.ts +1547 -0
  192. package/src/services/clips.ts +385 -0
  193. package/src/services/conduits.ts +453 -0
  194. package/src/services/entitlements.ts +219 -0
  195. package/src/services/eventsub.ts +372 -0
  196. package/src/services/extensions.ts +1098 -0
  197. package/src/services/games.ts +184 -0
  198. package/src/services/goals.ts +110 -0
  199. package/src/services/guest_star.ts +762 -0
  200. package/src/services/hype_train.ts +214 -0
  201. package/src/services/index.ts +30 -0
  202. package/src/services/moderation.ts +1817 -0
  203. package/src/services/polls.ts +363 -0
  204. package/src/services/predictions.ts +432 -0
  205. package/src/services/raids.ts +127 -0
  206. package/src/services/schedule.ts +539 -0
  207. package/src/services/search.ts +248 -0
  208. package/src/services/streams.ts +579 -0
  209. package/src/services/subscriptions.ts +247 -0
  210. package/src/services/teams.ts +225 -0
  211. package/src/services/users.ts +729 -0
  212. package/src/services/videos.ts +257 -0
  213. package/src/services/whispers.ts +71 -0
  214. package/src/traits.ts +47 -0
@@ -0,0 +1,471 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-twitch/specs/api/reference). Do not edit.
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import { TwitchServiceErrors } from "../errors.ts";
6
+ import { paginateCursor } from "../pagination.ts";
7
+ import { TwitchProtocol, type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
8
+ import * as Retry from "../retry.ts";
9
+ import * as T from "../traits.ts";
10
+ // Schema table, filled on first reach (see __S at the end).
11
+ const __s: any[] = [];
12
+
13
+ export type { TwitchOpError, TwitchOpContext };
14
+
15
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
16
+ const TELEMETRY = {
17
+ system: "twitch-api",
18
+ responseHeaders: [
19
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
20
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
21
+ ],
22
+ prefix: "Twitch",
23
+ service: "Channels",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface GetChannelEditorsRequest {
28
+ /** The ID of the broadcaster that owns the channel. This ID must match the user ID in the access token. */
29
+ broadcaster_id: string;
30
+ }
31
+ export interface GetChannelEditorsResponseDataItem {
32
+ /** An ID that uniquely identifies a user with editor permissions. */
33
+ user_id?: string | undefined;
34
+ /** The user's display name. */
35
+ user_name?: string | undefined;
36
+ /** The date and time, in RFC3339 format, when the user became one of the broadcaster's editors. */
37
+ created_at?: string | undefined;
38
+ }
39
+ /** A list of users that are editors for the specified broadcaster. The list is empty if the broadcaster doesn't have editors. */
40
+ export type GetChannelEditorsResponseDataList = Array<GetChannelEditorsResponseDataItem>;
41
+ export interface GetChannelEditorsResponse {
42
+ /** A list of users that are editors for the specified broadcaster. The list is empty if the broadcaster doesn't have editors. */
43
+ data?: GetChannelEditorsResponseDataList | undefined;
44
+ }
45
+ export interface GetChannelFollowersRequest {
46
+ /** A user's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this user if they follow the broadcaster. If not specified, the response contains all users that follow the broadcaster. Using this parameter requires both a user access token with the **moderator:read:followers** scope and the user ID in the access token match the broadcaster_id or be the user ID for a moderator of the specified broadcaster. */
47
+ user_id?: string | undefined;
48
+ /** The broadcaster's ID. Returns the list of users that follow this broadcaster. */
49
+ broadcaster_id: string;
50
+ /** The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20. */
51
+ first?: number | undefined;
52
+ /** The cursor used to get the next page of results. The **Pagination** object in the response contains the cursor's value. [Read more](https://dev.twitch.tv/docs/api/guide.md#pagination). */
53
+ after?: string | undefined;
54
+ }
55
+ export interface GetChannelFollowersResponseDataItem {
56
+ /** The UTC timestamp when the user started following the broadcaster. */
57
+ followed_at?: string | undefined;
58
+ /** An ID that uniquely identifies the user that's following the broadcaster. */
59
+ user_id?: string | undefined;
60
+ /** The user's login name. */
61
+ user_login?: string | undefined;
62
+ /** The user's display name. */
63
+ user_name?: string | undefined;
64
+ }
65
+ /** The list of users that follow the specified broadcaster. The list is in descending order by `followed_at` (with the most recent follower first). The list is empty if nobody follows the broadcaster, the specified _user_id_ isn't in the follower list, the user access token is missing the **moderator:read:followers** scope, or the user isn't the broadcaster or moderator for the channel. */
66
+ export type GetChannelFollowersResponseDataList = Array<GetChannelFollowersResponseDataItem>;
67
+ /** Contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination). */
68
+ export interface GetChannelFollowersResponsePagination {
69
+ /** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
70
+ cursor?: string | undefined;
71
+ }
72
+ export interface GetChannelFollowersResponse {
73
+ /** The list of users that follow the specified broadcaster. The list is in descending order by `followed_at` (with the most recent follower first). The list is empty if nobody follows the broadcaster, the specified _user_id_ isn't in the follower list, the user access token is missing the **moderator:read:followers** scope, or the user isn't the broadcaster or moderator for the channel. */
74
+ data: GetChannelFollowersResponseDataList;
75
+ /** Contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination). */
76
+ pagination?: GetChannelFollowersResponsePagination | undefined;
77
+ /** The total number of users that follow this broadcaster. As someone pages through the list, the number of users may change as users follow or unfollow the broadcaster. */
78
+ total?: number | undefined;
79
+ }
80
+ export type GetChannelInformationRequestBroadcasterIdList = Array<string>;
81
+ export interface GetChannelInformationRequest {
82
+ /** The ID of the broadcaster whose channel you want to get. To specify more than one ID, include this parameter for each broadcaster you want to get. For example, 'broadcaster_id=1234&broadcaster_id=5678'. You may specify a maximum of 100 IDs. The API ignores duplicate IDs and IDs that are not found. */
83
+ broadcaster_id: GetChannelInformationRequestBroadcasterIdList;
84
+ }
85
+ /** The tags applied to the channel. */
86
+ export type GetChannelInformationResponseDataItemTagsList = Array<string>;
87
+ /** The CCLs applied to the channel. */
88
+ export type GetChannelInformationResponseDataItemContentClassificationLabelsList = Array<string>;
89
+ export interface GetChannelInformationResponseDataItem {
90
+ /** An ID that uniquely identifies the broadcaster. */
91
+ broadcaster_id?: string | undefined;
92
+ /** The broadcaster's login name. */
93
+ broadcaster_login?: string | undefined;
94
+ /** The broadcaster's display name. */
95
+ broadcaster_name?: string | undefined;
96
+ /** The broadcaster's preferred language. The value is an ISO 639-1 two-letter language code (for example, *en* for English). The value is set to "other" if the language is not a Twitch supported language. */
97
+ broadcaster_language?: string | undefined;
98
+ /** The name of the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. */
99
+ game_name?: string | undefined;
100
+ /** An ID that uniquely identifies the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. */
101
+ game_id?: string | undefined;
102
+ /** The title of the stream that the broadcaster is currently streaming or last streamed. The value is an empty string if the broadcaster has never streamed. */
103
+ title?: string | undefined;
104
+ /** The value of the broadcaster's stream delay setting, in seconds. This field's value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the *broadcaster_id* query parameter matches the user ID in the access token, 3) the broadcaster has partner status and they set a non-zero stream delay value, and 4) the broadcaster's stream isn't disabled. */
105
+ delay?: number | undefined;
106
+ /** The tags applied to the channel. */
107
+ tags?: GetChannelInformationResponseDataItemTagsList | undefined;
108
+ /** The CCLs applied to the channel. */
109
+ content_classification_labels?:
110
+ | GetChannelInformationResponseDataItemContentClassificationLabelsList
111
+ | undefined;
112
+ /** Boolean flag indicating if the channel has branded content. */
113
+ is_branded_content?: boolean | undefined;
114
+ }
115
+ /** A list that contains information about the specified channels. The list is empty if the specified channels weren't found. */
116
+ export type GetChannelInformationResponseDataList = Array<GetChannelInformationResponseDataItem>;
117
+ export interface GetChannelInformationResponse {
118
+ /** A list that contains information about the specified channels. The list is empty if the specified channels weren't found. */
119
+ data?: GetChannelInformationResponseDataList | undefined;
120
+ }
121
+ export interface GetFollowedChannelsRequest {
122
+ /** A user's ID. Returns the list of broadcasters that this user follows. This ID must match the user ID in the user OAuth token. */
123
+ user_id: string;
124
+ /** A broadcaster's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows. */
125
+ broadcaster_id?: string | undefined;
126
+ /** The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20. */
127
+ first?: number | undefined;
128
+ /** The cursor used to get the next page of results. The **Pagination** object in the response contains the cursor's value. [Read more](https://dev.twitch.tv/docs/api/guide.md#pagination). */
129
+ after?: string | undefined;
130
+ }
131
+ export interface GetFollowedChannelsResponseDataItem {
132
+ /** An ID that uniquely identifies the broadcaster that this user is following. */
133
+ broadcaster_id?: string | undefined;
134
+ /** The broadcaster's login name. */
135
+ broadcaster_login?: string | undefined;
136
+ /** The broadcaster's display name. */
137
+ broadcaster_name?: string | undefined;
138
+ /** The UTC timestamp when the user started following the broadcaster. */
139
+ followed_at?: string | undefined;
140
+ }
141
+ /** The list of broadcasters that the user follows. The list is in descending order by `followed_at` (with the most recently followed broadcaster first). The list is empty if the user doesn't follow anyone. */
142
+ export type GetFollowedChannelsResponseDataList = Array<GetFollowedChannelsResponseDataItem>;
143
+ /** Contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination). */
144
+ export type GetFollowedChannelsResponsePagination = GetChannelFollowersResponsePagination;
145
+ export interface GetFollowedChannelsResponse {
146
+ /** The list of broadcasters that the user follows. The list is in descending order by `followed_at` (with the most recently followed broadcaster first). The list is empty if the user doesn't follow anyone. */
147
+ data: GetFollowedChannelsResponseDataList;
148
+ /** Contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination). */
149
+ pagination?: GetChannelFollowersResponsePagination | undefined;
150
+ /** The total number of broadcasters that the user follows. As someone pages through the list, the number may change as the user follows or unfollows broadcasters. */
151
+ total?: number | undefined;
152
+ }
153
+ /** A list of channel-defined tags to apply to the channel. To remove all tags from the channel, set tags to an empty array. Tags help identify the content that the channel streams. [Learn More](https://help.twitch.tv/s/article/guide-to-tags) A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. */
154
+ export type ModifyChannelInformationRequestTagsList = Array<string>;
155
+ export interface ModifyChannelInformationRequestContentClassificationLabelsItem {
156
+ /** ID of the [Content Classification Labels](https://help.twitch.tv/s/article/content-classification-labels) that must be added/removed from the channel. Possible values: - `DebatedSocialIssuesAndPolitics` - `DrugsIntoxication` - `SexualThemes` - `ViolentGraphic` - `Gambling` - `ProfanityVulgarity` */
157
+ id: string;
158
+ /** Boolean flag indicating whether the label should be enabled (true) or disabled for the channel. */
159
+ is_enabled: boolean;
160
+ }
161
+ /** List of labels that should be set as the Channel's CCLs. **Note:** To clear CCLs for a channel, set all *is_enabled* for all possible CCLs to **false** */
162
+ export type ModifyChannelInformationRequestContentClassificationLabelsList =
163
+ Array<ModifyChannelInformationRequestContentClassificationLabelsItem>;
164
+ export interface ModifyChannelInformationRequest {
165
+ /** The ID of the broadcaster whose channel you want to update. This ID must match the user ID in the user access token. */
166
+ broadcaster_id: string;
167
+ /** The ID of the game that the user plays. The game is not updated if the ID isn't a game ID that Twitch recognizes. To unset this field, use "0" or "" (an empty string). */
168
+ game_id?: string | undefined;
169
+ /** The user's preferred language. Set the value to an ISO 639-1 two-letter language code (for example, *en* for English). Set to "other" if the user's preferred language is not a Twitch supported language. If the language code isn't a Twitch supported language, the request fails with a 400 Bad Request error. */
170
+ broadcaster_language?: string | undefined;
171
+ /** The title of the user's stream. You may not set this field to an empty string. */
172
+ title?: string | undefined;
173
+ /** The number of seconds you want your broadcast buffered before streaming it live. The delay helps ensure fairness during competitive play. Only users with Partner status may set this field. The maximum delay is 900 seconds (15 minutes). */
174
+ delay?: number | undefined;
175
+ /** A list of channel-defined tags to apply to the channel. To remove all tags from the channel, set tags to an empty array. Tags help identify the content that the channel streams. [Learn More](https://help.twitch.tv/s/article/guide-to-tags) A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. */
176
+ tags?: ModifyChannelInformationRequestTagsList | undefined;
177
+ /** List of labels that should be set as the Channel's CCLs. **Note:** To clear CCLs for a channel, set all *is_enabled* for all possible CCLs to **false** */
178
+ content_classification_labels?:
179
+ | ModifyChannelInformationRequestContentClassificationLabelsList
180
+ | undefined;
181
+ /** Boolean flag indicating if the channel has branded content. */
182
+ is_branded_content?: boolean | undefined;
183
+ }
184
+ export interface ModifyChannelInformationResponse {}
185
+ export type GetChannelEditorsError = TwitchOpError;
186
+ /** Get Channel Editors Gets the broadcaster's list editors. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:read:editors** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-editors */
187
+ export const getChannelEditors: API.OperationMethod<
188
+ GetChannelEditorsRequest,
189
+ GetChannelEditorsResponse,
190
+ GetChannelEditorsError,
191
+ TwitchOpContext
192
+ > = /*@__PURE__*/ API.make(() => ({
193
+ input: __S(0, __c0, 0) as any as S.Schema<GetChannelEditorsRequest>,
194
+ output: __S(3, __c0, 3) as any as S.Schema<GetChannelEditorsResponse>,
195
+ errors: [],
196
+ serviceErrors: TwitchServiceErrors,
197
+ protocol: TwitchProtocol,
198
+ retry: Retry.Retry,
199
+ telemetry: TELEMETRY,
200
+ span: "GetChannelEditors",
201
+ }));
202
+
203
+ export type GetChannelFollowersError = TwitchOpError;
204
+ /** Get Channel Followers Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster. > **Note** This endpoint will return specific follower information only if the **moderator:read:followers** > scope is provided, and its User ID requirements are met. If the scope is not provided, or the > user is not the broadcaster or a moderator for the specified channel, only the total follower > count will be included in the response. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **moderator:read:followers** scope. The User ID in the access token must comply with one of the following: - The User ID in the access token must match the *broadcaster_id* in the query parameter. - The User ID in the access token must be a moderator on for the specified broadcaster. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-followers */
205
+ export const getChannelFollowers: API.PaginatedOperationMethod<
206
+ GetChannelFollowersRequest,
207
+ GetChannelFollowersResponse,
208
+ GetChannelFollowersError,
209
+ TwitchOpContext,
210
+ GetChannelFollowersResponseDataItem
211
+ > = /*@__PURE__*/ API.makePaginated(
212
+ () => ({
213
+ input: __S(4, __c1, 0) as any as S.Schema<GetChannelFollowersRequest>,
214
+ output: __S(7, __c1, 3) as any as S.Schema<GetChannelFollowersResponse>,
215
+ errors: [],
216
+ serviceErrors: TwitchServiceErrors,
217
+ protocol: TwitchProtocol,
218
+ retry: Retry.Retry,
219
+ telemetry: TELEMETRY,
220
+ span: "GetChannelFollowers",
221
+ pagination: {
222
+ mode: "cursor",
223
+ inputToken: "after",
224
+ outputToken: "pagination.cursor",
225
+ items: "data",
226
+ pageSize: "first",
227
+ } as const,
228
+ }),
229
+ paginateCursor,
230
+ ) as any;
231
+
232
+ export type GetChannelInformationError = TwitchOpError;
233
+ /** Get Channel Information Gets information about one or more channels. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-information */
234
+ export const getChannelInformation: API.OperationMethod<
235
+ GetChannelInformationRequest,
236
+ GetChannelInformationResponse,
237
+ GetChannelInformationError,
238
+ TwitchOpContext
239
+ > = /*@__PURE__*/ API.make(() => ({
240
+ input: __S(12, __c3, 0) as any as S.Schema<GetChannelInformationRequest>,
241
+ output: __S(15, __c3, 3) as any as S.Schema<GetChannelInformationResponse>,
242
+ errors: [],
243
+ serviceErrors: TwitchServiceErrors,
244
+ protocol: TwitchProtocol,
245
+ retry: Retry.Retry,
246
+ telemetry: TELEMETRY,
247
+ span: "GetChannelInformation",
248
+ }));
249
+
250
+ export type GetFollowedChannelsError = TwitchOpError;
251
+ /** Get Followed Channels Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether a user follows a specific broadcaster. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:read:follows** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-followed-channels */
252
+ export const getFollowedChannels: API.PaginatedOperationMethod<
253
+ GetFollowedChannelsRequest,
254
+ GetFollowedChannelsResponse,
255
+ GetFollowedChannelsError,
256
+ TwitchOpContext,
257
+ GetFollowedChannelsResponseDataItem
258
+ > = /*@__PURE__*/ API.makePaginated(
259
+ () => ({
260
+ input: __S(20, __c5, 0) as any as S.Schema<GetFollowedChannelsRequest>,
261
+ output: __S(23, __c5, 3) as any as S.Schema<GetFollowedChannelsResponse>,
262
+ errors: [],
263
+ serviceErrors: TwitchServiceErrors,
264
+ protocol: TwitchProtocol,
265
+ retry: Retry.Retry,
266
+ telemetry: TELEMETRY,
267
+ span: "GetFollowedChannels",
268
+ pagination: {
269
+ mode: "cursor",
270
+ inputToken: "after",
271
+ outputToken: "pagination.cursor",
272
+ items: "data",
273
+ pageSize: "first",
274
+ } as const,
275
+ }),
276
+ paginateCursor,
277
+ ) as any;
278
+
279
+ export type ModifyChannelInformationError = TwitchOpError;
280
+ /** Modify Channel Information Updates a channel's properties. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:broadcast** or **user:edit:broadcast** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#modify-channel-information */
281
+ export const modifyChannelInformation: API.OperationMethod<
282
+ ModifyChannelInformationRequest,
283
+ ModifyChannelInformationResponse,
284
+ ModifyChannelInformationError,
285
+ TwitchOpContext
286
+ > = /*@__PURE__*/ API.make(() => ({
287
+ input: __S(26, __c6, 2) as any as S.Schema<ModifyChannelInformationRequest>,
288
+ output: __S(27, __c6, 3) as any as S.Schema<ModifyChannelInformationResponse>,
289
+ errors: [],
290
+ serviceErrors: TwitchServiceErrors,
291
+ protocol: TwitchProtocol,
292
+ retry: Retry.Retry,
293
+ telemetry: TELEMETRY,
294
+ span: "ModifyChannelInformation",
295
+ }));
296
+
297
+ // Schema builders: each runs one schema initializer, on that schema's first use.
298
+ function __c0(j: number): any {
299
+ switch (j) {
300
+ case 0:
301
+ return S.suspend(() =>
302
+ S.Struct({
303
+ broadcaster_id: S.String.pipe(T.Query()),
304
+ }).pipe(T.Http({ method: "GET", uri: "/channels/editors", code: 200 })),
305
+ ).annotate({ identifier: "GetChannelEditorsRequest" });
306
+ case 1:
307
+ return S.suspend(() =>
308
+ S.Struct({
309
+ user_id: S.optional(S.String),
310
+ user_name: S.optional(S.String),
311
+ created_at: S.optional(S.String),
312
+ }),
313
+ ).annotate({ identifier: "GetChannelEditorsResponseDataItem" });
314
+ case 2:
315
+ return S.Array(__S(1, __c0, 1));
316
+ case 3:
317
+ return S.suspend(() =>
318
+ S.Struct({
319
+ data: S.optional(__S(2, __c0, 2)),
320
+ }),
321
+ ).annotate({ identifier: "GetChannelEditorsResponse" });
322
+ }
323
+ }
324
+ function __c1(j: number): any {
325
+ switch (j) {
326
+ case 0:
327
+ return S.suspend(() =>
328
+ S.Struct({
329
+ user_id: S.optional(S.String.pipe(T.Query())),
330
+ broadcaster_id: S.String.pipe(T.Query()),
331
+ first: S.optional(S.Number.pipe(T.Query())),
332
+ after: S.optional(S.String.pipe(T.Query())),
333
+ }).pipe(T.Http({ method: "GET", uri: "/channels/followers", code: 200 })),
334
+ ).annotate({ identifier: "GetChannelFollowersRequest" });
335
+ case 1:
336
+ return S.suspend(() =>
337
+ S.Struct({
338
+ followed_at: S.optional(S.String),
339
+ user_id: S.optional(S.String),
340
+ user_login: S.optional(S.String),
341
+ user_name: S.optional(S.String),
342
+ }),
343
+ ).annotate({ identifier: "GetChannelFollowersResponseDataItem" });
344
+ case 2:
345
+ return S.Array(__S(5, __c1, 1));
346
+ case 3:
347
+ return S.suspend(() =>
348
+ S.Struct({
349
+ data: __S(6, __c1, 2),
350
+ pagination: S.optional(__S(8, __c2, 0)),
351
+ total: S.optional(S.Number),
352
+ }),
353
+ ).annotate({ identifier: "GetChannelFollowersResponse" });
354
+ }
355
+ }
356
+ function __c2(j: number): any {
357
+ switch (j) {
358
+ case 0:
359
+ return S.suspend(() =>
360
+ S.Struct({
361
+ cursor: S.optional(S.String),
362
+ }),
363
+ ).annotate({ identifier: "GetChannelFollowersResponsePagination" });
364
+ }
365
+ }
366
+ function __c3(j: number): any {
367
+ switch (j) {
368
+ case 0:
369
+ return S.suspend(() =>
370
+ S.Struct({
371
+ broadcaster_id: __S(16, __c4, 0).pipe(T.Query()),
372
+ }).pipe(T.Http({ method: "GET", uri: "/channels", code: 200 })),
373
+ ).annotate({ identifier: "GetChannelInformationRequest" });
374
+ case 1:
375
+ return S.suspend(() =>
376
+ S.Struct({
377
+ broadcaster_id: S.optional(S.String),
378
+ broadcaster_login: S.optional(S.String),
379
+ broadcaster_name: S.optional(S.String),
380
+ broadcaster_language: S.optional(S.String),
381
+ game_name: S.optional(S.String),
382
+ game_id: S.optional(S.String),
383
+ title: S.optional(S.String),
384
+ delay: S.optional(S.Number),
385
+ tags: S.optional(__S(16, __c4, 0)),
386
+ content_classification_labels: S.optional(__S(16, __c4, 0)),
387
+ is_branded_content: S.optional(S.Boolean),
388
+ }),
389
+ ).annotate({ identifier: "GetChannelInformationResponseDataItem" });
390
+ case 2:
391
+ return S.Array(__S(13, __c3, 1));
392
+ case 3:
393
+ return S.suspend(() =>
394
+ S.Struct({
395
+ data: S.optional(__S(14, __c3, 2)),
396
+ }),
397
+ ).annotate({ identifier: "GetChannelInformationResponse" });
398
+ }
399
+ }
400
+ function __c4(j: number): any {
401
+ switch (j) {
402
+ case 0:
403
+ return S.Array(S.String);
404
+ }
405
+ }
406
+ function __c5(j: number): any {
407
+ switch (j) {
408
+ case 0:
409
+ return S.suspend(() =>
410
+ S.Struct({
411
+ user_id: S.String.pipe(T.Query()),
412
+ broadcaster_id: S.optional(S.String.pipe(T.Query())),
413
+ first: S.optional(S.Number.pipe(T.Query())),
414
+ after: S.optional(S.String.pipe(T.Query())),
415
+ }).pipe(T.Http({ method: "GET", uri: "/channels/followed", code: 200 })),
416
+ ).annotate({ identifier: "GetFollowedChannelsRequest" });
417
+ case 1:
418
+ return S.suspend(() =>
419
+ S.Struct({
420
+ broadcaster_id: S.optional(S.String),
421
+ broadcaster_login: S.optional(S.String),
422
+ broadcaster_name: S.optional(S.String),
423
+ followed_at: S.optional(S.String),
424
+ }),
425
+ ).annotate({ identifier: "GetFollowedChannelsResponseDataItem" });
426
+ case 2:
427
+ return S.Array(__S(21, __c5, 1));
428
+ case 3:
429
+ return S.suspend(() =>
430
+ S.Struct({
431
+ data: __S(22, __c5, 2),
432
+ pagination: S.optional(__S(8, __c2, 0)),
433
+ total: S.optional(S.Number),
434
+ }),
435
+ ).annotate({ identifier: "GetFollowedChannelsResponse" });
436
+ }
437
+ }
438
+ function __c6(j: number): any {
439
+ switch (j) {
440
+ case 0:
441
+ return S.suspend(() =>
442
+ S.Struct({
443
+ id: S.String,
444
+ is_enabled: S.Boolean,
445
+ }),
446
+ ).annotate({ identifier: "ModifyChannelInformationRequestContentClassificationLabelsItem" });
447
+ case 1:
448
+ return S.Array(__S(24, __c6, 0));
449
+ case 2:
450
+ return S.suspend(() =>
451
+ S.Struct({
452
+ broadcaster_id: S.String.pipe(T.Query()),
453
+ game_id: S.optional(S.String),
454
+ broadcaster_language: S.optional(S.String),
455
+ title: S.optional(S.String),
456
+ delay: S.optional(S.Number),
457
+ tags: S.optional(__S(16, __c4, 0)),
458
+ content_classification_labels: S.optional(__S(25, __c6, 1)),
459
+ is_branded_content: S.optional(S.Boolean),
460
+ }).pipe(T.Http({ method: "PATCH", uri: "/channels", code: 200 })),
461
+ ).annotate({ identifier: "ModifyChannelInformationRequest" });
462
+ case 3:
463
+ return S.suspend(() => S.Struct({})).annotate({
464
+ identifier: "ModifyChannelInformationResponse",
465
+ });
466
+ }
467
+ }
468
+ // Schema table: entry i is schema j of builder f, made on first reach.
469
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
470
+ return (__s[i] ??= __L.at(f, j));
471
+ }