Repository Public
1// SP Notes Core2// File: Sources/SPNotesSync/Repositories/Repositories.swift3// Description: The entry point of the repositories layer: one value built from the store, the API and the engine, giving4// the apps every repository. See docs/REPOSITORIES.md.5//6// Author: Simon-Pierre Boucher7// Contact: contact@spboucher.ai8import Foundation9import SPNotesAPI10import SPNotesStore1112/// Every repository of the apps. A value type: cheap to copy, safe to hand to any `@Observable` model.13public struct NotesRepositories: Sendable {14 public let context: RepositoryContext1516 public init(store: NotesStore, api: NotesAPI, engine: SyncEngine?) {17 context = RepositoryContext(store: store, api: api, engine: engine)18 }1920 public var tasks: TasksRepository { TasksRepository(context: context) }21 public var canvases: CanvasRepository { CanvasRepository(context: context) }22 public var databases: DatabasesRepository { DatabasesRepository(context: context) }23 public var graph: GraphRepository { GraphRepository(context: context) }24 public var timeline: TimelineRepository { TimelineRepository(context: context) }25 public var knowledge: KnowledgeRepository { KnowledgeRepository(context: context) }26 public var research: ResearchRepository { ResearchRepository(context: context) }27 public var inbox: InboxRepository { InboxRepository(context: context) }28 public var search: SearchRepository { SearchRepository(context: context) }29 public var assistant: AssistantRepository { AssistantRepository(context: context) }30 public var audio: AudioRepository { AudioRepository(context: context) }3132 /// What the server supports (nil = never asked yet). Gate UI on `meta.has(ServerFeature.…)`.33 public func features() async -> ServerMeta? { await context.knownFeatures() }34}35