Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,18 @@
}
}
},
"CompressionType": {
"description": "Compression requested for a binary command response. Small or incompressible responses may remain uncompressed.",
"oneOf": [
{
"description": "Zstandard framing, detected by magic bytes `28 b5 2f fd`, around the complete MessagePack response.",
"type": "string",
"enum": [
"zstd"
]
}
]
},
"CutStrategy": {
"description": "What strategy (algorithm) should be used for cutting? Defaults to Automatic.",
"oneOf": [
Expand Down Expand Up @@ -4239,6 +4251,15 @@
"description": "Export the scene to a file.\n\nThe response is a MsgPack-encoded message in a WebSocket binary frame.",
"type": "object",
"properties": {
"compression": {
"nullable": true,
"description": "Optional compression for the binary response. Defaults to uncompressed.",
"allOf": [
{
"$ref": "#/components/schemas/CompressionType"
}
]
},
"entity_ids": {
"description": "IDs of the entities to be exported. If this is empty, then all entities are exported.",
"type": "array",
Expand Down
3 changes: 3 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ define_modeling_cmd_enum! {
/// KCL source to embed in formats that support source metadata.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kcl_source: Option<KclProject>,
/// Optional compression for the binary response. Defaults to uncompressed.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub compression: Option<crate::shared::CompressionType>,
}

/// Export the scene to a file.
Expand Down
12 changes: 12 additions & 0 deletions modeling-cmds/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ pub mod safe_filepath;

pub use crate::kcl_project::{KclFile, KclFileBuilder, KclProject, KclProjectBuilder};

/// Compression requested for a binary command response. Small or incompressible responses may remain uncompressed.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "Compression.ts"))]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub enum CompressionType {
/// Zstandard framing, detected by magic bytes `28 b5 2f fd`, around the complete MessagePack response.
Zstd,
}

/// Default tolerance values for modeling operations.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, Builder)]
#[serde(rename_all = "snake_case")]
Expand Down
Loading