mirror of
https://github.com/metabolist/metatext.git
synced 2025-02-17 22:45:13 +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 Foundation
|
||||||
import Alamofire
|
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 {
|
protocol HTTPTarget: URLRequestConvertible {
|
||||||
var baseURL: URL { get }
|
var baseURL: URL { get }
|
||||||
var pathComponents: [String] { get }
|
var pathComponents: [String] { get }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
enum AccessTokenEndpoint {
|
enum AccessTokenEndpoint {
|
||||||
case oauthToken(
|
case oauthToken(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
enum AccountEndpoint {
|
enum AccountEndpoint {
|
||||||
case verifyCredentials
|
case verifyCredentials
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
enum AppAuthorizationEndpoint {
|
enum AppAuthorizationEndpoint {
|
||||||
case apps(clientName: String, redirectURI: String, scopes: String, website: URL?)
|
case apps(clientName: String, redirectURI: String, scopes: String, website: URL?)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
enum InstanceEndpoint {
|
enum InstanceEndpoint {
|
||||||
case instance
|
case instance
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Combine
|
import Combine
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
class MastodonClient: HTTPClient {
|
class MastodonClient: HTTPClient {
|
||||||
var instanceURL: URL?
|
var instanceURL: URL?
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
protocol MastodonEndpoint {
|
protocol MastodonEndpoint {
|
||||||
associatedtype ResultType: Decodable
|
associatedtype ResultType: Decodable
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright © 2020 Metabolist. All rights reserved.
|
// Copyright © 2020 Metabolist. All rights reserved.
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import Alamofire
|
|
||||||
|
|
||||||
struct MastodonTarget<E: MastodonEndpoint> {
|
struct MastodonTarget<E: MastodonEndpoint> {
|
||||||
let baseURL: URL
|
let baseURL: URL
|
||||||
|
|
Loading…
Reference in a new issue