@overlaysymphony/twitch 0.2.2 → 0.2.3
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/package.json +2 -2
- package/src/authentication/authentication.ts +1 -1
- package/src/authentication/index.ts +1 -1
- package/src/chat/chat.ts +4 -4
- package/src/chat/helpers.ts +1 -1
- package/src/chat/index.ts +4 -3
- package/src/chat/interfaces/index.ts +2 -2
- package/src/chat/parser.ts +1 -1
- package/src/eventsub/events/automod.message.hold-2.ts +81 -0
- package/src/eventsub/events/automod.message.update-2.ts +94 -0
- package/src/eventsub/events/automod.settings.update-1.ts +65 -0
- package/src/eventsub/events/automod.terms.update-1.ts +59 -0
- package/src/eventsub/events/channel.ad_break.begin-1.ts +50 -0
- package/src/eventsub/events/channel.ban-1.ts +58 -0
- package/src/eventsub/events/channel.bits.use-1.ts +112 -0
- package/src/eventsub/events/channel.channel_points_automatic_reward_redemption.add-2.ts +88 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.add-1.ts +101 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.remove-1.ts +103 -0
- package/src/eventsub/events/channel.channel_points_custom_reward.update-1.ts +103 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add-1.ts +65 -0
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update-1.ts +65 -0
- package/src/eventsub/events/channel.charity_campaign.donate-1.ts +69 -0
- package/src/eventsub/events/channel.charity_campaign.progress-1.ts +74 -0
- package/src/eventsub/events/channel.charity_campaign.start-1.ts +76 -0
- package/src/eventsub/events/channel.charity_campaign.stop-1.ts +76 -0
- package/src/eventsub/events/channel.chat.clear-1.ts +41 -0
- package/src/eventsub/events/channel.chat.clear_user_messages-1.ts +47 -0
- package/src/eventsub/events/channel.chat.message-1.ts +160 -0
- package/src/eventsub/events/channel.chat.message_delete-1.ts +49 -0
- package/src/eventsub/events/channel.chat.notification-1.ts +317 -0
- package/src/eventsub/events/channel.chat.user_message_hold-1.ts +75 -0
- package/src/eventsub/events/channel.chat.user_message_update-1.ts +82 -0
- package/src/eventsub/events/channel.chat_settings.update-1.ts +83 -0
- package/src/eventsub/events/channel.cheer-1.ts +50 -0
- package/src/eventsub/events/channel.follow-2.ts +49 -0
- package/src/eventsub/events/channel.goal.begin-1.ts +80 -0
- package/src/eventsub/events/channel.goal.end-1.ts +80 -0
- package/src/eventsub/events/channel.goal.progress-1.ts +80 -0
- package/src/eventsub/events/channel.guest_star_guest.update-beta.ts +85 -0
- package/src/eventsub/events/channel.guest_star_session.begin-beta.ts +50 -0
- package/src/eventsub/events/channel.guest_star_session.end-beta.ts +58 -0
- package/src/eventsub/events/channel.guest_star_settings.update-beta.ts +62 -0
- package/src/eventsub/events/channel.hype_train.begin-2.ts +90 -0
- package/src/eventsub/events/channel.hype_train.end-2.ts +70 -0
- package/src/eventsub/events/channel.hype_train.progress-2.ts +90 -0
- package/src/eventsub/events/channel.moderate-2.ts +258 -0
- package/src/eventsub/events/channel.moderator.add-1.ts +44 -0
- package/src/eventsub/events/channel.moderator.remove-1.ts +44 -0
- package/src/eventsub/events/channel.poll.begin-1.ts +73 -0
- package/src/eventsub/events/channel.poll.end-1.ts +75 -0
- package/src/eventsub/events/channel.poll.progress-1.ts +73 -0
- package/src/eventsub/events/channel.prediction.begin-1.ts +72 -0
- package/src/eventsub/events/channel.prediction.end-1.ts +76 -0
- package/src/eventsub/events/channel.prediction.lock-1.ts +72 -0
- package/src/eventsub/events/channel.prediction.progress-1.ts +72 -0
- package/src/eventsub/events/channel.raid-1.ts +48 -0
- package/src/eventsub/events/channel.shared_chat.begin-1.ts +55 -0
- package/src/eventsub/events/channel.shared_chat.end-1.ts +46 -0
- package/src/eventsub/events/channel.shared_chat.update-1.ts +55 -0
- package/src/eventsub/events/channel.shield_mode.begin-1.ts +51 -0
- package/src/eventsub/events/channel.shield_mode.end-1.ts +51 -0
- package/src/eventsub/events/channel.shoutout.create-1.ts +61 -0
- package/src/eventsub/events/channel.shoutout.receive-1.ts +51 -0
- package/src/eventsub/events/channel.subscribe-1.ts +48 -0
- package/src/eventsub/events/channel.subscription.end-1.ts +48 -0
- package/src/eventsub/events/channel.subscription.gift-1.ts +52 -0
- package/src/eventsub/events/channel.subscription.message-1.ts +66 -0
- package/src/eventsub/events/channel.suspicious_user.message-1.ts +85 -0
- package/src/eventsub/events/channel.suspicious_user.update-1.ts +55 -0
- package/src/eventsub/events/channel.unban-1.ts +50 -0
- package/src/eventsub/events/channel.unban_request.create-1.ts +53 -0
- package/src/eventsub/events/channel.unban_request.resolve-1.ts +64 -0
- package/src/eventsub/events/channel.update-2.ts +48 -0
- package/src/eventsub/events/channel.vip.add-1.ts +44 -0
- package/src/eventsub/events/channel.vip.remove-1.ts +44 -0
- package/src/eventsub/events/channel.warning.acknowledge-1.ts +47 -0
- package/src/eventsub/events/channel.warning.send-1.ts +57 -0
- package/src/eventsub/events/index.ts +73 -284
- package/src/eventsub/events/stream.offline-1.ts +38 -0
- package/src/eventsub/events/stream.online-1.ts +44 -0
- package/src/eventsub/events/user.update-1.ts +48 -0
- package/src/eventsub/events/user.whisper.message-1.ts +51 -0
- package/src/eventsub/events-helpers.ts +53 -25
- package/src/eventsub/eventsub.ts +37 -74
- package/src/eventsub/index.ts +8 -6
- package/src/eventsub/messages.ts +16 -4
- package/src/helix/channel-points/custom-rewards.ts +3 -3
- package/src/helix/channel-points/index.ts +1 -1
- package/src/helix/helix.ts +1 -1
- package/src/helix/subscriptions/index.ts +1 -1
- package/src/helix/subscriptions/subscriptions.ts +40 -47
- package/src/helix/users/index.ts +1 -1
- package/src/helix/users/users.ts +3 -3
- package/src/helpers/alerts/alerts.ts +5 -5
- package/src/helpers/alerts/index.ts +2 -2
- package/src/helpers/charity/charity.ts +2 -2
- package/src/helpers/charity/index.ts +1 -1
- package/src/helpers/goal/goal.ts +2 -2
- package/src/helpers/goal/index.ts +1 -1
- package/src/helpers/hype-train/hype-train.ts +2 -2
- package/src/helpers/hype-train/index.ts +1 -1
- package/src/helpers/poll/index.ts +1 -1
- package/src/helpers/poll/poll.ts +3 -3
- package/src/helpers/prediction/index.ts +1 -1
- package/src/helpers/prediction/prediction.ts +3 -3
- package/src/helpers/redemption/index.ts +1 -1
- package/src/helpers/redemption/redemption.ts +2 -2
- package/src/helpers/status/index.ts +1 -1
- package/src/helpers/status/status.ts +2 -2
- package/src/ui/authentication.ts +1 -1
- package/src/ui/popup.ts +26 -3
- package/src/eventsub/events/channel.ad_break.begin.ts +0 -51
- package/src/eventsub/events/channel.ban.ts +0 -59
- package/src/eventsub/events/channel.channel_points_custom_reward._.ts +0 -29
- package/src/eventsub/events/channel.channel_points_custom_reward.add.ts +0 -75
- package/src/eventsub/events/channel.channel_points_custom_reward.remove.ts +0 -77
- package/src/eventsub/events/channel.channel_points_custom_reward.update.ts +0 -77
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption._.ts +0 -10
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.add.ts +0 -59
- package/src/eventsub/events/channel.channel_points_custom_reward_redemption.update.ts +0 -59
- package/src/eventsub/events/channel.charity_campaign.donate.ts +0 -66
- package/src/eventsub/events/channel.charity_campaign.progress.ts +0 -67
- package/src/eventsub/events/channel.charity_campaign.start.ts +0 -69
- package/src/eventsub/events/channel.charity_campaign.stop.ts +0 -69
- package/src/eventsub/events/channel.chat.clear.ts +0 -42
- package/src/eventsub/events/channel.chat.clear_user_messages.ts +0 -48
- package/src/eventsub/events/channel.chat.message_delete.ts +0 -50
- package/src/eventsub/events/channel.chat.notification.ts +0 -50
- package/src/eventsub/events/channel.cheer.ts +0 -51
- package/src/eventsub/events/channel.follow.ts +0 -50
- package/src/eventsub/events/channel.goal.begin.ts +0 -51
- package/src/eventsub/events/channel.goal.end.ts +0 -55
- package/src/eventsub/events/channel.goal.progress.ts +0 -51
- package/src/eventsub/events/channel.guest_star_guest.update.ts +0 -66
- package/src/eventsub/events/channel.guest_star_session.begin.ts +0 -46
- package/src/eventsub/events/channel.guest_star_session.end.ts +0 -48
- package/src/eventsub/events/channel.guest_star_settings.update.ts +0 -50
- package/src/eventsub/events/channel.hype_train._.ts +0 -12
- package/src/eventsub/events/channel.hype_train.begin.ts +0 -57
- package/src/eventsub/events/channel.hype_train.end.ts +0 -55
- package/src/eventsub/events/channel.hype_train.progress.ts +0 -70
- package/src/eventsub/events/channel.moderator.add.ts +0 -45
- package/src/eventsub/events/channel.moderator.remove.ts +0 -45
- package/src/eventsub/events/channel.poll._.ts +0 -26
- package/src/eventsub/events/channel.poll.begin.ts +0 -55
- package/src/eventsub/events/channel.poll.end.ts +0 -57
- package/src/eventsub/events/channel.poll.progress.ts +0 -55
- package/src/eventsub/events/channel.prediction._.ts +0 -25
- package/src/eventsub/events/channel.prediction.begin.ts +0 -51
- package/src/eventsub/events/channel.prediction.end.ts +0 -55
- package/src/eventsub/events/channel.prediction.lock.ts +0 -51
- package/src/eventsub/events/channel.prediction.progress.ts +0 -51
- package/src/eventsub/events/channel.raid.ts +0 -49
- package/src/eventsub/events/channel.shield_mode.begin.ts +0 -50
- package/src/eventsub/events/channel.shield_mode.end.ts +0 -50
- package/src/eventsub/events/channel.shoutout.create.ts +0 -62
- package/src/eventsub/events/channel.shoutout.receive.ts +0 -52
- package/src/eventsub/events/channel.subscribe.ts +0 -49
- package/src/eventsub/events/channel.subscription.end.ts +0 -49
- package/src/eventsub/events/channel.subscription.gift.ts +0 -53
- package/src/eventsub/events/channel.subscription.message.ts +0 -67
- package/src/eventsub/events/channel.unban.ts +0 -51
- package/src/eventsub/events/channel.update.ts +0 -49
- package/src/eventsub/events/stream.offline.ts +0 -39
- package/src/eventsub/events/stream.online.ts +0 -45
- package/src/eventsub/events/user.update.ts +0 -45
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TwitchEventSub } from "../../eventsub/index.
|
|
1
|
+
import { type TwitchEventSub } from "../../eventsub/index.ts"
|
|
2
2
|
|
|
3
3
|
export interface Redemption {
|
|
4
4
|
id: string
|
|
@@ -38,7 +38,7 @@ export function onRedemption(
|
|
|
38
38
|
? config[1]
|
|
39
39
|
: undefined
|
|
40
40
|
|
|
41
|
-
eventsub.
|
|
41
|
+
eventsub.on(
|
|
42
42
|
["channel.channel_points_custom_reward_redemption.add"],
|
|
43
43
|
(payload) => {
|
|
44
44
|
if (typeof id === "undefined" || payload.event.reward.id === id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./status.
|
|
1
|
+
export * from "./status.ts"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TwitchEventSub } from "../../eventsub/index.
|
|
1
|
+
import { type TwitchEventSub } from "../../eventsub/index.ts"
|
|
2
2
|
|
|
3
3
|
export interface Status {
|
|
4
4
|
online: boolean
|
|
@@ -22,7 +22,7 @@ export function onStatus(
|
|
|
22
22
|
labels: [],
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
eventsub.
|
|
25
|
+
eventsub.on(
|
|
26
26
|
[
|
|
27
27
|
"channel.update",
|
|
28
28
|
"stream.online",
|
package/src/ui/authentication.ts
CHANGED
package/src/ui/popup.ts
CHANGED
|
@@ -3,11 +3,27 @@ import querystring from "@overlaysymphony/core/libs/querystring"
|
|
|
3
3
|
import {
|
|
4
4
|
type BareAuthentication,
|
|
5
5
|
validateAuthentication,
|
|
6
|
-
} from "../authentication/index.
|
|
6
|
+
} from "../authentication/index.ts"
|
|
7
|
+
|
|
8
|
+
const status = document.getElementById("status")
|
|
9
|
+
const statuses = {
|
|
10
|
+
error: "Something went wrong.",
|
|
11
|
+
initializing: "Initializing Twitch authentication.",
|
|
12
|
+
validating: "Validating Twitch authenticate.",
|
|
13
|
+
ready: "Twitch authentication validated. You may close this window.",
|
|
14
|
+
}
|
|
15
|
+
function updateStatus(key: keyof typeof statuses, message?: string) {
|
|
16
|
+
if (!status) return
|
|
17
|
+
|
|
18
|
+
status.innerText = statuses[key] + (message ? ` ${message}` : "")
|
|
19
|
+
}
|
|
7
20
|
|
|
8
21
|
const state = getState()
|
|
9
22
|
|
|
10
23
|
if (state.step === "initial") {
|
|
24
|
+
updateStatus("initializing")
|
|
25
|
+
setTimeout(() => updateStatus("error"), 500)
|
|
26
|
+
|
|
11
27
|
initiateAuthentication(
|
|
12
28
|
state.clientId,
|
|
13
29
|
`${window.location.origin}${window.location.pathname}`,
|
|
@@ -16,14 +32,21 @@ if (state.step === "initial") {
|
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
if (state.step === "token") {
|
|
35
|
+
updateStatus("validating")
|
|
36
|
+
|
|
19
37
|
const authentication = await authenticateResult(state.clientId, state)
|
|
20
38
|
const opener = window.opener as Window | undefined
|
|
21
39
|
opener?.postMessage({ type: "authentication", authentication }, "*")
|
|
40
|
+
|
|
41
|
+
updateStatus("ready")
|
|
22
42
|
window.close()
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
if (state.step === "error") {
|
|
26
|
-
|
|
46
|
+
updateStatus(
|
|
47
|
+
"error",
|
|
48
|
+
`${state.error}${state.description ? `: ${state.description}` : "."}`,
|
|
49
|
+
)
|
|
27
50
|
}
|
|
28
51
|
|
|
29
52
|
function getState():
|
|
@@ -62,7 +85,7 @@ function getState():
|
|
|
62
85
|
!scope ? "Missing scope." : "",
|
|
63
86
|
!clientId ? "Missing state." : "",
|
|
64
87
|
]
|
|
65
|
-
.filter(
|
|
88
|
+
.filter((value) => !!value)
|
|
66
89
|
.join(" "),
|
|
67
90
|
}
|
|
68
91
|
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
type ChannelAdBreakBeginType = "channel.ad_break.begin"
|
|
4
|
-
type ChannelAdBreakBeginVersion = "beta"
|
|
5
|
-
|
|
6
|
-
/** The parameters under which an event fires when A midroll commercial break starts running. */
|
|
7
|
-
export interface ChannelAdBreakBeginCondition {
|
|
8
|
-
/** The user ID of the broadcaster. */
|
|
9
|
-
broadcaster_id: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** The event information when A midroll commercial break starts running. */
|
|
13
|
-
export interface ChannelAdBreakBeginEvent {
|
|
14
|
-
/** Integer. Length in seconds of the mid-roll ad break requested. */
|
|
15
|
-
length_seconds: number
|
|
16
|
-
/** The time the ad break began. Note that there is potential delay between this event, when the streamer requested the ad break, and when the viewers will see ads. */
|
|
17
|
-
timestamp: Date
|
|
18
|
-
/** Indicates if the ad was automatically scheduled via Ads Manager. */
|
|
19
|
-
is_automatic: boolean
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** The user ID of the user who requested the ad. For automatic ads, this will be the ID of the broadcaster. */
|
|
27
|
-
requester_user_id: string
|
|
28
|
-
/** The user name of the user who requested the ad. */
|
|
29
|
-
requester_user_name: string
|
|
30
|
-
/** The user login of the user who requested the ad. */
|
|
31
|
-
requester_user_login: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** The event notification received when A midroll commercial break starts running. */
|
|
35
|
-
export type ChannelAdBreakBeginSubscription = BaseSubscription<
|
|
36
|
-
ChannelAdBreakBeginType,
|
|
37
|
-
ChannelAdBreakBeginVersion,
|
|
38
|
-
ChannelAdBreakBeginCondition
|
|
39
|
-
>
|
|
40
|
-
|
|
41
|
-
export function makeChannelAdBreakBeginSubscription(
|
|
42
|
-
userId: string,
|
|
43
|
-
): ChannelAdBreakBeginSubscription {
|
|
44
|
-
return {
|
|
45
|
-
type: "channel.ad_break.begin",
|
|
46
|
-
version: "beta",
|
|
47
|
-
condition: {
|
|
48
|
-
broadcaster_id: userId,
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
type ChannelBanType = "channel.ban"
|
|
4
|
-
type ChannelBanVersion = "1"
|
|
5
|
-
|
|
6
|
-
/** The parameters under which an event fires when A moderator bans a user. */
|
|
7
|
-
export interface ChannelBanCondition {
|
|
8
|
-
/** The user ID of the broadcaster. */
|
|
9
|
-
broadcaster_user_id: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** The event information when A moderator bans a user. */
|
|
13
|
-
export interface ChannelBanEvent {
|
|
14
|
-
/** The user ID of the user who was banned. */
|
|
15
|
-
user_id: string
|
|
16
|
-
/** The user login of the user who was banned. */
|
|
17
|
-
user_login: string
|
|
18
|
-
/** The user name of the user who was banned. */
|
|
19
|
-
user_name: string
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** The user ID of the issuer of the ban. */
|
|
27
|
-
moderator_user_id: string
|
|
28
|
-
/** The user login of the issuer of the ban. */
|
|
29
|
-
moderator_user_login: string
|
|
30
|
-
/** The user name of the issuer of the ban. */
|
|
31
|
-
moderator_user_name: string
|
|
32
|
-
/** The reason behind the ban. */
|
|
33
|
-
reason: string
|
|
34
|
-
/** The time the user was banned or put in a timeout. */
|
|
35
|
-
banned_at: Date
|
|
36
|
-
/** The time the timeout ends. Is null if the user was banned instead of put in a timeout. */
|
|
37
|
-
ends_at: Date
|
|
38
|
-
/** Indicates whether the ban is permanent (true) or a timeout (false). If true, ends_at will be null. */
|
|
39
|
-
is_permanent: boolean
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** The event notification received when A moderator bans a user. */
|
|
43
|
-
export type ChannelBanSubscription = BaseSubscription<
|
|
44
|
-
ChannelBanType,
|
|
45
|
-
ChannelBanVersion,
|
|
46
|
-
ChannelBanCondition
|
|
47
|
-
>
|
|
48
|
-
|
|
49
|
-
export function makeChannelBanSubscription(
|
|
50
|
-
userId: string,
|
|
51
|
-
): ChannelBanSubscription {
|
|
52
|
-
return {
|
|
53
|
-
type: "channel.ban",
|
|
54
|
-
version: "1",
|
|
55
|
-
condition: {
|
|
56
|
-
broadcaster_user_id: userId,
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface ChannelPointsCustomRewardGlobalCooldown {
|
|
2
|
-
/** Is the setting enabled. */
|
|
3
|
-
is_enabled: boolean
|
|
4
|
-
/** Integer. The cooldown in seconds. */
|
|
5
|
-
seconds: number
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ChannelPointsCustomRewardMaxPerStream {
|
|
9
|
-
/** Is the setting enabled. */
|
|
10
|
-
is_enabled: boolean
|
|
11
|
-
/** Integer. The max per stream limit. */
|
|
12
|
-
value: number
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ChannelPointsCustomRewardMaxPerUserPerStream {
|
|
16
|
-
/** Is the setting enabled. */
|
|
17
|
-
is_enabled: boolean
|
|
18
|
-
/** Integer. The max per user per stream limit. */
|
|
19
|
-
value: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ChannelPointsCustomRewardImage {
|
|
23
|
-
/** URL for the image at 1x size. */
|
|
24
|
-
url_1x: string
|
|
25
|
-
/** URL for the image at 2x size. */
|
|
26
|
-
url_2x: string
|
|
27
|
-
/** URL for the image at 3x size. */
|
|
28
|
-
url_4x: string
|
|
29
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
import { type ChannelPointsCustomRewardGlobalCooldown, type ChannelPointsCustomRewardImage, type ChannelPointsCustomRewardMaxPerStream, type ChannelPointsCustomRewardMaxPerUserPerStream } from "./channel.channel_points_custom_reward._.js"
|
|
4
|
-
|
|
5
|
-
type ChannelPointsCustomRewardAddType = "channel.channel_points_custom_reward.add"
|
|
6
|
-
type ChannelPointsCustomRewardAddVersion = "1"
|
|
7
|
-
|
|
8
|
-
/** The parameters under which an event fires when The broadcaster creates a custom channel points reward. */
|
|
9
|
-
export interface ChannelPointsCustomRewardAddCondition {
|
|
10
|
-
/** The user ID of the broadcaster. */
|
|
11
|
-
broadcaster_user_id: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** The event information when The broadcaster creates a custom channel points reward. */
|
|
15
|
-
export interface ChannelPointsCustomRewardAddEvent {
|
|
16
|
-
/** The reward identifier. */
|
|
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
|
-
/** Is the reward currently enabled. If false, the reward won't show up to viewers. */
|
|
25
|
-
is_enabled: boolean
|
|
26
|
-
/** Is the reward currently paused. If true, viewers can't redeem. */
|
|
27
|
-
is_paused: boolean
|
|
28
|
-
/** Is the reward currently in stock. If false, viewers can't redeem. */
|
|
29
|
-
is_in_stock: boolean
|
|
30
|
-
/** The reward title. */
|
|
31
|
-
title: string
|
|
32
|
-
/** Integer. The reward cost. */
|
|
33
|
-
cost: number
|
|
34
|
-
/** The reward description. */
|
|
35
|
-
prompt: string
|
|
36
|
-
/** Does the viewer need to enter information when redeeming the reward. */
|
|
37
|
-
is_user_input_required: boolean
|
|
38
|
-
/** Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status. */
|
|
39
|
-
should_redemptions_skip_request_queue: boolean
|
|
40
|
-
/** Whether a maximum per stream is enabled and what the maximum is. */
|
|
41
|
-
max_per_stream: ChannelPointsCustomRewardMaxPerStream
|
|
42
|
-
/** Whether a maximum per user per stream is enabled and what the maximum is. */
|
|
43
|
-
max_per_user_per_stream: ChannelPointsCustomRewardMaxPerUserPerStream
|
|
44
|
-
/** Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2. */
|
|
45
|
-
background_color: string
|
|
46
|
-
/** Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded. */
|
|
47
|
-
image: ChannelPointsCustomRewardImage
|
|
48
|
-
/** Set of default images of 1x, 2x and 4x sizes for the reward. */
|
|
49
|
-
default_image: ChannelPointsCustomRewardImage
|
|
50
|
-
/** Whether a cooldown is enabled and what the cooldown is in seconds. */
|
|
51
|
-
global_cooldown: ChannelPointsCustomRewardGlobalCooldown
|
|
52
|
-
/** The time the cooldown expires. null if the reward isn't on cooldown. */
|
|
53
|
-
cooldown_expires_at: Date
|
|
54
|
-
/** Integer. The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. null if the broadcasters stream isn't live or max_per_stream isn't enabled. */
|
|
55
|
-
redemptions_redeemed_current_stream: number
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** The event notification received when The broadcaster creates a custom channel points reward. */
|
|
59
|
-
export type ChannelPointsCustomRewardAddSubscription = BaseSubscription<
|
|
60
|
-
ChannelPointsCustomRewardAddType,
|
|
61
|
-
ChannelPointsCustomRewardAddVersion,
|
|
62
|
-
ChannelPointsCustomRewardAddCondition
|
|
63
|
-
>
|
|
64
|
-
|
|
65
|
-
export function makeChannelPointsCustomRewardAddSubscription(
|
|
66
|
-
userId: string,
|
|
67
|
-
): ChannelPointsCustomRewardAddSubscription {
|
|
68
|
-
return {
|
|
69
|
-
type: "channel.channel_points_custom_reward.add",
|
|
70
|
-
version: "1",
|
|
71
|
-
condition: {
|
|
72
|
-
broadcaster_user_id: userId,
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
import { type ChannelPointsCustomRewardGlobalCooldown, type ChannelPointsCustomRewardImage, type ChannelPointsCustomRewardMaxPerStream, type ChannelPointsCustomRewardMaxPerUserPerStream } from "./channel.channel_points_custom_reward._.js"
|
|
4
|
-
|
|
5
|
-
type ChannelPointsCustomRewardRemoveType = "channel.channel_points_custom_reward.remove"
|
|
6
|
-
type ChannelPointsCustomRewardRemoveVersion = "1"
|
|
7
|
-
|
|
8
|
-
/** The parameters under which an event fires when The broadcaster removes a custom channel points reward. */
|
|
9
|
-
export interface ChannelPointsCustomRewardRemoveCondition {
|
|
10
|
-
/** The user ID of the broadcaster. */
|
|
11
|
-
broadcaster_user_id: string
|
|
12
|
-
/** Optional. Specify a reward ID to only receive notifications for a specific reward. */
|
|
13
|
-
reward_id?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** The event information when The broadcaster removes a custom channel points reward. */
|
|
17
|
-
export interface ChannelPointsCustomRewardRemoveEvent {
|
|
18
|
-
/** The reward identifier. */
|
|
19
|
-
id: string
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** Is the reward currently enabled. If false, the reward won't show up to viewers. */
|
|
27
|
-
is_enabled: boolean
|
|
28
|
-
/** Is the reward currently paused. If true, viewers can't redeem. */
|
|
29
|
-
is_paused: boolean
|
|
30
|
-
/** Is the reward currently in stock. If false, viewers can't redeem. */
|
|
31
|
-
is_in_stock: boolean
|
|
32
|
-
/** The reward title. */
|
|
33
|
-
title: string
|
|
34
|
-
/** Integer. The reward cost. */
|
|
35
|
-
cost: number
|
|
36
|
-
/** The reward description. */
|
|
37
|
-
prompt: string
|
|
38
|
-
/** Does the viewer need to enter information when redeeming the reward. */
|
|
39
|
-
is_user_input_required: boolean
|
|
40
|
-
/** Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status. */
|
|
41
|
-
should_redemptions_skip_request_queue: boolean
|
|
42
|
-
/** Whether a maximum per stream is enabled and what the maximum is. */
|
|
43
|
-
max_per_stream: ChannelPointsCustomRewardMaxPerStream
|
|
44
|
-
/** Whether a maximum per user per stream is enabled and what the maximum is. */
|
|
45
|
-
max_per_user_per_stream: ChannelPointsCustomRewardMaxPerUserPerStream
|
|
46
|
-
/** Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2. */
|
|
47
|
-
background_color: string
|
|
48
|
-
/** Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded. */
|
|
49
|
-
image: ChannelPointsCustomRewardImage
|
|
50
|
-
/** Set of default images of 1x, 2x and 4x sizes for the reward. */
|
|
51
|
-
default_image: ChannelPointsCustomRewardImage
|
|
52
|
-
/** Whether a cooldown is enabled and what the cooldown is in seconds. */
|
|
53
|
-
global_cooldown: ChannelPointsCustomRewardGlobalCooldown
|
|
54
|
-
/** The time the cooldown expires. null if the reward isn't on cooldown. */
|
|
55
|
-
cooldown_expires_at: Date
|
|
56
|
-
/** Integer. The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. null if the broadcasters stream isn't live or max_per_stream isn't enabled. */
|
|
57
|
-
redemptions_redeemed_current_stream: number
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** The event notification received when The broadcaster removes a custom channel points reward. */
|
|
61
|
-
export type ChannelPointsCustomRewardRemoveSubscription = BaseSubscription<
|
|
62
|
-
ChannelPointsCustomRewardRemoveType,
|
|
63
|
-
ChannelPointsCustomRewardRemoveVersion,
|
|
64
|
-
ChannelPointsCustomRewardRemoveCondition
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
export function makeChannelPointsCustomRewardRemoveSubscription(
|
|
68
|
-
userId: string,
|
|
69
|
-
): ChannelPointsCustomRewardRemoveSubscription {
|
|
70
|
-
return {
|
|
71
|
-
type: "channel.channel_points_custom_reward.remove",
|
|
72
|
-
version: "1",
|
|
73
|
-
condition: {
|
|
74
|
-
broadcaster_user_id: userId,
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
import { type ChannelPointsCustomRewardGlobalCooldown, type ChannelPointsCustomRewardImage, type ChannelPointsCustomRewardMaxPerStream, type ChannelPointsCustomRewardMaxPerUserPerStream } from "./channel.channel_points_custom_reward._.js"
|
|
4
|
-
|
|
5
|
-
type ChannelPointsCustomRewardUpdateType = "channel.channel_points_custom_reward.update"
|
|
6
|
-
type ChannelPointsCustomRewardUpdateVersion = "1"
|
|
7
|
-
|
|
8
|
-
/** The parameters under which an event fires when The broadcaster updates a custom channel points reward. */
|
|
9
|
-
export interface ChannelPointsCustomRewardUpdateCondition {
|
|
10
|
-
/** The user ID of the broadcaster. */
|
|
11
|
-
broadcaster_user_id: string
|
|
12
|
-
/** Optional. Specify a reward ID to only receive notifications for a specific reward. */
|
|
13
|
-
reward_id?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** The event information when The broadcaster updates a custom channel points reward. */
|
|
17
|
-
export interface ChannelPointsCustomRewardUpdateEvent {
|
|
18
|
-
/** The reward identifier. */
|
|
19
|
-
id: string
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** Is the reward currently enabled. If false, the reward won't show up to viewers. */
|
|
27
|
-
is_enabled: boolean
|
|
28
|
-
/** Is the reward currently paused. If true, viewers can't redeem. */
|
|
29
|
-
is_paused: boolean
|
|
30
|
-
/** Is the reward currently in stock. If false, viewers can't redeem. */
|
|
31
|
-
is_in_stock: boolean
|
|
32
|
-
/** The reward title. */
|
|
33
|
-
title: string
|
|
34
|
-
/** Integer. The reward cost. */
|
|
35
|
-
cost: number
|
|
36
|
-
/** The reward description. */
|
|
37
|
-
prompt: string
|
|
38
|
-
/** Does the viewer need to enter information when redeeming the reward. */
|
|
39
|
-
is_user_input_required: boolean
|
|
40
|
-
/** Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status. */
|
|
41
|
-
should_redemptions_skip_request_queue: boolean
|
|
42
|
-
/** Whether a maximum per stream is enabled and what the maximum is. */
|
|
43
|
-
max_per_stream: ChannelPointsCustomRewardMaxPerStream
|
|
44
|
-
/** Whether a maximum per user per stream is enabled and what the maximum is. */
|
|
45
|
-
max_per_user_per_stream: ChannelPointsCustomRewardMaxPerUserPerStream
|
|
46
|
-
/** Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2. */
|
|
47
|
-
background_color: string
|
|
48
|
-
/** Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded. */
|
|
49
|
-
image: ChannelPointsCustomRewardImage
|
|
50
|
-
/** Set of default images of 1x, 2x and 4x sizes for the reward. */
|
|
51
|
-
default_image: ChannelPointsCustomRewardImage
|
|
52
|
-
/** Whether a cooldown is enabled and what the cooldown is in seconds. */
|
|
53
|
-
global_cooldown: ChannelPointsCustomRewardGlobalCooldown
|
|
54
|
-
/** The time the cooldown expires. null if the reward isn't on cooldown. */
|
|
55
|
-
cooldown_expires_at: Date
|
|
56
|
-
/** Integer. The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit. null if the broadcasters stream isn't live or max_per_stream isn't enabled. */
|
|
57
|
-
redemptions_redeemed_current_stream: number
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** The event notification received when The broadcaster updates a custom channel points reward. */
|
|
61
|
-
export type ChannelPointsCustomRewardUpdateSubscription = BaseSubscription<
|
|
62
|
-
ChannelPointsCustomRewardUpdateType,
|
|
63
|
-
ChannelPointsCustomRewardUpdateVersion,
|
|
64
|
-
ChannelPointsCustomRewardUpdateCondition
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
export function makeChannelPointsCustomRewardUpdateSubscription(
|
|
68
|
-
userId: string,
|
|
69
|
-
): ChannelPointsCustomRewardUpdateSubscription {
|
|
70
|
-
return {
|
|
71
|
-
type: "channel.channel_points_custom_reward.update",
|
|
72
|
-
version: "1",
|
|
73
|
-
condition: {
|
|
74
|
-
broadcaster_user_id: userId,
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
import { type ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
4
|
-
|
|
5
|
-
type ChannelPointsCustomRewardRedemptionAddType = "channel.channel_points_custom_reward_redemption.add"
|
|
6
|
-
type ChannelPointsCustomRewardRedemptionAddVersion = "1"
|
|
7
|
-
|
|
8
|
-
/** The parameters under which an event fires when A user redeems a custom channel points reward. */
|
|
9
|
-
export interface ChannelPointsCustomRewardRedemptionAddCondition {
|
|
10
|
-
/** The user ID of the broadcaster. */
|
|
11
|
-
broadcaster_user_id: string
|
|
12
|
-
/** Optional. Specify a reward ID to only receive notifications for a specific reward. */
|
|
13
|
-
reward_id?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** The event information when A user redeems a custom channel points reward. */
|
|
17
|
-
export interface ChannelPointsCustomRewardRedemptionAddEvent {
|
|
18
|
-
/** The redemption identifier. */
|
|
19
|
-
id: string
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** The user ID of the user who redeemed the reward. */
|
|
27
|
-
user_id: string
|
|
28
|
-
/** The user login of the user who redeemed the reward. */
|
|
29
|
-
user_login: string
|
|
30
|
-
/** The user name of the user who redeemed the reward. */
|
|
31
|
-
user_name: string
|
|
32
|
-
/** The user input provided. Empty string if not provided. */
|
|
33
|
-
user_input: string
|
|
34
|
-
/** Defaults to unfulfilled. Possible values are unknown, unfulfilled, fulfilled, and canceled. */
|
|
35
|
-
status: string
|
|
36
|
-
/** Basic information about the reward that was redeemed, at the time it was redeemed. */
|
|
37
|
-
reward: ChannelPointsCustomRewardRedemptionReward
|
|
38
|
-
/** The time the reward was redeemed. */
|
|
39
|
-
redeemed_at: Date
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** The event notification received when A user redeems a custom channel points reward. */
|
|
43
|
-
export type ChannelPointsCustomRewardRedemptionAddSubscription = BaseSubscription<
|
|
44
|
-
ChannelPointsCustomRewardRedemptionAddType,
|
|
45
|
-
ChannelPointsCustomRewardRedemptionAddVersion,
|
|
46
|
-
ChannelPointsCustomRewardRedemptionAddCondition
|
|
47
|
-
>
|
|
48
|
-
|
|
49
|
-
export function makeChannelPointsCustomRewardRedemptionAddSubscription(
|
|
50
|
-
userId: string,
|
|
51
|
-
): ChannelPointsCustomRewardRedemptionAddSubscription {
|
|
52
|
-
return {
|
|
53
|
-
type: "channel.channel_points_custom_reward_redemption.add",
|
|
54
|
-
version: "1",
|
|
55
|
-
condition: {
|
|
56
|
-
broadcaster_user_id: userId,
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type BaseSubscription } from "../events-helpers.js"
|
|
2
|
-
|
|
3
|
-
import { type ChannelPointsCustomRewardRedemptionReward } from "./channel.channel_points_custom_reward_redemption._.js"
|
|
4
|
-
|
|
5
|
-
type ChannelPointsCustomRewardRedemptionUpdateType = "channel.channel_points_custom_reward_redemption.update"
|
|
6
|
-
type ChannelPointsCustomRewardRedemptionUpdateVersion = "1"
|
|
7
|
-
|
|
8
|
-
/** The parameters under which an event fires when A moderator updates the redemption of a channel points custom reward. */
|
|
9
|
-
export interface ChannelPointsCustomRewardRedemptionUpdateCondition {
|
|
10
|
-
/** The user ID of the broadcaster. */
|
|
11
|
-
broadcaster_user_id: string
|
|
12
|
-
/** Optional. Specify a reward ID to only receive notifications for a specific reward. */
|
|
13
|
-
reward_id?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** The event information when A moderator updates the redemption of a channel points custom reward. */
|
|
17
|
-
export interface ChannelPointsCustomRewardRedemptionUpdateEvent {
|
|
18
|
-
/** The redemption identifier. */
|
|
19
|
-
id: string
|
|
20
|
-
/** The user ID of the broadcaster. */
|
|
21
|
-
broadcaster_user_id: string
|
|
22
|
-
/** The user login of the broadcaster. */
|
|
23
|
-
broadcaster_user_login: string
|
|
24
|
-
/** The user name of the broadcaster. */
|
|
25
|
-
broadcaster_user_name: string
|
|
26
|
-
/** The user ID of the user who redeemed the reward. */
|
|
27
|
-
user_id: string
|
|
28
|
-
/** The user login of the user who redeemed the reward. */
|
|
29
|
-
user_login: string
|
|
30
|
-
/** The user name of the user who redeemed the reward. */
|
|
31
|
-
user_name: string
|
|
32
|
-
/** The user input provided. Empty string if not provided. */
|
|
33
|
-
user_input: string
|
|
34
|
-
/** Will be fulfilled or canceled. Possible values are unknown, unfulfilled, fulfilled, and canceled. */
|
|
35
|
-
status: string
|
|
36
|
-
/** Basic information about the reward that was redeemed, at the time it was redeemed. */
|
|
37
|
-
reward: ChannelPointsCustomRewardRedemptionReward
|
|
38
|
-
/** The time the reward was redeemed. */
|
|
39
|
-
redeemed_at: Date
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** The event notification received when A moderator updates the redemption of a channel points custom reward. */
|
|
43
|
-
export type ChannelPointsCustomRewardRedemptionUpdateSubscription = BaseSubscription<
|
|
44
|
-
ChannelPointsCustomRewardRedemptionUpdateType,
|
|
45
|
-
ChannelPointsCustomRewardRedemptionUpdateVersion,
|
|
46
|
-
ChannelPointsCustomRewardRedemptionUpdateCondition
|
|
47
|
-
>
|
|
48
|
-
|
|
49
|
-
export function makeChannelPointsCustomRewardRedemptionUpdateSubscription(
|
|
50
|
-
userId: string,
|
|
51
|
-
): ChannelPointsCustomRewardRedemptionUpdateSubscription {
|
|
52
|
-
return {
|
|
53
|
-
type: "channel.channel_points_custom_reward_redemption.update",
|
|
54
|
-
version: "1",
|
|
55
|
-
condition: {
|
|
56
|
-
broadcaster_user_id: userId,
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
}
|