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:
parent
4834208f9f
commit
ada1c07f66
3 changed files with 89 additions and 40 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue