feat(mcp): WhatsApp connector, archivable catalog, MCP connector config endpoint
This commit is contained in:
@@ -1,12 +1,32 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// How a config property is rendered and edited in the Config UI.
|
||||
///
|
||||
/// Beyond the plain scalars (`String`/`Int`/`Bool`, rendered as text/number/
|
||||
/// switch), a variant can stand for a **custom, higher-level control** whose
|
||||
/// allowed values are computed by the backend rather than typed by hand —
|
||||
/// `SecurityGroup` and `Locale` are both of this kind: they turn into a
|
||||
/// dropdown fed by a server-supplied `options` list.
|
||||
///
|
||||
/// **Adding your own is cheap and encouraged.** If a new config section would
|
||||
/// otherwise expose a free-text field where only a fixed/derived set of values
|
||||
/// is valid, prefer adding a variant here instead. The wiring is three small,
|
||||
/// symmetric edits:
|
||||
/// 1. add the variant below;
|
||||
/// 2. in `frontend/api/config.rs`, map it to a type string and (if it's a
|
||||
/// dropdown) build its `options: Vec<SelectOption>`;
|
||||
/// 3. in `web/components/config-page.js`, add a render branch for that type.
|
||||
/// Anything carrying `options` renders as a `<select>` — see `_renderInput`.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PropertyType {
|
||||
String,
|
||||
Int,
|
||||
Bool,
|
||||
/// Dropdown of the instance's security groups (run-context groups).
|
||||
SecurityGroup,
|
||||
/// Dropdown of the interface languages the instance supports.
|
||||
Locale,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user