* feat(jellycompat): install web assets at runtime * fix(jellycompat): recover stale web operation locks * fix(jellycompat): harden web component management * feat(admin): refine compat settings and restart status * chore(dev): add hot-reload docker compose stack * fix(dev): include npm in hot-reload backend * feat(admin): refine Jellyfin compatibility settings * feat(settings): improve jellyfin proxy summary * feat(settings): improve jellyfin web controls * fix(settings): update jellyfin web removal status * fix(settings): enable jellyfin web after install * feat(jellycompat): auto-select web ui version * test(api): update rate limit handler setup * feat(jellycompat): refine web ui install onboarding * fix(jellycompat): address web ui install review issues * fix(onboarding): mirror jellyfin api runtime status * fix(admin): remove global restart banner * fix(settings): gate restart required tracking * fix(jellyfin): ignore live settings for restart status * fix(jellyfin): avoid restart for live compat settings * fix(subtitles): normalize AI language codes * fix(catalog): support partial title search tokens * feat(branding): add white-label customization * Add push relay engineering plan - Document relay API contracts, APNs/FCM behavior, auth, storage, and ops - Capture implementation plan, provider references, decisions, and README --------- Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
110 lines
3.3 KiB
Go
110 lines
3.3 KiB
Go
package events
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type EventChannel string
|
|
|
|
const (
|
|
ChannelCatalog EventChannel = "catalog"
|
|
ChannelJobs EventChannel = "jobs"
|
|
ChannelSessions EventChannel = "sessions"
|
|
ChannelTasks EventChannel = "tasks"
|
|
ChannelScans EventChannel = "scans"
|
|
ChannelHistoryImport EventChannel = "history_import"
|
|
ChannelUserState EventChannel = "user_state"
|
|
ChannelSettings EventChannel = "settings"
|
|
ChannelPlugins EventChannel = "plugins"
|
|
// ChannelNotifications carries profile-scoped user notifications
|
|
// (inbox deliveries). Subscriptions require a websocket ticket binding
|
|
// the connection to a (user, profile).
|
|
ChannelNotifications EventChannel = "notifications"
|
|
)
|
|
|
|
var AllChannels = []EventChannel{
|
|
ChannelCatalog,
|
|
ChannelJobs,
|
|
ChannelSessions,
|
|
ChannelTasks,
|
|
ChannelScans,
|
|
ChannelHistoryImport,
|
|
ChannelUserState,
|
|
ChannelSettings,
|
|
ChannelPlugins,
|
|
ChannelNotifications,
|
|
}
|
|
|
|
type Envelope struct {
|
|
Channel EventChannel `json:"channel"`
|
|
Event string `json:"event"`
|
|
EventID string `json:"event_id"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
SourceID string `json:"source_id,omitempty"`
|
|
Data json.RawMessage `json:"data,omitempty"`
|
|
UserID int `json:"user_id,omitempty"`
|
|
ProfileID string `json:"profile_id,omitempty"`
|
|
AdminOnly bool `json:"admin_only,omitempty"`
|
|
// TargetPluginID, when non-empty, restricts dispatch to a single installed
|
|
// plugin (and only if it is already a subscriber). Used by
|
|
// RuntimeHostServer.PublishEventTo.
|
|
TargetPluginID string `json:"target_plugin_id,omitempty"`
|
|
}
|
|
|
|
type PublishOptions struct {
|
|
EventID string
|
|
UserID int
|
|
ProfileID string
|
|
AdminOnly bool
|
|
}
|
|
|
|
type EventsHelloMessage struct {
|
|
Type string `json:"type"`
|
|
SchemaVersion int `json:"schema_version"`
|
|
ConnectionID string `json:"connection_id"`
|
|
AvailableChannels []EventChannel `json:"available_channels"`
|
|
RequiredAction string `json:"required_action"`
|
|
}
|
|
|
|
type EventsSubscribeMessage struct {
|
|
Type string `json:"type"`
|
|
RequestID string `json:"request_id,omitempty"`
|
|
Channels []EventChannel `json:"channels"`
|
|
}
|
|
|
|
type EventsRejectedChannel struct {
|
|
Channel EventChannel `json:"channel"`
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type EventsSubscribedMessage struct {
|
|
Type string `json:"type"`
|
|
RequestID string `json:"request_id,omitempty"`
|
|
Channels []EventChannel `json:"channels"`
|
|
Rejected []EventsRejectedChannel `json:"rejected,omitempty"`
|
|
}
|
|
|
|
type EventsSnapshotMessage struct {
|
|
Type string `json:"type"`
|
|
Channel EventChannel `json:"channel"`
|
|
Timestamp string `json:"timestamp"`
|
|
Data json.RawMessage `json:"data"`
|
|
}
|
|
|
|
type EventsEventMessage struct {
|
|
Type string `json:"type"`
|
|
Channel EventChannel `json:"channel"`
|
|
Event string `json:"event"`
|
|
EventID string `json:"event_id"`
|
|
Timestamp string `json:"timestamp"`
|
|
Data json.RawMessage `json:"data"`
|
|
}
|
|
|
|
type EventsErrorMessage struct {
|
|
Type string `json:"type"`
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
}
|