Make all tasks run in parallel to increase responsiveness and efficiency when fetching new data. However, parallel tasks means that toast errors are no longer feasible. Instead, add a logging system which has a more detailed view of app messages and direct the user there if there is an error. Signed-off-by: kingbri <bdashore3@proton.me>
37 lines
736 B
Swift
37 lines
736 B
Swift
//
|
|
// PluginModels.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 1/11/23.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct PluginListJson: Codable {
|
|
let name: String
|
|
let author: String
|
|
var sources: [SourceJson]?
|
|
var actions: [ActionJson]?
|
|
}
|
|
|
|
// Color: Hex value
|
|
public struct PluginTagJson: Codable, Hashable, Sendable {
|
|
public let name: String
|
|
public let colorHex: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case name
|
|
case colorHex = "color"
|
|
}
|
|
}
|
|
|
|
extension PluginManager {
|
|
enum PluginManagerError: Error {
|
|
case ListAddition(description: String)
|
|
}
|
|
|
|
struct AvailablePlugins {
|
|
let availableSources: [SourceJson]
|
|
let availableActions: [ActionJson]
|
|
}
|
|
}
|