feat(ios): add cross-instance notification center
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
import Foundation
|
||||
|
||||
public enum NotificationDeviceState: String, Equatable, Sendable, CaseIterable {
|
||||
case ready
|
||||
case unauthorized
|
||||
case unavailable
|
||||
case failed
|
||||
}
|
||||
|
||||
public struct NotificationDevice: Equatable, Identifiable, Sendable {
|
||||
public let id: UUID
|
||||
public let name: String
|
||||
public let state: NotificationDeviceState
|
||||
}
|
||||
|
||||
public struct NotificationChannelTypeSummary: Equatable, Identifiable, Sendable {
|
||||
public var id: String { type }
|
||||
public let type: String
|
||||
public let total: Int
|
||||
public let enabled: Int
|
||||
}
|
||||
|
||||
public struct NotificationConfigSummary: Equatable, Sendable {
|
||||
public let channelCount: Int
|
||||
public let channelEnabled: Int
|
||||
public let ruleCount: Int
|
||||
public let ruleEnabled: Int
|
||||
public let channelTypes: [NotificationChannelTypeSummary]
|
||||
}
|
||||
|
||||
public struct NotificationLogEntry: Equatable, Identifiable, Sendable {
|
||||
public let id: String
|
||||
public let eventType: String
|
||||
public let status: String
|
||||
public let ruleName: String?
|
||||
public let channelName: String?
|
||||
public let createdAt: String
|
||||
}
|
||||
|
||||
public struct NotificationLogSummary: Equatable, Sendable {
|
||||
public let total: Int
|
||||
public let success: Int
|
||||
public let failed: Int
|
||||
public let quietHours: Int
|
||||
public let unmatched: Int
|
||||
public let noAvailableChannel: Int
|
||||
public let other: Int
|
||||
public let entries: [NotificationLogEntry]
|
||||
}
|
||||
|
||||
public struct NotificationQueueEntry: Equatable, Identifiable, Sendable {
|
||||
public let id: String
|
||||
public let instanceID: UUID
|
||||
public let instanceName: String
|
||||
public let eventType: String
|
||||
public let status: String
|
||||
public let ruleName: String?
|
||||
public let channelName: String?
|
||||
public let createdAt: String
|
||||
}
|
||||
|
||||
public struct NotificationQueueSummary: Equatable, Sendable {
|
||||
public let total: Int
|
||||
public let pending: Int
|
||||
public let scheduled: Int
|
||||
public let retrying: Int
|
||||
public let sending: Int
|
||||
public let failed: Int
|
||||
public let items: [NotificationQueueEntry]
|
||||
}
|
||||
|
||||
public struct NotificationOverview: Equatable, Sendable {
|
||||
public let observedAt: Date
|
||||
public let devices: [NotificationDevice]
|
||||
public let config: NotificationConfigSummary
|
||||
public let logs: NotificationLogSummary
|
||||
public let queue: NotificationQueueSummary
|
||||
}
|
||||
Reference in New Issue
Block a user