Skip to content

Clean up CreateComment and rich text content param types #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ksinder
Copy link
Contributor

@ksinder ksinder commented Jun 2, 2025

  • Sync the latest generated src/api-endpoints.ts from Notion's codebase to the JS SDK.
    • In this case, there are no semantic changes, but refactors and additional docstrings/comments in the Create Comment API body parameters based on recent internal refactors.

@ksinder ksinder requested review from mquan, seemaullal and Copilot June 2, 2025 23:00
@ksinder ksinder marked this pull request as ready for review June 2, 2025 23:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Sync the latest Notion-generated src/api-endpoints.ts to update and clarify type definitions without semantic changes.

  • Refreshed API endpoint types, removing redundant null unions and replacing explicit color unions with ApiColor.
  • Expanded RichTextItemRequest with detailed docstrings for all rich text object variants.
  • Consolidated and documented CreateCommentBodyParameters, merging page/block parent cases and adding a discussion_id variant.
Comments suppressed due to low confidence (3)

src/api-endpoints.ts:8498

  • New CreateCommentBodyParameters variants (parent with page_id/block_id and discussion_id) have been introduced. Add unit tests or schema validations to cover both cases and ensure the request payload is constructed correctly.
type CreateCommentBodyParameters =

src/api-endpoints.ts:6242

  • Removing the null option from verified_by changes the semantics of VerificationPropertyResponse and may break existing consumers expecting verified_by to be nullable. Consider restoring | null or verifying the API never returns null for this field.
| null

src/api-endpoints.ts:6242

  • This removal of | null in the union for verification in PageObjectResponse may alter the expected type contract by making one of the branches non-nullable. If the API can return unverified values, restore the nullable union.
| null

@ksinder
Copy link
Contributor Author

ksinder commented Jun 30, 2025

Including this as part of #590

@ksinder ksinder closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant