@distilled.cloud/twitch 0.0.0 → 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 +79 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +31 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +49 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +46 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +50 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/ads.d.ts +75 -0
  26. package/lib/services/ads.d.ts.map +1 -0
  27. package/lib/services/ads.js +2 -0
  28. package/lib/services/ads.js.map +1 -0
  29. package/lib/services/analytics.d.ts +90 -0
  30. package/lib/services/analytics.d.ts.map +1 -0
  31. package/lib/services/analytics.js +2 -0
  32. package/lib/services/analytics.js.map +1 -0
  33. package/lib/services/bits.d.ts +284 -0
  34. package/lib/services/bits.d.ts.map +1 -0
  35. package/lib/services/bits.js +2 -0
  36. package/lib/services/bits.js.map +1 -0
  37. package/lib/services/ccls.d.ts +26 -0
  38. package/lib/services/ccls.d.ts.map +1 -0
  39. package/lib/services/ccls.js +2 -0
  40. package/lib/services/ccls.js.map +1 -0
  41. package/lib/services/channel_points.d.ts +416 -0
  42. package/lib/services/channel_points.d.ts.map +1 -0
  43. package/lib/services/channel_points.js +2 -0
  44. package/lib/services/channel_points.js.map +1 -0
  45. package/lib/services/channels.d.ts +173 -0
  46. package/lib/services/channels.d.ts.map +1 -0
  47. package/lib/services/channels.js +2 -0
  48. package/lib/services/channels.js.map +1 -0
  49. package/lib/services/charity.d.ts +97 -0
  50. package/lib/services/charity.d.ts.map +1 -0
  51. package/lib/services/charity.js +2 -0
  52. package/lib/services/charity.js.map +1 -0
  53. package/lib/services/chat.d.ts +638 -0
  54. package/lib/services/chat.d.ts.map +1 -0
  55. package/lib/services/chat.js +33 -0
  56. package/lib/services/chat.js.map +1 -0
  57. package/lib/services/clips.d.ts +153 -0
  58. package/lib/services/clips.d.ts.map +1 -0
  59. package/lib/services/clips.js +2 -0
  60. package/lib/services/clips.js.map +1 -0
  61. package/lib/services/conduits.d.ts +172 -0
  62. package/lib/services/conduits.d.ts.map +1 -0
  63. package/lib/services/conduits.js +2 -0
  64. package/lib/services/conduits.js.map +1 -0
  65. package/lib/services/entitlements.d.ts +76 -0
  66. package/lib/services/entitlements.d.ts.map +1 -0
  67. package/lib/services/entitlements.js +2 -0
  68. package/lib/services/entitlements.js.map +1 -0
  69. package/lib/services/eventsub.d.ts +158 -0
  70. package/lib/services/eventsub.d.ts.map +1 -0
  71. package/lib/services/eventsub.js +2 -0
  72. package/lib/services/eventsub.js.map +1 -0
  73. package/lib/services/extensions.d.ts +497 -0
  74. package/lib/services/extensions.d.ts.map +1 -0
  75. package/lib/services/extensions.js +2 -0
  76. package/lib/services/extensions.js.map +1 -0
  77. package/lib/services/games.d.ts +57 -0
  78. package/lib/services/games.d.ts.map +1 -0
  79. package/lib/services/games.js +2 -0
  80. package/lib/services/games.js.map +1 -0
  81. package/lib/services/goals.d.ts +37 -0
  82. package/lib/services/goals.d.ts.map +1 -0
  83. package/lib/services/goals.js +2 -0
  84. package/lib/services/goals.js.map +1 -0
  85. package/lib/services/guest_star.d.ts +314 -0
  86. package/lib/services/guest_star.d.ts.map +1 -0
  87. package/lib/services/guest_star.js +2 -0
  88. package/lib/services/guest_star.js.map +1 -0
  89. package/lib/services/hype_train.d.ts +91 -0
  90. package/lib/services/hype_train.d.ts.map +1 -0
  91. package/lib/services/hype_train.js +2 -0
  92. package/lib/services/hype_train.js.map +1 -0
  93. package/lib/services/index.d.ts +30 -0
  94. package/lib/services/index.d.ts.map +1 -0
  95. package/lib/services/index.js +29 -0
  96. package/lib/services/moderation.d.ts +731 -0
  97. package/lib/services/moderation.d.ts.map +1 -0
  98. package/lib/services/moderation.js +41 -0
  99. package/lib/services/moderation.js.map +1 -0
  100. package/lib/services/polls.d.ts +173 -0
  101. package/lib/services/polls.d.ts.map +1 -0
  102. package/lib/services/polls.js +2 -0
  103. package/lib/services/polls.js.map +1 -0
  104. package/lib/services/predictions.d.ts +221 -0
  105. package/lib/services/predictions.d.ts.map +1 -0
  106. package/lib/services/predictions.js +2 -0
  107. package/lib/services/predictions.js.map +1 -0
  108. package/lib/services/raids.d.ts +34 -0
  109. package/lib/services/raids.d.ts.map +1 -0
  110. package/lib/services/raids.js +2 -0
  111. package/lib/services/raids.js.map +1 -0
  112. package/lib/services/schedule.d.ts +223 -0
  113. package/lib/services/schedule.d.ts.map +1 -0
  114. package/lib/services/schedule.js +2 -0
  115. package/lib/services/schedule.js.map +1 -0
  116. package/lib/services/search.d.ts +89 -0
  117. package/lib/services/search.d.ts.map +1 -0
  118. package/lib/services/search.js +2 -0
  119. package/lib/services/search.js.map +1 -0
  120. package/lib/services/streams.d.ts +235 -0
  121. package/lib/services/streams.d.ts.map +1 -0
  122. package/lib/services/streams.js +2 -0
  123. package/lib/services/streams.js.map +1 -0
  124. package/lib/services/subscriptions.d.ts +96 -0
  125. package/lib/services/subscriptions.d.ts.map +1 -0
  126. package/lib/services/subscriptions.js +2 -0
  127. package/lib/services/subscriptions.js.map +1 -0
  128. package/lib/services/teams.d.ts +90 -0
  129. package/lib/services/teams.d.ts.map +1 -0
  130. package/lib/services/teams.js +2 -0
  131. package/lib/services/teams.js.map +1 -0
  132. package/lib/services/users.d.ts +324 -0
  133. package/lib/services/users.d.ts.map +1 -0
  134. package/lib/services/users.js +2 -0
  135. package/lib/services/users.js.map +1 -0
  136. package/lib/services/videos.d.ts +101 -0
  137. package/lib/services/videos.d.ts.map +1 -0
  138. package/lib/services/videos.js +2 -0
  139. package/lib/services/videos.js.map +1 -0
  140. package/lib/services/whispers.d.ts +17 -0
  141. package/lib/services/whispers.d.ts.map +1 -0
  142. package/lib/services/whispers.js +2 -0
  143. package/lib/services/whispers.js.map +1 -0
  144. package/lib/services.lazy/ads.js +1 -0
  145. package/lib/services.lazy/analytics.js +1 -0
  146. package/lib/services.lazy/bits.js +1 -0
  147. package/lib/services.lazy/ccls.js +1 -0
  148. package/lib/services.lazy/channel_points.js +1 -0
  149. package/lib/services.lazy/channels.js +1 -0
  150. package/lib/services.lazy/charity.js +1 -0
  151. package/lib/services.lazy/chat.js +3 -0
  152. package/lib/services.lazy/clips.js +1 -0
  153. package/lib/services.lazy/conduits.js +1 -0
  154. package/lib/services.lazy/entitlements.js +1 -0
  155. package/lib/services.lazy/eventsub.js +1 -0
  156. package/lib/services.lazy/extensions.js +1 -0
  157. package/lib/services.lazy/games.js +1 -0
  158. package/lib/services.lazy/goals.js +1 -0
  159. package/lib/services.lazy/guest_star.js +1 -0
  160. package/lib/services.lazy/hype_train.js +1 -0
  161. package/lib/services.lazy/index.js +3 -0
  162. package/lib/services.lazy/moderation.js +3 -0
  163. package/lib/services.lazy/polls.js +1 -0
  164. package/lib/services.lazy/predictions.js +1 -0
  165. package/lib/services.lazy/raids.js +1 -0
  166. package/lib/services.lazy/schedule.js +1 -0
  167. package/lib/services.lazy/search.js +1 -0
  168. package/lib/services.lazy/streams.js +1 -0
  169. package/lib/services.lazy/subscriptions.js +1 -0
  170. package/lib/services.lazy/teams.js +1 -0
  171. package/lib/services.lazy/users.js +1 -0
  172. package/lib/services.lazy/videos.js +1 -0
  173. package/lib/services.lazy/whispers.js +1 -0
  174. package/lib/traits.d.ts +10 -0
  175. package/lib/traits.d.ts.map +1 -0
  176. package/lib/traits.js +1 -0
  177. package/package.json +82 -2
  178. package/src/credentials.ts +79 -0
  179. package/src/errors.ts +78 -0
  180. package/src/index.ts +45 -0
  181. package/src/pagination.ts +9 -0
  182. package/src/protocol.ts +43 -0
  183. package/src/retry.ts +69 -0
  184. package/src/services/ads.ts +228 -0
  185. package/src/services/analytics.ts +253 -0
  186. package/src/services/bits.ts +631 -0
  187. package/src/services/ccls.ts +96 -0
  188. package/src/services/channel_points.ts +804 -0
  189. package/src/services/channels.ts +471 -0
  190. package/src/services/charity.ts +250 -0
  191. package/src/services/chat.ts +1547 -0
  192. package/src/services/clips.ts +385 -0
  193. package/src/services/conduits.ts +453 -0
  194. package/src/services/entitlements.ts +219 -0
  195. package/src/services/eventsub.ts +372 -0
  196. package/src/services/extensions.ts +1098 -0
  197. package/src/services/games.ts +184 -0
  198. package/src/services/goals.ts +110 -0
  199. package/src/services/guest_star.ts +762 -0
  200. package/src/services/hype_train.ts +214 -0
  201. package/src/services/index.ts +30 -0
  202. package/src/services/moderation.ts +1817 -0
  203. package/src/services/polls.ts +363 -0
  204. package/src/services/predictions.ts +432 -0
  205. package/src/services/raids.ts +127 -0
  206. package/src/services/schedule.ts +539 -0
  207. package/src/services/search.ts +248 -0
  208. package/src/services/streams.ts +579 -0
  209. package/src/services/subscriptions.ts +247 -0
  210. package/src/services/teams.ts +225 -0
  211. package/src/services/users.ts +729 -0
  212. package/src/services/videos.ts +257 -0
  213. package/src/services/whispers.ts +71 -0
  214. package/src/traits.ts +47 -0
@@ -0,0 +1,173 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import { type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
3
+ export type { TwitchOpError, TwitchOpContext };
4
+ export interface GetChannelEditorsRequest {
5
+ /** The ID of the broadcaster that owns the channel. This ID must match the user ID in the access token. */
6
+ broadcaster_id: string;
7
+ }
8
+ export interface GetChannelEditorsResponseDataItem {
9
+ /** An ID that uniquely identifies a user with editor permissions. */
10
+ user_id?: string | undefined;
11
+ /** The user's display name. */
12
+ user_name?: string | undefined;
13
+ /** The date and time, in RFC3339 format, when the user became one of the broadcaster's editors. */
14
+ created_at?: string | undefined;
15
+ }
16
+ /** A list of users that are editors for the specified broadcaster. The list is empty if the broadcaster doesn't have editors. */
17
+ export type GetChannelEditorsResponseDataList = Array<GetChannelEditorsResponseDataItem>;
18
+ export interface GetChannelEditorsResponse {
19
+ /** A list of users that are editors for the specified broadcaster. The list is empty if the broadcaster doesn't have editors. */
20
+ data?: GetChannelEditorsResponseDataList | undefined;
21
+ }
22
+ export interface GetChannelFollowersRequest {
23
+ /** A user's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this user if they follow the broadcaster. If not specified, the response contains all users that follow the broadcaster. Using this parameter requires both a user access token with the **moderator:read:followers** scope and the user ID in the access token match the broadcaster_id or be the user ID for a moderator of the specified broadcaster. */
24
+ user_id?: string | undefined;
25
+ /** The broadcaster's ID. Returns the list of users that follow this broadcaster. */
26
+ broadcaster_id: string;
27
+ /** 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. */
28
+ first?: number | undefined;
29
+ /** 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). */
30
+ after?: string | undefined;
31
+ }
32
+ export interface GetChannelFollowersResponseDataItem {
33
+ /** The UTC timestamp when the user started following the broadcaster. */
34
+ followed_at?: string | undefined;
35
+ /** An ID that uniquely identifies the user that's following the broadcaster. */
36
+ user_id?: string | undefined;
37
+ /** The user's login name. */
38
+ user_login?: string | undefined;
39
+ /** The user's display name. */
40
+ user_name?: string | undefined;
41
+ }
42
+ /** The list of users that follow the specified broadcaster. The list is in descending order by `followed_at` (with the most recent follower first). The list is empty if nobody follows the broadcaster, the specified _user_id_ isn't in the follower list, the user access token is missing the **moderator:read:followers** scope, or the user isn't the broadcaster or moderator for the channel. */
43
+ export type GetChannelFollowersResponseDataList = Array<GetChannelFollowersResponseDataItem>;
44
+ /** 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). */
45
+ export interface GetChannelFollowersResponsePagination {
46
+ /** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
47
+ cursor?: string | undefined;
48
+ }
49
+ export interface GetChannelFollowersResponse {
50
+ /** The list of users that follow the specified broadcaster. The list is in descending order by `followed_at` (with the most recent follower first). The list is empty if nobody follows the broadcaster, the specified _user_id_ isn't in the follower list, the user access token is missing the **moderator:read:followers** scope, or the user isn't the broadcaster or moderator for the channel. */
51
+ data: GetChannelFollowersResponseDataList;
52
+ /** 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). */
53
+ pagination?: GetChannelFollowersResponsePagination | undefined;
54
+ /** The total number of users that follow this broadcaster. As someone pages through the list, the number of users may change as users follow or unfollow the broadcaster. */
55
+ total?: number | undefined;
56
+ }
57
+ export type GetChannelInformationRequestBroadcasterIdList = Array<string>;
58
+ export interface GetChannelInformationRequest {
59
+ /** The ID of the broadcaster whose channel you want to get. To specify more than one ID, include this parameter for each broadcaster you want to get. For example, 'broadcaster_id=1234&broadcaster_id=5678'. You may specify a maximum of 100 IDs. The API ignores duplicate IDs and IDs that are not found. */
60
+ broadcaster_id: GetChannelInformationRequestBroadcasterIdList;
61
+ }
62
+ /** The tags applied to the channel. */
63
+ export type GetChannelInformationResponseDataItemTagsList = Array<string>;
64
+ /** The CCLs applied to the channel. */
65
+ export type GetChannelInformationResponseDataItemContentClassificationLabelsList = Array<string>;
66
+ export interface GetChannelInformationResponseDataItem {
67
+ /** An ID that uniquely identifies the broadcaster. */
68
+ broadcaster_id?: string | undefined;
69
+ /** The broadcaster's login name. */
70
+ broadcaster_login?: string | undefined;
71
+ /** The broadcaster's display name. */
72
+ broadcaster_name?: string | undefined;
73
+ /** The broadcaster's preferred language. The value is an ISO 639-1 two-letter language code (for example, *en* for English). The value is set to "other" if the language is not a Twitch supported language. */
74
+ broadcaster_language?: string | undefined;
75
+ /** The name of the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. */
76
+ game_name?: string | undefined;
77
+ /** An ID that uniquely identifies the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. */
78
+ game_id?: string | undefined;
79
+ /** The title of the stream that the broadcaster is currently streaming or last streamed. The value is an empty string if the broadcaster has never streamed. */
80
+ title?: string | undefined;
81
+ /** The value of the broadcaster's stream delay setting, in seconds. This field's value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the *broadcaster_id* query parameter matches the user ID in the access token, 3) the broadcaster has partner status and they set a non-zero stream delay value, and 4) the broadcaster's stream isn't disabled. */
82
+ delay?: number | undefined;
83
+ /** The tags applied to the channel. */
84
+ tags?: GetChannelInformationResponseDataItemTagsList | undefined;
85
+ /** The CCLs applied to the channel. */
86
+ content_classification_labels?: GetChannelInformationResponseDataItemContentClassificationLabelsList | undefined;
87
+ /** Boolean flag indicating if the channel has branded content. */
88
+ is_branded_content?: boolean | undefined;
89
+ }
90
+ /** A list that contains information about the specified channels. The list is empty if the specified channels weren't found. */
91
+ export type GetChannelInformationResponseDataList = Array<GetChannelInformationResponseDataItem>;
92
+ export interface GetChannelInformationResponse {
93
+ /** A list that contains information about the specified channels. The list is empty if the specified channels weren't found. */
94
+ data?: GetChannelInformationResponseDataList | undefined;
95
+ }
96
+ export interface GetFollowedChannelsRequest {
97
+ /** A user's ID. Returns the list of broadcasters that this user follows. This ID must match the user ID in the user OAuth token. */
98
+ user_id: string;
99
+ /** A broadcaster's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows. */
100
+ broadcaster_id?: string | undefined;
101
+ /** 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. */
102
+ first?: number | undefined;
103
+ /** 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). */
104
+ after?: string | undefined;
105
+ }
106
+ export interface GetFollowedChannelsResponseDataItem {
107
+ /** An ID that uniquely identifies the broadcaster that this user is following. */
108
+ broadcaster_id?: string | undefined;
109
+ /** The broadcaster's login name. */
110
+ broadcaster_login?: string | undefined;
111
+ /** The broadcaster's display name. */
112
+ broadcaster_name?: string | undefined;
113
+ /** The UTC timestamp when the user started following the broadcaster. */
114
+ followed_at?: string | undefined;
115
+ }
116
+ /** The list of broadcasters that the user follows. The list is in descending order by `followed_at` (with the most recently followed broadcaster first). The list is empty if the user doesn't follow anyone. */
117
+ export type GetFollowedChannelsResponseDataList = Array<GetFollowedChannelsResponseDataItem>;
118
+ /** 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). */
119
+ export type GetFollowedChannelsResponsePagination = GetChannelFollowersResponsePagination;
120
+ export interface GetFollowedChannelsResponse {
121
+ /** The list of broadcasters that the user follows. The list is in descending order by `followed_at` (with the most recently followed broadcaster first). The list is empty if the user doesn't follow anyone. */
122
+ data: GetFollowedChannelsResponseDataList;
123
+ /** 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). */
124
+ pagination?: GetChannelFollowersResponsePagination | undefined;
125
+ /** The total number of broadcasters that the user follows. As someone pages through the list, the number may change as the user follows or unfollows broadcasters. */
126
+ total?: number | undefined;
127
+ }
128
+ /** A list of channel-defined tags to apply to the channel. To remove all tags from the channel, set tags to an empty array. Tags help identify the content that the channel streams. [Learn More](https://help.twitch.tv/s/article/guide-to-tags) A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. */
129
+ export type ModifyChannelInformationRequestTagsList = Array<string>;
130
+ export interface ModifyChannelInformationRequestContentClassificationLabelsItem {
131
+ /** ID of the [Content Classification Labels](https://help.twitch.tv/s/article/content-classification-labels) that must be added/removed from the channel. Possible values: - `DebatedSocialIssuesAndPolitics` - `DrugsIntoxication` - `SexualThemes` - `ViolentGraphic` - `Gambling` - `ProfanityVulgarity` */
132
+ id: string;
133
+ /** Boolean flag indicating whether the label should be enabled (true) or disabled for the channel. */
134
+ is_enabled: boolean;
135
+ }
136
+ /** List of labels that should be set as the Channel's CCLs. **Note:** To clear CCLs for a channel, set all *is_enabled* for all possible CCLs to **false** */
137
+ export type ModifyChannelInformationRequestContentClassificationLabelsList = Array<ModifyChannelInformationRequestContentClassificationLabelsItem>;
138
+ export interface ModifyChannelInformationRequest {
139
+ /** The ID of the broadcaster whose channel you want to update. This ID must match the user ID in the user access token. */
140
+ broadcaster_id: string;
141
+ /** The ID of the game that the user plays. The game is not updated if the ID isn't a game ID that Twitch recognizes. To unset this field, use "0" or "" (an empty string). */
142
+ game_id?: string | undefined;
143
+ /** The user's preferred language. Set the value to an ISO 639-1 two-letter language code (for example, *en* for English). Set to "other" if the user's preferred language is not a Twitch supported language. If the language code isn't a Twitch supported language, the request fails with a 400 Bad Request error. */
144
+ broadcaster_language?: string | undefined;
145
+ /** The title of the user's stream. You may not set this field to an empty string. */
146
+ title?: string | undefined;
147
+ /** The number of seconds you want your broadcast buffered before streaming it live. The delay helps ensure fairness during competitive play. Only users with Partner status may set this field. The maximum delay is 900 seconds (15 minutes). */
148
+ delay?: number | undefined;
149
+ /** A list of channel-defined tags to apply to the channel. To remove all tags from the channel, set tags to an empty array. Tags help identify the content that the channel streams. [Learn More](https://help.twitch.tv/s/article/guide-to-tags) A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. */
150
+ tags?: ModifyChannelInformationRequestTagsList | undefined;
151
+ /** List of labels that should be set as the Channel's CCLs. **Note:** To clear CCLs for a channel, set all *is_enabled* for all possible CCLs to **false** */
152
+ content_classification_labels?: ModifyChannelInformationRequestContentClassificationLabelsList | undefined;
153
+ /** Boolean flag indicating if the channel has branded content. */
154
+ is_branded_content?: boolean | undefined;
155
+ }
156
+ export interface ModifyChannelInformationResponse {
157
+ }
158
+ export type GetChannelEditorsError = TwitchOpError;
159
+ /** Get Channel Editors Gets the broadcaster's list editors. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:read:editors** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-editors */
160
+ export declare const getChannelEditors: API.OperationMethod<GetChannelEditorsRequest, GetChannelEditorsResponse, GetChannelEditorsError, TwitchOpContext>;
161
+ export type GetChannelFollowersError = TwitchOpError;
162
+ /** Get Channel Followers Gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster. > **Note** This endpoint will return specific follower information only if the **moderator:read:followers** > scope is provided, and its User ID requirements are met. If the scope is not provided, or the > user is not the broadcaster or a moderator for the specified channel, only the total follower > count will be included in the response. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **moderator:read:followers** scope. The User ID in the access token must comply with one of the following: - The User ID in the access token must match the *broadcaster_id* in the query parameter. - The User ID in the access token must be a moderator on for the specified broadcaster. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-followers */
163
+ export declare const getChannelFollowers: API.PaginatedOperationMethod<GetChannelFollowersRequest, GetChannelFollowersResponse, GetChannelFollowersError, TwitchOpContext, GetChannelFollowersResponseDataItem>;
164
+ export type GetChannelInformationError = TwitchOpError;
165
+ /** Get Channel Information Gets information about one or more channels. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-channel-information */
166
+ export declare const getChannelInformation: API.OperationMethod<GetChannelInformationRequest, GetChannelInformationResponse, GetChannelInformationError, TwitchOpContext>;
167
+ export type GetFollowedChannelsError = TwitchOpError;
168
+ /** Get Followed Channels Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether a user follows a specific broadcaster. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:read:follows** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#get-followed-channels */
169
+ export declare const getFollowedChannels: API.PaginatedOperationMethod<GetFollowedChannelsRequest, GetFollowedChannelsResponse, GetFollowedChannelsError, TwitchOpContext, GetFollowedChannelsResponseDataItem>;
170
+ export type ModifyChannelInformationError = TwitchOpError;
171
+ /** Modify Channel Information Updates a channel's properties. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:broadcast** or **user:edit:broadcast** scope. Reference: https://dev.twitch.tv/docs/api/reference/channels/#modify-channel-information */
172
+ export declare const modifyChannelInformation: API.OperationMethod<ModifyChannelInformationRequest, ModifyChannelInformationResponse, ModifyChannelInformationError, TwitchOpContext>;
173
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sources":["../../src/services/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAMjD,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM1F,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAc/C,MAAM,WAAW,wBAAwB;IACvC,2GAA2G;IAC3G,cAAc,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,iCAAiC;IAChD,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AACD,iIAAiI;AACjI,MAAM,MAAM,iCAAiC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M,wBAAwB,EAAE,GAAG,CAAC,eAAe,CACxD,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,eAAe,CAUd,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{Gc as e,Jc as t,Kc as n,Rc as r,Wc as i,Xc as a,a as o,b as s,errors$TwitchServiceErrors as c,l,n as u,o as d,pagination$paginateCursor as f,protocol$TwitchProtocol as p,retry$Retry as m,traits$Http as h,traits$Query as g,wc as _,xc as v}from"../_bundle/sdk.js";const y={system:`twitch-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`Twitch`,service:`Channels`,propagate:`w3c`};const b=/*@__PURE__*/ u(e=>e===o?l(`GetChannelEditors`,`{input:#1,output:#4,errors:[],serviceErrors:$8,protocol:$9,retry:$10,telemetry:$11,span:"%"};$5(>5)@"%Request";$5(>6)@"%ResponseDataItem";$7(#2);$5(>7)@"%Response";$4({broadcaster_id:$3.pipe($2())}).pipe($1({method:"GET",uri:"/channels/editors",code:200}));$4({user_id:$6($3),user_name:$6($3),created_at:$6($3)});$4({data:$6(#3)})`,[r,h,g,t,n,a,i,_,c,p,m,y]):s(b,e));const x=/*@__PURE__*/ d(u=>u===o?l(`GetChannelFollowers`,`{input:#1,output:#4,errors:[],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%",pagination:{mode:"cursor",inputToken:"after",outputToken:"pagination.cursor",items:"data",pageSize:"first"},strategy:$14};$7(>5)@"%Request";$7(>6)@"%ResponseDataItem";$8(#2);$7(>7)@"%Response";$6({user_id:$4($3.pipe($2())),broadcaster_id:$3.pipe($2()),first:$4($5.pipe($2())),after:$4($3.pipe($2()))}).pipe($1({method:"GET",uri:"/channels/followers",code:200}));$6({followed_at:$4($3),user_id:$4($3),user_login:$4($3),user_name:$4($3)});$6({data:#3,pagination:$4(#9:0),total:$4($5)})`,[r,h,g,t,i,e,n,a,_,__d0,c,p,m,y,f]):s(x,u));const S=/*@__PURE__*/ u(u=>u===o?l(`GetChannelInformation`,`{input:#1,output:#4,errors:[],serviceErrors:$11,protocol:$12,retry:$13,telemetry:$14,span:"%"};$5(>5)@"%Request";$5(>6)@"%ResponseDataItem";$10(#2);$5(>7)@"%Response";$4({broadcaster_id:#3:0.pipe($2())}).pipe($1({method:"GET",uri:"/channels",code:200}));$4({broadcaster_id:$7($6),broadcaster_login:$7($6),broadcaster_name:$7($6),broadcaster_language:$7($6),game_name:$7($6),game_id:$7($6),title:$7($6),delay:$7($8),tags:$7(#3:0),content_classification_labels:$7(#3:0),is_branded_content:$7($9)});$4({data:$7(#3)})`,[r,h,g,__d1,n,a,t,i,e,v,_,c,p,m,y]):s(S,u));const C=/*@__PURE__*/ d(u=>u===o?l(`GetFollowedChannels`,`{input:#1,output:#4,errors:[],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%",pagination:{mode:"cursor",inputToken:"after",outputToken:"pagination.cursor",items:"data",pageSize:"first"},strategy:$14};$7(>5)@"%Request";$7(>6)@"%ResponseDataItem";$8(#2);$7(>7)@"%Response";$6({user_id:$3.pipe($2()),broadcaster_id:$4($3.pipe($2())),first:$4($5.pipe($2())),after:$4($3.pipe($2()))}).pipe($1({method:"GET",uri:"/channels/followed",code:200}));$6({broadcaster_id:$4($3),broadcaster_login:$4($3),broadcaster_name:$4($3),followed_at:$4($3)});$6({data:#3,pagination:$4(#9:0),total:$4($5)})`,[r,h,g,t,i,e,n,a,_,__d0,c,p,m,y,f]):s(C,u));const w=/*@__PURE__*/ u(u=>u===o?l(`ModifyChannelInformation`,`{input:#3,output:#4,errors:[],serviceErrors:$11,protocol:$12,retry:$13,telemetry:$14,span:"%"};$4(>5)@"%RequestContentClassificationLabelsItem";$5(#1);$4(>6)@"%Request";$4(>7)@"%Response";$3({id:$1,is_enabled:$2});$3({broadcaster_id:$1.pipe($7()),game_id:$8($1),broadcaster_language:$8($1),title:$8($1),delay:$8($9),tags:$8(#10:0),content_classification_labels:$8(#2),is_branded_content:$8($2)}).pipe($6({method:"PATCH",uri:"/channels",code:200}));$3({})`,[r,t,v,n,a,_,h,g,i,e,__d1,c,p,m,y]):s(w,u));function __d0(){return[`$4(>1)@"GetChannelFollowersResponsePagination";$3({cursor:$2($1)})`,[r,t,i,n,a]]}function __d1(){return[`$2($1)`,[r,t,_]]}export{b as getChannelEditors,x as getChannelFollowers,S as getChannelInformation,C as getFollowedChannels,w as modifyChannelInformation};
2
+ //# sourceMappingURL=channels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.js","names":["API.D","API.named","__L.at","T.Http","T.Query","S.String","S.Struct","S.suspend","S.optional","S.Array","Retry.Retry","API.call","S.Number","S.Boolean","Number","String","Struct","at","optional","suspend","D","call","TwitchServiceErrors","op","opPaginated","paginateCursor","TwitchProtocol","Retry","Http","Query","Array","Boolean","TELEMETRY","getChannelEditors","i","named","getChannelFollowers","getChannelInformation","getFollowedChannels","modifyChannelInformation"],"sources":["../../src/services/channels.ts"],"mappings":"6QAaA,MAAMgC,EAAY,CAChB,OAAQ,aACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,SACR,QAAS,WACT,UAAW,KACb,EAkKA,MAAaC,EAKK,gBAAQ,GAAgBC,IAAMlC,EAAQC,EAAU,oBAAqB,6UAA8U,CAACC,EAAQC,EAAQC,EAASC,EAAUC,EAAUC,EAAWC,EAAYC,EAASa,EAAqBI,EAAgBhB,EAAasB,CAAS,CAAC,EAAIrB,EAASsB,EAAmBC,CAAC,CAAC,EAIjlB,MAAaE,EAMK,gBAAiB,GAAgBF,IAAMlC,EAAQC,EAAU,sBAAuB,okBAAqkB,CAACC,EAAQC,EAAQC,EAASC,EAAUG,EAAYI,EAAUN,EAAUC,EAAWE,EAAS,KAAMa,EAAqBI,EAAgBhB,EAAasB,EAAWP,CAAc,CAAC,EAAId,EAASyB,EAAqBF,CAAC,CAAC,EAIr3B,MAAaG,EAKK,gBAAQ,GAAgBH,IAAMlC,EAAQC,EAAU,wBAAyB,ogBAAqgB,CAACC,EAAQC,EAAQC,EAAS,KAAME,EAAUC,EAAWF,EAAUG,EAAYI,EAAUC,EAAWJ,EAASa,EAAqBI,EAAgBhB,EAAasB,CAAS,CAAC,EAAIrB,EAAS0B,EAAuBH,CAAC,CAAC,EAI3yB,MAAaI,EAMK,gBAAiB,GAAgBJ,IAAMlC,EAAQC,EAAU,sBAAuB,wlBAAylB,CAACC,EAAQC,EAAQC,EAASC,EAAUG,EAAYI,EAAUN,EAAUC,EAAWE,EAAS,KAAMa,EAAqBI,EAAgBhB,EAAasB,EAAWP,CAAc,CAAC,EAAId,EAAS2B,EAAqBJ,CAAC,CAAC,EAIz4B,MAAaK,EAKK,gBAAQ,GAAgBL,IAAMlC,EAAQC,EAAU,2BAA4B,ycAA0c,CAACC,EAAQG,EAAUQ,EAAWP,EAAUC,EAAWE,EAASN,EAAQC,EAASI,EAAYI,EAAU,KAAMU,EAAqBI,EAAgBhB,EAAasB,CAAS,CAAC,EAAIrB,EAAS4B,EAA0BL,CAAC,CAAC,EAMtvB,SAAS,MAAY,CACnB,MAAO,CAAC,qEAAsE,CAAChC,EAAQG,EAAUG,EAAYF,EAAUC,CAAS,CAAC,CACnI,CACA,SAAS,MAAY,CACnB,MAAO,CAAC,SAAU,CAACL,EAAQG,EAAUI,CAAO,CAAC,CAC/C"}
@@ -0,0 +1,97 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import { type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
3
+ export type { TwitchOpError, TwitchOpContext };
4
+ export interface GetCharityCampaignRequest {
5
+ /** The ID of the broadcaster that's currently running a charity campaign. This ID must match the user ID in the access token. */
6
+ broadcaster_id: string;
7
+ }
8
+ /** The current amount of donations that the campaign has received. */
9
+ export interface GetCharityCampaignResponseDataItemCurrentAmount {
10
+ /** 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. */
11
+ value?: number | undefined;
12
+ /** 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' */
13
+ decimal_places?: number | undefined;
14
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in `value`. */
15
+ currency?: string | undefined;
16
+ }
17
+ /** The campaign's fundraising goal. If the broadcaster has not defined a fundraising goal, `value` is 0. */
18
+ export type GetCharityCampaignResponseDataItemTargetAmount = GetCharityCampaignResponseDataItemCurrentAmount;
19
+ export interface GetCharityCampaignResponseDataItem {
20
+ /** An ID that identifies the charity campaign. */
21
+ id?: string | undefined;
22
+ /** An ID that identifies the broadcaster that's running the campaign. */
23
+ broadcaster_id?: string | undefined;
24
+ /** The broadcaster's login name. */
25
+ broadcaster_login?: string | undefined;
26
+ /** The broadcaster's display name. */
27
+ broadcaster_name?: string | undefined;
28
+ /** The charity's name. */
29
+ charity_name?: string | undefined;
30
+ /** A description of the charity. */
31
+ charity_description?: string | undefined;
32
+ /** 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. */
33
+ charity_logo?: string | undefined;
34
+ /** A URL to the charity's website. */
35
+ charity_website?: string | undefined;
36
+ /** The current amount of donations that the campaign has received. */
37
+ current_amount?: GetCharityCampaignResponseDataItemCurrentAmount | undefined;
38
+ /** The campaign's fundraising goal. If the broadcaster has not defined a fundraising goal, `value` is 0. */
39
+ target_amount?: GetCharityCampaignResponseDataItemCurrentAmount | undefined;
40
+ }
41
+ /** 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. */
42
+ export type GetCharityCampaignResponseDataList = Array<GetCharityCampaignResponseDataItem>;
43
+ export interface GetCharityCampaignResponse {
44
+ /** 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. */
45
+ data?: GetCharityCampaignResponseDataList | undefined;
46
+ }
47
+ export interface GetCharityCampaignDonationsRequest {
48
+ /** The ID of the broadcaster that's currently running a charity campaign. This ID must match the user ID in the access token. */
49
+ broadcaster_id: string;
50
+ /** The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20. */
51
+ first?: number | undefined;
52
+ /** The cursor used to get the next page of results. The **Pagination** object in the response contains the cursor's value. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
53
+ after?: string | undefined;
54
+ }
55
+ /** An object that contains the amount of money that the user donated. */
56
+ export interface GetCharityCampaignDonationsResponseDataItemAmount {
57
+ /** 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. */
58
+ value?: number | undefined;
59
+ /** 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` */
60
+ decimal_places?: number | undefined;
61
+ /** The ISO-4217 three-letter currency code that identifies the type of currency in `value`. */
62
+ currency?: string | undefined;
63
+ }
64
+ export interface GetCharityCampaignDonationsResponseDataItem {
65
+ /** An ID that identifies the donation. The ID is unique across campaigns. */
66
+ id?: string | undefined;
67
+ /** An ID that identifies the charity campaign that the donation applies to. */
68
+ campaign_id?: string | undefined;
69
+ /** An ID that identifies a user that donated money to the campaign. */
70
+ user_id?: string | undefined;
71
+ /** The user's login name. */
72
+ user_login?: string | undefined;
73
+ /** The user's display name. */
74
+ user_name?: string | undefined;
75
+ /** An object that contains the amount of money that the user donated. */
76
+ amount?: GetCharityCampaignDonationsResponseDataItemAmount | undefined;
77
+ }
78
+ /** 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. */
79
+ export type GetCharityCampaignDonationsResponseDataList = Array<GetCharityCampaignDonationsResponseDataItem>;
80
+ /** 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) */
81
+ export interface GetCharityCampaignDonationsResponsePagination {
82
+ /** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
83
+ cursor?: string | undefined;
84
+ }
85
+ export interface GetCharityCampaignDonationsResponse {
86
+ /** 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. */
87
+ data: GetCharityCampaignDonationsResponseDataList;
88
+ /** 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) */
89
+ pagination?: GetCharityCampaignDonationsResponsePagination | undefined;
90
+ }
91
+ export type GetCharityCampaignError = TwitchOpError;
92
+ /** 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 */
93
+ export declare const getCharityCampaign: API.OperationMethod<GetCharityCampaignRequest, GetCharityCampaignResponse, GetCharityCampaignError, TwitchOpContext>;
94
+ export type GetCharityCampaignDonationsError = TwitchOpError;
95
+ /** 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 */
96
+ export declare const getCharityCampaignDonations: API.PaginatedOperationMethod<GetCharityCampaignDonationsRequest, GetCharityCampaignDonationsResponse, GetCharityCampaignDonationsError, TwitchOpContext, GetCharityCampaignDonationsResponseDataItem>;
97
+ //# sourceMappingURL=charity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charity.d.ts","sources":["../../src/services/charity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAMjD,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM1F,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAc/C,MAAM,WAAW,yBAAyB;IACxC,iIAAiI;IACjI,cAAc,EAAE,MAAM,CAAC;CACxB;AACD,sEAAsE;AACtE,MAAM,WAAW,+CAA+C;IAC9D,sLAAsL;IACtL,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,0NAA0N;IAC1N,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AACD,4GAA4G;AAC5G,MAAM,MAAM,8CAA8C,GACxD,+CAA+C,CAAC;AAClD,MAAM,WAAW,kCAAkC;IACjD,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,oCAAoC;IACpC,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,iLAAiL;IACjL,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC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AAC;CACxE;AACD,0PAA0P;AAC1P,MAAM,MAAM,2CAA2C,GACrD,KAAK,CAAC,2CAA2C,CAAC,CAAC;AACrD,6NAA6N;AAC7N,MAAM,WAAW,6CAA6C;IAC5D,oHAAoH;IACpH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AACD,MAAM,WAAW,mCAAmC;IAClD,0PAA0P;IAC1P,IAAI,EAAE,2CAA2C,CAAC;IAClD,6NAA6N;IAC7N,UAAU,CAAC,EAAE,6CAA6C,GAAG,SAAS,CAAC;CACxE;AACD,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AACpD,4tBAA4tB;AAC5tB,eAAO,MAAM,kBAAkB,EAAE,GAAG,CAAC,eAAe,CAClD,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,CAUd,CAAC;AAEJ,MAAM,MAAM,gCAAgC,GAAG,aAAa,CAAC;AAC7D,8lBAA8lB;AAC9lB,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAAC,wBAAwB,CACpE,kCAAkC,EAClC,mCAAmC,EACnC,gCAAgC,EAChC,eAAe,EACf,2CAA2C,CAoBrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{Gc as e,Jc as t,Kc as n,Rc as r,Wc as i,Xc as a,a as o,b as s,errors$TwitchServiceErrors as c,l,n as u,o as d,pagination$paginateCursor as f,protocol$TwitchProtocol as p,retry$Retry as m,traits$Http as h,traits$Query as g,wc as _}from"../_bundle/sdk.js";const v={system:`twitch-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`Twitch`,service:`Charity`,propagate:`w3c`};const y=/*@__PURE__*/ u(e=>e===o?l(`GetCharityCampaign`,`{input:#1,output:#4,errors:[],serviceErrors:$9,protocol:$10,retry:$11,telemetry:$12,span:"%"};$5(>5)@"%Request";$5(>6)@"%ResponseDataItem";$8(#2);$5(>7)@"%Response";$4({broadcaster_id:$3.pipe($2())}).pipe($1({method:"GET",uri:"/charity/campaigns",code:200}));$4({id:$6($3),broadcaster_id:$6($3),broadcaster_login:$6($3),broadcaster_name:$6($3),charity_name:$6($3),charity_description:$6($3),charity_logo:$6($3),charity_website:$6($3),current_amount:$6(#7:0),target_amount:$6(#7:0)});$4({data:$6(#3)})`,[r,h,g,t,n,a,i,__d0,_,c,p,m,v]):s(y,e));const b=/*@__PURE__*/ d(u=>u===o?l(`GetCharityCampaignDonations`,`{input:#1,output:#5,errors:[],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%",pagination:{mode:"cursor",inputToken:"after",outputToken:"pagination.cursor",items:"data",pageSize:"first"},strategy:$14};$7(>6)@"%Request";$7(>7)@"%ResponseDataItem";$9(#2);$7(>8)@"%ResponsePagination";$7(>9)@"%Response";$6({broadcaster_id:$3.pipe($2()),first:$5($4.pipe($2())),after:$5($3.pipe($2()))}).pipe($1({method:"GET",uri:"/charity/donations",code:200}));$6({id:$5($3),campaign_id:$5($3),user_id:$5($3),user_login:$5($3),user_name:$5($3),amount:$5(#8:0)});$6({cursor:$5($3)});$6({data:#3,pagination:$5(#4)})`,[r,h,g,t,e,i,n,a,__d0,_,c,p,m,v,f]):s(b,u));function __d0(){return[`$5(>1)@"GetCharityCampaignResponseDataItemCurrentAmount";$4({value:$2($1),decimal_places:$2($1),currency:$2($3)})`,[r,e,i,t,n,a]]}export{y as getCharityCampaign,b as getCharityCampaignDonations};
2
+ //# sourceMappingURL=charity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charity.js","names":["API.D","API.named","__L.at","T.Http","T.Query","S.String","S.Struct","S.suspend","S.optional","S.Array","Retry.Retry","API.call","S.Number","Number","String","Struct","at","optional","suspend","D","call","TwitchServiceErrors","op","opPaginated","paginateCursor","TwitchProtocol","Retry","Http","Query","Array","TELEMETRY","getCharityCampaign","i","named","getCharityCampaignDonations"],"sources":["../../src/services/charity.ts"],"mappings":"qQAaA,MAAM8B,EAAY,CAChB,OAAQ,aACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,SACR,QAAS,UACT,UAAW,KACb,EA6FA,MAAaC,EAKK,gBAAQ,GAAgBC,IAAMhC,EAAQC,EAAU,qBAAsB,ufAAwf,CAACC,EAAQC,EAAQC,EAASC,EAAUC,EAAUC,EAAWC,EAAY,KAAMC,EAASY,EAAqBI,EAAgBf,EAAaoB,CAAS,CAAC,EAAInB,EAASoB,EAAoBC,CAAC,CAAC,EAInwB,MAAaE,EAMK,gBAAiB,GAAgBF,IAAMhC,EAAQC,EAAU,8BAA+B,qmBAAsmB,CAACC,EAAQC,EAAQC,EAASC,EAAUO,EAAUJ,EAAYF,EAAUC,EAAW,KAAME,EAASY,EAAqBI,EAAgBf,EAAaoB,EAAWN,CAAc,CAAC,EAAIb,EAASuB,EAA6BF,CAAC,CAAC,EAMt6B,SAAS,MAAY,CACnB,MAAO,CAAC,oHAAqH,CAAC9B,EAAQU,EAAUJ,EAAYH,EAAUC,EAAUC,CAAS,CAAC,CAC5L"}