makenotion / notion-sdk-js

Official Notion JavaScript Client
https://developers.notion.com/docs
MIT License
4.82k stars 566 forks source link

DatabasePropertyConfigResponse is a local type #475

Open aDogCalledSpot opened 9 months ago

aDogCalledSpot commented 9 months ago

Describe the bug When fetching a database, there isn't a way to properly cast a property to the proper type it's supposed to be since these types aren't exported.

To Reproduce Notion JS library version: current master

Relevant line of code

example:

const response = await notion.databases.retrieve({ database_id });
const options = response.properties["My Select Property"].select; // Won't compile

Expected behavior I would expect type safety when inspecting the properties in my database.

aDogCalledSpot commented 9 months ago

Same deal with UpdateDatabaseBodyParameters

LoganTann commented 7 months ago

Yep, it's very painful to work with these types unavailable, especially when using Typescript.

The same stands for DatabaseObjectResponse