@distilled.cloud/twitch 0.0.0 → 1.0.0-rc.22
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,453 @@
|
|
|
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 type * as Redacted from "effect/Redacted";
|
|
6
|
+
import { TwitchServiceErrors } from "../errors.ts";
|
|
7
|
+
import { paginateCursor } from "../pagination.ts";
|
|
8
|
+
import { TwitchProtocol, type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
|
|
9
|
+
import * as Retry from "../retry.ts";
|
|
10
|
+
import * as T from "../traits.ts";
|
|
11
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
12
|
+
const __s: any[] = [];
|
|
13
|
+
|
|
14
|
+
export type { TwitchOpError, TwitchOpContext };
|
|
15
|
+
|
|
16
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
17
|
+
const TELEMETRY = {
|
|
18
|
+
system: "twitch-api",
|
|
19
|
+
responseHeaders: [
|
|
20
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
21
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
22
|
+
],
|
|
23
|
+
prefix: "Twitch",
|
|
24
|
+
service: "Conduits",
|
|
25
|
+
propagate: "w3c",
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
export interface CreateConduitsRequest {
|
|
29
|
+
/** The number of shards to create for this conduit. The minimum is 1 and the maximum is 20,000. */
|
|
30
|
+
shard_count: number;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateConduitsResponseDataItem {
|
|
33
|
+
/** Conduit ID. */
|
|
34
|
+
id?: string | undefined;
|
|
35
|
+
/** Number of shards created for this conduit. */
|
|
36
|
+
shard_count?: number | undefined;
|
|
37
|
+
}
|
|
38
|
+
/** A list that contains the conduit that you created. */
|
|
39
|
+
export type CreateConduitsResponseDataList = Array<CreateConduitsResponseDataItem>;
|
|
40
|
+
export interface CreateConduitsResponse {
|
|
41
|
+
/** A list that contains the conduit that you created. */
|
|
42
|
+
data?: CreateConduitsResponseDataList | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface DeleteConduitRequest {
|
|
45
|
+
/** Conduit ID. */
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
export interface DeleteConduitResponse {}
|
|
49
|
+
export interface GetConduitsRequest {}
|
|
50
|
+
export interface GetConduitsResponseDataItem {
|
|
51
|
+
/** Conduit ID. */
|
|
52
|
+
id?: string | undefined;
|
|
53
|
+
/** Number of shards associated with this conduit. */
|
|
54
|
+
shard_count?: number | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** List of information about the client's conduits. */
|
|
57
|
+
export type GetConduitsResponseDataList = Array<GetConduitsResponseDataItem>;
|
|
58
|
+
export interface GetConduitsResponse {
|
|
59
|
+
/** List of information about the client's conduits. */
|
|
60
|
+
data?: GetConduitsResponseDataList | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface GetConduitShardsRequest {
|
|
63
|
+
/** Conduit ID. */
|
|
64
|
+
conduit_id: string;
|
|
65
|
+
/** Status to filter by. Possible values: - `enabled`: The shard is enabled. - `webhook_callback_verification_pending`: The shard 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. - `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. */
|
|
66
|
+
status?: string | undefined;
|
|
67
|
+
/** The cursor used to get the next page of results. The pagination object in the response contains the cursor's value. */
|
|
68
|
+
after?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
/** The transport details used to send the notifications. */
|
|
71
|
+
export interface GetConduitShardsResponseDataItemTransport {
|
|
72
|
+
/** The transport method. Possible values: - `webhook` - `websocket` */
|
|
73
|
+
method?: string | undefined;
|
|
74
|
+
/** The callback URL where the notifications are sent. Included only if method is set to webhook. */
|
|
75
|
+
callback?: string | undefined;
|
|
76
|
+
/** An ID that identifies the WebSocket that notifications are sent to. Included only if method is set to websocket. */
|
|
77
|
+
session_id?: string | undefined;
|
|
78
|
+
/** The UTC date and time that the WebSocket connection was established. Included only if method is set to websocket. */
|
|
79
|
+
connected_at?: string | undefined;
|
|
80
|
+
/** The UTC date and time that the WebSocket connection was lost. Included only if method is set to websocket. */
|
|
81
|
+
disconnected_at?: string | undefined;
|
|
82
|
+
}
|
|
83
|
+
export interface GetConduitShardsResponseDataItem {
|
|
84
|
+
/** Shard ID. */
|
|
85
|
+
id?: string | undefined;
|
|
86
|
+
/** The shard status. The subscriber receives events only for enabled shards. Possible values: - `enabled`: The shard is enabled. - `webhook_callback_verification_pending`: The shard 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. - `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. */
|
|
87
|
+
status?: string | undefined;
|
|
88
|
+
/** The transport details used to send the notifications. */
|
|
89
|
+
transport?: GetConduitShardsResponseDataItemTransport | undefined;
|
|
90
|
+
}
|
|
91
|
+
/** List of information about a conduit's shards. */
|
|
92
|
+
export type GetConduitShardsResponseDataList = Array<GetConduitShardsResponseDataItem>;
|
|
93
|
+
/** Contains information used to page through a list of results. The object is empty if there are no more pages left to page through. */
|
|
94
|
+
export interface GetConduitShardsResponsePagination {
|
|
95
|
+
/** The cursor used to get the next page of results. Use the cursor to set the request's after query parameter. */
|
|
96
|
+
cursor?: string | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface GetConduitShardsResponse {
|
|
99
|
+
/** List of information about a conduit's shards. */
|
|
100
|
+
data: GetConduitShardsResponseDataList;
|
|
101
|
+
/** Contains information used to page through a list of results. The object is empty if there are no more pages left to page through. */
|
|
102
|
+
pagination?: GetConduitShardsResponsePagination | undefined;
|
|
103
|
+
}
|
|
104
|
+
export interface UpdateConduitsRequest {
|
|
105
|
+
/** Conduit ID. */
|
|
106
|
+
id: string;
|
|
107
|
+
/** The new number of shards for this conduit. The minimum is 1 and the maximum is 20,000. */
|
|
108
|
+
shard_count: number;
|
|
109
|
+
}
|
|
110
|
+
export interface UpdateConduitsResponseDataItem {
|
|
111
|
+
/** Conduit ID. */
|
|
112
|
+
id?: string | undefined;
|
|
113
|
+
/** Number of shards associated with this conduit after the update. */
|
|
114
|
+
shard_count?: number | undefined;
|
|
115
|
+
}
|
|
116
|
+
/** A list that contains the updated conduit. */
|
|
117
|
+
export type UpdateConduitsResponseDataList = Array<UpdateConduitsResponseDataItem>;
|
|
118
|
+
export interface UpdateConduitsResponse {
|
|
119
|
+
/** A list that contains the updated conduit. */
|
|
120
|
+
data?: UpdateConduitsResponseDataList | undefined;
|
|
121
|
+
}
|
|
122
|
+
/** The transport details that you want Twitch to use when sending you notifications. */
|
|
123
|
+
export interface UpdateConduitShardsRequestShardsItemTransport {
|
|
124
|
+
/** The transport method. Possible values: - `webhook` - `websocket` */
|
|
125
|
+
method: string;
|
|
126
|
+
/** The callback URL where the notifications are sent. The URL must use the HTTPS protocol and port 443. See Processing an event. Specify this field only if method is set to webhook. **NOTE:** Redirects are not followed. */
|
|
127
|
+
callback?: string | undefined;
|
|
128
|
+
/** 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. Specify this field only if method is set to webhook. */
|
|
129
|
+
secret?: string | Redacted.Redacted<string> | undefined;
|
|
130
|
+
/** 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. */
|
|
131
|
+
session_id?: string | undefined;
|
|
132
|
+
}
|
|
133
|
+
export interface UpdateConduitShardsRequestShardsItem {
|
|
134
|
+
/** Shard ID. */
|
|
135
|
+
id: string;
|
|
136
|
+
/** The transport details that you want Twitch to use when sending you notifications. */
|
|
137
|
+
transport: UpdateConduitShardsRequestShardsItemTransport;
|
|
138
|
+
}
|
|
139
|
+
/** List of shards to update. */
|
|
140
|
+
export type UpdateConduitShardsRequestShardsList = Array<UpdateConduitShardsRequestShardsItem>;
|
|
141
|
+
export interface UpdateConduitShardsRequest {
|
|
142
|
+
/** Conduit ID. */
|
|
143
|
+
conduit_id: string;
|
|
144
|
+
/** List of shards to update. */
|
|
145
|
+
shards: UpdateConduitShardsRequestShardsList;
|
|
146
|
+
}
|
|
147
|
+
/** The transport details used to send the notifications. */
|
|
148
|
+
export type UpdateConduitShardsResponseDataItemTransport =
|
|
149
|
+
GetConduitShardsResponseDataItemTransport;
|
|
150
|
+
export interface UpdateConduitShardsResponseDataItem {
|
|
151
|
+
/** Shard ID. */
|
|
152
|
+
id?: string | undefined;
|
|
153
|
+
/** The shard status. The subscriber receives events only for enabled shards. Possible values: - `enabled`: The shard is enabled. - `webhook_callback_verification_pending`: The shard 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. - `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_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. */
|
|
154
|
+
status?: string | undefined;
|
|
155
|
+
/** The transport details used to send the notifications. */
|
|
156
|
+
transport?: GetConduitShardsResponseDataItemTransport | undefined;
|
|
157
|
+
}
|
|
158
|
+
/** List of successful shard updates. */
|
|
159
|
+
export type UpdateConduitShardsResponseDataList = Array<UpdateConduitShardsResponseDataItem>;
|
|
160
|
+
export interface UpdateConduitShardsResponseErrorsItem {
|
|
161
|
+
/** Shard ID. */
|
|
162
|
+
id?: string | undefined;
|
|
163
|
+
/** The error that occurred while updating the shard. Possible errors: - `invalid shard id, must be a number greater or equal to 0 and less than N` -- The shard ID must be a number from 0 through N - 1, where N is the conduit's shard count. - `failed webhook transport validation: callback, must provide valid https callback with standard port in creation request` -- The URL in the callback field must use the HTTPS protocol and port 443. - `failed webhook transport validation: secret, must be between 10 and 100 characters` - `failed websocket transport validation: session_id, websocket transport session does not exist or has already disconnected` - `Duplicate shards in request` -- The request specifies the shard ID more than once. None of the entries for that shard are applied. - `Internal error` -- An internal error occurred while updating the shard. Try again later. */
|
|
164
|
+
message?: string | undefined;
|
|
165
|
+
/** Error codes used to represent a specific error condition while attempting to update shards. Possible values: - `invalid_parameter`: The shard ID or transport isn't valid, or the request specifies the shard ID more than once. - `internal_error`: An internal error occurred. Try again later. */
|
|
166
|
+
code?: string | undefined;
|
|
167
|
+
}
|
|
168
|
+
/** List of unsuccessful updates. */
|
|
169
|
+
export type UpdateConduitShardsResponseErrorsList = Array<UpdateConduitShardsResponseErrorsItem>;
|
|
170
|
+
export interface UpdateConduitShardsResponse {
|
|
171
|
+
/** List of successful shard updates. */
|
|
172
|
+
data?: UpdateConduitShardsResponseDataList | undefined;
|
|
173
|
+
/** List of unsuccessful updates. */
|
|
174
|
+
errors?: UpdateConduitShardsResponseErrorsList | undefined;
|
|
175
|
+
}
|
|
176
|
+
export type CreateConduitsError = TwitchOpError;
|
|
177
|
+
/** Create Conduits Creates a new [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). 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/conduits/#create-conduits */
|
|
178
|
+
export const createConduits: API.OperationMethod<
|
|
179
|
+
CreateConduitsRequest,
|
|
180
|
+
CreateConduitsResponse,
|
|
181
|
+
CreateConduitsError,
|
|
182
|
+
TwitchOpContext
|
|
183
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
184
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateConduitsRequest>,
|
|
185
|
+
output: __S(10, __c1, 2) as any as S.Schema<CreateConduitsResponse>,
|
|
186
|
+
errors: [],
|
|
187
|
+
serviceErrors: TwitchServiceErrors,
|
|
188
|
+
protocol: TwitchProtocol,
|
|
189
|
+
retry: Retry.Retry,
|
|
190
|
+
telemetry: TELEMETRY,
|
|
191
|
+
span: "CreateConduits",
|
|
192
|
+
}));
|
|
193
|
+
|
|
194
|
+
export type DeleteConduitError = TwitchOpError;
|
|
195
|
+
/** Delete Conduit Deletes a specified [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). Note that it may take some time for Eventsub subscriptions on a deleted [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md) to show as disabled when calling [Get Eventsub Subscriptions](https://dev.twitch.tv/docs/api/reference/eventsub.md#get-eventsub-subscriptions). 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/conduits/#delete-conduit */
|
|
196
|
+
export const deleteConduit: API.OperationMethod<
|
|
197
|
+
DeleteConduitRequest,
|
|
198
|
+
DeleteConduitResponse,
|
|
199
|
+
DeleteConduitError,
|
|
200
|
+
TwitchOpContext
|
|
201
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
202
|
+
input: __S(16, __c2, 0) as any as S.Schema<DeleteConduitRequest>,
|
|
203
|
+
output: __S(17, __c2, 1) as any as S.Schema<DeleteConduitResponse>,
|
|
204
|
+
errors: [],
|
|
205
|
+
serviceErrors: TwitchServiceErrors,
|
|
206
|
+
protocol: TwitchProtocol,
|
|
207
|
+
retry: Retry.Retry,
|
|
208
|
+
telemetry: TELEMETRY,
|
|
209
|
+
span: "DeleteConduit",
|
|
210
|
+
}));
|
|
211
|
+
|
|
212
|
+
export type GetConduitsError = TwitchOpError;
|
|
213
|
+
/** Get Conduits Gets the [conduits](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md) for a client ID. 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/conduits/#get-conduits */
|
|
214
|
+
export const getConduits: API.OperationMethod<
|
|
215
|
+
GetConduitsRequest,
|
|
216
|
+
GetConduitsResponse,
|
|
217
|
+
GetConduitsError,
|
|
218
|
+
TwitchOpContext
|
|
219
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
220
|
+
input: __S(24, __c3, 0) as any as S.Schema<GetConduitsRequest>,
|
|
221
|
+
output: __S(10, __c1, 2) as any as S.Schema<GetConduitsResponse>,
|
|
222
|
+
errors: [],
|
|
223
|
+
serviceErrors: TwitchServiceErrors,
|
|
224
|
+
protocol: TwitchProtocol,
|
|
225
|
+
retry: Retry.Retry,
|
|
226
|
+
telemetry: TELEMETRY,
|
|
227
|
+
span: "GetConduits",
|
|
228
|
+
}));
|
|
229
|
+
|
|
230
|
+
export type GetConduitShardsError = TwitchOpError;
|
|
231
|
+
/** Get Conduit Shards Gets a list of shards for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). The list includes only shards that you've assigned a transport to using [Update Conduit Shards](https://dev.twitch.tv/docs/api/reference/conduits.md#update-conduit-shards), so it's empty for a new conduit. 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/conduits/#get-conduit-shards */
|
|
232
|
+
export const getConduitShards: API.PaginatedOperationMethod<
|
|
233
|
+
GetConduitShardsRequest,
|
|
234
|
+
GetConduitShardsResponse,
|
|
235
|
+
GetConduitShardsError,
|
|
236
|
+
TwitchOpContext,
|
|
237
|
+
GetConduitShardsResponseDataItem
|
|
238
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
239
|
+
() => ({
|
|
240
|
+
input: __S(32, __c4, 0) as any as S.Schema<GetConduitShardsRequest>,
|
|
241
|
+
output: __S(34, __c4, 2) as any as S.Schema<GetConduitShardsResponse>,
|
|
242
|
+
errors: [],
|
|
243
|
+
serviceErrors: TwitchServiceErrors,
|
|
244
|
+
protocol: TwitchProtocol,
|
|
245
|
+
retry: Retry.Retry,
|
|
246
|
+
telemetry: TELEMETRY,
|
|
247
|
+
span: "GetConduitShards",
|
|
248
|
+
pagination: {
|
|
249
|
+
mode: "cursor",
|
|
250
|
+
inputToken: "after",
|
|
251
|
+
outputToken: "pagination.cursor",
|
|
252
|
+
items: "data",
|
|
253
|
+
} as const,
|
|
254
|
+
}),
|
|
255
|
+
paginateCursor,
|
|
256
|
+
) as any;
|
|
257
|
+
|
|
258
|
+
export type UpdateConduitsError = TwitchOpError;
|
|
259
|
+
/** Update Conduits Updates a [conduit's](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md) shard count. To delete shards, update the count to a lower number, and the shards above the count will be deleted. For example, if the existing shard count is 100, by resetting shard count to 50, shards 50-99 are deleted. 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/conduits/#update-conduits */
|
|
260
|
+
export const updateConduits: API.OperationMethod<
|
|
261
|
+
UpdateConduitsRequest,
|
|
262
|
+
UpdateConduitsResponse,
|
|
263
|
+
UpdateConduitsError,
|
|
264
|
+
TwitchOpContext
|
|
265
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
266
|
+
input: __S(48, __c6, 0) as any as S.Schema<UpdateConduitsRequest>,
|
|
267
|
+
output: __S(10, __c1, 2) as any as S.Schema<UpdateConduitsResponse>,
|
|
268
|
+
errors: [],
|
|
269
|
+
serviceErrors: TwitchServiceErrors,
|
|
270
|
+
protocol: TwitchProtocol,
|
|
271
|
+
retry: Retry.Retry,
|
|
272
|
+
telemetry: TELEMETRY,
|
|
273
|
+
span: "UpdateConduits",
|
|
274
|
+
}));
|
|
275
|
+
|
|
276
|
+
export type UpdateConduitShardsError = TwitchOpError;
|
|
277
|
+
/** Update Conduit Shards Updates shard(s) for a [conduit](https://dev.twitch.tv/docs/eventsub/handling-conduit-events.md). You can update up to 100 shards in a single request. > **Note** Shard IDs are indexed starting at 0, so a conduit with a `shard_count` of 5 will have shards with IDs 0 through 4. 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/conduits/#update-conduit-shards */
|
|
278
|
+
export const updateConduitShards: API.OperationMethod<
|
|
279
|
+
UpdateConduitShardsRequest,
|
|
280
|
+
UpdateConduitShardsResponse,
|
|
281
|
+
UpdateConduitShardsError,
|
|
282
|
+
TwitchOpContext
|
|
283
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
284
|
+
input: __S(59, __c7, 3) as any as S.Schema<UpdateConduitShardsRequest>,
|
|
285
|
+
output: __S(62, __c7, 6) as any as S.Schema<UpdateConduitShardsResponse>,
|
|
286
|
+
errors: [],
|
|
287
|
+
serviceErrors: TwitchServiceErrors,
|
|
288
|
+
protocol: TwitchProtocol,
|
|
289
|
+
retry: Retry.Retry,
|
|
290
|
+
telemetry: TELEMETRY,
|
|
291
|
+
span: "UpdateConduitShards",
|
|
292
|
+
}));
|
|
293
|
+
|
|
294
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
295
|
+
function __c0(j: number): any {
|
|
296
|
+
switch (j) {
|
|
297
|
+
case 0:
|
|
298
|
+
return S.suspend(() =>
|
|
299
|
+
S.Struct({
|
|
300
|
+
shard_count: S.Number,
|
|
301
|
+
}).pipe(T.Http({ method: "POST", uri: "/eventsub/conduits", code: 200 })),
|
|
302
|
+
).annotate({ identifier: "CreateConduitsRequest" });
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function __c1(j: number): any {
|
|
306
|
+
switch (j) {
|
|
307
|
+
case 0:
|
|
308
|
+
return S.suspend(() =>
|
|
309
|
+
S.Struct({
|
|
310
|
+
id: S.optional(S.String),
|
|
311
|
+
shard_count: S.optional(S.Number),
|
|
312
|
+
}),
|
|
313
|
+
).annotate({ identifier: "CreateConduitsResponseDataItem" });
|
|
314
|
+
case 1:
|
|
315
|
+
return S.Array(__S(8, __c1, 0));
|
|
316
|
+
case 2:
|
|
317
|
+
return S.suspend(() =>
|
|
318
|
+
S.Struct({
|
|
319
|
+
data: S.optional(__S(9, __c1, 1)),
|
|
320
|
+
}),
|
|
321
|
+
).annotate({ identifier: "CreateConduitsResponse" });
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function __c2(j: number): any {
|
|
325
|
+
switch (j) {
|
|
326
|
+
case 0:
|
|
327
|
+
return S.suspend(() =>
|
|
328
|
+
S.Struct({
|
|
329
|
+
id: S.String.pipe(T.Query()),
|
|
330
|
+
}).pipe(T.Http({ method: "DELETE", uri: "/eventsub/conduits", code: 200 })),
|
|
331
|
+
).annotate({ identifier: "DeleteConduitRequest" });
|
|
332
|
+
case 1:
|
|
333
|
+
return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteConduitResponse" });
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function __c3(j: number): any {
|
|
337
|
+
switch (j) {
|
|
338
|
+
case 0:
|
|
339
|
+
return S.suspend(() =>
|
|
340
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/eventsub/conduits", code: 200 })),
|
|
341
|
+
).annotate({ identifier: "GetConduitsRequest" });
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function __c4(j: number): any {
|
|
345
|
+
switch (j) {
|
|
346
|
+
case 0:
|
|
347
|
+
return S.suspend(() =>
|
|
348
|
+
S.Struct({
|
|
349
|
+
conduit_id: S.String.pipe(T.Query()),
|
|
350
|
+
status: S.optional(S.String.pipe(T.Query())),
|
|
351
|
+
after: S.optional(S.String.pipe(T.Query())),
|
|
352
|
+
}).pipe(T.Http({ method: "GET", uri: "/eventsub/conduits/shards", code: 200 })),
|
|
353
|
+
).annotate({ identifier: "GetConduitShardsRequest" });
|
|
354
|
+
case 1:
|
|
355
|
+
return S.suspend(() =>
|
|
356
|
+
S.Struct({
|
|
357
|
+
cursor: S.optional(S.String),
|
|
358
|
+
}),
|
|
359
|
+
).annotate({ identifier: "GetConduitShardsResponsePagination" });
|
|
360
|
+
case 2:
|
|
361
|
+
return S.suspend(() =>
|
|
362
|
+
S.Struct({
|
|
363
|
+
data: __S(42, __c5, 2),
|
|
364
|
+
pagination: S.optional(__S(33, __c4, 1)),
|
|
365
|
+
}),
|
|
366
|
+
).annotate({ identifier: "GetConduitShardsResponse" });
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function __c5(j: number): any {
|
|
370
|
+
switch (j) {
|
|
371
|
+
case 0:
|
|
372
|
+
return S.suspend(() =>
|
|
373
|
+
S.Struct({
|
|
374
|
+
method: S.optional(S.String),
|
|
375
|
+
callback: S.optional(S.String),
|
|
376
|
+
session_id: S.optional(S.String),
|
|
377
|
+
connected_at: S.optional(S.String),
|
|
378
|
+
disconnected_at: S.optional(S.String),
|
|
379
|
+
}),
|
|
380
|
+
).annotate({ identifier: "GetConduitShardsResponseDataItemTransport" });
|
|
381
|
+
case 1:
|
|
382
|
+
return S.suspend(() =>
|
|
383
|
+
S.Struct({
|
|
384
|
+
id: S.optional(S.String),
|
|
385
|
+
status: S.optional(S.String),
|
|
386
|
+
transport: S.optional(__S(40, __c5, 0)),
|
|
387
|
+
}),
|
|
388
|
+
).annotate({ identifier: "GetConduitShardsResponseDataItem" });
|
|
389
|
+
case 2:
|
|
390
|
+
return S.Array(__S(41, __c5, 1));
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
function __c6(j: number): any {
|
|
394
|
+
switch (j) {
|
|
395
|
+
case 0:
|
|
396
|
+
return S.suspend(() =>
|
|
397
|
+
S.Struct({
|
|
398
|
+
id: S.String,
|
|
399
|
+
shard_count: S.Number,
|
|
400
|
+
}).pipe(T.Http({ method: "PATCH", uri: "/eventsub/conduits", code: 200 })),
|
|
401
|
+
).annotate({ identifier: "UpdateConduitsRequest" });
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function __c7(j: number): any {
|
|
405
|
+
switch (j) {
|
|
406
|
+
case 0:
|
|
407
|
+
return S.suspend(() =>
|
|
408
|
+
S.Struct({
|
|
409
|
+
method: S.String,
|
|
410
|
+
callback: S.optional(S.String),
|
|
411
|
+
secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
412
|
+
session_id: S.optional(S.String),
|
|
413
|
+
}),
|
|
414
|
+
).annotate({ identifier: "UpdateConduitShardsRequestShardsItemTransport" });
|
|
415
|
+
case 1:
|
|
416
|
+
return S.suspend(() =>
|
|
417
|
+
S.Struct({
|
|
418
|
+
id: S.String,
|
|
419
|
+
transport: __S(56, __c7, 0),
|
|
420
|
+
}),
|
|
421
|
+
).annotate({ identifier: "UpdateConduitShardsRequestShardsItem" });
|
|
422
|
+
case 2:
|
|
423
|
+
return S.Array(__S(57, __c7, 1));
|
|
424
|
+
case 3:
|
|
425
|
+
return S.suspend(() =>
|
|
426
|
+
S.Struct({
|
|
427
|
+
conduit_id: S.String,
|
|
428
|
+
shards: __S(58, __c7, 2),
|
|
429
|
+
}).pipe(T.Http({ method: "PATCH", uri: "/eventsub/conduits/shards", code: 200 })),
|
|
430
|
+
).annotate({ identifier: "UpdateConduitShardsRequest" });
|
|
431
|
+
case 4:
|
|
432
|
+
return S.suspend(() =>
|
|
433
|
+
S.Struct({
|
|
434
|
+
id: S.optional(S.String),
|
|
435
|
+
message: S.optional(S.String),
|
|
436
|
+
code: S.optional(S.String),
|
|
437
|
+
}),
|
|
438
|
+
).annotate({ identifier: "UpdateConduitShardsResponseErrorsItem" });
|
|
439
|
+
case 5:
|
|
440
|
+
return S.Array(__S(60, __c7, 4));
|
|
441
|
+
case 6:
|
|
442
|
+
return S.suspend(() =>
|
|
443
|
+
S.Struct({
|
|
444
|
+
data: S.optional(__S(42, __c5, 2)),
|
|
445
|
+
errors: S.optional(__S(61, __c7, 5)),
|
|
446
|
+
}),
|
|
447
|
+
).annotate({ identifier: "UpdateConduitShardsResponse" });
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
451
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
452
|
+
return (__s[i] ??= __L.at(f, j));
|
|
453
|
+
}
|