Plugin lists are universal across clients and OS-specific cases should be appropriately handled. OSes can now be added to the deeplink action case and Ferrite scans for either iOS-specific or fallthrough actions. There must be 1 action that corresponds to an OS and/or 1 fallback case, otherwise the action will not show in the plugins list. Also remove some extraneous files. Signed-off-by: kingbri <bdashore3@proton.me>
38 lines
785 B
Swift
38 lines
785 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)
|
|
case ActionAddition(description: String)
|
|
}
|
|
|
|
struct AvailablePlugins {
|
|
let availableSources: [SourceJson]
|
|
let availableActions: [ActionJson]
|
|
}
|
|
}
|