@overlaysymphony/twitch 0.1.0 → 0.2.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 +1 -1
- package/package.json +21 -22
- package/src/authentication/authentication.ts +85 -55
- package/src/chat/chat.ts +9 -8
- package/src/chat/interfaces/events.ts +29 -29
- package/src/chat/interfaces/index.ts +1 -1
- package/src/chat/parser.ts +9 -20
- package/src/eventsub/events/channel.ad_break.begin.ts +1 -1
- package/src/eventsub/events/channel.ban.ts +1 -1
- package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +2 -2
- package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +2 -2
- package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +2 -2
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +2 -2
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +2 -2
- package/src/eventsub/events/channel.charity_campaign.donate.ts +1 -1
- package/src/eventsub/events/channel.charity_campaign.progress.ts +1 -1
- package/src/eventsub/events/channel.charity_campaign.start.ts +1 -1
- package/src/eventsub/events/channel.charity_campaign.stop.ts +1 -1
- package/src/eventsub/events/channel.chat.clear.ts +1 -1
- package/src/eventsub/events/channel.chat.clear_user_messages.ts +1 -1
- package/src/eventsub/events/channel.chat.message_delete.ts +1 -1
- package/src/eventsub/events/channel.chat.notification.ts +1 -1
- package/src/eventsub/events/channel.cheer.ts +1 -1
- package/src/eventsub/events/channel.follow.ts +1 -1
- package/src/eventsub/events/channel.goal.begin.ts +1 -1
- package/src/eventsub/events/channel.goal.end.ts +1 -1
- package/src/eventsub/events/channel.goal.progress.ts +1 -1
- package/src/eventsub/events/channel.guest_star_guest.update.ts +1 -1
- package/src/eventsub/events/channel.guest_star_session.begin.ts +1 -1
- package/src/eventsub/events/channel.guest_star_session.end.ts +1 -1
- package/src/eventsub/events/channel.guest_star_settings.update.ts +1 -1
- package/src/eventsub/events/channel.hype_train.begin.ts +2 -2
- package/src/eventsub/events/channel.hype_train.end.ts +2 -2
- package/src/eventsub/events/channel.hype_train.progress.ts +2 -2
- package/src/eventsub/events/channel.moderator.add.ts +1 -1
- package/src/eventsub/events/channel.moderator.remove.ts +1 -1
- package/src/eventsub/events/channel.poll.begin.ts +2 -2
- package/src/eventsub/events/channel.poll.end.ts +2 -2
- package/src/eventsub/events/channel.poll.progress.ts +2 -2
- package/src/eventsub/events/channel.prediction.begin.ts +2 -2
- package/src/eventsub/events/channel.prediction.end.ts +2 -2
- package/src/eventsub/events/channel.prediction.lock.ts +2 -2
- package/src/eventsub/events/channel.prediction.progress.ts +2 -2
- package/src/eventsub/events/channel.raid.ts +1 -1
- package/src/eventsub/events/channel.shield_mode.begin.ts +1 -1
- package/src/eventsub/events/channel.shield_mode.end.ts +1 -1
- package/src/eventsub/events/channel.shoutout.create.ts +1 -1
- package/src/eventsub/events/channel.shoutout.receive.ts +1 -1
- package/src/eventsub/events/channel.subscribe.ts +1 -1
- package/src/eventsub/events/channel.subscription.end.ts +1 -1
- package/src/eventsub/events/channel.subscription.gift.ts +1 -1
- package/src/eventsub/events/channel.subscription.message.ts +1 -1
- package/src/eventsub/events/channel.unban.ts +1 -1
- package/src/eventsub/events/channel.update.ts +1 -1
- package/src/eventsub/events/index.ts +52 -51
- package/src/eventsub/events/stream.offline.ts +1 -1
- package/src/eventsub/events/stream.online.ts +1 -1
- package/src/eventsub/events/user.update.ts +1 -1
- package/src/eventsub/events-helpers.ts +2 -2
- package/src/eventsub/eventsub.ts +9 -9
- package/src/eventsub/messages.ts +1 -1
- package/src/helix/channel-points/custom-rewards.ts +2 -3
- package/src/helix/helix.ts +1 -1
- package/src/helix/subscriptions/subscriptions.ts +9 -19
- package/src/helix/users/users.ts +1 -1
- package/src/helpers/alerts/alerts.ts +3 -3
- package/src/helpers/charity/charity.ts +1 -1
- package/src/helpers/goal/goal.ts +1 -1
- package/src/helpers/hype-train/hype-train.ts +1 -1
- package/src/helpers/poll/poll.ts +1 -1
- package/src/helpers/prediction/prediction.ts +1 -1
- package/src/helpers/redemption/redemption.ts +1 -1
- package/src/helpers/status/status.ts +1 -1
- package/src/ui/authentication.ts +29 -85
- package/src/ui/popup.ts +45 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
3
|
+
import { type ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPointsCustomRewardRedemptionAddType = "channel.channel_points_custom_reward_redemption.add"
|
|
6
6
|
type ChannelPointsCustomRewardRedemptionAddVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
3
|
+
import { type ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPointsCustomRewardRedemptionUpdateType = "channel.channel_points_custom_reward_redemption.update"
|
|
6
6
|
type ChannelPointsCustomRewardRedemptionUpdateVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
3
|
+
import { type HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
4
4
|
|
|
5
5
|
type HypeTrainBeginType = "channel.hype_train.begin"
|
|
6
6
|
type HypeTrainBeginVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
3
|
+
import { type HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
4
4
|
|
|
5
5
|
type HypeTrainEndType = "channel.hype_train.end"
|
|
6
6
|
type HypeTrainEndVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
3
|
+
import { type HypeTrainTopContribution } from "./channel.hype_train._.js"
|
|
4
4
|
|
|
5
5
|
type HypeTrainProgressType = "channel.hype_train.progress"
|
|
6
6
|
type HypeTrainProgressVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
3
|
+
import { type ChannelPollBitsVoting, type ChannelPollChoice, type ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPollBeginType = "channel.poll.begin"
|
|
6
6
|
type ChannelPollBeginVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
3
|
+
import { type ChannelPollBitsVoting, type ChannelPollChoice, type ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPollEndType = "channel.poll.end"
|
|
6
6
|
type ChannelPollEndVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPollBitsVoting, ChannelPollChoice, ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
3
|
+
import { type ChannelPollBitsVoting, type ChannelPollChoice, type ChannelPollPointsVoting } from "./channel.poll._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPollProgressType = "channel.poll.progress"
|
|
6
6
|
type ChannelPollProgressVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
3
|
+
import { type ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPredictionBeginType = "channel.prediction.begin"
|
|
6
6
|
type ChannelPredictionBeginVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
3
|
+
import { type ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPredictionEndType = "channel.prediction.end"
|
|
6
6
|
type ChannelPredictionEndVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
3
|
+
import { type ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPredictionLockType = "channel.prediction.lock"
|
|
6
6
|
type ChannelPredictionLockVersion = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSubscription } from "../events-helpers.js"
|
|
1
|
+
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
3
|
+
import { type ChannelPredictionOutcome } from "./channel.prediction._.js"
|
|
4
4
|
|
|
5
5
|
type ChannelPredictionProgressType = "channel.prediction.progress"
|
|
6
6
|
type ChannelPredictionProgressVersion = "1"
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { NotificationMessage } from "../events-helpers.js"
|
|
1
|
+
import { type NotificationMessage } from "../events-helpers.js"
|
|
2
2
|
|
|
3
|
-
import { ChannelAdBreakBeginEvent, ChannelAdBreakBeginSubscription, makeChannelAdBreakBeginSubscription } from "./channel.ad_break.begin.js"
|
|
4
|
-
import { ChannelBanEvent, ChannelBanSubscription, makeChannelBanSubscription } from "./channel.ban.js"
|
|
5
|
-
import { ChannelPointsCustomRewardAddEvent, ChannelPointsCustomRewardAddSubscription, makeChannelPointsCustomRewardAddSubscription } from "./channel.channel_points_custom_reward.add.js"
|
|
6
|
-
import { ChannelPointsCustomRewardRemoveEvent, ChannelPointsCustomRewardRemoveSubscription, makeChannelPointsCustomRewardRemoveSubscription } from "./channel.channel_points_custom_reward.remove.js"
|
|
7
|
-
import { ChannelPointsCustomRewardUpdateEvent, ChannelPointsCustomRewardUpdateSubscription, makeChannelPointsCustomRewardUpdateSubscription } from "./channel.channel_points_custom_reward.update.js"
|
|
8
|
-
import { ChannelPointsCustomRewardRedemptionAddEvent, ChannelPointsCustomRewardRedemptionAddSubscription, makeChannelPointsCustomRewardRedemptionAddSubscription } from "./channel.channel_points_custom_reward_redemption.add.js"
|
|
9
|
-
import { ChannelPointsCustomRewardRedemptionUpdateEvent, ChannelPointsCustomRewardRedemptionUpdateSubscription, makeChannelPointsCustomRewardRedemptionUpdateSubscription } from "./channel.channel_points_custom_reward_redemption.update.js"
|
|
10
|
-
import { CharityDonationEvent, CharityDonationSubscription, makeCharityDonationSubscription } from "./channel.charity_campaign.donate.js"
|
|
11
|
-
import { CharityCampaignProgressEvent, CharityCampaignProgressSubscription, makeCharityCampaignProgressSubscription } from "./channel.charity_campaign.progress.js"
|
|
12
|
-
import { CharityCampaignStartEvent, CharityCampaignStartSubscription, makeCharityCampaignStartSubscription } from "./channel.charity_campaign.start.js"
|
|
13
|
-
import { CharityCampaignStopEvent, CharityCampaignStopSubscription, makeCharityCampaignStopSubscription } from "./channel.charity_campaign.stop.js"
|
|
14
|
-
import { ChannelChatClearEvent, ChannelChatClearSubscription, makeChannelChatClearSubscription } from "./channel.chat.clear.js"
|
|
15
|
-
import { ChannelChatClearUserMessagesEvent, ChannelChatClearUserMessagesSubscription, makeChannelChatClearUserMessagesSubscription } from "./channel.chat.clear_user_messages.js"
|
|
16
|
-
import { ChannelChatMessageDeleteEvent, ChannelChatMessageDeleteSubscription, makeChannelChatMessageDeleteSubscription } from "./channel.chat.message_delete.js"
|
|
17
|
-
import { ChannelChatNotificationEvent, ChannelChatNotificationSubscription, makeChannelChatNotificationSubscription } from "./channel.chat.notification.js"
|
|
18
|
-
import { ChannelCheerEvent, ChannelCheerSubscription, makeChannelCheerSubscription } from "./channel.cheer.js"
|
|
19
|
-
import { ChannelFollowEvent, ChannelFollowSubscription, makeChannelFollowSubscription } from "./channel.follow.js"
|
|
20
|
-
import { GoalBeginEvent, GoalBeginSubscription, makeGoalBeginSubscription } from "./channel.goal.begin.js"
|
|
21
|
-
import { GoalEndEvent, GoalEndSubscription, makeGoalEndSubscription } from "./channel.goal.end.js"
|
|
22
|
-
import { GoalProgressEvent, GoalProgressSubscription, makeGoalProgressSubscription } from "./channel.goal.progress.js"
|
|
23
|
-
import { ChannelGuestStarGuestUpdateEvent, ChannelGuestStarGuestUpdateSubscription, makeChannelGuestStarGuestUpdateSubscription } from "./channel.guest_star_guest.update.js"
|
|
24
|
-
import { ChannelGuestStarSessionBeginEvent, ChannelGuestStarSessionBeginSubscription, makeChannelGuestStarSessionBeginSubscription } from "./channel.guest_star_session.begin.js"
|
|
25
|
-
import { ChannelGuestStarSessionEndEvent, ChannelGuestStarSessionEndSubscription, makeChannelGuestStarSessionEndSubscription } from "./channel.guest_star_session.end.js"
|
|
26
|
-
import { ChannelGuestStarSettingsUpdateEvent, ChannelGuestStarSettingsUpdateSubscription, makeChannelGuestStarSettingsUpdateSubscription } from "./channel.guest_star_settings.update.js"
|
|
27
|
-
import { HypeTrainBeginEvent, HypeTrainBeginSubscription, makeHypeTrainBeginSubscription } from "./channel.hype_train.begin.js"
|
|
28
|
-
import { HypeTrainEndEvent, HypeTrainEndSubscription, makeHypeTrainEndSubscription } from "./channel.hype_train.end.js"
|
|
29
|
-
import { HypeTrainProgressEvent, HypeTrainProgressSubscription, makeHypeTrainProgressSubscription } from "./channel.hype_train.progress.js"
|
|
30
|
-
import { ChannelModeratorAddEvent, ChannelModeratorAddSubscription, makeChannelModeratorAddSubscription } from "./channel.moderator.add.js"
|
|
31
|
-
import { ChannelModeratorRemoveEvent, ChannelModeratorRemoveSubscription, makeChannelModeratorRemoveSubscription } from "./channel.moderator.remove.js"
|
|
32
|
-
import { ChannelPollBeginEvent, ChannelPollBeginSubscription, makeChannelPollBeginSubscription } from "./channel.poll.begin.js"
|
|
33
|
-
import { ChannelPollEndEvent, ChannelPollEndSubscription, makeChannelPollEndSubscription } from "./channel.poll.end.js"
|
|
34
|
-
import { ChannelPollProgressEvent, ChannelPollProgressSubscription, makeChannelPollProgressSubscription } from "./channel.poll.progress.js"
|
|
35
|
-
import { ChannelPredictionBeginEvent, ChannelPredictionBeginSubscription, makeChannelPredictionBeginSubscription } from "./channel.prediction.begin.js"
|
|
36
|
-
import { ChannelPredictionEndEvent, ChannelPredictionEndSubscription, makeChannelPredictionEndSubscription } from "./channel.prediction.end.js"
|
|
37
|
-
import { ChannelPredictionLockEvent, ChannelPredictionLockSubscription, makeChannelPredictionLockSubscription } from "./channel.prediction.lock.js"
|
|
38
|
-
import { ChannelPredictionProgressEvent, ChannelPredictionProgressSubscription, makeChannelPredictionProgressSubscription } from "./channel.prediction.progress.js"
|
|
39
|
-
import { ChannelRaidEvent, ChannelRaidSubscription, makeChannelRaidSubscription } from "./channel.raid.js"
|
|
40
|
-
import { ShieldModeBeginEvent, ShieldModeBeginSubscription, makeShieldModeBeginSubscription } from "./channel.shield_mode.begin.js"
|
|
41
|
-
import { ShieldModeEndEvent, ShieldModeEndSubscription, makeShieldModeEndSubscription } from "./channel.shield_mode.end.js"
|
|
42
|
-
import { ShoutoutCreateEvent, ShoutoutCreateSubscription, makeShoutoutCreateSubscription } from "./channel.shoutout.create.js"
|
|
43
|
-
import { ShoutoutReceiveEvent, ShoutoutReceiveSubscription, makeShoutoutReceiveSubscription } from "./channel.shoutout.receive.js"
|
|
44
|
-
import { ChannelSubscribeEvent, ChannelSubscribeSubscription, makeChannelSubscribeSubscription } from "./channel.subscribe.js"
|
|
45
|
-
import { ChannelSubscriptionEndEvent, ChannelSubscriptionEndSubscription, makeChannelSubscriptionEndSubscription } from "./channel.subscription.end.js"
|
|
46
|
-
import { ChannelSubscriptionGiftEvent, ChannelSubscriptionGiftSubscription, makeChannelSubscriptionGiftSubscription } from "./channel.subscription.gift.js"
|
|
47
|
-
import { ChannelSubscriptionMessageEvent, ChannelSubscriptionMessageSubscription, makeChannelSubscriptionMessageSubscription } from "./channel.subscription.message.js"
|
|
48
|
-
import { ChannelUnbanEvent, ChannelUnbanSubscription, makeChannelUnbanSubscription } from "./channel.unban.js"
|
|
49
|
-
import { ChannelUpdateEvent, ChannelUpdateSubscription, makeChannelUpdateSubscription } from "./channel.update.js"
|
|
50
|
-
import { StreamOfflineEvent, StreamOfflineSubscription, makeStreamOfflineSubscription } from "./stream.offline.js"
|
|
51
|
-
import { StreamOnlineEvent, StreamOnlineSubscription, makeStreamOnlineSubscription } from "./stream.online.js"
|
|
52
|
-
import { UserUpdateEvent, UserUpdateSubscription, makeUserUpdateSubscription } from "./user.update.js"
|
|
3
|
+
import { type ChannelAdBreakBeginEvent, type ChannelAdBreakBeginSubscription, makeChannelAdBreakBeginSubscription } from "./channel.ad_break.begin.js"
|
|
4
|
+
import { type ChannelBanEvent, type ChannelBanSubscription, makeChannelBanSubscription } from "./channel.ban.js"
|
|
5
|
+
import { type ChannelPointsCustomRewardAddEvent, type ChannelPointsCustomRewardAddSubscription, makeChannelPointsCustomRewardAddSubscription } from "./channel.channel_points_custom_reward.add.js"
|
|
6
|
+
import { type ChannelPointsCustomRewardRemoveEvent, type ChannelPointsCustomRewardRemoveSubscription, makeChannelPointsCustomRewardRemoveSubscription } from "./channel.channel_points_custom_reward.remove.js"
|
|
7
|
+
import { type ChannelPointsCustomRewardUpdateEvent, type ChannelPointsCustomRewardUpdateSubscription, makeChannelPointsCustomRewardUpdateSubscription } from "./channel.channel_points_custom_reward.update.js"
|
|
8
|
+
import { type ChannelPointsCustomRewardRedemptionAddEvent, type ChannelPointsCustomRewardRedemptionAddSubscription, makeChannelPointsCustomRewardRedemptionAddSubscription } from "./channel.channel_points_custom_reward_redemption.add.js"
|
|
9
|
+
import { type ChannelPointsCustomRewardRedemptionUpdateEvent, type ChannelPointsCustomRewardRedemptionUpdateSubscription, makeChannelPointsCustomRewardRedemptionUpdateSubscription } from "./channel.channel_points_custom_reward_redemption.update.js"
|
|
10
|
+
import { type CharityDonationEvent, type CharityDonationSubscription, makeCharityDonationSubscription } from "./channel.charity_campaign.donate.js"
|
|
11
|
+
import { type CharityCampaignProgressEvent, type CharityCampaignProgressSubscription, makeCharityCampaignProgressSubscription } from "./channel.charity_campaign.progress.js"
|
|
12
|
+
import { type CharityCampaignStartEvent, type CharityCampaignStartSubscription, makeCharityCampaignStartSubscription } from "./channel.charity_campaign.start.js"
|
|
13
|
+
import { type CharityCampaignStopEvent, type CharityCampaignStopSubscription, makeCharityCampaignStopSubscription } from "./channel.charity_campaign.stop.js"
|
|
14
|
+
import { type ChannelChatClearEvent, type ChannelChatClearSubscription, makeChannelChatClearSubscription } from "./channel.chat.clear.js"
|
|
15
|
+
import { type ChannelChatClearUserMessagesEvent, type ChannelChatClearUserMessagesSubscription, makeChannelChatClearUserMessagesSubscription } from "./channel.chat.clear_user_messages.js"
|
|
16
|
+
import { type ChannelChatMessageDeleteEvent, type ChannelChatMessageDeleteSubscription, makeChannelChatMessageDeleteSubscription } from "./channel.chat.message_delete.js"
|
|
17
|
+
import { type ChannelChatNotificationEvent, type ChannelChatNotificationSubscription, makeChannelChatNotificationSubscription } from "./channel.chat.notification.js"
|
|
18
|
+
import { type ChannelCheerEvent, type ChannelCheerSubscription, makeChannelCheerSubscription } from "./channel.cheer.js"
|
|
19
|
+
import { type ChannelFollowEvent, type ChannelFollowSubscription, makeChannelFollowSubscription } from "./channel.follow.js"
|
|
20
|
+
import { type GoalBeginEvent, type GoalBeginSubscription, makeGoalBeginSubscription } from "./channel.goal.begin.js"
|
|
21
|
+
import { type GoalEndEvent, type GoalEndSubscription, makeGoalEndSubscription } from "./channel.goal.end.js"
|
|
22
|
+
import { type GoalProgressEvent, type GoalProgressSubscription, makeGoalProgressSubscription } from "./channel.goal.progress.js"
|
|
23
|
+
import { type ChannelGuestStarGuestUpdateEvent, type ChannelGuestStarGuestUpdateSubscription, makeChannelGuestStarGuestUpdateSubscription } from "./channel.guest_star_guest.update.js"
|
|
24
|
+
import { type ChannelGuestStarSessionBeginEvent, type ChannelGuestStarSessionBeginSubscription, makeChannelGuestStarSessionBeginSubscription } from "./channel.guest_star_session.begin.js"
|
|
25
|
+
import { type ChannelGuestStarSessionEndEvent, type ChannelGuestStarSessionEndSubscription, makeChannelGuestStarSessionEndSubscription } from "./channel.guest_star_session.end.js"
|
|
26
|
+
import { type ChannelGuestStarSettingsUpdateEvent, type ChannelGuestStarSettingsUpdateSubscription, makeChannelGuestStarSettingsUpdateSubscription } from "./channel.guest_star_settings.update.js"
|
|
27
|
+
import { type HypeTrainBeginEvent, type HypeTrainBeginSubscription, makeHypeTrainBeginSubscription } from "./channel.hype_train.begin.js"
|
|
28
|
+
import { type HypeTrainEndEvent, type HypeTrainEndSubscription, makeHypeTrainEndSubscription } from "./channel.hype_train.end.js"
|
|
29
|
+
import { type HypeTrainProgressEvent, type HypeTrainProgressSubscription, makeHypeTrainProgressSubscription } from "./channel.hype_train.progress.js"
|
|
30
|
+
import { type ChannelModeratorAddEvent, type ChannelModeratorAddSubscription, makeChannelModeratorAddSubscription } from "./channel.moderator.add.js"
|
|
31
|
+
import { type ChannelModeratorRemoveEvent, type ChannelModeratorRemoveSubscription, makeChannelModeratorRemoveSubscription } from "./channel.moderator.remove.js"
|
|
32
|
+
import { type ChannelPollBeginEvent, type ChannelPollBeginSubscription, makeChannelPollBeginSubscription } from "./channel.poll.begin.js"
|
|
33
|
+
import { type ChannelPollEndEvent, type ChannelPollEndSubscription, makeChannelPollEndSubscription } from "./channel.poll.end.js"
|
|
34
|
+
import { type ChannelPollProgressEvent, type ChannelPollProgressSubscription, makeChannelPollProgressSubscription } from "./channel.poll.progress.js"
|
|
35
|
+
import { type ChannelPredictionBeginEvent, type ChannelPredictionBeginSubscription, makeChannelPredictionBeginSubscription } from "./channel.prediction.begin.js"
|
|
36
|
+
import { type ChannelPredictionEndEvent, type ChannelPredictionEndSubscription, makeChannelPredictionEndSubscription } from "./channel.prediction.end.js"
|
|
37
|
+
import { type ChannelPredictionLockEvent, type ChannelPredictionLockSubscription, makeChannelPredictionLockSubscription } from "./channel.prediction.lock.js"
|
|
38
|
+
import { type ChannelPredictionProgressEvent, type ChannelPredictionProgressSubscription, makeChannelPredictionProgressSubscription } from "./channel.prediction.progress.js"
|
|
39
|
+
import { type ChannelRaidEvent, type ChannelRaidSubscription, makeChannelRaidSubscription } from "./channel.raid.js"
|
|
40
|
+
import { type ShieldModeBeginEvent, type ShieldModeBeginSubscription, makeShieldModeBeginSubscription } from "./channel.shield_mode.begin.js"
|
|
41
|
+
import { type ShieldModeEndEvent, type ShieldModeEndSubscription, makeShieldModeEndSubscription } from "./channel.shield_mode.end.js"
|
|
42
|
+
import { type ShoutoutCreateEvent, type ShoutoutCreateSubscription, makeShoutoutCreateSubscription } from "./channel.shoutout.create.js"
|
|
43
|
+
import { type ShoutoutReceiveEvent, type ShoutoutReceiveSubscription, makeShoutoutReceiveSubscription } from "./channel.shoutout.receive.js"
|
|
44
|
+
import { type ChannelSubscribeEvent, type ChannelSubscribeSubscription, makeChannelSubscribeSubscription } from "./channel.subscribe.js"
|
|
45
|
+
import { type ChannelSubscriptionEndEvent, type ChannelSubscriptionEndSubscription, makeChannelSubscriptionEndSubscription } from "./channel.subscription.end.js"
|
|
46
|
+
import { type ChannelSubscriptionGiftEvent, type ChannelSubscriptionGiftSubscription, makeChannelSubscriptionGiftSubscription } from "./channel.subscription.gift.js"
|
|
47
|
+
import { type ChannelSubscriptionMessageEvent, type ChannelSubscriptionMessageSubscription, makeChannelSubscriptionMessageSubscription } from "./channel.subscription.message.js"
|
|
48
|
+
import { type ChannelUnbanEvent, type ChannelUnbanSubscription, makeChannelUnbanSubscription } from "./channel.unban.js"
|
|
49
|
+
import { type ChannelUpdateEvent, type ChannelUpdateSubscription, makeChannelUpdateSubscription } from "./channel.update.js"
|
|
50
|
+
import { type StreamOfflineEvent, type StreamOfflineSubscription, makeStreamOfflineSubscription } from "./stream.offline.js"
|
|
51
|
+
import { type StreamOnlineEvent, type StreamOnlineSubscription, makeStreamOnlineSubscription } from "./stream.online.js"
|
|
52
|
+
import { type UserUpdateEvent, type UserUpdateSubscription, makeUserUpdateSubscription } from "./user.update.js"
|
|
53
53
|
|
|
54
54
|
export * from "./channel.ad_break.begin.js"
|
|
55
55
|
export * from "./channel.ban.js"
|
|
@@ -276,6 +276,7 @@ export function buildSubscription<
|
|
|
276
276
|
Subscription extends TwitchSubscription<Type>,
|
|
277
277
|
>(type: Type, userId: string): Subscription {
|
|
278
278
|
const creator = subscriptionBuilders[type]
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
279
280
|
if (!creator) {
|
|
280
281
|
throw new Error(`Unknown type ${type}`)
|
|
281
282
|
}
|
package/src/eventsub/eventsub.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import createDefer from "@overlaysymphony/core/libs/defer"
|
|
2
2
|
import createPubSub from "@overlaysymphony/core/libs/pubsub"
|
|
3
3
|
|
|
4
|
-
import { Authentication } from "../authentication/index.js"
|
|
4
|
+
import { type Authentication } from "../authentication/index.js"
|
|
5
5
|
import { createSubscription } from "../helix/subscriptions/index.js"
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
TwitchNotificationMessage,
|
|
9
|
-
TwitchSubscriptionType,
|
|
8
|
+
type TwitchNotificationMessage,
|
|
9
|
+
type TwitchSubscriptionType,
|
|
10
10
|
} from "./events/index.js"
|
|
11
|
-
import { TwitchMessage } from "./messages.js"
|
|
11
|
+
import { type TwitchMessage } from "./messages.js"
|
|
12
12
|
|
|
13
13
|
type EventSubListener = (
|
|
14
14
|
callback: (event: TwitchNotificationMessage["payload"]) => void,
|
|
@@ -35,8 +35,8 @@ export async function createEventSub(
|
|
|
35
35
|
const pubsub = createPubSub<TwitchNotificationMessage["payload"]>()
|
|
36
36
|
const socket = new WebSocket("wss://eventsub.wss.twitch.tv/ws")
|
|
37
37
|
|
|
38
|
-
socket.addEventListener("message",
|
|
39
|
-
const data = JSON.parse(rawData) as TwitchMessage
|
|
38
|
+
socket.addEventListener("message", ({ data: rawData }) => {
|
|
39
|
+
const data = JSON.parse(rawData as string) as TwitchMessage
|
|
40
40
|
data.type = data.metadata.message_type
|
|
41
41
|
|
|
42
42
|
if (data.type === "session_welcome") {
|
|
@@ -58,7 +58,6 @@ export async function createEventSub(
|
|
|
58
58
|
|
|
59
59
|
const listen: EventSubListener = (callback) => {
|
|
60
60
|
return pubsub.subscribe((event) => {
|
|
61
|
-
// @ts-ignore
|
|
62
61
|
callback(event)
|
|
63
62
|
})
|
|
64
63
|
}
|
|
@@ -67,14 +66,15 @@ export async function createEventSub(
|
|
|
67
66
|
for (const type of types) {
|
|
68
67
|
if (!subscriptions[type]) {
|
|
69
68
|
subscriptions[type] = true
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
70
70
|
createSubscription(sessionId, authentication, type)
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return pubsub.subscribe((event) => {
|
|
75
|
-
// @ts-
|
|
75
|
+
// @ts-expect-error: generic events are complicated
|
|
76
76
|
if (types.includes(event.type)) {
|
|
77
|
-
// @ts-
|
|
77
|
+
// @ts-expect-error: generic events are complicated
|
|
78
78
|
callback(event)
|
|
79
79
|
}
|
|
80
80
|
})
|
package/src/eventsub/messages.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Authentication } from "../../authentication/index.js"
|
|
1
|
+
import { type Authentication } from "../../authentication/index.js"
|
|
2
2
|
import { helix } from "../helix.js"
|
|
3
3
|
|
|
4
4
|
interface CustomReward {
|
|
@@ -49,8 +49,7 @@ export async function getCustomRewards(
|
|
|
49
49
|
never,
|
|
50
50
|
{
|
|
51
51
|
broadcaster_id: string
|
|
52
|
-
}
|
|
53
|
-
never
|
|
52
|
+
}
|
|
54
53
|
>(authentication, {
|
|
55
54
|
method: "get",
|
|
56
55
|
path: "/channel_points/custom_rewards",
|
package/src/helix/helix.ts
CHANGED