Replace all usage of getPublishedContentByUrl (#3395)

This commit is contained in:
Taran Vohra
2025-06-25 18:55:02 +05:30
committed by GitHub
parent 14843ac343
commit cfe4812045
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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;
};
+1 -1
View File
@@ -8,7 +8,7 @@ import { jwtDecode } from 'jwt-decode';
export type VisitorAuthClaims = Record<string, any>;
/**
* 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;
+1 -1
View File
@@ -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',
+1 -1
View File
@@ -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,
});