diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 09e5197e..cae1b781 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -452,6 +452,24 @@ define_modeling_cmd_enum! { pub format: OutputFormat3d, } + /// Cache the scene on the server. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct Cache { + /// ID of the cache (this should be built from a hash of the content that produced the scene) + pub cache_id: Uuid, + } + + /// Retrieve a cached version of the scene if one exists. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct LoadCache { + /// ID of the cache (this should be built from a hash of the content that produced the scene) + pub cache_id: Uuid, + } + /// What is this entity's parent? #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index b3c8b526..71f26ae9 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -330,6 +330,16 @@ define_ok_modeling_cmd_response_enum! { pub files: Vec, } + /// The response from the `Cache` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct Cache { + } + + /// The response from the `LoadCache` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct LoadCache { + } + /// The response from the `SelectWithPoint` command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct SelectWithPoint {