mirror of
https://github.com/metabolist/metatext
synced 2024-12-18 12:28:35 +01:00
29 lines
723 B
Swift
29 lines
723 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
struct MastodonAPI {
|
|
static let dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
|
|
struct OAuth {
|
|
static let clientName = "Metatext"
|
|
static let scopes = "read write follow push"
|
|
static let codeCallbackQueryItemName = "code"
|
|
static let grantType = "authorization_code"
|
|
static let callbackURLScheme = "metatext"
|
|
}
|
|
|
|
enum OAuthError {
|
|
case codeNotFound
|
|
}
|
|
}
|
|
|
|
extension MastodonAPI.OAuthError: LocalizedError {
|
|
var errorDescription: String? {
|
|
switch self {
|
|
case .codeNotFound:
|
|
return NSLocalizedString("oauth.error.code-not-found", comment: "")
|
|
}
|
|
}
|
|
}
|