@lumiastream/lumia-types 3.3.6 → 3.3.7-alpha.2
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/dist/activity.types.d.ts +1 -0
- package/dist/activity.types.js +4 -0
- package/dist/custom-overlays/custom-overlays.d.ts +12 -0
- package/dist/custom-overlays.d.ts +12 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -1
- package/dist/songrequest.types.d.ts +157 -0
- package/dist/songrequest.types.js +80 -0
- package/dist/variables.types.d.ts +12 -0
- package/dist/variables.types.js +12 -0
- package/package.json +1 -1
package/dist/activity.types.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare enum LumiaActivityCommandTypes {
|
|
|
23
23
|
CHAT_COMMAND = "chat-command",
|
|
24
24
|
CHATBOT_COMMAND = "chatbot-command",
|
|
25
25
|
CHAT_MATCH = "chat-match",
|
|
26
|
+
SONG_REQUEST = "song-request",
|
|
26
27
|
TWITCH_POINTS = "twitch-points",
|
|
27
28
|
TWITCH_POINTS_OUTPUT = "twitch-points-output",
|
|
28
29
|
TWITCH_EXTENSION = "twitch-extension",
|
package/dist/activity.types.js
CHANGED
|
@@ -29,6 +29,10 @@ var LumiaActivityCommandTypes;
|
|
|
29
29
|
LumiaActivityCommandTypes["CHAT_COMMAND"] = "chat-command";
|
|
30
30
|
LumiaActivityCommandTypes["CHATBOT_COMMAND"] = "chatbot-command";
|
|
31
31
|
LumiaActivityCommandTypes["CHAT_MATCH"] = "chat-match";
|
|
32
|
+
// Marker for song-request items mirrored into ModQueue. When QueueEngine
|
|
33
|
+
// sees this type on an approve/deny path, it routes to SongRequestManager
|
|
34
|
+
// instead of the default chat-command execution.
|
|
35
|
+
LumiaActivityCommandTypes["SONG_REQUEST"] = "song-request";
|
|
32
36
|
LumiaActivityCommandTypes["TWITCH_POINTS"] = "twitch-points";
|
|
33
37
|
LumiaActivityCommandTypes["TWITCH_POINTS_OUTPUT"] = "twitch-points-output";
|
|
34
38
|
LumiaActivityCommandTypes["TWITCH_EXTENSION"] = "twitch-extension";
|
|
@@ -1272,6 +1272,10 @@ export declare enum SystemVariables {
|
|
|
1272
1272
|
TWITCH_CURRENT_POLL_ID = "twitch_current_poll_id",
|
|
1273
1273
|
/** Current prediction ID. Use as {{twitch_current_prediction_id}}. */
|
|
1274
1274
|
TWITCH_CURRENT_PREDICTION_ID = "twitch_current_prediction_id",
|
|
1275
|
+
/** Channel id. Use as {{youtube_channel_id}}. */
|
|
1276
|
+
YOUTUBE_CHANNEL_ID = "youtube_channel_id",
|
|
1277
|
+
/** Channel username (custom URL slug, falls back to channel title). Use as {{youtube_username}}. */
|
|
1278
|
+
YOUTUBE_USERNAME = "youtube_username",
|
|
1275
1279
|
/** Current viewer count. Use as {{youtube_current_viewer_count}}. */
|
|
1276
1280
|
YOUTUBE_CURRENT_VIEWER_COUNT = "youtube_current_viewer_count",
|
|
1277
1281
|
/** Total viewer count (stream). Use as {{youtube_total_viewer_count}}. */
|
|
@@ -1350,6 +1354,10 @@ export declare enum SystemVariables {
|
|
|
1350
1354
|
YOUTUBE_TOTAL_VIDEO_COUNT = "youtube_total_video_count",
|
|
1351
1355
|
/** Total channel views. Use as {{youtube_total_view_count}}. */
|
|
1352
1356
|
YOUTUBE_TOTAL_VIEW_COUNT = "youtube_total_view_count",
|
|
1357
|
+
/** Page / user id. Use as {{facebook_user_id}}. */
|
|
1358
|
+
FACEBOOK_USER_ID = "facebook_user_id",
|
|
1359
|
+
/** Page / user username. Use as {{facebook_username}}. */
|
|
1360
|
+
FACEBOOK_USERNAME = "facebook_username",
|
|
1353
1361
|
/** Session chat count. Use as {{facebook_session_chat_count}}. */
|
|
1354
1362
|
FACEBOOK_SESSION_CHAT_COUNT = "facebook_session_chat_count",
|
|
1355
1363
|
/** Current first chatter. Use as {{facebook_current_first_chatter}}. */
|
|
@@ -1388,6 +1396,10 @@ export declare enum SystemVariables {
|
|
|
1388
1396
|
FACEBOOK_SESSION_STARS = "facebook_session_stars",
|
|
1389
1397
|
/** Session Stars with amounts list. Use as {{facebook_session_stars_with_amount}}. */
|
|
1390
1398
|
FACEBOOK_SESSION_STARS_WITH_AMOUNT = "facebook_session_stars_with_amount",
|
|
1399
|
+
/** Channel user id. Use as {{tiktok_user_id}}. */
|
|
1400
|
+
TIKTOK_USER_ID = "tiktok_user_id",
|
|
1401
|
+
/** Channel username. Use as {{tiktok_username}}. */
|
|
1402
|
+
TIKTOK_USERNAME = "tiktok_username",
|
|
1391
1403
|
/** Session chat count. Use as {{tiktok_session_chat_count}}. */
|
|
1392
1404
|
TIKTOK_SESSION_CHAT_COUNT = "tiktok_session_chat_count",
|
|
1393
1405
|
/** Current first chatter. Use as {{tiktok_current_first_chatter}}. */
|
|
@@ -1272,6 +1272,10 @@ export declare enum SystemVariables {
|
|
|
1272
1272
|
TWITCH_CURRENT_POLL_ID = "twitch_current_poll_id",
|
|
1273
1273
|
/** Current prediction ID. Use as {{twitch_current_prediction_id}}. */
|
|
1274
1274
|
TWITCH_CURRENT_PREDICTION_ID = "twitch_current_prediction_id",
|
|
1275
|
+
/** Channel id. Use as {{youtube_channel_id}}. */
|
|
1276
|
+
YOUTUBE_CHANNEL_ID = "youtube_channel_id",
|
|
1277
|
+
/** Channel username (custom URL slug, falls back to channel title). Use as {{youtube_username}}. */
|
|
1278
|
+
YOUTUBE_USERNAME = "youtube_username",
|
|
1275
1279
|
/** Current viewer count. Use as {{youtube_current_viewer_count}}. */
|
|
1276
1280
|
YOUTUBE_CURRENT_VIEWER_COUNT = "youtube_current_viewer_count",
|
|
1277
1281
|
/** Total viewer count (stream). Use as {{youtube_total_viewer_count}}. */
|
|
@@ -1350,6 +1354,10 @@ export declare enum SystemVariables {
|
|
|
1350
1354
|
YOUTUBE_TOTAL_VIDEO_COUNT = "youtube_total_video_count",
|
|
1351
1355
|
/** Total channel views. Use as {{youtube_total_view_count}}. */
|
|
1352
1356
|
YOUTUBE_TOTAL_VIEW_COUNT = "youtube_total_view_count",
|
|
1357
|
+
/** Page / user id. Use as {{facebook_user_id}}. */
|
|
1358
|
+
FACEBOOK_USER_ID = "facebook_user_id",
|
|
1359
|
+
/** Page / user username. Use as {{facebook_username}}. */
|
|
1360
|
+
FACEBOOK_USERNAME = "facebook_username",
|
|
1353
1361
|
/** Session chat count. Use as {{facebook_session_chat_count}}. */
|
|
1354
1362
|
FACEBOOK_SESSION_CHAT_COUNT = "facebook_session_chat_count",
|
|
1355
1363
|
/** Current first chatter. Use as {{facebook_current_first_chatter}}. */
|
|
@@ -1388,6 +1396,10 @@ export declare enum SystemVariables {
|
|
|
1388
1396
|
FACEBOOK_SESSION_STARS = "facebook_session_stars",
|
|
1389
1397
|
/** Session Stars with amounts list. Use as {{facebook_session_stars_with_amount}}. */
|
|
1390
1398
|
FACEBOOK_SESSION_STARS_WITH_AMOUNT = "facebook_session_stars_with_amount",
|
|
1399
|
+
/** Channel user id. Use as {{tiktok_user_id}}. */
|
|
1400
|
+
TIKTOK_USER_ID = "tiktok_user_id",
|
|
1401
|
+
/** Channel username. Use as {{tiktok_username}}. */
|
|
1402
|
+
TIKTOK_USERNAME = "tiktok_username",
|
|
1391
1403
|
/** Session chat count. Use as {{tiktok_session_chat_count}}. */
|
|
1392
1404
|
TIKTOK_SESSION_CHAT_COUNT = "tiktok_session_chat_count",
|
|
1393
1405
|
/** Current first chatter. Use as {{tiktok_current_first_chatter}}. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { LumiaStreamingSites, LumiaActivityCommandTypes, LumiaExternalActivityCommandTypes, LumiaAlertValues, LumiaAlertFriendlyValues, LumiaActivityOriginTypes, LumiaActivityApiValueType, LumiaActivityNoValueTypes, LumiaActivityTestType, } from './activity.types';
|
|
2
|
-
export { LumiaVariationConditions, LumiaVariationCurrency, VariationCurrencySymbol, LumiaAlertConfigs, LumiaDynamicCondition, type LumiaSelectionOption } from './alert.types';
|
|
2
|
+
export { LumiaVariationConditions, LumiaVariationCurrency, VariationCurrencySymbol, LumiaRedemptionCurrency, LumiaRedemptionCurrencySymbol, LumiaAlertConfigs, LumiaDynamicCondition, type LumiaSelectionOption, } from './alert.types';
|
|
3
3
|
export { ILumiaSendPack, ILumiaEvent, ILumiaEventChatCommandBody, ILumiaEventChatBody, ILumiaEventAlertBody, ILumiaEventStateBody, ILumiaLight, LumiaIntegrations, LumiaEventTypes, } from './event.types';
|
|
4
4
|
export { LumiaEventListTypes, LumiaMapAlertTypeToEventListType } from './eventlist.types';
|
|
5
5
|
export { SystemVariables, ReservedVariables, AllVariables, getAcceptedVariableName, getAcceptedVariableNames, type LumiaAcceptedVariable, type LumiaAcceptedVariableDefinition, } from './variables.types';
|
|
@@ -8,3 +8,4 @@ export { KickKicksData } from './kick_kicks';
|
|
|
8
8
|
export { TiktokGiftsData } from './tiktok_gifts';
|
|
9
9
|
export { YoutubeSuperstickersData } from './youtube_superstickers';
|
|
10
10
|
export { VIEWER_PROFILE_ACHIEVEMENTS, type ViewerProfileAchievementColor, type ViewerProfileAchievementDefinition, type ViewerProfileAchievementMetric, type ViewerProfileCollectionMode, type ViewerProfileCollectionRule, type ViewerProfileCollectionSettings, type ViewerProfileCollectionSource, } from './viewer_profile_achievements';
|
|
11
|
+
export { SongRequestStatus, SongRequestSource, SongRequestProvider, SongRequestPlaybackTarget, type SongRequestItem, type SongRequestConfig, type SongRequestState, type SongRequestQueueUpdatePayload, type SongRequestPendingUpdatePayload, type SongRequestNowPlayingPayload, type SongRequestAddParams, type SongRequestModerationParams, } from './songrequest.types';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VIEWER_PROFILE_ACHIEVEMENTS = exports.YoutubeSuperstickersData = exports.TiktokGiftsData = exports.KickKicksData = exports.formatCondition = exports.getAcceptedVariableNames = exports.getAcceptedVariableName = exports.AllVariables = exports.ReservedVariables = exports.SystemVariables = exports.LumiaMapAlertTypeToEventListType = exports.LumiaEventListTypes = exports.LumiaEventTypes = exports.LumiaIntegrations = exports.LumiaAlertConfigs = exports.VariationCurrencySymbol = exports.LumiaVariationCurrency = exports.LumiaVariationConditions = exports.LumiaActivityTestType = exports.LumiaActivityNoValueTypes = exports.LumiaActivityApiValueType = exports.LumiaActivityOriginTypes = exports.LumiaAlertFriendlyValues = exports.LumiaAlertValues = exports.LumiaExternalActivityCommandTypes = exports.LumiaActivityCommandTypes = exports.LumiaStreamingSites = void 0;
|
|
3
|
+
exports.SongRequestPlaybackTarget = exports.SongRequestProvider = exports.SongRequestSource = exports.SongRequestStatus = exports.VIEWER_PROFILE_ACHIEVEMENTS = exports.YoutubeSuperstickersData = exports.TiktokGiftsData = exports.KickKicksData = exports.formatCondition = exports.getAcceptedVariableNames = exports.getAcceptedVariableName = exports.AllVariables = exports.ReservedVariables = exports.SystemVariables = exports.LumiaMapAlertTypeToEventListType = exports.LumiaEventListTypes = exports.LumiaEventTypes = exports.LumiaIntegrations = exports.LumiaAlertConfigs = exports.LumiaRedemptionCurrencySymbol = exports.LumiaRedemptionCurrency = exports.VariationCurrencySymbol = exports.LumiaVariationCurrency = exports.LumiaVariationConditions = exports.LumiaActivityTestType = exports.LumiaActivityNoValueTypes = exports.LumiaActivityApiValueType = exports.LumiaActivityOriginTypes = exports.LumiaAlertFriendlyValues = exports.LumiaAlertValues = exports.LumiaExternalActivityCommandTypes = exports.LumiaActivityCommandTypes = exports.LumiaStreamingSites = void 0;
|
|
4
4
|
var activity_types_1 = require("./activity.types");
|
|
5
5
|
Object.defineProperty(exports, "LumiaStreamingSites", { enumerable: true, get: function () { return activity_types_1.LumiaStreamingSites; } });
|
|
6
6
|
Object.defineProperty(exports, "LumiaActivityCommandTypes", { enumerable: true, get: function () { return activity_types_1.LumiaActivityCommandTypes; } });
|
|
@@ -15,6 +15,8 @@ var alert_types_1 = require("./alert.types");
|
|
|
15
15
|
Object.defineProperty(exports, "LumiaVariationConditions", { enumerable: true, get: function () { return alert_types_1.LumiaVariationConditions; } });
|
|
16
16
|
Object.defineProperty(exports, "LumiaVariationCurrency", { enumerable: true, get: function () { return alert_types_1.LumiaVariationCurrency; } });
|
|
17
17
|
Object.defineProperty(exports, "VariationCurrencySymbol", { enumerable: true, get: function () { return alert_types_1.VariationCurrencySymbol; } });
|
|
18
|
+
Object.defineProperty(exports, "LumiaRedemptionCurrency", { enumerable: true, get: function () { return alert_types_1.LumiaRedemptionCurrency; } });
|
|
19
|
+
Object.defineProperty(exports, "LumiaRedemptionCurrencySymbol", { enumerable: true, get: function () { return alert_types_1.LumiaRedemptionCurrencySymbol; } });
|
|
18
20
|
Object.defineProperty(exports, "LumiaAlertConfigs", { enumerable: true, get: function () { return alert_types_1.LumiaAlertConfigs; } });
|
|
19
21
|
var event_types_1 = require("./event.types");
|
|
20
22
|
Object.defineProperty(exports, "LumiaIntegrations", { enumerable: true, get: function () { return event_types_1.LumiaIntegrations; } });
|
|
@@ -38,3 +40,8 @@ var youtube_superstickers_1 = require("./youtube_superstickers");
|
|
|
38
40
|
Object.defineProperty(exports, "YoutubeSuperstickersData", { enumerable: true, get: function () { return youtube_superstickers_1.YoutubeSuperstickersData; } });
|
|
39
41
|
var viewer_profile_achievements_1 = require("./viewer_profile_achievements");
|
|
40
42
|
Object.defineProperty(exports, "VIEWER_PROFILE_ACHIEVEMENTS", { enumerable: true, get: function () { return viewer_profile_achievements_1.VIEWER_PROFILE_ACHIEVEMENTS; } });
|
|
43
|
+
var songrequest_types_1 = require("./songrequest.types");
|
|
44
|
+
Object.defineProperty(exports, "SongRequestStatus", { enumerable: true, get: function () { return songrequest_types_1.SongRequestStatus; } });
|
|
45
|
+
Object.defineProperty(exports, "SongRequestSource", { enumerable: true, get: function () { return songrequest_types_1.SongRequestSource; } });
|
|
46
|
+
Object.defineProperty(exports, "SongRequestProvider", { enumerable: true, get: function () { return songrequest_types_1.SongRequestProvider; } });
|
|
47
|
+
Object.defineProperty(exports, "SongRequestPlaybackTarget", { enumerable: true, get: function () { return songrequest_types_1.SongRequestPlaybackTarget; } });
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { LumiaStreamingSites } from './activity.types';
|
|
2
|
+
/** Lifecycle of a single song request. */
|
|
3
|
+
export declare enum SongRequestStatus {
|
|
4
|
+
/** Awaiting moderator approval (only used when `config.approvalRequired`). */
|
|
5
|
+
PENDING = "pending",
|
|
6
|
+
/** Approved, waiting in the queue. */
|
|
7
|
+
QUEUED = "queued",
|
|
8
|
+
/** Currently playing. */
|
|
9
|
+
PLAYING = "playing",
|
|
10
|
+
/** Finished playing naturally. */
|
|
11
|
+
COMPLETED = "completed",
|
|
12
|
+
/** Rejected by streamer / mod before playing. */
|
|
13
|
+
DENIED = "denied",
|
|
14
|
+
/** Ended early (skip button or skip command). */
|
|
15
|
+
SKIPPED = "skipped"
|
|
16
|
+
}
|
|
17
|
+
/** Where a request entered the system. Used for analytics + permission checks. */
|
|
18
|
+
export declare enum SongRequestSource {
|
|
19
|
+
/** Triggered by the `!sr` system chatbot command. */
|
|
20
|
+
CHAT_COMMAND = "chat",
|
|
21
|
+
/** Triggered by the ADD_SONG_REQUEST Lumia action (decks, automations, …). */
|
|
22
|
+
LUMIA_ACTION = "action",
|
|
23
|
+
/** Streamer added directly from the dashboard. */
|
|
24
|
+
STREAMER = "streamer",
|
|
25
|
+
/** Mod added directly from the modtool window. */
|
|
26
|
+
MOD = "mod"
|
|
27
|
+
}
|
|
28
|
+
/** Format of the user's submission, before resolution. */
|
|
29
|
+
export declare enum SongRequestProvider {
|
|
30
|
+
/** YouTube watch URL or short URL. */
|
|
31
|
+
YOUTUBE = "youtube",
|
|
32
|
+
/** Spotify track URL — may be routed to Spotify queue or converted to YouTube. */
|
|
33
|
+
SPOTIFY = "spotify",
|
|
34
|
+
/** YouTube Music URL (less common; usually treated like YouTube). */
|
|
35
|
+
YOUTUBE_MUSIC = "youtubeMusic",
|
|
36
|
+
/** Free-text query that needs a search before it can play. */
|
|
37
|
+
TEXT = "text"
|
|
38
|
+
}
|
|
39
|
+
/** Where the resolved song actually plays once approved. */
|
|
40
|
+
export declare enum SongRequestPlaybackTarget {
|
|
41
|
+
/** Hidden YT iframe inside the songrequest overlay module (default). */
|
|
42
|
+
OVERLAY = "overlay",
|
|
43
|
+
/** Streamer's Spotify Premium player via Spotify Web API queue. */
|
|
44
|
+
SPOTIFY = "spotify",
|
|
45
|
+
/** Streamer's YouTube Music player via YT Music queue. */
|
|
46
|
+
YOUTUBE_MUSIC = "youtubeMusic"
|
|
47
|
+
}
|
|
48
|
+
/** A single request item — one row in the queue / pending tray / history. */
|
|
49
|
+
export interface SongRequestItem {
|
|
50
|
+
id: string;
|
|
51
|
+
status: SongRequestStatus;
|
|
52
|
+
source: SongRequestSource;
|
|
53
|
+
provider: SongRequestProvider;
|
|
54
|
+
/** Raw user input — the URL or text query they submitted. */
|
|
55
|
+
query: string;
|
|
56
|
+
resolvedUrl?: string;
|
|
57
|
+
/** YouTube video ID (resolved for both YOUTUBE and TEXT providers). */
|
|
58
|
+
videoId?: string;
|
|
59
|
+
/** Spotify track ID, when applicable. */
|
|
60
|
+
spotifyTrackId?: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
artist?: string;
|
|
63
|
+
thumbnailUrl?: string;
|
|
64
|
+
durationSeconds?: number;
|
|
65
|
+
requesterUsername: string;
|
|
66
|
+
requesterPlatform?: LumiaStreamingSites;
|
|
67
|
+
requesterAvatar?: string;
|
|
68
|
+
approvedBy?: string;
|
|
69
|
+
approvedAt?: number;
|
|
70
|
+
deniedBy?: string;
|
|
71
|
+
deniedReason?: string;
|
|
72
|
+
/** Chosen at queue-entry time based on connected services + config. */
|
|
73
|
+
playbackTarget?: SongRequestPlaybackTarget;
|
|
74
|
+
createdAt: number;
|
|
75
|
+
startedAt?: number;
|
|
76
|
+
endedAt?: number;
|
|
77
|
+
tipAmount?: number;
|
|
78
|
+
tipCurrency?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* User-configurable settings for the song-request system. Lives in user
|
|
82
|
+
* settings (not in runtime state). Role gating for the `!sr` command piggybacks
|
|
83
|
+
* on the system command's own `userLevels` field — we deliberately do NOT
|
|
84
|
+
* duplicate it here.
|
|
85
|
+
*/
|
|
86
|
+
export interface SongRequestConfig {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
/** Trigger word for the system chatbot command. Default: `!sr`. */
|
|
89
|
+
triggerCommand: string;
|
|
90
|
+
cooldownPerUserSeconds: number;
|
|
91
|
+
cooldownGlobalSeconds: number;
|
|
92
|
+
maxRequestsPerUserInSession: number;
|
|
93
|
+
/** When true, requests land in `pending` until a mod / streamer approves. */
|
|
94
|
+
approvalRequired: boolean;
|
|
95
|
+
maxQueueSize: number;
|
|
96
|
+
maxSongDurationSeconds: number;
|
|
97
|
+
allowYouTubeUrls: boolean;
|
|
98
|
+
allowSpotifyUrls: boolean;
|
|
99
|
+
allowFreeTextSearch: boolean;
|
|
100
|
+
/** Required for free-text → YouTube Data API v3 search. */
|
|
101
|
+
youtubeApiKey?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Where approved songs play. `'auto'` = use the streamer's connected music
|
|
104
|
+
* service (Spotify Premium > YT Music) when available, otherwise the overlay
|
|
105
|
+
* iframe. The other values force a single target regardless of connections.
|
|
106
|
+
*/
|
|
107
|
+
preferredPlaybackTarget: 'auto' | SongRequestPlaybackTarget;
|
|
108
|
+
announceInChat: boolean;
|
|
109
|
+
chatTemplateAdded: string;
|
|
110
|
+
chatTemplateNowPlaying: string;
|
|
111
|
+
chatTemplateDenied: string;
|
|
112
|
+
/** Used for dedup / cooldown / queue-full / disallowed-source rejections. */
|
|
113
|
+
chatTemplateRejected: string;
|
|
114
|
+
}
|
|
115
|
+
/** Runtime queue state. Lives in the LumiaStream Redux slice; the dashboard
|
|
116
|
+
* widgets and the overlay module consume slices of this shape. */
|
|
117
|
+
export interface SongRequestState {
|
|
118
|
+
/** Awaiting moderator approval (empty when `approvalRequired: false`). */
|
|
119
|
+
pending: SongRequestItem[];
|
|
120
|
+
/** Approved, waiting to play. Index 0 plays next. */
|
|
121
|
+
queue: SongRequestItem[];
|
|
122
|
+
/** Currently playing item, if any. */
|
|
123
|
+
nowPlaying: SongRequestItem | null;
|
|
124
|
+
/** Recently completed / skipped / denied items, newest first. Capped. */
|
|
125
|
+
history: SongRequestItem[];
|
|
126
|
+
}
|
|
127
|
+
/** Fired whenever the active queue or now-playing changes. */
|
|
128
|
+
export interface SongRequestQueueUpdatePayload {
|
|
129
|
+
queue: SongRequestItem[];
|
|
130
|
+
nowPlaying: SongRequestItem | null;
|
|
131
|
+
}
|
|
132
|
+
/** Fired whenever the pending tray changes (drives the moderation widget). */
|
|
133
|
+
export interface SongRequestPendingUpdatePayload {
|
|
134
|
+
pending: SongRequestItem[];
|
|
135
|
+
}
|
|
136
|
+
/** Lighter-weight ping when only nowPlaying changed (e.g., natural advance). */
|
|
137
|
+
export interface SongRequestNowPlayingPayload {
|
|
138
|
+
nowPlaying: SongRequestItem | null;
|
|
139
|
+
}
|
|
140
|
+
export interface SongRequestAddParams {
|
|
141
|
+
/** Raw input — URL or free text. The parser resolves it. */
|
|
142
|
+
query: string;
|
|
143
|
+
requesterUsername?: string;
|
|
144
|
+
requesterPlatform?: LumiaStreamingSites;
|
|
145
|
+
/** Defaults to `LUMIA_ACTION` when omitted (matches the action call site). */
|
|
146
|
+
source?: SongRequestSource;
|
|
147
|
+
/**
|
|
148
|
+
* Streamer / mod additions can skip the pending state. Chat-command
|
|
149
|
+
* additions ignore this flag — chat is always subject to `approvalRequired`.
|
|
150
|
+
*/
|
|
151
|
+
forceApprove?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface SongRequestModerationParams {
|
|
154
|
+
id: string;
|
|
155
|
+
/** Optional reason for deny actions (surfaced in chat / mod log). */
|
|
156
|
+
reason?: string;
|
|
157
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SongRequestPlaybackTarget = exports.SongRequestProvider = exports.SongRequestSource = exports.SongRequestStatus = void 0;
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Song Request — shared types for the native LumiaStream song-request system.
|
|
6
|
+
//
|
|
7
|
+
// Used by:
|
|
8
|
+
// - LumiaStream renderer (queue manager, system chatbot command, Lumia
|
|
9
|
+
// action handler, dashboard page + widgets)
|
|
10
|
+
// - Overlay-UI `songrequest` module (now-playing card + queue list + skip/
|
|
11
|
+
// pause UI; consumes SongRequestQueueUpdatePayload via SSE)
|
|
12
|
+
// - Lumia-UI `se-import` (`mapMediaShare` translates SE's
|
|
13
|
+
// `se-widget-media-share` widget into a Lumia `songrequest` module)
|
|
14
|
+
//
|
|
15
|
+
// Architecture summary (so this file's shape is legible standalone):
|
|
16
|
+
// 1. Viewers submit via `!sr <youtube-url|spotify-url|free text>` chat
|
|
17
|
+
// command. Streamer / mods can also add via the dashboard UI or via the
|
|
18
|
+
// ADD_SONG_REQUEST Lumia action.
|
|
19
|
+
// 2. Submission lands in `pending` for moderator approval (default) or
|
|
20
|
+
// jumps directly to `queue` when `forceApprove: true` (streamer / mod
|
|
21
|
+
// additions) or when `config.approvalRequired: false`.
|
|
22
|
+
// 3. Approved items get a `playbackTarget` chosen at queue time:
|
|
23
|
+
// - `OVERLAY` (default): hidden YT iframe inside the songrequest
|
|
24
|
+
// overlay module
|
|
25
|
+
// - `SPOTIFY`: routed to streamer's Spotify Premium queue via
|
|
26
|
+
// spotify.manager.SearchAndAddToQueue (already implemented)
|
|
27
|
+
// - `YOUTUBE_MUSIC`: routed to streamer's YT Music queue (handler
|
|
28
|
+
// to be added in Phase E)
|
|
29
|
+
// 4. Items move queue → nowPlaying → history (capped) as they play out.
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
/** Lifecycle of a single song request. */
|
|
32
|
+
var SongRequestStatus;
|
|
33
|
+
(function (SongRequestStatus) {
|
|
34
|
+
/** Awaiting moderator approval (only used when `config.approvalRequired`). */
|
|
35
|
+
SongRequestStatus["PENDING"] = "pending";
|
|
36
|
+
/** Approved, waiting in the queue. */
|
|
37
|
+
SongRequestStatus["QUEUED"] = "queued";
|
|
38
|
+
/** Currently playing. */
|
|
39
|
+
SongRequestStatus["PLAYING"] = "playing";
|
|
40
|
+
/** Finished playing naturally. */
|
|
41
|
+
SongRequestStatus["COMPLETED"] = "completed";
|
|
42
|
+
/** Rejected by streamer / mod before playing. */
|
|
43
|
+
SongRequestStatus["DENIED"] = "denied";
|
|
44
|
+
/** Ended early (skip button or skip command). */
|
|
45
|
+
SongRequestStatus["SKIPPED"] = "skipped";
|
|
46
|
+
})(SongRequestStatus || (exports.SongRequestStatus = SongRequestStatus = {}));
|
|
47
|
+
/** Where a request entered the system. Used for analytics + permission checks. */
|
|
48
|
+
var SongRequestSource;
|
|
49
|
+
(function (SongRequestSource) {
|
|
50
|
+
/** Triggered by the `!sr` system chatbot command. */
|
|
51
|
+
SongRequestSource["CHAT_COMMAND"] = "chat";
|
|
52
|
+
/** Triggered by the ADD_SONG_REQUEST Lumia action (decks, automations, …). */
|
|
53
|
+
SongRequestSource["LUMIA_ACTION"] = "action";
|
|
54
|
+
/** Streamer added directly from the dashboard. */
|
|
55
|
+
SongRequestSource["STREAMER"] = "streamer";
|
|
56
|
+
/** Mod added directly from the modtool window. */
|
|
57
|
+
SongRequestSource["MOD"] = "mod";
|
|
58
|
+
})(SongRequestSource || (exports.SongRequestSource = SongRequestSource = {}));
|
|
59
|
+
/** Format of the user's submission, before resolution. */
|
|
60
|
+
var SongRequestProvider;
|
|
61
|
+
(function (SongRequestProvider) {
|
|
62
|
+
/** YouTube watch URL or short URL. */
|
|
63
|
+
SongRequestProvider["YOUTUBE"] = "youtube";
|
|
64
|
+
/** Spotify track URL — may be routed to Spotify queue or converted to YouTube. */
|
|
65
|
+
SongRequestProvider["SPOTIFY"] = "spotify";
|
|
66
|
+
/** YouTube Music URL (less common; usually treated like YouTube). */
|
|
67
|
+
SongRequestProvider["YOUTUBE_MUSIC"] = "youtubeMusic";
|
|
68
|
+
/** Free-text query that needs a search before it can play. */
|
|
69
|
+
SongRequestProvider["TEXT"] = "text";
|
|
70
|
+
})(SongRequestProvider || (exports.SongRequestProvider = SongRequestProvider = {}));
|
|
71
|
+
/** Where the resolved song actually plays once approved. */
|
|
72
|
+
var SongRequestPlaybackTarget;
|
|
73
|
+
(function (SongRequestPlaybackTarget) {
|
|
74
|
+
/** Hidden YT iframe inside the songrequest overlay module (default). */
|
|
75
|
+
SongRequestPlaybackTarget["OVERLAY"] = "overlay";
|
|
76
|
+
/** Streamer's Spotify Premium player via Spotify Web API queue. */
|
|
77
|
+
SongRequestPlaybackTarget["SPOTIFY"] = "spotify";
|
|
78
|
+
/** Streamer's YouTube Music player via YT Music queue. */
|
|
79
|
+
SongRequestPlaybackTarget["YOUTUBE_MUSIC"] = "youtubeMusic";
|
|
80
|
+
})(SongRequestPlaybackTarget || (exports.SongRequestPlaybackTarget = SongRequestPlaybackTarget = {}));
|
|
@@ -426,6 +426,10 @@ export declare enum SystemVariables {
|
|
|
426
426
|
TWITCH_CURRENT_POLL_ID = "twitch_current_poll_id",
|
|
427
427
|
/** Current prediction ID. Use as {{twitch_current_prediction_id}}. */
|
|
428
428
|
TWITCH_CURRENT_PREDICTION_ID = "twitch_current_prediction_id",
|
|
429
|
+
/** Channel id. Use as {{youtube_channel_id}}. */
|
|
430
|
+
YOUTUBE_CHANNEL_ID = "youtube_channel_id",
|
|
431
|
+
/** Channel username (custom URL slug, falls back to channel title). Use as {{youtube_username}}. */
|
|
432
|
+
YOUTUBE_USERNAME = "youtube_username",
|
|
429
433
|
/** Current viewer count. Use as {{youtube_current_viewer_count}}. */
|
|
430
434
|
YOUTUBE_CURRENT_VIEWER_COUNT = "youtube_current_viewer_count",
|
|
431
435
|
/** Total viewer count (stream). Use as {{youtube_total_viewer_count}}. */
|
|
@@ -504,6 +508,10 @@ export declare enum SystemVariables {
|
|
|
504
508
|
YOUTUBE_TOTAL_VIDEO_COUNT = "youtube_total_video_count",
|
|
505
509
|
/** Total channel views. Use as {{youtube_total_view_count}}. */
|
|
506
510
|
YOUTUBE_TOTAL_VIEW_COUNT = "youtube_total_view_count",
|
|
511
|
+
/** Page / user id. Use as {{facebook_user_id}}. */
|
|
512
|
+
FACEBOOK_USER_ID = "facebook_user_id",
|
|
513
|
+
/** Page / user username. Use as {{facebook_username}}. */
|
|
514
|
+
FACEBOOK_USERNAME = "facebook_username",
|
|
507
515
|
/** Session chat count. Use as {{facebook_session_chat_count}}. */
|
|
508
516
|
FACEBOOK_SESSION_CHAT_COUNT = "facebook_session_chat_count",
|
|
509
517
|
/** Current first chatter. Use as {{facebook_current_first_chatter}}. */
|
|
@@ -542,6 +550,10 @@ export declare enum SystemVariables {
|
|
|
542
550
|
FACEBOOK_SESSION_STARS = "facebook_session_stars",
|
|
543
551
|
/** Session Stars with amounts list. Use as {{facebook_session_stars_with_amount}}. */
|
|
544
552
|
FACEBOOK_SESSION_STARS_WITH_AMOUNT = "facebook_session_stars_with_amount",
|
|
553
|
+
/** Channel user id. Use as {{tiktok_user_id}}. */
|
|
554
|
+
TIKTOK_USER_ID = "tiktok_user_id",
|
|
555
|
+
/** Channel username. Use as {{tiktok_username}}. */
|
|
556
|
+
TIKTOK_USERNAME = "tiktok_username",
|
|
545
557
|
/** Session chat count. Use as {{tiktok_session_chat_count}}. */
|
|
546
558
|
TIKTOK_SESSION_CHAT_COUNT = "tiktok_session_chat_count",
|
|
547
559
|
/** Current first chatter. Use as {{tiktok_current_first_chatter}}. */
|
package/dist/variables.types.js
CHANGED
|
@@ -435,6 +435,10 @@ var SystemVariables;
|
|
|
435
435
|
/** Current prediction ID. Use as {{twitch_current_prediction_id}}. */
|
|
436
436
|
SystemVariables["TWITCH_CURRENT_PREDICTION_ID"] = "twitch_current_prediction_id";
|
|
437
437
|
// ─────────────────────────────────── YouTube ──────────────────────────────────
|
|
438
|
+
/** Channel id. Use as {{youtube_channel_id}}. */
|
|
439
|
+
SystemVariables["YOUTUBE_CHANNEL_ID"] = "youtube_channel_id";
|
|
440
|
+
/** Channel username (custom URL slug, falls back to channel title). Use as {{youtube_username}}. */
|
|
441
|
+
SystemVariables["YOUTUBE_USERNAME"] = "youtube_username";
|
|
438
442
|
/** Current viewer count. Use as {{youtube_current_viewer_count}}. */
|
|
439
443
|
SystemVariables["YOUTUBE_CURRENT_VIEWER_COUNT"] = "youtube_current_viewer_count";
|
|
440
444
|
/** Total viewer count (stream). Use as {{youtube_total_viewer_count}}. */
|
|
@@ -514,6 +518,10 @@ var SystemVariables;
|
|
|
514
518
|
/** Total channel views. Use as {{youtube_total_view_count}}. */
|
|
515
519
|
SystemVariables["YOUTUBE_TOTAL_VIEW_COUNT"] = "youtube_total_view_count";
|
|
516
520
|
// ────────────────────────────────── Facebook ──────────────────────────────────
|
|
521
|
+
/** Page / user id. Use as {{facebook_user_id}}. */
|
|
522
|
+
SystemVariables["FACEBOOK_USER_ID"] = "facebook_user_id";
|
|
523
|
+
/** Page / user username. Use as {{facebook_username}}. */
|
|
524
|
+
SystemVariables["FACEBOOK_USERNAME"] = "facebook_username";
|
|
517
525
|
/** Session chat count. Use as {{facebook_session_chat_count}}. */
|
|
518
526
|
SystemVariables["FACEBOOK_SESSION_CHAT_COUNT"] = "facebook_session_chat_count";
|
|
519
527
|
/** Current first chatter. Use as {{facebook_current_first_chatter}}. */
|
|
@@ -553,6 +561,10 @@ var SystemVariables;
|
|
|
553
561
|
/** Session Stars with amounts list. Use as {{facebook_session_stars_with_amount}}. */
|
|
554
562
|
SystemVariables["FACEBOOK_SESSION_STARS_WITH_AMOUNT"] = "facebook_session_stars_with_amount";
|
|
555
563
|
// ─────────────────────────────────── TikTok ───────────────────────────────────
|
|
564
|
+
/** Channel user id. Use as {{tiktok_user_id}}. */
|
|
565
|
+
SystemVariables["TIKTOK_USER_ID"] = "tiktok_user_id";
|
|
566
|
+
/** Channel username. Use as {{tiktok_username}}. */
|
|
567
|
+
SystemVariables["TIKTOK_USERNAME"] = "tiktok_username";
|
|
556
568
|
/** Session chat count. Use as {{tiktok_session_chat_count}}. */
|
|
557
569
|
SystemVariables["TIKTOK_SESSION_CHAT_COUNT"] = "tiktok_session_chat_count";
|
|
558
570
|
/** Current first chatter. Use as {{tiktok_current_first_chatter}}. */
|