EditionProvider

public protocol EditionProvider

Protocol to get the the editions available since the latest feed update.

  • Method for getting editions.It returns a Paginator object that can be used to iterate over the requested editions. Editions are sorted by date with newer editions first. You can specify filters productTags, startDate, endDate and a page size for the paginator. When pageSize is nil, the method will return a Paginator with ALL the Editions matching the filters in a single Page.

    The product tag format is “organization/productTag” or “productTag” if the productTag matches the organization.

    Declaration

    Swift

    func editions(
        productTags: [String]?,
        startDate: Date?,
        endDate: Date?,
        pageSize: Int?
    ) -> Paginator
  • Get an Edition from its UUID. This method is normally used to get Edition objects after using DownloadedEditionsProvider

    Declaration

    Swift

    func edition(id: UUID, callback: @escaping (Edition?) -> Void)
  • Returns a map of the form [year : [month : count]], where count is the count of Edition for that month. Format for years and months is numeric (e.g. “2023”, “01”). You can narrow the results down with productTags. An empty map is returned on errors.

    Declaration

    Swift

    func editionCounts(
        productTags: [String]?,
        callback: @escaping (EditionCounts) -> Void
    )