46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
/**
|
|
* Data access layer for Light of the Bhāgavata (LOB).
|
|
*
|
|
* Delegates to the generic book data layer which calls the BFF API.
|
|
*/
|
|
|
|
import {
|
|
getBookMeta,
|
|
getIntroSegments,
|
|
getIntroSegment,
|
|
getChapter,
|
|
getContent,
|
|
getSidebarItems,
|
|
type BookMeta,
|
|
type IntroSegment,
|
|
type Chapter,
|
|
type SidebarItem,
|
|
} from "@/lib/books";
|
|
|
|
const CODE = "lob";
|
|
|
|
export type LobMeta = BookMeta;
|
|
export type LobChapterEntry = { number: number; title: string };
|
|
export type LobIntroSegment = IntroSegment;
|
|
export type LobChapter = Chapter;
|
|
export type LobSidebarItem = SidebarItem;
|
|
|
|
export async function getLobMeta() {
|
|
return getBookMeta(CODE);
|
|
}
|
|
export async function getLobIntroSegments() {
|
|
return getIntroSegments(CODE);
|
|
}
|
|
export async function getLobIntroSegment(slug: string) {
|
|
return getIntroSegment(CODE, slug);
|
|
}
|
|
export async function getLobChapter(chapterNum: number) {
|
|
return getChapter(CODE, String(chapterNum));
|
|
}
|
|
export async function getLobContent(slug: string) {
|
|
return getContent(CODE, slug);
|
|
}
|
|
export async function getLobSidebarItems() {
|
|
return getSidebarItems(CODE);
|
|
}
|