- 补 OnlyOffice callback 附件写回的 media asset bridge 适配层,并继续扩展 documents bridge/测试覆盖 - 提交当前 OMX hooks 删除与 Harness 运行状态文件更新,保留本轮任务执行轨迹 - 一并提交仓库中已跟踪的 Rust target 构建产物与相关协议桥接变更,确保工作区清零
127 lines
3.2 KiB
Rust
127 lines
3.2 KiB
Rust
use crate::common::{ActorPayload, AffectedObject, SourcePayload, TargetRef};
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct CommandEnvelope<T> {
|
|
pub name: String,
|
|
pub command_id: String,
|
|
pub idempotency_key: Option<String>,
|
|
pub actor: ActorPayload,
|
|
pub source: SourcePayload,
|
|
pub target: Option<TargetRef>,
|
|
pub payload: T,
|
|
pub reason: Option<String>,
|
|
pub refs: Vec<String>,
|
|
pub dry_run: bool,
|
|
pub validate_only: bool,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct CommandResult {
|
|
pub ok: bool,
|
|
pub command_id: String,
|
|
pub event_ids: Vec<String>,
|
|
pub affected_objects: Vec<AffectedObject>,
|
|
pub revision: Option<u64>,
|
|
pub warnings: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct CreateWorkspace {
|
|
pub name: String,
|
|
pub slug: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct CreatePage {
|
|
pub title: String,
|
|
pub parent_page_id: Option<String>,
|
|
pub position: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct UpdatePageTitle {
|
|
pub page_id: String,
|
|
pub title: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct UpdatePageStats {
|
|
pub page_id: String,
|
|
pub word_count: i64,
|
|
pub character_count: i64,
|
|
pub block_count: i64,
|
|
pub todo_total: i64,
|
|
pub todo_done: i64,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct UpdatePageOptions {
|
|
pub page_id: String,
|
|
pub wide_layout: Option<bool>,
|
|
pub small_text: Option<bool>,
|
|
pub show_heading_numbers: Option<bool>,
|
|
pub show_toc: Option<bool>,
|
|
pub show_structure: Option<bool>,
|
|
pub protect_editing: Option<bool>,
|
|
pub show_word_count: Option<bool>,
|
|
pub collapse_backlinks: Option<bool>,
|
|
pub page_font: Option<String>,
|
|
pub layout_density: Option<String>,
|
|
pub hide_child_pages: Option<bool>,
|
|
pub show_block_ref_count: Option<bool>,
|
|
pub embed_default_block_id: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct ReplaceMediaAssetStorage {
|
|
pub asset_id: String,
|
|
pub storage_id: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct SavePageContent {
|
|
pub page_id: String,
|
|
pub workspace_id: Option<String>,
|
|
pub revision: Option<u64>,
|
|
pub content_json: String,
|
|
pub conflict_detection_key: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct PatchPageBlock {
|
|
pub page_id: String,
|
|
pub block_id: String,
|
|
pub workspace_id: Option<String>,
|
|
pub revision: Option<u64>,
|
|
pub block_snapshot_json: String,
|
|
pub conflict_detection_key: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct InsertBlock {
|
|
pub page_id: String,
|
|
pub block_type: String,
|
|
pub content: String,
|
|
pub parent_block_id: Option<String>,
|
|
pub prev_block_id: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct UpdateBlock {
|
|
pub block_id: String,
|
|
pub patch_content: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct MoveBlock {
|
|
pub block_id: String,
|
|
pub new_parent_block_id: Option<String>,
|
|
pub new_page_id: Option<String>,
|
|
pub prev_block_id: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct DeleteBlock {
|
|
pub block_id: String,
|
|
}
|