diff options
| author | soryu <soryu@soryu.co> | 2026-01-21 15:58:34 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-21 15:58:34 +0000 |
| commit | da246c4c4e23c9ad976705f9a3fa80e0d75b4425 (patch) | |
| tree | ddc3b93ed269e60dac1aa9113000daeac4a1b6e6 /makima/src/daemon/api/contract.rs | |
| parent | 7155e6cd7ddf25a5a4d4f6d6abecd49f0cf519dc (diff) | |
| download | soryu-da246c4c4e23c9ad976705f9a3fa80e0d75b4425.tar.gz soryu-da246c4c4e23c9ad976705f9a3fa80e0d75b4425.zip | |
Update CLI to show repo suggestions
Diffstat (limited to 'makima/src/daemon/api/contract.rs')
| -rw-r--r-- | makima/src/daemon/api/contract.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/makima/src/daemon/api/contract.rs b/makima/src/daemon/api/contract.rs index 955fe41..50fd64f 100644 --- a/makima/src/daemon/api/contract.rs +++ b/makima/src/daemon/api/contract.rs @@ -224,4 +224,27 @@ impl ApiClient { self.get(&format!("/api/v1/mesh/tasks/{}/output", task_id)) .await } + + /// Get repository suggestions for autocomplete. + /// Returns recently used repositories sorted by usage frequency and recency. + pub async fn get_repository_suggestions( + &self, + source_type: Option<&str>, + limit: Option<i32>, + ) -> Result<JsonValue, ApiError> { + let mut params = Vec::new(); + if let Some(st) = source_type { + params.push(format!("source_type={}", st)); + } + if let Some(l) = limit { + params.push(format!("limit={}", l)); + } + let query_string = if params.is_empty() { + String::new() + } else { + format!("?{}", params.join("&")) + }; + self.get(&format!("/api/v1/settings/repository-history/suggestions{}", query_string)) + .await + } } |
