secretive/Sources/SecretiveUpdater/SecretiveUpdater.swift
Max Goedjen f76766a9d5
Updater UI (#703)
* Parse markdown oop

* Update UI.

* Tweaks.
2025-09-14 08:20:10 +00:00

20 lines
518 B
Swift

import Foundation
import OSLog
import XPCWrappers
import Brief
final class SecretiveUpdater: NSObject, XPCProtocol {
enum Constants {
static let updateURL = URL(string: "https://api.github.com/repos/maxgoedjen/secretive/releases")!
}
func process(_: Data) async throws -> [Release] {
let (data, _) = try await URLSession.shared.data(from: Constants.updateURL)
return try JSONDecoder()
.decode([GitHubRelease].self, from: data)
.map(Release.init)
}
}