Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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}`);
Expand All @@ -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) {
Expand All @@ -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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ export class SynchronizeMarkdownToNotion<T, U extends Page> {
try {
const childResults = await this.synchronizeChildNode({
childNode,
parentPageId: rootPageElement?.id ?? parentObjectId,
parentObjectId: rootPageElement?.id ?? parentObjectId,
parentObjectType: rootPageElement ? 'page' : parentObjectType,
lockPage,
forceNew,
});
Expand Down Expand Up @@ -435,12 +436,14 @@ export class SynchronizeMarkdownToNotion<T, U extends Page> {
*/
private async synchronizeChildNode({
childNode,
parentPageId,
parentObjectId,
parentObjectType,
lockPage,
forceNew,
}: {
childNode: TreeNode;
parentPageId: string;
parentObjectId: string;
parentObjectType: ObjectType;
lockPage: boolean;
forceNew: boolean;
}): Promise<SynchronizationResult[]> {
Expand Down Expand Up @@ -468,8 +471,8 @@ export class SynchronizeMarkdownToNotion<T, U extends Page> {

const newPage = await this.destinationRepository.createPage({
pageElement,
parentObjectId: parentPageId,
parentObjectType: 'page',
parentObjectId,
parentObjectType,
});

this.logger.info(`Created Notion page for file: ${filePath}`);
Expand All @@ -491,7 +494,8 @@ export class SynchronizeMarkdownToNotion<T, U extends Page> {
childNode.children.map(async (grandChild) => {
const grandChildSyncResult = await this.synchronizeChildNode({
childNode: grandChild,
parentPageId: pageElement.id!,
parentObjectId: pageElement.id!,
parentObjectType: 'page',
lockPage,
forceNew,
});
Expand Down
12 changes: 7 additions & 5 deletions sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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}`);
Expand All @@ -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) {
Expand All @@ -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,
});
Expand Down