From b2b6fd5efdc9ff62199f27953fbc5f387a2d7ab5 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Tue, 4 Nov 2025 13:53:22 -0800 Subject: [PATCH 1/4] prototyping --- modeling-cmds/src/def_enum.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 09e5197e..a1f1e2ee 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -452,6 +452,18 @@ define_modeling_cmd_enum! { pub format: OutputFormat3d, } + /// Cache the scene on the server. + 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. + 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))] From b05fce56682a379596fcc7c5a55a6f3f5b862f79 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Tue, 4 Nov 2025 13:54:31 -0800 Subject: [PATCH 2/4] missing traits --- modeling-cmds/src/def_enum.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index a1f1e2ee..cae1b781 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -453,12 +453,18 @@ define_modeling_cmd_enum! { } /// 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, From 5ffd5fda4f9d437b74921c78b028bb52cdc00dc5 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Tue, 4 Nov 2025 13:57:36 -0800 Subject: [PATCH 3/4] forgot responses --- modeling-cmds/src/ok_response.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index b3c8b526..2f39a0ad 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -323,6 +323,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 Export { + } + + /// The response from the `LoadCache` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct LoadCache { + } + /// The response from the `Export` endpoint. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct Export { From 91b94645242aa6e7bdda02578e60dc849d298c6a Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Tue, 4 Nov 2025 13:59:43 -0800 Subject: [PATCH 4/4] ... --- modeling-cmds/src/ok_response.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 2f39a0ad..71f26ae9 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -323,21 +323,21 @@ define_ok_modeling_cmd_response_enum! { pub files: Vec, } - /// The response from the `Cache` endpoint. + /// The response from the `Export` endpoint. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct Export { + /// The files that were exported. + pub files: Vec, } - /// The response from the `LoadCache` endpoint. + /// The response from the `Cache` endpoint. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct LoadCache { + pub struct Cache { } - /// The response from the `Export` endpoint. + /// The response from the `LoadCache` endpoint. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct Export { - /// The files that were exported. - pub files: Vec, + pub struct LoadCache { } /// The response from the `SelectWithPoint` command.