mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-15 13:01:26 +00:00
Refactoring
This commit is contained in:
parent
827c3cfc77
commit
0755e81ed9
8 changed files with 6 additions and 7 deletions
|
@ -3,6 +3,12 @@
|
|||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
typealias HTTPMethod = Alamofire.HTTPMethod
|
||||
typealias HTTPHeaders = Alamofire.HTTPHeaders
|
||||
typealias ParameterEncoding = Alamofire.ParameterEncoding
|
||||
typealias URLEncoding = Alamofire.URLEncoding
|
||||
typealias JSONEncoding = Alamofire.JSONEncoding
|
||||
|
||||
protocol HTTPTarget: URLRequestConvertible {
|
||||
var baseURL: URL { get }
|
||||
var pathComponents: [String] { get }
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
enum AccessTokenEndpoint {
|
||||
case oauthToken(
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
enum AccountEndpoint {
|
||||
case verifyCredentials
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
enum AppAuthorizationEndpoint {
|
||||
case apps(clientName: String, redirectURI: String, scopes: String, website: URL?)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
enum InstanceEndpoint {
|
||||
case instance
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Alamofire
|
||||
|
||||
class MastodonClient: HTTPClient {
|
||||
var instanceURL: URL?
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
protocol MastodonEndpoint {
|
||||
associatedtype ResultType: Decodable
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright © 2020 Metabolist. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Alamofire
|
||||
|
||||
struct MastodonTarget<E: MastodonEndpoint> {
|
||||
let baseURL: URL
|
||||
|
|
Loading…
Reference in a new issue