@notionhq/client 2.2.12 → 2.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -183,13 +183,14 @@ try {
183
183
  There are several [type guards](https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types)
184
184
  provided to distinguish between full and partial API responses.
185
185
 
186
- | Type guard function | Purpose |
187
- | ------------------- | -------------------------------------------------------------- |
188
- | `isFullPage` | Determine whether an object is a full `PageObjectResponse` |
189
- | `isFullBlock` | Determine whether an object is a full `BlockObjectResponse` |
190
- | `isFullDatabase` | Determine whether an object is a full `DatabaseObjectResponse` |
191
- | `isFullUser` | Determine whether an object is a full `UserObjectResponse` |
192
- | `isFullComment` | Determine whether an object is a full `CommentObjectResponse` |
186
+ | Type guard function | Purpose |
187
+ | ---------------------- | -------------------------------------------------------------------------------------- |
188
+ | `isFullPage` | Determine whether an object is a full `PageObjectResponse` |
189
+ | `isFullBlock` | Determine whether an object is a full `BlockObjectResponse` |
190
+ | `isFullDatabase` | Determine whether an object is a full `DatabaseObjectResponse` |
191
+ | `isFullPageOrDatabase` | Determine whether an object is a full `PageObjectResponse` or `DatabaseObjectResponse` |
192
+ | `isFullUser` | Determine whether an object is a full `UserObjectResponse` |
193
+ | `isFullComment` | Determine whether an object is a full `CommentObjectResponse` |
193
194
 
194
195
  Here is an example of using a type guard:
195
196
 
@@ -198,10 +199,13 @@ const fullOrPartialPages = await notion.databases.query({
198
199
  database_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
199
200
  })
200
201
  for (const page of fullOrPartialPages.results) {
201
- if (!isFullPage(page)) {
202
+ if (!isFullPageOrDatabase(page)) {
202
203
  continue
203
204
  }
204
- // The page variable has been narrowed from PageObjectResponse | PartialPageObjectResponse to PageObjectResponse.
205
+ // The page variable has been narrowed from
206
+ // PageObjectResponse | PartialPageObjectResponse | DatabaseObjectResponse | PartialDatabaseObjectResponse
207
+ // to
208
+ // PageObjectResponse | DatabaseObjectResponse.
205
209
  console.log("Created at:", page.created_time)
206
210
  }
207
211
  ```
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/client",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=12"