@overlaysymphony/twitch 0.1.0
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/README.md +9 -0
- package/package.json +40 -0
- package/src/authentication/authentication.ts +107 -0
- package/src/authentication/index.ts +1 -0
- package/src/chat/chat.ts +160 -0
- package/src/chat/index.ts +6 -0
- package/src/chat/interfaces/events.ts +269 -0
- package/src/chat/interfaces/index.ts +9 -0
- package/src/chat/parser.ts +265 -0
- package/src/eventsub/events/channel.ad_break.begin.ts +51 -0
- package/src/eventsub/events/channel.ban.ts +59 -0
- package/src/eventsub/events/channel.channel_points_custom_reward._.ts +29 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +75 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +77 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +77 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption._.ts +10 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +59 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +59 -0
- package/src/eventsub/events/channel.charity_campaign.donate.ts +66 -0
- package/src/eventsub/events/channel.charity_campaign.progress.ts +67 -0
- package/src/eventsub/events/channel.charity_campaign.start.ts +69 -0
- package/src/eventsub/events/channel.charity_campaign.stop.ts +69 -0
- package/src/eventsub/events/channel.chat.clear.ts +42 -0
- package/src/eventsub/events/channel.chat.clear_user_messages.ts +48 -0
- package/src/eventsub/events/channel.chat.message_delete.ts +50 -0
- package/src/eventsub/events/channel.chat.notification.ts +50 -0
- package/src/eventsub/events/channel.cheer.ts +51 -0
- package/src/eventsub/events/channel.follow.ts +50 -0
- package/src/eventsub/events/channel.goal.begin.ts +51 -0
- package/src/eventsub/events/channel.goal.end.ts +55 -0
- package/src/eventsub/events/channel.goal.progress.ts +51 -0
- package/src/eventsub/events/channel.guest_star_guest.update.ts +66 -0
- package/src/eventsub/events/channel.guest_star_session.begin.ts +46 -0
- package/src/eventsub/events/channel.guest_star_session.end.ts +48 -0
- package/src/eventsub/events/channel.guest_star_settings.update.ts +50 -0
- package/src/eventsub/events/channel.hype_train._.ts +12 -0
- package/src/eventsub/events/channel.hype_train.begin.ts +57 -0
- package/src/eventsub/events/channel.hype_train.end.ts +55 -0
- package/src/eventsub/events/channel.hype_train.progress.ts +70 -0
- package/src/eventsub/events/channel.moderator.add.ts +45 -0
- package/src/eventsub/events/channel.moderator.remove.ts +45 -0
- package/src/eventsub/events/channel.poll._.ts +26 -0
- package/src/eventsub/events/channel.poll.begin.ts +55 -0
- package/src/eventsub/events/channel.poll.end.ts +57 -0
- package/src/eventsub/events/channel.poll.progress.ts +55 -0
- package/src/eventsub/events/channel.prediction._.ts +25 -0
- package/src/eventsub/events/channel.prediction.begin.ts +51 -0
- package/src/eventsub/events/channel.prediction.end.ts +55 -0
- package/src/eventsub/events/channel.prediction.lock.ts +51 -0
- package/src/eventsub/events/channel.prediction.progress.ts +51 -0
- package/src/eventsub/events/channel.raid.ts +49 -0
- package/src/eventsub/events/channel.shield_mode.begin.ts +50 -0
- package/src/eventsub/events/channel.shield_mode.end.ts +50 -0
- package/src/eventsub/events/channel.shoutout.create.ts +62 -0
- package/src/eventsub/events/channel.shoutout.receive.ts +52 -0
- package/src/eventsub/events/channel.subscribe.ts +49 -0
- package/src/eventsub/events/channel.subscription.end.ts +49 -0
- package/src/eventsub/events/channel.subscription.gift.ts +53 -0
- package/src/eventsub/events/channel.subscription.message.ts +67 -0
- package/src/eventsub/events/channel.unban.ts +51 -0
- package/src/eventsub/events/channel.update.ts +49 -0
- package/src/eventsub/events/index.ts +284 -0
- package/src/eventsub/events/stream.offline.ts +39 -0
- package/src/eventsub/events/stream.online.ts +45 -0
- package/src/eventsub/events/user.update.ts +45 -0
- package/src/eventsub/events-helpers.ts +29 -0
- package/src/eventsub/eventsub.ts +88 -0
- package/src/eventsub/index.ts +7 -0
- package/src/eventsub/messages.ts +34 -0
- package/src/helix/channel-points/custom-rewards.ts +63 -0
- package/src/helix/channel-points/index.ts +1 -0
- package/src/helix/helix.ts +89 -0
- package/src/helix/subscriptions/index.ts +1 -0
- package/src/helix/subscriptions/subscriptions.ts +122 -0
- package/src/helix/users/index.ts +1 -0
- package/src/helix/users/users.ts +42 -0
- package/src/helpers/alerts/alerts.ts +60 -0
- package/src/helpers/alerts/index.ts +2 -0
- package/src/helpers/charity/charity.ts +89 -0
- package/src/helpers/charity/index.ts +1 -0
- package/src/helpers/goal/goal.ts +38 -0
- package/src/helpers/goal/index.ts +1 -0
- package/src/helpers/hype-train/hype-train.ts +51 -0
- package/src/helpers/hype-train/index.ts +1 -0
- package/src/helpers/poll/index.ts +1 -0
- package/src/helpers/poll/poll.ts +63 -0
- package/src/helpers/prediction/index.ts +1 -0
- package/src/helpers/prediction/prediction.ts +66 -0
- package/src/helpers/redemption/index.ts +1 -0
- package/src/helpers/redemption/redemption.ts +42 -0
- package/src/helpers/status/index.ts +1 -0
- package/src/helpers/status/status.ts +61 -0
- package/src/setupTests.ts +0 -0
- package/src/ui/authentication.ts +230 -0
- package/src/ui/popup.ts +115 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
type ChannelModeratorRemoveType = "channel.moderator.remove"
|
|
4
|
+
type ChannelModeratorRemoveVersion = "1"
|
|
5
|
+
|
|
6
|
+
/** The parameters under which an event fires when The broadcaster removes moderator privileges from a user. */
|
|
7
|
+
export interface ChannelModeratorRemoveCondition {
|
|
8
|
+
/** The user ID of the broadcaster. */
|
|
9
|
+
broadcaster_user_id: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** The event information when The broadcaster removes moderator privileges from a user. */
|
|
13
|
+
export interface ChannelModeratorRemoveEvent {
|
|
14
|
+
/** The user ID of the broadcaster. */
|
|
15
|
+
broadcaster_user_id: string
|
|
16
|
+
/** The user login of the broadcaster. */
|
|
17
|
+
broadcaster_user_login: string
|
|
18
|
+
/** The user name of the broadcaster. */
|
|
19
|
+
broadcaster_user_name: string
|
|
20
|
+
/** The user ID of the removed moderator. */
|
|
21
|
+
user_id: string
|
|
22
|
+
/** The user login of the removed moderator. */
|
|
23
|
+
user_login: string
|
|
24
|
+
/** The user name of the removed moderator. */
|
|
25
|
+
user_name: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The event notification received when The broadcaster removes moderator privileges from a user. */
|
|
29
|
+
export type ChannelModeratorRemoveSubscription = BaseSubscription<
|
|
30
|
+
ChannelModeratorRemoveType,
|
|
31
|
+
ChannelModeratorRemoveVersion,
|
|
32
|
+
ChannelModeratorRemoveCondition
|
|
33
|
+
>
|
|
34
|
+
|
|
35
|
+
export function makeChannelModeratorRemoveSubscription(
|
|
36
|
+
userId: string,
|
|
37
|
+
): ChannelModeratorRemoveSubscription {
|
|
38
|
+
return {
|
|
39
|
+
type: "channel.moderator.remove",
|
|
40
|
+
version: "1",
|
|
41
|
+
condition: {
|
|
42
|
+
broadcaster_user_id: userId,
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface ChannelPollPointsVoting {
|
|
2
|
+
/** Indicates if channel points can be used for voting. */
|
|
3
|
+
is_enabled: boolean
|
|
4
|
+
/** Integer. Number of channel points required to vote once with channel points. */
|
|
5
|
+
amount_per_vote: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ChannelPollBitsVoting {
|
|
9
|
+
/** Indicates if bits can be used for voting. */
|
|
10
|
+
is_enabled: boolean
|
|
11
|
+
/** Integer. Number of bits required to vote once with bits. */
|
|
12
|
+
amount_per_vote: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ChannelPollChoice {
|
|
16
|
+
/** ID for the choice. */
|
|
17
|
+
id: string
|
|
18
|
+
/** Text displayed for the choice. */
|
|
19
|
+
title: string
|
|
20
|
+
/** Integer. Not used; will be set to 0. */
|
|
21
|
+
bits_votes: number
|
|
22
|
+
/** Integer. Number of votes received via Channel Points. */
|
|
23
|
+
channel_points_votes: number
|
|
24
|
+
/** Integer. Total number of votes received for the choice across all methods of voting. */
|
|
25
|
+
votes: number
|
|
26
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPollBeginType = "channel.poll.begin"
|
|
6
|
+
type ChannelPollBeginVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A poll starts. */
|
|
9
|
+
export interface ChannelPollBeginCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A poll starts. */
|
|
15
|
+
export interface ChannelPollBeginEvent {
|
|
16
|
+
/** ID of the poll. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Question displayed for the poll. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of choices for the poll. */
|
|
27
|
+
choices: ChannelPollChoice[]
|
|
28
|
+
/** The bits voting settings for the poll. */
|
|
29
|
+
bits_voting: ChannelPollBitsVoting
|
|
30
|
+
/** The Channel Points voting settings for the poll. */
|
|
31
|
+
channel_points_voting: ChannelPollPointsVoting
|
|
32
|
+
/** The time the poll started. */
|
|
33
|
+
started_at: Date
|
|
34
|
+
/** The time the poll will end. */
|
|
35
|
+
ends_at: Date
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The event notification received when A poll starts. */
|
|
39
|
+
export type ChannelPollBeginSubscription = BaseSubscription<
|
|
40
|
+
ChannelPollBeginType,
|
|
41
|
+
ChannelPollBeginVersion,
|
|
42
|
+
ChannelPollBeginCondition
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
export function makeChannelPollBeginSubscription(
|
|
46
|
+
userId: string,
|
|
47
|
+
): ChannelPollBeginSubscription {
|
|
48
|
+
return {
|
|
49
|
+
type: "channel.poll.begin",
|
|
50
|
+
version: "1",
|
|
51
|
+
condition: {
|
|
52
|
+
broadcaster_user_id: userId,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPollEndType = "channel.poll.end"
|
|
6
|
+
type ChannelPollEndVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A poll ends. */
|
|
9
|
+
export interface ChannelPollEndCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A poll ends. */
|
|
15
|
+
export interface ChannelPollEndEvent {
|
|
16
|
+
/** ID of the poll. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Question displayed for the poll. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of choices for the poll. Includes vote counts. */
|
|
27
|
+
choices: ChannelPollChoice[]
|
|
28
|
+
/** The bits voting settings for the poll. */
|
|
29
|
+
bits_voting: ChannelPollBitsVoting
|
|
30
|
+
/** The Channel Points voting settings for the poll. */
|
|
31
|
+
channel_points_voting: ChannelPollPointsVoting
|
|
32
|
+
/** The status of the poll. Valid values are completed, archived, and terminated. */
|
|
33
|
+
status: string
|
|
34
|
+
/** The time the poll started. */
|
|
35
|
+
started_at: Date
|
|
36
|
+
/** The time the poll ended. */
|
|
37
|
+
ended_at: Date
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The event notification received when A poll ends. */
|
|
41
|
+
export type ChannelPollEndSubscription = BaseSubscription<
|
|
42
|
+
ChannelPollEndType,
|
|
43
|
+
ChannelPollEndVersion,
|
|
44
|
+
ChannelPollEndCondition
|
|
45
|
+
>
|
|
46
|
+
|
|
47
|
+
export function makeChannelPollEndSubscription(
|
|
48
|
+
userId: string,
|
|
49
|
+
): ChannelPollEndSubscription {
|
|
50
|
+
return {
|
|
51
|
+
type: "channel.poll.end",
|
|
52
|
+
version: "1",
|
|
53
|
+
condition: {
|
|
54
|
+
broadcaster_user_id: userId,
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPollProgressType = "channel.poll.progress"
|
|
6
|
+
type ChannelPollProgressVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A user responds to a poll. */
|
|
9
|
+
export interface ChannelPollProgressCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A user responds to a poll. */
|
|
15
|
+
export interface ChannelPollProgressEvent {
|
|
16
|
+
/** ID of the poll. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Question displayed for the poll. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of choices for the poll. Includes vote counts. */
|
|
27
|
+
choices: ChannelPollChoice[]
|
|
28
|
+
/** The bits voting settings for the poll. */
|
|
29
|
+
bits_voting: ChannelPollBitsVoting
|
|
30
|
+
/** The Channel Points voting settings for the poll. */
|
|
31
|
+
channel_points_voting: ChannelPollPointsVoting
|
|
32
|
+
/** The time the poll started. */
|
|
33
|
+
started_at: Date
|
|
34
|
+
/** The time the poll will end. */
|
|
35
|
+
ends_at: Date
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The event notification received when A user responds to a poll. */
|
|
39
|
+
export type ChannelPollProgressSubscription = BaseSubscription<
|
|
40
|
+
ChannelPollProgressType,
|
|
41
|
+
ChannelPollProgressVersion,
|
|
42
|
+
ChannelPollProgressCondition
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
export function makeChannelPollProgressSubscription(
|
|
46
|
+
userId: string,
|
|
47
|
+
): ChannelPollProgressSubscription {
|
|
48
|
+
return {
|
|
49
|
+
type: "channel.poll.progress",
|
|
50
|
+
version: "1",
|
|
51
|
+
condition: {
|
|
52
|
+
broadcaster_user_id: userId,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ChannelPredictionOutcome {
|
|
2
|
+
/** The outcome ID. */
|
|
3
|
+
id: string
|
|
4
|
+
/** The outcome title. */
|
|
5
|
+
title: string
|
|
6
|
+
/** The color for the outcome. Valid values are pink and blue. */
|
|
7
|
+
color: string
|
|
8
|
+
/** Integer. The number of users who used Channel Points on this outcome. */
|
|
9
|
+
users: number
|
|
10
|
+
/** Integer. The total number of Channel Points used on this outcome. */
|
|
11
|
+
channel_points: number
|
|
12
|
+
/** An array of users who used the most Channel Points on this outcome. */
|
|
13
|
+
top_predictors: Array<{
|
|
14
|
+
/** The ID of the user. */
|
|
15
|
+
user_id: string
|
|
16
|
+
/** The login of the user. */
|
|
17
|
+
user_login: string
|
|
18
|
+
/** The display name of the user. */
|
|
19
|
+
user_name: string
|
|
20
|
+
/** Integer. The number of Channel Points won. This value is always null in the event payload for Prediction progress and Prediction lock. This value is 0 if the outcome did not win or if the Prediction was canceled and Channel Points were refunded. */
|
|
21
|
+
channel_points_won: number
|
|
22
|
+
/** Integer. The number of Channel Points used to participate in the Prediction. */
|
|
23
|
+
channel_points_used: number
|
|
24
|
+
}>
|
|
25
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPredictionBeginType = "channel.prediction.begin"
|
|
6
|
+
type ChannelPredictionBeginVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A Prediction startn. */
|
|
9
|
+
export interface ChannelPredictionBeginCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A Prediction startn. */
|
|
15
|
+
export interface ChannelPredictionBeginEvent {
|
|
16
|
+
/** Channel Points Prediction ID. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Title for the Channel Points Prediction. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of outcomes for the Channel Points Prediction. */
|
|
27
|
+
outcomes: ChannelPredictionOutcome[]
|
|
28
|
+
/** The time the Channel Points Prediction started. */
|
|
29
|
+
started_at: Date
|
|
30
|
+
/** The time the Channel Points Prediction will automatically lock. */
|
|
31
|
+
locks_at: Date
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The event notification received when A Prediction startn. */
|
|
35
|
+
export type ChannelPredictionBeginSubscription = BaseSubscription<
|
|
36
|
+
ChannelPredictionBeginType,
|
|
37
|
+
ChannelPredictionBeginVersion,
|
|
38
|
+
ChannelPredictionBeginCondition
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
export function makeChannelPredictionBeginSubscription(
|
|
42
|
+
userId: string,
|
|
43
|
+
): ChannelPredictionBeginSubscription {
|
|
44
|
+
return {
|
|
45
|
+
type: "channel.prediction.begin",
|
|
46
|
+
version: "1",
|
|
47
|
+
condition: {
|
|
48
|
+
broadcaster_user_id: userId,
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPredictionEndType = "channel.prediction.end"
|
|
6
|
+
type ChannelPredictionEndVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A Prediction ends. */
|
|
9
|
+
export interface ChannelPredictionEndCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A Prediction ends. */
|
|
15
|
+
export interface ChannelPredictionEndEvent {
|
|
16
|
+
/** Channel Points Prediction ID. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Title for the Channel Points Prediction. */
|
|
25
|
+
title: string
|
|
26
|
+
/** ID of the winning outcome. */
|
|
27
|
+
winning_outcome_id: string
|
|
28
|
+
/** An array of outcomes for the Channel Points Prediction. Includes top_predictors. */
|
|
29
|
+
outcomes: ChannelPredictionOutcome[]
|
|
30
|
+
/** The status of the Channel Points Prediction. Valid values are resolved and canceled. */
|
|
31
|
+
status: string
|
|
32
|
+
/** The time the Channel Points Prediction started. */
|
|
33
|
+
started_at: Date
|
|
34
|
+
/** The time the Channel Points Prediction ended. */
|
|
35
|
+
ended_at: Date
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The event notification received when A Prediction ends. */
|
|
39
|
+
export type ChannelPredictionEndSubscription = BaseSubscription<
|
|
40
|
+
ChannelPredictionEndType,
|
|
41
|
+
ChannelPredictionEndVersion,
|
|
42
|
+
ChannelPredictionEndCondition
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
export function makeChannelPredictionEndSubscription(
|
|
46
|
+
userId: string,
|
|
47
|
+
): ChannelPredictionEndSubscription {
|
|
48
|
+
return {
|
|
49
|
+
type: "channel.prediction.end",
|
|
50
|
+
version: "1",
|
|
51
|
+
condition: {
|
|
52
|
+
broadcaster_user_id: userId,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPredictionLockType = "channel.prediction.lock"
|
|
6
|
+
type ChannelPredictionLockVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A Prediction lockeds. */
|
|
9
|
+
export interface ChannelPredictionLockCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A Prediction lockeds. */
|
|
15
|
+
export interface ChannelPredictionLockEvent {
|
|
16
|
+
/** Channel Points Prediction ID. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Title for the Channel Points Prediction. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of outcomes for the Channel Points Prediction. Includes top_predictors. */
|
|
27
|
+
outcomes: ChannelPredictionOutcome[]
|
|
28
|
+
/** The time the Channel Points Prediction started. */
|
|
29
|
+
started_at: Date
|
|
30
|
+
/** The time the Channel Points Prediction was locked. */
|
|
31
|
+
locked_at: Date
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The event notification received when A Prediction lockeds. */
|
|
35
|
+
export type ChannelPredictionLockSubscription = BaseSubscription<
|
|
36
|
+
ChannelPredictionLockType,
|
|
37
|
+
ChannelPredictionLockVersion,
|
|
38
|
+
ChannelPredictionLockCondition
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
export function makeChannelPredictionLockSubscription(
|
|
42
|
+
userId: string,
|
|
43
|
+
): ChannelPredictionLockSubscription {
|
|
44
|
+
return {
|
|
45
|
+
type: "channel.prediction.lock",
|
|
46
|
+
version: "1",
|
|
47
|
+
condition: {
|
|
48
|
+
broadcaster_user_id: userId,
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
|
+
|
|
5
|
+
type ChannelPredictionProgressType = "channel.prediction.progress"
|
|
6
|
+
type ChannelPredictionProgressVersion = "1"
|
|
7
|
+
|
|
8
|
+
/** The parameters under which an event fires when A user participates in a Prediction. */
|
|
9
|
+
export interface ChannelPredictionProgressCondition {
|
|
10
|
+
/** The user ID of the broadcaster. */
|
|
11
|
+
broadcaster_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when A user participates in a Prediction. */
|
|
15
|
+
export interface ChannelPredictionProgressEvent {
|
|
16
|
+
/** Channel Points Prediction ID. */
|
|
17
|
+
id: string
|
|
18
|
+
/** The user ID of the broadcaster. */
|
|
19
|
+
broadcaster_user_id: string
|
|
20
|
+
/** The user login of the broadcaster. */
|
|
21
|
+
broadcaster_user_login: string
|
|
22
|
+
/** The user name of the broadcaster. */
|
|
23
|
+
broadcaster_user_name: string
|
|
24
|
+
/** Title for the Channel Points Prediction. */
|
|
25
|
+
title: string
|
|
26
|
+
/** An array of outcomes for the Channel Points Prediction. Includes top_predictors. */
|
|
27
|
+
outcomes: ChannelPredictionOutcome[]
|
|
28
|
+
/** The time the Channel Points Prediction started. */
|
|
29
|
+
started_at: Date
|
|
30
|
+
/** The time the Channel Points Prediction will automatically lock. */
|
|
31
|
+
locks_at: Date
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The event notification received when A user participates in a Prediction. */
|
|
35
|
+
export type ChannelPredictionProgressSubscription = BaseSubscription<
|
|
36
|
+
ChannelPredictionProgressType,
|
|
37
|
+
ChannelPredictionProgressVersion,
|
|
38
|
+
ChannelPredictionProgressCondition
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
export function makeChannelPredictionProgressSubscription(
|
|
42
|
+
userId: string,
|
|
43
|
+
): ChannelPredictionProgressSubscription {
|
|
44
|
+
return {
|
|
45
|
+
type: "channel.prediction.progress",
|
|
46
|
+
version: "1",
|
|
47
|
+
condition: {
|
|
48
|
+
broadcaster_user_id: userId,
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
type ChannelRaidType = "channel.raid"
|
|
4
|
+
type ChannelRaidVersion = "1"
|
|
5
|
+
|
|
6
|
+
/** The parameters under which an event fires when The broadcaster raids another broadcaster's channel. */
|
|
7
|
+
export interface ChannelRaidCondition {
|
|
8
|
+
/** The user ID of the broadcaster that created the channel raid. */
|
|
9
|
+
from_broadcaster_user_id?: string
|
|
10
|
+
/** The user ID of the broadcaster that received the channel raid. */
|
|
11
|
+
to_broadcaster_user_id?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when The broadcaster raids another broadcaster's channel. */
|
|
15
|
+
export interface ChannelRaidEvent {
|
|
16
|
+
/** The user ID of the broadcaster that created the raid. */
|
|
17
|
+
from_broadcaster_user_id: string
|
|
18
|
+
/** The user login of the broadcaster that created the raid. */
|
|
19
|
+
from_broadcaster_user_login: string
|
|
20
|
+
/** The user name of the broadcaster that created the raid. */
|
|
21
|
+
from_broadcaster_user_name: string
|
|
22
|
+
/** The user ID of the broadcaster that received the raid. */
|
|
23
|
+
to_broadcaster_user_id: string
|
|
24
|
+
/** The user login of the broadcaster that received the raid. */
|
|
25
|
+
to_broadcaster_user_login: string
|
|
26
|
+
/** The user name of the broadcaster that received the raid. */
|
|
27
|
+
to_broadcaster_user_name: string
|
|
28
|
+
/** Integer. The number of viewers in the raid. */
|
|
29
|
+
viewers: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The event notification received when The broadcaster raids another broadcaster's channel. */
|
|
33
|
+
export type ChannelRaidSubscription = BaseSubscription<
|
|
34
|
+
ChannelRaidType,
|
|
35
|
+
ChannelRaidVersion,
|
|
36
|
+
ChannelRaidCondition
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export function makeChannelRaidSubscription(
|
|
40
|
+
userId: string,
|
|
41
|
+
): ChannelRaidSubscription {
|
|
42
|
+
return {
|
|
43
|
+
type: "channel.raid",
|
|
44
|
+
version: "1",
|
|
45
|
+
condition: {
|
|
46
|
+
to_broadcaster_user_id: userId,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
type ShieldModeBeginType = "channel.shield_mode.begin"
|
|
4
|
+
type ShieldModeBeginVersion = "1"
|
|
5
|
+
|
|
6
|
+
/** The parameters under which an event fires when The broadcaster activates Shield Mode. */
|
|
7
|
+
export interface ShieldModeBeginCondition {
|
|
8
|
+
/** The user ID of the broadcaster. */
|
|
9
|
+
broadcaster_user_id: string
|
|
10
|
+
/** The user ID of the moderator or broadcaster. */
|
|
11
|
+
moderator_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when The broadcaster activates Shield Mode. */
|
|
15
|
+
export interface ShieldModeBeginEvent {
|
|
16
|
+
/** The user ID of the broadcaster. */
|
|
17
|
+
broadcaster_user_id: string
|
|
18
|
+
/** The user login of the broadcaster. */
|
|
19
|
+
broadcaster_user_login: string
|
|
20
|
+
/** The user name of the broadcaster. */
|
|
21
|
+
broadcaster_user_name: string
|
|
22
|
+
/** The user ID of the moderator that updated the shield mode's status. If the broadcaster updated the status, this ID will be the same as broadcaster_user_id. */
|
|
23
|
+
moderator_user_id: string
|
|
24
|
+
/** The user login of the moderator. */
|
|
25
|
+
moderator_user_login: string
|
|
26
|
+
/** The user name of the moderator. */
|
|
27
|
+
moderator_user_name: string
|
|
28
|
+
/** The time the moderator activated shield mode. */
|
|
29
|
+
started_at: Date
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The event notification received when The broadcaster activates Shield Mode. */
|
|
33
|
+
export type ShieldModeBeginSubscription = BaseSubscription<
|
|
34
|
+
ShieldModeBeginType,
|
|
35
|
+
ShieldModeBeginVersion,
|
|
36
|
+
ShieldModeBeginCondition
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export function makeShieldModeBeginSubscription(
|
|
40
|
+
userId: string,
|
|
41
|
+
): ShieldModeBeginSubscription {
|
|
42
|
+
return {
|
|
43
|
+
type: "channel.shield_mode.begin",
|
|
44
|
+
version: "1",
|
|
45
|
+
condition: {
|
|
46
|
+
broadcaster_user_id: userId,
|
|
47
|
+
moderator_user_id: userId,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseSubscription } from "../events-helpers.js"
|
|
2
|
+
|
|
3
|
+
type ShieldModeEndType = "channel.shield_mode.end"
|
|
4
|
+
type ShieldModeEndVersion = "1"
|
|
5
|
+
|
|
6
|
+
/** The parameters under which an event fires when The broadcaster deactivates Shield Mode. */
|
|
7
|
+
export interface ShieldModeEndCondition {
|
|
8
|
+
/** The user ID of the broadcaster. */
|
|
9
|
+
broadcaster_user_id: string
|
|
10
|
+
/** The user ID of the moderator or broadcaster. */
|
|
11
|
+
moderator_user_id: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The event information when The broadcaster deactivates Shield Mode. */
|
|
15
|
+
export interface ShieldModeEndEvent {
|
|
16
|
+
/** The user ID of the broadcaster. */
|
|
17
|
+
broadcaster_user_id: string
|
|
18
|
+
/** The user login of the broadcaster. */
|
|
19
|
+
broadcaster_user_login: string
|
|
20
|
+
/** The user name of the broadcaster. */
|
|
21
|
+
broadcaster_user_name: string
|
|
22
|
+
/** The user ID of the moderator that updated the shield mode's status. If the broadcaster updated the status, this ID will be the same as broadcaster_user_id. */
|
|
23
|
+
moderator_user_id: string
|
|
24
|
+
/** The user login of the moderator. */
|
|
25
|
+
moderator_user_login: string
|
|
26
|
+
/** The user name of the moderator. */
|
|
27
|
+
moderator_user_name: string
|
|
28
|
+
/** The time the moderator deactivated shield mode. */
|
|
29
|
+
ended_at: Date
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The event notification received when The broadcaster deactivates Shield Mode. */
|
|
33
|
+
export type ShieldModeEndSubscription = BaseSubscription<
|
|
34
|
+
ShieldModeEndType,
|
|
35
|
+
ShieldModeEndVersion,
|
|
36
|
+
ShieldModeEndCondition
|
|
37
|
+
>
|
|
38
|
+
|
|
39
|
+
export function makeShieldModeEndSubscription(
|
|
40
|
+
userId: string,
|
|
41
|
+
): ShieldModeEndSubscription {
|
|
42
|
+
return {
|
|
43
|
+
type: "channel.shield_mode.end",
|
|
44
|
+
version: "1",
|
|
45
|
+
condition: {
|
|
46
|
+
broadcaster_user_id: userId,
|
|
47
|
+
moderator_user_id: userId,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|