@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,1098 @@
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: "Extensions",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface CreateExtensionSecretRequest {
28
+ /** The ID of the extension to apply the shared secret to. */
29
+ extension_id: string;
30
+ /** The amount of time, in seconds, to delay activating the secret. The delay should provide enough time for instances of the extension to gracefully switch over to the new secret. The minimum delay is 300 seconds (5 minutes). The default is 300 seconds. */
31
+ delay?: number | undefined;
32
+ }
33
+ export interface CreateExtensionSecretResponseDataItemSecretsItem {
34
+ /** The secret, base64-encoded. Decode it to get the key that you use to sign and verify JWTs. */
35
+ content?: string | undefined;
36
+ /** The UTC date and time (in RFC3339 format) that you may begin using this secret to sign a JWT. */
37
+ active_at?: string | undefined;
38
+ /** The UTC date and time (in RFC3339 format) that you must stop using this secret to decode a JWT. */
39
+ expires_at?: string | undefined;
40
+ }
41
+ /** The list of secrets. */
42
+ export type CreateExtensionSecretResponseDataItemSecretsList =
43
+ Array<CreateExtensionSecretResponseDataItemSecretsItem>;
44
+ export interface CreateExtensionSecretResponseDataItem {
45
+ /** The version number that identifies this definition of the secret's data. */
46
+ format_version?: number | undefined;
47
+ /** The list of secrets. */
48
+ secrets?: CreateExtensionSecretResponseDataItemSecretsList | undefined;
49
+ }
50
+ /** A list that contains the newly added secrets. */
51
+ export type CreateExtensionSecretResponseDataList = Array<CreateExtensionSecretResponseDataItem>;
52
+ export interface CreateExtensionSecretResponse {
53
+ /** A list that contains the newly added secrets. */
54
+ data?: CreateExtensionSecretResponseDataList | undefined;
55
+ }
56
+ export interface GetExtensionBitsProductsRequest {
57
+ /** A Boolean value that determines whether to include disabled or expired Bits products in the response. The default is **false**. */
58
+ should_include_all?: boolean | undefined;
59
+ }
60
+ /** An object that contains the product's cost information. Is **null** if the product doesn't have a cost. */
61
+ export interface GetExtensionBitsProductsResponseDataItemCost {
62
+ /** The product's price. */
63
+ amount?: number | undefined;
64
+ /** The type of currency. Possible values: - `bits` */
65
+ type?: string | undefined;
66
+ }
67
+ export interface GetExtensionBitsProductsResponseDataItem {
68
+ /** The product's SKU. The SKU is unique across an extension's products. */
69
+ sku?: string | undefined;
70
+ /** An object that contains the product's cost information. Is **null** if the product doesn't have a cost. */
71
+ cost?: GetExtensionBitsProductsResponseDataItemCost | null | undefined;
72
+ /** A Boolean value that indicates whether the product is in development. If **true**, the product is not available for public use. */
73
+ in_development?: boolean | undefined;
74
+ /** The product's name as displayed in the extension. */
75
+ display_name?: string | undefined;
76
+ /** The date and time, in RFC3339 format, when the product expires. Is **null** if the product doesn't expire. */
77
+ expiration?: string | null | undefined;
78
+ /** A Boolean value that determines whether Bits product purchase events are broadcast to all instances of an extension on a channel. The events are broadcast via the 'onTransactionComplete' helper callback. Is **true** if the event is broadcast to all instances. */
79
+ is_broadcast?: boolean | undefined;
80
+ }
81
+ /** A list of Bits products that the extension created. The list is in ascending SKU order. The list is empty if the extension hasn't created any products or they're all expired or disabled. */
82
+ export type GetExtensionBitsProductsResponseDataList =
83
+ Array<GetExtensionBitsProductsResponseDataItem>;
84
+ export interface GetExtensionBitsProductsResponse {
85
+ /** A list of Bits products that the extension created. The list is in ascending SKU order. The list is empty if the extension hasn't created any products or they're all expired or disabled. */
86
+ data?: GetExtensionBitsProductsResponseDataList | undefined;
87
+ }
88
+ export type GetExtensionConfigurationSegmentRequestSegmentList = Array<string>;
89
+ export interface GetExtensionConfigurationSegmentRequest {
90
+ /** The ID of the broadcaster that installed the extension. This parameter is required if you set the *segment* parameter to broadcaster or developer. Do not specify this parameter if you set *segment* to global. */
91
+ broadcaster_id?: string | undefined;
92
+ /** The ID of the extension that contains the configuration segment you want to get. */
93
+ extension_id: string;
94
+ /** The type of configuration segment to get. To get more than one segment, include this parameter for each segment, for example, `segment=broadcaster&segment=developer`. If you don't specify a segment, the list in the response is empty. Possible values: - `broadcaster` - `developer` - `global` */
95
+ segment?: GetExtensionConfigurationSegmentRequestSegmentList | undefined;
96
+ }
97
+ export interface GetExtensionConfigurationSegmentResponseDataItem {
98
+ /** The type of segment. Possible values: - `broadcaster` - `developer` - `global` */
99
+ segment?: string | undefined;
100
+ /** The ID of the broadcaster that installed the extension. Is an empty string if `segment` is global. */
101
+ broadcaster_id?: string | undefined;
102
+ /** The contents of the segment. This string may be a plain-text string or a string-encoded JSON object. */
103
+ content?: string | undefined;
104
+ /** The version number that identifies this definition of the segment's data. */
105
+ version?: string | undefined;
106
+ }
107
+ /** The list of requested configuration segments. The list is returned in the same order that you specified the list of segments in the request. Segments that haven't been set aren't included in the list. */
108
+ export type GetExtensionConfigurationSegmentResponseDataList =
109
+ Array<GetExtensionConfigurationSegmentResponseDataItem>;
110
+ export interface GetExtensionConfigurationSegmentResponse {
111
+ /** The list of requested configuration segments. The list is returned in the same order that you specified the list of segments in the request. Segments that haven't been set aren't included in the list. */
112
+ data?: GetExtensionConfigurationSegmentResponseDataList | undefined;
113
+ }
114
+ export interface GetExtensionLiveChannelsRequest {
115
+ /** The ID of the extension to get. Returns the list of broadcasters that are live and that have installed or activated this extension. */
116
+ extension_id: string;
117
+ /** The specific maximum number of items 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. The actual number returned may be less than this limit. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
118
+ first?: number | undefined;
119
+ /** The cursor used to get the next page of results. The `pagination` field in the response contains the cursor's value. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
120
+ after?: string | undefined;
121
+ }
122
+ export interface GetExtensionLiveChannelsResponseDataItem {
123
+ /** The ID of the broadcaster that is streaming live and has installed or activated the extension. */
124
+ broadcaster_id?: string | undefined;
125
+ /** The broadcaster's display name. */
126
+ broadcaster_name?: string | undefined;
127
+ /** The name of the category or game being streamed. */
128
+ game_name?: string | undefined;
129
+ /** The ID of the category or game being streamed. May be an empty string if the category can't be identified. */
130
+ game_id?: string | undefined;
131
+ /** The title of the broadcaster's stream. May be an empty string if not specified. */
132
+ title?: string | undefined;
133
+ }
134
+ /** The list of broadcasters that are streaming live and that have installed or activated the extension. */
135
+ export type GetExtensionLiveChannelsResponseDataList =
136
+ Array<GetExtensionLiveChannelsResponseDataItem>;
137
+ export interface GetExtensionLiveChannelsResponse {
138
+ /** The list of broadcasters that are streaming live and that have installed or activated the extension. */
139
+ data: GetExtensionLiveChannelsResponseDataList;
140
+ /** This field contains the cursor used to page through the results. The field is empty if there are no more pages left to page through. Note that this field is a string compared to other endpoints that use a **Pagination** object. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
141
+ pagination?: string | undefined;
142
+ }
143
+ export interface GetExtensionsRequest {
144
+ /** The ID of the extension to get. */
145
+ extension_id: string;
146
+ /** The version of the extension to get. If not specified, it returns the released version. If the extension doesn't have a released version, you must specify a version; otherwise, the request fails with 404 Not Found. */
147
+ extension_version?: string | undefined;
148
+ }
149
+ /** A dictionary that contains URLs to different sizes of the default icon. The dictionary's key identifies the icon's size (for example, 24x24), and the dictionary's value contains the URL to the icon. */
150
+ export type GetExtensionsResponseDataItemIconUrlsMap = { [key: string]: string | undefined };
151
+ /** A list of URLs to screenshots that are shown in the Extensions marketplace. */
152
+ export type GetExtensionsResponseDataItemScreenshotUrlsList = Array<string>;
153
+ /** Describes how the extension is displayed on mobile devices. */
154
+ export interface GetExtensionsResponseDataItemViewsMobile {
155
+ /** The HTML file that is shown to viewers on mobile devices. This page is presented to viewers as a panel behind the chat area of the mobile app. */
156
+ viewer_url?: string | undefined;
157
+ }
158
+ /** Describes how the extension is rendered if the extension may be activated as a panel extension. */
159
+ export interface GetExtensionsResponseDataItemViewsPanel {
160
+ /** The HTML file that is shown to viewers on the channel page when the extension is activated in a Panel slot. */
161
+ viewer_url?: string | undefined;
162
+ /** The height, in pixels, of the panel component that the extension is rendered in. */
163
+ height?: number | undefined;
164
+ /** A Boolean value that determines whether the extension can link to non-Twitch domains. */
165
+ can_link_external_content?: boolean | undefined;
166
+ }
167
+ /** Describes how the extension is rendered if the extension may be activated as a video-overlay extension. */
168
+ export interface GetExtensionsResponseDataItemViewsVideoOverlay {
169
+ /** The HTML file that is shown to viewers on the channel page when the extension is activated on the Video - Overlay slot. */
170
+ viewer_url?: string | undefined;
171
+ /** A Boolean value that determines whether the extension can link to non-Twitch domains. */
172
+ can_link_external_content?: boolean | undefined;
173
+ }
174
+ /** Describes how the extension is rendered if the extension may be activated as a video-component extension. */
175
+ export interface GetExtensionsResponseDataItemViewsComponent {
176
+ /** The HTML file that is shown to viewers on the channel page when the extension is activated in a Video - Component slot. */
177
+ viewer_url?: string | undefined;
178
+ /** Deprecated. */
179
+ aspect_width?: number | undefined;
180
+ /** Deprecated. */
181
+ aspect_height?: number | undefined;
182
+ /** The width value of the ratio (width : height) which determines the extension's width, and how the extension's iframe will resize in different video player environments. */
183
+ aspect_ratio_x?: number | undefined;
184
+ /** The height value of the ratio (width : height) which determines the extension's height, and how the extension's iframe will resize in different video player environments. */
185
+ aspect_ratio_y?: number | undefined;
186
+ /** A Boolean value that determines whether to apply CSS zoom. If **true**, a CSS zoom is applied such that the size of the extension is variable but the inner dimensions are fixed based on Scale Pixels. This allows your extension to render as if it is of fixed width and height. If **false**, the inner dimensions of the extension iframe are variable, meaning your extension must implement responsiveness. */
187
+ autoscale?: boolean | undefined;
188
+ /** The base width, in pixels, of the extension to use when scaling (see `autoscale`). This value is ignored if `autoscale` is **false**. */
189
+ scale_pixels?: number | undefined;
190
+ /** The height as a percent of the maximum height of a video component extension. Values are between 1% - 100%. */
191
+ target_height?: number | undefined;
192
+ /** Deprecated. */
193
+ size?: number | undefined;
194
+ /** Deprecated. */
195
+ zoom?: boolean | undefined;
196
+ /** Deprecated. */
197
+ zoom_pixels?: number | undefined;
198
+ /** A Boolean value that determines whether the extension can link to non-Twitch domains. */
199
+ can_link_external_content?: boolean | undefined;
200
+ }
201
+ /** Describes the view that is shown to broadcasters while they are configuring your extension within the Extension Manager. */
202
+ export interface GetExtensionsResponseDataItemViewsConfig {
203
+ /** The HTML file shown to broadcasters while they are configuring your extension within the Extension Manager. */
204
+ viewer_url?: string | undefined;
205
+ /** A Boolean value that determines whether the extension can link to non-Twitch domains. */
206
+ can_link_external_content?: boolean | undefined;
207
+ }
208
+ /** Describes the view that is shown to broadcasters in the Live module of the dashboard. */
209
+ export interface GetExtensionsResponseDataItemViewsLiveConfig {
210
+ /** The HTML file that is shown to broadcasters in the Live module of the dashboard. It's used for actions that broadcasters take while the extension is active, such as creating a new poll. */
211
+ viewer_url?: string | undefined;
212
+ /** A Boolean value that determines whether the extension can link to non-Twitch domains. */
213
+ can_link_external_content?: boolean | undefined;
214
+ }
215
+ /** Describes all views-related information such as how the extension is displayed on mobile devices. The object includes only the views that the extension supports. */
216
+ export interface GetExtensionsResponseDataItemViews {
217
+ /** Describes how the extension is displayed on mobile devices. */
218
+ mobile?: GetExtensionsResponseDataItemViewsMobile | undefined;
219
+ /** Describes how the extension is rendered if the extension may be activated as a panel extension. */
220
+ panel?: GetExtensionsResponseDataItemViewsPanel | undefined;
221
+ /** Describes how the extension is rendered if the extension may be activated as a video-overlay extension. */
222
+ video_overlay?: GetExtensionsResponseDataItemViewsVideoOverlay | undefined;
223
+ /** Describes how the extension is rendered if the extension may be activated as a video-component extension. */
224
+ component?: GetExtensionsResponseDataItemViewsComponent | undefined;
225
+ /** Describes the view that is shown to broadcasters while they are configuring your extension within the Extension Manager. */
226
+ config?: GetExtensionsResponseDataItemViewsConfig | undefined;
227
+ /** Describes the view that is shown to broadcasters in the Live module of the dashboard. */
228
+ live_config?: GetExtensionsResponseDataItemViewsLiveConfig | undefined;
229
+ }
230
+ /** Allowlisted configuration URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
231
+ export type GetExtensionsResponseDataItemAllowlistedConfigUrlsList = Array<string>;
232
+ /** Allowlisted panel URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
233
+ export type GetExtensionsResponseDataItemAllowlistedPanelUrlsList = Array<string>;
234
+ export interface GetExtensionsResponseDataItem {
235
+ /** The name of the user or organization that owns the extension. */
236
+ author_name?: string | undefined;
237
+ /** A Boolean value that determines whether the extension has features that use Bits. Is **true** if the extension has features that use Bits. */
238
+ bits_enabled?: boolean | undefined;
239
+ /** A Boolean value that determines whether a user can install the extension on their channel. Is **true** if a user can install the extension. Typically, this is set to **false** if the extension is currently in testing mode and requires users to be allowlisted (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Access**). */
240
+ can_install?: boolean | undefined;
241
+ /** The location of where the extension's configuration is stored. Possible values: - `hosted`: The Extensions Configuration Service hosts the configuration. - `custom`: The Extension Backend Service (EBS) hosts the configuration. - `none`: The extension doesn't require configuration. */
242
+ configuration_location?: string | undefined;
243
+ /** A longer description of the extension. It appears on the details page. */
244
+ description?: string | undefined;
245
+ /** A URL to the extension's Terms of Service. */
246
+ eula_tos_url?: string | undefined;
247
+ /** A Boolean value that determines whether the extension can communicate with the installed channel's chat. Is **true** if the extension can communicate with the channel's chat room. */
248
+ has_chat_support?: boolean | undefined;
249
+ /** A URL to the default icon that's displayed in the Extensions directory. */
250
+ icon_url?: string | undefined;
251
+ /** A dictionary that contains URLs to different sizes of the default icon. The dictionary's key identifies the icon's size (for example, 24x24), and the dictionary's value contains the URL to the icon. */
252
+ icon_urls?: GetExtensionsResponseDataItemIconUrlsMap | undefined;
253
+ /** The extension's ID. */
254
+ id?: string | undefined;
255
+ /** The extension's name. */
256
+ name?: string | undefined;
257
+ /** A URL to the extension's privacy policy. */
258
+ privacy_policy_url?: string | undefined;
259
+ /** A Boolean value that determines whether the extension wants to explicitly ask viewers to link their Twitch identity. */
260
+ request_identity_link?: boolean | undefined;
261
+ /** A list of URLs to screenshots that are shown in the Extensions marketplace. */
262
+ screenshot_urls?: GetExtensionsResponseDataItemScreenshotUrlsList | undefined;
263
+ /** The extension's state. Possible values: - `Approved` - `Assets Uploaded` - `Deleted` - `Deprecated` - `In Review` - `Pending Action` - `Rejected` - `Released` - `Testing` */
264
+ state?: string | undefined;
265
+ /** Indicates whether the extension can view the user's subscription level on the channel that the extension is installed on. Possible values: - `none`: The extension can't view the user's subscription level. - `optional`: The extension can view the user's subscription level. */
266
+ subscriptions_support_level?: string | undefined;
267
+ /** A short description of the extension that streamers see when hovering over the discovery splash screen in the Extensions manager. */
268
+ summary?: string | undefined;
269
+ /** The email address that users use to get support for the extension. */
270
+ support_email?: string | undefined;
271
+ /** The extension's version number. */
272
+ version?: string | undefined;
273
+ /** A brief description displayed on the channel to explain how the extension works. */
274
+ viewer_summary?: string | undefined;
275
+ /** Describes all views-related information such as how the extension is displayed on mobile devices. The object includes only the views that the extension supports. */
276
+ views?: GetExtensionsResponseDataItemViews | undefined;
277
+ /** Allowlisted configuration URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
278
+ allowlisted_config_urls?: GetExtensionsResponseDataItemAllowlistedConfigUrlsList | undefined;
279
+ /** Allowlisted panel URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
280
+ allowlisted_panel_urls?: GetExtensionsResponseDataItemAllowlistedPanelUrlsList | undefined;
281
+ }
282
+ /** A list that contains the specified extension. */
283
+ export type GetExtensionsResponseDataList = Array<GetExtensionsResponseDataItem>;
284
+ export interface GetExtensionsResponse {
285
+ /** A list that contains the specified extension. */
286
+ data?: GetExtensionsResponseDataList | undefined;
287
+ }
288
+ export interface GetExtensionSecretsRequest {
289
+ /** The ID of the extension whose shared secrets you want to get. */
290
+ extension_id: string;
291
+ }
292
+ export type GetExtensionSecretsResponseDataItemSecretsItem =
293
+ CreateExtensionSecretResponseDataItemSecretsItem;
294
+ /** The list of secrets. */
295
+ export type GetExtensionSecretsResponseDataItemSecretsList =
296
+ Array<CreateExtensionSecretResponseDataItemSecretsItem>;
297
+ export interface GetExtensionSecretsResponseDataItem {
298
+ /** The version number that identifies this definition of the secret's data. */
299
+ format_version?: number | undefined;
300
+ /** The list of secrets. */
301
+ secrets?: GetExtensionSecretsResponseDataItemSecretsList | undefined;
302
+ }
303
+ /** The list of shared secrets that the extension created. */
304
+ export type GetExtensionSecretsResponseDataList = Array<GetExtensionSecretsResponseDataItem>;
305
+ export interface GetExtensionSecretsResponse {
306
+ /** The list of shared secrets that the extension created. */
307
+ data?: GetExtensionSecretsResponseDataList | undefined;
308
+ }
309
+ export interface GetReleasedExtensionsRequest {
310
+ /** The ID of the extension to get. */
311
+ extension_id: string;
312
+ /** The version of the extension to get. If not specified, it returns the released version. */
313
+ extension_version?: string | undefined;
314
+ }
315
+ /** A dictionary that contains URLs to different sizes of the default icon. The dictionary's key identifies the icon's size (for example, 24x24), and the dictionary's value contains the URL to the icon. */
316
+ export type GetReleasedExtensionsResponseDataItemIconUrlsMap = {
317
+ [key: string]: string | undefined;
318
+ };
319
+ /** A list of URLs to screenshots that are shown in the Extensions marketplace. */
320
+ export type GetReleasedExtensionsResponseDataItemScreenshotUrlsList = Array<string>;
321
+ /** Describes how the extension is displayed on mobile devices. */
322
+ export type GetReleasedExtensionsResponseDataItemViewsMobile =
323
+ GetExtensionsResponseDataItemViewsMobile;
324
+ /** Describes how the extension is rendered if the extension may be activated as a panel extension. */
325
+ export type GetReleasedExtensionsResponseDataItemViewsPanel =
326
+ GetExtensionsResponseDataItemViewsPanel;
327
+ /** Describes how the extension is rendered if the extension may be activated as a video-overlay extension. */
328
+ export type GetReleasedExtensionsResponseDataItemViewsVideoOverlay =
329
+ GetExtensionsResponseDataItemViewsVideoOverlay;
330
+ /** Describes how the extension is rendered if the extension may be activated as a video-component extension. */
331
+ export type GetReleasedExtensionsResponseDataItemViewsComponent =
332
+ GetExtensionsResponseDataItemViewsComponent;
333
+ /** Describes the view that is shown to broadcasters while they are configuring your extension within the Extension Manager. */
334
+ export type GetReleasedExtensionsResponseDataItemViewsConfig =
335
+ GetExtensionsResponseDataItemViewsConfig;
336
+ /** Describes the view that is shown to broadcasters in the Live module of the dashboard. */
337
+ export type GetReleasedExtensionsResponseDataItemViewsLiveConfig =
338
+ GetExtensionsResponseDataItemViewsLiveConfig;
339
+ /** Describes all views-related information such as how the extension is displayed on mobile devices. The object includes only the views that the extension supports. */
340
+ export type GetReleasedExtensionsResponseDataItemViews = GetExtensionsResponseDataItemViews;
341
+ /** Allowlisted configuration URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
342
+ export type GetReleasedExtensionsResponseDataItemAllowlistedConfigUrlsList = Array<string>;
343
+ /** Allowlisted panel URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
344
+ export type GetReleasedExtensionsResponseDataItemAllowlistedPanelUrlsList = Array<string>;
345
+ export interface GetReleasedExtensionsResponseDataItem {
346
+ /** The name of the user or organization that owns the extension. */
347
+ author_name?: string | undefined;
348
+ /** A Boolean value that determines whether the extension has features that use Bits. Is **true** if the extension has features that use Bits. */
349
+ bits_enabled?: boolean | undefined;
350
+ /** A Boolean value that determines whether a user can install the extension on their channel. Is **true** if a user can install the extension. Typically, this is set to **false** if the extension is currently in testing mode and requires users to be allowlisted (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Access**). */
351
+ can_install?: boolean | undefined;
352
+ /** The location of where the extension's configuration is stored. Possible values: - `hosted`: The Extensions Configuration Service hosts the configuration. - `custom`: The Extension Backend Service (EBS) hosts the configuration. - `none`: The extension doesn't require configuration. */
353
+ configuration_location?: string | undefined;
354
+ /** A longer description of the extension. It appears on the details page. */
355
+ description?: string | undefined;
356
+ /** A URL to the extension's Terms of Service. */
357
+ eula_tos_url?: string | undefined;
358
+ /** A Boolean value that determines whether the extension can communicate with the installed channel's chat. Is **true** if the extension can communicate with the channel's chat room. */
359
+ has_chat_support?: boolean | undefined;
360
+ /** A URL to the default icon that's displayed in the Extensions directory. */
361
+ icon_url?: string | undefined;
362
+ /** A dictionary that contains URLs to different sizes of the default icon. The dictionary's key identifies the icon's size (for example, 24x24), and the dictionary's value contains the URL to the icon. */
363
+ icon_urls?: GetReleasedExtensionsResponseDataItemIconUrlsMap | undefined;
364
+ /** The extension's ID. */
365
+ id?: string | undefined;
366
+ /** The extension's name. */
367
+ name?: string | undefined;
368
+ /** A URL to the extension's privacy policy. */
369
+ privacy_policy_url?: string | undefined;
370
+ /** A Boolean value that determines whether the extension wants to explicitly ask viewers to link their Twitch identity. */
371
+ request_identity_link?: boolean | undefined;
372
+ /** A list of URLs to screenshots that are shown in the Extensions marketplace. */
373
+ screenshot_urls?: GetReleasedExtensionsResponseDataItemScreenshotUrlsList | undefined;
374
+ /** The extension's state. This endpoint returns only released extensions. Possible values: - `Released` */
375
+ state?: string | undefined;
376
+ /** Indicates whether the extension can view the user's subscription level on the channel that the extension is installed on. Possible values: - `none`: The extension can't view the user's subscription level. - `optional`: The extension can view the user's subscription level. */
377
+ subscriptions_support_level?: string | undefined;
378
+ /** A short description of the extension that streamers see when hovering over the discovery splash screen in the Extensions manager. */
379
+ summary?: string | undefined;
380
+ /** The email address that users use to get support for the extension. */
381
+ support_email?: string | undefined;
382
+ /** The extension's version number. */
383
+ version?: string | undefined;
384
+ /** A brief description displayed on the channel to explain how the extension works. */
385
+ viewer_summary?: string | undefined;
386
+ /** Describes all views-related information such as how the extension is displayed on mobile devices. The object includes only the views that the extension supports. */
387
+ views?: GetExtensionsResponseDataItemViews | undefined;
388
+ /** Allowlisted configuration URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
389
+ allowlisted_config_urls?:
390
+ | GetReleasedExtensionsResponseDataItemAllowlistedConfigUrlsList
391
+ | undefined;
392
+ /** Allowlisted panel URLs for displaying the extension (the allowlist is configured on Twitch's [developer site](https://dev.twitch.tv/console/extensions) under the **Extensions** -> **Extension** -> **Version** -> **Capabilities**). */
393
+ allowlisted_panel_urls?:
394
+ | GetReleasedExtensionsResponseDataItemAllowlistedPanelUrlsList
395
+ | undefined;
396
+ }
397
+ /** A list that contains the specified extension. */
398
+ export type GetReleasedExtensionsResponseDataList = Array<GetReleasedExtensionsResponseDataItem>;
399
+ export interface GetReleasedExtensionsResponse {
400
+ /** A list that contains the specified extension. */
401
+ data?: GetReleasedExtensionsResponseDataList | undefined;
402
+ }
403
+ export interface SendExtensionChatMessageRequest {
404
+ /** The ID of the broadcaster that has activated the extension. */
405
+ broadcaster_id: string;
406
+ /** The message. The message may contain a maximum of 280 characters. */
407
+ text: string;
408
+ /** The ID of the extension that's sending the chat message. */
409
+ extension_id: string;
410
+ /** The extension's version number. */
411
+ extension_version: string;
412
+ }
413
+ export interface SendExtensionChatMessageResponse {}
414
+ /** The target of the message. Possible values: - `broadcast` - `global` - `whisper-<user-id>` */
415
+ export type SendExtensionPubsubMessageRequestTargetList = Array<string>;
416
+ export interface SendExtensionPubsubMessageRequest {
417
+ /** The target of the message. Possible values: - `broadcast` - `global` - `whisper-<user-id>` */
418
+ target: SendExtensionPubsubMessageRequestTargetList;
419
+ /** The ID of the broadcaster to send the message to. This field is required if *is_global_broadcast* is **false**. Don't include this field if *is_global_broadcast* is set to **true**. */
420
+ broadcaster_id?: string | undefined;
421
+ /** A Boolean value that determines whether the message should be sent to all channels where your extension is active. Set to **true** if the message should be sent to all channels. The default is **false**. */
422
+ is_global_broadcast?: boolean | undefined;
423
+ /** The message to send. The message can be a plain-text string or a string-encoded JSON object. The message is limited to a maximum of 5 KB. */
424
+ message: string;
425
+ }
426
+ export interface SendExtensionPubsubMessageResponse {}
427
+ export interface SetExtensionConfigurationSegmentRequest {
428
+ /** The ID of the extension to update. */
429
+ extension_id: string;
430
+ /** The configuration segment to update. Possible values: - `broadcaster` - `developer` - `global` */
431
+ segment: string;
432
+ /** The ID of the broadcaster that installed the extension. Include this field only if the *segment* is set to developer or broadcaster. */
433
+ broadcaster_id?: string | undefined;
434
+ /** The contents of the segment. This string may be a plain-text string or a string-encoded JSON object. */
435
+ content?: string | undefined;
436
+ /** The version number that identifies this definition of the segment's data. If not specified, the segment is saved with an empty version string. */
437
+ version?: string | undefined;
438
+ }
439
+ export interface SetExtensionConfigurationSegmentResponse {}
440
+ export interface SetExtensionRequiredConfigurationRequest {
441
+ /** The ID of the broadcaster that installed the extension on their channel. */
442
+ broadcaster_id: string;
443
+ /** The ID of the extension to update. */
444
+ extension_id: string;
445
+ /** The version of the extension to update. */
446
+ extension_version: string;
447
+ /** The required_configuration string to use with the extension. */
448
+ required_configuration: string;
449
+ }
450
+ export interface SetExtensionRequiredConfigurationResponse {}
451
+ /** An object that contains the product's cost information. */
452
+ export interface UpdateExtensionBitsProductRequestCost {
453
+ /** The product's price. */
454
+ amount: number;
455
+ /** The type of currency. Possible values: - `bits`: The minimum price is 1 and the maximum is 10000. */
456
+ type: string;
457
+ }
458
+ export interface UpdateExtensionBitsProductRequest {
459
+ /** The product's SKU. The SKU must be unique within an extension. The product's SKU cannot be changed. The SKU may contain only alphanumeric characters, dashes (-), underscores (_), and periods (.) and is limited to a maximum of 255 characters. No spaces. */
460
+ sku: string;
461
+ /** An object that contains the product's cost information. */
462
+ cost: UpdateExtensionBitsProductRequestCost;
463
+ /** The product's name as displayed in the extension. The name must be valid UTF-8 and may contain a maximum of 255 bytes. */
464
+ display_name: string;
465
+ /** A Boolean value that indicates whether the product is in development. Set to **true** if the product is in development and not available for public use. The default is **false**. */
466
+ in_development?: boolean | undefined;
467
+ /** The date and time, in RFC3339 format, when the product expires. If not set, the product does not expire. To disable the product, set the expiration date to a date in the past. */
468
+ expiration?: string | undefined;
469
+ /** A Boolean value that determines whether Bits product purchase events are broadcast to all instances of the extension on a channel. The events are broadcast via the 'onTransactionComplete' helper callback. The default is **false**. */
470
+ is_broadcast?: boolean | undefined;
471
+ }
472
+ /** An object that contains the product's cost information. */
473
+ export type UpdateExtensionBitsProductResponseDataItemCost =
474
+ GetExtensionBitsProductsResponseDataItemCost;
475
+ export interface UpdateExtensionBitsProductResponseDataItem {
476
+ /** The product's SKU. The SKU is unique across an extension's products. */
477
+ sku?: string | undefined;
478
+ /** An object that contains the product's cost information. */
479
+ cost?: GetExtensionBitsProductsResponseDataItemCost | undefined;
480
+ /** A Boolean value that indicates whether the product is in development. If **true**, the product is not available for public use. */
481
+ in_development?: boolean | undefined;
482
+ /** The product's name as displayed in the extension. */
483
+ display_name?: string | undefined;
484
+ /** The date and time, in RFC3339 format, when the product expires. Is **null** if the product doesn't expire. */
485
+ expiration?: string | null | undefined;
486
+ /** A Boolean value that determines whether Bits product purchase events are broadcast to all instances of an extension on a channel. The events are broadcast via the 'onTransactionComplete' helper callback. Is **true** if the event is broadcast to all instances. */
487
+ is_broadcast?: boolean | undefined;
488
+ }
489
+ /** A list that contains the product that you added or updated. */
490
+ export type UpdateExtensionBitsProductResponseDataList =
491
+ Array<UpdateExtensionBitsProductResponseDataItem>;
492
+ export interface UpdateExtensionBitsProductResponse {
493
+ /** A list that contains the product that you added or updated. */
494
+ data?: UpdateExtensionBitsProductResponseDataList | undefined;
495
+ }
496
+ export type CreateExtensionSecretError = TwitchOpError;
497
+ /** Create Extension Secret Creates a shared secret used to sign and verify JWT tokens. Creating a new secret removes the current secrets from service. Use this function only when you are ready to use the new secret it returns. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). Set the `role` field to *external* and the `user_id` field to the ID of the user that owns the extension. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#create-extension-secret */
498
+ export const createExtensionSecret: API.OperationMethod<
499
+ CreateExtensionSecretRequest,
500
+ CreateExtensionSecretResponse,
501
+ CreateExtensionSecretError,
502
+ TwitchOpContext
503
+ > = /*@__PURE__*/ API.make(() => ({
504
+ input: __S(0, __c0, 0) as any as S.Schema<CreateExtensionSecretRequest>,
505
+ output: __S(20, __c1, 4) as any as S.Schema<CreateExtensionSecretResponse>,
506
+ errors: [],
507
+ serviceErrors: TwitchServiceErrors,
508
+ protocol: TwitchProtocol,
509
+ retry: Retry.Retry,
510
+ telemetry: TELEMETRY,
511
+ span: "CreateExtensionSecret",
512
+ }));
513
+
514
+ export type GetExtensionBitsProductsError = TwitchOpError;
515
+ /** Get Extension Bits Products Gets the list of Bits products that belongs to the extension. The Client ID in the App Access Token identifies the extension. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). The client ID in the app access token must be the extension's client ID. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#get-extension-bits-products */
516
+ export const getExtensionBitsProducts: API.OperationMethod<
517
+ GetExtensionBitsProductsRequest,
518
+ GetExtensionBitsProductsResponse,
519
+ GetExtensionBitsProductsError,
520
+ TwitchOpContext
521
+ > = /*@__PURE__*/ API.make(() => ({
522
+ input: __S(32, __c2, 0) as any as S.Schema<GetExtensionBitsProductsRequest>,
523
+ output: __S(35, __c2, 3) as any as S.Schema<GetExtensionBitsProductsResponse>,
524
+ errors: [],
525
+ serviceErrors: TwitchServiceErrors,
526
+ protocol: TwitchProtocol,
527
+ retry: Retry.Retry,
528
+ telemetry: TELEMETRY,
529
+ span: "GetExtensionBitsProducts",
530
+ }));
531
+
532
+ export type GetExtensionConfigurationSegmentError = TwitchOpError;
533
+ /** Get Extension Configuration Segment **Rate Limits**: You may make a maximum of 20 requests per minute per combination of extension client ID and broadcaster ID, regardless of which segments you request. Requests that don't specify a broadcaster ID share a single limit per extension client ID. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). The `role` field must be set to *external*. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#get-extension-configuration-segment */
534
+ export const getExtensionConfigurationSegment: API.OperationMethod<
535
+ GetExtensionConfigurationSegmentRequest,
536
+ GetExtensionConfigurationSegmentResponse,
537
+ GetExtensionConfigurationSegmentError,
538
+ TwitchOpContext
539
+ > = /*@__PURE__*/ API.make(() => ({
540
+ input: __S(96, __c6, 0) as any as S.Schema<GetExtensionConfigurationSegmentRequest>,
541
+ output: __S(99, __c6, 3) as any as S.Schema<GetExtensionConfigurationSegmentResponse>,
542
+ errors: [],
543
+ serviceErrors: TwitchServiceErrors,
544
+ protocol: TwitchProtocol,
545
+ retry: Retry.Retry,
546
+ telemetry: TELEMETRY,
547
+ span: "GetExtensionConfigurationSegment",
548
+ }));
549
+
550
+ export type GetExtensionLiveChannelsError = TwitchOpError;
551
+ /** Get Extension Live Channels Gets a list of broadcasters that are streaming live and have installed or activated the extension. It may take a few minutes for the list to include or remove broadcasters that have recently gone live or stopped broadcasting. If the extension requires configuration through the configuration service, the list includes only broadcasters whose broadcaster and developer configuration segments have the required versions. 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/extensions/#get-extension-live-channels */
552
+ export const getExtensionLiveChannels: API.PaginatedOperationMethod<
553
+ GetExtensionLiveChannelsRequest,
554
+ GetExtensionLiveChannelsResponse,
555
+ GetExtensionLiveChannelsError,
556
+ TwitchOpContext,
557
+ GetExtensionLiveChannelsResponseDataItem
558
+ > = /*@__PURE__*/ API.makePaginated(
559
+ () => ({
560
+ input: __S(128, __c8, 0) as any as S.Schema<GetExtensionLiveChannelsRequest>,
561
+ output: __S(131, __c8, 3) as any as S.Schema<GetExtensionLiveChannelsResponse>,
562
+ errors: [],
563
+ serviceErrors: TwitchServiceErrors,
564
+ protocol: TwitchProtocol,
565
+ retry: Retry.Retry,
566
+ telemetry: TELEMETRY,
567
+ span: "GetExtensionLiveChannels",
568
+ pagination: {
569
+ mode: "cursor",
570
+ inputToken: "after",
571
+ outputToken: "pagination",
572
+ items: "data",
573
+ pageSize: "first",
574
+ } as const,
575
+ }),
576
+ paginateCursor,
577
+ ) as any;
578
+
579
+ export type GetExtensionsError = TwitchOpError;
580
+ /** Get Extensions Gets information about an extension. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)), and the `role` field must be set to *external*. To get a version that isn't released, the user in `user_id` must own the extension or be on the version's testing allowlist. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#get-extensions */
581
+ export const getExtensions: API.OperationMethod<
582
+ GetExtensionsRequest,
583
+ GetExtensionsResponse,
584
+ GetExtensionsError,
585
+ TwitchOpContext
586
+ > = /*@__PURE__*/ API.make(() => ({
587
+ input: __S(144, __c9, 0) as any as S.Schema<GetExtensionsRequest>,
588
+ output: __S(168, __c10, 8) as any as S.Schema<GetExtensionsResponse>,
589
+ errors: [],
590
+ serviceErrors: TwitchServiceErrors,
591
+ protocol: TwitchProtocol,
592
+ retry: Retry.Retry,
593
+ telemetry: TELEMETRY,
594
+ span: "GetExtensions",
595
+ }));
596
+
597
+ export type GetExtensionSecretsError = TwitchOpError;
598
+ /** Get Extension Secrets Gets an extension's list of shared secrets. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). Set the `role` field to *external* and the `user_id` field to the ID of the user that owns the extension. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#get-extension-secrets */
599
+ export const getExtensionSecrets: API.OperationMethod<
600
+ GetExtensionSecretsRequest,
601
+ GetExtensionSecretsResponse,
602
+ GetExtensionSecretsError,
603
+ TwitchOpContext
604
+ > = /*@__PURE__*/ API.make(() => ({
605
+ input: __S(176, __c11, 0) as any as S.Schema<GetExtensionSecretsRequest>,
606
+ output: __S(20, __c1, 4) as any as S.Schema<GetExtensionSecretsResponse>,
607
+ errors: [],
608
+ serviceErrors: TwitchServiceErrors,
609
+ protocol: TwitchProtocol,
610
+ retry: Retry.Retry,
611
+ telemetry: TELEMETRY,
612
+ span: "GetExtensionSecrets",
613
+ }));
614
+
615
+ export type GetReleasedExtensionsError = TwitchOpError;
616
+ /** Get Released Extensions Returns the extension if its `state` is Released. 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/extensions/#get-released-extensions */
617
+ export const getReleasedExtensions: API.OperationMethod<
618
+ GetReleasedExtensionsRequest,
619
+ GetReleasedExtensionsResponse,
620
+ GetReleasedExtensionsError,
621
+ TwitchOpContext
622
+ > = /*@__PURE__*/ API.make(() => ({
623
+ input: __S(192, __c12, 0) as any as S.Schema<GetReleasedExtensionsRequest>,
624
+ output: __S(168, __c10, 8) as any as S.Schema<GetReleasedExtensionsResponse>,
625
+ errors: [],
626
+ serviceErrors: TwitchServiceErrors,
627
+ protocol: TwitchProtocol,
628
+ retry: Retry.Retry,
629
+ telemetry: TELEMETRY,
630
+ span: "GetReleasedExtensions",
631
+ }));
632
+
633
+ export type SendExtensionChatMessageError = TwitchOpError;
634
+ /** Send Extension Chat Message Sends a message to the specified broadcaster's chat room. The extension's name is used as the username for the message in the chat room. To send a chat message, your extension must enable **Chat Capabilities** (under your extension's **Capabilities** tab). **Rate Limits**: You may send a maximum of 12 messages per minute per combination of broadcaster ID, extension ID, and extension version. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). The `role` field must be set to *external* or *broadcaster*, and the `user_id` field must contain the ID of the user that owns the extension or the ID in *broadcaster_id*. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#send-extension-chat-message */
635
+ export const sendExtensionChatMessage: API.OperationMethod<
636
+ SendExtensionChatMessageRequest,
637
+ SendExtensionChatMessageResponse,
638
+ SendExtensionChatMessageError,
639
+ TwitchOpContext
640
+ > = /*@__PURE__*/ API.make(() => ({
641
+ input: __S(208, __c13, 0) as any as S.Schema<SendExtensionChatMessageRequest>,
642
+ output: __S(224, __c14, 0) as any as S.Schema<SendExtensionChatMessageResponse>,
643
+ errors: [],
644
+ serviceErrors: TwitchServiceErrors,
645
+ protocol: TwitchProtocol,
646
+ retry: Retry.Retry,
647
+ telemetry: TELEMETRY,
648
+ span: "SendExtensionChatMessage",
649
+ }));
650
+
651
+ export type SendExtensionPubsubMessageError = TwitchOpError;
652
+ /** Send Extension PubSub Message Sends a message to one or more viewers. You can send messages to a specific channel or to all channels where your extension is active. This endpoint uses the same mechanism as the [send](https://dev.twitch.tv/docs/extensions/reference.md#send) JavaScript helper function used to send messages. **Rate Limits**: You may send a maximum of 100 messages per minute per combination of extension client ID and broadcaster ID. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `exp`, `channel_id`, and `pubsub_perms` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). Your EBS should set the `role` field to *external*. To send the message to a specific channel, set the `channel_id` field in the JWT to the channel's ID and set the `pubsub_perms.send` array to *broadcast*. ~~~json { "exp": 1503343947, "user_id": "27419011", "role": "external", "channel_id": "27419011", "pubsub_perms": { "send":[ "broadcast" ] } } ~~~ To send the message to all channels on which your extension is active, set the `channel_id` field to *all* and set the `pubsub_perms.send` array to *global*. ~~~json { "exp": 1503343947, "user_id": "27419011", "role": "external", "channel_id": "all", "pubsub_perms": { "send":[ "global" ] } } ~~~ Reference: https://dev.twitch.tv/docs/api/reference/extensions/#send-extension-pubsub-message */
653
+ export const sendExtensionPubsubMessage: API.OperationMethod<
654
+ SendExtensionPubsubMessageRequest,
655
+ SendExtensionPubsubMessageResponse,
656
+ SendExtensionPubsubMessageError,
657
+ TwitchOpContext
658
+ > = /*@__PURE__*/ API.make(() => ({
659
+ input: __S(240, __c15, 0) as any as S.Schema<SendExtensionPubsubMessageRequest>,
660
+ output: __S(224, __c14, 0) as any as S.Schema<SendExtensionPubsubMessageResponse>,
661
+ errors: [],
662
+ serviceErrors: TwitchServiceErrors,
663
+ protocol: TwitchProtocol,
664
+ retry: Retry.Retry,
665
+ telemetry: TELEMETRY,
666
+ span: "SendExtensionPubsubMessage",
667
+ }));
668
+
669
+ export type SetExtensionConfigurationSegmentError = TwitchOpError;
670
+ /** Set Extension Configuration Segment Updates an Extension configuration segment. The segment is limited to 5 KB. Extensions that are active on a channel do not receive the updated configuration. **Rate Limits**: You may update the configuration a maximum of 20 times per minute. Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an Extension Backend Service (EBS). For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). Set the `role` field to *external* and the `user_id` field to the ID of the user that owns the extension. To update the broadcaster segment, you may instead set `user_id` to the ID in _broadcaster_id_. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#set-extension-configuration-segment */
671
+ export const setExtensionConfigurationSegment: API.OperationMethod<
672
+ SetExtensionConfigurationSegmentRequest,
673
+ SetExtensionConfigurationSegmentResponse,
674
+ SetExtensionConfigurationSegmentError,
675
+ TwitchOpContext
676
+ > = /*@__PURE__*/ API.make(() => ({
677
+ input: __S(256, __c16, 0) as any as S.Schema<SetExtensionConfigurationSegmentRequest>,
678
+ output: __S(224, __c14, 0) as any as S.Schema<SetExtensionConfigurationSegmentResponse>,
679
+ errors: [],
680
+ serviceErrors: TwitchServiceErrors,
681
+ protocol: TwitchProtocol,
682
+ retry: Retry.Retry,
683
+ telemetry: TELEMETRY,
684
+ span: "SetExtensionConfigurationSegment",
685
+ }));
686
+
687
+ export type SetExtensionRequiredConfigurationError = TwitchOpError;
688
+ /** Set Extension Required Configuration Updates the extension's _required_configuration_ string. Use this endpoint if your extension requires the broadcaster to configure the extension before activating it (to require configuration, you must select **Custom/My Own Service** in Extension [Capabilities](https://dev.twitch.tv/docs/extensions/life-cycle.md#capabilities)). For more information, see [Required Configurations](https://dev.twitch.tv/docs/extensions/building.md#required-configurations) and [Setting Required Configuration](https://dev.twitch.tv/docs/extensions/building.md#setting-required-configuration-with-the-configuration-service-optional). Authorization: Requires one of the following: - A [signed JSON Web Token (JWT)](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). Requires a signed JSON Web Token (JWT) created by an EBS. For signing requirements, see [Signing the JWT](https://dev.twitch.tv/docs/extensions/building.md#signing-the-jwt). The signed JWT must include the `role`, `user_id`, and `exp` fields (see [JWT Schema](https://dev.twitch.tv/docs/extensions/reference.md#jwt-schema)). Set the `role` field to *external* and the `user_id` field to the ID of the user that owns the extension. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#set-extension-required-configuration */
689
+ export const setExtensionRequiredConfiguration: API.OperationMethod<
690
+ SetExtensionRequiredConfigurationRequest,
691
+ SetExtensionRequiredConfigurationResponse,
692
+ SetExtensionRequiredConfigurationError,
693
+ TwitchOpContext
694
+ > = /*@__PURE__*/ API.make(() => ({
695
+ input: __S(64, __c4, 0) as any as S.Schema<SetExtensionRequiredConfigurationRequest>,
696
+ output: __S(224, __c14, 0) as any as S.Schema<SetExtensionRequiredConfigurationResponse>,
697
+ errors: [],
698
+ serviceErrors: TwitchServiceErrors,
699
+ protocol: TwitchProtocol,
700
+ retry: Retry.Retry,
701
+ telemetry: TELEMETRY,
702
+ span: "SetExtensionRequiredConfiguration",
703
+ }));
704
+
705
+ export type UpdateExtensionBitsProductError = TwitchOpError;
706
+ /** Update Extension Bits Product Adds or updates a Bits product that the extension created. If the SKU doesn't exist, the product is added. You may update all fields except the *sku* field. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). The client ID in the app access token must match the extension's client ID. Reference: https://dev.twitch.tv/docs/api/reference/extensions/#update-extension-bits-product */
707
+ export const updateExtensionBitsProduct: API.OperationMethod<
708
+ UpdateExtensionBitsProductRequest,
709
+ UpdateExtensionBitsProductResponse,
710
+ UpdateExtensionBitsProductError,
711
+ TwitchOpContext
712
+ > = /*@__PURE__*/ API.make(() => ({
713
+ input: __S(81, __c5, 1) as any as S.Schema<UpdateExtensionBitsProductRequest>,
714
+ output: __S(84, __c5, 4) as any as S.Schema<UpdateExtensionBitsProductResponse>,
715
+ errors: [],
716
+ serviceErrors: TwitchServiceErrors,
717
+ protocol: TwitchProtocol,
718
+ retry: Retry.Retry,
719
+ telemetry: TELEMETRY,
720
+ span: "UpdateExtensionBitsProduct",
721
+ }));
722
+
723
+ // Schema builders: each runs one schema initializer, on that schema's first use.
724
+ function __c0(j: number): any {
725
+ switch (j) {
726
+ case 0:
727
+ return S.suspend(() =>
728
+ S.Struct({
729
+ extension_id: S.String.pipe(T.Query()),
730
+ delay: S.optional(S.Number.pipe(T.Query())),
731
+ }).pipe(T.Http({ method: "POST", uri: "/extensions/jwt/secrets", code: 200 })),
732
+ ).annotate({ identifier: "CreateExtensionSecretRequest" });
733
+ }
734
+ }
735
+ function __c1(j: number): any {
736
+ switch (j) {
737
+ case 0:
738
+ return S.suspend(() =>
739
+ S.Struct({
740
+ content: S.optional(S.String),
741
+ active_at: S.optional(S.String),
742
+ expires_at: S.optional(S.String),
743
+ }),
744
+ ).annotate({ identifier: "CreateExtensionSecretResponseDataItemSecretsItem" });
745
+ case 1:
746
+ return S.Array(__S(16, __c1, 0));
747
+ case 2:
748
+ return S.suspend(() =>
749
+ S.Struct({
750
+ format_version: S.optional(S.Number),
751
+ secrets: S.optional(__S(17, __c1, 1)),
752
+ }),
753
+ ).annotate({ identifier: "CreateExtensionSecretResponseDataItem" });
754
+ case 3:
755
+ return S.Array(__S(18, __c1, 2));
756
+ case 4:
757
+ return S.suspend(() =>
758
+ S.Struct({
759
+ data: S.optional(__S(19, __c1, 3)),
760
+ }),
761
+ ).annotate({ identifier: "CreateExtensionSecretResponse" });
762
+ }
763
+ }
764
+ function __c2(j: number): any {
765
+ switch (j) {
766
+ case 0:
767
+ return S.suspend(() =>
768
+ S.Struct({
769
+ should_include_all: S.optional(S.Boolean.pipe(T.Query())),
770
+ }).pipe(T.Http({ method: "GET", uri: "/bits/extensions", code: 200 })),
771
+ ).annotate({ identifier: "GetExtensionBitsProductsRequest" });
772
+ case 1:
773
+ return S.suspend(() =>
774
+ S.Struct({
775
+ sku: S.optional(S.String),
776
+ cost: S.optional(S.NullOr(__S(48, __c3, 0))),
777
+ in_development: S.optional(S.Boolean),
778
+ display_name: S.optional(S.String),
779
+ expiration: S.optional(S.NullOr(S.String)),
780
+ is_broadcast: S.optional(S.Boolean),
781
+ }),
782
+ ).annotate({ identifier: "GetExtensionBitsProductsResponseDataItem" });
783
+ case 2:
784
+ return S.Array(__S(33, __c2, 1));
785
+ case 3:
786
+ return S.suspend(() =>
787
+ S.Struct({
788
+ data: S.optional(__S(34, __c2, 2)),
789
+ }),
790
+ ).annotate({ identifier: "GetExtensionBitsProductsResponse" });
791
+ }
792
+ }
793
+ function __c3(j: number): any {
794
+ switch (j) {
795
+ case 0:
796
+ return S.suspend(() =>
797
+ S.Struct({
798
+ amount: S.optional(S.Number),
799
+ type: S.optional(S.String),
800
+ }),
801
+ ).annotate({ identifier: "GetExtensionBitsProductsResponseDataItemCost" });
802
+ }
803
+ }
804
+ function __c4(j: number): any {
805
+ switch (j) {
806
+ case 0:
807
+ return S.suspend(() =>
808
+ S.Struct({
809
+ broadcaster_id: S.String.pipe(T.Query()),
810
+ extension_id: S.String,
811
+ extension_version: S.String,
812
+ required_configuration: S.String,
813
+ }).pipe(T.Http({ method: "PUT", uri: "/extensions/required_configuration", code: 200 })),
814
+ ).annotate({ identifier: "SetExtensionRequiredConfigurationRequest" });
815
+ }
816
+ }
817
+ function __c5(j: number): any {
818
+ switch (j) {
819
+ case 0:
820
+ return S.suspend(() =>
821
+ S.Struct({
822
+ amount: S.Number,
823
+ type: S.String,
824
+ }),
825
+ ).annotate({ identifier: "UpdateExtensionBitsProductRequestCost" });
826
+ case 1:
827
+ return S.suspend(() =>
828
+ S.Struct({
829
+ sku: S.String,
830
+ cost: __S(80, __c5, 0),
831
+ display_name: S.String,
832
+ in_development: S.optional(S.Boolean),
833
+ expiration: S.optional(S.String),
834
+ is_broadcast: S.optional(S.Boolean),
835
+ }).pipe(T.Http({ method: "PUT", uri: "/bits/extensions", code: 200 })),
836
+ ).annotate({ identifier: "UpdateExtensionBitsProductRequest" });
837
+ case 2:
838
+ return S.suspend(() =>
839
+ S.Struct({
840
+ sku: S.optional(S.String),
841
+ cost: S.optional(__S(48, __c3, 0)),
842
+ in_development: S.optional(S.Boolean),
843
+ display_name: S.optional(S.String),
844
+ expiration: S.optional(S.NullOr(S.String)),
845
+ is_broadcast: S.optional(S.Boolean),
846
+ }),
847
+ ).annotate({ identifier: "UpdateExtensionBitsProductResponseDataItem" });
848
+ case 3:
849
+ return S.Array(__S(82, __c5, 2));
850
+ case 4:
851
+ return S.suspend(() =>
852
+ S.Struct({
853
+ data: S.optional(__S(83, __c5, 3)),
854
+ }),
855
+ ).annotate({ identifier: "UpdateExtensionBitsProductResponse" });
856
+ }
857
+ }
858
+ function __c6(j: number): any {
859
+ switch (j) {
860
+ case 0:
861
+ return S.suspend(() =>
862
+ S.Struct({
863
+ broadcaster_id: S.optional(S.String.pipe(T.Query())),
864
+ extension_id: S.String.pipe(T.Query()),
865
+ segment: S.optional(__S(112, __c7, 0).pipe(T.Query())),
866
+ }).pipe(T.Http({ method: "GET", uri: "/extensions/configurations", code: 200 })),
867
+ ).annotate({ identifier: "GetExtensionConfigurationSegmentRequest" });
868
+ case 1:
869
+ return S.suspend(() =>
870
+ S.Struct({
871
+ segment: S.optional(S.String),
872
+ broadcaster_id: S.optional(S.String),
873
+ content: S.optional(S.String),
874
+ version: S.optional(S.String),
875
+ }),
876
+ ).annotate({ identifier: "GetExtensionConfigurationSegmentResponseDataItem" });
877
+ case 2:
878
+ return S.Array(__S(97, __c6, 1));
879
+ case 3:
880
+ return S.suspend(() =>
881
+ S.Struct({
882
+ data: S.optional(__S(98, __c6, 2)),
883
+ }),
884
+ ).annotate({ identifier: "GetExtensionConfigurationSegmentResponse" });
885
+ }
886
+ }
887
+ function __c7(j: number): any {
888
+ switch (j) {
889
+ case 0:
890
+ return S.Array(S.String);
891
+ }
892
+ }
893
+ function __c8(j: number): any {
894
+ switch (j) {
895
+ case 0:
896
+ return S.suspend(() =>
897
+ S.Struct({
898
+ extension_id: S.String.pipe(T.Query()),
899
+ first: S.optional(S.Number.pipe(T.Query())),
900
+ after: S.optional(S.String.pipe(T.Query())),
901
+ }).pipe(T.Http({ method: "GET", uri: "/extensions/live", code: 200 })),
902
+ ).annotate({ identifier: "GetExtensionLiveChannelsRequest" });
903
+ case 1:
904
+ return S.suspend(() =>
905
+ S.Struct({
906
+ broadcaster_id: S.optional(S.String),
907
+ broadcaster_name: S.optional(S.String),
908
+ game_name: S.optional(S.String),
909
+ game_id: S.optional(S.String),
910
+ title: S.optional(S.String),
911
+ }),
912
+ ).annotate({ identifier: "GetExtensionLiveChannelsResponseDataItem" });
913
+ case 2:
914
+ return S.Array(__S(129, __c8, 1));
915
+ case 3:
916
+ return S.suspend(() =>
917
+ S.Struct({
918
+ data: __S(130, __c8, 2),
919
+ pagination: S.optional(S.String),
920
+ }),
921
+ ).annotate({ identifier: "GetExtensionLiveChannelsResponse" });
922
+ }
923
+ }
924
+ function __c9(j: number): any {
925
+ switch (j) {
926
+ case 0:
927
+ return S.suspend(() =>
928
+ S.Struct({
929
+ extension_id: S.String.pipe(T.Query()),
930
+ extension_version: S.optional(S.String.pipe(T.Query())),
931
+ }).pipe(T.Http({ method: "GET", uri: "/extensions", code: 200 })),
932
+ ).annotate({ identifier: "GetExtensionsRequest" });
933
+ }
934
+ }
935
+ function __c10(j: number): any {
936
+ switch (j) {
937
+ case 0:
938
+ return S.Record(S.String, S.String);
939
+ case 1:
940
+ return S.suspend(() =>
941
+ S.Struct({
942
+ viewer_url: S.optional(S.String),
943
+ }),
944
+ ).annotate({ identifier: "GetExtensionsResponseDataItemViewsMobile" });
945
+ case 2:
946
+ return S.suspend(() =>
947
+ S.Struct({
948
+ viewer_url: S.optional(S.String),
949
+ height: S.optional(S.Number),
950
+ can_link_external_content: S.optional(S.Boolean),
951
+ }),
952
+ ).annotate({ identifier: "GetExtensionsResponseDataItemViewsPanel" });
953
+ case 3:
954
+ return S.suspend(() =>
955
+ S.Struct({
956
+ viewer_url: S.optional(S.String),
957
+ can_link_external_content: S.optional(S.Boolean),
958
+ }),
959
+ ).annotate({ identifier: "GetExtensionsResponseDataItemViewsVideoOverlay" });
960
+ case 4:
961
+ return S.suspend(() =>
962
+ S.Struct({
963
+ viewer_url: S.optional(S.String),
964
+ aspect_width: S.optional(S.Number),
965
+ aspect_height: S.optional(S.Number),
966
+ aspect_ratio_x: S.optional(S.Number),
967
+ aspect_ratio_y: S.optional(S.Number),
968
+ autoscale: S.optional(S.Boolean),
969
+ scale_pixels: S.optional(S.Number),
970
+ target_height: S.optional(S.Number),
971
+ size: S.optional(S.Number),
972
+ zoom: S.optional(S.Boolean),
973
+ zoom_pixels: S.optional(S.Number),
974
+ can_link_external_content: S.optional(S.Boolean),
975
+ }),
976
+ ).annotate({ identifier: "GetExtensionsResponseDataItemViewsComponent" });
977
+ case 5:
978
+ return S.suspend(() =>
979
+ S.Struct({
980
+ mobile: S.optional(__S(161, __c10, 1)),
981
+ panel: S.optional(__S(162, __c10, 2)),
982
+ video_overlay: S.optional(__S(163, __c10, 3)),
983
+ component: S.optional(__S(164, __c10, 4)),
984
+ config: S.optional(__S(163, __c10, 3)),
985
+ live_config: S.optional(__S(163, __c10, 3)),
986
+ }),
987
+ ).annotate({ identifier: "GetExtensionsResponseDataItemViews" });
988
+ case 6:
989
+ return S.suspend(() =>
990
+ S.Struct({
991
+ author_name: S.optional(S.String),
992
+ bits_enabled: S.optional(S.Boolean),
993
+ can_install: S.optional(S.Boolean),
994
+ configuration_location: S.optional(S.String),
995
+ description: S.optional(S.String),
996
+ eula_tos_url: S.optional(S.String),
997
+ has_chat_support: S.optional(S.Boolean),
998
+ icon_url: S.optional(S.String),
999
+ icon_urls: S.optional(__S(160, __c10, 0)),
1000
+ id: S.optional(S.String),
1001
+ name: S.optional(S.String),
1002
+ privacy_policy_url: S.optional(S.String),
1003
+ request_identity_link: S.optional(S.Boolean),
1004
+ screenshot_urls: S.optional(__S(112, __c7, 0)),
1005
+ state: S.optional(S.String),
1006
+ subscriptions_support_level: S.optional(S.String),
1007
+ summary: S.optional(S.String),
1008
+ support_email: S.optional(S.String),
1009
+ version: S.optional(S.String),
1010
+ viewer_summary: S.optional(S.String),
1011
+ views: S.optional(__S(165, __c10, 5)),
1012
+ allowlisted_config_urls: S.optional(__S(112, __c7, 0)),
1013
+ allowlisted_panel_urls: S.optional(__S(112, __c7, 0)),
1014
+ }),
1015
+ ).annotate({ identifier: "GetExtensionsResponseDataItem" });
1016
+ case 7:
1017
+ return S.Array(__S(166, __c10, 6));
1018
+ case 8:
1019
+ return S.suspend(() =>
1020
+ S.Struct({
1021
+ data: S.optional(__S(167, __c10, 7)),
1022
+ }),
1023
+ ).annotate({ identifier: "GetExtensionsResponse" });
1024
+ }
1025
+ }
1026
+ function __c11(j: number): any {
1027
+ switch (j) {
1028
+ case 0:
1029
+ return S.suspend(() =>
1030
+ S.Struct({
1031
+ extension_id: S.String.pipe(T.Query()),
1032
+ }).pipe(T.Http({ method: "GET", uri: "/extensions/jwt/secrets", code: 200 })),
1033
+ ).annotate({ identifier: "GetExtensionSecretsRequest" });
1034
+ }
1035
+ }
1036
+ function __c12(j: number): any {
1037
+ switch (j) {
1038
+ case 0:
1039
+ return S.suspend(() =>
1040
+ S.Struct({
1041
+ extension_id: S.String.pipe(T.Query()),
1042
+ extension_version: S.optional(S.String.pipe(T.Query())),
1043
+ }).pipe(T.Http({ method: "GET", uri: "/extensions/released", code: 200 })),
1044
+ ).annotate({ identifier: "GetReleasedExtensionsRequest" });
1045
+ }
1046
+ }
1047
+ function __c13(j: number): any {
1048
+ switch (j) {
1049
+ case 0:
1050
+ return S.suspend(() =>
1051
+ S.Struct({
1052
+ broadcaster_id: S.String.pipe(T.Query()),
1053
+ text: S.String,
1054
+ extension_id: S.String,
1055
+ extension_version: S.String,
1056
+ }).pipe(T.Http({ method: "POST", uri: "/extensions/chat", code: 200 })),
1057
+ ).annotate({ identifier: "SendExtensionChatMessageRequest" });
1058
+ }
1059
+ }
1060
+ function __c14(j: number): any {
1061
+ switch (j) {
1062
+ case 0:
1063
+ return S.suspend(() => S.Struct({})).annotate({
1064
+ identifier: "SendExtensionChatMessageResponse",
1065
+ });
1066
+ }
1067
+ }
1068
+ function __c15(j: number): any {
1069
+ switch (j) {
1070
+ case 0:
1071
+ return S.suspend(() =>
1072
+ S.Struct({
1073
+ target: __S(112, __c7, 0),
1074
+ broadcaster_id: S.optional(S.String),
1075
+ is_global_broadcast: S.optional(S.Boolean),
1076
+ message: S.String,
1077
+ }).pipe(T.Http({ method: "POST", uri: "/extensions/pubsub", code: 200 })),
1078
+ ).annotate({ identifier: "SendExtensionPubsubMessageRequest" });
1079
+ }
1080
+ }
1081
+ function __c16(j: number): any {
1082
+ switch (j) {
1083
+ case 0:
1084
+ return S.suspend(() =>
1085
+ S.Struct({
1086
+ extension_id: S.String,
1087
+ segment: S.String,
1088
+ broadcaster_id: S.optional(S.String),
1089
+ content: S.optional(S.String),
1090
+ version: S.optional(S.String),
1091
+ }).pipe(T.Http({ method: "PUT", uri: "/extensions/configurations", code: 200 })),
1092
+ ).annotate({ identifier: "SetExtensionConfigurationSegmentRequest" });
1093
+ }
1094
+ }
1095
+ // Schema table: entry i is schema j of builder f, made on first reach.
1096
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
1097
+ return (__s[i] ??= __L.at(f, j));
1098
+ }