feat(notion): add Notion API client and type definitions

- Define notionPage, notionBlock, notionParent, notionFile and cursor types
- Implement rate-limited HTTP client with context-aware retry and backoff
- Support search, page/block retrieval, database queries, and file downloads
- Add HasChildren field to Resource type, NotionChannel to knowledge types
- Add unit tests for types and client
This commit is contained in:
nullkey
2026-04-06 23:31:38 +08:00
committed by lyingbug
parent d5ecc150e0
commit 9f35abafff
6 changed files with 1279 additions and 0 deletions
+3
View File
@@ -232,6 +232,9 @@ type Resource struct {
// For hierarchical resources (parent ID if applicable)
ParentID string `json:"parent_id,omitempty"`
// Whether this resource has children that can be expanded
HasChildren bool `json:"has_children,omitempty"`
// Additional metadata
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
+1
View File
@@ -28,6 +28,7 @@ const (
ChannelDingtalk = "dingtalk" // DingTalk
ChannelSlack = "slack" // Slack
ChannelIM = "im" // Generic IM channel
ChannelNotion = "notion" // Notion
)
// Knowledge parse status constants