diff --git a/apps/frontend/src/ui/pages/browser/BrowserMain.tsx b/apps/frontend/src/ui/pages/browser/BrowserMain.tsx index 59710e6..9f51de2 100644 --- a/apps/frontend/src/ui/pages/browser/BrowserMain.tsx +++ b/apps/frontend/src/ui/pages/browser/BrowserMain.tsx @@ -1,4 +1,4 @@ -import type { ManagedPackage, Providers } from '@onelauncher/client/bindings'; +import type { Providers } from '@onelauncher/client/bindings'; import { ChevronRightIcon } from '@untitled-theme/icons-solid'; import OneConfigLogo from '~assets/logos/oneconfig.svg?component-solid'; import Button from '~ui/components/base/Button'; @@ -21,7 +21,7 @@ function BrowserMain() {
- + {([provider, results]) => ( @@ -40,7 +40,13 @@ function BrowserMain() { } interface FeaturedProps { - package: ManagedPackage; + package: { + title: string; + description: string; + id: string; + provider: Providers; + oneconfig: boolean; + }; } function Featured(props: FeaturedProps) { diff --git a/package.json b/package.json index 7647526..482a043 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "version": "1.0.0-alpha.1", "private": true, "engineStrict": true, - "packageManager": "pnpm@9.12.2", "description": "Next-generation open source Minecraft launcher and tools for interacting with Polyfrost", "license": "GPL-3.0-only", "homepage": "https://polyfrost.org", diff --git a/packages/core/src/api/java.rs b/packages/core/src/api/java.rs index 43041cd..04511dd 100644 --- a/packages/core/src/api/java.rs +++ b/packages/core/src/api/java.rs @@ -24,9 +24,27 @@ pub async fn filter_java_version(java_version: Option) -> crate::Result, +} + +pub async fn fetch_zulu() -> crate::Result> { + let state = State::get().await?; + + fetch_json::>( + Method::GET, + &format!( + "https://api.azul.com/metadata/v1/zulu/packages/?os={}&arch={}&archive_type=zip&java_package_type=jre&javafx_bundled=false&latest=true&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=100", + std::env::consts::OS, + std::env::consts::ARCH, + ), + None, + None, + &state.fetch_semaphore, + ) + .await } // TODO: support more than just zulu ? @@ -44,7 +62,7 @@ pub async fn install_java(java_version: u32) -> crate::Result { .await?; send_ingress(&ingress, 0.0, Some("fetching java api")).await?; - let packages = fetch_json::>(Method::GET, &format!( + let packages = fetch_json::>(Method::GET, &format!( "https://api.azul.com/metadata/v1/zulu/packages?arch={}&java_version={}&os={}&archive_type=zip&javafx_bundled=false&java_package_type=jre&page_size=1", std::env::consts::ARCH, java_version, std::env::consts::OS, ), None, None, &state.fetch_semaphore).await?;