notion-client
Advanced tools
+2
-1
@@ -57,3 +57,3 @@ import * as notion from 'notion-types'; | ||
| }): Promise<notion.PageChunk>; | ||
| getCollectionData(collectionId: string, collectionViewId: string, collectionView?: any, { limit, searchQuery, userTimeZone, loadContentCover, ofetchOptions }?: { | ||
| getCollectionData(collectionId: string, collectionViewId: string, collectionView?: any, { limit, searchQuery, userTimeZone, loadContentCover, spaceId, ofetchOptions }?: { | ||
| type?: notion.CollectionViewType; | ||
@@ -65,2 +65,3 @@ limit?: number; | ||
| loadContentCover?: boolean; | ||
| spaceId?: string; | ||
| ofetchOptions?: FetchOptions; | ||
@@ -67,0 +68,0 @@ }): Promise<notion.CollectionInstance>; |
+12
-7
@@ -17,7 +17,3 @@ // src/notion-api.ts | ||
| constructor({ | ||
| // TODO: figure out a workaround so this base URL isn't hardcoded to my | ||
| // personal public notion site. This used to be 'https://www.notion.so/api/v3', | ||
| // but the queryCollection endpoint on this domain started returning `530` | ||
| // HTTP errors for some reason. | ||
| apiBaseUrl = "https://transitive-bs.notion.site/api/v3", | ||
| apiBaseUrl = "https://www.notion.so/api/v3", | ||
| authToken, | ||
@@ -81,5 +77,7 @@ activeUser, | ||
| if (collectionId) { | ||
| const spaceId = block?.space_id; | ||
| return block.view_ids?.map((collectionViewId) => ({ | ||
| collectionId, | ||
| collectionViewId | ||
| collectionViewId, | ||
| spaceId | ||
| })); | ||
@@ -93,3 +91,3 @@ } else { | ||
| async (collectionInstance) => { | ||
| const { collectionId, collectionViewId } = collectionInstance; | ||
| const { collectionId, collectionViewId, spaceId } = collectionInstance; | ||
| const collectionView = recordMap.collection_view[collectionViewId]?.value; | ||
@@ -103,2 +101,3 @@ try { | ||
| limit: collectionReducerLimit, | ||
| spaceId, | ||
| ofetchOptions | ||
@@ -285,2 +284,3 @@ } | ||
| loadContentCover = true, | ||
| spaceId, | ||
| ofetchOptions | ||
@@ -409,2 +409,6 @@ } = {}) { | ||
| } | ||
| const headers = {}; | ||
| if (spaceId) { | ||
| headers["x-notion-space-id"] = spaceId; | ||
| } | ||
| return this.fetch({ | ||
@@ -425,2 +429,3 @@ endpoint: "queryCollection", | ||
| }, | ||
| headers, | ||
| ofetchOptions: { | ||
@@ -427,0 +432,0 @@ timeout: 6e4, |
+3
-3
| { | ||
| "name": "notion-client", | ||
| "version": "7.7.0", | ||
| "version": "7.7.1", | ||
| "type": "module", | ||
@@ -22,4 +22,4 @@ "description": "Robust TypeScript client for the unofficial Notion API.", | ||
| "p-map": "^7.0.3", | ||
| "notion-types": "7.7.0", | ||
| "notion-utils": "7.7.0" | ||
| "notion-utils": "7.7.1", | ||
| "notion-types": "7.7.1" | ||
| }, | ||
@@ -26,0 +26,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
57817
0.14%604
1%2
-33.33%+ Added
+ Added
- Removed
- Removed
Updated
Updated