mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-19 23:00:59 +00:00
28 lines
723 B
Swift
28 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: "")
|
|
}
|
|
}
|
|
}
|