dkp_core/procedures/
schema.rs1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct ProcedureSchema {
8 pub id: String,
9 pub title: String,
10 pub description: String,
11 pub input: serde_json::Value,
13 pub output: serde_json::Value,
15 #[serde(skip_serializing_if = "Option::is_none")]
17 pub entry_point: Option<EntryPoint>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct EntryPoint {
23 pub filename: String,
25 pub command: String,
27}
28
29#[derive(Debug, Clone)]
31pub struct ProcedureDef {
32 pub id: String,
33 pub schema: ProcedureSchema,
34 pub wasm_path: Option<PathBuf>,
36 pub entry_point: Option<EntryPoint>,
38 pub doc_path: PathBuf,
40 pub schema_path: PathBuf,
42}
43
44impl ProcedureDef {
45 pub fn is_runnable(&self) -> bool {
46 self.wasm_path.is_some() || self.entry_point.is_some()
47 }
48}