feat: Add AUR package synchronization and update README documentation.

This commit is contained in:
Yusuf İpek
2025-11-22 15:53:19 +03:00
parent 27a8544e02
commit afd4456893
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -79,6 +79,7 @@ You can trigger a repository sync using the API. This is useful for updating the
- `debian`: Sync Debian packages (Official Repo) - `debian`: Sync Debian packages (Official Repo)
- `ubuntu`: Sync Ubuntu packages (Official Repo) - `ubuntu`: Sync Ubuntu packages (Official Repo)
- `arch`: Sync Arch Linux packages (Official Repo) - `arch`: Sync Arch Linux packages (Official Repo)
- `aur`: Sync Arch User Repository (AUR) packages
- `fedora`: Sync Fedora packages (Official Repo) - `fedora`: Sync Fedora packages (Official Repo)
- `windows`: Sync Windows packages (Winget) - `windows`: Sync Windows packages (Winget)
- `macos`: Sync macOS packages (Homebrew) - `macos`: Sync macOS packages (Homebrew)
+10
View File
@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from 'next/server' import { NextRequest, NextResponse } from 'next/server'
import { PackageFetcherV2 } from '@/services/packageFetcherV2' import { PackageFetcherV2 } from '@/services/packageFetcherV2'
import { ArchPackageFetcher } from '@/services/archPackageFetcher' import { ArchPackageFetcher } from '@/services/archPackageFetcher'
import { AurPackageFetcher } from '@/services/aurPackageFetcher'
import { FedoraPackageFetcher } from '@/services/fedoraPackageFetcher' import { FedoraPackageFetcher } from '@/services/fedoraPackageFetcher'
import { WingetPackageFetcher } from '@/services/wingetPackageFetcher' import { WingetPackageFetcher } from '@/services/wingetPackageFetcher'
import { HomebrewPackageFetcher } from '@/services/homebrewPackageFetcher' import { HomebrewPackageFetcher } from '@/services/homebrewPackageFetcher'
@@ -46,12 +47,21 @@ export async function POST(request: NextRequest) {
return 'Ubuntu packages synced' return 'Ubuntu packages synced'
case 'arch': { case 'arch': {
// Sync official Arch packages
const archFetcher = new ArchPackageFetcher() const archFetcher = new ArchPackageFetcher()
const archPackages = await archFetcher.fetchAllPackages() const archPackages = await archFetcher.fetchAllPackages()
await archFetcher.storePackages(archPackages) await archFetcher.storePackages(archPackages)
return `Arch Linux packages synced (${archPackages.length})` return `Arch Linux packages synced (${archPackages.length})`
} }
case 'aur': {
// Sync AUR packages
const aurFetcher = new AurPackageFetcher()
const aurPackages = await aurFetcher.fetchAllPackages()
await aurFetcher.storePackages(aurPackages)
return `AUR packages synced (${aurPackages.length})`
}
case 'fedora': { case 'fedora': {
const fedoraFetcher = new FedoraPackageFetcher() const fedoraFetcher = new FedoraPackageFetcher()
const fedoraPackages = await fedoraFetcher.fetchAllPackages() const fedoraPackages = await fedoraFetcher.fetchAllPackages()