mirror of
https://github.com/dstotijn/go-notion.git
synced 2025-06-27 00:41:07 +02:00
Add support for link_preview
block type and rich text mentions
This commit is contained in:
2
block.go
2
block.go
@ -40,6 +40,7 @@ type Block struct {
|
||||
Breadcrumb *Breadcrumb `json:"breadcrumb,omitempty"`
|
||||
ColumnList *ColumnList `json:"column_list,omitempty"`
|
||||
Column *Column `json:"column,omitempty"`
|
||||
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
|
||||
}
|
||||
|
||||
type RichTextBlock struct {
|
||||
@ -149,6 +150,7 @@ const (
|
||||
BlockTypeBreadCrumb BlockType = "breadcrumb"
|
||||
BlockTypeColumnList BlockType = "column_list"
|
||||
BlockTypeColumn BlockType = "column"
|
||||
BlockTypeLinkPreview BlockType = "link_preview"
|
||||
BlockTypeUnsupported BlockType = "unsupported"
|
||||
)
|
||||
|
||||
|
22
rich_text.go
22
rich_text.go
@ -27,10 +27,11 @@ type Annotations struct {
|
||||
type Mention struct {
|
||||
Type MentionType `json:"type"`
|
||||
|
||||
User *User `json:"user,omitempty"`
|
||||
Page *ID `json:"page,omitempty"`
|
||||
Database *ID `json:"database,omitempty"`
|
||||
Date *Date `json:"date,omitempty"`
|
||||
User *User `json:"user,omitempty"`
|
||||
Page *ID `json:"page,omitempty"`
|
||||
Database *ID `json:"database,omitempty"`
|
||||
Date *Date `json:"date,omitempty"`
|
||||
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
|
||||
}
|
||||
|
||||
type Date struct {
|
||||
@ -38,6 +39,10 @@ type Date struct {
|
||||
End *DateTime `json:"end,omitempty"`
|
||||
}
|
||||
|
||||
type LinkPreview struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type Text struct {
|
||||
Content string `json:"content"`
|
||||
Link *Link `json:"link,omitempty"`
|
||||
@ -64,10 +69,11 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
MentionTypeUser MentionType = "user"
|
||||
MentionTypePage MentionType = "page"
|
||||
MentionTypeDatabase MentionType = "database"
|
||||
MentionTypeDate MentionType = "date"
|
||||
MentionTypeUser MentionType = "user"
|
||||
MentionTypePage MentionType = "page"
|
||||
MentionTypeDatabase MentionType = "database"
|
||||
MentionTypeDate MentionType = "date"
|
||||
MentionTypeLinkPreview MentionType = "link_preview"
|
||||
)
|
||||
|
||||
const (
|
||||
|
Reference in New Issue
Block a user