@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,76 @@
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 type GetDropsEntitlementsRequestIdList = Array<string>;
5
+ export interface GetDropsEntitlementsRequest {
6
+ /** An ID that identifies the entitlement to get. Include this parameter for each entitlement you want to get. For example, 'id=1234&id=5678'. You may specify a maximum of 100 IDs. If you specify *id*, the *user_id*, *game_id*, and *fulfillment_status* filters don't apply. */
7
+ id?: GetDropsEntitlementsRequestIdList | undefined;
8
+ /** An ID that identifies a user that was granted entitlements. */
9
+ user_id?: string | undefined;
10
+ /** An ID that identifies a game that offered entitlements. */
11
+ game_id?: string | undefined;
12
+ /** The entitlement's fulfillment status. Used to filter the list to only those with the specified status. The value is case-insensitive. Possible values: - `CLAIMED` - `FULFILLED` */
13
+ fulfillment_status?: string | undefined;
14
+ /** 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) */
15
+ after?: string | undefined;
16
+ /** The maximum number of entitlements to return per page in the response. The minimum page size is 1 entitlement per page and the maximum is 1000. The default is 20. */
17
+ first?: number | undefined;
18
+ }
19
+ export interface GetDropsEntitlementsResponseDataItem {
20
+ /** An ID that identifies the entitlement. */
21
+ id?: string | undefined;
22
+ /** An ID that identifies the benefit (reward). */
23
+ benefit_id?: string | undefined;
24
+ /** The UTC date and time (in RFC3339 format) of when the entitlement was granted. */
25
+ timestamp?: string | undefined;
26
+ /** An ID that identifies the user who was granted the entitlement. */
27
+ user_id?: string | undefined;
28
+ /** An ID that identifies the game the user was playing when the reward was entitled. */
29
+ game_id?: string | undefined;
30
+ /** The entitlement's fulfillment status. Possible values: - `CLAIMED` - `FULFILLED` */
31
+ fulfillment_status?: string | undefined;
32
+ /** The UTC date and time (in RFC3339 format) of when the entitlement was last updated. */
33
+ last_updated?: string | undefined;
34
+ }
35
+ /** The list of entitlements. */
36
+ export type GetDropsEntitlementsResponseDataList = Array<GetDropsEntitlementsResponseDataItem>;
37
+ /** The information used to page through the list of results. The response doesn't include this object if there are no more pages left to page through, or if you specify *id*. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
38
+ export interface GetDropsEntitlementsResponsePagination {
39
+ /** The cursor used to get the next page of results. Set the request's *after* query parameter to this value to page forward through the results. */
40
+ cursor?: string | undefined;
41
+ }
42
+ export interface GetDropsEntitlementsResponse {
43
+ /** The list of entitlements. */
44
+ data: GetDropsEntitlementsResponseDataList;
45
+ /** The information used to page through the list of results. The response doesn't include this object if there are no more pages left to page through, or if you specify *id*. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
46
+ pagination?: GetDropsEntitlementsResponsePagination | undefined;
47
+ }
48
+ /** A list of IDs that identify the entitlements to update. You may specify a maximum of 100 IDs. */
49
+ export type UpdateDropsEntitlementsRequestEntitlementIdsList = Array<string>;
50
+ export interface UpdateDropsEntitlementsRequest {
51
+ /** A list of IDs that identify the entitlements to update. You may specify a maximum of 100 IDs. */
52
+ entitlement_ids: UpdateDropsEntitlementsRequestEntitlementIdsList;
53
+ /** The fulfillment status to set the entitlements to. The value is case-insensitive. Possible values: - `CLAIMED`: The user claimed the benefit. - `FULFILLED`: The developer granted the benefit that the user claimed. */
54
+ fulfillment_status: string;
55
+ }
56
+ /** The list of entitlements that the status in the `status` field applies to. */
57
+ export type UpdateDropsEntitlementsResponseDataItemIdsList = Array<string>;
58
+ export interface UpdateDropsEntitlementsResponseDataItem {
59
+ /** A string that indicates whether the status of the entitlements in the `ids` field were successfully updated. Possible values: - `INVALID_ID`: The entitlement IDs in the `ids` field are not valid. - `NOT_FOUND`: The entitlement IDs in the `ids` field were not found. - `SUCCESS`: The status of the entitlements in the `ids` field were successfully updated. - `UNAUTHORIZED`: The user or organization identified by the user access token is not authorized to update the entitlements. - `UPDATE_FAILED`: The update failed. Attempting to change a FULFILLED entitlement back to CLAIMED using a User Access Token will always fail. Any other failure should be retried later, or reported on our [Issue Tracker](http://github.com/twitchdev/issues/). */
60
+ status?: string | undefined;
61
+ /** The list of entitlements that the status in the `status` field applies to. */
62
+ ids?: UpdateDropsEntitlementsResponseDataItemIdsList | undefined;
63
+ }
64
+ /** A list that indicates which entitlements were successfully updated and those that weren't. */
65
+ export type UpdateDropsEntitlementsResponseDataList = Array<UpdateDropsEntitlementsResponseDataItem>;
66
+ export interface UpdateDropsEntitlementsResponse {
67
+ /** A list that indicates which entitlements were successfully updated and those that weren't. */
68
+ data?: UpdateDropsEntitlementsResponseDataList | undefined;
69
+ }
70
+ export type GetDropsEntitlementsError = TwitchOpError;
71
+ /** Get Drops Entitlements Gets an organization's list of entitlements that have been granted to a game, a user, or both. The following table identifies the request parameters that you may specify based on the type of access token used. Except when you specify *id*, or both a user and a game (*user_id* and *game_id*, or *game_id* with a user access token), the response includes only entitlements granted in the last 6 months. > **Note** Entitlements returned in the response body data are not guaranteed to be sorted by any field returned by the API. > To retrieve **CLAIMED** or **FULFILLED** entitlements, use the *fulfillment_status* query parameter to filter results. > To retrieve entitlements for a specific game, use the *game_id* query parameter to filter results. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/companies.md) that holds ownership of the game. - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/companies.md) that holds ownership of the game. Reference: https://dev.twitch.tv/docs/api/reference/entitlements/#get-drops-entitlements */
72
+ export declare const getDropsEntitlements: API.PaginatedOperationMethod<GetDropsEntitlementsRequest, GetDropsEntitlementsResponse, GetDropsEntitlementsError, TwitchOpContext, GetDropsEntitlementsResponseDataItem>;
73
+ export type UpdateDropsEntitlementsError = TwitchOpError;
74
+ /** Update Drops Entitlements Updates the Drop entitlement's fulfillment status. The following table identifies which entitlements are updated based on the type of access token used. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/companies.md) that holds ownership of the game. - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). The Client ID associated with the access token must be owned by a user who is a member of the [organization](https://dev.twitch.tv/docs/companies.md) that holds ownership of the game. Reference: https://dev.twitch.tv/docs/api/reference/entitlements/#update-drops-entitlements */
75
+ export declare const updateDropsEntitlements: API.OperationMethod<UpdateDropsEntitlementsRequest, UpdateDropsEntitlementsResponse, UpdateDropsEntitlementsError, TwitchOpContext>;
76
+ //# sourceMappingURL=entitlements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlements.d.ts","sources":["../../src/services/entitlements.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,MAAM,iCAAiC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,WAAW,2BAA2B;IAC1C,oRAAoR;IACpR,EAAE,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IACnD,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,uLAAuL;IACvL,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,8LAA8L;IAC9L,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,yKAAyK;IACzK,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AACD,MAAM,WAAW,oCAAoC;IACnD,6CAA6C;IAC7C,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,wFAAwF;IACxF,OAAO,CAAC,EAAE,MA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AAwB,CAC7D,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,eAAe,EACf,oCAAoC,CAoB9B,CAAC;AAET,MAAM,MAAM,4BAA4B,GAAG,aAAa,CAAC;AACzD,s2BAAs2B;AACt2B,eAAO,MAAM,uBAAuB,EAAE,GAAG,CAAC,eAAe,CACvD,8BAA8B,EAC9B,+BAA+B,EAC/B,4BAA4B,EAC5B,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 _}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:`Entitlements`,propagate:`w3c`};const y=/*@__PURE__*/ d(u=>u===o?l(`GetDropsEntitlements`,`{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};$8(>6)@"%Request";$8(>7)@"%ResponseDataItem";$9(#2);$8(>8)@"%ResponsePagination";$8(>9)@"%Response";$7({id:$4(#3:0.pipe($2())),user_id:$4($5.pipe($2())),game_id:$4($5.pipe($2())),fulfillment_status:$4($5.pipe($2())),after:$4($5.pipe($2())),first:$4($6.pipe($2()))}).pipe($1({method:"GET",uri:"/entitlements/drops",code:200}));$7({id:$4($5),benefit_id:$4($5),timestamp:$4($5),user_id:$4($5),game_id:$4($5),fulfillment_status:$4($5),last_updated:$4($5)});$7({cursor:$4($5)});$7({data:#3,pagination:$4(#4)})`,[r,h,g,__d0,i,t,e,n,a,_,c,p,m,v,f]):s(y,u));const b=/*@__PURE__*/ u(e=>e===o?l(`UpdateDropsEntitlements`,`{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({entitlement_ids:#2:0,fulfillment_status:$3}).pipe($1({method:"PATCH",uri:"/entitlements/drops",code:200}));$4({status:$6($3),ids:$6(#2:0)});$4({data:$6(#3)})`,[r,h,__d0,t,n,a,i,_,c,p,m,v]):s(b,e));function __d0(){return[`$2($1)`,[r,t,_]]}export{y as getDropsEntitlements,b as updateDropsEntitlements};
2
+ //# sourceMappingURL=entitlements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlements.js","names":["API.D","API.named","__L.at","T.Http","T.Query","S.optional","S.String","S.Number","S.Struct","S.suspend","S.Array","Retry.Retry","API.call","Number","String","Struct","at","optional","suspend","D","call","TwitchServiceErrors","op","opPaginated","paginateCursor","TwitchProtocol","Retry","Http","Query","Array","TELEMETRY","getDropsEntitlements","i","named","updateDropsEntitlements"],"sources":["../../src/services/entitlements.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,eACT,UAAW,KACb,EAuEA,MAAaC,EAMK,gBAAiB,GAAgBC,IAAMhC,EAAQC,EAAU,uBAAwB,mtBAAotB,CAACC,EAAQC,EAAQC,EAAS,KAAMC,EAAYC,EAAUC,EAAUC,EAAUC,EAAWC,EAASW,EAAqBI,EAAgBd,EAAamB,EAAWN,CAAc,CAAC,EAAIZ,EAASmB,EAAsBC,CAAC,CAAC,EAItgC,MAAaE,EAKK,gBAAQ,GAAgBF,IAAMhC,EAAQC,EAAU,0BAA2B,wUAAyU,CAACC,EAAQC,EAAQ,KAAMG,EAAUE,EAAUC,EAAWJ,EAAYK,EAASW,EAAqBI,EAAgBd,EAAamB,CAAS,CAAC,EAAIlB,EAASsB,EAAyBF,CAAC,CAAC,EAMrlB,SAAS,MAAY,CACnB,MAAO,CAAC,SAAU,CAAC9B,EAAQI,EAAUI,CAAO,CAAC,CAC/C"}
@@ -0,0 +1,158 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import type * as Redacted from "effect/Redacted";
3
+ import { type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
4
+ export type { TwitchOpError, TwitchOpContext };
5
+ /** The transport details that you want Twitch to use when sending you notifications. */
6
+ export interface CreateEventsubSubscriptionRequestTransport {
7
+ /** The transport method. Possible values: - `webhook` - `websocket` - `conduit` */
8
+ method: string;
9
+ /** The callback URL where the notifications are sent. The URL must use the HTTPS protocol and port 443. See [Processing an event](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md#processing-an-event). Specify this field only if *method* is set to **webhook**. **NOTE**: Redirects are not followed. */
10
+ callback?: string | undefined;
11
+ /** The secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see [Verifying the event message](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md#verifying-the-event-message). Specify this field only if *method* is set to **webhook**. */
12
+ secret?: string | Redacted.Redacted<string> | undefined;
13
+ /** An ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message. Specify this field only if *method* is set to **websocket**. */
14
+ session_id?: string | undefined;
15
+ /** An ID that identifies the conduit to send notifications to. When you create a conduit, the server returns the conduit ID. Specify this field only if *method* is set to **conduit**. */
16
+ conduit_id?: string | undefined;
17
+ }
18
+ export interface CreateEventsubSubscriptionRequest {
19
+ /** The type of subscription to create. For a list of subscriptions that you can create, see [Subscription Types](https://dev.twitch.tv/docs/eventsub/reference.md). */
20
+ type: string;
21
+ /** The version number that identifies the definition of the subscription type that you want the response to use. */
22
+ version: string;
23
+ /** A JSON object that contains the parameter values that are specific to the specified subscription type. For the object's required and optional fields, see the subscription type's documentation. */
24
+ condition: unknown;
25
+ /** The transport details that you want Twitch to use when sending you notifications. */
26
+ transport: CreateEventsubSubscriptionRequestTransport;
27
+ /** Whether notifications are batched, so that a single notification can contain multiple events. Must be **true** for [drop.entitlement.grant](https://dev.twitch.tv/docs/eventsub/reference/drop.md#drop-entitlement-grant) subscriptions, and **false** or omitted for all other subscription types. */
28
+ is_batching_enabled?: boolean | undefined;
29
+ }
30
+ /** The transport details used to send the notifications. */
31
+ export interface CreateEventsubSubscriptionResponseDataItemTransport {
32
+ /** The transport method. Possible values: - `webhook` - `websocket` - `conduit` */
33
+ method?: string | undefined;
34
+ /** The callback URL where the notifications are sent. Included only if `method` is set to **webhook**. */
35
+ callback?: string | undefined;
36
+ /** An ID that identifies the WebSocket that notifications are sent to. Included only if `method` is set to **websocket**. */
37
+ session_id?: string | undefined;
38
+ /** The UTC date and time that the WebSocket connection was established. Included only if `method` is set to **websocket**. */
39
+ connected_at?: string | undefined;
40
+ /** An ID that identifies the conduit to send notifications to. Included only if `method` is set to **conduit**. */
41
+ conduit_id?: string | undefined;
42
+ }
43
+ export interface CreateEventsubSubscriptionResponseDataItem {
44
+ /** An ID that identifies the subscription. */
45
+ id?: string | undefined;
46
+ /** The subscription's status. The subscriber receives events only for enabled subscriptions. Possible values: - `enabled`: The subscription is enabled. - `webhook_callback_verification_pending`: The subscription is pending verification of the specified callback URL (see [Responding to a challenge request](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md#responding-to-a-challenge-request)). */
47
+ status?: string | undefined;
48
+ /** The subscription's type. See [Subscription Types](https://dev.twitch.tv/docs/eventsub/reference.md). */
49
+ type?: string | undefined;
50
+ /** The version number that identifies this definition of the subscription's data. */
51
+ version?: string | undefined;
52
+ /** The subscription's parameter values. This is a object whose contents are determined by the subscription type. */
53
+ condition?: unknown | undefined;
54
+ /** The date and time (in RFC3339 format) of when the subscription was created. */
55
+ created_at?: string | undefined;
56
+ /** The transport details used to send the notifications. */
57
+ transport?: CreateEventsubSubscriptionResponseDataItemTransport | undefined;
58
+ /** The amount that the subscription counts against your limit. [Learn More](https://dev.twitch.tv/docs/eventsub/manage-subscriptions.md#subscription-limits) */
59
+ cost?: number | undefined;
60
+ /** Whether notifications are batched. Included only if **true**, which is the case for drop.entitlement.grant subscriptions. */
61
+ is_batching_enabled?: boolean | undefined;
62
+ }
63
+ /** A list that contains the single subscription that you created. */
64
+ export type CreateEventsubSubscriptionResponseDataList = Array<CreateEventsubSubscriptionResponseDataItem>;
65
+ export interface CreateEventsubSubscriptionResponse {
66
+ /** A list that contains the single subscription that you created. */
67
+ data?: CreateEventsubSubscriptionResponseDataList | undefined;
68
+ /** The total number of subscriptions you've created. */
69
+ total?: number | undefined;
70
+ /** The sum of all of your subscription costs. [Learn More](https://dev.twitch.tv/docs/eventsub/manage-subscriptions.md#subscription-limits) */
71
+ total_cost?: number | undefined;
72
+ /** The maximum total cost that you're allowed to incur for all subscriptions you create. */
73
+ max_total_cost?: number | undefined;
74
+ }
75
+ export interface DeleteEventsubSubscriptionRequest {
76
+ /** The ID of the subscription to delete. */
77
+ id: string;
78
+ }
79
+ export interface DeleteEventsubSubscriptionResponse {
80
+ }
81
+ export interface GetEventsubSubscriptionsRequest {
82
+ /** Filter subscriptions by its status. Possible values: - `enabled`: The subscription is enabled. - `webhook_callback_verification_pending`: The subscription is pending verification of the specified callback URL. - `webhook_callback_verification_failed`: The specified callback URL failed verification. - `notification_failures_exceeded`: The notification delivery failure rate was too high. - `authorization_revoked`: The authorization was revoked for one or more users specified in the Condition object. - `moderator_removed`: The moderator that authorized the subscription is no longer one of the broadcaster's moderators. - `guest_star_moderator_removed`: The [Guest Star moderator](https://help.twitch.tv/s/article/stream-together#settings:~:text=Stream%20Together%20mods%20can%20take%20actions%20like%20inviting%20guests%2C%20reporting%20guests%2C%20removing%20guests%2C%20muting%20guests%2C%20and%20turning%20off%20guests%20video.) that authorized the subscription is no longer one of the broadcaster's Guest Star moderators. - `user_removed`: One of the users specified in the Condition object was removed. - `chat_user_banned`: The user specified in the Condition object was banned from the broadcaster's chat. - `version_removed`: The subscription to subscription type and version is no longer supported. - `beta_maintenance`: The subscription to the beta subscription type was removed due to maintenance. - `websocket_disconnected`: The client closed the connection. - `websocket_failed_ping_pong`: The client failed to respond to a ping message. - `websocket_received_inbound_traffic`: The client sent a non-pong message. Clients may only send pong messages (and only in response to a ping message). - `websocket_connection_unused`: The client failed to subscribe to events within the required time. - `websocket_internal_error`: The Twitch WebSocket server experienced an unexpected error. - `websocket_network_timeout`: The Twitch WebSocket server timed out writing the message to the client. - `websocket_network_error`: The Twitch WebSocket server experienced a network error writing the message to the client. - `websocket_failed_to_reconnect`: The client failed to reconnect to the Twitch WebSocket server within the required time after a Reconnect Message. - `conduit_deleted`: The conduit associated with the subscription was deleted. */
83
+ status?: string | undefined;
84
+ /** Filter subscriptions by subscription type. For a list of subscription types, see [Subscription Types](https://dev.twitch.tv/docs/eventsub/reference.md). */
85
+ type?: string | undefined;
86
+ /** Filter subscriptions by user ID. The response contains subscriptions where this ID matches a user ID that you specified in the **Condition** object when you [created the subscription](https://dev.twitch.tv/docs/api/reference/eventsub.md#create-eventsub-subscription). */
87
+ user_id?: string | undefined;
88
+ /** Returns an array with the subscription matching the ID (as long as it is owned by the client making the request), or an empty array if there is no matching subscription. */
89
+ subscription_id?: string | undefined;
90
+ /** Filter subscriptions by [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md) ID. */
91
+ conduit_id?: string | undefined;
92
+ /** The cursor used to get the next page of results. The `pagination` object in the response contains the cursor's value. */
93
+ after?: string | undefined;
94
+ }
95
+ /** The transport details used to send the notifications. */
96
+ export interface GetEventsubSubscriptionsResponseDataItemTransport {
97
+ /** The transport method. Possible values: - `webhook` - `websocket` - `conduit` */
98
+ method?: string | undefined;
99
+ /** The callback URL where the notifications are sent. Included only if `method` is set to **webhook**. */
100
+ callback?: string | undefined;
101
+ /** An ID that identifies the WebSocket that notifications are sent to. Included only if `method` is set to **websocket**. */
102
+ session_id?: string | undefined;
103
+ /** The UTC date and time that the WebSocket connection was established. Included only if `method` is set to **websocket**. */
104
+ connected_at?: string | undefined;
105
+ /** The UTC date and time that the WebSocket connection was lost. Included only if `method` is set to **websocket**. */
106
+ disconnected_at?: string | undefined;
107
+ /** An ID that identifies the conduit that notifications are sent to. Included only if `method` is set to **conduit**. */
108
+ conduit_id?: string | undefined;
109
+ }
110
+ export interface GetEventsubSubscriptionsResponseDataItem {
111
+ /** An ID that identifies the subscription. */
112
+ id?: string | undefined;
113
+ /** The subscription's status. The subscriber receives events only for **enabled** subscriptions. Possible values: - `enabled`: The subscription is enabled. - `webhook_callback_verification_pending`: The subscription is pending verification of the specified callback URL. - `webhook_callback_verification_failed`: The specified callback URL failed verification. - `notification_failures_exceeded`: The notification delivery failure rate was too high. - `authorization_revoked`: The authorization was revoked for one or more users specified in the Condition object. - `moderator_removed`: The moderator that authorized the subscription is no longer one of the broadcaster's moderators. - `guest_star_moderator_removed`: The [Guest Star moderator](https://help.twitch.tv/s/article/stream-together#settings:~:text=Stream%20Together%20mods%20can%20take%20actions%20like%20inviting%20guests%2C%20reporting%20guests%2C%20removing%20guests%2C%20muting%20guests%2C%20and%20turning%20off%20guests%20video.) that authorized the subscription is no longer one of the broadcaster's Guest Star moderators. - `user_removed`: One of the users specified in the Condition object was removed. - `chat_user_banned`: The user specified in the Condition object was banned from the broadcaster's chat. - `version_removed`: The subscription to subscription type and version is no longer supported. - `beta_maintenance`: The subscription to the beta subscription type was removed due to maintenance. - `websocket_disconnected`: The client closed the connection. - `websocket_failed_ping_pong`: The client failed to respond to a ping message. - `websocket_received_inbound_traffic`: The client sent a non-pong message. Clients may only send pong messages (and only in response to a ping message). - `websocket_connection_unused`: The client failed to subscribe to events within the required time. - `websocket_internal_error`: The Twitch WebSocket server experienced an unexpected error. - `websocket_network_timeout`: The Twitch WebSocket server timed out writing the message to the client. - `websocket_network_error`: The Twitch WebSocket server experienced a network error writing the message to the client. - `websocket_failed_to_reconnect`: The client failed to reconnect to the Twitch WebSocket server within the required time after a Reconnect Message. - `conduit_deleted`: The conduit associated with the subscription was deleted. */
114
+ status?: string | undefined;
115
+ /** The subscription's type. See [Subscription Types](https://dev.twitch.tv/docs/eventsub/reference.md). */
116
+ type?: string | undefined;
117
+ /** The version number that identifies this definition of the subscription's data. */
118
+ version?: string | undefined;
119
+ /** The subscription's parameter values. This is a JSON object whose contents are determined by the subscription type. */
120
+ condition?: unknown | undefined;
121
+ /** The date and time (in RFC3339 format) of when the subscription was created. */
122
+ created_at?: string | undefined;
123
+ /** The transport details used to send the notifications. */
124
+ transport?: GetEventsubSubscriptionsResponseDataItemTransport | undefined;
125
+ /** The amount that the subscription counts against your limit. [Learn More](https://dev.twitch.tv/docs/eventsub/manage-subscriptions.md#subscription-limits) */
126
+ cost?: number | undefined;
127
+ /** Whether notifications are batched. Included only if **true**, which is the case for drop.entitlement.grant subscriptions. */
128
+ is_batching_enabled?: boolean | undefined;
129
+ }
130
+ /** The list of subscriptions. The list is ordered by the oldest subscription first. The list is empty if the client hasn't created subscriptions or there are no subscriptions that match the specified filter criteria. */
131
+ export type GetEventsubSubscriptionsResponseDataList = Array<GetEventsubSubscriptionsResponseDataItem>;
132
+ /** An object that contains the cursor used to get the next page of subscriptions. The object is empty if there are no more pages to get. The number of subscriptions returned per page is undertermined. */
133
+ export interface GetEventsubSubscriptionsResponsePagination {
134
+ /** The cursor value that you set the *after* query parameter to. */
135
+ cursor?: string | undefined;
136
+ }
137
+ export interface GetEventsubSubscriptionsResponse {
138
+ /** The list of subscriptions. The list is ordered by the oldest subscription first. The list is empty if the client hasn't created subscriptions or there are no subscriptions that match the specified filter criteria. */
139
+ data: GetEventsubSubscriptionsResponseDataList;
140
+ /** The total number of subscriptions that you've created. If you use a user access token, the count includes only the user's WebSocket subscriptions. */
141
+ total?: number | undefined;
142
+ /** The sum of all of your subscription costs. [Learn More](https://dev.twitch.tv/docs/eventsub/manage-subscriptions.md#subscription-limits) */
143
+ total_cost?: number | undefined;
144
+ /** The maximum total cost that you're allowed to incur for all subscriptions that you create. If you use a user access token, this is the WebSocket limit of 10. */
145
+ max_total_cost?: number | undefined;
146
+ /** An object that contains the cursor used to get the next page of subscriptions. The object is empty if there are no more pages to get. The number of subscriptions returned per page is undertermined. */
147
+ pagination?: GetEventsubSubscriptionsResponsePagination | undefined;
148
+ }
149
+ export type CreateEventsubSubscriptionError = TwitchOpError;
150
+ /** Create EventSub Subscription Creates an EventSub subscription. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Required if you use [webhooks](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md) or [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md) to receive events. If the subscription type requires user authorization, the user must have granted your app (Client ID) permissions to receive those events before you subscribe to them. For example, to subscribe to [channel.subscribe](https://dev.twitch.tv/docs/eventsub/reference/channel.md#channel-subscribe) events, your app must get a user access token that includes the **channel:read:subscriptions** scope, which adds the required permission to your App Access Token's Client ID. - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). Required if you use [WebSockets](https://dev.twitch.tv/docs/eventsub/handling-websocket-events.md) to receive events. If the subscription type requires user authorization, the token must include the required scope. However, if the subscription type doesn't include user authorization, the token may include any scopes or no scopes. Reference: https://dev.twitch.tv/docs/api/reference/eventsub/#create-eventsub-subscription */
151
+ export declare const createEventsubSubscription: API.OperationMethod<CreateEventsubSubscriptionRequest, CreateEventsubSubscriptionResponse, CreateEventsubSubscriptionError, TwitchOpContext>;
152
+ export type DeleteEventsubSubscriptionError = TwitchOpError;
153
+ /** Delete EventSub Subscription Deletes an EventSub subscription. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Required to delete subscriptions that use [webhooks](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md) or [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). Required to delete subscriptions that use [WebSockets](https://dev.twitch.tv/docs/eventsub/handling-websocket-events.md). The token must be for the user who created the subscription, and may include any scopes. Reference: https://dev.twitch.tv/docs/api/reference/eventsub/#delete-eventsub-subscription */
154
+ export declare const deleteEventsubSubscription: API.OperationMethod<DeleteEventsubSubscriptionRequest, DeleteEventsubSubscriptionResponse, DeleteEventsubSubscriptionError, TwitchOpContext>;
155
+ export type GetEventsubSubscriptionsError = TwitchOpError;
156
+ /** Get EventSub Subscriptions Gets a list of EventSub subscriptions that the client in the access token created. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Returns the subscriptions that use [webhooks](https://dev.twitch.tv/docs/eventsub/handling-webhook-events.md) or [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). Returns the subscriptions that use [WebSockets](https://dev.twitch.tv/docs/eventsub/handling-websocket-events.md) and that the user created. The token may include any scopes. Reference: https://dev.twitch.tv/docs/api/reference/eventsub/#get-eventsub-subscriptions */
157
+ export declare const getEventsubSubscriptions: API.PaginatedOperationMethod<GetEventsubSubscriptionsRequest, GetEventsubSubscriptionsResponse, GetEventsubSubscriptionsError, TwitchOpContext, GetEventsubSubscriptionsResponseDataItem>;
158
+ //# sourceMappingURL=eventsub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventsub.d.ts","sources":["../../src/services/eventsub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAIjD,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM1F,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAc/C,wFAAwF;AACxF,MAAM,WAAW,0CAA0C;IACzD,mFAAmF;IACnF,MAAM,EAAE,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C;CAC7B;AACD,MAAM,WAAW,gCAAgC;IAC/C,4NAA4N;IAC5N,IAAI,EAAE,wCAAwC,CAAC;IAC/C,yJAAyJ;IACzJ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,+IAA+I;IAC/I,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,oKAAoK;IACpK,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,4MAA4M;IAC5M,UAAU,CAAC,EAAE,0CAA0C,GAAG,SAAS,CAAC;CACrE;AACD,MAAM,MAAM,+BAA+B,GAAG,aAAa,CAAC;AAC5D,i2CAAi2C;AACj2C,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,eAAe,CAC1D,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,eAAe,CAUd,CAAC;AAEJ,MAAM,MAAM,+BAA+B,GAAG,aAAa,CAAC;AAC5D,wxBAAwxB;AACxxB,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,eAAe,CAC1D,iCAAiC,EACjC,kCAAkC,EAClC,+BAA+B,EAC/B,eAAe,CAUd,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GAAG,aAAa,CAAC;AAC1D,0xBAA0xB;AAC1xB,eAAO,MAAM,wBAAwB,EAAE,GAAG,CAAC,wBAAwB,CACjE,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,eAAe,EACf,wCAAwC,CAmBlC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{Gc as e,Jc as t,Kc as n,Pc as r,Rc as i,Wc as a,Xc as o,a as s,b as c,errors$TwitchServiceErrors as l,l as u,n as d,o as f,pagination$paginateCursor as p,protocol$TwitchProtocol as m,retry$Retry as h,traits$Http as g,traits$Query as _,traits$SensitiveValue as v,wc as y,xc as b}from"../_bundle/sdk.js";const x={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:`Eventsub`,propagate:`w3c`};const S=/*@__PURE__*/ d(d=>d===s?u(`CreateEventsubSubscription`,`{input:#2,output:#6,errors:[],serviceErrors:$11,protocol:$12,retry:$13,telemetry:$14,span:"%"};$5(>7)@"%RequestTransport";$5(>8)@"%Request";$5(>9)@"%ResponseDataItemTransport";$5(>10)@"%ResponseDataItem";$10(#4);$5(>11)@"%Response";$4({method:$1,callback:$2($1),secret:$2($1.pipe($3({}))),session_id:$2($1),conduit_id:$2($1)});$4({type:$1,version:$1,condition:$7,transport:#1,is_batching_enabled:$2($8)}).pipe($6({method:"POST",uri:"/eventsub/subscriptions",code:200}));$4({method:$2($1),callback:$2($1),session_id:$2($1),connected_at:$2($1),conduit_id:$2($1)});$4({id:$2($1),status:$2($1),type:$2($1),version:$2($1),condition:$2($7),created_at:$2($1),transport:$2(#3),cost:$2($9),is_batching_enabled:$2($8)});$4({data:$2(#5),total:$2($9),total_cost:$2($9),max_total_cost:$2($9)})`,[i,t,a,v,n,o,g,r,b,e,y,l,m,h,x]):c(S,d));const C=/*@__PURE__*/ d(e=>e===s?u(`DeleteEventsubSubscription`,`{input:#1,output:#2,errors:[],serviceErrors:$6,protocol:$7,retry:$8,telemetry:$9,span:"%"};$5(>3)@"%Request";$5(>4)@"%Response";$4({id:$3.pipe($2())}).pipe($1({method:"DELETE",uri:"/eventsub/subscriptions",code:200}));$4({})`,[i,g,_,t,n,o,l,m,h,x]):c(C,e));const w=/*@__PURE__*/ f(d=>d===s?u(`GetEventsubSubscriptions`,`{input:#1,output:#6,errors:[],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%",pagination:{mode:"cursor",inputToken:"after",outputToken:"pagination.cursor",items:"data"},strategy:$14};$3(>8)@"%Request";$3(>9)@"%ResponseDataItemTransport";$3(>10)@"%ResponseDataItem";$9(#3);$3(>11)@"%ResponsePagination";$3(>12)@"%Response";$5($4.pipe($15()));$2({status:~7,type:~7,user_id:~7,subscription_id:~7,conduit_id:~7,after:~7}).pipe($1({method:"GET",uri:"/eventsub/subscriptions",code:200}));$2({method:$5($4),callback:$5($4),session_id:$5($4),connected_at:$5($4),disconnected_at:$5($4),conduit_id:$5($4)});$2({id:$5($4),status:$5($4),type:$5($4),version:$5($4),condition:$5($6),created_at:$5($4),transport:$5(#2),cost:$5($7),is_batching_enabled:$5($8)});$2({cursor:$5($4)});$2({data:#4,total:$5($7),total_cost:$5($7),max_total_cost:$5($7),pagination:$5(#5)})`,[i,g,n,o,t,a,r,e,b,y,l,m,h,x,p,_]):c(w,d));export{S as createEventsubSubscription,C as deleteEventsubSubscription,w as getEventsubSubscriptions};
2
+ //# sourceMappingURL=eventsub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventsub.js","names":["API.D","API.named","__L.at","S.String","S.optional","T.SensitiveValue","S.Struct","S.suspend","T.Http","S.Unknown","S.Boolean","S.Number","S.Array","Retry.Retry","API.call","T.Query","Number","String","Struct","Unknown","at","optional","suspend","D","call","TwitchServiceErrors","named","op","opPaginated","paginateCursor","TwitchProtocol","Retry","Http","Query","SensitiveValue","Array","Boolean","TELEMETRY","createEventsubSubscription","i","deleteEventsubSubscription","getEventsubSubscriptions"],"sources":["../../src/services/eventsub.ts"],"mappings":"qTAcA,MAAMqC,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,EAqJA,MAAaC,EAKK,gBAAQ,GAAgBC,IAAMvC,EAAQC,EAAU,6BAA8B,+wBAAgxB,CAACC,EAAQC,EAAUC,EAAYC,EAAkBC,EAAUC,EAAWC,EAAQC,EAAWC,EAAWC,EAAUC,EAASa,EAAqBK,EAAgBjB,EAAawB,CAAS,CAAC,EAAIvB,EAASwB,EAA4BC,CAAC,CAAC,EAI9kC,MAAaC,EAKK,gBAAQ,GAAgBD,IAAMvC,EAAQC,EAAU,6BAA8B,mOAAoO,CAACC,EAAQM,EAAQO,EAASZ,EAAUG,EAAUC,EAAWkB,EAAqBK,EAAgBjB,EAAawB,CAAS,CAAC,EAAIvB,EAAS0B,EAA4BD,CAAC,CAAC,EAIpe,MAAaE,EAMK,gBAAiB,GAAgBF,IAAMvC,EAAQC,EAAU,2BAA4B,o2BAAq2B,CAACC,EAAQM,EAAQF,EAAUC,EAAWJ,EAAUC,EAAYK,EAAWE,EAAUD,EAAWE,EAASa,EAAqBK,EAAgBjB,EAAawB,EAAWR,EAAgBd,CAAO,CAAC,EAAID,EAAS2B,EAA0BF,CAAC,CAAC"}