@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,250 @@
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: "Charity",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface GetCharityCampaignRequest {
28
+ /** The ID of the broadcaster that's currently running a charity campaign. This ID must match the user ID in the access token. */
29
+ broadcaster_id: string;
30
+ }
31
+ /** The current amount of donations that the campaign has received. */
32
+ export interface GetCharityCampaignResponseDataItemCurrentAmount {
33
+ /** The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, `value` is set to 550. */
34
+ value?: number | undefined;
35
+ /** The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate `value` from minor units to major units by using the formula: 'value / 10^decimal_places' */
36
+ decimal_places?: number | undefined;
37
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in `value`. */
38
+ currency?: string | undefined;
39
+ }
40
+ /** The campaign's fundraising goal. If the broadcaster has not defined a fundraising goal, `value` is 0. */
41
+ export type GetCharityCampaignResponseDataItemTargetAmount =
42
+ GetCharityCampaignResponseDataItemCurrentAmount;
43
+ export interface GetCharityCampaignResponseDataItem {
44
+ /** An ID that identifies the charity campaign. */
45
+ id?: string | undefined;
46
+ /** An ID that identifies the broadcaster that's running the campaign. */
47
+ broadcaster_id?: string | undefined;
48
+ /** The broadcaster's login name. */
49
+ broadcaster_login?: string | undefined;
50
+ /** The broadcaster's display name. */
51
+ broadcaster_name?: string | undefined;
52
+ /** The charity's name. */
53
+ charity_name?: string | undefined;
54
+ /** A description of the charity. */
55
+ charity_description?: string | undefined;
56
+ /** A URL to an image of the charity's logo. The image is typically a PNG that's 100px X 100px. If larger, it is recommended to squash the image and present as a square size. */
57
+ charity_logo?: string | undefined;
58
+ /** A URL to the charity's website. */
59
+ charity_website?: string | undefined;
60
+ /** The current amount of donations that the campaign has received. */
61
+ current_amount?: GetCharityCampaignResponseDataItemCurrentAmount | undefined;
62
+ /** The campaign's fundraising goal. If the broadcaster has not defined a fundraising goal, `value` is 0. */
63
+ target_amount?: GetCharityCampaignResponseDataItemCurrentAmount | undefined;
64
+ }
65
+ /** A list that contains the charity campaign that the broadcaster is currently running. The list is empty if the broadcaster is not running a charity campaign; the campaign information is not available after the campaign ends. */
66
+ export type GetCharityCampaignResponseDataList = Array<GetCharityCampaignResponseDataItem>;
67
+ export interface GetCharityCampaignResponse {
68
+ /** A list that contains the charity campaign that the broadcaster is currently running. The list is empty if the broadcaster is not running a charity campaign; the campaign information is not available after the campaign ends. */
69
+ data?: GetCharityCampaignResponseDataList | undefined;
70
+ }
71
+ export interface GetCharityCampaignDonationsRequest {
72
+ /** The ID of the broadcaster that's currently running a charity campaign. This ID must match the user ID in the access token. */
73
+ broadcaster_id: string;
74
+ /** The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20. */
75
+ first?: number | undefined;
76
+ /** 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) */
77
+ after?: string | undefined;
78
+ }
79
+ /** An object that contains the amount of money that the user donated. */
80
+ export interface GetCharityCampaignDonationsResponseDataItemAmount {
81
+ /** The monetary amount. The amount is specified in the currency's minor unit. For example, the minor units for USD is cents, so if the amount is $5.50 USD, `value` is set to 550. */
82
+ value?: number | undefined;
83
+ /** The number of decimal places used by the currency. For example, USD uses two decimal places. Use this number to translate `value` from minor units to major units by using the formula: `value / 10^decimal_places` */
84
+ decimal_places?: number | undefined;
85
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in `value`. */
86
+ currency?: string | undefined;
87
+ }
88
+ export interface GetCharityCampaignDonationsResponseDataItem {
89
+ /** An ID that identifies the donation. The ID is unique across campaigns. */
90
+ id?: string | undefined;
91
+ /** An ID that identifies the charity campaign that the donation applies to. */
92
+ campaign_id?: string | undefined;
93
+ /** An ID that identifies a user that donated money to the campaign. */
94
+ user_id?: string | undefined;
95
+ /** The user's login name. */
96
+ user_login?: string | undefined;
97
+ /** The user's display name. */
98
+ user_name?: string | undefined;
99
+ /** An object that contains the amount of money that the user donated. */
100
+ amount?: GetCharityCampaignDonationsResponseDataItemAmount | undefined;
101
+ }
102
+ /** A list that contains the donations that users have made to the broadcaster's charity campaign. The list is empty if the broadcaster is not currently running a charity campaign; the donation information is not available after the campaign ends. */
103
+ export type GetCharityCampaignDonationsResponseDataList =
104
+ Array<GetCharityCampaignDonationsResponseDataItem>;
105
+ /** An object that contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
106
+ export interface GetCharityCampaignDonationsResponsePagination {
107
+ /** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
108
+ cursor?: string | undefined;
109
+ }
110
+ export interface GetCharityCampaignDonationsResponse {
111
+ /** A list that contains the donations that users have made to the broadcaster's charity campaign. The list is empty if the broadcaster is not currently running a charity campaign; the donation information is not available after the campaign ends. */
112
+ data: GetCharityCampaignDonationsResponseDataList;
113
+ /** An object that contains the information used to page through the list of results. The object is empty if there are no more pages left to page through. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
114
+ pagination?: GetCharityCampaignDonationsResponsePagination | undefined;
115
+ }
116
+ export type GetCharityCampaignError = TwitchOpError;
117
+ /** Get Charity Campaign Gets information about the charity campaign that a broadcaster is running. For example, the campaign's fundraising goal and the current amount of donations. To receive events when progress is made towards the campaign's goal or the broadcaster changes the fundraising goal, subscribe to the [channel.charity_campaign.progress](https://dev.twitch.tv/docs/eventsub/reference/charity.md#channel-charity-campaign-progress) subscription type. 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:charity** scope. Reference: https://dev.twitch.tv/docs/api/reference/charity/#get-charity-campaign */
118
+ export const getCharityCampaign: API.OperationMethod<
119
+ GetCharityCampaignRequest,
120
+ GetCharityCampaignResponse,
121
+ GetCharityCampaignError,
122
+ TwitchOpContext
123
+ > = /*@__PURE__*/ API.make(() => ({
124
+ input: __S(0, __c0, 0) as any as S.Schema<GetCharityCampaignRequest>,
125
+ output: __S(3, __c0, 3) as any as S.Schema<GetCharityCampaignResponse>,
126
+ errors: [],
127
+ serviceErrors: TwitchServiceErrors,
128
+ protocol: TwitchProtocol,
129
+ retry: Retry.Retry,
130
+ telemetry: TELEMETRY,
131
+ span: "GetCharityCampaign",
132
+ }));
133
+
134
+ export type GetCharityCampaignDonationsError = TwitchOpError;
135
+ /** Get Charity Campaign Donations Gets the list of donations that users have made to the broadcaster's active charity campaign. To receive events as donations occur, subscribe to the [channel.charity_campaign.donate](https://dev.twitch.tv/docs/eventsub/reference/charity.md#channel-charity-campaign-donate) subscription type. 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:charity** scope. Reference: https://dev.twitch.tv/docs/api/reference/charity/#get-charity-campaign-donations */
136
+ export const getCharityCampaignDonations: API.PaginatedOperationMethod<
137
+ GetCharityCampaignDonationsRequest,
138
+ GetCharityCampaignDonationsResponse,
139
+ GetCharityCampaignDonationsError,
140
+ TwitchOpContext,
141
+ GetCharityCampaignDonationsResponseDataItem
142
+ > = /*@__PURE__*/ API.makePaginated(
143
+ () => ({
144
+ input: __S(16, __c2, 0) as any as S.Schema<GetCharityCampaignDonationsRequest>,
145
+ output: __S(20, __c2, 4) as any as S.Schema<GetCharityCampaignDonationsResponse>,
146
+ errors: [],
147
+ serviceErrors: TwitchServiceErrors,
148
+ protocol: TwitchProtocol,
149
+ retry: Retry.Retry,
150
+ telemetry: TELEMETRY,
151
+ span: "GetCharityCampaignDonations",
152
+ pagination: {
153
+ mode: "cursor",
154
+ inputToken: "after",
155
+ outputToken: "pagination.cursor",
156
+ items: "data",
157
+ pageSize: "first",
158
+ } as const,
159
+ }),
160
+ paginateCursor,
161
+ ) as any;
162
+
163
+ // Schema builders: each runs one schema initializer, on that schema's first use.
164
+ function __c0(j: number): any {
165
+ switch (j) {
166
+ case 0:
167
+ return S.suspend(() =>
168
+ S.Struct({
169
+ broadcaster_id: S.String.pipe(T.Query()),
170
+ }).pipe(T.Http({ method: "GET", uri: "/charity/campaigns", code: 200 })),
171
+ ).annotate({ identifier: "GetCharityCampaignRequest" });
172
+ case 1:
173
+ return S.suspend(() =>
174
+ S.Struct({
175
+ id: S.optional(S.String),
176
+ broadcaster_id: S.optional(S.String),
177
+ broadcaster_login: S.optional(S.String),
178
+ broadcaster_name: S.optional(S.String),
179
+ charity_name: S.optional(S.String),
180
+ charity_description: S.optional(S.String),
181
+ charity_logo: S.optional(S.String),
182
+ charity_website: S.optional(S.String),
183
+ current_amount: S.optional(__S(8, __c1, 0)),
184
+ target_amount: S.optional(__S(8, __c1, 0)),
185
+ }),
186
+ ).annotate({ identifier: "GetCharityCampaignResponseDataItem" });
187
+ case 2:
188
+ return S.Array(__S(1, __c0, 1));
189
+ case 3:
190
+ return S.suspend(() =>
191
+ S.Struct({
192
+ data: S.optional(__S(2, __c0, 2)),
193
+ }),
194
+ ).annotate({ identifier: "GetCharityCampaignResponse" });
195
+ }
196
+ }
197
+ function __c1(j: number): any {
198
+ switch (j) {
199
+ case 0:
200
+ return S.suspend(() =>
201
+ S.Struct({
202
+ value: S.optional(S.Number),
203
+ decimal_places: S.optional(S.Number),
204
+ currency: S.optional(S.String),
205
+ }),
206
+ ).annotate({ identifier: "GetCharityCampaignResponseDataItemCurrentAmount" });
207
+ }
208
+ }
209
+ function __c2(j: number): any {
210
+ switch (j) {
211
+ case 0:
212
+ return S.suspend(() =>
213
+ S.Struct({
214
+ broadcaster_id: S.String.pipe(T.Query()),
215
+ first: S.optional(S.Number.pipe(T.Query())),
216
+ after: S.optional(S.String.pipe(T.Query())),
217
+ }).pipe(T.Http({ method: "GET", uri: "/charity/donations", code: 200 })),
218
+ ).annotate({ identifier: "GetCharityCampaignDonationsRequest" });
219
+ case 1:
220
+ return S.suspend(() =>
221
+ S.Struct({
222
+ id: S.optional(S.String),
223
+ campaign_id: S.optional(S.String),
224
+ user_id: S.optional(S.String),
225
+ user_login: S.optional(S.String),
226
+ user_name: S.optional(S.String),
227
+ amount: S.optional(__S(8, __c1, 0)),
228
+ }),
229
+ ).annotate({ identifier: "GetCharityCampaignDonationsResponseDataItem" });
230
+ case 2:
231
+ return S.Array(__S(17, __c2, 1));
232
+ case 3:
233
+ return S.suspend(() =>
234
+ S.Struct({
235
+ cursor: S.optional(S.String),
236
+ }),
237
+ ).annotate({ identifier: "GetCharityCampaignDonationsResponsePagination" });
238
+ case 4:
239
+ return S.suspend(() =>
240
+ S.Struct({
241
+ data: __S(18, __c2, 2),
242
+ pagination: S.optional(__S(19, __c2, 3)),
243
+ }),
244
+ ).annotate({ identifier: "GetCharityCampaignDonationsResponse" });
245
+ }
246
+ }
247
+ // Schema table: entry i is schema j of builder f, made on first reach.
248
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
249
+ return (__s[i] ??= __L.at(f, j));
250
+ }