@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.
- package/LICENSE +201 -0
- package/README.md +83 -2
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +31 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +1 -0
- package/lib/errors.d.ts +49 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +1 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +1 -0
- package/lib/protocol.d.ts +19 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +1 -0
- package/lib/retry.d.ts +50 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +1 -0
- package/lib/services/ads.d.ts +75 -0
- package/lib/services/ads.d.ts.map +1 -0
- package/lib/services/ads.js +2 -0
- package/lib/services/ads.js.map +1 -0
- package/lib/services/analytics.d.ts +90 -0
- package/lib/services/analytics.d.ts.map +1 -0
- package/lib/services/analytics.js +2 -0
- package/lib/services/analytics.js.map +1 -0
- package/lib/services/bits.d.ts +284 -0
- package/lib/services/bits.d.ts.map +1 -0
- package/lib/services/bits.js +2 -0
- package/lib/services/bits.js.map +1 -0
- package/lib/services/ccls.d.ts +26 -0
- package/lib/services/ccls.d.ts.map +1 -0
- package/lib/services/ccls.js +2 -0
- package/lib/services/ccls.js.map +1 -0
- package/lib/services/channel_points.d.ts +416 -0
- package/lib/services/channel_points.d.ts.map +1 -0
- package/lib/services/channel_points.js +2 -0
- package/lib/services/channel_points.js.map +1 -0
- package/lib/services/channels.d.ts +173 -0
- package/lib/services/channels.d.ts.map +1 -0
- package/lib/services/channels.js +2 -0
- package/lib/services/channels.js.map +1 -0
- package/lib/services/charity.d.ts +97 -0
- package/lib/services/charity.d.ts.map +1 -0
- package/lib/services/charity.js +2 -0
- package/lib/services/charity.js.map +1 -0
- package/lib/services/chat.d.ts +638 -0
- package/lib/services/chat.d.ts.map +1 -0
- package/lib/services/chat.js +33 -0
- package/lib/services/chat.js.map +1 -0
- package/lib/services/clips.d.ts +153 -0
- package/lib/services/clips.d.ts.map +1 -0
- package/lib/services/clips.js +2 -0
- package/lib/services/clips.js.map +1 -0
- package/lib/services/conduits.d.ts +172 -0
- package/lib/services/conduits.d.ts.map +1 -0
- package/lib/services/conduits.js +2 -0
- package/lib/services/conduits.js.map +1 -0
- package/lib/services/entitlements.d.ts +76 -0
- package/lib/services/entitlements.d.ts.map +1 -0
- package/lib/services/entitlements.js +2 -0
- package/lib/services/entitlements.js.map +1 -0
- package/lib/services/eventsub.d.ts +158 -0
- package/lib/services/eventsub.d.ts.map +1 -0
- package/lib/services/eventsub.js +2 -0
- package/lib/services/eventsub.js.map +1 -0
- package/lib/services/extensions.d.ts +497 -0
- package/lib/services/extensions.d.ts.map +1 -0
- package/lib/services/extensions.js +2 -0
- package/lib/services/extensions.js.map +1 -0
- package/lib/services/games.d.ts +57 -0
- package/lib/services/games.d.ts.map +1 -0
- package/lib/services/games.js +2 -0
- package/lib/services/games.js.map +1 -0
- package/lib/services/goals.d.ts +37 -0
- package/lib/services/goals.d.ts.map +1 -0
- package/lib/services/goals.js +2 -0
- package/lib/services/goals.js.map +1 -0
- package/lib/services/guest_star.d.ts +314 -0
- package/lib/services/guest_star.d.ts.map +1 -0
- package/lib/services/guest_star.js +2 -0
- package/lib/services/guest_star.js.map +1 -0
- package/lib/services/hype_train.d.ts +91 -0
- package/lib/services/hype_train.d.ts.map +1 -0
- package/lib/services/hype_train.js +2 -0
- package/lib/services/hype_train.js.map +1 -0
- package/lib/services/index.d.ts +30 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +29 -0
- package/lib/services/moderation.d.ts +731 -0
- package/lib/services/moderation.d.ts.map +1 -0
- package/lib/services/moderation.js +41 -0
- package/lib/services/moderation.js.map +1 -0
- package/lib/services/polls.d.ts +173 -0
- package/lib/services/polls.d.ts.map +1 -0
- package/lib/services/polls.js +2 -0
- package/lib/services/polls.js.map +1 -0
- package/lib/services/predictions.d.ts +221 -0
- package/lib/services/predictions.d.ts.map +1 -0
- package/lib/services/predictions.js +2 -0
- package/lib/services/predictions.js.map +1 -0
- package/lib/services/raids.d.ts +34 -0
- package/lib/services/raids.d.ts.map +1 -0
- package/lib/services/raids.js +2 -0
- package/lib/services/raids.js.map +1 -0
- package/lib/services/schedule.d.ts +223 -0
- package/lib/services/schedule.d.ts.map +1 -0
- package/lib/services/schedule.js +2 -0
- package/lib/services/schedule.js.map +1 -0
- package/lib/services/search.d.ts +89 -0
- package/lib/services/search.d.ts.map +1 -0
- package/lib/services/search.js +2 -0
- package/lib/services/search.js.map +1 -0
- package/lib/services/streams.d.ts +235 -0
- package/lib/services/streams.d.ts.map +1 -0
- package/lib/services/streams.js +2 -0
- package/lib/services/streams.js.map +1 -0
- package/lib/services/subscriptions.d.ts +96 -0
- package/lib/services/subscriptions.d.ts.map +1 -0
- package/lib/services/subscriptions.js +2 -0
- package/lib/services/subscriptions.js.map +1 -0
- package/lib/services/teams.d.ts +90 -0
- package/lib/services/teams.d.ts.map +1 -0
- package/lib/services/teams.js +2 -0
- package/lib/services/teams.js.map +1 -0
- package/lib/services/users.d.ts +324 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +2 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/videos.d.ts +101 -0
- package/lib/services/videos.d.ts.map +1 -0
- package/lib/services/videos.js +2 -0
- package/lib/services/videos.js.map +1 -0
- package/lib/services/whispers.d.ts +17 -0
- package/lib/services/whispers.d.ts.map +1 -0
- package/lib/services/whispers.js +2 -0
- package/lib/services/whispers.js.map +1 -0
- package/lib/services.lazy/ads.js +1 -0
- package/lib/services.lazy/analytics.js +1 -0
- package/lib/services.lazy/bits.js +1 -0
- package/lib/services.lazy/ccls.js +1 -0
- package/lib/services.lazy/channel_points.js +1 -0
- package/lib/services.lazy/channels.js +1 -0
- package/lib/services.lazy/charity.js +1 -0
- package/lib/services.lazy/chat.js +3 -0
- package/lib/services.lazy/clips.js +1 -0
- package/lib/services.lazy/conduits.js +1 -0
- package/lib/services.lazy/entitlements.js +1 -0
- package/lib/services.lazy/eventsub.js +1 -0
- package/lib/services.lazy/extensions.js +1 -0
- package/lib/services.lazy/games.js +1 -0
- package/lib/services.lazy/goals.js +1 -0
- package/lib/services.lazy/guest_star.js +1 -0
- package/lib/services.lazy/hype_train.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/moderation.js +3 -0
- package/lib/services.lazy/polls.js +1 -0
- package/lib/services.lazy/predictions.js +1 -0
- package/lib/services.lazy/raids.js +1 -0
- package/lib/services.lazy/schedule.js +1 -0
- package/lib/services.lazy/search.js +1 -0
- package/lib/services.lazy/streams.js +1 -0
- package/lib/services.lazy/subscriptions.js +1 -0
- package/lib/services.lazy/teams.js +1 -0
- package/lib/services.lazy/users.js +1 -0
- package/lib/services.lazy/videos.js +1 -0
- package/lib/services.lazy/whispers.js +1 -0
- package/lib/traits.d.ts +10 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +1 -0
- package/package.json +88 -3
- package/src/credentials.ts +79 -0
- package/src/errors.ts +78 -0
- package/src/index.ts +45 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +43 -0
- package/src/retry.ts +69 -0
- package/src/services/ads.ts +228 -0
- package/src/services/analytics.ts +253 -0
- package/src/services/bits.ts +631 -0
- package/src/services/ccls.ts +96 -0
- package/src/services/channel_points.ts +804 -0
- package/src/services/channels.ts +471 -0
- package/src/services/charity.ts +250 -0
- package/src/services/chat.ts +1547 -0
- package/src/services/clips.ts +385 -0
- package/src/services/conduits.ts +453 -0
- package/src/services/entitlements.ts +219 -0
- package/src/services/eventsub.ts +372 -0
- package/src/services/extensions.ts +1098 -0
- package/src/services/games.ts +184 -0
- package/src/services/goals.ts +110 -0
- package/src/services/guest_star.ts +762 -0
- package/src/services/hype_train.ts +214 -0
- package/src/services/index.ts +30 -0
- package/src/services/moderation.ts +1817 -0
- package/src/services/polls.ts +363 -0
- package/src/services/predictions.ts +432 -0
- package/src/services/raids.ts +127 -0
- package/src/services/schedule.ts +539 -0
- package/src/services/search.ts +248 -0
- package/src/services/streams.ts +579 -0
- package/src/services/subscriptions.ts +247 -0
- package/src/services/teams.ts +225 -0
- package/src/services/users.ts +729 -0
- package/src/services/videos.ts +257 -0
- package/src/services/whispers.ts +71 -0
- package/src/traits.ts +47 -0
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
2
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-twitch/specs/api/reference). Do not edit.
|
|
3
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
4
|
+
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
5
|
+
import { TwitchServiceErrors } from "../errors.ts";
|
|
6
|
+
import { paginateCursor } from "../pagination.ts";
|
|
7
|
+
import { TwitchProtocol, type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
|
|
8
|
+
import * as Retry from "../retry.ts";
|
|
9
|
+
import * as T from "../traits.ts";
|
|
10
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
11
|
+
const __s: any[] = [];
|
|
12
|
+
|
|
13
|
+
export type { TwitchOpError, TwitchOpContext };
|
|
14
|
+
|
|
15
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
16
|
+
const TELEMETRY = {
|
|
17
|
+
system: "twitch-api",
|
|
18
|
+
responseHeaders: [
|
|
19
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
20
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
21
|
+
],
|
|
22
|
+
prefix: "Twitch",
|
|
23
|
+
service: "Users",
|
|
24
|
+
propagate: "w3c",
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export interface BlockUserRequest {
|
|
28
|
+
/** The ID of the user to block. If the broadcaster has already blocked the user, the API replaces the existing block. */
|
|
29
|
+
target_user_id: string;
|
|
30
|
+
/** The location where the harassment took place that is causing the brodcaster to block the user. Possible values: - `chat` - `whisper` */
|
|
31
|
+
source_context?: string | undefined;
|
|
32
|
+
/** The reason that the broadcaster is blocking the user. Possible values: - `harassment` - `spam` - `other` */
|
|
33
|
+
reason?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface BlockUserResponse {}
|
|
36
|
+
export type GetAuthorizationByUserRequestUserIdList = Array<string>;
|
|
37
|
+
export interface GetAuthorizationByUserRequest {
|
|
38
|
+
/** The ID of the user(s) you want to check authorization for. To specify more than one user, include the user_id parameter for each user to get. For example, 'user_id=1234&user_id=5678'. The maximum number of IDs you may specify is 10. */
|
|
39
|
+
user_id: GetAuthorizationByUserRequestUserIdList;
|
|
40
|
+
}
|
|
41
|
+
/** An array of all the scopes the user has granted to the client ID. */
|
|
42
|
+
export type GetAuthorizationByUserResponseDataItemScopesList = Array<string>;
|
|
43
|
+
export interface GetAuthorizationByUserResponseDataItem {
|
|
44
|
+
/** The user's ID. */
|
|
45
|
+
user_id?: string | undefined;
|
|
46
|
+
/** The user's display name. */
|
|
47
|
+
user_name?: string | undefined;
|
|
48
|
+
/** The user's login name. */
|
|
49
|
+
user_login?: string | undefined;
|
|
50
|
+
/** An array of all the scopes the user has granted to the client ID. */
|
|
51
|
+
scopes?: GetAuthorizationByUserResponseDataItemScopesList | undefined;
|
|
52
|
+
/** A boolean indicating whether or not the specified user has authorized this application. */
|
|
53
|
+
has_authorized?: boolean | undefined;
|
|
54
|
+
}
|
|
55
|
+
/** List of users and their authorized scopes. The list is in the same order as the *user_id* query parameters and doesn't include IDs that don't match a user. */
|
|
56
|
+
export type GetAuthorizationByUserResponseDataList = Array<GetAuthorizationByUserResponseDataItem>;
|
|
57
|
+
export interface GetAuthorizationByUserResponse {
|
|
58
|
+
/** List of users and their authorized scopes. The list is in the same order as the *user_id* query parameters and doesn't include IDs that don't match a user. */
|
|
59
|
+
data?: GetAuthorizationByUserResponseDataList | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface GetUserActiveExtensionsRequest {
|
|
62
|
+
/** The ID of the broadcaster whose active extensions you want to get. This parameter is required if you specify an app access token and is optional if you specify a user access token. If you specify a user access token and don't specify this parameter, the API uses the user ID from the access token. */
|
|
63
|
+
user_id?: string | undefined;
|
|
64
|
+
}
|
|
65
|
+
export interface GetUserActiveExtensionsResponseDataPanelValue {
|
|
66
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured this panel extension, and the object contains only this field. */
|
|
67
|
+
active?: boolean | undefined;
|
|
68
|
+
/** An ID that identifies the extension. */
|
|
69
|
+
id?: string | undefined;
|
|
70
|
+
/** The extension's version. */
|
|
71
|
+
version?: string | undefined;
|
|
72
|
+
/** The extension's name. */
|
|
73
|
+
name?: string | undefined;
|
|
74
|
+
}
|
|
75
|
+
/** A dictionary that contains the data for a panel extension. The dictionary always contains the keys 1, 2, and 3, one for each panel slot. The following fields contain the panel's data for each key. */
|
|
76
|
+
export type GetUserActiveExtensionsResponseDataPanelMap = {
|
|
77
|
+
[key: string]: GetUserActiveExtensionsResponseDataPanelValue | undefined;
|
|
78
|
+
};
|
|
79
|
+
export interface GetUserActiveExtensionsResponseDataOverlayValue {
|
|
80
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured this overlay extension, and the object contains only this field. */
|
|
81
|
+
active?: boolean | undefined;
|
|
82
|
+
/** An ID that identifies the extension. */
|
|
83
|
+
id?: string | undefined;
|
|
84
|
+
/** The extension's version. */
|
|
85
|
+
version?: string | undefined;
|
|
86
|
+
/** The extension's name. */
|
|
87
|
+
name?: string | undefined;
|
|
88
|
+
}
|
|
89
|
+
/** A dictionary that contains the data for a video-overlay extension. The dictionary always contains the key 1, for the single overlay slot. The following fields contain the overlay's data for that key. */
|
|
90
|
+
export type GetUserActiveExtensionsResponseDataOverlayMap = {
|
|
91
|
+
[key: string]: GetUserActiveExtensionsResponseDataOverlayValue | undefined;
|
|
92
|
+
};
|
|
93
|
+
export interface GetUserActiveExtensionsResponseDataComponentValue {
|
|
94
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured this component extension, and the object contains only this field. */
|
|
95
|
+
active?: boolean | undefined;
|
|
96
|
+
/** An ID that identifies the extension. */
|
|
97
|
+
id?: string | undefined;
|
|
98
|
+
/** The extension's version. */
|
|
99
|
+
version?: string | undefined;
|
|
100
|
+
/** The extension's name. */
|
|
101
|
+
name?: string | undefined;
|
|
102
|
+
/** The x-coordinate where the extension is placed. */
|
|
103
|
+
x?: number | undefined;
|
|
104
|
+
/** The y-coordinate where the extension is placed. */
|
|
105
|
+
y?: number | undefined;
|
|
106
|
+
}
|
|
107
|
+
/** A dictionary that contains the data for a video-component extension. The dictionary always contains the keys 1 and 2, one for each component slot. The following fields contain the component's data for each key. */
|
|
108
|
+
export type GetUserActiveExtensionsResponseDataComponentMap = {
|
|
109
|
+
[key: string]: GetUserActiveExtensionsResponseDataComponentValue | undefined;
|
|
110
|
+
};
|
|
111
|
+
/** The active extensions that the broadcaster has installed. */
|
|
112
|
+
export interface GetUserActiveExtensionsResponseData {
|
|
113
|
+
/** A dictionary that contains the data for a panel extension. The dictionary always contains the keys 1, 2, and 3, one for each panel slot. The following fields contain the panel's data for each key. */
|
|
114
|
+
panel?: GetUserActiveExtensionsResponseDataPanelMap | undefined;
|
|
115
|
+
/** A dictionary that contains the data for a video-overlay extension. The dictionary always contains the key 1, for the single overlay slot. The following fields contain the overlay's data for that key. */
|
|
116
|
+
overlay?: GetUserActiveExtensionsResponseDataOverlayMap | undefined;
|
|
117
|
+
/** A dictionary that contains the data for a video-component extension. The dictionary always contains the keys 1 and 2, one for each component slot. The following fields contain the component's data for each key. */
|
|
118
|
+
component?: GetUserActiveExtensionsResponseDataComponentMap | undefined;
|
|
119
|
+
}
|
|
120
|
+
export interface GetUserActiveExtensionsResponse {
|
|
121
|
+
/** The active extensions that the broadcaster has installed. */
|
|
122
|
+
data?: GetUserActiveExtensionsResponseData | undefined;
|
|
123
|
+
}
|
|
124
|
+
export type GetUserBlockListRequestUserIdList = Array<string>;
|
|
125
|
+
export interface GetUserBlockListRequest {
|
|
126
|
+
/** The ID of the broadcaster whose list of blocked users you want to get. */
|
|
127
|
+
broadcaster_id: string;
|
|
128
|
+
/** A list of user IDs used to filter the results. To specify more than one ID, include this parameter for each user you want to check. For example, 'user_id=1234&user_id=5678'. You may specify a maximum of 100 IDs. The returned list includes only those users that the broadcaster has blocked. If you specify this parameter, the *first* and *after* query parameters are ignored, the response's `pagination` object is empty, and the list is in no particular order. */
|
|
129
|
+
user_id?: GetUserBlockListRequestUserIdList | undefined;
|
|
130
|
+
/** 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. */
|
|
131
|
+
first?: number | undefined;
|
|
132
|
+
/** 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) */
|
|
133
|
+
after?: string | undefined;
|
|
134
|
+
}
|
|
135
|
+
export interface GetUserBlockListResponseDataItem {
|
|
136
|
+
/** An ID that identifies the blocked user. */
|
|
137
|
+
user_id?: string | undefined;
|
|
138
|
+
/** The blocked user's login name. */
|
|
139
|
+
user_login?: string | undefined;
|
|
140
|
+
/** The blocked user's display name. */
|
|
141
|
+
display_name?: string | undefined;
|
|
142
|
+
}
|
|
143
|
+
/** The list of blocked users. If the request doesn't specify *user_id*, the list is in descending order by when the user was blocked. */
|
|
144
|
+
export type GetUserBlockListResponseDataList = Array<GetUserBlockListResponseDataItem>;
|
|
145
|
+
/** 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). */
|
|
146
|
+
export interface GetUserBlockListResponsePagination {
|
|
147
|
+
/** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
|
|
148
|
+
cursor?: string | undefined;
|
|
149
|
+
}
|
|
150
|
+
export interface GetUserBlockListResponse {
|
|
151
|
+
/** The list of blocked users. If the request doesn't specify *user_id*, the list is in descending order by when the user was blocked. */
|
|
152
|
+
data: GetUserBlockListResponseDataList;
|
|
153
|
+
/** 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). */
|
|
154
|
+
pagination?: GetUserBlockListResponsePagination | undefined;
|
|
155
|
+
}
|
|
156
|
+
export interface GetUserExtensionsRequest {}
|
|
157
|
+
/** The extension types that you can activate for this extension. Possible values: - `component` - `mobile` - `overlay` - `panel` */
|
|
158
|
+
export type GetUserExtensionsResponseDataItemTypeList = Array<string>;
|
|
159
|
+
export interface GetUserExtensionsResponseDataItem {
|
|
160
|
+
/** An ID that identifies the extension. */
|
|
161
|
+
id?: string | undefined;
|
|
162
|
+
/** The extension's version. */
|
|
163
|
+
version?: string | undefined;
|
|
164
|
+
/** The extension's name. */
|
|
165
|
+
name?: string | undefined;
|
|
166
|
+
/** A Boolean value that determines whether the extension is configured and can be activated. Is **true** if the extension is configured and can be activated. */
|
|
167
|
+
can_activate?: boolean | undefined;
|
|
168
|
+
/** The extension types that you can activate for this extension. Possible values: - `component` - `mobile` - `overlay` - `panel` */
|
|
169
|
+
type?: GetUserExtensionsResponseDataItemTypeList | undefined;
|
|
170
|
+
}
|
|
171
|
+
/** The list of extensions that the user has installed. */
|
|
172
|
+
export type GetUserExtensionsResponseDataList = Array<GetUserExtensionsResponseDataItem>;
|
|
173
|
+
export interface GetUserExtensionsResponse {
|
|
174
|
+
/** The list of extensions that the user has installed. */
|
|
175
|
+
data?: GetUserExtensionsResponseDataList | undefined;
|
|
176
|
+
}
|
|
177
|
+
export type GetUsersRequestIdList = Array<string>;
|
|
178
|
+
export type GetUsersRequestLoginList = Array<string>;
|
|
179
|
+
export interface GetUsersRequest {
|
|
180
|
+
/** The ID of the user to get. To specify more than one user, include the *id* parameter for each user to get. For example, 'id=1234&id=5678'. The maximum number of IDs you may specify is 100. */
|
|
181
|
+
id?: GetUsersRequestIdList | undefined;
|
|
182
|
+
/** The login name of the user to get. To specify more than one user, include the *login* parameter for each user to get. For example, 'login=foo&login=bar'. The maximum number of login names you may specify is 100. */
|
|
183
|
+
login?: GetUsersRequestLoginList | undefined;
|
|
184
|
+
}
|
|
185
|
+
export interface GetUsersResponseDataItem {
|
|
186
|
+
/** An ID that identifies the user. */
|
|
187
|
+
id?: string | undefined;
|
|
188
|
+
/** The user's login name. */
|
|
189
|
+
login?: string | undefined;
|
|
190
|
+
/** The user's display name. */
|
|
191
|
+
display_name?: string | undefined;
|
|
192
|
+
/** The type of user. Possible values: - `admin`: Twitch administrator - `global_mod` - `staff`: Twitch staff - `(empty string value provided in field)`: Normal user */
|
|
193
|
+
type?: string | undefined;
|
|
194
|
+
/** The type of broadcaster. Possible values: - `affiliate`: An [affiliate broadcaster](https://help.twitch.tv/s/article/joining-the-affiliate-program) - `partner`: [A partner broadcaster](https://help.twitch.tv/s/article/partner-program-overview) - `(empty string value provided in field)`: A normal broadcaster */
|
|
195
|
+
broadcaster_type?: string | undefined;
|
|
196
|
+
/** The user's description of their channel. */
|
|
197
|
+
description?: string | undefined;
|
|
198
|
+
/** A URL to the user's profile image. */
|
|
199
|
+
profile_image_url?: string | undefined;
|
|
200
|
+
/** A URL to the user's offline image. */
|
|
201
|
+
offline_image_url?: string | undefined;
|
|
202
|
+
/** The number of times the user's channel has been viewed. **NOTE**: This field has been deprecated (see [Get Users API endpoint - "view_count" deprecation](https://discuss.dev.twitch.tv/t/get-users-api-endpoint-view-count-deprecation/37777)). Any data in this field is not valid and should not be used. */
|
|
203
|
+
view_count?: number | undefined;
|
|
204
|
+
/** The user's verified email address. The object includes this field only for the user in the user access token, and only if the token includes the **user:read:email** scope and the user has verified their email address. */
|
|
205
|
+
email?: string | undefined;
|
|
206
|
+
/** The UTC date and time that the user's account was created. The timestamp is in RFC3339 format. */
|
|
207
|
+
created_at?: string | undefined;
|
|
208
|
+
}
|
|
209
|
+
/** The list of users. The list doesn't include deleted or suspended accounts. */
|
|
210
|
+
export type GetUsersResponseDataList = Array<GetUsersResponseDataItem>;
|
|
211
|
+
export interface GetUsersResponse {
|
|
212
|
+
/** The list of users. The list doesn't include deleted or suspended accounts. */
|
|
213
|
+
data?: GetUsersResponseDataList | undefined;
|
|
214
|
+
}
|
|
215
|
+
export interface UnblockUserRequest {
|
|
216
|
+
/** The ID of the user to remove from the broadcaster's list of blocked users. The API ignores the request if the broadcaster hasn't blocked the user. */
|
|
217
|
+
target_user_id: string;
|
|
218
|
+
}
|
|
219
|
+
export interface UnblockUserResponse {}
|
|
220
|
+
export interface UpdateUserRequest {
|
|
221
|
+
/** The string to update the channel's description to. The description is limited to a maximum of 300 characters. Before it checks the length and saves the description, the API removes line breaks and replaces each `<` and `>` with `<` and `>`. To remove the description, specify this parameter but don't set it's value (for example, '?description='). */
|
|
222
|
+
description?: string | undefined;
|
|
223
|
+
}
|
|
224
|
+
export interface UpdateUserResponseDataItem {
|
|
225
|
+
/** An ID that identifies the user. */
|
|
226
|
+
id?: string | undefined;
|
|
227
|
+
/** The user's login name. */
|
|
228
|
+
login?: string | undefined;
|
|
229
|
+
/** The user's display name. */
|
|
230
|
+
display_name?: string | undefined;
|
|
231
|
+
/** The type of user. Possible values: - `admin`: Twitch administrator - `global_mod` - `staff`: Twitch staff - `(empty string value provided in field)`: Normal user */
|
|
232
|
+
type?: string | undefined;
|
|
233
|
+
/** The type of broadcaster. Possible values: - `affiliate`: An [affiliate broadcaster](https://help.twitch.tv/s/article/joining-the-affiliate-program) - `partner`: A [partner broadcaster](https://help.twitch.tv/s/article/partner-program-overview) - `(empty string value provided in field)`: A normal broadcaster */
|
|
234
|
+
broadcaster_type?: string | undefined;
|
|
235
|
+
/** The user's description of their channel. */
|
|
236
|
+
description?: string | undefined;
|
|
237
|
+
/** A URL to the user's profile image. */
|
|
238
|
+
profile_image_url?: string | undefined;
|
|
239
|
+
/** A URL to the user's offline image. */
|
|
240
|
+
offline_image_url?: string | undefined;
|
|
241
|
+
/** The number of times the user's channel has been viewed. **NOTE**: This field has been deprecated (see [Get Users API endpoint - "view_count" deprecation](https://discuss.dev.twitch.tv/t/get-users-api-endpoint-view-count-deprecation/37777)). Any data in this field is not valid and should not be used. */
|
|
242
|
+
view_count?: number | undefined;
|
|
243
|
+
/** The user's verified email address. The object includes this field only if the user access token includes the **user:read:email** scope. If the request contains more than one user, only the user associated with the access token that provided consent will include an email address -- the email address for all other users will be empty. */
|
|
244
|
+
email?: string | undefined;
|
|
245
|
+
/** The UTC date and time that the user's account was created. The timestamp is in RFC3339 format. */
|
|
246
|
+
created_at?: string | undefined;
|
|
247
|
+
}
|
|
248
|
+
/** A list contains the single user that you updated. */
|
|
249
|
+
export type UpdateUserResponseDataList = Array<UpdateUserResponseDataItem>;
|
|
250
|
+
export interface UpdateUserResponse {
|
|
251
|
+
/** A list contains the single user that you updated. */
|
|
252
|
+
data?: UpdateUserResponseDataList | undefined;
|
|
253
|
+
}
|
|
254
|
+
export interface UpdateUserExtensionsRequest {
|
|
255
|
+
/** The extensions to update. The *data* field is a dictionary of extension types. The dictionary's possible keys are: panel, overlay, or component. The key's value is a dictionary of extensions. For the extension's dictionary, the key is a sequential number beginning with 1. For panel and overlay extensions, the key's value is an object that contains the following fields: `active` (true/false), `id` (the extension's ID), and `version` (the extension's version). For component extensions, the key's value includes the above fields plus the `x` and `y` fields, which identify the coordinate where the extension is placed. */
|
|
256
|
+
data: unknown;
|
|
257
|
+
}
|
|
258
|
+
export interface UpdateUserExtensionsResponseDataPanelValue {
|
|
259
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured a panel extension. */
|
|
260
|
+
active?: boolean | undefined;
|
|
261
|
+
/** An ID that identifies the extension. */
|
|
262
|
+
id?: string | undefined;
|
|
263
|
+
/** The extension's version. */
|
|
264
|
+
version?: string | undefined;
|
|
265
|
+
/** The extension's name. */
|
|
266
|
+
name?: string | undefined;
|
|
267
|
+
}
|
|
268
|
+
/** A dictionary that contains the data for a panel extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the panel's data for each key. */
|
|
269
|
+
export type UpdateUserExtensionsResponseDataPanelMap = {
|
|
270
|
+
[key: string]: UpdateUserExtensionsResponseDataPanelValue | undefined;
|
|
271
|
+
};
|
|
272
|
+
export interface UpdateUserExtensionsResponseDataOverlayValue {
|
|
273
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured an overlay extension. */
|
|
274
|
+
active?: boolean | undefined;
|
|
275
|
+
/** An ID that identifies the extension. */
|
|
276
|
+
id?: string | undefined;
|
|
277
|
+
/** The extension's version. */
|
|
278
|
+
version?: string | undefined;
|
|
279
|
+
/** The extension's name. */
|
|
280
|
+
name?: string | undefined;
|
|
281
|
+
}
|
|
282
|
+
/** A dictionary that contains the data for a video-overlay extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the overlay's data for each key. */
|
|
283
|
+
export type UpdateUserExtensionsResponseDataOverlayMap = {
|
|
284
|
+
[key: string]: UpdateUserExtensionsResponseDataOverlayValue | undefined;
|
|
285
|
+
};
|
|
286
|
+
export interface UpdateUserExtensionsResponseDataComponentValue {
|
|
287
|
+
/** A Boolean value that determines the extension's activation state. If **false**, the user has not configured a component extension. */
|
|
288
|
+
active?: boolean | undefined;
|
|
289
|
+
/** An ID that identifies the extension. */
|
|
290
|
+
id?: string | undefined;
|
|
291
|
+
/** The extension's version. */
|
|
292
|
+
version?: string | undefined;
|
|
293
|
+
/** The extension's name. */
|
|
294
|
+
name?: string | undefined;
|
|
295
|
+
/** The x-coordinate where the extension is placed. */
|
|
296
|
+
x?: number | undefined;
|
|
297
|
+
/** The y-coordinate where the extension is placed. */
|
|
298
|
+
y?: number | undefined;
|
|
299
|
+
}
|
|
300
|
+
/** A dictionary that contains the data for a video-component extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the component's data for each key. */
|
|
301
|
+
export type UpdateUserExtensionsResponseDataComponentMap = {
|
|
302
|
+
[key: string]: UpdateUserExtensionsResponseDataComponentValue | undefined;
|
|
303
|
+
};
|
|
304
|
+
/** The extensions that the broadcaster updated. */
|
|
305
|
+
export interface UpdateUserExtensionsResponseData {
|
|
306
|
+
/** A dictionary that contains the data for a panel extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the panel's data for each key. */
|
|
307
|
+
panel?: UpdateUserExtensionsResponseDataPanelMap | undefined;
|
|
308
|
+
/** A dictionary that contains the data for a video-overlay extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the overlay's data for each key. */
|
|
309
|
+
overlay?: UpdateUserExtensionsResponseDataOverlayMap | undefined;
|
|
310
|
+
/** A dictionary that contains the data for a video-component extension. The dictionary's key is a sequential number beginning with 1. The following fields contain the component's data for each key. */
|
|
311
|
+
component?: UpdateUserExtensionsResponseDataComponentMap | undefined;
|
|
312
|
+
}
|
|
313
|
+
export interface UpdateUserExtensionsResponse {
|
|
314
|
+
/** The extensions that the broadcaster updated. */
|
|
315
|
+
data?: UpdateUserExtensionsResponseData | undefined;
|
|
316
|
+
}
|
|
317
|
+
export type BlockUserError = TwitchOpError;
|
|
318
|
+
/** Block User Blocks the specified user from interacting with or having contact with the broadcaster. The User ID in the OAuth token identifies the broadcaster who is blocking the user. To learn more about blocking users, see [Block Other Users on Twitch](https://help.twitch.tv/s/article/how-to-manage-harassment-in-chat?language=en_US#BlockWhispersandMessagesfromStrangers). Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:manage:blocked_users** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#block-user */
|
|
319
|
+
export const blockUser: API.OperationMethod<
|
|
320
|
+
BlockUserRequest,
|
|
321
|
+
BlockUserResponse,
|
|
322
|
+
BlockUserError,
|
|
323
|
+
TwitchOpContext
|
|
324
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
325
|
+
input: __S(0, __c0, 0) as any as S.Schema<BlockUserRequest>,
|
|
326
|
+
output: __S(8, __c1, 0) as any as S.Schema<BlockUserResponse>,
|
|
327
|
+
errors: [],
|
|
328
|
+
serviceErrors: TwitchServiceErrors,
|
|
329
|
+
protocol: TwitchProtocol,
|
|
330
|
+
retry: Retry.Retry,
|
|
331
|
+
telemetry: TELEMETRY,
|
|
332
|
+
span: "BlockUser",
|
|
333
|
+
}));
|
|
334
|
+
|
|
335
|
+
export type GetAuthorizationByUserError = TwitchOpError;
|
|
336
|
+
/** Get Authorization By User Gets the authorization scopes that the specified user(s) have granted the application. Authorization: Requires one of the following: - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Reference: https://dev.twitch.tv/docs/api/reference/users/#get-authorization-by-user */
|
|
337
|
+
export const getAuthorizationByUser: API.OperationMethod<
|
|
338
|
+
GetAuthorizationByUserRequest,
|
|
339
|
+
GetAuthorizationByUserResponse,
|
|
340
|
+
GetAuthorizationByUserError,
|
|
341
|
+
TwitchOpContext
|
|
342
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
343
|
+
input: __S(16, __c2, 0) as any as S.Schema<GetAuthorizationByUserRequest>,
|
|
344
|
+
output: __S(19, __c2, 3) as any as S.Schema<GetAuthorizationByUserResponse>,
|
|
345
|
+
errors: [],
|
|
346
|
+
serviceErrors: TwitchServiceErrors,
|
|
347
|
+
protocol: TwitchProtocol,
|
|
348
|
+
retry: Retry.Retry,
|
|
349
|
+
telemetry: TELEMETRY,
|
|
350
|
+
span: "GetAuthorizationByUser",
|
|
351
|
+
}));
|
|
352
|
+
|
|
353
|
+
export type GetUserActiveExtensionsError = TwitchOpError;
|
|
354
|
+
/** Get User Active Extensions Gets the active extensions that the broadcaster has installed for each configuration. > **Note** An active extension version that isn't released (for example, one in Hosted Test) is included only > if you specify a user access token and that user is on the version's Testing Account Allowlist. > The account that created the version is on the allowlist automatically, and no scope is required. > If the version isn't included, its slot contains only the `active` field, set to **false**. 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/users/#get-user-active-extensions */
|
|
355
|
+
export const getUserActiveExtensions: API.OperationMethod<
|
|
356
|
+
GetUserActiveExtensionsRequest,
|
|
357
|
+
GetUserActiveExtensionsResponse,
|
|
358
|
+
GetUserActiveExtensionsError,
|
|
359
|
+
TwitchOpContext
|
|
360
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
361
|
+
input: __S(32, __c4, 0) as any as S.Schema<GetUserActiveExtensionsRequest>,
|
|
362
|
+
output: __S(45, __c5, 5) as any as S.Schema<GetUserActiveExtensionsResponse>,
|
|
363
|
+
errors: [],
|
|
364
|
+
serviceErrors: TwitchServiceErrors,
|
|
365
|
+
protocol: TwitchProtocol,
|
|
366
|
+
retry: Retry.Retry,
|
|
367
|
+
telemetry: TELEMETRY,
|
|
368
|
+
span: "GetUserActiveExtensions",
|
|
369
|
+
}));
|
|
370
|
+
|
|
371
|
+
export type GetUserBlockListError = TwitchOpError;
|
|
372
|
+
/** Get User Block List Gets the list of users that the broadcaster has blocked. [Read More](https://help.twitch.tv/s/article/how-to-manage-harassment-in-chat?language=en_US#BlockWhispersandMessagesfromStrangers) 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:blocked_users** or **user:manage:blocked_users** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#get-user-block-list */
|
|
373
|
+
export const getUserBlockList: API.PaginatedOperationMethod<
|
|
374
|
+
GetUserBlockListRequest,
|
|
375
|
+
GetUserBlockListResponse,
|
|
376
|
+
GetUserBlockListError,
|
|
377
|
+
TwitchOpContext,
|
|
378
|
+
GetUserBlockListResponseDataItem
|
|
379
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
380
|
+
() => ({
|
|
381
|
+
input: __S(48, __c6, 0) as any as S.Schema<GetUserBlockListRequest>,
|
|
382
|
+
output: __S(52, __c6, 4) as any as S.Schema<GetUserBlockListResponse>,
|
|
383
|
+
errors: [],
|
|
384
|
+
serviceErrors: TwitchServiceErrors,
|
|
385
|
+
protocol: TwitchProtocol,
|
|
386
|
+
retry: Retry.Retry,
|
|
387
|
+
telemetry: TELEMETRY,
|
|
388
|
+
span: "GetUserBlockList",
|
|
389
|
+
pagination: {
|
|
390
|
+
mode: "cursor",
|
|
391
|
+
inputToken: "after",
|
|
392
|
+
outputToken: "pagination.cursor",
|
|
393
|
+
items: "data",
|
|
394
|
+
pageSize: "first",
|
|
395
|
+
} as const,
|
|
396
|
+
}),
|
|
397
|
+
paginateCursor,
|
|
398
|
+
) as any;
|
|
399
|
+
|
|
400
|
+
export type GetUserExtensionsError = TwitchOpError;
|
|
401
|
+
/** Get User Extensions Gets a list of all extensions (both active and inactive) that the broadcaster has installed. The user ID in the access token identifies the 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:broadcast**, **user:edit:broadcast**, or **channel:manage:extensions** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#get-user-extensions */
|
|
402
|
+
export const getUserExtensions: API.OperationMethod<
|
|
403
|
+
GetUserExtensionsRequest,
|
|
404
|
+
GetUserExtensionsResponse,
|
|
405
|
+
GetUserExtensionsError,
|
|
406
|
+
TwitchOpContext
|
|
407
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
408
|
+
input: __S(56, __c7, 0) as any as S.Schema<GetUserExtensionsRequest>,
|
|
409
|
+
output: __S(59, __c7, 3) as any as S.Schema<GetUserExtensionsResponse>,
|
|
410
|
+
errors: [],
|
|
411
|
+
serviceErrors: TwitchServiceErrors,
|
|
412
|
+
protocol: TwitchProtocol,
|
|
413
|
+
retry: Retry.Retry,
|
|
414
|
+
telemetry: TELEMETRY,
|
|
415
|
+
span: "GetUserExtensions",
|
|
416
|
+
}));
|
|
417
|
+
|
|
418
|
+
export type GetUsersError = TwitchOpError;
|
|
419
|
+
/** Get Users Gets information about one or more users. You may look up users using their user ID, login name, or both but the sum total of the number of users you may look up is 100. For example, you may specify 50 IDs and 50 names or 100 IDs or names, but you cannot specify 100 IDs and 100 names.<br><br> If you don't specify IDs or login names, the request returns information about the user in the access token if you specify a user access token.<br><br> To include the user's verified email address in the response, you must use a user access token that includes the **user:read:email** scope. 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/users/#get-users */
|
|
420
|
+
export const getUsers: API.OperationMethod<
|
|
421
|
+
GetUsersRequest,
|
|
422
|
+
GetUsersResponse,
|
|
423
|
+
GetUsersError,
|
|
424
|
+
TwitchOpContext
|
|
425
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
426
|
+
input: __S(64, __c8, 0) as any as S.Schema<GetUsersRequest>,
|
|
427
|
+
output: __S(74, __c9, 2) as any as S.Schema<GetUsersResponse>,
|
|
428
|
+
errors: [],
|
|
429
|
+
serviceErrors: TwitchServiceErrors,
|
|
430
|
+
protocol: TwitchProtocol,
|
|
431
|
+
retry: Retry.Retry,
|
|
432
|
+
telemetry: TELEMETRY,
|
|
433
|
+
span: "GetUsers",
|
|
434
|
+
}));
|
|
435
|
+
|
|
436
|
+
export type UnblockUserError = TwitchOpError;
|
|
437
|
+
/** Unblock User Removes the user from the broadcaster's list of blocked users. The user ID in the OAuth token identifies the broadcaster who's removing the block. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:manage:blocked_users** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#unblock-user */
|
|
438
|
+
export const unblockUser: API.OperationMethod<
|
|
439
|
+
UnblockUserRequest,
|
|
440
|
+
UnblockUserResponse,
|
|
441
|
+
UnblockUserError,
|
|
442
|
+
TwitchOpContext
|
|
443
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
444
|
+
input: __S(80, __c10, 0) as any as S.Schema<UnblockUserRequest>,
|
|
445
|
+
output: __S(8, __c1, 0) as any as S.Schema<UnblockUserResponse>,
|
|
446
|
+
errors: [],
|
|
447
|
+
serviceErrors: TwitchServiceErrors,
|
|
448
|
+
protocol: TwitchProtocol,
|
|
449
|
+
retry: Retry.Retry,
|
|
450
|
+
telemetry: TELEMETRY,
|
|
451
|
+
span: "UnblockUser",
|
|
452
|
+
}));
|
|
453
|
+
|
|
454
|
+
export type UpdateUserError = TwitchOpError;
|
|
455
|
+
/** Update User Updates the specified user's information. The user ID in the OAuth token identifies the user whose information you want to update. To include the user's verified email address in the response, the user access token must also include the **user:read:email** scope. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:edit** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#update-user */
|
|
456
|
+
export const updateUser: API.OperationMethod<
|
|
457
|
+
UpdateUserRequest,
|
|
458
|
+
UpdateUserResponse,
|
|
459
|
+
UpdateUserError,
|
|
460
|
+
TwitchOpContext
|
|
461
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
462
|
+
input: __S(88, __c11, 0) as any as S.Schema<UpdateUserRequest>,
|
|
463
|
+
output: __S(74, __c9, 2) as any as S.Schema<UpdateUserResponse>,
|
|
464
|
+
errors: [],
|
|
465
|
+
serviceErrors: TwitchServiceErrors,
|
|
466
|
+
protocol: TwitchProtocol,
|
|
467
|
+
retry: Retry.Retry,
|
|
468
|
+
telemetry: TELEMETRY,
|
|
469
|
+
span: "UpdateUser",
|
|
470
|
+
}));
|
|
471
|
+
|
|
472
|
+
export type UpdateUserExtensionsError = TwitchOpError;
|
|
473
|
+
/** Update User Extensions Updates an installed extension's information. You can update the extension's activation state, ID, and version number. The User ID in the access token identifies the broadcaster whose extensions you're updating. > **Note** If you try to activate an extension under multiple extension types, the last write wins (and there is no guarantee of write order). Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **user:edit:broadcast** or **channel:manage:extensions** scope. Reference: https://dev.twitch.tv/docs/api/reference/users/#update-user-extensions */
|
|
474
|
+
export const updateUserExtensions: API.OperationMethod<
|
|
475
|
+
UpdateUserExtensionsRequest,
|
|
476
|
+
UpdateUserExtensionsResponse,
|
|
477
|
+
UpdateUserExtensionsError,
|
|
478
|
+
TwitchOpContext
|
|
479
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
480
|
+
input: __S(96, __c12, 0) as any as S.Schema<UpdateUserExtensionsRequest>,
|
|
481
|
+
output: __S(45, __c5, 5) as any as S.Schema<UpdateUserExtensionsResponse>,
|
|
482
|
+
errors: [],
|
|
483
|
+
serviceErrors: TwitchServiceErrors,
|
|
484
|
+
protocol: TwitchProtocol,
|
|
485
|
+
retry: Retry.Retry,
|
|
486
|
+
telemetry: TELEMETRY,
|
|
487
|
+
span: "UpdateUserExtensions",
|
|
488
|
+
}));
|
|
489
|
+
|
|
490
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
491
|
+
function __c0(j: number): any {
|
|
492
|
+
switch (j) {
|
|
493
|
+
case 0:
|
|
494
|
+
return S.suspend(() =>
|
|
495
|
+
S.Struct({
|
|
496
|
+
target_user_id: S.String.pipe(T.Query()),
|
|
497
|
+
source_context: S.optional(S.String.pipe(T.Query())),
|
|
498
|
+
reason: S.optional(S.String.pipe(T.Query())),
|
|
499
|
+
}).pipe(T.Http({ method: "PUT", uri: "/users/blocks", code: 200 })),
|
|
500
|
+
).annotate({ identifier: "BlockUserRequest" });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function __c1(j: number): any {
|
|
504
|
+
switch (j) {
|
|
505
|
+
case 0:
|
|
506
|
+
return S.suspend(() => S.Struct({})).annotate({ identifier: "BlockUserResponse" });
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function __c2(j: number): any {
|
|
510
|
+
switch (j) {
|
|
511
|
+
case 0:
|
|
512
|
+
return S.suspend(() =>
|
|
513
|
+
S.Struct({
|
|
514
|
+
user_id: __S(24, __c3, 0).pipe(T.Query()),
|
|
515
|
+
}).pipe(T.Http({ method: "GET", uri: "/authorization/users", code: 200 })),
|
|
516
|
+
).annotate({ identifier: "GetAuthorizationByUserRequest" });
|
|
517
|
+
case 1:
|
|
518
|
+
return S.suspend(() =>
|
|
519
|
+
S.Struct({
|
|
520
|
+
user_id: S.optional(S.String),
|
|
521
|
+
user_name: S.optional(S.String),
|
|
522
|
+
user_login: S.optional(S.String),
|
|
523
|
+
scopes: S.optional(__S(24, __c3, 0)),
|
|
524
|
+
has_authorized: S.optional(S.Boolean),
|
|
525
|
+
}),
|
|
526
|
+
).annotate({ identifier: "GetAuthorizationByUserResponseDataItem" });
|
|
527
|
+
case 2:
|
|
528
|
+
return S.Array(__S(17, __c2, 1));
|
|
529
|
+
case 3:
|
|
530
|
+
return S.suspend(() =>
|
|
531
|
+
S.Struct({
|
|
532
|
+
data: S.optional(__S(18, __c2, 2)),
|
|
533
|
+
}),
|
|
534
|
+
).annotate({ identifier: "GetAuthorizationByUserResponse" });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function __c3(j: number): any {
|
|
538
|
+
switch (j) {
|
|
539
|
+
case 0:
|
|
540
|
+
return S.Array(S.String);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function __c4(j: number): any {
|
|
544
|
+
switch (j) {
|
|
545
|
+
case 0:
|
|
546
|
+
return S.suspend(() =>
|
|
547
|
+
S.Struct({
|
|
548
|
+
user_id: S.optional(S.String.pipe(T.Query())),
|
|
549
|
+
}).pipe(T.Http({ method: "GET", uri: "/users/extensions", code: 200 })),
|
|
550
|
+
).annotate({ identifier: "GetUserActiveExtensionsRequest" });
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function __c5(j: number): any {
|
|
554
|
+
switch (j) {
|
|
555
|
+
case 0:
|
|
556
|
+
return S.suspend(() =>
|
|
557
|
+
S.Struct({
|
|
558
|
+
active: S.optional(S.Boolean),
|
|
559
|
+
id: S.optional(S.String),
|
|
560
|
+
version: S.optional(S.String),
|
|
561
|
+
name: S.optional(S.String),
|
|
562
|
+
}),
|
|
563
|
+
).annotate({ identifier: "GetUserActiveExtensionsResponseDataPanelValue" });
|
|
564
|
+
case 1:
|
|
565
|
+
return S.Record(S.String, __S(40, __c5, 0));
|
|
566
|
+
case 2:
|
|
567
|
+
return S.suspend(() =>
|
|
568
|
+
S.Struct({
|
|
569
|
+
active: S.optional(S.Boolean),
|
|
570
|
+
id: S.optional(S.String),
|
|
571
|
+
version: S.optional(S.String),
|
|
572
|
+
name: S.optional(S.String),
|
|
573
|
+
x: S.optional(S.Number),
|
|
574
|
+
y: S.optional(S.Number),
|
|
575
|
+
}),
|
|
576
|
+
).annotate({ identifier: "GetUserActiveExtensionsResponseDataComponentValue" });
|
|
577
|
+
case 3:
|
|
578
|
+
return S.Record(S.String, __S(42, __c5, 2));
|
|
579
|
+
case 4:
|
|
580
|
+
return S.suspend(() =>
|
|
581
|
+
S.Struct({
|
|
582
|
+
panel: S.optional(__S(41, __c5, 1)),
|
|
583
|
+
overlay: S.optional(__S(41, __c5, 1)),
|
|
584
|
+
component: S.optional(__S(43, __c5, 3)),
|
|
585
|
+
}),
|
|
586
|
+
).annotate({ identifier: "GetUserActiveExtensionsResponseData" });
|
|
587
|
+
case 5:
|
|
588
|
+
return S.suspend(() =>
|
|
589
|
+
S.Struct({
|
|
590
|
+
data: S.optional(__S(44, __c5, 4)),
|
|
591
|
+
}),
|
|
592
|
+
).annotate({ identifier: "GetUserActiveExtensionsResponse" });
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function __c6(j: number): any {
|
|
596
|
+
switch (j) {
|
|
597
|
+
case 0:
|
|
598
|
+
return S.suspend(() =>
|
|
599
|
+
S.Struct({
|
|
600
|
+
broadcaster_id: S.String.pipe(T.Query()),
|
|
601
|
+
user_id: S.optional(__S(24, __c3, 0).pipe(T.Query())),
|
|
602
|
+
first: S.optional(S.Number.pipe(T.Query())),
|
|
603
|
+
after: S.optional(S.String.pipe(T.Query())),
|
|
604
|
+
}).pipe(T.Http({ method: "GET", uri: "/users/blocks", code: 200 })),
|
|
605
|
+
).annotate({ identifier: "GetUserBlockListRequest" });
|
|
606
|
+
case 1:
|
|
607
|
+
return S.suspend(() =>
|
|
608
|
+
S.Struct({
|
|
609
|
+
user_id: S.optional(S.String),
|
|
610
|
+
user_login: S.optional(S.String),
|
|
611
|
+
display_name: S.optional(S.String),
|
|
612
|
+
}),
|
|
613
|
+
).annotate({ identifier: "GetUserBlockListResponseDataItem" });
|
|
614
|
+
case 2:
|
|
615
|
+
return S.Array(__S(49, __c6, 1));
|
|
616
|
+
case 3:
|
|
617
|
+
return S.suspend(() =>
|
|
618
|
+
S.Struct({
|
|
619
|
+
cursor: S.optional(S.String),
|
|
620
|
+
}),
|
|
621
|
+
).annotate({ identifier: "GetUserBlockListResponsePagination" });
|
|
622
|
+
case 4:
|
|
623
|
+
return S.suspend(() =>
|
|
624
|
+
S.Struct({
|
|
625
|
+
data: __S(50, __c6, 2),
|
|
626
|
+
pagination: S.optional(__S(51, __c6, 3)),
|
|
627
|
+
}),
|
|
628
|
+
).annotate({ identifier: "GetUserBlockListResponse" });
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
function __c7(j: number): any {
|
|
632
|
+
switch (j) {
|
|
633
|
+
case 0:
|
|
634
|
+
return S.suspend(() =>
|
|
635
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users/extensions/list", code: 200 })),
|
|
636
|
+
).annotate({ identifier: "GetUserExtensionsRequest" });
|
|
637
|
+
case 1:
|
|
638
|
+
return S.suspend(() =>
|
|
639
|
+
S.Struct({
|
|
640
|
+
id: S.optional(S.String),
|
|
641
|
+
version: S.optional(S.String),
|
|
642
|
+
name: S.optional(S.String),
|
|
643
|
+
can_activate: S.optional(S.Boolean),
|
|
644
|
+
type: S.optional(__S(24, __c3, 0)),
|
|
645
|
+
}),
|
|
646
|
+
).annotate({ identifier: "GetUserExtensionsResponseDataItem" });
|
|
647
|
+
case 2:
|
|
648
|
+
return S.Array(__S(57, __c7, 1));
|
|
649
|
+
case 3:
|
|
650
|
+
return S.suspend(() =>
|
|
651
|
+
S.Struct({
|
|
652
|
+
data: S.optional(__S(58, __c7, 2)),
|
|
653
|
+
}),
|
|
654
|
+
).annotate({ identifier: "GetUserExtensionsResponse" });
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function __c8(j: number): any {
|
|
658
|
+
switch (j) {
|
|
659
|
+
case 0:
|
|
660
|
+
return S.suspend(() =>
|
|
661
|
+
S.Struct({
|
|
662
|
+
id: S.optional(__S(24, __c3, 0).pipe(T.Query())),
|
|
663
|
+
login: S.optional(__S(24, __c3, 0).pipe(T.Query())),
|
|
664
|
+
}).pipe(T.Http({ method: "GET", uri: "/users", code: 200 })),
|
|
665
|
+
).annotate({ identifier: "GetUsersRequest" });
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function __c9(j: number): any {
|
|
669
|
+
switch (j) {
|
|
670
|
+
case 0:
|
|
671
|
+
return S.suspend(() =>
|
|
672
|
+
S.Struct({
|
|
673
|
+
id: S.optional(S.String),
|
|
674
|
+
login: S.optional(S.String),
|
|
675
|
+
display_name: S.optional(S.String),
|
|
676
|
+
type: S.optional(S.String),
|
|
677
|
+
broadcaster_type: S.optional(S.String),
|
|
678
|
+
description: S.optional(S.String),
|
|
679
|
+
profile_image_url: S.optional(S.String),
|
|
680
|
+
offline_image_url: S.optional(S.String),
|
|
681
|
+
view_count: S.optional(S.Number),
|
|
682
|
+
email: S.optional(S.String),
|
|
683
|
+
created_at: S.optional(S.String),
|
|
684
|
+
}),
|
|
685
|
+
).annotate({ identifier: "GetUsersResponseDataItem" });
|
|
686
|
+
case 1:
|
|
687
|
+
return S.Array(__S(72, __c9, 0));
|
|
688
|
+
case 2:
|
|
689
|
+
return S.suspend(() =>
|
|
690
|
+
S.Struct({
|
|
691
|
+
data: S.optional(__S(73, __c9, 1)),
|
|
692
|
+
}),
|
|
693
|
+
).annotate({ identifier: "GetUsersResponse" });
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function __c10(j: number): any {
|
|
697
|
+
switch (j) {
|
|
698
|
+
case 0:
|
|
699
|
+
return S.suspend(() =>
|
|
700
|
+
S.Struct({
|
|
701
|
+
target_user_id: S.String.pipe(T.Query()),
|
|
702
|
+
}).pipe(T.Http({ method: "DELETE", uri: "/users/blocks", code: 200 })),
|
|
703
|
+
).annotate({ identifier: "UnblockUserRequest" });
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
function __c11(j: number): any {
|
|
707
|
+
switch (j) {
|
|
708
|
+
case 0:
|
|
709
|
+
return S.suspend(() =>
|
|
710
|
+
S.Struct({
|
|
711
|
+
description: S.optional(S.String.pipe(T.Query())),
|
|
712
|
+
}).pipe(T.Http({ method: "PUT", uri: "/users", code: 200 })),
|
|
713
|
+
).annotate({ identifier: "UpdateUserRequest" });
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
function __c12(j: number): any {
|
|
717
|
+
switch (j) {
|
|
718
|
+
case 0:
|
|
719
|
+
return S.suspend(() =>
|
|
720
|
+
S.Struct({
|
|
721
|
+
data: S.Unknown,
|
|
722
|
+
}).pipe(T.Http({ method: "PUT", uri: "/users/extensions", code: 200 })),
|
|
723
|
+
).annotate({ identifier: "UpdateUserExtensionsRequest" });
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
727
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
728
|
+
return (__s[i] ??= __L.at(f, j));
|
|
729
|
+
}
|