53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
|
|
"""Notion 厂商集成元数据。
|
|||
|
|
|
|||
|
|
定义 ``IntegrationMetadata(key="notion", ...)``,由 ``__init__.py`` 自注册到
|
|||
|
|
``IntegrationRegistry``。元数据为内存态,不持久化到数据库。
|
|||
|
|
"""
|
|||
|
|
|
|||
|
|
from __future__ import annotations
|
|||
|
|
|
|||
|
|
from yuxi.external_systems.integrations.schemas import IntegrationMetadata
|
|||
|
|
|
|||
|
|
NOTION_METADATA = IntegrationMetadata(
|
|||
|
|
key="notion",
|
|||
|
|
display_name="Notion",
|
|||
|
|
description="Notion 知识库集成,支持数据库查询、页面/块 CRUD、用户与工作区元数据发现",
|
|||
|
|
adapter_type="http",
|
|||
|
|
source_types=["notion"],
|
|||
|
|
supported_auth_types=[
|
|||
|
|
"notion_integration_token",
|
|||
|
|
"oauth2_authorization_code",
|
|||
|
|
"bearer", # 首期降级方案
|
|||
|
|
],
|
|||
|
|
tags=["document", "knowledge_base", "collaboration"],
|
|||
|
|
icon="notion",
|
|||
|
|
docs_url="https://developers.notion.com/reference/intro",
|
|||
|
|
connection_extra_schema={
|
|||
|
|
"type": "object",
|
|||
|
|
"properties": {
|
|||
|
|
"base_url": {
|
|||
|
|
"type": "string",
|
|||
|
|
"default": "https://api.notion.com/v1",
|
|||
|
|
"description": "Notion API 基础 URL",
|
|||
|
|
},
|
|||
|
|
"notion_version": {
|
|||
|
|
"type": "string",
|
|||
|
|
"default": "2022-06-28",
|
|||
|
|
"description": "Notion-Version 头部值",
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
"required": ["base_url"],
|
|||
|
|
},
|
|||
|
|
example_config={
|
|||
|
|
"base_url": "https://api.notion.com/v1",
|
|||
|
|
"notion_version": "2022-06-28",
|
|||
|
|
},
|
|||
|
|
dependency_note=(
|
|||
|
|
"1. 至少配置一种认证方式(notion_integration_token / oauth2_authorization_code / bearer);"
|
|||
|
|
"2. Internal Integration Token 需在 Notion App 设置页创建并勾选所需能力"
|
|||
|
|
"(read_content / update_content / insert_content / read_users);"
|
|||
|
|
"3. 数据库查询工具需通过 discover 阶段拉取数据库结构后生成专属参数 schema;"
|
|||
|
|
"4. 块内容解析仅支持常见块类型(paragraph / heading / list / to_do / toggle / quote / code / divider)。"
|
|||
|
|
),
|
|||
|
|
)
|