Skip to content

Commit 341e51d

Browse files
Update api spec (#868)
* YOYO NEW API SPEC! * u[dates Signed-off-by: Jessie Frazelle <[email protected]> --------- Signed-off-by: Jessie Frazelle <[email protected]> Co-authored-by: zoo-github-actions-auth[bot] <zoo-github-actions-auth[bot]@users.noreply.github.com> Co-authored-by: Jessie Frazelle <[email protected]>
1 parent ece209e commit 341e51d

File tree

6 files changed

+282
-78
lines changed

6 files changed

+282
-78
lines changed

Cargo.lock

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kittycad/Cargo.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,53 @@ license = "MIT"
1010

1111
[dependencies]
1212
anyhow = "1"
13-
async-trait = { version = "^0.1.53", optional = true }
13+
async-trait = { version = "^0.1", optional = true }
1414
base64 = "0.22"
1515
bigdecimal = { version = "0.4", features = ["serde"] }
1616
bytes = { version = "1", features = ["serde"] }
17-
clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true }
18-
data-encoding = "^2.3.2"
19-
dirs = { version = "^5.0.1", optional = true }
17+
clap = { version = "4", features = ["cargo", "derive", "env", "unicode"], optional = true }
18+
data-encoding = "^2"
19+
dirs = { version = "^5", optional = true }
2020
format_serde_error = { version = "^0.3.0", optional = true }
21-
futures = { version = "0.3.26", optional = true }
21+
futures = { version = "0.3", optional = true }
2222
http = { version = "1", optional = true }
23-
itertools = "0.13.0"
23+
itertools = "0.14"
2424
log = { version = "^0.4", features = ["serde"], optional = true }
25-
mime_guess = "2.0.4"
26-
parse-display = "0.10.0"
27-
phonenumber = "0.3.5"
25+
mime_guess = "2"
26+
parse-display = "0.10"
27+
phonenumber = "0.3"
2828
rand = { version = "0.9", optional = true }
2929
getrandom = { version = "0.3" }
30-
reqwest = { version = "0.12.14", default-features = false, features = ["json", "multipart"], optional = true }
30+
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart"], optional = true }
3131
reqwest-conditional-middleware = { version = "0.4", optional = true }
3232
reqwest-middleware = { version = "0.4", optional = true, features = ["json", "multipart", "http2"] }
3333
reqwest-retry = { version = "0.7", optional = true }
3434
reqwest-tracing = { version = "0.5.4", features = ["opentelemetry_0_24"], optional = true }
35-
schemars = { version = "0.8.17", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }
35+
schemars = { version = "0.8", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] }
3636
serde = { version = "1", features = ["derive"] }
3737
serde_bytes = "0.11"
3838
serde_json = "1"
3939
serde_urlencoded = { version = "^0.7", optional = true }
40-
tabled = { version = "0.20.0", features = ["ansi"], optional = true }
40+
tabled = { version = "0.20", features = ["ansi"], optional = true }
4141
thiserror = "2"
4242
tracing = { version = "^0.1", optional = true }
4343
url = { version = "2", features = ["serde"] }
4444
uuid = { version = "1", features = ["serde", "v4", "v7"] }
4545

4646
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
4747
chrono = { version = "0.4", default-features = false, features = ["now", "serde", "std"] }
48-
tokio = { version = "1.38.0", features = ["rt", "macros"] }
48+
tokio = { version = "1", features = ["rt", "macros"] }
4949

5050
[target.'cfg(target_arch = "wasm32")'.dependencies]
5151
chrono = { version = "0.4", default-features = false, features = ["serde", "std"] }
5252

5353
[dev-dependencies]
5454
expectorate = "1"
55-
futures-util = "^0.3.26"
55+
futures-util = "^0.3"
5656
pretty_assertions = "1"
5757
rand = "0.9"
58-
tokio = { version = "1.38.0", features = ["rt", "macros"] }
59-
tokio-tungstenite = "0.24"
58+
tokio = { version = "1", features = ["rt", "macros"] }
59+
tokio-tungstenite = "0.27"
6060

6161
[features]
6262
default = ["requests", "retry", "default-tls"]

kittycad/src/tests.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ async fn test_modeling_websocket() {
341341
cmd: ModelingCmd::StartPath {},
342342
cmd_id: path_id,
343343
})
344-
.unwrap(),
344+
.unwrap()
345+
.into(),
345346
))
346347
.await
347348
.unwrap();
@@ -378,7 +379,8 @@ async fn test_modeling_websocket() {
378379
},
379380
cmd_id: Uuid::new_v4(),
380381
})
381-
.unwrap(),
382+
.unwrap()
383+
.into(),
382384
))
383385
.await
384386
.unwrap();

kittycad/src/types.rs

Lines changed: 82 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8905,6 +8905,12 @@ pub struct Invoice {
89058905
to display that invoice as unpaid to your users."]
89068906
#[serde(default)]
89078907
pub attempted: bool,
8908+
#[doc = "Why this invoice was created (e.g. `subscription_cycle`)."]
8909+
#[serde(default, skip_serializing_if = "Option::is_none")]
8910+
pub billing_reason: Option<String>,
8911+
#[doc = "Invoice collection method as returned by Stripe."]
8912+
#[serde(default, skip_serializing_if = "Option::is_none")]
8913+
pub collection_method: Option<String>,
89088914
#[doc = "Time at which the object was created."]
89098915
pub created_at: chrono::DateTime<chrono::Utc>,
89108916
#[doc = "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), \
@@ -8948,9 +8954,6 @@ pub struct Invoice {
89488954
balance."]
89498955
#[serde(default)]
89508956
pub paid: bool,
8951-
#[doc = "Identifier for the payment intent backing this invoice."]
8952-
#[serde(default, skip_serializing_if = "Option::is_none")]
8953-
pub payment_intent_id: Option<String>,
89548957
#[doc = "The link to download the PDF for the invoice."]
89558958
#[serde(default, skip_serializing_if = "Option::is_none")]
89568959
pub pdf: Option<String>,
@@ -8964,6 +8967,9 @@ pub struct Invoice {
89648967
`void`."]
89658968
#[serde(default, skip_serializing_if = "Option::is_none")]
89668969
pub status: Option<InvoiceStatus>,
8970+
#[doc = "Subscription ID tied to this invoice, when available."]
8971+
#[serde(default, skip_serializing_if = "Option::is_none")]
8972+
pub subscription_id: Option<String>,
89678973
#[doc = "Total of all subscriptions, invoice items, and prorations on the invoice before any \
89688974
invoice level discount or tax is applied.\n\nItem discounts are already incorporated."]
89698975
#[serde(default, skip_serializing_if = "Option::is_none")]
@@ -8993,7 +8999,7 @@ impl std::fmt::Display for Invoice {
89938999

89949000
#[cfg(feature = "tabled")]
89959001
impl tabled::Tabled for Invoice {
8996-
const LENGTH: usize = 26;
9002+
const LENGTH: usize = 28;
89979003
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
89989004
vec![
89999005
if let Some(amount_due) = &self.amount_due {
@@ -9017,6 +9023,16 @@ impl tabled::Tabled for Invoice {
90179023
String::new().into()
90189024
},
90199025
format!("{:?}", self.attempted).into(),
9026+
if let Some(billing_reason) = &self.billing_reason {
9027+
format!("{:?}", billing_reason).into()
9028+
} else {
9029+
String::new().into()
9030+
},
9031+
if let Some(collection_method) = &self.collection_method {
9032+
format!("{:?}", collection_method).into()
9033+
} else {
9034+
String::new().into()
9035+
},
90209036
format!("{:?}", self.created_at).into(),
90219037
if let Some(currency) = &self.currency {
90229038
format!("{:?}", currency).into()
@@ -9069,11 +9085,6 @@ impl tabled::Tabled for Invoice {
90699085
String::new().into()
90709086
},
90719087
format!("{:?}", self.paid).into(),
9072-
if let Some(payment_intent_id) = &self.payment_intent_id {
9073-
format!("{:?}", payment_intent_id).into()
9074-
} else {
9075-
String::new().into()
9076-
},
90779088
if let Some(pdf) = &self.pdf {
90789089
format!("{:?}", pdf).into()
90799090
} else {
@@ -9094,6 +9105,11 @@ impl tabled::Tabled for Invoice {
90949105
} else {
90959106
String::new().into()
90969107
},
9108+
if let Some(subscription_id) = &self.subscription_id {
9109+
format!("{:?}", subscription_id).into()
9110+
} else {
9111+
String::new().into()
9112+
},
90979113
if let Some(subtotal) = &self.subtotal {
90989114
format!("{:?}", subtotal).into()
90999115
} else {
@@ -9124,6 +9140,8 @@ impl tabled::Tabled for Invoice {
91249140
"amount_remaining".into(),
91259141
"attempt_count".into(),
91269142
"attempted".into(),
9143+
"billing_reason".into(),
9144+
"collection_method".into(),
91279145
"created_at".into(),
91289146
"currency".into(),
91299147
"customer_email".into(),
@@ -9136,11 +9154,11 @@ impl tabled::Tabled for Invoice {
91369154
"metadata".into(),
91379155
"number".into(),
91389156
"paid".into(),
9139-
"payment_intent_id".into(),
91409157
"pdf".into(),
91419158
"receipt_number".into(),
91429159
"statement_descriptor".into(),
91439160
"status".into(),
9161+
"subscription_id".into(),
91449162
"subtotal".into(),
91459163
"tax".into(),
91469164
"total".into(),
@@ -10338,10 +10356,10 @@ pub enum MlCopilotSupportedModels {
1033810356
#[serde(rename = "gpt5")]
1033910357
#[display("gpt5")]
1034010358
Gpt5,
10341-
#[doc = "o3"]
10342-
#[serde(rename = "o3")]
10343-
#[display("o3")]
10344-
O3,
10359+
#[doc = "o3-mini"]
10360+
#[serde(rename = "o3_mini")]
10361+
#[display("o3_mini")]
10362+
O3Mini,
1034510363
}
1034610364

1034710365
#[doc = "The type of system command that can be sent to the ML Copilot."]
@@ -12157,6 +12175,20 @@ pub enum ModelingCmd {
1215712175
entity types will be selectable."]
1215812176
filter: Vec<EntityType>,
1215912177
},
12178+
#[doc = "Get the ids of a given entity type."]
12179+
#[serde(rename = "scene_get_entity_ids")]
12180+
SceneGetEntityIds {
12181+
#[doc = "The entity types to be queried."]
12182+
filter: Vec<EntityType>,
12183+
#[doc = "Skip the first n returned ids. If multiple filters are provided, this skip will \
12184+
apply to each filter individually."]
12185+
skip: u32,
12186+
#[doc = "Take n ids after any ids skipped. This value must be greater than zero and not \
12187+
exceed 1000. If multiple filters are provided, this take will apply to each \
12188+
filter individually. If there are fewer than `take` items of the provided filter \
12189+
type then the returned list's length will be the smaller value."]
12190+
take: u32,
12191+
},
1216012192
#[doc = "Use orthographic projection."]
1216112193
#[serde(rename = "default_camera_set_orthographic")]
1216212194
DefaultCameraSetOrthographic {},
@@ -13183,6 +13215,11 @@ pub enum OkModelingCmdResponse {
1318313215
#[doc = "The response from the `GetEntityType` command."]
1318413216
data: GetEntityType,
1318513217
},
13218+
#[serde(rename = "scene_get_entity_ids")]
13219+
SceneGetEntityIds {
13220+
#[doc = "The response from the `SceneGetEntityIds` command."]
13221+
data: SceneGetEntityIds,
13222+
},
1318613223
#[serde(rename = "curve_get_control_points")]
1318713224
CurveGetControlPoints {
1318813225
#[doc = "The response from the `CurveGetControlPoints` command."]
@@ -16135,6 +16172,37 @@ impl tabled::Tabled for SceneClearAll {
1613516172
}
1613616173
}
1613716174

16175+
#[doc = "The response from the `SceneGetEntityIds` command."]
16176+
#[derive(
16177+
serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16178+
)]
16179+
pub struct SceneGetEntityIds {
16180+
#[doc = "The ids of the requested entities."]
16181+
pub entity_ids: Vec<Vec<uuid::Uuid>>,
16182+
}
16183+
16184+
impl std::fmt::Display for SceneGetEntityIds {
16185+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16186+
write!(
16187+
f,
16188+
"{}",
16189+
serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16190+
)
16191+
}
16192+
}
16193+
16194+
#[cfg(feature = "tabled")]
16195+
impl tabled::Tabled for SceneGetEntityIds {
16196+
const LENGTH: usize = 1;
16197+
fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16198+
vec![format!("{:?}", self.entity_ids).into()]
16199+
}
16200+
16201+
fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16202+
vec!["entity_ids".into()]
16203+
}
16204+
}
16205+
1613816206
#[doc = "The type of scene selection change"]
1613916207
#[derive(
1614016208
serde :: Serialize,
@@ -22405,10 +22473,6 @@ pub enum ZooTool {
2240522473
#[serde(rename = "modeling_app")]
2240622474
#[display("modeling_app")]
2240722475
ModelingApp,
22408-
#[doc = "The Diff Chrome Extension."]
22409-
#[serde(rename = "diff_chrome_extension")]
22410-
#[display("diff_chrome_extension")]
22411-
DiffChromeExtension,
2241222476
#[doc = "The Text-to-CAD UI."]
2241322477
#[serde(rename = "text_to_cad")]
2241422478
#[display("text_to_cad")]

0 commit comments

Comments
 (0)