diff --git a/packages/gitbook/src/app/utils.ts b/packages/gitbook/src/app/utils.ts index d5710bba2..0e5d1688b 100644 --- a/packages/gitbook/src/app/utils.ts +++ b/packages/gitbook/src/app/utils.ts @@ -14,7 +14,7 @@ export type RouteLayoutParams = { /** URL encoded site URL */ siteURL: string; - /** URL and Rison encoded site data from getPublishedContentByUrl */ + /** URL and Rison encoded site data from resolvePublishedContentByUrl */ siteData: string; }; diff --git a/packages/gitbook/src/lib/adaptive.ts b/packages/gitbook/src/lib/adaptive.ts index efc7f989e..5b459d03d 100644 --- a/packages/gitbook/src/lib/adaptive.ts +++ b/packages/gitbook/src/lib/adaptive.ts @@ -8,7 +8,7 @@ import { jwtDecode } from 'jwt-decode'; export type VisitorAuthClaims = Record; /** - * Get the visitor auth claims from the API response obtained from `getPublishedContentByUrl`. + * Get the visitor auth claims from the API response obtained from `resolvePublishedContentByUrl`. */ export function getVisitorAuthClaims(siteData: SiteURLData): VisitorAuthClaims { const { apiToken } = siteData; diff --git a/packages/gitbook/src/middleware.ts b/packages/gitbook/src/middleware.ts index bb1457e9c..b943e0f25 100644 --- a/packages/gitbook/src/middleware.ts +++ b/packages/gitbook/src/middleware.ts @@ -131,7 +131,7 @@ async function serveSiteRoutes(requestURL: URL, request: NextRequest) { jwtToken: visitorToken?.token ?? undefined, unsignedClaims, }, - // When the visitor auth token is pulled from the cookie, set redirectOnError when calling getPublishedContentByUrl to allow + // When the visitor auth token is pulled from the cookie, set redirectOnError when calling resolvePublishedContentByUrl to allow // redirecting when the token is invalid as we could be dealing with stale token stored in the cookie. // For example when the VA backend signature has changed but the token stored in the cookie is not yet expired. redirectOnError: visitorToken?.source === 'visitor-auth-cookie', diff --git a/packages/gitbook/tests/utils.ts b/packages/gitbook/tests/utils.ts index a5f0466d9..7443591f7 100644 --- a/packages/gitbook/tests/utils.ts +++ b/packages/gitbook/tests/utils.ts @@ -52,7 +52,7 @@ export async function getSiteAPIToken(url: string) { const api = new GitBookAPI({ endpoint: 'https://api.gitbook.com/cache', }); - const { data } = await api.urls.getPublishedContentByUrl({ + const { data } = await api.urls.resolvePublishedContentByUrl({ url, });