mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
e5bfc3a26d
Expose OpenID tokens and homeserver credentials from the client proxy, and add fork-only services for the HealthChat member directory backend (api.healthchat.ch) plus a service that reads MSC4133 extended profile fields directly from the homeserver. Groundwork for the members tab and the profile screens. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS
30 lines
958 B
Swift
30 lines
958 B
Swift
//
|
|
// Copyright 2026 Element Creations Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum HealthChatAPIError: Error, Equatable {
|
|
case tokenAcquisitionFailed
|
|
case unauthorized
|
|
case networkFailure
|
|
case decodingFailure
|
|
case httpStatus(Int)
|
|
}
|
|
|
|
// sourcery: AutoMockable
|
|
protocol HealthChatAPIServiceProtocol {
|
|
func members(searchQuery: String?) async -> Result<HealthChatMembersResponse, HealthChatAPIError>
|
|
|
|
func ownProfile() async -> Result<HealthChatMember, HealthChatAPIError>
|
|
|
|
func updateOwnProfile(_ update: HealthChatProfileUpdate) async -> Result<Void, HealthChatAPIError>
|
|
|
|
func profileCompleteness() async -> Result<HealthChatProfileCompleteness, HealthChatAPIError>
|
|
|
|
func inviteMember(email: String, personalNote: String) async -> Result<Void, HealthChatAPIError>
|
|
}
|