max / makenotwork
23 files changed,
+76 insertions,
-97 deletions
| @@ -505,9 +505,9 @@ | |||
| 505 | 505 | ||
| 506 | 506 | [[package]] | |
| 507 | 507 | name = "crossbeam-epoch" | |
| 508 | - | version = "0.9.18" | |
| 508 | + | version = "0.9.20" | |
| 509 | 509 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 510 | - | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" | |
| 510 | + | checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" | |
| 511 | 511 | dependencies = [ | |
| 512 | 512 | "crossbeam-utils", | |
| 513 | 513 | ] |
| @@ -368,9 +368,9 @@ | |||
| 368 | 368 | ||
| 369 | 369 | [[package]] | |
| 370 | 370 | name = "crossbeam-epoch" | |
| 371 | - | version = "0.9.18" | |
| 371 | + | version = "0.9.20" | |
| 372 | 372 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 373 | - | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" | |
| 373 | + | checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" | |
| 374 | 374 | dependencies = [ | |
| 375 | 375 | "crossbeam-utils", | |
| 376 | 376 | ] |
| @@ -2128,9 +2128,9 @@ | |||
| 2128 | 2128 | ||
| 2129 | 2129 | [[package]] | |
| 2130 | 2130 | name = "crossbeam-epoch" | |
| 2131 | - | version = "0.9.18" | |
| 2131 | + | version = "0.9.20" | |
| 2132 | 2132 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2133 | - | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" | |
| 2133 | + | checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" | |
| 2134 | 2134 | dependencies = [ | |
| 2135 | 2135 | "crossbeam-utils", | |
| 2136 | 2136 | ] |
| @@ -254,6 +254,7 @@ | |||
| 254 | 254 | ||
| 255 | 255 | /// Result of a broadcast send. | |
| 256 | 256 | #[derive(Debug, Deserialize)] | |
| 257 | + | #[allow(dead_code)] // wire contract: every field the endpoint returns, read or not | |
| 257 | 258 | pub struct BroadcastResult { | |
| 258 | 259 | pub success: bool, | |
| 259 | 260 | pub recipient_count: usize, | |
| @@ -292,6 +293,7 @@ | |||
| 292 | 293 | ||
| 293 | 294 | /// Domain verification result. | |
| 294 | 295 | #[derive(Debug, Deserialize)] | |
| 296 | + | #[allow(dead_code)] // wire contract: every field the endpoint returns, read or not | |
| 295 | 297 | pub struct DomainVerifyResult { | |
| 296 | 298 | pub verified: bool, | |
| 297 | 299 | pub message: String, | |
| @@ -1371,6 +1373,9 @@ | |||
| 1371 | 1373 | empty_response(resp, "add_item_tag").await | |
| 1372 | 1374 | } | |
| 1373 | 1375 | ||
| 1376 | + | // Unused by the TUI today; kept so the client mirrors the full | |
| 1377 | + | // /api/internal surface rather than only the paths one caller happens to hit. | |
| 1378 | + | #[allow(dead_code)] | |
| 1374 | 1379 | pub async fn remove_item_tag(&self, user_id: &str, item_id: &str, tag_id: &str) -> anyhow::Result<()> { | |
| 1375 | 1380 | let url = format!("{}/api/internal/creator/items/tags/remove", self.base_url); | |
| 1376 | 1381 | let resp = self.http.post(&url).bearer_auth(&self.service_token) | |
| @@ -1411,6 +1416,7 @@ | |||
| 1411 | 1416 | json_response(resp, "list_collections").await | |
| 1412 | 1417 | } | |
| 1413 | 1418 | ||
| 1419 | + | #[allow(dead_code)] | |
| 1414 | 1420 | pub async fn create_collection(&self, user_id: &str, slug: &str, title: &str) -> anyhow::Result<serde_json::Value> { | |
| 1415 | 1421 | let url = format!("{}/api/internal/creator/collections", self.base_url); | |
| 1416 | 1422 | let resp = self.http.post(&url).bearer_auth(&self.service_token) | |
| @@ -1420,6 +1426,7 @@ | |||
| 1420 | 1426 | json_response(resp, "create_collection").await | |
| 1421 | 1427 | } | |
| 1422 | 1428 | ||
| 1429 | + | #[allow(dead_code)] | |
| 1423 | 1430 | pub async fn delete_collection(&self, user_id: &str, collection_id: &str) -> anyhow::Result<()> { | |
| 1424 | 1431 | let url = format!("{}/api/internal/creator/collections/{}", self.base_url, collection_id); | |
| 1425 | 1432 | let resp = self.http.delete(&url).bearer_auth(&self.service_token) |
| @@ -53,7 +53,7 @@ | |||
| 53 | 53 | _ => b"Usage: project create --title \"Name\" [--type audio|digital|video|mixed|subscription] [--description \"...\"]\r\n".to_vec(), | |
| 54 | 54 | }, | |
| 55 | 55 | "upload" => { | |
| 56 | - | return b"Pipe uploads use stdin. Example:\r\n cat file.wav | ssh cli.makenot.work upload --filename track.wav --project my-project\r\n".to_vec(); | |
| 56 | + | b"Pipe uploads use stdin. Example:\r\n cat file.wav | ssh cli.makenot.work upload --filename track.wav --project my-project\r\n".to_vec() | |
| 57 | 57 | } | |
| 58 | 58 | "projects" => cmd_projects(user, api, json).await, | |
| 59 | 59 | "analytics" => { | |
| @@ -403,11 +403,10 @@ | |||
| 403 | 403 | Ok(Some(d)) => { | |
| 404 | 404 | let status = if d.verified { "verified" } else { "pending" }; | |
| 405 | 405 | let mut out = format!("Domain: {} ({})\r\n", d.domain, status); | |
| 406 | - | if !d.verified { | |
| 407 | - | if let Some(ref instr) = d.instructions { | |
| 406 | + | if !d.verified | |
| 407 | + | && let Some(ref instr) = d.instructions { | |
| 408 | 408 | out.push_str(&format!("{}\r\n", instr)); | |
| 409 | 409 | } | |
| 410 | - | } | |
| 411 | 410 | out.into_bytes() | |
| 412 | 411 | } | |
| 413 | 412 | Ok(None) => b"No custom domain configured.\r\nUsage: domain add <domain>\r\n".to_vec(), | |
| @@ -557,8 +556,8 @@ | |||
| 557 | 556 | /// Handles quoted values that were split by whitespace by rejoining until the closing quote. | |
| 558 | 557 | fn extract_flag(parts: &[&str], flags: &[&str]) -> Option<String> { | |
| 559 | 558 | for (i, part) in parts.iter().enumerate() { | |
| 560 | - | if flags.contains(part) { | |
| 561 | - | if let Some(&next) = parts.get(i + 1) { | |
| 559 | + | if flags.contains(part) | |
| 560 | + | && let Some(&next) = parts.get(i + 1) { | |
| 562 | 561 | // If the value starts with a quote, collect until closing quote | |
| 563 | 562 | if next.starts_with('"') || next.starts_with('\'') { | |
| 564 | 563 | let quote = next.as_bytes()[0] as char; | |
| @@ -579,7 +578,6 @@ | |||
| 579 | 578 | } | |
| 580 | 579 | return Some(next.to_string()); | |
| 581 | 580 | } | |
| 582 | - | } | |
| 583 | 581 | } | |
| 584 | 582 | None | |
| 585 | 583 | } |
| @@ -60,7 +60,7 @@ | |||
| 60 | 60 | }); | |
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | - | files.sort_by(|a, b| b.modified.cmp(&a.modified)); | |
| 63 | + | files.sort_by_key(|f| std::cmp::Reverse(f.modified)); | |
| 64 | 64 | files | |
| 65 | 65 | } | |
| 66 | 66 |