50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
/**
|
|
* Data access layer for The Nectar of Devotion (NOD).
|
|
*
|
|
* 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 = "nod";
|
|
|
|
export type NodMeta = BookMeta;
|
|
export type NodChapterEntry = { number: number; title: string };
|
|
export type NodIntroSegment = IntroSegment;
|
|
export type NodChapter = Chapter;
|
|
export type NodSidebarItem = SidebarItem;
|
|
|
|
export async function getNodMeta() {
|
|
return getBookMeta(CODE);
|
|
}
|
|
export async function getNodIntroSegments() {
|
|
return getIntroSegments(CODE);
|
|
}
|
|
export async function getNodIntroSegment(slug: string) {
|
|
return getIntroSegment(CODE, slug);
|
|
}
|
|
export async function getNodChapter(chapterNum: number) {
|
|
return getChapter(CODE, String(chapterNum));
|
|
}
|
|
// NodConcludingWords is just a chapter with slug "concluding-words"
|
|
export async function getNodConcludingWords() {
|
|
return getChapter(CODE, "concluding-words");
|
|
}
|
|
export async function getNodContent(slug: string) {
|
|
return getContent(CODE, slug);
|
|
}
|
|
export async function getNodSidebarItems() {
|
|
return getSidebarItems(CODE);
|
|
}
|