From 5a5b465b72402a8a49156af028a34b5c1a21ea3c Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Tue, 12 Apr 2022 10:05:21 -0400 Subject: [PATCH] feat: add more logging to getSiteMaps --- lib/get-all-pages.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/get-all-pages.ts b/lib/get-all-pages.ts index 8007b54..9b9c77f 100644 --- a/lib/get-all-pages.ts +++ b/lib/get-all-pages.ts @@ -1,5 +1,5 @@ import pMemoize from 'p-memoize' -import { getAllPagesInSpace } from 'notion-utils' +import { getAllPagesInSpace, uuidToId } from 'notion-utils' import * as types from './types' import { includeNotionIdInUrls } from './config' @@ -16,10 +16,15 @@ export async function getAllPagesImpl( rootNotionPageId: string, rootNotionSpaceId: string ): Promise> { + const getPage = async (pageId: string, ...args) => { + console.log('\nnotion getPage', uuidToId(pageId)) + return notion.getPage(pageId, ...args) + } + const pageMap = await getAllPagesInSpace( rootNotionPageId, rootNotionSpaceId, - notion.getPage.bind(notion) + getPage ) const canonicalPageMap = Object.keys(pageMap).reduce(