diff options
| author | Christian Cleberg <[email protected]> | 2026-03-17 23:19:43 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-17 23:19:43 -0500 |
| commit | 32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5 (patch) | |
| tree | ee36d421d704e508d5617d803b4c8cbdb4804fe1 /Hutch/Models/Meta.swift | |
| parent | 8f2057c53e9009c2529c9c4849c914666c0e4b40 (diff) | |
| download | hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.tar.gz hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.tar.bz2 hutch-32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5.zip | |
v1.0
Diffstat (limited to 'Hutch/Models/Meta.swift')
| -rw-r--r-- | Hutch/Models/Meta.swift | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Hutch/Models/Meta.swift b/Hutch/Models/Meta.swift new file mode 100644 index 0000000..c0434bc --- /dev/null +++ b/Hutch/Models/Meta.swift @@ -0,0 +1,65 @@ +import Foundation + +// MARK: - User Profile (full) + +/// Extended user profile from meta.sr.ht with all fields from the `me` query. +struct UserProfile: Codable, Sendable { + let username: String + let canonicalName: String + let email: String + let url: String? + let location: String? + let bio: String? + let avatar: String? + let userType: String? + let sshKeys: SSHKeyPage + let pgpKeys: PGPKeyPage + let paymentStatus: String? + let subscription: Subscription? +} + +// MARK: - SSH Key + +struct SSHKey: Codable, Sendable, Identifiable { + let id: Int + let fingerprint: String + let comment: String? + let created: Date + let lastUsed: Date? +} + +struct SSHKeyPage: Codable, Sendable { + let results: [SSHKey] + let cursor: String? +} + +// MARK: - PGP Key + +struct PGPKey: Codable, Sendable, Identifiable { + let id: Int + let fingerprint: String + let created: Date +} + +struct PGPKeyPage: Codable, Sendable { + let results: [PGPKey] + let cursor: String? +} + +// MARK: - Subscription + +struct Subscription: Codable, Sendable { + let status: String? + let autorenew: Bool? + let interval: String? +} + +// MARK: - Personal Access Token + +struct PersonalAccessToken: Codable, Sendable, Identifiable { + let id: Int + let issued: Date + let expires: Date? + let comment: String? + let grants: String? +} |
