58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
/**
|
|
* Data access layer for Beyond Birth and Death (BBD).
|
|
*
|
|
* 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 = "bbd";
|
|
|
|
// Re-export types with book-specific names for backwards compatibility
|
|
export type BbdMeta = BookMeta;
|
|
export type BbdChapterEntry = { number: number; title: string };
|
|
export type BbdIntroSegment = IntroSegment;
|
|
export type BbdChapter = Chapter;
|
|
export type BbdSidebarItem = SidebarItem;
|
|
|
|
export async function getBbdMeta(): Promise<BbdMeta | null> {
|
|
return getBookMeta(CODE);
|
|
}
|
|
|
|
export async function getBbdIntroSegments(): Promise<BbdIntroSegment[]> {
|
|
return getIntroSegments(CODE);
|
|
}
|
|
|
|
export async function getBbdIntroSegment(
|
|
slug: string,
|
|
): Promise<BbdIntroSegment | null> {
|
|
return getIntroSegment(CODE, slug);
|
|
}
|
|
|
|
export async function getBbdChapter(
|
|
chapterNum: number,
|
|
): Promise<BbdChapter | null> {
|
|
return getChapter(CODE, String(chapterNum));
|
|
}
|
|
|
|
export async function getBbdContent(
|
|
slug: string,
|
|
): Promise<BbdChapter | BbdIntroSegment | null> {
|
|
return getContent(CODE, slug);
|
|
}
|
|
|
|
export async function getBbdSidebarItems(): Promise<BbdSidebarItem[]> {
|
|
return getSidebarItems(CODE);
|
|
}
|