Skip to content

Commit cfe4812

Browse files
authored
Replace all usage of getPublishedContentByUrl (#3395)
1 parent 14843ac commit cfe4812

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/gitbook/src/app/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type RouteLayoutParams = {
1414
/** URL encoded site URL */
1515
siteURL: string;
1616

17-
/** URL and Rison encoded site data from getPublishedContentByUrl */
17+
/** URL and Rison encoded site data from resolvePublishedContentByUrl */
1818
siteData: string;
1919
};
2020

packages/gitbook/src/lib/adaptive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { jwtDecode } from 'jwt-decode';
88
export type VisitorAuthClaims = Record<string, any>;
99

1010
/**
11-
* Get the visitor auth claims from the API response obtained from `getPublishedContentByUrl`.
11+
* Get the visitor auth claims from the API response obtained from `resolvePublishedContentByUrl`.
1212
*/
1313
export function getVisitorAuthClaims(siteData: SiteURLData): VisitorAuthClaims {
1414
const { apiToken } = siteData;

packages/gitbook/src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function serveSiteRoutes(requestURL: URL, request: NextRequest) {
131131
jwtToken: visitorToken?.token ?? undefined,
132132
unsignedClaims,
133133
},
134-
// When the visitor auth token is pulled from the cookie, set redirectOnError when calling getPublishedContentByUrl to allow
134+
// When the visitor auth token is pulled from the cookie, set redirectOnError when calling resolvePublishedContentByUrl to allow
135135
// redirecting when the token is invalid as we could be dealing with stale token stored in the cookie.
136136
// For example when the VA backend signature has changed but the token stored in the cookie is not yet expired.
137137
redirectOnError: visitorToken?.source === 'visitor-auth-cookie',

packages/gitbook/tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function getSiteAPIToken(url: string) {
5252
const api = new GitBookAPI({
5353
endpoint: 'https://api.gitbook.com/cache',
5454
});
55-
const { data } = await api.urls.getPublishedContentByUrl({
55+
const { data } = await api.urls.resolvePublishedContentByUrl({
5656
url,
5757
});
5858

0 commit comments

Comments
 (0)