Skip to content

Commit

Permalink
Add 'export' command back in (#774)
Browse files Browse the repository at this point in the history
Accidentally made a change to the JSON API which is not backwards compatible. Reverting it.
  • Loading branch information
adamchalmers authored Feb 25, 2025
1 parent bcd3c11 commit 2810f8a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modeling-cmds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kittycad-modeling-cmds"
version = "0.2.99"
version = "0.2.100"
edition = "2021"
authors = ["KittyCAD, Inc."]
description = "Commands in the KittyCAD Modeling API"
Expand Down
15 changes: 11 additions & 4 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,6 @@ define_modeling_cmd_enum! {
pub magnitude: f32,
}

/// Alias for backward compatibility.
#[deprecated(since = "0.2.96", note = "use `Export3d` instead")]
pub type Export = Export3d;

/// Export a sketch to a file.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
Expand All @@ -352,6 +348,17 @@ define_modeling_cmd_enum! {
pub format: OutputFormat3d,
}

/// Export the scene to a file.
#[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<Uuid>,
/// The file format to export to.
pub format: OutputFormat3d,
}

/// What is this entity's parent?
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
Expand Down
11 changes: 7 additions & 4 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,6 @@ define_ok_modeling_cmd_response_enum! {
pub struct SelectClear {
}

/// Alias for backward compatibility.
#[deprecated(since = "0.2.96", note = "use `Export3d` instead")]
pub type Export = Export3d;

/// The response from the `Export2d` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct Export2d {
Expand All @@ -311,6 +307,13 @@ define_ok_modeling_cmd_response_enum! {
pub files: Vec<ExportFile>,
}

/// The response from the `Export` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct Export {
/// The files that were exported.
pub files: Vec<ExportFile>,
}

/// The response from the `SelectWithPoint` command.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
pub struct SelectWithPoint {
Expand Down

0 comments on commit 2810f8a

Please sign in to comment.