@distilled.cloud/twitch 0.0.0-stage → 1.0.0-rc.21

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 +83 -2
  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 +88 -3
  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,579 @@
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: "Streams",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface CreateStreamMarkerRequest {
28
+ /** The ID of the broadcaster that's streaming content. This ID must match the user ID in the access token or the user in the access token must be one of the broadcaster's editors. */
29
+ user_id: string;
30
+ /** A short description of the marker to help the user remember why they marked the location. The maximum length of the description is 140 characters. */
31
+ description?: string | undefined;
32
+ }
33
+ export interface CreateStreamMarkerResponseDataItem {
34
+ /** An ID that identifies this marker. */
35
+ id?: string | undefined;
36
+ /** The UTC date and time (in RFC3339 format) of when the user created the marker. */
37
+ created_at?: string | undefined;
38
+ /** The relative offset (in seconds) of the marker from the beginning of the stream. */
39
+ position_seconds?: number | undefined;
40
+ /** A description that the user gave the marker to help them remember why they marked the location. */
41
+ description?: string | undefined;
42
+ }
43
+ /** A list that contains the single marker that you added. */
44
+ export type CreateStreamMarkerResponseDataList = Array<CreateStreamMarkerResponseDataItem>;
45
+ export interface CreateStreamMarkerResponse {
46
+ /** A list that contains the single marker that you added. */
47
+ data?: CreateStreamMarkerResponseDataList | undefined;
48
+ }
49
+ export interface GetFollowedStreamsRequest {
50
+ /** The ID of the user whose list of followed streams you want to get. This ID must match the user ID in the access token. */
51
+ user_id: string;
52
+ /** 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 items per page. The default is 100. */
53
+ first?: number | undefined;
54
+ /** 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) */
55
+ after?: string | undefined;
56
+ }
57
+ /** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
58
+ export type GetFollowedStreamsResponseDataItemTagIdsList = Array<string>;
59
+ /** The tags applied to the stream. Is **null** if the stream has no tags. */
60
+ export type GetFollowedStreamsResponseDataItemTagsList = Array<string>;
61
+ export interface GetFollowedStreamsResponseDataItem {
62
+ /** An ID that identifies the stream. You can use this ID later to look up the video on demand (VOD). */
63
+ id?: string | undefined;
64
+ /** The ID of the user that's broadcasting the stream. */
65
+ user_id?: string | undefined;
66
+ /** The user's login name. */
67
+ user_login?: string | undefined;
68
+ /** The user's display name. */
69
+ user_name?: string | undefined;
70
+ /** The ID of the category or game being played. */
71
+ game_id?: string | undefined;
72
+ /** The name of the category or game being played. */
73
+ game_name?: string | undefined;
74
+ /** The type of stream. Possible values: - `live` */
75
+ type?: string | undefined;
76
+ /** The stream's title. Is an empty string if not set. */
77
+ title?: string | undefined;
78
+ /** The number of users watching the stream. */
79
+ viewer_count?: number | undefined;
80
+ /** The UTC date and time (in RFC3339 format) of when the broadcast began. */
81
+ started_at?: string | undefined;
82
+ /** The language that the stream uses. This is an ISO 639-1 two-letter language code or *other* if the stream uses a language not in the list of [supported stream languages](https://help.twitch.tv/s/article/languages-on-twitch#streamlang) */
83
+ language?: string | undefined;
84
+ /** A URL to an image of a frame from the last 5 minutes of the stream. Replace the width and height placeholders in the URL ('{width}x{height}') with the size of the image you want, in pixels. */
85
+ thumbnail_url?: string | undefined;
86
+ /** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
87
+ tag_ids?: GetFollowedStreamsResponseDataItemTagIdsList | undefined;
88
+ /** The tags applied to the stream. Is **null** if the stream has no tags. */
89
+ tags?: GetFollowedStreamsResponseDataItemTagsList | null | undefined;
90
+ /** **IMPORTANT** This field is deprecated and returns only **false**. A Boolean value that indicates whether the stream is meant for mature audiences. */
91
+ is_mature?: boolean | undefined;
92
+ }
93
+ /** The list of live streams of broadcasters that the specified user follows. The list is in descending order by the number of viewers watching the stream. Because viewers come and go during a stream, it's possible to find duplicate or missing streams in the list as you page through the results. The list is empty if none of the followed broadcasters are streaming live. If the user follows more than 2,000 broadcasters, the list includes only streams from the first 2,000 broadcasters that the user followed. */
94
+ export type GetFollowedStreamsResponseDataList = Array<GetFollowedStreamsResponseDataItem>;
95
+ /** The information used to page through the list of results. The object is empty if the page contains fewer streams than the page size (see *first*). A full page includes a cursor even if no more streams remain, in which case the next page is empty. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
96
+ export interface GetFollowedStreamsResponsePagination {
97
+ /** The cursor used to get the next page of results. Set the request's *after* query parameter to this value. */
98
+ cursor?: string | undefined;
99
+ }
100
+ export interface GetFollowedStreamsResponse {
101
+ /** The list of live streams of broadcasters that the specified user follows. The list is in descending order by the number of viewers watching the stream. Because viewers come and go during a stream, it's possible to find duplicate or missing streams in the list as you page through the results. The list is empty if none of the followed broadcasters are streaming live. If the user follows more than 2,000 broadcasters, the list includes only streams from the first 2,000 broadcasters that the user followed. */
102
+ data: GetFollowedStreamsResponseDataList;
103
+ /** The information used to page through the list of results. The object is empty if the page contains fewer streams than the page size (see *first*). A full page includes a cursor even if no more streams remain, in which case the next page is empty. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
104
+ pagination?: GetFollowedStreamsResponsePagination | undefined;
105
+ }
106
+ export interface GetStreamKeyRequest {
107
+ /** The ID of the broadcaster that owns the channel. The ID must match the user ID in the access token. */
108
+ broadcaster_id: string;
109
+ }
110
+ export interface GetStreamKeyResponseDataItem {
111
+ /** The channel's stream key. */
112
+ stream_key?: string | undefined;
113
+ }
114
+ /** A list that contains the channel's stream key. */
115
+ export type GetStreamKeyResponseDataList = Array<GetStreamKeyResponseDataItem>;
116
+ export interface GetStreamKeyResponse {
117
+ /** A list that contains the channel's stream key. */
118
+ data?: GetStreamKeyResponseDataList | undefined;
119
+ }
120
+ export interface GetStreamMarkersRequest {
121
+ /** A user ID. The request returns the markers from this user's most recent past broadcast (a video of type *archive*); highlights and uploads aren't considered. This ID must match the user ID in the access token or the user in the access token must be one of the broadcaster's editors. This parameter and the *video_id* query parameter are mutually exclusive. */
122
+ user_id?: string | undefined;
123
+ /** A video on demand (VOD)/video ID. The request returns the markers from this VOD/video. The user in the access token must own the video or the user must be one of the broadcaster's editors. This parameter and the *user_id* query parameter are mutually exclusive. */
124
+ video_id?: string | undefined;
125
+ /** 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 items per page. The default is 20. */
126
+ first?: number | undefined;
127
+ /** 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) */
128
+ after?: string | undefined;
129
+ }
130
+ export interface GetStreamMarkersResponseDataItemVideosItemMarkersItem {
131
+ /** An ID that identifies this marker. */
132
+ id?: string | undefined;
133
+ /** The UTC date and time (in RFC3339 format) of when the user created the marker. */
134
+ created_at?: string | undefined;
135
+ /** The description that the user gave the marker to help them remember why they marked the location. Is an empty string if the user didn't provide one. */
136
+ description?: string | undefined;
137
+ /** The relative offset (in seconds) of the marker from the beginning of the stream. */
138
+ position_seconds?: number | undefined;
139
+ /** A URL that opens the video in Twitch Highlighter. */
140
+ URL?: string | undefined;
141
+ }
142
+ /** The list of markers in this video. The list is in ascending order by the marker's position in the video (see `position_seconds`). */
143
+ export type GetStreamMarkersResponseDataItemVideosItemMarkersList =
144
+ Array<GetStreamMarkersResponseDataItemVideosItemMarkersItem>;
145
+ export interface GetStreamMarkersResponseDataItemVideosItem {
146
+ /** An ID that identifies this video. */
147
+ video_id?: string | undefined;
148
+ /** The list of markers in this video. The list is in ascending order by the marker's position in the video (see `position_seconds`). */
149
+ markers?: GetStreamMarkersResponseDataItemVideosItemMarkersList | undefined;
150
+ }
151
+ /** A list of videos that contain markers. The list contains a single video. */
152
+ export type GetStreamMarkersResponseDataItemVideosList =
153
+ Array<GetStreamMarkersResponseDataItemVideosItem>;
154
+ export interface GetStreamMarkersResponseDataItem {
155
+ /** The ID of the user that created the marker. */
156
+ user_id?: string | undefined;
157
+ /** The user's display name. */
158
+ user_name?: string | undefined;
159
+ /** The user's login name. */
160
+ user_login?: string | undefined;
161
+ /** A list of videos that contain markers. The list contains a single video. */
162
+ videos?: GetStreamMarkersResponseDataItemVideosList | undefined;
163
+ }
164
+ /** The list of markers grouped by the user that created the marks. */
165
+ export type GetStreamMarkersResponseDataList = Array<GetStreamMarkersResponseDataItem>;
166
+ /** 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) */
167
+ export type GetStreamMarkersResponsePagination = GetFollowedStreamsResponsePagination;
168
+ export interface GetStreamMarkersResponse {
169
+ /** The list of markers grouped by the user that created the marks. */
170
+ data: GetStreamMarkersResponseDataList;
171
+ /** 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) */
172
+ pagination?: GetFollowedStreamsResponsePagination | undefined;
173
+ }
174
+ export type GetStreamsRequestUserIdList = Array<string>;
175
+ export type GetStreamsRequestUserLoginList = Array<string>;
176
+ export type GetStreamsRequestGameIdList = Array<string>;
177
+ export type GetStreamsRequestLanguageList = Array<string>;
178
+ export interface GetStreamsRequest {
179
+ /** A user ID used to filter the list of streams. Returns only the streams of those users that are broadcasting. You may specify a maximum of 100 IDs. To specify multiple IDs, include the *user_id* parameter for each user. For example, '&user_id=1234&user_id=5678'. */
180
+ user_id?: GetStreamsRequestUserIdList | undefined;
181
+ /** A user login name used to filter the list of streams. Returns only the streams of those users that are broadcasting. You may specify a maximum of 100 login names. To specify multiple names, include the *user_login* parameter for each user. For example, '&user_login=foo&user_login=bar'. */
182
+ user_login?: GetStreamsRequestUserLoginList | undefined;
183
+ /** A game (category) ID used to filter the list of streams. Returns only the streams that are broadcasting the game (category). You may specify a maximum of 100 IDs. To specify multiple IDs, include the *game_id* parameter for each game. For example, '&game_id=9876&game_id=5432'. */
184
+ game_id?: GetStreamsRequestGameIdList | undefined;
185
+ /** The type of stream to filter the list of streams by. The default is *all*. Both values return only live streams. Possible values: - `all` - `live` */
186
+ type?: string | undefined;
187
+ /** A language code used to filter the list of streams. Returns only streams that broadcast in the specified language. Specify the language using an ISO 639-1 two-letter language code or *other* if the broadcast uses a language not in the list of [supported stream languages](https://help.twitch.tv/s/article/languages-on-twitch#streamlang). You may specify a maximum of 100 language codes. To specify multiple languages, include the *language* parameter for each language. For example, '&language=de&language=fr'. */
188
+ language?: GetStreamsRequestLanguageList | undefined;
189
+ /** 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 items per page. The default is 20. If you specify *user_id* or *user_login*, the response contains all of the matching streams, regardless of this value. */
190
+ first?: number | undefined;
191
+ /** The cursor used to get the previous 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) */
192
+ before?: string | undefined;
193
+ /** 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) */
194
+ after?: string | undefined;
195
+ }
196
+ /** The tags applied to the stream. Is **null** if the stream has no tags. */
197
+ export type GetStreamsResponseDataItemTagsList = Array<string>;
198
+ /** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
199
+ export type GetStreamsResponseDataItemTagIdsList = Array<string>;
200
+ export interface GetStreamsResponseDataItem {
201
+ /** An ID that identifies the stream. You can use this ID later to look up the video on demand (VOD). */
202
+ id?: string | undefined;
203
+ /** The ID of the user that's broadcasting the stream. */
204
+ user_id?: string | undefined;
205
+ /** The user's login name. */
206
+ user_login?: string | undefined;
207
+ /** The user's display name. */
208
+ user_name?: string | undefined;
209
+ /** The ID of the category or game being streamed. If no category is set on the channel, this will be set to an empty string. */
210
+ game_id?: string | undefined;
211
+ /** The name of the category or game being streamed. If no category is set on the channel, this will be set to an empty string. */
212
+ game_name?: string | undefined;
213
+ /** The type of stream. Possible values: - `live` */
214
+ type?: string | undefined;
215
+ /** The stream's title. Is an empty string if not set. */
216
+ title?: string | undefined;
217
+ /** The tags applied to the stream. Is **null** if the stream has no tags. */
218
+ tags?: GetStreamsResponseDataItemTagsList | null | undefined;
219
+ /** The number of users watching the stream. */
220
+ viewer_count?: number | undefined;
221
+ /** The UTC date and time (in RFC3339 format) of when the broadcast began. */
222
+ started_at?: string | undefined;
223
+ /** The language that the stream uses. This is an ISO 639-1 two-letter language code or *other* if the stream uses a language not in the list of [supported stream languages](https://help.twitch.tv/s/article/languages-on-twitch#streamlang). */
224
+ language?: string | undefined;
225
+ /** A URL to an image of a frame from the last 5 minutes of the stream. Replace the width and height placeholders in the URL ('{width}x{height}') with the size of the image you want, in pixels. */
226
+ thumbnail_url?: string | undefined;
227
+ /** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
228
+ tag_ids?: GetStreamsResponseDataItemTagIdsList | undefined;
229
+ /** **IMPORTANT** This field is deprecated and returns only **false**. A Boolean value that indicates whether the stream is meant for mature audiences. */
230
+ is_mature?: boolean | undefined;
231
+ }
232
+ /** The list of streams. Streams that Twitch restricts from discovery aren't included, except the user's own stream if you use a user access token, so a page may contain fewer than *first* items even if more pages remain. */
233
+ export type GetStreamsResponseDataList = Array<GetStreamsResponseDataItem>;
234
+ /** 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) */
235
+ export interface GetStreamsResponsePagination {
236
+ /** The cursor used to get the next page of results. Set the request's *after* or *before* query parameter to this value depending on whether you're paging forwards or backwards. */
237
+ cursor?: string | undefined;
238
+ }
239
+ export interface GetStreamsResponse {
240
+ /** The list of streams. Streams that Twitch restricts from discovery aren't included, except the user's own stream if you use a user access token, so a page may contain fewer than *first* items even if more pages remain. */
241
+ data: GetStreamsResponseDataList;
242
+ /** 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) */
243
+ pagination?: GetStreamsResponsePagination | undefined;
244
+ }
245
+ export type CreateStreamMarkerError = TwitchOpError;
246
+ /** Create Stream Marker Adds a marker to a live stream. A marker is an arbitrary point in a live stream that the broadcaster or editor wants to mark, so they can return to that spot later to create video highlights. For more information on these features, see [Creating Highlights and Stream Markers](https://help.twitch.tv/s/article/creating-highlights-and-stream-markers). You may not add markers: - If the stream is not live. - If the stream has not enabled video on demand (VOD). - If the stream is a rerun of a past broadcast. - If the stream is a premiere. 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/streams/#create-stream-marker */
247
+ export const createStreamMarker: API.OperationMethod<
248
+ CreateStreamMarkerRequest,
249
+ CreateStreamMarkerResponse,
250
+ CreateStreamMarkerError,
251
+ TwitchOpContext
252
+ > = /*@__PURE__*/ API.make(() => ({
253
+ input: __S(0, __c0, 0) as any as S.Schema<CreateStreamMarkerRequest>,
254
+ output: __S(3, __c0, 3) as any as S.Schema<CreateStreamMarkerResponse>,
255
+ errors: [],
256
+ serviceErrors: TwitchServiceErrors,
257
+ protocol: TwitchProtocol,
258
+ retry: Retry.Retry,
259
+ telemetry: TELEMETRY,
260
+ span: "CreateStreamMarker",
261
+ }));
262
+
263
+ export type GetFollowedStreamsError = TwitchOpError;
264
+ /** Get Followed Streams Gets the list of broadcasters that the user follows and that are streaming live. 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/streams/#get-followed-streams */
265
+ export const getFollowedStreams: API.PaginatedOperationMethod<
266
+ GetFollowedStreamsRequest,
267
+ GetFollowedStreamsResponse,
268
+ GetFollowedStreamsError,
269
+ TwitchOpContext,
270
+ GetFollowedStreamsResponseDataItem
271
+ > = /*@__PURE__*/ API.makePaginated(
272
+ () => ({
273
+ input: __S(8, __c1, 0) as any as S.Schema<GetFollowedStreamsRequest>,
274
+ output: __S(11, __c1, 3) as any as S.Schema<GetFollowedStreamsResponse>,
275
+ errors: [],
276
+ serviceErrors: TwitchServiceErrors,
277
+ protocol: TwitchProtocol,
278
+ retry: Retry.Retry,
279
+ telemetry: TELEMETRY,
280
+ span: "GetFollowedStreams",
281
+ pagination: {
282
+ mode: "cursor",
283
+ inputToken: "after",
284
+ outputToken: "pagination.cursor",
285
+ items: "data",
286
+ pageSize: "first",
287
+ } as const,
288
+ }),
289
+ paginateCursor,
290
+ ) as any;
291
+
292
+ export type GetStreamKeyError = TwitchOpError;
293
+ /** Get Stream Key Gets the channel's stream key. 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:stream_key** scope. Reference: https://dev.twitch.tv/docs/api/reference/streams/#get-stream-key */
294
+ export const getStreamKey: API.OperationMethod<
295
+ GetStreamKeyRequest,
296
+ GetStreamKeyResponse,
297
+ GetStreamKeyError,
298
+ TwitchOpContext
299
+ > = /*@__PURE__*/ API.make(() => ({
300
+ input: __S(32, __c4, 0) as any as S.Schema<GetStreamKeyRequest>,
301
+ output: __S(35, __c4, 3) as any as S.Schema<GetStreamKeyResponse>,
302
+ errors: [],
303
+ serviceErrors: TwitchServiceErrors,
304
+ protocol: TwitchProtocol,
305
+ retry: Retry.Retry,
306
+ telemetry: TELEMETRY,
307
+ span: "GetStreamKey",
308
+ }));
309
+
310
+ export type GetStreamMarkersError = TwitchOpError;
311
+ /** Get Stream Markers Gets a list of markers from the user's most recent stream or from the specified VOD/video. A marker is an arbitrary point in a live stream that the broadcaster or editor marked, so they can return to that spot later to create video highlights. For more information on these features, see [Creating Highlights and Stream Markers](https://help.twitch.tv/s/article/creating-highlights-and-stream-markers). You must specify exactly one of the *user_id* and *video_id* query parameters; the request fails if you specify none of them or more than one. 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:broadcast** or **channel:manage:broadcast** scope. Reference: https://dev.twitch.tv/docs/api/reference/streams/#get-stream-markers */
312
+ export const getStreamMarkers: API.PaginatedOperationMethod<
313
+ GetStreamMarkersRequest,
314
+ GetStreamMarkersResponse,
315
+ GetStreamMarkersError,
316
+ TwitchOpContext,
317
+ GetStreamMarkersResponseDataItem
318
+ > = /*@__PURE__*/ API.makePaginated(
319
+ () => ({
320
+ input: __S(40, __c5, 0) as any as S.Schema<GetStreamMarkersRequest>,
321
+ output: __S(47, __c5, 7) as any as S.Schema<GetStreamMarkersResponse>,
322
+ errors: [],
323
+ serviceErrors: TwitchServiceErrors,
324
+ protocol: TwitchProtocol,
325
+ retry: Retry.Retry,
326
+ telemetry: TELEMETRY,
327
+ span: "GetStreamMarkers",
328
+ pagination: {
329
+ mode: "cursor",
330
+ inputToken: "after",
331
+ outputToken: "pagination.cursor",
332
+ items: "data",
333
+ pageSize: "first",
334
+ } as const,
335
+ }),
336
+ paginateCursor,
337
+ ) as any;
338
+
339
+ export type GetStreamsError = TwitchOpError;
340
+ /** Get Streams Gets a list of all streams. The list is in descending order by the number of viewers watching the stream. Because viewers come and go during a stream, it's possible to find duplicate or missing streams in the list as you page through the results. 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/streams/#get-streams */
341
+ export const getStreams: API.PaginatedOperationMethod<
342
+ GetStreamsRequest,
343
+ GetStreamsResponse,
344
+ GetStreamsError,
345
+ TwitchOpContext,
346
+ GetStreamsResponseDataItem
347
+ > = /*@__PURE__*/ API.makePaginated(
348
+ () => ({
349
+ input: __S(48, __c6, 0) as any as S.Schema<GetStreamsRequest>,
350
+ output: __S(51, __c6, 3) as any as S.Schema<GetStreamsResponse>,
351
+ errors: [],
352
+ serviceErrors: TwitchServiceErrors,
353
+ protocol: TwitchProtocol,
354
+ retry: Retry.Retry,
355
+ telemetry: TELEMETRY,
356
+ span: "GetStreams",
357
+ pagination: {
358
+ mode: "cursor",
359
+ inputToken: "after",
360
+ outputToken: "pagination.cursor",
361
+ items: "data",
362
+ pageSize: "first",
363
+ } as const,
364
+ }),
365
+ paginateCursor,
366
+ ) as any;
367
+
368
+ // Schema builders: each runs one schema initializer, on that schema's first use.
369
+ function __c0(j: number): any {
370
+ switch (j) {
371
+ case 0:
372
+ return S.suspend(() =>
373
+ S.Struct({
374
+ user_id: S.String,
375
+ description: S.optional(S.String),
376
+ }).pipe(T.Http({ method: "POST", uri: "/streams/markers", code: 200 })),
377
+ ).annotate({ identifier: "CreateStreamMarkerRequest" });
378
+ case 1:
379
+ return S.suspend(() =>
380
+ S.Struct({
381
+ id: S.optional(S.String),
382
+ created_at: S.optional(S.String),
383
+ position_seconds: S.optional(S.Number),
384
+ description: S.optional(S.String),
385
+ }),
386
+ ).annotate({ identifier: "CreateStreamMarkerResponseDataItem" });
387
+ case 2:
388
+ return S.Array(__S(1, __c0, 1));
389
+ case 3:
390
+ return S.suspend(() =>
391
+ S.Struct({
392
+ data: S.optional(__S(2, __c0, 2)),
393
+ }),
394
+ ).annotate({ identifier: "CreateStreamMarkerResponse" });
395
+ }
396
+ }
397
+ function __c1(j: number): any {
398
+ switch (j) {
399
+ case 0:
400
+ return S.suspend(() =>
401
+ S.Struct({
402
+ user_id: S.String.pipe(T.Query()),
403
+ first: S.optional(S.Number.pipe(T.Query())),
404
+ after: S.optional(S.String.pipe(T.Query())),
405
+ }).pipe(T.Http({ method: "GET", uri: "/streams/followed", code: 200 })),
406
+ ).annotate({ identifier: "GetFollowedStreamsRequest" });
407
+ case 1:
408
+ return S.suspend(() =>
409
+ S.Struct({
410
+ id: S.optional(S.String),
411
+ user_id: S.optional(S.String),
412
+ user_login: S.optional(S.String),
413
+ user_name: S.optional(S.String),
414
+ game_id: S.optional(S.String),
415
+ game_name: S.optional(S.String),
416
+ type: S.optional(S.String),
417
+ title: S.optional(S.String),
418
+ viewer_count: S.optional(S.Number),
419
+ started_at: S.optional(S.String),
420
+ language: S.optional(S.String),
421
+ thumbnail_url: S.optional(S.String),
422
+ tag_ids: S.optional(__S(24, __c3, 0)),
423
+ tags: S.optional(S.NullOr(__S(24, __c3, 0))),
424
+ is_mature: S.optional(S.Boolean),
425
+ }),
426
+ ).annotate({ identifier: "GetFollowedStreamsResponseDataItem" });
427
+ case 2:
428
+ return S.Array(__S(9, __c1, 1));
429
+ case 3:
430
+ return S.suspend(() =>
431
+ S.Struct({
432
+ data: __S(10, __c1, 2),
433
+ pagination: S.optional(__S(16, __c2, 0)),
434
+ }),
435
+ ).annotate({ identifier: "GetFollowedStreamsResponse" });
436
+ }
437
+ }
438
+ function __c2(j: number): any {
439
+ switch (j) {
440
+ case 0:
441
+ return S.suspend(() =>
442
+ S.Struct({
443
+ cursor: S.optional(S.String),
444
+ }),
445
+ ).annotate({ identifier: "GetFollowedStreamsResponsePagination" });
446
+ }
447
+ }
448
+ function __c3(j: number): any {
449
+ switch (j) {
450
+ case 0:
451
+ return S.Array(S.String);
452
+ }
453
+ }
454
+ function __c4(j: number): any {
455
+ switch (j) {
456
+ case 0:
457
+ return S.suspend(() =>
458
+ S.Struct({
459
+ broadcaster_id: S.String.pipe(T.Query()),
460
+ }).pipe(T.Http({ method: "GET", uri: "/streams/key", code: 200 })),
461
+ ).annotate({ identifier: "GetStreamKeyRequest" });
462
+ case 1:
463
+ return S.suspend(() =>
464
+ S.Struct({
465
+ stream_key: S.optional(S.String),
466
+ }),
467
+ ).annotate({ identifier: "GetStreamKeyResponseDataItem" });
468
+ case 2:
469
+ return S.Array(__S(33, __c4, 1));
470
+ case 3:
471
+ return S.suspend(() =>
472
+ S.Struct({
473
+ data: S.optional(__S(34, __c4, 2)),
474
+ }),
475
+ ).annotate({ identifier: "GetStreamKeyResponse" });
476
+ }
477
+ }
478
+ function __c5(j: number): any {
479
+ switch (j) {
480
+ case 0:
481
+ return S.suspend(() =>
482
+ S.Struct({
483
+ user_id: S.optional(S.String.pipe(T.Query())),
484
+ video_id: S.optional(S.String.pipe(T.Query())),
485
+ first: S.optional(S.Number.pipe(T.Query())),
486
+ after: S.optional(S.String.pipe(T.Query())),
487
+ }).pipe(T.Http({ method: "GET", uri: "/streams/markers", code: 200 })),
488
+ ).annotate({ identifier: "GetStreamMarkersRequest" });
489
+ case 1:
490
+ return S.suspend(() =>
491
+ S.Struct({
492
+ id: S.optional(S.String),
493
+ created_at: S.optional(S.String),
494
+ description: S.optional(S.String),
495
+ position_seconds: S.optional(S.Number),
496
+ URL: S.optional(S.String),
497
+ }),
498
+ ).annotate({ identifier: "GetStreamMarkersResponseDataItemVideosItemMarkersItem" });
499
+ case 2:
500
+ return S.Array(__S(41, __c5, 1));
501
+ case 3:
502
+ return S.suspend(() =>
503
+ S.Struct({
504
+ video_id: S.optional(S.String),
505
+ markers: S.optional(__S(42, __c5, 2)),
506
+ }),
507
+ ).annotate({ identifier: "GetStreamMarkersResponseDataItemVideosItem" });
508
+ case 4:
509
+ return S.Array(__S(43, __c5, 3));
510
+ case 5:
511
+ return S.suspend(() =>
512
+ S.Struct({
513
+ user_id: S.optional(S.String),
514
+ user_name: S.optional(S.String),
515
+ user_login: S.optional(S.String),
516
+ videos: S.optional(__S(44, __c5, 4)),
517
+ }),
518
+ ).annotate({ identifier: "GetStreamMarkersResponseDataItem" });
519
+ case 6:
520
+ return S.Array(__S(45, __c5, 5));
521
+ case 7:
522
+ return S.suspend(() =>
523
+ S.Struct({
524
+ data: __S(46, __c5, 6),
525
+ pagination: S.optional(__S(16, __c2, 0)),
526
+ }),
527
+ ).annotate({ identifier: "GetStreamMarkersResponse" });
528
+ }
529
+ }
530
+ function __c6(j: number): any {
531
+ switch (j) {
532
+ case 0:
533
+ return S.suspend(() =>
534
+ S.Struct({
535
+ user_id: S.optional(__S(24, __c3, 0).pipe(T.Query())),
536
+ user_login: S.optional(__S(24, __c3, 0).pipe(T.Query())),
537
+ game_id: S.optional(__S(24, __c3, 0).pipe(T.Query())),
538
+ type: S.optional(S.String.pipe(T.Query())),
539
+ language: S.optional(__S(24, __c3, 0).pipe(T.Query())),
540
+ first: S.optional(S.Number.pipe(T.Query())),
541
+ before: S.optional(S.String.pipe(T.Query())),
542
+ after: S.optional(S.String.pipe(T.Query())),
543
+ }).pipe(T.Http({ method: "GET", uri: "/streams", code: 200 })),
544
+ ).annotate({ identifier: "GetStreamsRequest" });
545
+ case 1:
546
+ return S.suspend(() =>
547
+ S.Struct({
548
+ id: S.optional(S.String),
549
+ user_id: S.optional(S.String),
550
+ user_login: S.optional(S.String),
551
+ user_name: S.optional(S.String),
552
+ game_id: S.optional(S.String),
553
+ game_name: S.optional(S.String),
554
+ type: S.optional(S.String),
555
+ title: S.optional(S.String),
556
+ tags: S.optional(S.NullOr(__S(24, __c3, 0))),
557
+ viewer_count: S.optional(S.Number),
558
+ started_at: S.optional(S.String),
559
+ language: S.optional(S.String),
560
+ thumbnail_url: S.optional(S.String),
561
+ tag_ids: S.optional(__S(24, __c3, 0)),
562
+ is_mature: S.optional(S.Boolean),
563
+ }),
564
+ ).annotate({ identifier: "GetStreamsResponseDataItem" });
565
+ case 2:
566
+ return S.Array(__S(49, __c6, 1));
567
+ case 3:
568
+ return S.suspend(() =>
569
+ S.Struct({
570
+ data: __S(50, __c6, 2),
571
+ pagination: S.optional(__S(16, __c2, 0)),
572
+ }),
573
+ ).annotate({ identifier: "GetStreamsResponse" });
574
+ }
575
+ }
576
+ // Schema table: entry i is schema j of builder f, made on first reach.
577
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
578
+ return (__s[i] ??= __L.at(f, j));
579
+ }