Documentation
¶
Index ¶
- type BackLink
- type BlockEntity
- type BlockInput
- type BlockRef
- type BlockSummary
- type CreatePageInput
- type DeleteBlockInput
- type EnrichedBlock
- type EnrichedPage
- type FileInfo
- type FindByTagInput
- type FindConnectionsInput
- type FlashcardCreateInput
- type FlashcardDueInput
- type FlashcardOverviewInput
- type GetBlockInput
- type GetLinksInput
- type GetPageInput
- type GetReferencesInput
- type GetWhiteboardInput
- type GraphOverviewInput
- type JournalRangeInput
- type JournalSearchInput
- type KnowledgeGapsInput
- type LinkPagesInput
- type ListPagesInput
- type ListWhiteboardsInput
- type LogseqAPIRequest
- type MoveBlockInput
- type NamespaceInfo
- type PageEntity
- type PageRef
- type ParsedContent
- type QueryDatalogInput
- type QueryPropertiesInput
- type SearchInput
- type TopicClustersInput
- type TraverseInput
- type UpdateBlockInput
- type UpsertBlocksInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackLink ¶
type BackLink struct {
PageName string `json:"pageName"`
Blocks []BlockSummary `json:"blocks"` // the specific blocks containing the link
}
BackLink represents an incoming link from another page.
type BlockEntity ¶
type BlockEntity struct {
ID int `json:"id"`
UUID string `json:"uuid"`
Content string `json:"content"`
Format string `json:"format,omitempty"`
Marker string `json:"marker,omitempty"` // TODO, DOING, DONE, etc.
Priority string `json:"priority,omitempty"` // A, B, C
Page *PageRef `json:"page,omitempty"`
Left *BlockRef `json:"left,omitempty"`
Parent *BlockRef `json:"parent,omitempty"`
Children []BlockEntity `json:"children,omitempty"`
Properties map[string]any `json:"properties,omitempty"`
PropertiesOrder []string `json:"propertiesOrder,omitempty"`
PathRefs []PageRef `json:"pathRefs,omitempty"`
Refs []PageRef `json:"refs,omitempty"`
PreBlock bool `json:"preBlock,omitempty"`
}
BlockEntity represents a Logseq block (the atomic unit of knowledge).
type BlockInput ¶
type BlockInput struct {
Content string `json:"content" jsonschema:"Block text content"`
Properties map[string]string `json:"properties,omitempty" jsonschema:"Block properties"`
Children []BlockInput `json:"children,omitempty" jsonschema:"Nested child blocks"`
}
type BlockRef ¶
type BlockRef struct {
ID int `json:"id"`
}
BlockRef is a lightweight block reference.
func (*BlockRef) UnmarshalJSON ¶
UnmarshalJSON handles Logseq returning BlockRef as either {"id": N} or plain N.
type BlockSummary ¶
BlockSummary is a lightweight block representation for context.
type CreatePageInput ¶
type DeleteBlockInput ¶
type DeleteBlockInput struct {
UUID string `json:"uuid" jsonschema:"UUID of block to delete"`
}
type EnrichedBlock ¶
type EnrichedBlock struct {
BlockEntity
Parsed ParsedContent `json:"parsed"`
Ancestors []BlockSummary `json:"ancestors,omitempty"` // path from root to this block
Siblings []BlockSummary `json:"siblings,omitempty"`
}
EnrichedBlock extends BlockEntity with parsed content and ancestor chain.
type EnrichedPage ¶
type EnrichedPage struct {
PageEntity
Blocks []EnrichedBlock `json:"blocks"`
OutgoingLinks []string `json:"outgoingLinks"` // pages this page links to
BackLinks []BackLink `json:"backlinks"` // pages that link to this page
BlockCount int `json:"blockCount"`
LinkCount int `json:"linkCount"`
}
EnrichedPage extends PageEntity with its full block tree and link data.
type FindByTagInput ¶
type FindConnectionsInput ¶
type FlashcardCreateInput ¶
type FlashcardDueInput ¶
type FlashcardDueInput struct {
Limit int `json:"limit,omitempty" jsonschema:"Max cards to return. Default: 20"`
}
type FlashcardOverviewInput ¶
type FlashcardOverviewInput struct{}
FlashcardOverviewInput has no required params — returns SRS statistics.
type GetBlockInput ¶
type GetBlockInput struct {
UUID string `json:"uuid" jsonschema:"Block UUID to retrieve"`
IncludeAncestors bool `json:"includeAncestors,omitempty" jsonschema:"Include ancestor chain from root. Default: true"`
IncludeSiblings bool `json:"includeSiblings,omitempty" jsonschema:"Include sibling blocks. Default: false"`
}
type GetLinksInput ¶
type GetPageInput ¶
type GetReferencesInput ¶
type GetReferencesInput struct {
UUID string `json:"uuid" jsonschema:"Block UUID to find references for"`
}
type GetWhiteboardInput ¶
type GetWhiteboardInput struct {
Name string `json:"name" jsonschema:"Whiteboard name"`
}
type GraphOverviewInput ¶
type GraphOverviewInput struct{}
GraphOverviewInput has no required params — returns global stats.
type JournalRangeInput ¶
type JournalSearchInput ¶
type KnowledgeGapsInput ¶
type KnowledgeGapsInput struct{}
KnowledgeGapsInput has no required params — returns sparse areas.
type LinkPagesInput ¶
type ListPagesInput ¶
type ListPagesInput struct {
Namespace string `json:"namespace,omitempty" jsonschema:"Filter by namespace prefix (e.g. graphthulhu)"`
HasProperty string `json:"hasProperty,omitempty" jsonschema:"Filter to pages with this property key"`
HasTag string `json:"hasTag,omitempty" jsonschema:"Filter to pages with this tag"`
SortBy string `json:"sortBy,omitempty" jsonschema:"Sort by: name or modified or created. Default: name"`
Limit int `json:"limit,omitempty" jsonschema:"Max results. Default: 50"`
}
type ListWhiteboardsInput ¶
type ListWhiteboardsInput struct{}
ListWhiteboardsInput has no required params.
type LogseqAPIRequest ¶
LogseqAPIRequest is the JSON body sent to the Logseq HTTP API.
type MoveBlockInput ¶
type NamespaceInfo ¶
type NamespaceInfo struct {
ID int `json:"id"`
}
NamespaceInfo contains namespace hierarchy data.
type PageEntity ¶
type PageEntity struct {
ID int `json:"id"`
UUID string `json:"uuid"`
Name string `json:"name"`
OriginalName string `json:"originalName"`
Journal bool `json:"journal?"`
JournalDay int `json:"journalDay,omitempty"`
Namespace *NamespaceInfo `json:"namespace,omitempty"`
Properties map[string]any `json:"properties,omitempty"`
PropertiesOrder []string `json:"propertiesOrder,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
File *FileInfo `json:"file,omitempty"`
}
PageEntity represents a Logseq page.
type PageRef ¶
PageRef is a lightweight page reference (used in block refs and path refs).
func (*PageRef) UnmarshalJSON ¶
UnmarshalJSON handles Logseq returning PageRef as either {"id": N} or plain N.
type ParsedContent ¶
type ParsedContent struct {
Raw string `json:"raw"`
Links []string `json:"links"` // [[page name]]
BlockReferences []string `json:"blockReferences"` // ((uuid))
Tags []string `json:"tags"` // #tag
Properties map[string]string `json:"properties,omitempty"` // key:: value
Marker string `json:"marker,omitempty"` // TODO, DOING, DONE
Priority string `json:"priority,omitempty"` // [#A], [#B], [#C]
}
ParsedContent holds structured data extracted from block content.
type QueryDatalogInput ¶
type QueryPropertiesInput ¶
type QueryPropertiesInput struct {
Property string `json:"property" jsonschema:"Property key to search for"`
Value string `json:"value,omitempty" jsonschema:"Property value to match (omit to find all with this property)"`
Operator string `json:"operator,omitempty" jsonschema:"Comparison: eq or contains or gt or lt. Default: eq"`
}
type SearchInput ¶
type TopicClustersInput ¶
type TopicClustersInput struct{}
TopicClustersInput has no required params — returns community clusters.
type TraverseInput ¶
type UpdateBlockInput ¶
type UpsertBlocksInput ¶
type UpsertBlocksInput struct {
Page string `json:"page" jsonschema:"Page name to add blocks to"`
Blocks []BlockInput `json:"blocks" jsonschema:"Blocks to create or update"`
Position string `json:"position,omitempty" jsonschema:"Where to add: append or prepend. Default: append"`
}