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>
35 lines
798 B
Swift
35 lines
798 B
Swift
//
|
|
// Plugin.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 1/25/23.
|
|
//
|
|
|
|
import CoreData
|
|
import Foundation
|
|
|
|
public protocol Plugin: ObservableObject, NSManagedObject {
|
|
var id: UUID { get set }
|
|
var listId: UUID? { get set }
|
|
var name: String { get set }
|
|
var version: Int16 { get set }
|
|
var author: String { get set }
|
|
var enabled: Bool { get set }
|
|
var tags: NSOrderedSet? { get set }
|
|
func getTags() -> [PluginTagJson]
|
|
}
|
|
|
|
extension Plugin {
|
|
var tagArray: [PluginTag] {
|
|
tags?.array as? [PluginTag] ?? []
|
|
}
|
|
}
|
|
|
|
public protocol PluginJson: Hashable {
|
|
var name: String { get }
|
|
var version: Int16 { get }
|
|
var author: String? { get }
|
|
var listId: UUID? { get }
|
|
var tags: [PluginTagJson]? { get }
|
|
func getTags() -> [PluginTagJson]
|
|
}
|