58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
/**
|
|
* Data access layer for Elevation to Kṛṣṇa Consciousness (EK).
|
|
*
|
|
* 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 = "ek";
|
|
|
|
// Re-export types with book-specific names for backwards compatibility
|
|
export type EkMeta = BookMeta;
|
|
export type EkChapterEntry = { number: number; title: string };
|
|
export type EkIntroSegment = IntroSegment;
|
|
export type EkChapter = Chapter;
|
|
export type EkSidebarItem = SidebarItem;
|
|
|
|
export async function getEkMeta(): Promise<EkMeta | null> {
|
|
return getBookMeta(CODE);
|
|
}
|
|
|
|
export async function getEkIntroSegments(): Promise<EkIntroSegment[]> {
|
|
return getIntroSegments(CODE);
|
|
}
|
|
|
|
export async function getEkIntroSegment(
|
|
slug: string,
|
|
): Promise<EkIntroSegment | null> {
|
|
return getIntroSegment(CODE, slug);
|
|
}
|
|
|
|
export async function getEkChapter(
|
|
chapterNum: number,
|
|
): Promise<EkChapter | null> {
|
|
return getChapter(CODE, String(chapterNum));
|
|
}
|
|
|
|
export async function getEkContent(
|
|
slug: string,
|
|
): Promise<EkChapter | EkIntroSegment | null> {
|
|
return getContent(CODE, slug);
|
|
}
|
|
|
|
export async function getEkSidebarItems(): Promise<EkSidebarItem[]> {
|
|
return getSidebarItems(CODE);
|
|
}
|