fix: align code with spec

This commit is contained in:
2026-04-03 15:53:48 +02:00
parent 95c97bce33
commit 897577a369
10 changed files with 141 additions and 20 deletions

View File

@@ -1,5 +1,20 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum ScriptKind {
Macro,
Utility,
Transform,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum ScriptStatus {
Draft,
Published,
}
/// A user-authored script. Matches the `scripts` table.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Script {
@@ -7,13 +22,12 @@ pub struct Script {
pub project_id: String,
pub slug: String,
pub title: String,
/// "macro", "transform", or "utility"
pub kind: String,
pub kind: ScriptKind,
pub entrypoint: String,
pub enabled: bool,
pub version: i32,
pub file_path: String,
pub status: String,
pub status: ScriptStatus,
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
pub created_at: i64,