mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 00:28:53 +01:00
Coalesce the various Feedly services files into one file.
This commit is contained in:
parent
47c68aa4cc
commit
db69ddd209
57
Feedly/Sources/Feedly/FeedlyServices.swift
Normal file
57
Feedly/Sources/Feedly/FeedlyServices.swift
Normal 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
|
||||||
|
}
|
@ -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]
|
|
||||||
}
|
|
@ -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]
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user