notion

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations struct {
	Bold          bool   `json:"bold"`
	Italic        bool   `json:"italic"`
	Strikethrough bool   `json:"strikethrough"`
	Underline     bool   `json:"underline"`
	Code          bool   `json:"code"`
	Color         string `json:"color"`
}

Annotations stores styling information for the text (e.g., bold, italic)

type Config

type Config struct {
	Token string `config:"token"`
}

type CoverImage

type CoverImage struct {
	Type     string `json:"type"`
	External struct {
		URL string `json:"url"`
	} `json:"external"`
}

CoverImage represents the cover image for a page

type Filter

type Filter struct {
	Value    string `json:"value,omitempty"`
	Property string `json:"property,omitempty"`
}

Filter represents the filter options used in a search query

type Link struct {
	URL string `json:"url"`
}

Link represents a hyperlink inside the text

type ParentInfo

type ParentInfo struct {
	Type       string `json:"type"`
	DatabaseID string `json:"database_id,omitempty"`
	PageID     string `json:"page_id,omitempty"`
}

ParentInfo contains information about the parent of a page or database

type Plugin

type Plugin struct {
	api.Handler
	Enabled  bool               `config:"enabled"`
	Queue    *queue.QueueConfig `config:"queue"`
	Interval string             `config:"interval"`
	PageSize int                `config:"page_size"`
}

func (*Plugin) Name

func (this *Plugin) Name() string

func (*Plugin) Setup

func (this *Plugin) Setup()

func (*Plugin) Start

func (this *Plugin) Start() error

func (*Plugin) Stop

func (this *Plugin) Stop() error

type Property

type Property struct {
	ID    string      `json:"id"`
	Type  string      `json:"type"`
	Title []TitleItem `json:"title"`
}

Property represents the various property types in a Notion page (e.g., title, rich_text, etc.)

type SearchItem

type SearchItem struct {
	Object     string                 `json:"object"`
	ID         string                 `json:"id"`
	Created    time.Time              `json:"created_time"`
	Updated    time.Time              `json:"last_edited_time"`
	Archived   bool                   `json:"archived"`
	Properties map[string]interface{} `json:"properties"`

	//database
	Title []TitleItem `json:"title"`

	Parent       ParentInfo  `json:"parent"`
	Cover        CoverImage  `json:"cover"`
	Icon         interface{} `json:"icon"`
	CreatedBy    interface{} `json:"created_by"`
	LastEditedBy interface{} `json:"last_edited_by"`
	Url          string      `json:"url"`
}

SearchItem represents an individual item in the search results

type SearchOptions

type SearchOptions struct {
	Query       string `json:"query,omitempty"`
	Filter      Filter `json:"filter,omitempty"`
	Sort        Sort   `json:"sort,omitempty"`
	StartCursor string `json:"start_cursor,omitempty"`
	PageSize    int    `json:"page_size,omitempty"`
}

SearchOptions allows for filtering and customizing search queries

type SearchResult

type SearchResult struct {
	Object         string       `json:"object"`
	Results        []SearchItem `json:"results"`
	NextCursor     string       `json:"next_cursor"`
	HasMore        bool         `json:"has_more"`
	Type           string       `json:"type"`
	PageOrDatabase interface{}  `json:"page_or_database"`
}

SearchResult represents the response from the Notion Search API

type Sort

type Sort struct {
	Property  string `json:"property,omitempty"`
	Direction string `json:"direction,omitempty"`
}

Sort defines how the results should be ordered

type TextContent

type TextContent struct {
	Content string `json:"content"`
	Link    *Link  `json:"link"`
}

TextContent holds the text content of the title item

type TitleItem

type TitleItem struct {
	Type        string      `json:"type"`
	Text        TextContent `json:"text"`
	Annotations Annotations `json:"annotations"`
	PlainText   string      `json:"plain_text"`
	Href        string      `json:"href"`
}

TitleItem represents each item in a title property

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL