2023-09-27 16:06:32 +08:00
|
|
|
from flask_restful import fields
|
2024-02-06 13:21:13 +08:00
|
|
|
|
2023-09-27 16:06:32 +08:00
|
|
|
from libs.helper import TimestampField
|
|
|
|
|
2024-08-15 12:54:05 +08:00
|
|
|
integrate_icon_fields = {"type": fields.String, "url": fields.String, "emoji": fields.String}
|
2023-09-27 16:06:32 +08:00
|
|
|
|
|
|
|
integrate_page_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"page_name": fields.String,
|
|
|
|
"page_id": fields.String,
|
|
|
|
"page_icon": fields.Nested(integrate_icon_fields, allow_null=True),
|
|
|
|
"is_bound": fields.Boolean,
|
|
|
|
"parent_id": fields.String,
|
|
|
|
"type": fields.String,
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
integrate_workspace_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"workspace_name": fields.String,
|
|
|
|
"workspace_id": fields.String,
|
|
|
|
"workspace_icon": fields.String,
|
|
|
|
"pages": fields.List(fields.Nested(integrate_page_fields)),
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
integrate_notion_info_list_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"notion_info": fields.List(fields.Nested(integrate_workspace_fields)),
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
2024-08-15 12:54:05 +08:00
|
|
|
integrate_icon_fields = {"type": fields.String, "url": fields.String, "emoji": fields.String}
|
2023-09-27 16:06:32 +08:00
|
|
|
|
|
|
|
integrate_page_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"page_name": fields.String,
|
|
|
|
"page_id": fields.String,
|
|
|
|
"page_icon": fields.Nested(integrate_icon_fields, allow_null=True),
|
|
|
|
"parent_id": fields.String,
|
|
|
|
"type": fields.String,
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
integrate_workspace_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"workspace_name": fields.String,
|
|
|
|
"workspace_id": fields.String,
|
|
|
|
"workspace_icon": fields.String,
|
|
|
|
"pages": fields.List(fields.Nested(integrate_page_fields)),
|
|
|
|
"total": fields.Integer,
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
integrate_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"id": fields.String,
|
|
|
|
"provider": fields.String,
|
|
|
|
"created_at": TimestampField,
|
|
|
|
"is_bound": fields.Boolean,
|
|
|
|
"disabled": fields.Boolean,
|
|
|
|
"link": fields.String,
|
|
|
|
"source_info": fields.Nested(integrate_workspace_fields),
|
2023-09-27 16:06:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
integrate_list_fields = {
|
2024-08-15 12:54:05 +08:00
|
|
|
"data": fields.List(fields.Nested(integrate_fields)),
|
|
|
|
}
|