diff options
author | Kilian Koeltzsch <me@kilian.io> | 2021-10-01 14:54:26 +0200 |
---|---|---|
committer | Kilian Koeltzsch <me@kilian.io> | 2021-10-01 14:54:26 +0200 |
commit | d7a4b8e35b28e4cca58957aca8f441559a57065a (patch) | |
tree | db09b89365bcc7ae10e7f93d7f2859ce739a97ee | |
parent | 35c3fe43c3cfdfa5ff8efa3553dcb991c88626b0 (diff) | |
download | MatrixCore-d7a4b8e35b28e4cca58957aca8f441559a57065a.tar.gz MatrixCore-d7a4b8e35b28e4cca58957aca8f441559a57065a.tar.xz MatrixCore-d7a4b8e35b28e4cca58957aca8f441559a57065a.zip |
fix typos
-rw-r--r-- | Sources/MatrixClient/API/Request.swift | 2 | ||||
-rw-r--r-- | Sources/MatrixClient/Error.swift | 4 | ||||
-rw-r--r-- | Sources/MatrixClient/MatrixClient.swift | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Sources/MatrixClient/API/Request.swift b/Sources/MatrixClient/API/Request.swift index cedbd31..be1751b 100644 --- a/Sources/MatrixClient/API/Request.swift +++ b/Sources/MatrixClient/API/Request.swift @@ -51,7 +51,7 @@ public extension MatrixRequest { } @available(swift, introduced: 5.5) - func repsonse(on homeserver: MatrixHomeserver, withToken token: String? = nil, with parameters: URLParameters, withUrlSession urlSession: URLSession = URLSession.shared) async throws -> Response { + func response(on homeserver: MatrixHomeserver, withToken token: String? = nil, with parameters: URLParameters, withUrlSession urlSession: URLSession = URLSession.shared) async throws -> Response { let request = try request(on: homeserver, withToken: token, with: parameters) let (data, urlResponse) = try await urlSession.data(for: request) diff --git a/Sources/MatrixClient/Error.swift b/Sources/MatrixClient/Error.swift index 0998788..90113c6 100644 --- a/Sources/MatrixClient/Error.swift +++ b/Sources/MatrixClient/Error.swift @@ -25,11 +25,11 @@ public enum MatrixError: String, Error, Codable { case ThreePIDInUse = "M_THREEPID_IN_USE" case ThreePIDNotFound = "M_THREEPID_NOT_FOUND" case ServerNotTrusted = "M_SERVER_NOT_TRUSTED" - case GuestAccessforbidden = "M_GUEST_ACCESS_FORBIDDEN" + case GuestAccessForbidden = "M_GUEST_ACCESS_FORBIDDEN" case ConsentNotGiven = "M_CONSENT_NOT_GIVEN" case ResourceLimitExceeded = "M_RESOURCE_LIMIT_EXCEEDED" case BackupWrongKeysVersion = "M_WRONG_ROOM_KEYS_VERSION" - case PasswordToShort = "M_PASSWORD_TOO_SHORT" + case PasswordTooShort = "M_PASSWORD_TOO_SHORT" case PasswordNoDigit = "M_PASSWORD_NO_DIGIT" case PasswordNoUppercase = "M_PASSWORD_NO_UPPERCASE" case PasswordNoLowercase = "M_PASSWORD_NO_LOWERCASE" diff --git a/Sources/MatrixClient/MatrixClient.swift b/Sources/MatrixClient/MatrixClient.swift index a3164ab..3ae2cd7 100644 --- a/Sources/MatrixClient/MatrixClient.swift +++ b/Sources/MatrixClient/MatrixClient.swift @@ -34,7 +34,7 @@ public struct MatrixClient { /// ``` @available(swift, introduced: 5.5) public func getVersions() async throws -> MatrixServerInfo { - return try await MatrixServerInfoRequest().repsonse(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) + return try await MatrixServerInfoRequest().response(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) } /// Gets discovery information about the domain. The file may include additional keys, which MUST follow the Java package naming convention, @@ -48,7 +48,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func getWellKnown() async throws -> MatrixWellKnown { - return try await MatrixWellKnownRequest().repsonse(on: homeserver, with: (), withUrlSession: urlSession) + return try await MatrixWellKnownRequest().response(on: homeserver, with: (), withUrlSession: urlSession) } /// Gets the homeserver's supported login types to authenticate users. Clients should pick one of these and supply it as the type when logging in. @@ -59,7 +59,7 @@ public struct MatrixClient { /// ``` @available(swift, introduced: 5.5) public func getLoginFlows() async throws -> [MatrixLoginFlow] { - let flows = try await MatrixLoginFlowRequest().repsonse(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) + let flows = try await MatrixLoginFlowRequest().response(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) return flows.flows.map({$0.type}) } @@ -106,7 +106,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func login(request: MatrixLoginRequest) async throws -> MatrixLogin { - return try await request.repsonse(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) + return try await request.response(on: homeserver, withToken: accessToken, with: (), withUrlSession: urlSession) } // 5.5.3 POST /_matrix/client/r0/logout @@ -121,7 +121,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func logout() async throws { - let _ = try await MatrixLogoutRequest().repsonse(on: homeserver, withToken: accessToken, with: false, withUrlSession: urlSession) + let _ = try await MatrixLogoutRequest().response(on: homeserver, withToken: accessToken, with: false, withUrlSession: urlSession) } /// Invalidates all access tokens for a user, so that they can no longer be used for authorization. This includes the access token that made this request. @@ -138,7 +138,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func logoutAll() async throws { - let _ = try await MatrixLogoutRequest().repsonse(on: homeserver, withToken: accessToken, with: true, withUrlSession: urlSession) + let _ = try await MatrixLogoutRequest().response(on: homeserver, withToken: accessToken, with: true, withUrlSession: urlSession) } /// Uploads a new filter definition to the homeserver. Returns a filter ID that may be used in future requests to restrict which events are returned to the client. @@ -149,7 +149,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func setFilter(userId: String, filter: MatrixFilter) async throws -> MatrixFilterId { - var id = try await filter.repsonse(on: homeserver, withToken: accessToken, with: userId, withUrlSession: urlSession) + var id = try await filter.response(on: homeserver, withToken: accessToken, with: userId, withUrlSession: urlSession) id.user = userId return id @@ -175,7 +175,7 @@ public struct MatrixClient { ///``` @available(swift, introduced: 5.5) public func getFilter(with id: MatrixFilterId) async throws -> MatrixFilter { - return try await MatrixFilterRequest().repsonse(on: homeserver, withToken: accessToken, with: id, withUrlSession: urlSession) + return try await MatrixFilterRequest().response(on: homeserver, withToken: accessToken, with: id, withUrlSession: urlSession) } } |