Files
hyungi_document_server/clients/ds-app/Sources/DSKit/DSClient.swift
T
hyungi f527c63232 feat(ds-app): macOS 앱 마무리 — 업로드·다운로드·로그아웃 + 4섹션 페이지
- FU-C 멀티파트 업로드(DSClient.uploadDocument + LiveDSClient 401 재시도 공유 + 툴바/상태바)
- FU-D 네이티브 다운로드(NSSavePanel + URLSession, ?token= 미노출, 임시파일 정리)
- 로그아웃(AppModel.logout 세션 전체 초기화 + 계정 메뉴)
- 셸 2-column 재구성: 질문/이드 제거, 홈 코크핏 + 문서 3-pane 컬럼 브라우저
  (인스펙터 TL;DR/핵심점/심층/불일치) + 도메인 필터 전체 load-all
- 적대 리뷰 반영(stale 401 데모션·다운로드 임시파일 정리·메모 저장 saveMemo 경유·도메인 필터 선택 정합)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 14:52:29 +09:00

46 lines
2.4 KiB
Swift

import Foundation
/// The single networking seam the whole app codes against. The app builds entirely on
/// `FixtureDSClient` (zero backend); `LiveDSClient` (FU-A) drops in later unchanged.
///
/// `ask(backend:)` keeps `backend` as `String?` (raw AI-ROUTING §4 values) S2 maps AIProviderID
/// to that string. This shape is locked by AI-ROUTING.md §4 (a documented contract), verified at
/// integration by the FU-B call-shape regression.
public protocol DSClient: Sendable {
// Auth
func login(username: String, password: String, totpCode: String?) async throws -> AccessTokenResponse
func me() async throws -> UserResponse
func refresh() async throws -> AccessTokenResponse
func logout() async throws
// Documents
func documents(_ query: DocumentListQuery) async throws -> DocumentListResponse
func document(id: Int) async throws -> DocumentDetailResponse
func documentContent(id: Int) async throws -> DocumentContentResponse
func documentTree() async throws -> [DomainTreeNode]
func categoryCounts() async throws -> CategoryCounts
func duplicates() async throws -> DuplicatesResponse
func patchDocument(id: Int, _ update: DocumentUpdate) async throws -> DocumentResponse
func putContent(id: Int, content: String) async throws
func deleteDocument(id: Int) async throws
/// (POST /documents/) Inbox + . 201 DocumentResponse.
func uploadDocument(_ upload: DocumentUpload) async throws -> DocumentResponse
// Search / Ask
func search(q: String, mode: SearchMode?, page: Int?, debug: Bool?) async throws -> SearchResponse
func ask(q: String, limit: Int?, backend: String?, debug: Bool?) async throws -> AskResponse
// Memos
func memos(_ query: MemoListQuery) async throws -> MemoListResponse
func memo(id: Int) async throws -> MemoResponse
func createMemo(_ create: MemoCreate) async throws -> MemoResponse
func patchMemo(id: Int, _ update: MemoUpdate) async throws -> MemoResponse
func pinMemo(id: Int, pinned: Bool) async throws -> MemoResponse
func archiveMemo(id: Int, archived: Bool) async throws -> MemoResponse
func toggleMemoTask(id: Int, taskIndex: Int, checked: Bool) async throws -> MemoResponse
func deleteMemo(id: Int) async throws
// Digest
func digest(date: String?, country: String?) async throws -> DigestResponse
}