gatsby-source-notion-churnotion 1.1.24 → 1.1.25
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/dist/util/fetchData.d.ts
CHANGED
@@ -6,11 +6,6 @@
|
|
6
6
|
export declare const fetchAllBlocks: (pageId: string) => Promise<any[]>;
|
7
7
|
/**
|
8
8
|
* Notion API에서 GET 요청을 수행하는 함수 (재시도 로직 포함)
|
9
|
-
* @param {string} url - API endpoint URL
|
10
|
-
* @param {any} options - Axios 요청 옵션
|
11
|
-
* @param {number} tryCount - 현재 재시도 횟수
|
12
|
-
* @param {number} maxRetries - 최대 재시도 횟수
|
13
|
-
* @returns {Promise<any>} API 응답 데이터
|
14
9
|
*/
|
15
10
|
export declare const fetchGetWithRetry: (url: string, options?: any, tryCount?: number, maxRetries?: number) => Promise<any>;
|
16
11
|
/**
|
package/dist/util/fetchData.js
CHANGED
@@ -27,22 +27,17 @@ const fetchAllBlocks = async (pageId) => {
|
|
27
27
|
exports.fetchAllBlocks = fetchAllBlocks;
|
28
28
|
/**
|
29
29
|
* Notion API에서 GET 요청을 수행하는 함수 (재시도 로직 포함)
|
30
|
-
* @param {string} url - API endpoint URL
|
31
|
-
* @param {any} options - Axios 요청 옵션
|
32
|
-
* @param {number} tryCount - 현재 재시도 횟수
|
33
|
-
* @param {number} maxRetries - 최대 재시도 횟수
|
34
|
-
* @returns {Promise<any>} API 응답 데이터
|
35
30
|
*/
|
36
31
|
const fetchGetWithRetry = async (url, options = {}, tryCount = 0, maxRetries = 5) => {
|
37
32
|
try {
|
38
33
|
const response = await connector_1.instance.get(url);
|
39
|
-
|
40
|
-
// Notion API 응답에 has_more가 있으면
|
34
|
+
let results = response.data.results;
|
35
|
+
// Notion API 응답에 has_more가 있으면 추가 블록을 가져와 병합
|
41
36
|
if (response.data.has_more) {
|
42
37
|
const additionalResults = await (0, exports.fetchAllBlocks)(url.split("/")[1]); // pageId 추출
|
43
|
-
results
|
38
|
+
results = [...results, ...additionalResults]; // 기존 results에 추가 데이터 병합
|
44
39
|
}
|
45
|
-
return { ...response.data, results }; // 전체 데이터 반환
|
40
|
+
return { ...response.data, results }; // 병합된 전체 데이터 반환
|
46
41
|
}
|
47
42
|
catch (error) {
|
48
43
|
const status = error.response?.status;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-source-notion-churnotion",
|
3
3
|
"description": "Gatsby plugin that can connect with One Notion Database RECURSIVELY using official API",
|
4
|
-
"version": "1.1.
|
4
|
+
"version": "1.1.25",
|
5
5
|
"skipLibCheck": true,
|
6
6
|
"license": "0BSD",
|
7
7
|
"main": "./dist/gatsby-node.js",
|