From 1f0c60e361a34b9e04edc1e7fe319ba880ccd9a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:30:58 -0800 Subject: [PATCH 01/18] Bump thiserror from 2.0.7 to 2.0.8 (#692) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.7 to 2.0.8. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/2.0.7...2.0.8) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- modeling-session/Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2a260db..d32f20e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1948,7 +1948,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_urlencoded", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", "url", @@ -2024,7 +2024,7 @@ dependencies = [ "lsystem", "reqwest", "serde_json", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tokio-tungstenite", "uuid", @@ -2883,7 +2883,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", ] @@ -2902,7 +2902,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.7", + "thiserror 2.0.8", "tinyvec", "tracing", "web-time", @@ -4004,11 +4004,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.8", ] [[package]] @@ -4024,9 +4024,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", diff --git a/modeling-session/Cargo.toml b/modeling-session/Cargo.toml index 1023aa6d..87b59128 100644 --- a/modeling-session/Cargo.toml +++ b/modeling-session/Cargo.toml @@ -17,7 +17,7 @@ kittycad-modeling-cmds = { workspace = true, features = ["websocket"] } lsystem = "0.2.1" reqwest = "0.12.9" serde_json = "1.0.133" -thiserror = "2.0.7" +thiserror = "2.0.8" tokio = { version = "1", features = ["sync"] } tokio-tungstenite = "0.24.0" uuid = { version = "1.11.0", features = ["v4"] } From c7cc1b10a52e2d2c7a52cb50200f4ce1b59535b9 Mon Sep 17 00:00:00 2001 From: Ben Crabbe Date: Thu, 19 Dec 2024 10:15:16 +0900 Subject: [PATCH 02/18] Use new offset capabilities to add a hole to a closed path with uniform thickness from the perimeter (#685) * Extrude can send IDs for the new faces When extruding a 2D shape into a 3D shape, a bunch of new faces are created. These faces need IDs. The backend currently generates these IDs randomly. Add a new option to allow the client to send the IDs. * AddHoleFromOffset --------- Co-authored-by: Adam Chalmers Co-authored-by: gserena --- modeling-cmds/src/def_enum.rs | 9 +++++++++ modeling-cmds/src/ok_response.rs | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 26d98390..62803d24 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1211,6 +1211,15 @@ define_modeling_cmd_enum! { /// The distance to offset the path (positive for outset, negative for inset) pub offset: LengthUnit, } + + /// Add a hole to a closed path by offsetting it a uniform distance inward. + #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + pub struct AddHoleFromOffset { + /// The closed path to add a hole to. + pub object_id: Uuid, + /// The distance to offset the path (positive for outset, negative for inset) + pub offset: LengthUnit, + } } } diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 7b9dd787..214928f9 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -440,6 +440,16 @@ define_ok_modeling_cmd_response_enum! { pub entity_ids: Vec, } + /// The response from the `AddHoleFromOffset` command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct AddHoleFromOffset { + /// If the offset path splits into multiple paths, this will contain the UUIDs of the + /// new paths. + /// If the offset path remains as a single path, this will be empty, and the resulting ID + /// of the (single) new path will be the ID of the `AddHoleFromOffset` command. + pub entity_ids: Vec, + } + /// The response from the `DefaultCameraFocusOn` command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct DefaultCameraFocusOn { } From 7f92ddc0f67373503499bf656439d417d4da0393 Mon Sep 17 00:00:00 2001 From: Ben Crabbe Date: Thu, 19 Dec 2024 10:26:45 +0900 Subject: [PATCH 03/18] Release modeling-cmds 0.2.84 (#694) --- Cargo.lock | 2 +- modeling-cmds/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d32f20e9..923b40c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1957,7 +1957,7 @@ dependencies = [ [[package]] name = "kittycad-modeling-cmds" -version = "0.2.83" +version = "0.2.84" dependencies = [ "anyhow", "bson", diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index 49a95d64..2807a389 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kittycad-modeling-cmds" -version = "0.2.83" +version = "0.2.84" edition = "2021" authors = ["KittyCAD, Inc."] description = "Commands in the KittyCAD Modeling API" From c8cfe1eef38ccef854b6796bb72a5f35a594d4c4 Mon Sep 17 00:00:00 2001 From: Serena Gandhi <60444726+gserena01@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:30:39 -0500 Subject: [PATCH 04/18] mirrors and helices return uuids (#691) * mirrors return uuids * return helix id too --------- Co-authored-by: gserena --- modeling-cmds/src/ok_response.rs | 48 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 214928f9..09ed25a5 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -84,26 +84,6 @@ define_ok_modeling_cmd_response_enum! { pub struct DefaultCameraPerspectiveSettings { } - /// The response from the `EntityMakeHelix` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct EntityMakeHelix { - } - - /// The response from the `EntityMakeHelixFromParams` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct EntityMakeHelixFromParams { - } - - /// The response from the `EntityMirror` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct EntityMirror { - } - - /// The response from the `EntityMirrorAcrossEdge` endpoint. - #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] - pub struct EntityMirrorAcrossEdge { - } - /// The response from the `SelectAdd` endpoint. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct SelectAdd { @@ -755,6 +735,34 @@ define_ok_modeling_cmd_response_enum! { pub entity_ids: Vec, } + /// The response from the `EntityMirror` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct EntityMirror { + /// The UUIDs of the entities that were created. + pub entity_ids: Vec + } + + /// The response from the `EntityMirrorAcrossEdge` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct EntityMirrorAcrossEdge { + /// The UUIDs of the entities that were created. + pub entity_ids: Vec + } + + /// The response from the `EntityMakeHelix` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct EntityMakeHelix { + /// The UUID of the helix that was created. + pub helix_id: Uuid + } + + /// The response from the `EntityMakeHelixFromParams` endpoint. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct EntityMakeHelixFromParams { + /// The UUID of the helix that was created. + pub helix_id: Uuid + } + /// Extrusion face info struct (useful for maintaining mappings between source path segment ids and extrusion faces) #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct Solid3dGetExtrusionFaceInfo { From dca042ee88736cec31ac0c67a777e489961449d2 Mon Sep 17 00:00:00 2001 From: Serena Gandhi <60444726+gserena01@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:37:10 -0500 Subject: [PATCH 05/18] Release modeling-cmds 0.2.85 (#696) Co-authored-by: gserena --- Cargo.lock | 2 +- modeling-cmds/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 923b40c6..3d9d1e8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1957,7 +1957,7 @@ dependencies = [ [[package]] name = "kittycad-modeling-cmds" -version = "0.2.84" +version = "0.2.85" dependencies = [ "anyhow", "bson", diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index 2807a389..2a11b1cc 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kittycad-modeling-cmds" -version = "0.2.84" +version = "0.2.85" edition = "2021" authors = ["KittyCAD, Inc."] description = "Commands in the KittyCAD Modeling API" From 25041a5449f3be3a593f88e976d1ce50e8f8be00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:36:04 -0800 Subject: [PATCH 06/18] Bump syn from 2.0.90 to 2.0.91 (#700) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.90 to 2.0.91. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.90...2.0.91) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 76 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d9d1e8d..540f5a61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -242,7 +242,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure 0.13.1", ] @@ -265,7 +265,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -276,7 +276,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -668,7 +668,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -925,7 +925,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -952,7 +952,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -970,7 +970,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1052,7 +1052,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1134,7 +1134,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1356,7 +1356,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1833,7 +1833,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1995,7 +1995,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2009,7 +2009,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2038,7 +2038,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2328,7 +2328,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2434,7 +2434,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2609,7 +2609,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2623,7 +2623,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2815,7 +2815,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2843,7 +2843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3493,7 +3493,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3583,7 +3583,7 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3594,7 +3594,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3779,7 +3779,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3790,7 +3790,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3812,7 +3812,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3862,9 +3862,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -3900,7 +3900,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4019,7 +4019,7 @@ checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4030,7 +4030,7 @@ checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4135,7 +4135,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4256,7 +4256,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -4565,7 +4565,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-shared", ] @@ -4599,7 +4599,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5167,7 +5167,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -5187,7 +5187,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 16a406b2..8e825156 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ kittycad-modeling-cmds-macros-impl = { path = "modeling-cmds-macros-impl", versi kittycad-modeling-session = { path = "modeling-session", version = "0.1.2" } proc-macro2 = "1.0.92" quote = "1.0.37" -syn = "2.0.90" +syn = "2.0.91" [profile.bench] debug = true From 0d6c9a7f2fda926ed2d766808def57a7fbb4868f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:36:13 -0800 Subject: [PATCH 07/18] Bump thiserror from 2.0.8 to 2.0.9 (#699) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.8 to 2.0.9. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/2.0.8...2.0.9) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- modeling-session/Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 540f5a61..9da7933c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1948,7 +1948,7 @@ dependencies = [ "serde_bytes", "serde_json", "serde_urlencoded", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "url", @@ -2024,7 +2024,7 @@ dependencies = [ "lsystem", "reqwest", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-tungstenite", "uuid", @@ -2883,7 +2883,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -2902,7 +2902,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.8", + "thiserror 2.0.9", "tinyvec", "tracing", "web-time", @@ -4004,11 +4004,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.9", ] [[package]] @@ -4024,9 +4024,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", diff --git a/modeling-session/Cargo.toml b/modeling-session/Cargo.toml index 87b59128..4a0dea03 100644 --- a/modeling-session/Cargo.toml +++ b/modeling-session/Cargo.toml @@ -17,7 +17,7 @@ kittycad-modeling-cmds = { workspace = true, features = ["websocket"] } lsystem = "0.2.1" reqwest = "0.12.9" serde_json = "1.0.133" -thiserror = "2.0.8" +thiserror = "2.0.9" tokio = { version = "1", features = ["sync"] } tokio-tungstenite = "0.24.0" uuid = { version = "1.11.0", features = ["v4"] } From 9a2777273cdc4d307626bf373ed8033e3bfde1e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 09:36:20 -0800 Subject: [PATCH 08/18] Bump anyhow from 1.0.94 to 1.0.95 (#698) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.94 to 1.0.95. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.94...1.0.95) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- bumper/Cargo.toml | 2 +- modeling-cmds-macros-impl/Cargo.toml | 2 +- modeling-cmds-macros/Cargo.toml | 2 +- modeling-cmds/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9da7933c..8efc571d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -152,9 +152,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "approx" diff --git a/bumper/Cargo.toml b/bumper/Cargo.toml index 2b8f05d2..582151b0 100644 --- a/bumper/Cargo.toml +++ b/bumper/Cargo.toml @@ -10,7 +10,7 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.94" +anyhow = "1.0.95" clap = { version = "4.5.23", features = ["derive"] } semver = "1.0.24" serde = "1.0.216" diff --git a/modeling-cmds-macros-impl/Cargo.toml b/modeling-cmds-macros-impl/Cargo.toml index 939ebb4f..b0720554 100644 --- a/modeling-cmds-macros-impl/Cargo.toml +++ b/modeling-cmds-macros-impl/Cargo.toml @@ -16,7 +16,7 @@ quote = { workspace = true } syn = { workspace = true, features = ["extra-traits", "full"] } [dev-dependencies] -anyhow = "1.0.94" +anyhow = "1.0.95" criterion = { version = "0.5", features = ["html_reports"] } insta = "1.41.1" regex = "1.11.1" diff --git a/modeling-cmds-macros/Cargo.toml b/modeling-cmds-macros/Cargo.toml index a45607e7..8b846fb3 100644 --- a/modeling-cmds-macros/Cargo.toml +++ b/modeling-cmds-macros/Cargo.toml @@ -20,7 +20,7 @@ syn = { workspace = true, features = ["extra-traits", "full"] } proc-macro = true [dev-dependencies] -anyhow = "1.0.94" +anyhow = "1.0.95" insta = "1.41.1" regex = "1.11.1" rustfmt-wrapper = "0.2.1" diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index 2a11b1cc..3c2660a2 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.94" +anyhow = "1.0.95" chrono = "0.4.39" cxx = { version = "1.0", optional = true } data-encoding = "2.5.0" From f0e017f6bcf39760015fafb59993c3a6cc1525f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:05:21 -0800 Subject: [PATCH 09/18] Bump serde_json from 1.0.133 to 1.0.134 (#697) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.133 to 1.0.134. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.133...v1.0.134) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- modeling-cmds/Cargo.toml | 2 +- modeling-session/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8efc571d..a98f5d29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3599,9 +3599,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "indexmap 2.2.6", "itoa", diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index 3c2660a2..c465df0a 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -33,7 +33,7 @@ schemars = { version = "0.8.16", features = [ ] } serde = { version = "1.0.216", features = ["derive"] } serde_bytes = "0.11.15" -serde_json = { version = "1.0.133", optional = true } +serde_json = { version = "1.0.134", optional = true } slog = { version = "2.7.0", optional = true } tabled = { version = "0.17", optional = true } uuid = { version = "1.11.0", features = ["serde", "v4", "js"] } diff --git a/modeling-session/Cargo.toml b/modeling-session/Cargo.toml index 4a0dea03..e6b44824 100644 --- a/modeling-session/Cargo.toml +++ b/modeling-session/Cargo.toml @@ -16,7 +16,7 @@ kittycad = { workspace = true } kittycad-modeling-cmds = { workspace = true, features = ["websocket"] } lsystem = "0.2.1" reqwest = "0.12.9" -serde_json = "1.0.133" +serde_json = "1.0.134" thiserror = "2.0.9" tokio = { version = "1", features = ["sync"] } tokio-tungstenite = "0.24.0" From bd2b33aeacea75e97902eec453dc8a111965ba40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:58:23 -0800 Subject: [PATCH 10/18] Bump syn from 2.0.91 to 2.0.93 (#705) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.91 to 2.0.93. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.91...2.0.93) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 76 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a98f5d29..5492463f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -242,7 +242,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "synstructure 0.13.1", ] @@ -265,7 +265,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -276,7 +276,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -668,7 +668,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -925,7 +925,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -952,7 +952,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -970,7 +970,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1052,7 +1052,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1134,7 +1134,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1356,7 +1356,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1833,7 +1833,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1995,7 +1995,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2009,7 +2009,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2038,7 +2038,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2328,7 +2328,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2434,7 +2434,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2609,7 +2609,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2623,7 +2623,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2815,7 +2815,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2843,7 +2843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3493,7 +3493,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3583,7 +3583,7 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3594,7 +3594,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3779,7 +3779,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3790,7 +3790,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3812,7 +3812,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3862,9 +3862,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.91" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -3900,7 +3900,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4019,7 +4019,7 @@ checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4030,7 +4030,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4135,7 +4135,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4256,7 +4256,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4565,7 +4565,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "wasm-bindgen-shared", ] @@ -4599,7 +4599,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5167,7 +5167,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -5187,7 +5187,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8e825156..3ba80f65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ kittycad-modeling-cmds-macros-impl = { path = "modeling-cmds-macros-impl", versi kittycad-modeling-session = { path = "modeling-session", version = "0.1.2" } proc-macro2 = "1.0.92" quote = "1.0.37" -syn = "2.0.91" +syn = "2.0.93" [profile.bench] debug = true From 2d5781c6bfa274f759ecf35257d9059a1c4f7c8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:43:21 -0800 Subject: [PATCH 11/18] Bump cxx from 1.0.135 to 1.0.136 (#701) Bumps [cxx](https://github.com/dtolnay/cxx) from 1.0.135 to 1.0.136. - [Release notes](https://github.com/dtolnay/cxx/releases) - [Commits](https://github.com/dtolnay/cxx/compare/1.0.135...1.0.136) --- updated-dependencies: - dependency-name: cxx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5492463f..f5f4a32d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -930,9 +930,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d44ff199ff93242c3afe480ab588d544dd08d72e92885e152ffebc670f076ad" +checksum = "ad7c7515609502d316ab9a24f67dc045132d93bfd3f00713389e90d9898bf30d" dependencies = [ "cc", "cxxbridge-cmd", @@ -944,9 +944,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717c9c806a9e07fdcb34c84965a414ea40fafe57667187052cf1eb7f5e8a8a9" +checksum = "6c33fd49f5d956a1b7ee5f7a9768d58580c6752838d92e39d0d56439efdedc35" dependencies = [ "clap", "codespan-reporting", @@ -957,15 +957,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f6515329bf3d98f4073101c7866ff2bec4e635a13acb82e3f3753fff0bf43cb" +checksum = "be0f1077278fac36299cce8446effd19fe93a95eedb10d39265f3bf67b3036c9" [[package]] name = "cxxbridge-macro" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb93e6a7ce8ec985c02bbb758237a31598b340acbbc3c19c5a4fa6adaaac92ab" +checksum = "3da7e4d6e74af6b79031d264b2f13c3ea70af1978083741c41ffce9308f1f24f" dependencies = [ "proc-macro2", "quote", From 259c14bf8dd9c0533ec827fd0f2d4d3753d47997 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:43:29 -0800 Subject: [PATCH 12/18] Bump quote from 1.0.37 to 1.0.38 (#702) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.37 to 1.0.38. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.37...1.0.38) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5f4a32d..eb80bbb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2924,9 +2924,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] diff --git a/Cargo.toml b/Cargo.toml index 3ba80f65..cda95734 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ kittycad-modeling-cmds-macros = { path = "modeling-cmds-macros", version = "0.1. kittycad-modeling-cmds-macros-impl = { path = "modeling-cmds-macros-impl", version = "0.1.12" } kittycad-modeling-session = { path = "modeling-session", version = "0.1.2" } proc-macro2 = "1.0.92" -quote = "1.0.37" +quote = "1.0.38" syn = "2.0.93" [profile.bench] From 8118487b0206813882b9270e515ad0b180e5e1cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:44:17 -0800 Subject: [PATCH 13/18] Bump serde from 1.0.216 to 1.0.217 (#706) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.216 to 1.0.217. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.216...v1.0.217) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- bumper/Cargo.toml | 2 +- modeling-cmds/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb80bbb4..15fc9148 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3559,9 +3559,9 @@ checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -3577,9 +3577,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", diff --git a/bumper/Cargo.toml b/bumper/Cargo.toml index 582151b0..3fe102ce 100644 --- a/bumper/Cargo.toml +++ b/bumper/Cargo.toml @@ -13,7 +13,7 @@ publish = false anyhow = "1.0.95" clap = { version = "4.5.23", features = ["derive"] } semver = "1.0.24" -serde = "1.0.216" +serde = "1.0.217" toml_edit = "0.22.16" [lints] diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index c465df0a..81877b54 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -31,7 +31,7 @@ schemars = { version = "0.8.16", features = [ "url", "uuid1", ] } -serde = { version = "1.0.216", features = ["derive"] } +serde = { version = "1.0.217", features = ["derive"] } serde_bytes = "0.11.15" serde_json = { version = "1.0.134", optional = true } slog = { version = "2.7.0", optional = true } From 7645014adbaf856323bcee255722d7ed2d2f77f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 08:44:24 -0800 Subject: [PATCH 14/18] Bump reqwest from 0.12.9 to 0.12.12 (#707) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.12.9 to 0.12.12. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.9...v0.12.12) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 30 ++++++++++++++++++++++++++---- modeling-session/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15fc9148..0910d604 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3155,9 +3155,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", @@ -3193,6 +3193,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -4231,11 +4232,32 @@ dependencies = [ "walkdir", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" diff --git a/modeling-session/Cargo.toml b/modeling-session/Cargo.toml index e6b44824..b4475405 100644 --- a/modeling-session/Cargo.toml +++ b/modeling-session/Cargo.toml @@ -15,7 +15,7 @@ futures = "0.3.31" kittycad = { workspace = true } kittycad-modeling-cmds = { workspace = true, features = ["websocket"] } lsystem = "0.2.1" -reqwest = "0.12.9" +reqwest = "0.12.12" serde_json = "1.0.134" thiserror = "2.0.9" tokio = { version = "1", features = ["sync"] } From 7d3f93e791a1b2a4c34f1c182a629c8eb1f0fc0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:02:08 -0800 Subject: [PATCH 15/18] Bump syn from 2.0.93 to 2.0.95 (#709) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.93 to 2.0.95. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.93...2.0.95) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 76 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0910d604..9c8de1e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -242,7 +242,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "synstructure 0.13.1", ] @@ -265,7 +265,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -276,7 +276,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -668,7 +668,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -925,7 +925,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -952,7 +952,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -970,7 +970,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1052,7 +1052,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1134,7 +1134,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1356,7 +1356,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1833,7 +1833,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1995,7 +1995,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2009,7 +2009,7 @@ dependencies = [ "quote", "regex", "rustfmt-wrapper", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2038,7 +2038,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2328,7 +2328,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2434,7 +2434,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2609,7 +2609,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2623,7 +2623,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2815,7 +2815,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2843,7 +2843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3494,7 +3494,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3584,7 +3584,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3595,7 +3595,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3780,7 +3780,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3791,7 +3791,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3813,7 +3813,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3863,9 +3863,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.93" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -3901,7 +3901,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4020,7 +4020,7 @@ checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4031,7 +4031,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4136,7 +4136,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4278,7 +4278,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4587,7 +4587,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "wasm-bindgen-shared", ] @@ -4621,7 +4621,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5189,7 +5189,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -5209,7 +5209,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cda95734..346eb43f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ kittycad-modeling-cmds-macros-impl = { path = "modeling-cmds-macros-impl", versi kittycad-modeling-session = { path = "modeling-session", version = "0.1.2" } proc-macro2 = "1.0.92" quote = "1.0.38" -syn = "2.0.93" +syn = "2.0.95" [profile.bench] debug = true From 766bb5ed330512e9ba0758b968114e343947afbf Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 6 Jan 2025 14:02:09 -0500 Subject: [PATCH 16/18] Add ts-rs cargo feature to derive ts-rs (#708) * Add ts-rs cargo feature to derive ts-rs * Add derive PartialEq for all modeling commands * Fix empty variant structs to have a field to work with ts-rs --- Cargo.lock | 26 + .../src/modeling_cmd_enum.rs | 4 +- modeling-cmds/Cargo.toml | 6 + modeling-cmds/src/coord.rs | 8 + modeling-cmds/src/def_enum.rs | 537 +++++++++++++----- modeling-cmds/src/format/fbx.rs | 6 + modeling-cmds/src/format/gltf.rs | 8 + modeling-cmds/src/format/mod.rs | 6 + modeling-cmds/src/format/obj.rs | 4 + modeling-cmds/src/format/ply.rs | 6 + modeling-cmds/src/format/sldprt.rs | 2 + modeling-cmds/src/format/step.rs | 4 + modeling-cmds/src/format/stl.rs | 6 + modeling-cmds/src/id.rs | 2 + modeling-cmds/src/length_unit.rs | 2 + modeling-cmds/src/shared.rs | 97 +++- modeling-cmds/src/shared/point.rs | 6 + modeling-cmds/src/units.rs | 12 + modeling-session/examples/cube_png.rs | 2 +- modeling-session/examples/cube_png_batch.rs | 2 +- .../examples/lsystem_png_batch.rs | 2 +- 21 files changed, 605 insertions(+), 143 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c8de1e1..1eaf2633 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1980,6 +1980,7 @@ dependencies = [ "serde_json", "slog", "tabled", + "ts-rs", "uuid", "webrtc", ] @@ -4347,6 +4348,31 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ts-rs" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e640d9b0964e9d39df633548591090ab92f7a4567bc31d3891af23471a3365c6" +dependencies = [ + "lazy_static", + "serde_json", + "thiserror 2.0.9", + "ts-rs-macros", + "uuid", +] + +[[package]] +name = "ts-rs-macros" +version = "10.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9d8656589772eeec2cf7a8264d9cda40fb28b9bc53118ceb9e8c07f8f38730" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.93", + "termcolor", +] + [[package]] name = "tungstenite" version = "0.24.0" diff --git a/modeling-cmds-macros-impl/src/modeling_cmd_enum.rs b/modeling-cmds-macros-impl/src/modeling_cmd_enum.rs index 3573827f..88762581 100644 --- a/modeling-cmds-macros-impl/src/modeling_cmd_enum.rs +++ b/modeling-cmds-macros-impl/src/modeling_cmd_enum.rs @@ -54,9 +54,11 @@ pub fn generate(input: ItemMod) -> TokenStream { /// Definition of each modeling command. #input /// Commands that the KittyCAD engine can execute. - #[derive(Debug, Clone, Serialize, Deserialize)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[cfg_attr(feature = "derive-jsonschema-on-enums", derive(schemars::JsonSchema))] #[serde(rename_all = "snake_case", tag = "type")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub enum ModelingCmd {#( #[doc = #docs] diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index 81877b54..f136385d 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -36,6 +36,11 @@ serde_bytes = "0.11.15" serde_json = { version = "1.0.134", optional = true } slog = { version = "2.7.0", optional = true } tabled = { version = "0.17", optional = true } +ts-rs = { version = "10.1.0", optional = true, features = [ + "uuid-impl", + "no-serde-warnings", + "serde-json-impl", +] } uuid = { version = "1.11.0", features = ["serde", "v4", "js"] } webrtc = { version = "0.11", optional = true } @@ -46,6 +51,7 @@ workspace = true default = [] derive-jsonschema-on-enums = [] tabled = ["dep:tabled"] +ts-rs = ["dep:ts-rs"] slog = ["dep:slog"] cxx = ["dep:cxx"] convert_client_crate = ["dep:kittycad"] diff --git a/modeling-cmds/src/coord.rs b/modeling-cmds/src/coord.rs index 7b382f82..d9781873 100644 --- a/modeling-cmds/src/coord.rs +++ b/modeling-cmds/src/coord.rs @@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Axis { /// 'Y' axis. Y = 1, @@ -21,6 +23,8 @@ pub enum Axis { #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Direction { /// Increasing numbers. Positive = 1, @@ -42,6 +46,8 @@ impl std::ops::Mul for Direction { /// An [`Axis`] paired with a [`Direction`]. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("({axis}, {direction})")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct AxisDirectionPair { /// Axis specifier. pub axis: Axis, @@ -59,6 +65,8 @@ pub struct AxisDirectionPair { /// [cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1) #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("forward: {forward}, up: {up}")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct System { /// Axis the front face of a model looks along. pub forward: AxisDirectionPair, diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 62803d24..41ed5c1b 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -44,8 +44,10 @@ define_modeling_cmd_enum! { /// Evaluates the position of a path in one shot (engine utility for kcl executor) #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 EngineUtilEvaluatePath { /// The path in json form (the serialized result of the kcl Sketch/Path object pub path_json: String, @@ -56,9 +58,16 @@ define_modeling_cmd_enum! { /// Start a new path. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, )] - pub struct StartPath; + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct StartPath { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Move the path's "pen". /// If you're in sketch mode, these coordinates are in the local coordinate system, @@ -68,8 +77,10 @@ define_modeling_cmd_enum! { /// to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to /// (1, 1, 50) in global coordinates. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 MovePathPen { /// The ID of the command which created the path. pub path: ModelingCmdId, @@ -80,8 +91,10 @@ define_modeling_cmd_enum! { /// Extend a path by adding a new segment which starts at the path's "pen". /// If no "pen" location has been set before (via `MovePen`), then the pen is at the origin. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 ExtendPath { /// The ID of the command which created the path. pub path: ModelingCmdId, @@ -92,8 +105,10 @@ define_modeling_cmd_enum! { /// Command for extruding a solid 2d. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 Extrude { /// Which sketch to extrude. /// Must be a closed 2D solid. @@ -108,8 +123,10 @@ define_modeling_cmd_enum! { /// Extrude the object along a path. #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Sweep { /// Which sketch to sweep. /// Must be a closed 2D solid. @@ -124,8 +141,10 @@ define_modeling_cmd_enum! { /// Command for revolving a solid 2d. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 Revolve { /// Which sketch to revolve. /// Must be a closed 2D solid. @@ -144,8 +163,10 @@ define_modeling_cmd_enum! { /// Command for shelling a solid3d face #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 Solid3dShellFace { /// Which Solid3D is being shelled. pub object_id: Uuid, @@ -161,8 +182,10 @@ define_modeling_cmd_enum! { /// Command for revolving a solid 2d about a brep edge #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 RevolveAboutEdge { /// Which sketch to revolve. /// Must be a closed 2D solid. @@ -177,8 +200,10 @@ define_modeling_cmd_enum! { /// Command for lofting sections to create a solid #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant + 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 Loft { /// The closed section curves to create a lofted solid from. /// Currently, these must be Solid2Ds @@ -199,15 +224,19 @@ define_modeling_cmd_enum! { /// Closes a path, converting it to a 2D solid. #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + 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 ClosePath { /// Which path to close. pub path_id: Uuid, } /// Camera drag started. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CameraDragStart { /// The type of camera drag interaction. pub interaction: CameraDragInteractionType, @@ -216,7 +245,9 @@ define_modeling_cmd_enum! { } /// Camera drag continued. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CameraDragMove { /// The type of camera drag interaction. pub interaction: CameraDragInteractionType, @@ -230,7 +261,9 @@ define_modeling_cmd_enum! { } /// Camera drag ended - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CameraDragEnd { /// The type of camera drag interaction. pub interaction: CameraDragInteractionType, @@ -239,11 +272,20 @@ define_modeling_cmd_enum! { } /// Gets the default camera's camera settings - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct DefaultCameraGetSettings; + #[derive(Debug, Clone, Default, 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 DefaultCameraGetSettings { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Change what the default camera is looking at. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 DefaultCameraLookAt { /// Where the camera is positioned pub vantage: Point3d, @@ -259,7 +301,9 @@ define_modeling_cmd_enum! { } /// Change what the default camera is looking at. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 DefaultCameraPerspectiveSettings { /// Where the camera is positioned pub vantage: Point3d, @@ -281,7 +325,9 @@ define_modeling_cmd_enum! { } /// Adjust zoom of the default camera. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 DefaultCameraZoom { /// Move the camera forward along the vector it's looking at, /// by this magnitudedefaultCameraZoom. @@ -290,7 +336,9 @@ define_modeling_cmd_enum! { } /// Export the scene to a file. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Export { /// IDs of the entities to be exported. If this is empty, then all entities are exported. pub entity_ids: Vec, @@ -299,21 +347,27 @@ define_modeling_cmd_enum! { } /// What is this entity's parent? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetParentId { /// ID of the entity being queried. pub entity_id: Uuid, } /// How many children does the entity have? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetNumChildren { /// ID of the entity being queried. pub entity_id: Uuid, } /// What is the UUID of this entity's n-th child? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetChildUuid { /// ID of the entity being queried. pub entity_id: Uuid, @@ -322,21 +376,27 @@ define_modeling_cmd_enum! { } /// What are all UUIDs of this entity's children? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetAllChildUuids { /// ID of the entity being queried. pub entity_id: Uuid, } /// What are all UUIDs of all the paths sketched on top of this entity? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetSketchPaths { /// ID of the entity being queried. pub entity_id: Uuid, } /// What is the distance between these two entities? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityGetDistance { /// ID of the first entity being queried. pub entity_id1: Uuid, @@ -348,7 +408,9 @@ define_modeling_cmd_enum! { /// Create a pattern using this entity by specifying the transform for each desired repetition. /// Transformations are performed in the following order (first applied to last applied): scale, rotate, translate. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityLinearPatternTransform { /// ID of the entity being copied. pub entity_id: Uuid, @@ -365,7 +427,9 @@ define_modeling_cmd_enum! { } /// Create a linear pattern using this entity. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityLinearPattern { /// ID of the entity being copied. pub entity_id: Uuid, @@ -378,7 +442,9 @@ define_modeling_cmd_enum! { pub spacing: LengthUnit, } /// Create a circular pattern using this entity. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityCircularPattern { /// ID of the entity being copied. pub entity_id: Uuid, @@ -397,7 +463,9 @@ define_modeling_cmd_enum! { } /// Create a helix using the input cylinder and other specified parameters. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityMakeHelix { /// ID of the cylinder. pub cylinder_id: Uuid, @@ -413,7 +481,9 @@ define_modeling_cmd_enum! { } /// Create a helix using the specified parameters. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityMakeHelixFromParams { /// Radius of the helix. pub radius: f64, @@ -433,7 +503,9 @@ define_modeling_cmd_enum! { } /// Mirror the input entities over the specified axis. (Currently only supports sketches) - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityMirror { /// ID of the mirror entities. pub ids: Vec, @@ -445,9 +517,11 @@ define_modeling_cmd_enum! { /// Mirror the input entities over the specified edge. (Currently only supports sketches) #[derive( - Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, + Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, )] - pub struct EntityMirrorAcrossEdge { + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct EntityMirrorAcrossEdge { /// ID of the mirror entities. pub ids: Vec, /// The edge to use as the mirror axis, must be linear and lie in the plane of the solid @@ -456,7 +530,9 @@ define_modeling_cmd_enum! { /// Modifies the selection by simulating a "mouse click" at the given x,y window coordinate /// Returns ID of whatever was selected. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SelectWithPoint { /// Where in the window was selected pub selected_at_window: Point2d, @@ -465,25 +541,38 @@ define_modeling_cmd_enum! { } /// Adds one or more entities (by UUID) to the selection. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SelectAdd { /// Which entities to select pub entities: Vec, } /// Removes one or more entities (by UUID) from the selection. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SelectRemove { /// Which entities to unselect pub entities: Vec, } /// Removes all of the Objects in the scene - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct SceneClearAll; + #[derive(Debug, Clone, Default, 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 SceneClearAll { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Replaces current selection with these entities (by UUID). - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SelectReplace { /// Which entities to select pub entities: Vec, @@ -491,7 +580,9 @@ define_modeling_cmd_enum! { /// Changes the current highlighted entity to whichever one is at the given window coordinate. /// If there's no entity at this location, clears the highlight. - #[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[derive(Debug, Clone, Copy, 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 HighlightSetEntity { /// Coordinates of the window being clicked pub selected_at_window: Point2d, @@ -503,14 +594,18 @@ define_modeling_cmd_enum! { } /// Changes the current highlighted entity to these entities. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 HighlightSetEntities { /// Highlight these entities. pub entities: Vec, } /// Create a new annotation - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 NewAnnotation { /// What should the annotation contain? pub options: AnnotationOptions, @@ -521,7 +616,9 @@ define_modeling_cmd_enum! { } /// Update an annotation - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 UpdateAnnotation { /// Which annotation to update pub annotation_id: Uuid, @@ -531,14 +628,18 @@ define_modeling_cmd_enum! { } /// Changes visibility of scene-wide edge lines on brep solids - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EdgeLinesVisible { /// Whether or not the edge lines should be hidden. pub hidden: bool, } /// Hide or show an object - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ObjectVisible { /// Which object to change pub object_id: Uuid, @@ -547,14 +648,18 @@ define_modeling_cmd_enum! { } /// Bring an object to the front of the scene - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ObjectBringToFront { /// Which object to change pub object_id: Uuid, } /// Set the material properties of an object - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ObjectSetMaterialParamsPbr { /// Which object to change pub object_id: Uuid, @@ -568,14 +673,18 @@ define_modeling_cmd_enum! { pub ambient_occlusion: f32, } /// What type of entity is this? - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 GetEntityType { /// ID of the entity being queried. pub entity_id: Uuid, } /// Gets all faces which use the given edge. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetAllEdgeFaces { /// Which object is being queried. pub object_id: Uuid, @@ -584,7 +693,9 @@ define_modeling_cmd_enum! { } /// Add a hole to a Solid2d object before extruding it. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid2dAddHole { /// Which object to add the hole to. pub object_id: Uuid, @@ -593,7 +704,9 @@ define_modeling_cmd_enum! { } /// Gets all edges which are opposite the given edge, across all possible faces. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetAllOppositeEdges { /// Which object is being queried. pub object_id: Uuid, @@ -604,7 +717,9 @@ define_modeling_cmd_enum! { } /// Gets the edge opposite the given edge, along the given face. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetOppositeEdge { /// Which object is being queried. pub object_id: Uuid, @@ -615,7 +730,9 @@ define_modeling_cmd_enum! { } /// Gets the next adjacent edge for the given edge, along the given face. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetNextAdjacentEdge { /// Which object is being queried. pub object_id: Uuid, @@ -626,7 +743,9 @@ define_modeling_cmd_enum! { } /// Gets the previous adjacent edge for the given edge, along the given face. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetPrevAdjacentEdge { /// Which object is being queried. pub object_id: Uuid, @@ -637,7 +756,9 @@ define_modeling_cmd_enum! { } /// Gets the shared edge between these two faces if it exists - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dGetCommonEdge { /// Which object is being queried. pub object_id: Uuid, @@ -646,7 +767,9 @@ define_modeling_cmd_enum! { } /// Fillets the given edge with the specified radius. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Solid3dFilletEdge { /// Which object is being filletted. pub object_id: Uuid, @@ -666,14 +789,18 @@ define_modeling_cmd_enum! { } /// Determines whether a brep face is planar and returns its surface-local planar axes if so - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 FaceIsPlanar { /// Which face is being queried. pub object_id: Uuid, } /// Determines a position on a brep face evaluated by parameters u,v - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 FaceGetPosition { /// Which face is being queried. pub object_id: Uuid, @@ -683,14 +810,18 @@ define_modeling_cmd_enum! { } ///Obtains the surface "center of mass" - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 FaceGetCenter { /// Which face is being queried. pub object_id: Uuid, } /// Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 FaceGetGradient { /// Which face is being queried. pub object_id: Uuid, @@ -700,7 +831,9 @@ define_modeling_cmd_enum! { } /// Send object to front or back. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SendObject { /// Which object is being changed. pub object_id: Uuid, @@ -708,7 +841,9 @@ define_modeling_cmd_enum! { pub front: bool, } /// Set opacity of the entity. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntitySetOpacity { /// Which entity is being changed. pub entity_id: Uuid, @@ -719,7 +854,9 @@ define_modeling_cmd_enum! { } /// Fade entity in or out. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EntityFade { /// Which entity is being changed. pub entity_id: Uuid, @@ -731,7 +868,9 @@ define_modeling_cmd_enum! { } /// Make a new plane - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 MakePlane { /// Origin of the plane pub origin: Point3d, @@ -750,7 +889,9 @@ define_modeling_cmd_enum! { } /// Set the color of a plane. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PlaneSetColor { /// Which plane is being changed. pub plane_id: Uuid, @@ -759,14 +900,18 @@ define_modeling_cmd_enum! { } /// Set the current tool. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SetTool { /// What tool should be active. pub tool: SceneToolType, } /// Send a mouse move event - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 MouseMove { /// Where the mouse is pub window: Point2d, @@ -779,7 +924,9 @@ define_modeling_cmd_enum! { /// Send a mouse click event /// Updates modified/selected entities. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 MouseClick { /// Where the mouse is pub window: Point2d, @@ -788,15 +935,31 @@ define_modeling_cmd_enum! { /// Disable sketch mode. /// If you are sketching on a face, be sure to not disable sketch mode until you have extruded. /// Otherwise, your object will not be fused with the face. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct SketchModeDisable; + #[derive(Debug, Clone, Default, 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 SketchModeDisable { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Get the plane for sketch mode. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct GetSketchModePlane; + #[derive(Debug, Clone, Default, 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 GetSketchModePlane { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Get the plane for sketch mode. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CurveSetConstraint { /// Which curve to constrain. pub object_id: Uuid, @@ -807,7 +970,9 @@ define_modeling_cmd_enum! { } /// Sketch on some entity (e.g. a plane, a face). - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 EnableSketchMode { /// Which entity to sketch on. pub entity_id: Uuid, @@ -826,54 +991,80 @@ define_modeling_cmd_enum! { /// Sets whether or not changes to the scene or its objects will be done as a "dry run" /// In a dry run, successful commands won't actually change the model. /// This is useful for catching errors before actually making the change. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct EnableDryRun; + #[derive(Debug, Clone, Default, 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 EnableDryRun { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Sets whether or not changes to the scene or its objects will be done as a "dry run" /// In a dry run, successful commands won't actually change the model. /// This is useful for catching errors before actually making the change. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] - pub struct DisableDryRun; + #[derive(Debug, Clone, Default, 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 DisableDryRun { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Set the background color of the scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SetBackgroundColor { /// The color to set the background to. pub color: Color, } /// Set the properties of the tool lines for the scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SetCurrentToolProperties { /// The color to set the tool line to. pub color: Option, } /// Set the default system properties used when a specific property isn't set. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SetDefaultSystemProperties { /// The default system color. pub color: Option, } /// Get type of the given curve. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CurveGetType { /// Which curve to query. pub curve_id: Uuid, } /// Get control points of the given curve. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CurveGetControlPoints { /// Which curve to query. pub curve_id: Uuid, } /// Enum containing the variety of image formats snapshots may be exported to. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, FromStr, Display)] + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, FromStr, Display)] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum ImageFormat { /// .png format Png, @@ -882,14 +1073,18 @@ define_modeling_cmd_enum! { } /// Take a snapshot of the current view. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 TakeSnapshot { /// What image format to return. pub format: ImageFormat, } /// Add a gizmo showing the axes. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 MakeAxesGizmo { /// If true, axes gizmo will be placed in the corner of the screen. /// If false, it will be placed at the origin of the scene. @@ -899,14 +1094,18 @@ define_modeling_cmd_enum! { } /// Query the given path. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PathGetInfo { /// Which path to query pub path_id: Uuid, } /// Obtain curve ids for vertex ids - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PathGetCurveUuidsForVertices { /// Which path to query pub path_id: Uuid, @@ -916,7 +1115,9 @@ define_modeling_cmd_enum! { } /// Obtain curve id by index - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PathGetCurveUuid { /// Which path to query pub path_id: Uuid, @@ -926,28 +1127,36 @@ define_modeling_cmd_enum! { } /// Obtain vertex ids for a path - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PathGetVertexUuids { /// Which path to query pub path_id: Uuid, } /// Obtain the sketch target id (if the path was drawn in sketchmode) for a path - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PathGetSketchTargetUuid { /// Which path to query pub path_id: Uuid, } /// Start dragging the mouse. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 HandleMouseDragStart { /// The mouse position. pub window: Point2d, } /// Continue dragging the mouse. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 HandleMouseDragMove { /// The mouse position. pub window: Point2d, @@ -959,14 +1168,18 @@ define_modeling_cmd_enum! { } /// Stop dragging the mouse. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 HandleMouseDragEnd { /// The mouse position. pub window: Point2d, } /// Remove scene objects. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 RemoveSceneObjects { /// Objects to remove. pub object_ids: HashSet, @@ -974,7 +1187,9 @@ define_modeling_cmd_enum! { /// Utility method. Performs both a ray cast and projection to plane-local coordinates. /// Returns the plane coordinates for the given window coordinates. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 PlaneIntersectAndProject { /// The plane you're intersecting against. pub plane_id: Uuid, @@ -983,14 +1198,18 @@ define_modeling_cmd_enum! { } /// Find the start and end of a curve. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CurveGetEndPoints { /// ID of the curve being queried. pub curve_id: Uuid, } /// Reconfigure the stream. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ReconfigureStream { /// Width of the stream. pub width: u32, @@ -1005,6 +1224,8 @@ define_modeling_cmd_enum! { /// Import files to the current model. #[derive(Debug, Eq, PartialEq, Clone, 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 ImportFiles { /// Files to import. pub files: Vec, @@ -1014,14 +1235,18 @@ define_modeling_cmd_enum! { /// Set the units of the scene. /// For all following commands, the units will be interpreted as the given units. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SetSceneUnits { /// Which units the scene uses. pub unit: units::UnitLength, } /// Get the mass of entities in the scene or the default scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Mass { /// IDs of the entities to get the mass of. If this is empty, then the default scene is included in /// the mass. @@ -1035,7 +1260,9 @@ define_modeling_cmd_enum! { } /// Get the density of entities in the scene or the default scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Density { /// IDs of the entities to get the density of. If this is empty, then the default scene is included in /// the density. @@ -1049,7 +1276,9 @@ define_modeling_cmd_enum! { } /// Get the volume of entities in the scene or the default scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 Volume { /// IDs of the entities to get the volume of. If this is empty, then the default scene is included in /// the volume. @@ -1059,7 +1288,9 @@ define_modeling_cmd_enum! { } /// Get the center of mass of entities in the scene or the default scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 CenterOfMass { /// IDs of the entities to get the center of mass of. If this is empty, then the default scene is included in /// the center of mass. @@ -1069,7 +1300,9 @@ define_modeling_cmd_enum! { } /// Get the surface area of entities in the scene or the default scene. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 SurfaceArea { /// IDs of the entities to get the surface area of. If this is empty, then the default scene is included in /// the surface area. @@ -1080,16 +1313,20 @@ define_modeling_cmd_enum! { /// Focus the default camera upon an object in the scene. #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct DefaultCameraFocusOn { /// UUID of object to focus on. pub uuid: Uuid, } /// When you select some entity with the current tool, what should happen to the entity? #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct SetSelectionType { /// What type of selection should occur when you select something? pub selection_type: SceneSelectionType, @@ -1097,8 +1334,10 @@ define_modeling_cmd_enum! { /// What kind of entities can be selected? #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct SetSelectionFilter { /// If vector is empty, clear all filters. /// If vector is non-empty, only the given entity types will be selectable. @@ -1107,14 +1346,23 @@ define_modeling_cmd_enum! { /// Use orthographic projection. #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] - pub struct DefaultCameraSetOrthographic; + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct DefaultCameraSetOrthographic { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Use perspective projection. #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct DefaultCameraSetPerspective { /// If this is not given, use the same parameters as last time the perspective camera was used. pub parameters: Option, @@ -1123,8 +1371,10 @@ define_modeling_cmd_enum! { ///Updates the camera to center to the center of the current selection ///(or the origin if nothing is selected) #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct DefaultCameraCenterToSelection { /// Dictates whether or not the camera position should be adjusted during this operation /// If no movement is requested, the camera will orbit around the new center from its current position @@ -1134,8 +1384,10 @@ define_modeling_cmd_enum! { ///Updates the camera to center to the center of the current scene's bounds #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct DefaultCameraCenterToScene { /// Dictates whether or not the camera position should be adjusted during this operation /// If no movement is requested, the camera will orbit around the new center from its current position @@ -1144,7 +1396,9 @@ define_modeling_cmd_enum! { } /// Fit the view to the specified object(s). - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ZoomToFit { /// Which objects to fit camera to; if empty, fit to all non-default objects. Defaults to empty vector. #[serde(default = "default_uuid_vector")] @@ -1161,7 +1415,9 @@ define_modeling_cmd_enum! { } /// Fit the view to the scene with an isometric view. - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)] + #[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 ViewIsometric { /// How much to pad the view frame by, as a fraction of the object(s) bounding box size. /// Negative padding will crop the view of the object proportionally. @@ -1172,7 +1428,9 @@ define_modeling_cmd_enum! { } /// Get a concise description of all of an extrusion's faces. - #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Solid3dGetExtrusionFaceInfo { /// The Solid3d object whose extrusion is being queried. pub object_id: Uuid, @@ -1181,24 +1439,45 @@ define_modeling_cmd_enum! { } /// Clear the selection - #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, - )] - pub struct SelectClear; + #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct SelectClear { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Find all IDs of selected entities - #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] - pub struct SelectGet; + #[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct SelectGet { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Get the number of objects in the scene #[derive( - Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, )] - pub struct GetNumObjects; + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct GetNumObjects { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + } /// Make a new path by offsetting an object by a given distance. /// The new path's ID will be the ID of this command. - #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct MakeOffsetPath { /// The object that will be offset (can be a path, sketch, or a solid) pub object_id: Uuid, @@ -1213,7 +1492,9 @@ define_modeling_cmd_enum! { } /// Add a hole to a closed path by offsetting it a uniform distance inward. - #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct AddHoleFromOffset { /// The closed path to add a hole to. pub object_id: Uuid, @@ -1251,6 +1532,8 @@ impl ModelingCmd { /// If you are sending binary data for a file, be sure to send the WebSocketRequest as /// binary/bson, not text/json. #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct ImportFile { /// The file's full path, including file extension. pub path: String, diff --git a/modeling-cmds/src/format/fbx.rs b/modeling-cmds/src/format/fbx.rs index cc664aa5..a46b6f03 100644 --- a/modeling-cmds/src/format/fbx.rs +++ b/modeling-cmds/src/format/fbx.rs @@ -24,6 +24,8 @@ pub mod import { )] #[display("")] #[serde(rename = "FbxImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options {} } @@ -34,6 +36,8 @@ pub mod export { /// Options for exporting FBX. #[derive(Clone, Debug, Default, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename = "FbxExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Specifies which kind of FBX will be exported. pub storage: Storage, @@ -80,6 +84,8 @@ pub mod export { )] #[display(style = "snake_case")] #[serde(rename = "FbxStorage", rename_all = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Storage { /// ASCII FBX encoding. Ascii, diff --git a/modeling-cmds/src/format/gltf.rs b/modeling-cmds/src/format/gltf.rs index e9ea9627..857d5cd6 100644 --- a/modeling-cmds/src/format/gltf.rs +++ b/modeling-cmds/src/format/gltf.rs @@ -24,6 +24,8 @@ pub mod import { )] #[display("")] #[serde(rename = "GltfImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options {} } @@ -34,6 +36,8 @@ pub mod export { #[derive(Default, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("storage: {storage}, presentation: {presentation}")] #[serde(rename = "GltfExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Specifies which kind of glTF 2.0 will be exported. pub storage: Storage, @@ -47,6 +51,8 @@ pub mod export { )] #[display(style = "snake_case")] #[serde(rename = "GltfStorage", rename_all = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Storage { /// Binary glTF 2.0. /// @@ -75,6 +81,8 @@ pub mod export { )] #[display(style = "snake_case")] #[serde(rename = "GltfPresentation", rename_all = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Presentation { /// Condense the JSON into the smallest possible size. Compact, diff --git a/modeling-cmds/src/format/mod.rs b/modeling-cmds/src/format/mod.rs index 4d04a56f..df404138 100644 --- a/modeling-cmds/src/format/mod.rs +++ b/modeling-cmds/src/format/mod.rs @@ -27,6 +27,8 @@ pub mod sldprt; #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[serde(tag = "type", rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum OutputFormat { /// Autodesk Filmbox (FBX) format. #[display("{}: {0}")] @@ -55,6 +57,8 @@ pub enum OutputFormat { #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[serde(tag = "type", rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum InputFormat { /// Autodesk Filmbox (FBX) format. #[display("{}: {0}")] @@ -85,6 +89,8 @@ pub enum InputFormat { #[derive(Clone, Debug, Default, Display, Eq, FromStr, Hash, PartialEq, JsonSchema, Deserialize, Serialize)] #[display(style = "snake_case")] #[serde(rename_all = "snake_case", tag = "type")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Selection { /// Visit the default scene. #[default] diff --git a/modeling-cmds/src/format/obj.rs b/modeling-cmds/src/format/obj.rs index d922bf4f..5f609078 100644 --- a/modeling-cmds/src/format/obj.rs +++ b/modeling-cmds/src/format/obj.rs @@ -15,6 +15,8 @@ pub mod import { )] #[display("coords: {coords}, units: {units}")] #[serde(rename = "ObjImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of input data. /// @@ -48,6 +50,8 @@ pub mod export { #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("coords: {coords}, units: {units}")] #[serde(rename = "ObjExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of output data. /// diff --git a/modeling-cmds/src/format/ply.rs b/modeling-cmds/src/format/ply.rs index d45293db..006cec0a 100644 --- a/modeling-cmds/src/format/ply.rs +++ b/modeling-cmds/src/format/ply.rs @@ -15,6 +15,8 @@ pub mod import { )] #[display("coords: {coords}, units: {units}")] #[serde(rename = "PlyImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of input data. /// @@ -48,6 +50,8 @@ pub mod export { #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("coords: {coords}, selection: {selection}, storage: {storage}, units: {units}")] #[serde(rename = "PlyExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of output data. /// @@ -83,6 +87,8 @@ pub mod export { #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr, Default)] #[display(style = "snake_case")] #[serde(rename = "PlyStorage", rename_all = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Storage { /// Write numbers in their ascii representation (e.g. -13, 6.28, etc.). Properties are separated by spaces and elements are separated by line breaks. #[default] diff --git a/modeling-cmds/src/format/sldprt.rs b/modeling-cmds/src/format/sldprt.rs index 78a0cc0f..aaba58ca 100644 --- a/modeling-cmds/src/format/sldprt.rs +++ b/modeling-cmds/src/format/sldprt.rs @@ -22,6 +22,8 @@ pub mod import { )] #[display("split_closed_faces: {split_closed_faces}")] #[serde(default, rename = "SldprtImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Splits all closed faces into two open faces. /// diff --git a/modeling-cmds/src/format/step.rs b/modeling-cmds/src/format/step.rs index 2c599ade..20f3c0f7 100644 --- a/modeling-cmds/src/format/step.rs +++ b/modeling-cmds/src/format/step.rs @@ -25,6 +25,8 @@ pub mod import { )] #[display("split_closed_faces: {split_closed_faces}")] #[serde(default, rename = "StepImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Splits all closed faces into two open faces. /// @@ -40,6 +42,8 @@ pub mod export { /// Options for exporting STEP format. #[derive(Clone, Debug, Deserialize, Eq, Hash, JsonSchema, PartialEq, Serialize)] #[serde(rename = "StepExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of output data. /// diff --git a/modeling-cmds/src/format/stl.rs b/modeling-cmds/src/format/stl.rs index c3631947..a719b998 100644 --- a/modeling-cmds/src/format/stl.rs +++ b/modeling-cmds/src/format/stl.rs @@ -15,6 +15,8 @@ pub mod import { )] #[display("coords: {coords}, units: {units}")] #[serde(rename = "StlImportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of input data. /// @@ -47,6 +49,8 @@ pub mod export { #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, JsonSchema, Display, FromStr)] #[display("coords: {coords}, selection: {selection}, storage: {storage}, units: {units}")] #[serde(rename = "StlExportOptions")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Options { /// Co-ordinate system of output data. /// @@ -84,6 +88,8 @@ pub mod export { )] #[display(style = "snake_case")] #[serde(rename = "StlStorage", rename_all = "snake_case")] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum Storage { /// Plaintext encoding. Ascii, diff --git a/modeling-cmds/src/id.rs b/modeling-cmds/src/id.rs index 476f82e3..ae8a298b 100644 --- a/modeling-cmds/src/id.rs +++ b/modeling-cmds/src/id.rs @@ -7,6 +7,8 @@ use uuid::Uuid; /// All commands have unique IDs. These should be randomly generated. #[derive(Debug, Clone, Copy, Hash, Ord, PartialOrd, Eq, PartialEq, JsonSchema, Serialize)] #[cfg_attr(test, derive(Default))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct ModelingCmdId(pub Uuid); impl AsRef for ModelingCmdId { diff --git a/modeling-cmds/src/length_unit.rs b/modeling-cmds/src/length_unit.rs index 2a4fb56d..2fb6213a 100644 --- a/modeling-cmds/src/length_unit.rs +++ b/modeling-cmds/src/length_unit.rs @@ -7,6 +7,8 @@ use crate::shared::{Point2d, Point3d, Point4d}; /// A length unit is wrapper around an f64 that represents a length in some unit. #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, Default)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct LengthUnit(pub f64); impl LengthUnit { diff --git a/modeling-cmds/src/shared.rs b/modeling-cmds/src/shared.rs index 2fa1dada..8b8521a7 100644 --- a/modeling-cmds/src/shared.rs +++ b/modeling-cmds/src/shared.rs @@ -13,8 +13,10 @@ pub use point::{Point2d, Point3d, Point4d, Quaternion}; mod point; /// What kind of cut to do -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum CutType { /// Round off an edge. #[default] @@ -24,8 +26,10 @@ pub enum CutType { } /// A rotation defined by an axis, origin of rotation, and an angle. -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Rotation { /// Rotation axis. /// Defaults to (0, 0, 1) (i.e. the Z axis). @@ -49,8 +53,10 @@ impl Default for Rotation { } /// Ways to transform each solid being replicated in a repeating pattern. -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Transform { /// Translate the replica this far along each dimension. /// Defaults to zero vector (i.e. same position as the original). @@ -81,8 +87,10 @@ impl Default for Transform { } /// Options for annotations -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct AnnotationOptions { /// Text displayed on the annotation pub text: Option, @@ -97,8 +105,10 @@ pub struct AnnotationOptions { } /// Options for annotation text -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct AnnotationLineEndOptions { /// How to style the start of the annotation line. pub start: AnnotationLineEnd, @@ -107,8 +117,10 @@ pub struct AnnotationLineEndOptions { } /// Options for annotation text -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct AnnotationTextOptions { /// Alignment along the X axis pub x: AnnotationTextAlignmentX, @@ -123,11 +135,18 @@ pub struct AnnotationTextOptions { /// The type of distance /// Distances can vary depending on /// the objects used as input. -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "snake_case", tag = "type")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum DistanceType { /// Euclidean Distance. - Euclidean {}, + Euclidean { + #[cfg(feature = "ts-rs")] + /// Work around issue with ts-rs not allowing tag on an empty variant. + #[serde(default, skip)] + _fix_ts_rs: (), + }, /// The distance between objects along the specified axis OnAxis { /// Global axis @@ -136,8 +155,10 @@ pub enum DistanceType { } /// The type of origin -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema, Default)] #[serde(rename_all = "snake_case", tag = "type")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum OriginType { /// Local Origin (center of object bounding box). #[default] @@ -152,7 +173,9 @@ pub enum OriginType { } /// An RGBA color -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, JsonSchema)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Color { /// Red pub r: f32, @@ -170,6 +193,8 @@ pub struct Color { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum AnnotationTextAlignmentX { Left, Center, @@ -182,6 +207,8 @@ pub enum AnnotationTextAlignmentX { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum AnnotationTextAlignmentY { Bottom, Center, @@ -194,6 +221,8 @@ pub enum AnnotationTextAlignmentY { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum AnnotationLineEnd { None, Arrow, @@ -204,6 +233,8 @@ pub enum AnnotationLineEnd { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum AnnotationType { /// 2D annotation type (screen or planar space) T2D, @@ -216,6 +247,8 @@ pub enum AnnotationType { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum CameraDragInteractionType { /// Camera pan Pan, @@ -231,6 +264,8 @@ pub enum CameraDragInteractionType { /// Paths are composed of many segments. #[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)] #[serde(rename_all = "snake_case", tag = "type")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum PathSegment { /// A straight line segment. /// Goes from the current path "pen" to the given endpoint. @@ -298,6 +333,8 @@ pub enum PathSegment { /// An angle, with a specific unit. #[derive(Clone, Copy, PartialEq, Debug, JsonSchema, Deserialize, Serialize)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Angle { /// What unit is the measurement? pub unit: UnitAngle, @@ -400,6 +437,8 @@ impl std::ops::AddAssign for Angle { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum SceneSelectionType { /// Replaces the selection Replace, @@ -415,6 +454,8 @@ pub enum SceneSelectionType { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum SceneToolType { CameraRevolve, Select, @@ -444,6 +485,8 @@ pub enum SceneToolType { Default, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum PathComponentConstraintBound { #[default] Unconstrained, @@ -470,6 +513,8 @@ pub enum PathComponentConstraintBound { Default, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum PathComponentConstraintType { #[default] Unconstrained, @@ -486,6 +531,8 @@ pub enum PathComponentConstraintType { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum PathCommand { MoveTo, LineTo, @@ -500,6 +547,8 @@ pub enum PathCommand { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[repr(u8)] pub enum EntityType { Entity, @@ -520,6 +569,8 @@ pub enum EntityType { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum CurveType { Line, Arc, @@ -541,6 +592,8 @@ pub struct ExportFile { )] #[serde(rename_all = "lowercase")] #[display(style = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum FileExportFormat { /// Autodesk Filmbox (FBX) format. Fbx, @@ -580,6 +633,8 @@ pub enum FileExportFormat { )] #[serde(rename_all = "lowercase")] #[display(style = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum FileImportFormat { /// Autodesk Filmbox (FBX) format. Fbx, @@ -602,6 +657,8 @@ pub enum FileImportFormat { /// The type of error sent by the KittyCAD graphics engine. #[derive(Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, Ord, PartialOrd)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum EngineErrorCode { /// User requested something geometrically or graphically impossible. /// Don't retry this request, as it's inherently impossible. Instead, read the error message @@ -621,7 +678,9 @@ impl From for http::StatusCode { } /// IDs for the extruded faces. -#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] +#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema, Clone)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct ExtrudedFaceInfo { /// The face made from the original 2D shape being extruded. /// If the solid is extruded from a shape which already has an ID @@ -635,7 +694,9 @@ pub struct ExtrudedFaceInfo { } /// IDs for a side face, extruded from the path of some sketch/2D shape. -#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] +#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema, Clone)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct SideFace { /// ID of the path this face is being extruded from. pub path_id: Uuid, @@ -645,6 +706,8 @@ pub struct SideFace { /// Camera settings including position, center, fov etc #[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct CameraSettings { ///Camera position (vantage) pub pos: Point3d, @@ -702,6 +765,8 @@ impl From for crate::output::ViewIsometric { /// Defines a perspective view. #[derive(Copy, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Clone, PartialOrd, Default)] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct PerspectiveCameraParameters { /// Camera frustum vertical field of view. pub fov_y: Option, @@ -729,6 +794,8 @@ pub struct PerspectiveCameraParameters { PartialOrd, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum CameraMovement { /// Adjusts the camera position during the camera operation #[default] @@ -742,6 +809,8 @@ pub enum CameraMovement { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum GlobalAxis { /// The X axis X, @@ -756,6 +825,8 @@ pub enum GlobalAxis { Display, FromStr, Copy, Eq, PartialEq, Debug, JsonSchema, Deserialize, Serialize, Sequence, Clone, Ord, PartialOrd, )] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[repr(u8)] pub enum ExtrusionFaceCapType { /// Uncapped. @@ -787,6 +858,8 @@ pub enum ExtrusionFaceCapType { Default, )] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum PostEffectType { Phosphor, Ssao, diff --git a/modeling-cmds/src/shared/point.rs b/modeling-cmds/src/shared/point.rs index b6b23f51..b9b475d1 100644 --- a/modeling-cmds/src/shared/point.rs +++ b/modeling-cmds/src/shared/point.rs @@ -10,6 +10,8 @@ mod zero; #[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, Default)] #[serde(rename = "Point2d")] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Point2d { #[allow(missing_docs)] pub x: T, @@ -56,6 +58,8 @@ impl Point2d { #[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq, Default)] #[serde(rename = "Point3d")] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Point3d { #[allow(missing_docs)] pub x: T, @@ -113,6 +117,8 @@ impl Point3d { #[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema)] #[serde(rename = "Point4d")] #[serde(rename_all = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub struct Point4d { #[allow(missing_docs)] pub x: T, diff --git a/modeling-cmds/src/units.rs b/modeling-cmds/src/units.rs index a63acd24..47b3ef13 100644 --- a/modeling-cmds/src/units.rs +++ b/modeling-cmds/src/units.rs @@ -23,6 +23,8 @@ use serde::{Deserialize, Serialize}; )] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitLength { /// Centimeters #[serde(rename = "cm")] @@ -84,6 +86,8 @@ impl UnitLength { #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitAngle { /// Degrees Degrees, @@ -112,6 +116,8 @@ pub enum UnitAngle { #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitArea { /// Square centimeters #[serde(rename = "cm2")] @@ -184,6 +190,8 @@ impl UnitArea { )] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitDensity { /// Pounds per cubic feet. #[serde(rename = "lb:ft3")] @@ -228,6 +236,8 @@ impl UnitDensity { #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[serde(rename_all = "snake_case")] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitMass { /// Grams #[default] @@ -275,6 +285,8 @@ impl UnitMass { )] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] #[display(style = "snake_case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] pub enum UnitVolume { /// Cubic centimeters (cc or cm³) #[serde(rename = "cm3")] diff --git a/modeling-session/examples/cube_png.rs b/modeling-session/examples/cube_png.rs index c31d3f00..625de92d 100644 --- a/modeling-session/examples/cube_png.rs +++ b/modeling-session/examples/cube_png.rs @@ -44,7 +44,7 @@ async fn main() -> Result<()> { let path_id = Uuid::new_v4(); let path = path_id.into(); session - .run_command(path, ModelingCmd::StartPath(StartPath {})) + .run_command(path, ModelingCmd::StartPath(StartPath::default())) .await .context("could not create path")?; diff --git a/modeling-session/examples/cube_png_batch.rs b/modeling-session/examples/cube_png_batch.rs index 4fd3340f..210459b8 100644 --- a/modeling-session/examples/cube_png_batch.rs +++ b/modeling-session/examples/cube_png_batch.rs @@ -45,7 +45,7 @@ async fn main() -> Result<()> { let path_id = Uuid::new_v4(); let path = path_id.into(); session - .run_command(path, StartPath {}.into()) + .run_command(path, StartPath::default().into()) .await .context("could not create path")?; diff --git a/modeling-session/examples/lsystem_png_batch.rs b/modeling-session/examples/lsystem_png_batch.rs index c2a8a265..842ee4cc 100644 --- a/modeling-session/examples/lsystem_png_batch.rs +++ b/modeling-session/examples/lsystem_png_batch.rs @@ -52,7 +52,7 @@ async fn main() -> Result<()> { let path_id = Uuid::new_v4(); let path = path_id.into(); session - .run_command(path, ModelingCmd::from(StartPath {})) + .run_command(path, ModelingCmd::from(StartPath::default())) .await .context("could not create path")?; From ce17180e1b4f45328ee081c6844c782feffa4bdd Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 6 Jan 2025 14:11:02 -0500 Subject: [PATCH 17/18] Fix cargo lock (#710) --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1eaf2633..1b4bb94e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4369,7 +4369,7 @@ checksum = "0e9d8656589772eeec2cf7a8264d9cda40fb28b9bc53118ceb9e8c07f8f38730" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "termcolor", ] From d87e394f57094f64d82990794acc23aaa1340530 Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 6 Jan 2025 19:54:50 -0500 Subject: [PATCH 18/18] Release modeling-cmds 0.2.86 (#711) --- Cargo.lock | 2 +- modeling-cmds/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b4bb94e..fcce02c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1957,7 +1957,7 @@ dependencies = [ [[package]] name = "kittycad-modeling-cmds" -version = "0.2.85" +version = "0.2.86" dependencies = [ "anyhow", "bson", diff --git a/modeling-cmds/Cargo.toml b/modeling-cmds/Cargo.toml index f136385d..d0976586 100644 --- a/modeling-cmds/Cargo.toml +++ b/modeling-cmds/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kittycad-modeling-cmds" -version = "0.2.85" +version = "0.2.86" edition = "2021" authors = ["KittyCAD, Inc."] description = "Commands in the KittyCAD Modeling API"