import Foundation /// One signed-in identity: an account on an instance. gitbay is /// self-hosted, so the pair is the unit — the same person on two /// instances is two accounts. nonisolated struct Account: Codable, Hashable, Sendable, Identifiable { let instance: GitbayInstance let username: String /// Stable across renames of nothing — usernames are the identity on an /// instance, and tokens are keyed by this. var id: String { "\(instance.baseURL.absoluteString)#\(username)" } /// "cmc on gitbay.org" var label: String { "\(username) on \(instance.baseURL.host() ?? instance.baseURL.absoluteString)" } }