pinakes-server: add widget, theme-extension, and event plugin routes; expose allowed_endpoints in UI page DTO

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia7efa6db85da2d44b59e0e2e57f6e45b6a6a6964
This commit is contained in:
raf 2026-03-11 16:55:27 +03:00
commit ada1c07f66
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 89 additions and 40 deletions

View file

@ -1,4 +1,4 @@
use pinakes_plugin_api::UiPage;
use pinakes_plugin_api::{UiPage, UiWidget};
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize)]
@ -26,9 +26,29 @@ pub struct TogglePluginRequest {
#[derive(Debug, Serialize)]
pub struct PluginUiPageEntry {
/// Plugin ID that provides this page
pub plugin_id: String,
pub plugin_id: String,
/// Full page definition
pub page: UiPage,
pub page: UiPage,
/// Endpoint paths this plugin is allowed to fetch (empty means no
/// restriction)
pub allowed_endpoints: Vec<String>,
}
/// A single plugin UI widget entry in the list response
#[derive(Debug, Serialize)]
pub struct PluginUiWidgetEntry {
/// Plugin ID that provides this widget
pub plugin_id: String,
/// Full widget definition
pub widget: UiWidget,
}
/// Request body for emitting a plugin event
#[derive(Debug, Deserialize)]
pub struct PluginEventRequest {
pub event: String,
#[serde(default)]
pub payload: serde_json::Value,
}
impl PluginResponse {