Skip to content

Commit

Permalink
feat: api service protocols conform to Sendable protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
makinosp committed Sep 23, 2024
1 parent dead58a commit eb67cb9
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public protocol UserOrRequires: Sendable {}
extension User: UserOrRequires {}
extension VerifyType: UserOrRequires {}

public protocol AuthenticationServiceProtocol {
public protocol AuthenticationServiceProtocol: Sendable {
func isExists(userId: String) async throws -> Bool
func loginUserInfo() async throws -> UserOrRequires
func verify2FA(verifyType: VerifyType, code: String) async throws -> Bool
Expand Down
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/FavoriteServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by makinosp on 2024/07/14.
//

public protocol FavoriteServiceProtocol {
public protocol FavoriteServiceProtocol: Sendable {
func listFavoriteGroups() async throws -> [FavoriteGroup]
func listFavorites(n: Int, type: FavoriteType, tag: String?) async throws -> [Favorite]
func fetchFavoriteGroupDetails(favoriteGroups: [FavoriteGroup]) async throws -> [FavoriteDetail]
Expand Down
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/FriendServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by makinosp on 2024/07/14.
//

public protocol FriendServiceProtocol {
public protocol FriendServiceProtocol: Sendable {
func fetchFriends(offset: Int, n: Int, offline: Bool) async throws -> [Friend]
func fetchFriends(count: Int, offline: Bool) async throws -> [Friend]
func unfriend(id: String) async throws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public protocol ImageUrlRepresentable {
public protocol ImageUrlRepresentable: Sendable {
func imageUrl(_ resolution: ImageResolution) -> URL?
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/InstanceServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by makinosp on 2024/07/14.
//

public protocol InstanceServiceProtocol {
public protocol InstanceServiceProtocol: Sendable {
func fetchInstance(worldId: String, instanceId: String) async throws -> Instance
func fetchInstance(location: String) async throws -> Instance
}
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/LocationProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

/// Represents a type that has a location string.
public protocol LocationRepresentable {
public protocol LocationRepresentable: Sendable {
var location: Location { get }
var isVisible: Bool { get }
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/ProfileProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// A protocol representing common properties for user profile elements.
/// This protocol can be adopted by structures such as User, Friend, and UserDetail.
public protocol ProfileElementRepresentable: Hashable, Identifiable, ImageUrlRepresentable {
public protocol ProfileElementRepresentable: Sendable, Hashable, Identifiable, ImageUrlRepresentable {
var bio: String? { get }
var bioLinks: SafeDecodingArray<URL> { get }
var avatarImageUrl: URL? { get }
Expand Down
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/UserNoteServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by makinosp on 2024/07/14.
//

public protocol UserNoteServiceProtocol {
public protocol UserNoteServiceProtocol: Sendable {
func updateUserNote(targetUserId: String, note: String) async throws -> UserNoteResponse
func clearUserNote(targetUserId: String) async throws
}
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/UserServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by makinosp on 2024/07/14.
//

public protocol UserServiceProtocol {
public protocol UserServiceProtocol: Sendable {
func fetchUser(userId: String) async throws -> UserDetail
func updateUser(id: String, editedInfo: EditableUserInfo) async throws
}
2 changes: 1 addition & 1 deletion Sources/VRCKit/Protocols/WorldServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by kiripoipoi on 2024/09/07.
//

public protocol WorldServiceProtocol {
public protocol WorldServiceProtocol: Sendable {
func fetchWorld(worldId: String) async throws -> World
func fetchFavoritedWorlds() async throws -> [World]
}

0 comments on commit eb67cb9

Please sign in to comment.