Skip to content

Commit

Permalink
renamed func
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoMoretti committed Aug 10, 2024
1 parent d93d306 commit 9411be6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/NotionPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export async function getPageContentInfo(
}
}

export async function fromPageId(
export async function notionPageFromId(
pageId: string,
client: Client,
config?: NotionPageConfig
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/get-tree-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DatabaseObjectResponse } from "@notionhq/client/build/src/api-endpoints
import { FilesMap } from "./FilesMap"
import { LayoutStrategy } from "./LayoutStrategy"
import { NotionDatabase } from "./NotionDatabase"
import { NotionPage, fromPageId, getPageContentInfo } from "./NotionPage"
import { NotionPage, getPageContentInfo, notionPageFromId } from "./NotionPage"
import { getBlockChildren } from "./getBlockChildren"
import { error, info, warning } from "./log"
import { OutputCounts } from "./notionPull"
Expand Down Expand Up @@ -60,7 +60,7 @@ export async function getTreePages(
)
}
} else if (currentType == "page") {
const currentPage = await fromPageId(currentID, client)
const currentPage = await notionPageFromId(currentID, client)
const blocks = await getBlockChildren(currentPage.id, client)
const pageInfo = await getPageContentInfo(blocks)

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/notionPull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { FilesMap } from "./FilesMap"
import { FlatLayoutStrategy } from "./FlatLayoutStrategy"
import { HierarchicalLayoutStrategy } from "./HierarchicalLayoutStrategy"
import { NotionDatabase } from "./NotionDatabase"
import { NotionPage, NotionPageConfig, fromPageId } from "./NotionPage"
import { NotionPage, NotionPageConfig, notionPageFromId } from "./NotionPage"
import { IDocuNotionConfig, loadConfigAsync } from "./config/configuration"
import { pullOptionsSchema } from "./config/schema"
import { getBlockChildren } from "./getBlockChildren"
Expand Down Expand Up @@ -214,7 +214,7 @@ export async function notionPull(options: DocuNotionOptions): Promise<void> {
)

const pagesPromises: Promise<NotionPage>[] = Object.keys(filesMap.page).map(
(id) => fromPageId(id, cachedNotionClient, pageConfig)
(id) => notionPageFromId(id, cachedNotionClient, pageConfig)
)

const pages = await Promise.all(pagesPromises)
Expand Down

0 comments on commit 9411be6

Please sign in to comment.