diff --git a/preview/index.js b/preview/index.js index cc986f5..7cd272e 100644 --- a/preview/index.js +++ b/preview/index.js @@ -76596,7 +76596,8 @@ class SynchronizeMarkdownToNotion { try { const childResults = await this.synchronizeChildNode({ childNode, - parentPageId: rootPageElement?.id ?? parentObjectId, + parentObjectId: rootPageElement?.id ?? parentObjectId, + parentObjectType: rootPageElement ? 'page' : parentObjectType, lockPage, forceNew, }); @@ -76712,7 +76713,7 @@ class SynchronizeMarkdownToNotion { /** * Synchronizes a child node and its descendants recursively */ - async synchronizeChildNode({ childNode, parentPageId, lockPage, forceNew, }) { + async synchronizeChildNode({ childNode, parentObjectId, parentObjectType, lockPage, forceNew, }) { const syncResult = []; const filePath = childNode.filepath; this.logger.info(`Processing file: ${filePath}`); @@ -76734,8 +76735,8 @@ class SynchronizeMarkdownToNotion { } const newPage = await this.destinationRepository.createPage({ pageElement, - parentObjectId: parentPageId, - parentObjectType: 'page', + parentObjectId, + parentObjectType, }); this.logger.info(`Created Notion page for file: ${filePath}`); if (!newPage.pageId) { @@ -76751,7 +76752,8 @@ class SynchronizeMarkdownToNotion { await Promise.all(childNode.children.map(async (grandChild) => { const grandChildSyncResult = await this.synchronizeChildNode({ childNode: grandChild, - parentPageId: pageElement.id, + parentObjectId: pageElement.id, + parentObjectType: 'page', lockPage, forceNew, }); diff --git a/src/domains/synchronization/features/synchronize-markdown-to-notion.feature.ts b/src/domains/synchronization/features/synchronize-markdown-to-notion.feature.ts index 35477ad..ac132da 100644 --- a/src/domains/synchronization/features/synchronize-markdown-to-notion.feature.ts +++ b/src/domains/synchronization/features/synchronize-markdown-to-notion.feature.ts @@ -248,7 +248,8 @@ export class SynchronizeMarkdownToNotion { try { const childResults = await this.synchronizeChildNode({ childNode, - parentPageId: rootPageElement?.id ?? parentObjectId, + parentObjectId: rootPageElement?.id ?? parentObjectId, + parentObjectType: rootPageElement ? 'page' : parentObjectType, lockPage, forceNew, }); @@ -435,12 +436,14 @@ export class SynchronizeMarkdownToNotion { */ private async synchronizeChildNode({ childNode, - parentPageId, + parentObjectId, + parentObjectType, lockPage, forceNew, }: { childNode: TreeNode; - parentPageId: string; + parentObjectId: string; + parentObjectType: ObjectType; lockPage: boolean; forceNew: boolean; }): Promise { @@ -468,8 +471,8 @@ export class SynchronizeMarkdownToNotion { const newPage = await this.destinationRepository.createPage({ pageElement, - parentObjectId: parentPageId, - parentObjectType: 'page', + parentObjectId, + parentObjectType, }); this.logger.info(`Created Notion page for file: ${filePath}`); @@ -491,7 +494,8 @@ export class SynchronizeMarkdownToNotion { childNode.children.map(async (grandChild) => { const grandChildSyncResult = await this.synchronizeChildNode({ childNode: grandChild, - parentPageId: pageElement.id!, + parentObjectId: pageElement.id!, + parentObjectType: 'page', lockPage, forceNew, }); diff --git a/sync/index.js b/sync/index.js index ed98cf3..fa2138a 100644 --- a/sync/index.js +++ b/sync/index.js @@ -76645,7 +76645,8 @@ class SynchronizeMarkdownToNotion { try { const childResults = await this.synchronizeChildNode({ childNode, - parentPageId: rootPageElement?.id ?? parentObjectId, + parentObjectId: rootPageElement?.id ?? parentObjectId, + parentObjectType: rootPageElement ? 'page' : parentObjectType, lockPage, forceNew, }); @@ -76761,7 +76762,7 @@ class SynchronizeMarkdownToNotion { /** * Synchronizes a child node and its descendants recursively */ - async synchronizeChildNode({ childNode, parentPageId, lockPage, forceNew, }) { + async synchronizeChildNode({ childNode, parentObjectId, parentObjectType, lockPage, forceNew, }) { const syncResult = []; const filePath = childNode.filepath; this.logger.info(`Processing file: ${filePath}`); @@ -76783,8 +76784,8 @@ class SynchronizeMarkdownToNotion { } const newPage = await this.destinationRepository.createPage({ pageElement, - parentObjectId: parentPageId, - parentObjectType: 'page', + parentObjectId, + parentObjectType, }); this.logger.info(`Created Notion page for file: ${filePath}`); if (!newPage.pageId) { @@ -76800,7 +76801,8 @@ class SynchronizeMarkdownToNotion { await Promise.all(childNode.children.map(async (grandChild) => { const grandChildSyncResult = await this.synchronizeChildNode({ childNode: grandChild, - parentPageId: pageElement.id, + parentObjectId: pageElement.id, + parentObjectType: 'page', lockPage, forceNew, });