PackageCollectionsProtocol
API.swift:20protocol PackageCollectionsProtocol
Requirements
Instance members
func addCollection(PackageCollectionsModel.CollectionSource, order: Int?, trustConfirmationProvider: ((PackageCollectionsModel.Collection, @escaping (Bool) -> Void) -> Void)?, callback: @escaping (Result<PackageCollectionsModel.Collection, Error>) -> Void
) Adds a package collection.
func findPackages(String, collections: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<PackageCollectionsModel.PackageSearchResult, Error>) -> Void
) Finds and returns packages that match the query.
func findTargets(String, searchType: PackageCollectionsModel.TargetSearchType?, collections: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<PackageCollectionsModel.TargetSearchResult, Error>) -> Void
) Finds targets by name and returns the corresponding packages.
func getCollection(PackageCollectionsModel.CollectionSource, callback: @escaping (Result<PackageCollectionsModel.Collection, Error>) -> Void
) Returns information about a package collection. The collection is not required to be in the configured list. If not found locally, the collection will be fetched from the source.
func getPackageMetadata(identity: PackageIdentity, location: String?, callback: @escaping (Result<PackageCollectionsModel.PackageMetadata, Error>) -> Void
) Returns metadata for the package identified by the given
PackageIdentity
, along with the identifiers ofPackageCollection
s where the package is found.func getPackageMetadata(identity: PackageIdentity, location: String?, collections: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<PackageCollectionsModel.PackageMetadata, Error>) -> Void
) Returns metadata for the package identified by the given
PackageIdentity
, along with the identifiers ofPackageCollection
s where the package is found.func listCollections(identifiers: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<[PackageCollectionsModel.Collection], Error>) -> Void
) Returns packages organized into collections.
func listPackages(collections: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<PackageCollectionsModel.PackageSearchResult, Error>) -> Void
) Lists packages from the specified collections.
func listTargets(collections: Set<PackageCollectionsModel.CollectionIdentifier>?, callback: @escaping (Result<PackageCollectionsModel.TargetListResult, Error>) -> Void
) List all known targets.
func moveCollection(PackageCollectionsModel.CollectionSource, to: Int, callback: @escaping (Result<Void, Error>) -> Void
) Moves a package collection to a different order.
func refreshCollection(PackageCollectionsModel.CollectionSource, callback: @escaping (Result<PackageCollectionsModel.Collection, Error>) -> Void
) Refreshes a package collection.
func refreshCollections(callback: @escaping (Result<[PackageCollectionsModel.CollectionSource], Error>) -> Void
) Refreshes all configured package collections.
func removeCollection(PackageCollectionsModel.CollectionSource, callback: @escaping (Result<Void, Error>) -> Void
) Removes a package collection.
func updateCollection(PackageCollectionsModel.CollectionSource, callback: @escaping (Result<PackageCollectionsModel.Collection, Error>) -> Void
) Updates settings of a
PackageCollection
source (e.g., if it is trusted or not).
Citizens in PackageCollections
Instance members
func addCollection(PackageCollectionsModel.CollectionSource, order: Int?, trustConfirmationProvider: ((PackageCollectionsModel.Collection, @escaping (Bool) -> Void) -> Void)?
) async throws -> PackageCollectionsModel.Collection func findPackages(String, collections: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> PackageCollectionsModel.PackageSearchResult func findTargets(String, searchType: PackageCollectionsModel.TargetSearchType?, collections: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> PackageCollectionsModel.TargetSearchResult func getCollection(PackageCollectionsModel.CollectionSource
) async throws -> PackageCollectionsModel.Collection func getPackageMetadata(identity: PackageIdentity, location: String?, collections: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> PackageCollectionsModel.PackageMetadata func listCollections(identifiers: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> [PackageCollectionsModel.Collection] func listPackages(collections: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> PackageCollectionsModel.PackageSearchResult func listTargets(collections: Set<PackageCollectionsModel.CollectionIdentifier>?
) async throws -> PackageCollectionsModel.TargetListResult func moveCollection(PackageCollectionsModel.CollectionSource, to: Int
) async throws func refreshCollection(PackageCollectionsModel.CollectionSource
) async throws -> PackageCollectionsModel.Collection func refreshCollections(
) async throws -> [PackageCollectionsModel.CollectionSource] func removeCollection(PackageCollectionsModel.CollectionSource
) async throws func updateCollection(PackageCollectionsModel.CollectionSource
) async throws -> PackageCollectionsModel.Collection