@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.
Files changed (75) hide show
  1. package/README.md +1 -1
  2. package/package.json +21 -22
  3. package/src/authentication/authentication.ts +85 -55
  4. package/src/chat/chat.ts +9 -8
  5. package/src/chat/interfaces/events.ts +29 -29
  6. package/src/chat/interfaces/index.ts +1 -1
  7. package/src/chat/parser.ts +9 -20
  8. package/src/eventsub/events/channel.ad_break.begin.ts +1 -1
  9. package/src/eventsub/events/channel.ban.ts +1 -1
  10. package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +2 -2
  11. package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +2 -2
  12. package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +2 -2
  13. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +2 -2
  14. package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +2 -2
  15. package/src/eventsub/events/channel.charity_campaign.donate.ts +1 -1
  16. package/src/eventsub/events/channel.charity_campaign.progress.ts +1 -1
  17. package/src/eventsub/events/channel.charity_campaign.start.ts +1 -1
  18. package/src/eventsub/events/channel.charity_campaign.stop.ts +1 -1
  19. package/src/eventsub/events/channel.chat.clear.ts +1 -1
  20. package/src/eventsub/events/channel.chat.clear_user_messages.ts +1 -1
  21. package/src/eventsub/events/channel.chat.message_delete.ts +1 -1
  22. package/src/eventsub/events/channel.chat.notification.ts +1 -1
  23. package/src/eventsub/events/channel.cheer.ts +1 -1
  24. package/src/eventsub/events/channel.follow.ts +1 -1
  25. package/src/eventsub/events/channel.goal.begin.ts +1 -1
  26. package/src/eventsub/events/channel.goal.end.ts +1 -1
  27. package/src/eventsub/events/channel.goal.progress.ts +1 -1
  28. package/src/eventsub/events/channel.guest_star_guest.update.ts +1 -1
  29. package/src/eventsub/events/channel.guest_star_session.begin.ts +1 -1
  30. package/src/eventsub/events/channel.guest_star_session.end.ts +1 -1
  31. package/src/eventsub/events/channel.guest_star_settings.update.ts +1 -1
  32. package/src/eventsub/events/channel.hype_train.begin.ts +2 -2
  33. package/src/eventsub/events/channel.hype_train.end.ts +2 -2
  34. package/src/eventsub/events/channel.hype_train.progress.ts +2 -2
  35. package/src/eventsub/events/channel.moderator.add.ts +1 -1
  36. package/src/eventsub/events/channel.moderator.remove.ts +1 -1
  37. package/src/eventsub/events/channel.poll.begin.ts +2 -2
  38. package/src/eventsub/events/channel.poll.end.ts +2 -2
  39. package/src/eventsub/events/channel.poll.progress.ts +2 -2
  40. package/src/eventsub/events/channel.prediction.begin.ts +2 -2
  41. package/src/eventsub/events/channel.prediction.end.ts +2 -2
  42. package/src/eventsub/events/channel.prediction.lock.ts +2 -2
  43. package/src/eventsub/events/channel.prediction.progress.ts +2 -2
  44. package/src/eventsub/events/channel.raid.ts +1 -1
  45. package/src/eventsub/events/channel.shield_mode.begin.ts +1 -1
  46. package/src/eventsub/events/channel.shield_mode.end.ts +1 -1
  47. package/src/eventsub/events/channel.shoutout.create.ts +1 -1
  48. package/src/eventsub/events/channel.shoutout.receive.ts +1 -1
  49. package/src/eventsub/events/channel.subscribe.ts +1 -1
  50. package/src/eventsub/events/channel.subscription.end.ts +1 -1
  51. package/src/eventsub/events/channel.subscription.gift.ts +1 -1
  52. package/src/eventsub/events/channel.subscription.message.ts +1 -1
  53. package/src/eventsub/events/channel.unban.ts +1 -1
  54. package/src/eventsub/events/channel.update.ts +1 -1
  55. package/src/eventsub/events/index.ts +52 -51
  56. package/src/eventsub/events/stream.offline.ts +1 -1
  57. package/src/eventsub/events/stream.online.ts +1 -1
  58. package/src/eventsub/events/user.update.ts +1 -1
  59. package/src/eventsub/events-helpers.ts +2 -2
  60. package/src/eventsub/eventsub.ts +9 -9
  61. package/src/eventsub/messages.ts +1 -1
  62. package/src/helix/channel-points/custom-rewards.ts +2 -3
  63. package/src/helix/helix.ts +1 -1
  64. package/src/helix/subscriptions/subscriptions.ts +9 -19
  65. package/src/helix/users/users.ts +1 -1
  66. package/src/helpers/alerts/alerts.ts +3 -3
  67. package/src/helpers/charity/charity.ts +1 -1
  68. package/src/helpers/goal/goal.ts +1 -1
  69. package/src/helpers/hype-train/hype-train.ts +1 -1
  70. package/src/helpers/poll/poll.ts +1 -1
  71. package/src/helpers/prediction/prediction.ts +1 -1
  72. package/src/helpers/redemption/redemption.ts +1 -1
  73. package/src/helpers/status/status.ts +1 -1
  74. package/src/ui/authentication.ts +29 -85
  75. 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,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type CharityDonationType = "channel.charity_campaign.donate"
4
4
  type CharityDonationVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type CharityCampaignProgressType = "channel.charity_campaign.progress"
4
4
  type CharityCampaignProgressVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type CharityCampaignStartType = "channel.charity_campaign.start"
4
4
  type CharityCampaignStartVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type CharityCampaignStopType = "channel.charity_campaign.stop"
4
4
  type CharityCampaignStopVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelChatClearType = "channel.chat.clear"
4
4
  type ChannelChatClearVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelChatClearUserMessagesType = "channel.chat.clear_user_messages"
4
4
  type ChannelChatClearUserMessagesVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelChatMessageDeleteType = "channel.chat.message_delete"
4
4
  type ChannelChatMessageDeleteVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelChatNotificationType = "channel.chat.notification"
4
4
  type ChannelChatNotificationVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelCheerType = "channel.cheer"
4
4
  type ChannelCheerVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelFollowType = "channel.follow"
4
4
  type ChannelFollowVersion = "2"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type GoalBeginType = "channel.goal.begin"
4
4
  type GoalBeginVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type GoalEndType = "channel.goal.end"
4
4
  type GoalEndVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type GoalProgressType = "channel.goal.progress"
4
4
  type GoalProgressVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelGuestStarGuestUpdateType = "channel.guest_star_guest.update"
4
4
  type ChannelGuestStarGuestUpdateVersion = "beta"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelGuestStarSessionBeginType = "channel.guest_star_session.begin"
4
4
  type ChannelGuestStarSessionBeginVersion = "beta"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelGuestStarSessionEndType = "channel.guest_star_session.end"
4
4
  type ChannelGuestStarSessionEndVersion = "beta"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelGuestStarSettingsUpdateType = "channel.guest_star_settings.update"
4
4
  type ChannelGuestStarSettingsUpdateVersion = "beta"
@@ -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,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelModeratorAddType = "channel.moderator.add"
4
4
  type ChannelModeratorAddVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelModeratorRemoveType = "channel.moderator.remove"
4
4
  type ChannelModeratorRemoveVersion = "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,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelRaidType = "channel.raid"
4
4
  type ChannelRaidVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ShieldModeBeginType = "channel.shield_mode.begin"
4
4
  type ShieldModeBeginVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ShieldModeEndType = "channel.shield_mode.end"
4
4
  type ShieldModeEndVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ShoutoutCreateType = "channel.shoutout.create"
4
4
  type ShoutoutCreateVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ShoutoutReceiveType = "channel.shoutout.receive"
4
4
  type ShoutoutReceiveVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelSubscribeType = "channel.subscribe"
4
4
  type ChannelSubscribeVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelSubscriptionEndType = "channel.subscription.end"
4
4
  type ChannelSubscriptionEndVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelSubscriptionGiftType = "channel.subscription.gift"
4
4
  type ChannelSubscriptionGiftVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelSubscriptionMessageType = "channel.subscription.message"
4
4
  type ChannelSubscriptionMessageVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelUnbanType = "channel.unban"
4
4
  type ChannelUnbanVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type ChannelUpdateType = "channel.update"
4
4
  type ChannelUpdateVersion = "2"
@@ -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
  }
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type StreamOfflineType = "stream.offline"
4
4
  type StreamOfflineVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type StreamOnlineType = "stream.online"
4
4
  type StreamOnlineVersion = "1"
@@ -1,4 +1,4 @@
1
- import { BaseSubscription } from "../events-helpers.js"
1
+ import { type BaseSubscription } from "../events-helpers.js"
2
2
 
3
3
  type UserUpdateType = "user.update"
4
4
  type UserUpdateVersion = "1"
@@ -1,8 +1,8 @@
1
- export type BaseSubscription<
1
+ export interface BaseSubscription<
2
2
  Type = unknown,
3
3
  Version = unknown,
4
4
  Condition = unknown,
5
- > = {
5
+ > {
6
6
  type: Type
7
7
  version: Version
8
8
  condition: Condition
@@ -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", async ({ data: rawData }) => {
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-ignore
75
+ // @ts-expect-error: generic events are complicated
76
76
  if (types.includes(event.type)) {
77
- // @ts-ignore
77
+ // @ts-expect-error: generic events are complicated
78
78
  callback(event)
79
79
  }
80
80
  })
@@ -1,4 +1,4 @@
1
- import { TwitchNotificationMessage } from "./events/index.js"
1
+ import { type TwitchNotificationMessage } from "./events/index.js"
2
2
 
3
3
  export interface SessionWelcomeMessage {
4
4
  type: "session_welcome"
@@ -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",
@@ -1,6 +1,6 @@
1
1
  import querystring from "@overlaysymphony/core/libs/querystring"
2
2
 
3
- import { Authentication } from "../authentication/index.js"
3
+ import { type Authentication } from "../authentication/index.js"
4
4
 
5
5
  export async function helix<
6
6
  Data = never,