Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ragaeeb/shamela/llms.txt

Use this file to discover all available pages before exploring further.

MasterData

Master data structure containing all core entities from the Shamela database.
type MasterData = {
  authors: Author[];
  books: Book[];
  categories: Category[];
  version: number;
};
authors
Author[]
required
Array of all authors in the database
books
Book[]
required
Array of all books in the database
categories
Category[]
required
Array of all categories in the database
version
number
required
Version number of the master database

Author

Represents an author entity.
type Author = {
  id: number;
  name: string;
  biography: string | null;
  death_number: string;
  death_text: string | null;
  is_deleted?: string;
};
id
number
required
Unique identifier for the author
name
string
required
Author’s full name
biography
string | null
required
Author’s biographical information (null if not available)
death_number
string
required
Death year or UNKNOWN_VALUE_PLACEHOLDER if not known
death_text
string | null
required
Death year formatted as text (null if not available)
is_deleted
string
Set to ‘1’ if this author was deleted in a patch update

Book

Represents a book entity.
type Book = {
  id: number;
  name: string;
  author: string;
  category: string;
  major_release: string;
  minor_release: string;
  bibliography: string;
  date: string;
  hint: string | null;
  metadata: string;
  pdf_links: string | null;
  printed: string;
  type: string;
  is_deleted?: string;
};
id
number
required
Unique identifier for the book
name
string
required
Book title
author
string
required
Serialized author ID(s), e.g., “2747, 3147” or “513”
category
string
required
Category ID
major_release
string
required
Major version number of the book
minor_release
string
required
Minor version number of the book
bibliography
string
required
Bibliography information
date
string
required
Publication date (or 99999 if unavailable)
hint
string | null
required
Additional hint or description (null if not available)
metadata
string
required
Serialized metadata as JSON string
Serialized PDF links (null if not available)
printed
string
required
Flag indicating if book has been printed
type
string
required
Book type classification
is_deleted
string
Set to ‘1’ if this book was deleted in a patch update

Category

Represents a book category.
type Category = {
  id: number;
  name: string;
  order: string;
  is_deleted?: string;
};
id
number
required
Unique identifier for the category
name
string
required
Category name
order
string
required
Display order for sorting categories
is_deleted
string
Set to ‘1’ if this category was deleted in a patch update

Usage Example

import { getMaster } from 'shamela';

const master = await getMaster();

console.log(`Version: ${master.version}`);
console.log(`Books: ${master.books.length}`);
console.log(`Authors: ${master.authors.length}`);
console.log(`Categories: ${master.categories.length}`);

// Find books by category
const categoryId = '1';
const booksInCategory = master.books.filter(book => book.category === categoryId);

// Find author information
const author = master.authors.find(a => a.id === 100);
console.log(author?.name, author?.death_text);

Denormalizing Books

Use denormalizeBooks() to resolve author and category references:
import { getMaster, denormalizeBooks } from 'shamela';

const master = await getMaster();
const books = denormalizeBooks(master);

// Now you can access nested objects directly
const book = books[0];
console.log(book.name);
console.log(book.author.name);      // Resolved author object
console.log(book.category.name);    // Resolved category object

Build docs developers (and LLMs) love