Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit bb7aebc

Browse files
authored
Merge pull request #104 from makinosp/develop
Develop
2 parents 25b6873 + d83f653 commit bb7aebc

16 files changed

Lines changed: 62 additions & 17 deletions

.github/workflows/swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
swift: ["6.0"]
20+
swift: ["6.1"]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- uses: SwiftyLab/setup-swift@a0188eaa95c3af0db72e8697c2f0a91c514da86c

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.0
1+
// swift-tools-version: 6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -19,7 +19,7 @@ let package = Package(
1919
)
2020
],
2121
dependencies: [
22-
.package(url: "https://github.com/gohanlon/swift-memberwise-init-macro", from: "0.5.0")
22+
.package(url: "https://github.com/gohanlon/swift-memberwise-init-macro", from: "0.5.2")
2323
],
2424
targets: [
2525
.target(

Sources/VRCKit/Models/SafeDecodingArray.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extension SafeDecodingArray: Decodable where T: Decodable {
2121
if let value = try? container.decode(T.self) {
2222
wrappedValue.append(value)
2323
} else {
24+
// Skip the decorder cursor
2425
_ = try container.decode(AnyDecodable.self)
2526
}
2627
}

Sources/VRCKit/Models/Tag/SystemTagModel.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ public enum SystemTag: String, Hashable, Codable, Sendable {
3131
case systemWorldAccess = "system_world_access"
3232
}
3333

34+
extension SystemTag {
35+
static let rankTags: Set<Self> = [
36+
.systemTrustVeteran,
37+
.systemTrustTrusted,
38+
.systemTrustKnown,
39+
.systemTrustBasic
40+
]
41+
}
42+
3443
extension SystemTag: Identifiable {
3544
public var id: String { rawValue }
3645
}

Sources/VRCKit/Models/Tag/TrustRankModel.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,16 @@ public enum TrustRank: Equatable, Sendable {
1010
}
1111

1212
public extension ProfileElementRepresentable {
13+
var systemTag: SystemTag? {
14+
SystemTag.rankTags.first { tags.systemTags.contains($0) }
15+
}
1316
var trustRank: TrustRank {
14-
let rankTags: [SystemTag] = [
15-
.systemTrustVeteran,
16-
.systemTrustTrusted,
17-
.systemTrustKnown,
18-
.systemTrustBasic
19-
]
20-
let rankTag = rankTags.first { tags.systemTags.contains($0) }
21-
guard let rankTag = rankTag else { return .visitor }
22-
return switch rankTag {
17+
switch systemTag {
2318
case .systemTrustVeteran: .trusted
2419
case .systemTrustTrusted: .known
2520
case .systemTrustKnown: .user
2621
case .systemTrustBasic: .newUser
22+
case nil: .visitor
2723
default: .unknown
2824
}
2925
}

Sources/VRCKit/Models/UnityPackage/UnityPackageModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import MemberwiseInit
1111
@MemberwiseInit(.public)
1212
public struct UnityPackage: Sendable, Identifiable, Hashable {
1313
public let id: String
14-
@InitWrapper(type: SafeDecoding<URL>)
14+
@InitWrapper(type: SafeDecoding<URL>.self)
1515
@SafeDecoding public var assetUrl: URL?
1616
public let assetVersion: Int
1717
public let createdAt: OptionalISO8601Date
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// AgeVerificationModel.swift
3+
// VRCKit
4+
//
5+
// Created by makinosp on 2025/02/26.
6+
//
7+
8+
public enum AgeVerificationStatus: String, Codable, Sendable {
9+
case hidden
10+
case verified
11+
case over18 = "18+"
12+
}

Sources/VRCKit/Models/User/UserCodingKeys.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77

88
public enum UserCodingKeys: String, CodingKey {
9+
case ageVerificationStatus
10+
case ageVerified
911
case bio
1012
case bioLinks
1113
case currentAvatarImageUrl

Sources/VRCKit/Models/User/UserDetailModel+Decodable.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import Foundation
1010
extension UserDetail: Decodable {
1111
public init(from decoder: Decoder) throws {
1212
let container = try decoder.container(keyedBy: UserCodingKeys.self)
13+
ageVerificationStatus = try container.decode(AgeVerificationStatus.self, forKey: .ageVerificationStatus)
14+
ageVerified = try container.decode(Bool.self, forKey: .ageVerified)
1315
bio = try container.decodeIfPresent(String.self, forKey: .bio)
1416
bioLinks = try container.decodeSafeNullableArray(URL.self, forKey: .bioLinks)
1517
avatarImageUrl = try? container.decodeIfPresent(URL.self, forKey: .currentAvatarImageUrl)

0 commit comments

Comments
 (0)