Coalesce the various Feedly services files into one file.

This commit is contained in:
Brent Simmons 2024-04-27 11:29:10 -07:00
parent 47c68aa4cc
commit db69ddd209
6 changed files with 57 additions and 93 deletions

View File

@ -0,0 +1,57 @@
//
// FeedlyServices.swift
//
//
// Created by Brent Simmons on 4/27/24.
// Includes text of a bunch of files created by Kiel Gillard 2019
//
import Foundation
public protocol FeedlyGetCollectionsService: AnyObject {
@MainActor func getCollections() async throws -> [FeedlyCollection]
}
public protocol FeedlyGetEntriesService: AnyObject {
@MainActor func getEntries(for ids: Set<String>) async throws -> [FeedlyEntry]
}
public protocol FeedlyGetStreamContentsService: AnyObject {
@MainActor func getStreamContents(for resource: FeedlyResourceID, continuation: String?, newerThan: Date?, unreadOnly: Bool?) async throws -> FeedlyStream
}
public protocol FeedlyGetStreamIDsService: AnyObject {
@MainActor func getStreamIDs(for resource: FeedlyResourceID, continuation: String?, newerThan: Date?, unreadOnly: Bool?) async throws -> FeedlyStreamIDs
}
public enum FeedlyMarkAction: String, Sendable {
case read
case unread
case saved
case unsaved
/// These values are paired with the "action" key in POST requests to the markers API.
/// See for example: https://developer.feedly.com/v3/markers/#mark-one-or-multiple-articles-as-read
public var actionValue: String {
switch self {
case .read:
return "markAsRead"
case .unread:
return "keepUnread"
case .saved:
return "markAsSaved"
case .unsaved:
return "markAsUnsaved"
}
}
}
public protocol FeedlyMarkArticlesService: AnyObject {
@MainActor func mark(_ articleIDs: Set<String>, as action: FeedlyMarkAction) async throws
}

View File

@ -1,14 +0,0 @@
//
// FeedlyGetCollectionsService.swift
// Account
//
// Created by Kiel Gillard on 21/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public protocol FeedlyGetCollectionsService: AnyObject {
@MainActor func getCollections() async throws -> [FeedlyCollection]
}

View File

@ -1,14 +0,0 @@
//
// FeedlyGetEntriesService.swift
// Account
//
// Created by Kiel Gillard on 28/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public protocol FeedlyGetEntriesService: AnyObject {
@MainActor func getEntries(for ids: Set<String>) async throws -> [FeedlyEntry]
}

View File

@ -1,14 +0,0 @@
//
// FeedlyGetStreamContentsService.swift
// Account
//
// Created by Kiel Gillard on 21/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public protocol FeedlyGetStreamContentsService: AnyObject {
@MainActor func getStreamContents(for resource: FeedlyResourceID, continuation: String?, newerThan: Date?, unreadOnly: Bool?) async throws -> FeedlyStream
}

View File

@ -1,14 +0,0 @@
//
// FeedlyGetStreamIDsService.swift
// Account
//
// Created by Kiel Gillard on 21/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public protocol FeedlyGetStreamIDsService: AnyObject {
@MainActor func getStreamIDs(for resource: FeedlyResourceID, continuation: String?, newerThan: Date?, unreadOnly: Bool?) async throws -> FeedlyStreamIDs
}

View File

@ -1,37 +0,0 @@
//
// FeedlyMarkArticlesService.swift
// Account
//
// Created by Kiel Gillard on 21/10/19.
// Copyright © 2019 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public enum FeedlyMarkAction: String, Sendable {
case read
case unread
case saved
case unsaved
/// These values are paired with the "action" key in POST requests to the markers API.
/// See for example: https://developer.feedly.com/v3/markers/#mark-one-or-multiple-articles-as-read
public var actionValue: String {
switch self {
case .read:
return "markAsRead"
case .unread:
return "keepUnread"
case .saved:
return "markAsSaved"
case .unsaved:
return "markAsUnsaved"
}
}
}
public protocol FeedlyMarkArticlesService: AnyObject {
@MainActor func mark(_ articleIDs: Set<String>, as action: FeedlyMarkAction) async throws
}