Files
Outpost/OutlineKit/Sources/OutlineKit/Requests/UpdateDocumentRequest.swift
T
Puranjay Savar Mattas 86e7aa5800 feat(reader): document toolbar - viewers, share, edit, pin/subscribe, menu
Adds the full document reader toolbar: recent-viewer avatar stack
(views.list, polled every 20s, filtered to entries with a
lastViewedAt), Share button (shares.create/info/update), Edit/Done
toggle that switches the reader into an editable NativeTextViewWrapper
and saves via documents.update (last-write-wins REST editing, per
CLAUDE.md's Phase 1 scope - full realtime CRDT collaboration is a
separate, much larger effort, see the Collaboration/ skeleton in this
branch), New Document button, and an overflow menu with the same
action set as the sidebar's document context menu plus this session's
additions: Star/Unstar (shared StarStore), Pin/Unpin and
Subscribe/Unsubscribe (pins.*/subscriptions.* - not in the vendored
OpenAPI spec, reconstructed from Outline's actual API surface and
flagged as best-effort in code comments), Enable Viewer Insights,
Enable Embeds (speculative field on documents.update), and Full
Width (toggles + reads back Document.fullWidth, now added to the
model).

Also replaces the always-expanded .searchable contextual search field
with a plain icon that expands into a field on click.

OutlineKit: shares.*, pins.* (best-effort), subscriptions.*
(best-effort), views.list, with test coverage for the endpoints that
are in the vendored spec.
2026-08-14 02:53:54 +01:00

35 lines
1.1 KiB
Swift

import Foundation
public struct UpdateDocumentRequest: Encodable, Sendable {
public let id: String
public let title: String?
public let text: String?
public let append: Bool?
public let fullWidth: Bool?
public let insightsEnabled: Bool?
/// Not in the vendored spec's `Document`/`documents.update` shape at all
/// (only a workspace-level `documentEmbeds` flag exists there) — included
/// speculatively since the field may exist on newer self-hosted servers.
/// Unrecognized fields are typically ignored server-side rather than
/// rejected, so this is low-risk even if unsupported.
public let documentEmbeds: Bool?
public init(
id: String,
title: String? = nil,
text: String? = nil,
append: Bool? = nil,
fullWidth: Bool? = nil,
insightsEnabled: Bool? = nil,
documentEmbeds: Bool? = nil
) {
self.id = id
self.title = title
self.text = text
self.append = append
self.fullWidth = fullWidth
self.insightsEnabled = insightsEnabled
self.documentEmbeds = documentEmbeds
}
}