File size: 1,652 Bytes
a8b3f00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from flask_restful import fields

from libs.helper import TimestampField

integrate_icon_fields = {"type": fields.String, "url": fields.String, "emoji": fields.String}

integrate_page_fields = {
    "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,
}

integrate_workspace_fields = {
    "workspace_name": fields.String,
    "workspace_id": fields.String,
    "workspace_icon": fields.String,
    "pages": fields.List(fields.Nested(integrate_page_fields)),
}

integrate_notion_info_list_fields = {
    "notion_info": fields.List(fields.Nested(integrate_workspace_fields)),
}

integrate_icon_fields = {"type": fields.String, "url": fields.String, "emoji": fields.String}

integrate_page_fields = {
    "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,
}

integrate_workspace_fields = {
    "workspace_name": fields.String,
    "workspace_id": fields.String,
    "workspace_icon": fields.String,
    "pages": fields.List(fields.Nested(integrate_page_fields)),
    "total": fields.Integer,
}

integrate_fields = {
    "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),
}

integrate_list_fields = {
    "data": fields.List(fields.Nested(integrate_fields)),
}