2022-11-20 15:39:06 +00:00
|
|
|
import Foundation
|
|
|
|
|
2022-12-17 12:37:46 +00:00
|
|
|
public struct Account: Codable, Identifiable, Equatable, Hashable {
|
|
|
|
public func hash(into hasher: inout Hasher) {
|
|
|
|
hasher.combine(id)
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-21 19:53:23 +00:00
|
|
|
public struct Field: Codable, Equatable, Identifiable {
|
|
|
|
public var id: String {
|
|
|
|
value + name
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-17 12:37:46 +00:00
|
|
|
public let name: String
|
2022-12-21 19:53:23 +00:00
|
|
|
public let value: HTMLString
|
2022-12-17 12:37:46 +00:00
|
|
|
public let verifiedAt: String?
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2023-01-10 07:24:05 +00:00
|
|
|
public struct Source: Codable, Equatable {
|
|
|
|
public let privacy: Visibility
|
|
|
|
public let sensitive: Bool
|
|
|
|
public let language: String?
|
|
|
|
public let note: String
|
|
|
|
public let fields: [Field]
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-11-20 15:39:06 +00:00
|
|
|
public let id: String
|
|
|
|
public let username: String
|
|
|
|
public let displayName: String
|
|
|
|
public let avatar: URL
|
2022-12-17 12:37:46 +00:00
|
|
|
public let header: URL
|
2022-11-21 13:42:59 +00:00
|
|
|
public let acct: String
|
2022-12-17 12:37:46 +00:00
|
|
|
public let note: HTMLString
|
|
|
|
public let createdAt: ServerDate
|
|
|
|
public let followersCount: Int
|
|
|
|
public let followingCount: Int
|
|
|
|
public let statusesCount: Int
|
|
|
|
public let lastStatusAt: String?
|
|
|
|
public let fields: [Field]
|
|
|
|
public let locked: Bool
|
2022-12-21 16:39:48 +00:00
|
|
|
public let emojis: [Emoji]
|
2023-01-04 17:37:58 +00:00
|
|
|
public let url: URL?
|
2023-01-10 07:24:05 +00:00
|
|
|
public let source: Source?
|
|
|
|
public let bot: Bool
|
|
|
|
public let discoverable: Bool?
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-17 12:37:46 +00:00
|
|
|
public static func placeholder() -> Account {
|
|
|
|
.init(id: UUID().uuidString,
|
|
|
|
username: "Username",
|
|
|
|
displayName: "Display Name",
|
|
|
|
avatar: URL(string: "https://files.mastodon.social/media_attachments/files/003/134/405/original/04060b07ddf7bb0b.png")!,
|
|
|
|
header: URL(string: "https://files.mastodon.social/media_attachments/files/003/134/405/original/04060b07ddf7bb0b.png")!,
|
|
|
|
acct: "account@account.com",
|
|
|
|
note: "Some content",
|
|
|
|
createdAt: "2022-12-16T10:20:54.000Z",
|
|
|
|
followersCount: 10,
|
|
|
|
followingCount: 10,
|
|
|
|
statusesCount: 10,
|
|
|
|
lastStatusAt: nil,
|
|
|
|
fields: [],
|
2022-12-21 16:39:48 +00:00
|
|
|
locked: false,
|
2023-01-04 17:37:58 +00:00
|
|
|
emojis: [],
|
2023-01-10 07:24:05 +00:00
|
|
|
url: nil,
|
|
|
|
source: nil,
|
|
|
|
bot: false,
|
|
|
|
discoverable: true)
|
2022-12-17 12:37:46 +00:00
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-23 17:47:19 +00:00
|
|
|
public static func placeholders() -> [Account] {
|
|
|
|
[.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder(),
|
|
|
|
.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder()]
|
|
|
|
}
|
2022-11-20 15:39:06 +00:00
|
|
|
}
|
2022-12-22 11:26:11 +00:00
|
|
|
|
|
|
|
public struct FamilliarAccounts: Codable {
|
|
|
|
public let id: String
|
|
|
|
public let accounts: [Account]
|
|
|
|
}
|