Files
2026-05-10 00:35:14 +05:30

58 lines
1.3 KiB
TypeScript

/**
* Data access layer for The Perfection of Yoga (POY).
*
* 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 = "poy";
// Re-export types with book-specific names for backwards compatibility
export type PoyMeta = BookMeta;
export type PoyChapterEntry = { number: number; title: string };
export type PoyIntroSegment = IntroSegment;
export type PoyChapter = Chapter;
export type PoySidebarItem = SidebarItem;
export async function getPoyMeta(): Promise<PoyMeta | null> {
return getBookMeta(CODE);
}
export async function getPoyIntroSegments(): Promise<PoyIntroSegment[]> {
return getIntroSegments(CODE);
}
export async function getPoyIntroSegment(
slug: string,
): Promise<PoyIntroSegment | null> {
return getIntroSegment(CODE, slug);
}
export async function getPoyChapter(
chapterNum: number,
): Promise<PoyChapter | null> {
return getChapter(CODE, String(chapterNum));
}
export async function getPoyContent(
slug: string,
): Promise<PoyChapter | PoyIntroSegment | null> {
return getContent(CODE, slug);
}
export async function getPoySidebarItems(): Promise<PoySidebarItem[]> {
return getSidebarItems(CODE);
}