Documentation
¶
Index ¶
- Constants
- Variables
- func Delete(ctx context.Context, app core.App, actorID, id string) error
- func Register(app core.App)
- func SetPinned(ctx context.Context, app core.App, actorID, id string, pinned bool) error
- type Asset
- type CreateInput
- type Document
- func Create(ctx context.Context, app core.App, actorID string, input CreateInput) (Document, error)
- func Get(ctx context.Context, app core.App, actorID, id string) (Document, error)
- func ListPinned(ctx context.Context, app core.App, actorID string) ([]Document, error)
- func MoveToProject(ctx context.Context, app core.App, actorID, id, projectID string) (Document, error)
- func Replace(ctx context.Context, app core.App, actorID, id string, input ReplaceInput) (Document, int, bool, error)
- func Restore(ctx context.Context, app core.App, actorID, id string, ...) (Document, error)
- func Search(ctx context.Context, app core.App, actorID string, options SearchOptions) ([]Document, error)
- func SetArchived(ctx context.Context, app core.App, actorID, id string, archived bool) (Document, error)
- func Update(ctx context.Context, app core.App, actorID, id string, input UpdateInput) (Document, bool, error)
- func WriteChunk(ctx context.Context, app core.App, actorID string, input WriteChunkInput) (Document, error)
- type ReplaceInput
- type SearchOptions
- type UpdateInput
- type Version
- type WriteChunkInput
Constants ¶
View Source
const ( CollectionName = "docs" VersionsCollectionName = "doc_versions" PinsCollectionName = "doc_pins" // KindMarkdown documents use the BlockNote editing flow; KindHTML // documents hold a self-contained HTML artifact rendered in a sandboxed // preview. The kind is fixed at creation: content mutations validate // against the stored kind, never against caller input. KindMarkdown = "markdown" KindHTML = "html" )
View Source
const (
AssetsCollectionName = "doc_assets"
)
Variables ¶
Functions ¶
Types ¶
type Asset ¶ added in v0.0.4
type CreateInput ¶
type Document ¶
type Document struct {
ID string `json:"id"`
Title string `json:"title"`
Kind string `json:"kind"`
Content string `json:"content"`
OwnerID string `json:"ownerId"`
ProjectID string `json:"projectId,omitempty"`
ProjectName string `json:"projectName,omitempty"`
Status string `json:"status"`
Revision int `json:"revision"`
LastEditedBy string `json:"lastEditedBy"`
Created string `json:"created"`
Updated string `json:"updated"`
}
func ListPinned ¶
func MoveToProject ¶
func SetArchived ¶
func WriteChunk ¶ added in v0.0.6
func WriteChunk(ctx context.Context, app core.App, actorID string, input WriteChunkInput) (Document, error)
WriteChunk writes long content in pieces, for callers (mainly AI tools) whose single-call output is limited. Mode "replace" starts a new chunked write: it bumps the revision and records one version. Mode "append" extends the same write: it keeps the revision and syncs that version's snapshot, so a whole chunked session leaves exactly one version entry. Both modes require the caller's baseRevision to match, and each call returns the revision to pass next.
type ReplaceInput ¶
type SearchOptions ¶
type UpdateInput ¶
Click to show internal directories.
Click to hide internal directories.