Files
hyungi_document_server/Sources/DSKit/Models/Auth.swift
T
Hyungi 0becf7829e feat(s3): SwiftPM scaffold + DSKit data layer + 14-fixture acceptance
- Package.swift: AI (S2-owned) + DSKit (models/client/fixtures) + DSKitTests, tools 6.2, .swiftLanguageMode(.v6), .macOS(.v26)
- JSONValue (Sendable AnyCodable), DSDate (value-type ISO8601FormatStyle cascade, date-only UTC), explicit-CodingKeys decoder
- Models: Auth/Document(+Detail flat-compose, MD-first)/Catalog/Search+Ask/Memo/Digest; non-optional limited to id/file_type/created+updated_at/total
- DSClient protocol + FixtureDSClient (Bundle.module, zero backend) + DSError + DSConfig + DownloadURL (?token= query)
- Tests: 14-fixture contract acceptance (value asserts) + JSONValue number trap + Ask round-trip + AI router fallback/explicit-unavailable

swift build + swift test green (19 tests). Sources/AI untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 17:16:55 +09:00

29 lines
782 B
Swift

import Foundation
public struct AccessTokenResponse: Codable, Sendable, Equatable {
public let accessToken: String
public let tokenType: String
enum CodingKeys: String, CodingKey {
case accessToken = "access_token"
case tokenType = "token_type"
}
}
public struct UserResponse: Codable, Sendable, Equatable, Identifiable {
public let id: Int
public let username: String
public let isActive: Bool
public let totpEnabled: Bool
public let lastLoginAtRaw: String?
public var lastLoginAt: Date? { DSDate.parse(lastLoginAtRaw) }
enum CodingKeys: String, CodingKey {
case id, username
case isActive = "is_active"
case totpEnabled = "totp_enabled"
case lastLoginAtRaw = "last_login_at"
}
}