dlt-hub / verified-sources

Contribute to dlt verified sources 🔥
https://dlthub.com/docs/walkthroughs/add-a-verified-source
Apache License 2.0
48 stars 38 forks source link

fix(notion): pages resource returns only meta info #460

Open IlyaFaer opened 1 month ago

IlyaFaer commented 1 month ago

Closes #413

IlyaFaer commented 1 month ago

@adrianbr, the thing is - I don't have straight access to the Notion account, so I can't always say if it's content or just metadata - some fields look like what's needed to me.

With new changes, it returns blocks, let's see:

[
    {
        "object": "block",
        "id": "3d28f2cb-dd86-4207-b25c-f36af16e2f8d",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "heading_1",
        "heading_1": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "Background info", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "Background info",
                    "href": None,
                }
            ],
            "is_toggleable": False,
            "color": "default",
        },
    },
    {
        "object": "block",
        "id": "944d2062-ba72-43cc-96f3-577af7c559c8",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "bulleted_list_item",
        "bulleted_list_item": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "...", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "...",
                    "href": None,
                }
            ],
            "color": "default",
        },
    },
    {
        "object": "block",
        "id": "f7eb3202-9ba5-4946-8484-134f58d95f32",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "bulleted_list_item",
        "bulleted_list_item": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "...", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "...",
                    "href": None,
                }
            ],
            "color": "default",
        },
    },
    {
        "object": "block",
        "id": "5c2df167-fea8-463f-b880-05c9e322bbe5",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "heading_1",
        "heading_1": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "History of interactions", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "History of interactions",
                    "href": None,
                }
            ],
            "is_toggleable": False,
            "color": "default",
        },
    },
    {
        "object": "block",
        "id": "22afc43a-db33-4d01-9ada-9930d4f265cc",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "bulleted_list_item",
        "bulleted_list_item": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "...", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "...",
                    "href": None,
                }
            ],
            "color": "default",
        },
    },
    {
        "object": "block",
        "id": "4d76ff34-1649-437c-900f-32cc8e0d3cc4",
        "parent": {
            "type": "page_id",
            "page_id": "29298248-6067-4332-b6db-ca516d4d9af3",
        },
        "created_time": "2023-05-08T16:10:00.000Z",
        "last_edited_time": "2023-05-08T16:10:00.000Z",
        "created_by": {"object": "user", "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402"},
        "last_edited_by": {
            "object": "user",
            "id": "4625a1c7-b3f5-44d2-a0ed-c50f33882402",
        },
        "has_children": False,
        "archived": False,
        "in_trash": False,
        "type": "bulleted_list_item",
        "bulleted_list_item": {
            "rich_text": [
                {
                    "type": "text",
                    "text": {"content": "...", "link": None},
                    "annotations": {
                        "bold": False,
                        "italic": False,
                        "strikethrough": False,
                        "underline": False,
                        "code": False,
                        "color": "default",
                    },
                    "plain_text": "...",
                    "href": None,
                }
            ],
            "color": "default",
        },
    },
]
rudolfix commented 1 month ago

@adrianbr are you going to review it? if not please assign someone so we get exactly what you wanted :)

IlyaFaer commented 2 weeks ago

This PR is a bit stuck