Files
傅洋 087048d192 feat(auth,client): surface integration type and guide past root-page error (#32)
The Notion API returns a technically-accurate but hard-to-action
validation error when an internal integration tries to create a page at
the workspace root:

    validation_error: Provide a parent.page_id or parent.database_id
    parameter to create a page, or use a public integration with
    insert_content capability. Internal integrations aren't owned by a
    single user, so creating workspace-level private pages is not
    supported.

Two small improvements so users don't have to parse that paragraph:

1. `notion auth status` and `notion auth doctor` now derive the
   integration type from bot.owner.type ("workspace" → internal,
   "user" → public) and print it. For internal integrations a follow-up
   line reminds the user they must share a parent page first.

2. client.errorHint matches the internal-integration validation_error
   signature and prints a concrete workaround with the exact next command:

       → Internal integrations can't create pages at the workspace root.
          Workaround: create (or pick) a parent page in the Notion UI,
          share it with this integration, then pass its ID as the parent:
              notion page create <shared-page-id> --title "..."
          To list pages shared with your integration: notion page list

Detection code is small (detectIntegrationType in cmd/auth.go) and
defensive: unknown or missing owner shape returns "" so pre-existing
response fixtures that don't include bot.owner still render fine.

Closes #25
2026-04-30 13:00:38 +08:00
..
2026-02-18 23:40:14 +08:00
2026-02-18 23:40:14 +08:00