0becf7829e
- 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>
62 lines
1.9 KiB
Swift
62 lines
1.9 KiB
Swift
import Foundation
|
|
|
|
public enum SearchMode: String, Sendable, CaseIterable {
|
|
case text, vector, hybrid
|
|
}
|
|
|
|
public struct DocumentListQuery: Sendable {
|
|
public var page: Int = 1
|
|
public var pageSize: Int = 20
|
|
public var domain: String?
|
|
public var subGroup: String?
|
|
public var source: String?
|
|
public var format: String?
|
|
public var reviewStatus: String?
|
|
public var category: String?
|
|
public init() {}
|
|
}
|
|
|
|
public struct MemoListQuery: Sendable {
|
|
public var page: Int = 1
|
|
public var pageSize: Int = 20
|
|
public var pinned: Bool?
|
|
public var archived: Bool?
|
|
public init() {}
|
|
}
|
|
|
|
public struct DocumentUpdate: Codable, Sendable {
|
|
public var title: String?
|
|
public var userNote: String?
|
|
public var pinned: Bool?
|
|
public var reviewStatus: String?
|
|
public init(title: String? = nil, userNote: String? = nil, pinned: Bool? = nil, reviewStatus: String? = nil) {
|
|
self.title = title; self.userNote = userNote; self.pinned = pinned; self.reviewStatus = reviewStatus
|
|
}
|
|
enum CodingKeys: String, CodingKey {
|
|
case title, pinned
|
|
case userNote = "user_note"
|
|
case reviewStatus = "review_status"
|
|
}
|
|
}
|
|
|
|
public struct MemoCreate: Codable, Sendable {
|
|
public var content: String
|
|
public var title: String?
|
|
public var askIncludable: Bool?
|
|
public var sourceChannel: String?
|
|
public init(content: String, title: String? = nil, askIncludable: Bool? = nil, sourceChannel: String? = nil) {
|
|
self.content = content; self.title = title; self.askIncludable = askIncludable; self.sourceChannel = sourceChannel
|
|
}
|
|
enum CodingKeys: String, CodingKey {
|
|
case content, title
|
|
case askIncludable = "ask_includable"
|
|
case sourceChannel = "source_channel"
|
|
}
|
|
}
|
|
|
|
public struct MemoUpdate: Codable, Sendable {
|
|
public var content: String
|
|
public var title: String?
|
|
public init(content: String, title: String? = nil) { self.content = content; self.title = title }
|
|
}
|