@distilled.cloud/twitch 0.0.0 → 1.0.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +79 -4
- 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 +82 -2
- 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,248 @@
|
|
|
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: "Search",
|
|
24
|
+
propagate: "w3c",
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export interface SearchCategoriesRequest {
|
|
28
|
+
/** The URI-encoded search string. For example, encode *#archery* as '%23archery' and search strings like *angel of death* as 'angel%20of%20death'. */
|
|
29
|
+
query: string;
|
|
30
|
+
/** 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 items per page. The default is 20. */
|
|
31
|
+
first?: number | undefined;
|
|
32
|
+
/** 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) */
|
|
33
|
+
after?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface SearchCategoriesResponseDataItem {
|
|
36
|
+
/** A URL to an image of the game's box art or streaming category. */
|
|
37
|
+
box_art_url?: string | undefined;
|
|
38
|
+
/** The name of the game or category. */
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
/** An ID that uniquely identifies the game or category. */
|
|
41
|
+
id?: string | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** The list of games or categories that match the query. The list is empty if there are no matches. */
|
|
44
|
+
export type SearchCategoriesResponseDataList = Array<SearchCategoriesResponseDataItem>;
|
|
45
|
+
/** 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). */
|
|
46
|
+
export interface SearchCategoriesResponsePagination {
|
|
47
|
+
/** The cursor used to get the next page of results. Use the cursor to set the request's *after* query parameter. */
|
|
48
|
+
cursor?: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface SearchCategoriesResponse {
|
|
51
|
+
/** The list of games or categories that match the query. The list is empty if there are no matches. */
|
|
52
|
+
data: SearchCategoriesResponseDataList;
|
|
53
|
+
/** 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). */
|
|
54
|
+
pagination?: SearchCategoriesResponsePagination | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface SearchChannelsRequest {
|
|
57
|
+
/** The URI-encoded search string. For example, encode search strings like *angel of death* as 'angel%20of%20death'. */
|
|
58
|
+
query: string;
|
|
59
|
+
/** A Boolean value that determines whether the response includes only channels that are currently streaming live. Set to **true** to get only channels that are streaming live; otherwise, **false** to get live and offline channels. The default is **false**. */
|
|
60
|
+
live_only?: boolean | undefined;
|
|
61
|
+
/** 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 items per page. The default is 20. */
|
|
62
|
+
first?: number | undefined;
|
|
63
|
+
/** 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) */
|
|
64
|
+
after?: string | undefined;
|
|
65
|
+
}
|
|
66
|
+
/** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
|
|
67
|
+
export type SearchChannelsResponseDataItemTagIdsList = Array<string>;
|
|
68
|
+
/** The tags applied to the channel. */
|
|
69
|
+
export type SearchChannelsResponseDataItemTagsList = Array<string>;
|
|
70
|
+
export interface SearchChannelsResponseDataItem {
|
|
71
|
+
/** The ISO 639-1 two-letter language code of the language used by the broadcaster. For example, *en* for English. If the broadcaster uses a language not in the list of [supported stream languages](https://help.twitch.tv/s/article/languages-on-twitch#streamlang), the value is *other*. */
|
|
72
|
+
broadcaster_language?: string | undefined;
|
|
73
|
+
/** The broadcaster's login name. */
|
|
74
|
+
broadcaster_login?: string | undefined;
|
|
75
|
+
/** The broadcaster's display name. */
|
|
76
|
+
display_name?: string | undefined;
|
|
77
|
+
/** The ID of the game that the broadcaster is playing or last played. */
|
|
78
|
+
game_id?: string | undefined;
|
|
79
|
+
/** The name of the game that the broadcaster is playing or last played. */
|
|
80
|
+
game_name?: string | undefined;
|
|
81
|
+
/** An ID that uniquely identifies the channel (this is the broadcaster's ID). */
|
|
82
|
+
id?: string | undefined;
|
|
83
|
+
/** A Boolean value that determines whether the broadcaster is streaming live. Is **true** if the broadcaster is streaming live; otherwise, **false**. */
|
|
84
|
+
is_live?: boolean | undefined;
|
|
85
|
+
/** **IMPORTANT** As of February 28, 2023, this field is deprecated and returns only an empty array. If you use this field, please update your code to use the `tags` field. The list of tags that apply to the stream. The list contains IDs only when the channel is steaming live. For a list of possible tags, see [List of All Tags](https://www.twitch.tv/directory/all/tags). The list doesn't include Category Tags. */
|
|
86
|
+
tag_ids?: SearchChannelsResponseDataItemTagIdsList | undefined;
|
|
87
|
+
/** The tags applied to the channel. */
|
|
88
|
+
tags?: SearchChannelsResponseDataItemTagsList | undefined;
|
|
89
|
+
/** A URL to a thumbnail of the broadcaster's profile image. */
|
|
90
|
+
thumbnail_url?: string | undefined;
|
|
91
|
+
/** The stream's title. Is an empty string if the broadcaster didn't set it. */
|
|
92
|
+
title?: string | undefined;
|
|
93
|
+
/** The UTC date and time (in RFC3339 format) of when the broadcaster started streaming. The string is empty if the broadcaster is not streaming live. */
|
|
94
|
+
started_at?: string | undefined;
|
|
95
|
+
}
|
|
96
|
+
/** The list of channels that match the query. The list is empty if there are no matches. */
|
|
97
|
+
export type SearchChannelsResponseDataList = Array<SearchChannelsResponseDataItem>;
|
|
98
|
+
/** 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). */
|
|
99
|
+
export type SearchChannelsResponsePagination = SearchCategoriesResponsePagination;
|
|
100
|
+
export interface SearchChannelsResponse {
|
|
101
|
+
/** The list of channels that match the query. The list is empty if there are no matches. */
|
|
102
|
+
data: SearchChannelsResponseDataList;
|
|
103
|
+
/** 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). */
|
|
104
|
+
pagination?: SearchCategoriesResponsePagination | undefined;
|
|
105
|
+
}
|
|
106
|
+
export type SearchCategoriesError = TwitchOpError;
|
|
107
|
+
/** Search Categories Gets the games or categories that match the specified query. A category matches if its name or one of its alternative names begins with the query string, if any word in its name begins with the query string, or if each word in the query string matches the beginning of a word in its name. For example, if the query string is *love computer*, the response includes any category whose name contains words that begin with love and computer. The comparison is case insensitive, and close misspellings can also match. 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/search/#search-categories */
|
|
108
|
+
export const searchCategories: API.PaginatedOperationMethod<
|
|
109
|
+
SearchCategoriesRequest,
|
|
110
|
+
SearchCategoriesResponse,
|
|
111
|
+
SearchCategoriesError,
|
|
112
|
+
TwitchOpContext,
|
|
113
|
+
SearchCategoriesResponseDataItem
|
|
114
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
115
|
+
() => ({
|
|
116
|
+
input: __S(0, __c0, 0) as any as S.Schema<SearchCategoriesRequest>,
|
|
117
|
+
output: __S(3, __c0, 3) as any as S.Schema<SearchCategoriesResponse>,
|
|
118
|
+
errors: [],
|
|
119
|
+
serviceErrors: TwitchServiceErrors,
|
|
120
|
+
protocol: TwitchProtocol,
|
|
121
|
+
retry: Retry.Retry,
|
|
122
|
+
telemetry: TELEMETRY,
|
|
123
|
+
span: "SearchCategories",
|
|
124
|
+
pagination: {
|
|
125
|
+
mode: "cursor",
|
|
126
|
+
inputToken: "after",
|
|
127
|
+
outputToken: "pagination.cursor",
|
|
128
|
+
items: "data",
|
|
129
|
+
pageSize: "first",
|
|
130
|
+
} as const,
|
|
131
|
+
}),
|
|
132
|
+
paginateCursor,
|
|
133
|
+
) as any;
|
|
134
|
+
|
|
135
|
+
export type SearchChannelsError = TwitchOpError;
|
|
136
|
+
/** Search Channels Gets the channels that match the specified query. The fields that the API uses for comparison depends on the value that the *live_only* query parameter is set to. If *live_only* is **false**, the API matches on the broadcaster's login name and display name. However, if *live_only* is **true**, the API matches on the broadcaster's login name, display name, and the name of the category they're streaming. If *live_only* is **false**, the broadcaster's login name or display name must begin with the query string. If *live_only* is **true**, the query string can also match the beginning of any word in those names or in the category name, and a phrase matches if each of its words does. The comparison is case insensitive, and close misspellings can also match. For example, the query string *angel of death* can match names that begin with angelofdeath or angel_of_death. By default, the results include both live and offline channels. To get only live channels set the *live_only* query parameter to **true**. 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/search/#search-channels */
|
|
137
|
+
export const searchChannels: API.PaginatedOperationMethod<
|
|
138
|
+
SearchChannelsRequest,
|
|
139
|
+
SearchChannelsResponse,
|
|
140
|
+
SearchChannelsError,
|
|
141
|
+
TwitchOpContext,
|
|
142
|
+
SearchChannelsResponseDataItem
|
|
143
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
144
|
+
() => ({
|
|
145
|
+
input: __S(16, __c2, 0) as any as S.Schema<SearchChannelsRequest>,
|
|
146
|
+
output: __S(20, __c2, 4) as any as S.Schema<SearchChannelsResponse>,
|
|
147
|
+
errors: [],
|
|
148
|
+
serviceErrors: TwitchServiceErrors,
|
|
149
|
+
protocol: TwitchProtocol,
|
|
150
|
+
retry: Retry.Retry,
|
|
151
|
+
telemetry: TELEMETRY,
|
|
152
|
+
span: "SearchChannels",
|
|
153
|
+
pagination: {
|
|
154
|
+
mode: "cursor",
|
|
155
|
+
inputToken: "after",
|
|
156
|
+
outputToken: "pagination.cursor",
|
|
157
|
+
items: "data",
|
|
158
|
+
pageSize: "first",
|
|
159
|
+
} as const,
|
|
160
|
+
}),
|
|
161
|
+
paginateCursor,
|
|
162
|
+
) as any;
|
|
163
|
+
|
|
164
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
165
|
+
function __c0(j: number): any {
|
|
166
|
+
switch (j) {
|
|
167
|
+
case 0:
|
|
168
|
+
return S.suspend(() =>
|
|
169
|
+
S.Struct({
|
|
170
|
+
query: S.String.pipe(T.Query()),
|
|
171
|
+
first: S.optional(S.Number.pipe(T.Query())),
|
|
172
|
+
after: S.optional(S.String.pipe(T.Query())),
|
|
173
|
+
}).pipe(T.Http({ method: "GET", uri: "/search/categories", code: 200 })),
|
|
174
|
+
).annotate({ identifier: "SearchCategoriesRequest" });
|
|
175
|
+
case 1:
|
|
176
|
+
return S.suspend(() =>
|
|
177
|
+
S.Struct({
|
|
178
|
+
box_art_url: S.optional(S.String),
|
|
179
|
+
name: S.optional(S.String),
|
|
180
|
+
id: S.optional(S.String),
|
|
181
|
+
}),
|
|
182
|
+
).annotate({ identifier: "SearchCategoriesResponseDataItem" });
|
|
183
|
+
case 2:
|
|
184
|
+
return S.Array(__S(1, __c0, 1));
|
|
185
|
+
case 3:
|
|
186
|
+
return S.suspend(() =>
|
|
187
|
+
S.Struct({
|
|
188
|
+
data: __S(2, __c0, 2),
|
|
189
|
+
pagination: S.optional(__S(8, __c1, 0)),
|
|
190
|
+
}),
|
|
191
|
+
).annotate({ identifier: "SearchCategoriesResponse" });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function __c1(j: number): any {
|
|
195
|
+
switch (j) {
|
|
196
|
+
case 0:
|
|
197
|
+
return S.suspend(() =>
|
|
198
|
+
S.Struct({
|
|
199
|
+
cursor: S.optional(S.String),
|
|
200
|
+
}),
|
|
201
|
+
).annotate({ identifier: "SearchCategoriesResponsePagination" });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function __c2(j: number): any {
|
|
205
|
+
switch (j) {
|
|
206
|
+
case 0:
|
|
207
|
+
return S.suspend(() =>
|
|
208
|
+
S.Struct({
|
|
209
|
+
query: S.String.pipe(T.Query()),
|
|
210
|
+
live_only: S.optional(S.Boolean.pipe(T.Query())),
|
|
211
|
+
first: S.optional(S.Number.pipe(T.Query())),
|
|
212
|
+
after: S.optional(S.String.pipe(T.Query())),
|
|
213
|
+
}).pipe(T.Http({ method: "GET", uri: "/search/channels", code: 200 })),
|
|
214
|
+
).annotate({ identifier: "SearchChannelsRequest" });
|
|
215
|
+
case 1:
|
|
216
|
+
return S.Array(S.String);
|
|
217
|
+
case 2:
|
|
218
|
+
return S.suspend(() =>
|
|
219
|
+
S.Struct({
|
|
220
|
+
broadcaster_language: S.optional(S.String),
|
|
221
|
+
broadcaster_login: S.optional(S.String),
|
|
222
|
+
display_name: S.optional(S.String),
|
|
223
|
+
game_id: S.optional(S.String),
|
|
224
|
+
game_name: S.optional(S.String),
|
|
225
|
+
id: S.optional(S.String),
|
|
226
|
+
is_live: S.optional(S.Boolean),
|
|
227
|
+
tag_ids: S.optional(__S(17, __c2, 1)),
|
|
228
|
+
tags: S.optional(__S(17, __c2, 1)),
|
|
229
|
+
thumbnail_url: S.optional(S.String),
|
|
230
|
+
title: S.optional(S.String),
|
|
231
|
+
started_at: S.optional(S.String),
|
|
232
|
+
}),
|
|
233
|
+
).annotate({ identifier: "SearchChannelsResponseDataItem" });
|
|
234
|
+
case 3:
|
|
235
|
+
return S.Array(__S(18, __c2, 2));
|
|
236
|
+
case 4:
|
|
237
|
+
return S.suspend(() =>
|
|
238
|
+
S.Struct({
|
|
239
|
+
data: __S(19, __c2, 3),
|
|
240
|
+
pagination: S.optional(__S(8, __c1, 0)),
|
|
241
|
+
}),
|
|
242
|
+
).annotate({ identifier: "SearchChannelsResponse" });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
246
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
247
|
+
return (__s[i] ??= __L.at(f, j));
|
|
248
|
+
}
|