feat: New V3 version

This commit is contained in:
2026-02-07 13:53:54 +01:00
parent 0176945bd6
commit 8926cd7ecf
7 changed files with 300 additions and 127 deletions

16
src/api.rs Normal file
View File

@@ -0,0 +1,16 @@
use crate::models::{ApiResponse, SuplError};
pub fn fetch_api(provider_url: &str) -> Result<ApiResponse, SuplError> {
let trimmed = provider_url.trim_end_matches('/');
let url = format!("{}/versioned/v3", trimmed);
minreq::get(&url)
.send()
.map_err(|e| SuplError::NetworkError {
reason: e.to_string(),
})?
.json()
.map_err(|e| SuplError::ParseError {
reason: e.to_string(),
})
}