widebible 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +371 -0
- package/dist/index.d.ts +237 -0
- package/dist/index.js +165 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WideHoly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# widebible
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/widebible)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.npmjs.com/package/widebible)
|
|
7
|
+
|
|
8
|
+
TypeScript SDK for [WideBible](https://widebible.com) -- the complete Bible study platform with 66 books, 4 public domain translations (KJV, ASV, BBE, YLT), 3,000+ biblical people, 942 geocoded places, 432K cross-references, and structured study tools. Access verses, people, places, topics, glossary terms, timeline events, and reading plans through a fully typed async API. Zero runtime dependencies -- uses native `fetch`.
|
|
9
|
+
|
|
10
|
+
All data is drawn from [widebible.com](https://widebible.com), a scripture reference site covering the Old and New Testaments with cross-references, genealogies, geographical data, and curated reading plans. The REST API is free, requires no authentication, and returns JSON with CORS enabled.
|
|
11
|
+
|
|
12
|
+
> **Explore the Bible at [widebible.com](https://widebible.com)** -- [Books](https://widebible.com/books/) | [People](https://widebible.com/people/) | [Places](https://widebible.com/places/) | [Topics](https://widebible.com/topics/) | [Timeline](https://widebible.com/timeline/)
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Quick Start](#quick-start)
|
|
18
|
+
- [What You'll Find on WideBible](#what-youll-find-on-widebible)
|
|
19
|
+
- [Bible Books & Translations](#bible-books--translations)
|
|
20
|
+
- [Biblical People & Genealogies](#biblical-people--genealogies)
|
|
21
|
+
- [Places & Geography](#places--geography)
|
|
22
|
+
- [Cross-References & Parallel Passages](#cross-references--parallel-passages)
|
|
23
|
+
- [Topics & Study Tools](#topics--study-tools)
|
|
24
|
+
- [API Endpoints](#api-endpoints)
|
|
25
|
+
- [API Reference](#api-reference)
|
|
26
|
+
- [TypeScript Types](#typescript-types)
|
|
27
|
+
- [Learn More About the Bible](#learn-more-about-the-bible)
|
|
28
|
+
- [Also Available for Python](#also-available-for-python)
|
|
29
|
+
- [WideHoly Scripture Platform](#wideholy-scripture-platform)
|
|
30
|
+
- [License](#license)
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install widebible
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { WideBible } from "widebible";
|
|
42
|
+
|
|
43
|
+
// Initialize the client (no API key required)
|
|
44
|
+
const client = new WideBible();
|
|
45
|
+
|
|
46
|
+
// Get a Bible verse -- John 3:16 in KJV translation
|
|
47
|
+
const verse = await client.getVerse("john", 3, 16);
|
|
48
|
+
console.log(verse.results[0].text);
|
|
49
|
+
|
|
50
|
+
// List all 66 books of the Bible with chapter and verse counts
|
|
51
|
+
const books = await client.listBooks();
|
|
52
|
+
console.log(`${books.count} books`); // 66 books
|
|
53
|
+
|
|
54
|
+
// Search Bible verses by keyword
|
|
55
|
+
const results = await client.search("love", 5);
|
|
56
|
+
for (const v of results.results) {
|
|
57
|
+
console.log(`${v.reference}: ${v.text.slice(0, 80)}...`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Look up a biblical person -- Moses, leader of the Exodus
|
|
61
|
+
const moses = await client.getPerson("moses");
|
|
62
|
+
console.log(`${moses.name}: ${moses.bio}`);
|
|
63
|
+
|
|
64
|
+
// Get a geocoded biblical place with latitude/longitude
|
|
65
|
+
const jerusalem = await client.getPlace("jerusalem");
|
|
66
|
+
console.log(`${jerusalem.name}: ${jerusalem.latitude}, ${jerusalem.longitude}`);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## What You'll Find on WideBible
|
|
70
|
+
|
|
71
|
+
### Bible Books & Translations
|
|
72
|
+
|
|
73
|
+
The Bible consists of 66 books divided into the Old Testament (39 books, from Genesis through Malachi) and the New Testament (27 books, from Matthew through Revelation). These books span genres including law, history, poetry, prophecy, gospels, and epistles, written over roughly 1,500 years.
|
|
74
|
+
|
|
75
|
+
WideBible provides 4 public domain English translations, each with a different translation philosophy:
|
|
76
|
+
|
|
77
|
+
| Translation | Code | Year | Philosophy |
|
|
78
|
+
|-------------|------|------|------------|
|
|
79
|
+
| King James Version | `kjv` | 1611 | Formal equivalence, literary English |
|
|
80
|
+
| American Standard Version | `asv` | 1901 | Formal equivalence, updated language |
|
|
81
|
+
| Bible in Basic English | `bbe` | 1949 | Limited vocabulary (850 core words) |
|
|
82
|
+
| Young's Literal Translation | `ylt` | 1862 | Ultra-literal, preserves Hebrew/Greek word order |
|
|
83
|
+
|
|
84
|
+
Books are organized into 10 groups that reflect the literary and theological structure of the canon:
|
|
85
|
+
|
|
86
|
+
| Group | Testament | Books | Example |
|
|
87
|
+
|-------|-----------|-------|---------|
|
|
88
|
+
| Pentateuch | Old | 5 | Genesis, Exodus, Leviticus |
|
|
89
|
+
| Historical Books | Old | 12 | Joshua, Judges, Ruth, 1-2 Samuel |
|
|
90
|
+
| Wisdom Literature | Old | 5 | Job, Psalms, Proverbs, Ecclesiastes |
|
|
91
|
+
| Major Prophets | Old | 5 | Isaiah, Jeremiah, Ezekiel, Daniel |
|
|
92
|
+
| Minor Prophets | Old | 12 | Hosea, Joel, Amos, Malachi |
|
|
93
|
+
| Gospels | New | 4 | Matthew, Mark, Luke, John |
|
|
94
|
+
| Acts | New | 1 | Acts of the Apostles |
|
|
95
|
+
| Pauline Epistles | New | 13 | Romans, 1-2 Corinthians, Galatians |
|
|
96
|
+
| General Epistles | New | 8 | Hebrews, James, 1-2 Peter, 1-3 John |
|
|
97
|
+
| Apocalyptic | New | 1 | Revelation |
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { WideBible } from "widebible";
|
|
101
|
+
|
|
102
|
+
const client = new WideBible();
|
|
103
|
+
|
|
104
|
+
// List all 66 books with chapter and verse counts
|
|
105
|
+
const books = await client.listBooks();
|
|
106
|
+
console.log(`${books.count} books of the Bible`);
|
|
107
|
+
|
|
108
|
+
// Get detailed information about a specific book
|
|
109
|
+
const genesis = await client.getBook("genesis");
|
|
110
|
+
console.log(`${genesis.name}: ${genesis.chapter_count} chapters, ${genesis.verse_count} verses`);
|
|
111
|
+
|
|
112
|
+
// Retrieve a verse in a specific translation
|
|
113
|
+
const verse = await client.getVerse("john", 3, 16, "asv");
|
|
114
|
+
console.log(verse.results[0].text);
|
|
115
|
+
|
|
116
|
+
// Browse book groups to understand canon structure
|
|
117
|
+
const groups = await client.listBookGroups();
|
|
118
|
+
for (const g of groups.results) {
|
|
119
|
+
console.log(`${g.name}: ${g.book_count} books`);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Learn more: [Bible Book Explorer](https://widebible.com/books/) | [Translation Comparison](https://widebible.com/translations/) | [Reading Plans](https://widebible.com/reading-plans/)
|
|
124
|
+
|
|
125
|
+
### Biblical People & Genealogies
|
|
126
|
+
|
|
127
|
+
WideBible catalogs over 3,000 people mentioned in the Bible, from patriarchs and matriarchs through kings, prophets, and apostles. Each person entry includes biographical details, testament association, verse count, and Wikidata cross-references for further research.
|
|
128
|
+
|
|
129
|
+
The biblical narrative spans 10 major eras:
|
|
130
|
+
|
|
131
|
+
| Era | Period | Key Figures |
|
|
132
|
+
|-----|--------|-------------|
|
|
133
|
+
| Patriarchs | ~2000-1700 BC | Abraham, Isaac, Jacob, Joseph |
|
|
134
|
+
| Exodus | ~1446-1406 BC | Moses, Aaron, Miriam, Joshua |
|
|
135
|
+
| Judges | ~1375-1050 BC | Deborah, Gideon, Samson, Samuel |
|
|
136
|
+
| United Kingdom | ~1050-930 BC | Saul, David, Solomon |
|
|
137
|
+
| Divided Kingdom | ~930-586 BC | Elijah, Elisha, Isaiah, Jeremiah |
|
|
138
|
+
| Exile | ~586-538 BC | Daniel, Ezekiel, Esther |
|
|
139
|
+
| Return | ~538-400 BC | Ezra, Nehemiah, Zerubbabel |
|
|
140
|
+
| Intertestamental | ~400 BC-5 BC | Maccabees (referenced in NT context) |
|
|
141
|
+
| Gospel | ~5 BC-33 AD | Jesus, Mary, John the Baptist |
|
|
142
|
+
| Apostolic | ~33-100 AD | Peter, Paul, James, John |
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// Look up a biblical person by slug
|
|
146
|
+
const moses = await client.getPerson("moses");
|
|
147
|
+
console.log(`${moses.name} -- mentioned in ${moses.verse_count} verses`);
|
|
148
|
+
|
|
149
|
+
// List all biblical people
|
|
150
|
+
const people = await client.listPeople();
|
|
151
|
+
console.log(`${people.count} people in the Bible`);
|
|
152
|
+
|
|
153
|
+
// Explore timeline eras
|
|
154
|
+
const eras = await client.listEras();
|
|
155
|
+
for (const era of eras.results) {
|
|
156
|
+
console.log(`${era.name}: ${era.start_year} to ${era.end_year}`);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Learn more: [Biblical People Directory](https://widebible.com/people/) | [Timeline of Biblical History](https://widebible.com/timeline/)
|
|
161
|
+
|
|
162
|
+
### Places & Geography
|
|
163
|
+
|
|
164
|
+
WideBible includes 942 geocoded biblical locations spanning the ancient Near East, from Egypt and Mesopotamia to the Greco-Roman world. Each place entry includes latitude/longitude coordinates, description, verse count, and Wikidata references.
|
|
165
|
+
|
|
166
|
+
| Region | Key Places | Significance |
|
|
167
|
+
|--------|------------|--------------|
|
|
168
|
+
| Galilee | Nazareth, Capernaum, Sea of Galilee | Jesus' childhood and early ministry |
|
|
169
|
+
| Judea | Jerusalem, Bethlehem, Jericho | Temple worship, birth of Jesus |
|
|
170
|
+
| Egypt | Goshen, Nile, Red Sea | Exodus narrative, Holy Family refuge |
|
|
171
|
+
| Mesopotamia | Babylon, Ur, Nineveh | Abraham's origin, Exile period |
|
|
172
|
+
| Asia Minor | Ephesus, Antioch, Galatia | Pauline missionary journeys |
|
|
173
|
+
| Rome | Rome, Puteoli | Center of the Roman Empire, Paul's trial |
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
// Get a geocoded biblical place with latitude/longitude
|
|
177
|
+
const jerusalem = await client.getPlace("jerusalem");
|
|
178
|
+
console.log(`${jerusalem.name}: (${jerusalem.latitude}, ${jerusalem.longitude})`);
|
|
179
|
+
|
|
180
|
+
// List all 942 biblical places
|
|
181
|
+
const places = await client.listPlaces();
|
|
182
|
+
console.log(`${places.count} biblical places with coordinates`);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Learn more: [Biblical Places Map](https://widebible.com/places/) | [Glossary of Biblical Terms](https://widebible.com/glossary/)
|
|
186
|
+
|
|
187
|
+
### Cross-References & Parallel Passages
|
|
188
|
+
|
|
189
|
+
With 432,000+ cross-references, WideBible maps the internal connections between Bible passages. Cross-references reveal typological links (Old Testament events foreshadowing New Testament fulfillment), direct quotations, thematic parallels, and synoptic gospel parallels.
|
|
190
|
+
|
|
191
|
+
The most densely cross-referenced books include Psalms, Isaiah, and Matthew, reflecting the deep intertextual web of prophecy, fulfillment, and liturgical usage throughout the biblical canon.
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
// Find cross-references from Genesis 1:1
|
|
195
|
+
const xrefs = await client.listCrossReferences({
|
|
196
|
+
from_book: "genesis",
|
|
197
|
+
from_chapter: "1",
|
|
198
|
+
from_verse: "1",
|
|
199
|
+
});
|
|
200
|
+
for (const ref of xrefs.results.slice(0, 5)) {
|
|
201
|
+
console.log(`${ref.from_ref} -> ${ref.to_ref}: ${ref.explanation}`);
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Learn more: [Cross-Reference Explorer](https://widebible.com/cross-references/) | [Topic Index](https://widebible.com/topics/)
|
|
206
|
+
|
|
207
|
+
### Topics & Study Tools
|
|
208
|
+
|
|
209
|
+
WideBible organizes verses into thematic topics for structured Bible study. Topics like Love, Faith, Prayer, Salvation, and Forgiveness each aggregate relevant verses across both testaments, providing a topical index for devotional reading and theological research.
|
|
210
|
+
|
|
211
|
+
Additional study tools include a glossary of biblical terms with Hebrew and Greek original words, a historical timeline with dated events, and curated reading plans for systematic Bible reading.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
// Browse all Bible study topics
|
|
215
|
+
const topics = await client.listTopics();
|
|
216
|
+
|
|
217
|
+
// Get verses grouped under a specific topic
|
|
218
|
+
const love = await client.getTopic("love");
|
|
219
|
+
console.log(`'${love.name}' topic: ${love.verse_count} verses`);
|
|
220
|
+
|
|
221
|
+
// Look up a biblical term with Hebrew/Greek origins
|
|
222
|
+
const covenant = await client.getGlossaryTerm("covenant");
|
|
223
|
+
console.log(`${covenant.term}: ${covenant.definition}`);
|
|
224
|
+
console.log(`Hebrew: ${covenant.hebrew_word ?? "N/A"}`);
|
|
225
|
+
|
|
226
|
+
// Browse curated reading plans
|
|
227
|
+
const plans = await client.listReadingPlans();
|
|
228
|
+
const plan = await client.getReadingPlan("bible-in-a-year");
|
|
229
|
+
console.log(`${plan.name}: ${plan.duration_days} days`);
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Learn more: [Topic Index](https://widebible.com/topics/) | [Biblical Glossary](https://widebible.com/glossary/) | [Reading Plans](https://widebible.com/reading-plans/)
|
|
233
|
+
|
|
234
|
+
## API Endpoints
|
|
235
|
+
|
|
236
|
+
All endpoints are under `https://widebible.com/api/v1/bible/`. No authentication required. JSON responses with CORS enabled.
|
|
237
|
+
|
|
238
|
+
| Method | Endpoint | Description |
|
|
239
|
+
|--------|----------|-------------|
|
|
240
|
+
| GET | `/books/` | List all 66 books |
|
|
241
|
+
| GET | `/books/{slug}/` | Book details (chapters, verse count) |
|
|
242
|
+
| GET | `/book-groups/` | List book groups (Pentateuch, Gospels, etc.) |
|
|
243
|
+
| GET | `/book-groups/{slug}/` | Book group details |
|
|
244
|
+
| GET | `/translations/` | List Bible translations |
|
|
245
|
+
| GET | `/translations/{code}/` | Translation details |
|
|
246
|
+
| GET | `/chapters/` | List chapters (filter: `book__slug`) |
|
|
247
|
+
| GET | `/verses/` | List/search verses (filter: `book__slug`, `chapter`, `verse`, `translation__code`; search: `search`) |
|
|
248
|
+
| GET | `/people/` | List biblical people |
|
|
249
|
+
| GET | `/people/{slug}/` | Person details |
|
|
250
|
+
| GET | `/places/` | List biblical places |
|
|
251
|
+
| GET | `/places/{slug}/` | Place details with coordinates |
|
|
252
|
+
| GET | `/topics/` | List study topics |
|
|
253
|
+
| GET | `/topics/{slug}/` | Topic details |
|
|
254
|
+
| GET | `/cross-references/` | List cross-references (filter: `from_book`, `from_chapter`, `from_verse`) |
|
|
255
|
+
| GET | `/glossary/` | List glossary terms |
|
|
256
|
+
| GET | `/glossary/{slug}/` | Glossary term details |
|
|
257
|
+
| GET | `/timeline-eras/` | List timeline eras |
|
|
258
|
+
| GET | `/timeline-events/` | List events (filter: `era__slug`) |
|
|
259
|
+
| GET | `/reading-plans/` | List reading plans |
|
|
260
|
+
| GET | `/reading-plans/{slug}/` | Reading plan with daily entries |
|
|
261
|
+
|
|
262
|
+
### Example
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
curl -s "https://widebible.com/api/v1/bible/books/genesis/"
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"id": 1,
|
|
271
|
+
"name": "Genesis",
|
|
272
|
+
"slug": "genesis",
|
|
273
|
+
"abbreviation": "Gen",
|
|
274
|
+
"testament": "Old Testament",
|
|
275
|
+
"order": 1,
|
|
276
|
+
"chapter_count": 50,
|
|
277
|
+
"verse_count": 1533,
|
|
278
|
+
"description": "The book of beginnings -- creation, the fall, the flood, and the patriarchs.",
|
|
279
|
+
"url": "/books/genesis/"
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Full API documentation at [widebible.com/developers/](https://widebible.com/developers/).
|
|
284
|
+
OpenAPI 3.1.0 spec: [widebible.com/api/schema/](https://widebible.com/api/schema/).
|
|
285
|
+
|
|
286
|
+
## API Reference
|
|
287
|
+
|
|
288
|
+
| Method | Arguments | Returns | Description |
|
|
289
|
+
|--------|-----------|---------|-------------|
|
|
290
|
+
| `listBooks()` | -- | `Promise<ApiResponse<Book>>` | List all 66 books |
|
|
291
|
+
| `getBook(slug)` | `slug: string` | `Promise<Book>` | Book details |
|
|
292
|
+
| `listBookGroups()` | -- | `Promise<ApiResponse<BookGroup>>` | List book groups |
|
|
293
|
+
| `getBookGroup(slug)` | `slug: string` | `Promise<BookGroup>` | Book group details |
|
|
294
|
+
| `listTranslations()` | -- | `Promise<ApiResponse<Translation>>` | List translations |
|
|
295
|
+
| `getTranslation(code)` | `code: string` | `Promise<Translation>` | Translation details |
|
|
296
|
+
| `listChapters(book?)` | `book?: string` | `Promise<ApiResponse<Chapter>>` | List chapters |
|
|
297
|
+
| `getVerse(book, chapter, verse, translation?)` | `book: string, chapter: number, verse: number, translation?: string` | `Promise<ApiResponse<Verse>>` | Get a specific verse |
|
|
298
|
+
| `search(query, limit?)` | `query: string, limit?: number` | `Promise<ApiResponse<Verse>>` | Search verses |
|
|
299
|
+
| `listPeople()` | -- | `Promise<ApiResponse<Person>>` | List biblical people |
|
|
300
|
+
| `getPerson(slug)` | `slug: string` | `Promise<Person>` | Person details |
|
|
301
|
+
| `listPlaces()` | -- | `Promise<ApiResponse<Place>>` | List biblical places |
|
|
302
|
+
| `getPlace(slug)` | `slug: string` | `Promise<Place>` | Place details with coordinates |
|
|
303
|
+
| `listTopics()` | -- | `Promise<ApiResponse<Topic>>` | List study topics |
|
|
304
|
+
| `getTopic(slug)` | `slug: string` | `Promise<Topic>` | Topic details |
|
|
305
|
+
| `listCrossReferences(params?)` | `params?: Record<string, string>` | `Promise<ApiResponse<CrossReference>>` | List cross-references |
|
|
306
|
+
| `listGlossary()` | -- | `Promise<ApiResponse<GlossaryTerm>>` | List glossary terms |
|
|
307
|
+
| `getGlossaryTerm(slug)` | `slug: string` | `Promise<GlossaryTerm>` | Glossary term definition |
|
|
308
|
+
| `listEras()` | -- | `Promise<ApiResponse<TimelineEra>>` | List timeline eras |
|
|
309
|
+
| `listEvents(era?)` | `era?: string` | `Promise<ApiResponse<TimelineEvent>>` | List timeline events |
|
|
310
|
+
| `listReadingPlans()` | -- | `Promise<ApiResponse<ReadingPlan>>` | List reading plans |
|
|
311
|
+
| `getReadingPlan(slug)` | `slug: string` | `Promise<ReadingPlan>` | Reading plan with entries |
|
|
312
|
+
|
|
313
|
+
## TypeScript Types
|
|
314
|
+
|
|
315
|
+
All response types are exported and available for strong typing:
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
import type {
|
|
319
|
+
ApiResponse,
|
|
320
|
+
Book,
|
|
321
|
+
BookGroup,
|
|
322
|
+
Chapter,
|
|
323
|
+
CrossReference,
|
|
324
|
+
GlossaryTerm,
|
|
325
|
+
Person,
|
|
326
|
+
Place,
|
|
327
|
+
ReadingPlan,
|
|
328
|
+
ReadingPlanEntry,
|
|
329
|
+
TimelineEra,
|
|
330
|
+
TimelineEvent,
|
|
331
|
+
Topic,
|
|
332
|
+
Translation,
|
|
333
|
+
Verse,
|
|
334
|
+
} from "widebible";
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Learn More About the Bible
|
|
338
|
+
|
|
339
|
+
- **Scripture**: [Bible Books](https://widebible.com/books/) | [Bible Translations](https://widebible.com/translations/) | [Reading Plans](https://widebible.com/reading-plans/)
|
|
340
|
+
- **Reference**: [Biblical People](https://widebible.com/people/) | [Biblical Places](https://widebible.com/places/) | [Cross-References](https://widebible.com/cross-references/)
|
|
341
|
+
- **Study**: [Topic Index](https://widebible.com/topics/) | [Biblical Glossary](https://widebible.com/glossary/) | [Timeline](https://widebible.com/timeline/)
|
|
342
|
+
- **Tools**: [Verse Search](https://widebible.com/) | [Developer Docs](https://widebible.com/developers/)
|
|
343
|
+
- **API**: [REST API Documentation](https://widebible.com/developers/) | [OpenAPI Spec](https://widebible.com/api/schema/)
|
|
344
|
+
- **Python**: [PyPI Package](https://pypi.org/project/widebible/)
|
|
345
|
+
|
|
346
|
+
## Also Available for Python
|
|
347
|
+
|
|
348
|
+
| Platform | Package | Install |
|
|
349
|
+
|----------|---------|---------|
|
|
350
|
+
| **PyPI** | [widebible](https://pypi.org/project/widebible/) | `pip install widebible` |
|
|
351
|
+
| **Go** | [widebible-go](https://pkg.go.dev/github.com/dobestan/widebible-go) | `go get github.com/dobestan/widebible-go` |
|
|
352
|
+
| **Rust** | [widebible](https://crates.io/crates/widebible) | `cargo add widebible` |
|
|
353
|
+
| **Ruby** | [widebible](https://rubygems.org/gems/widebible) | `gem install widebible` |
|
|
354
|
+
| **MCP** | widebible-mcp | `uvx --from "widebible[mcp]" python -m widebible.mcp_server` |
|
|
355
|
+
|
|
356
|
+
## WideHoly Scripture Platform
|
|
357
|
+
|
|
358
|
+
Part of the [WideHoly](https://wideholy.com) multi-religion scripture platform.
|
|
359
|
+
|
|
360
|
+
| Site | Domain | Focus |
|
|
361
|
+
|------|--------|-------|
|
|
362
|
+
| **WideBible** | [widebible.com](https://widebible.com) | **66 books, 4 translations (KJV, ASV, BBE, YLT), 3,000+ people, 942 places, 432K cross-references** |
|
|
363
|
+
| WideQuran | [widequran.com](https://widequran.com) | 114 surahs, hadith collections, tafsir commentary, Quranic figures |
|
|
364
|
+
| WideTorah | [widetorah.com](https://widetorah.com) | Tanakh, 54 parashot, Talmud tractates, Rashi commentary |
|
|
365
|
+
| WideGita | [widegita.com](https://widegita.com) | 18 Gita chapters, Upanishads, Yoga Sutras, Hindu deities |
|
|
366
|
+
| WideSutra | [widesutra.com](https://widesutra.com) | Tipitaka, Mahayana sutras, Buddhist figures, core concepts |
|
|
367
|
+
| WideHoly | [wideholy.com](https://wideholy.com) | Cross-religion search, verse comparison, religious calendar |
|
|
368
|
+
|
|
369
|
+
## License
|
|
370
|
+
|
|
371
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript interfaces for WideBible API responses.
|
|
3
|
+
*
|
|
4
|
+
* All types mirror the widebible.com REST API JSON structure.
|
|
5
|
+
* See https://widebible.com/api/schema/ for the OpenAPI 3.1.0 spec.
|
|
6
|
+
*/
|
|
7
|
+
/** Paginated API response wrapper. */
|
|
8
|
+
interface ApiResponse<T> {
|
|
9
|
+
count: number;
|
|
10
|
+
next: string | null;
|
|
11
|
+
previous: string | null;
|
|
12
|
+
results: T[];
|
|
13
|
+
}
|
|
14
|
+
/** A book of the Bible (e.g. Genesis, John, Revelation). */
|
|
15
|
+
interface Book {
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
abbreviation: string;
|
|
20
|
+
testament: string;
|
|
21
|
+
order: number;
|
|
22
|
+
chapter_count: number;
|
|
23
|
+
verse_count: number;
|
|
24
|
+
description: string;
|
|
25
|
+
url: string;
|
|
26
|
+
}
|
|
27
|
+
/** A grouping of books (e.g. Pentateuch, Gospels, Pauline Epistles). */
|
|
28
|
+
interface BookGroup {
|
|
29
|
+
id: number;
|
|
30
|
+
name: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
testament: string;
|
|
33
|
+
book_count: number;
|
|
34
|
+
description: string;
|
|
35
|
+
}
|
|
36
|
+
/** A Bible translation (e.g. KJV, ASV, BBE, YLT). */
|
|
37
|
+
interface Translation {
|
|
38
|
+
id: number;
|
|
39
|
+
code: string;
|
|
40
|
+
name: string;
|
|
41
|
+
language: string;
|
|
42
|
+
year: number;
|
|
43
|
+
is_public_domain: boolean;
|
|
44
|
+
description: string;
|
|
45
|
+
}
|
|
46
|
+
/** A chapter within a book. */
|
|
47
|
+
interface Chapter {
|
|
48
|
+
id: number;
|
|
49
|
+
book_slug: string;
|
|
50
|
+
book_name: string;
|
|
51
|
+
number: number;
|
|
52
|
+
verse_count: number;
|
|
53
|
+
}
|
|
54
|
+
/** A single Bible verse in a specific translation. */
|
|
55
|
+
interface Verse {
|
|
56
|
+
id: number;
|
|
57
|
+
book_slug: string;
|
|
58
|
+
book_name: string;
|
|
59
|
+
chapter: number;
|
|
60
|
+
verse: number;
|
|
61
|
+
translation_code: string;
|
|
62
|
+
text: string;
|
|
63
|
+
reference: string;
|
|
64
|
+
}
|
|
65
|
+
/** A biblical person (prophet, king, apostle, etc.). */
|
|
66
|
+
interface Person {
|
|
67
|
+
id: number;
|
|
68
|
+
name: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
bio: string;
|
|
71
|
+
testament: string;
|
|
72
|
+
verse_count: number;
|
|
73
|
+
wikidata_id: string | null;
|
|
74
|
+
}
|
|
75
|
+
/** A geocoded biblical place. */
|
|
76
|
+
interface Place {
|
|
77
|
+
id: number;
|
|
78
|
+
name: string;
|
|
79
|
+
slug: string;
|
|
80
|
+
description: string;
|
|
81
|
+
latitude: number | null;
|
|
82
|
+
longitude: number | null;
|
|
83
|
+
verse_count: number;
|
|
84
|
+
wikidata_id: string | null;
|
|
85
|
+
}
|
|
86
|
+
/** A thematic Bible study topic (e.g. love, faith, prayer). */
|
|
87
|
+
interface Topic {
|
|
88
|
+
id: number;
|
|
89
|
+
name: string;
|
|
90
|
+
slug: string;
|
|
91
|
+
description: string;
|
|
92
|
+
verse_count: number;
|
|
93
|
+
}
|
|
94
|
+
/** A cross-reference linking two Bible passages. */
|
|
95
|
+
interface CrossReference {
|
|
96
|
+
id: number;
|
|
97
|
+
from_ref: string;
|
|
98
|
+
to_ref: string;
|
|
99
|
+
explanation: string;
|
|
100
|
+
}
|
|
101
|
+
/** A glossary term with Hebrew/Greek origins. */
|
|
102
|
+
interface GlossaryTerm {
|
|
103
|
+
id: number;
|
|
104
|
+
term: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
definition: string;
|
|
107
|
+
hebrew_word: string | null;
|
|
108
|
+
greek_word: string | null;
|
|
109
|
+
}
|
|
110
|
+
/** A timeline era (e.g. Patriarchs, Exodus, Apostolic). */
|
|
111
|
+
interface TimelineEra {
|
|
112
|
+
id: number;
|
|
113
|
+
name: string;
|
|
114
|
+
slug: string;
|
|
115
|
+
start_year: string;
|
|
116
|
+
end_year: string;
|
|
117
|
+
description: string;
|
|
118
|
+
}
|
|
119
|
+
/** A dated event in biblical history. */
|
|
120
|
+
interface TimelineEvent {
|
|
121
|
+
id: number;
|
|
122
|
+
name: string;
|
|
123
|
+
slug: string;
|
|
124
|
+
era_slug: string;
|
|
125
|
+
date: string;
|
|
126
|
+
description: string;
|
|
127
|
+
}
|
|
128
|
+
/** A curated Bible reading plan. */
|
|
129
|
+
interface ReadingPlan {
|
|
130
|
+
id: number;
|
|
131
|
+
name: string;
|
|
132
|
+
slug: string;
|
|
133
|
+
description: string;
|
|
134
|
+
duration_days: number;
|
|
135
|
+
entries: ReadingPlanEntry[];
|
|
136
|
+
}
|
|
137
|
+
/** A single day's entry in a reading plan. */
|
|
138
|
+
interface ReadingPlanEntry {
|
|
139
|
+
day: number;
|
|
140
|
+
passages: string[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* WideBible TypeScript SDK — zero-dependency API client for widebible.com.
|
|
145
|
+
*
|
|
146
|
+
* Uses native `fetch` for HTTP requests. Works in Node.js 18+, Deno, Bun,
|
|
147
|
+
* and modern browsers.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* import { WideBible } from "widebible";
|
|
152
|
+
*
|
|
153
|
+
* const client = new WideBible();
|
|
154
|
+
* const books = await client.listBooks();
|
|
155
|
+
* const verse = await client.getVerse("john", 3, 16);
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
declare class WideBible {
|
|
160
|
+
private readonly baseUrl;
|
|
161
|
+
/**
|
|
162
|
+
* Create a new WideBible API client.
|
|
163
|
+
*
|
|
164
|
+
* @param baseUrl - Base URL for the WideBible site. Defaults to `https://widebible.com`.
|
|
165
|
+
*/
|
|
166
|
+
constructor(baseUrl?: string);
|
|
167
|
+
/**
|
|
168
|
+
* Internal GET request helper — builds URL with query params and returns parsed JSON.
|
|
169
|
+
*/
|
|
170
|
+
private get;
|
|
171
|
+
/** List all 66 books of the Bible with chapter and verse counts. */
|
|
172
|
+
listBooks(): Promise<ApiResponse<Book>>;
|
|
173
|
+
/** Get book details by slug (e.g. 'genesis', 'john', 'revelation'). */
|
|
174
|
+
getBook(slug: string): Promise<Book>;
|
|
175
|
+
/** List book groups (Pentateuch, Gospels, Pauline Epistles, etc.). */
|
|
176
|
+
listBookGroups(): Promise<ApiResponse<BookGroup>>;
|
|
177
|
+
/** Get book group details by slug. */
|
|
178
|
+
getBookGroup(slug: string): Promise<BookGroup>;
|
|
179
|
+
/** List available Bible translations (KJV, ASV, BBE, YLT). */
|
|
180
|
+
listTranslations(): Promise<ApiResponse<Translation>>;
|
|
181
|
+
/** Get translation details by code (e.g. 'kjv', 'asv'). */
|
|
182
|
+
getTranslation(code: string): Promise<Translation>;
|
|
183
|
+
/** List chapters, optionally filtered by book slug. */
|
|
184
|
+
listChapters(book?: string): Promise<ApiResponse<Chapter>>;
|
|
185
|
+
/**
|
|
186
|
+
* Get a specific Bible verse by book, chapter, and verse number.
|
|
187
|
+
*
|
|
188
|
+
* @param book - Book slug (e.g. 'john', 'genesis')
|
|
189
|
+
* @param chapter - Chapter number
|
|
190
|
+
* @param verse - Verse number
|
|
191
|
+
* @param translation - Translation code (default: 'kjv')
|
|
192
|
+
*/
|
|
193
|
+
getVerse(book: string, chapter: number, verse: number, translation?: string): Promise<ApiResponse<Verse>>;
|
|
194
|
+
/**
|
|
195
|
+
* Search Bible verses by keyword.
|
|
196
|
+
*
|
|
197
|
+
* @param query - Search query string
|
|
198
|
+
* @param limit - Maximum number of results (default: 25)
|
|
199
|
+
*/
|
|
200
|
+
search(query: string, limit?: number): Promise<ApiResponse<Verse>>;
|
|
201
|
+
/** List biblical people (prophets, kings, apostles, etc.). */
|
|
202
|
+
listPeople(): Promise<ApiResponse<Person>>;
|
|
203
|
+
/** Get a biblical person's details by slug. */
|
|
204
|
+
getPerson(slug: string): Promise<Person>;
|
|
205
|
+
/** List biblical places with geocoded coordinates. */
|
|
206
|
+
listPlaces(): Promise<ApiResponse<Place>>;
|
|
207
|
+
/** Get a biblical place's details by slug. */
|
|
208
|
+
getPlace(slug: string): Promise<Place>;
|
|
209
|
+
/** List thematic verse collections (love, faith, prayer, etc.). */
|
|
210
|
+
listTopics(): Promise<ApiResponse<Topic>>;
|
|
211
|
+
/** Get topic details and associated verses by slug. */
|
|
212
|
+
getTopic(slug: string): Promise<Topic>;
|
|
213
|
+
/**
|
|
214
|
+
* List cross-references between Bible passages.
|
|
215
|
+
*
|
|
216
|
+
* @param params - Optional filters: from_book, from_chapter, from_verse, to_book
|
|
217
|
+
*/
|
|
218
|
+
listCrossReferences(params?: Record<string, string>): Promise<ApiResponse<CrossReference>>;
|
|
219
|
+
/** List biblical glossary terms with Hebrew/Greek words. */
|
|
220
|
+
listGlossary(): Promise<ApiResponse<GlossaryTerm>>;
|
|
221
|
+
/** Get a glossary term's definition by slug. */
|
|
222
|
+
getGlossaryTerm(slug: string): Promise<GlossaryTerm>;
|
|
223
|
+
/** List biblical timeline eras (Patriarchs, Exodus, Apostolic, etc.). */
|
|
224
|
+
listEras(): Promise<ApiResponse<TimelineEra>>;
|
|
225
|
+
/**
|
|
226
|
+
* List timeline events, optionally filtered by era slug.
|
|
227
|
+
*
|
|
228
|
+
* @param era - Era slug to filter by (e.g. 'patriarchs', 'exodus')
|
|
229
|
+
*/
|
|
230
|
+
listEvents(era?: string): Promise<ApiResponse<TimelineEvent>>;
|
|
231
|
+
/** List Bible reading plans. */
|
|
232
|
+
listReadingPlans(): Promise<ApiResponse<ReadingPlan>>;
|
|
233
|
+
/** Get a reading plan's details and daily entries by slug. */
|
|
234
|
+
getReadingPlan(slug: string): Promise<ReadingPlan>;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export { type ApiResponse, type Book, type BookGroup, type Chapter, type CrossReference, type GlossaryTerm, type Person, type Place, type ReadingPlan, type ReadingPlanEntry, type TimelineEra, type TimelineEvent, type Topic, type Translation, type Verse, WideBible };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// src/client.ts
|
|
2
|
+
var WideBible = class {
|
|
3
|
+
baseUrl;
|
|
4
|
+
/**
|
|
5
|
+
* Create a new WideBible API client.
|
|
6
|
+
*
|
|
7
|
+
* @param baseUrl - Base URL for the WideBible site. Defaults to `https://widebible.com`.
|
|
8
|
+
*/
|
|
9
|
+
constructor(baseUrl = "https://widebible.com") {
|
|
10
|
+
this.baseUrl = `${baseUrl.replace(/\/+$/, "")}/api/v1/bible`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Internal GET request helper — builds URL with query params and returns parsed JSON.
|
|
14
|
+
*/
|
|
15
|
+
async get(path, params) {
|
|
16
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
17
|
+
if (params) {
|
|
18
|
+
for (const [key, value] of Object.entries(params)) {
|
|
19
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
20
|
+
url.searchParams.set(key, value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const res = await fetch(url.toString());
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
throw new Error(`HTTP ${res.status}: ${res.statusText}`);
|
|
27
|
+
}
|
|
28
|
+
return res.json();
|
|
29
|
+
}
|
|
30
|
+
// --- Books -----------------------------------------------------------------
|
|
31
|
+
/** List all 66 books of the Bible with chapter and verse counts. */
|
|
32
|
+
async listBooks() {
|
|
33
|
+
return this.get("/books/");
|
|
34
|
+
}
|
|
35
|
+
/** Get book details by slug (e.g. 'genesis', 'john', 'revelation'). */
|
|
36
|
+
async getBook(slug) {
|
|
37
|
+
return this.get(`/books/${slug}/`);
|
|
38
|
+
}
|
|
39
|
+
// --- Book Groups -----------------------------------------------------------
|
|
40
|
+
/** List book groups (Pentateuch, Gospels, Pauline Epistles, etc.). */
|
|
41
|
+
async listBookGroups() {
|
|
42
|
+
return this.get("/book-groups/");
|
|
43
|
+
}
|
|
44
|
+
/** Get book group details by slug. */
|
|
45
|
+
async getBookGroup(slug) {
|
|
46
|
+
return this.get(`/book-groups/${slug}/`);
|
|
47
|
+
}
|
|
48
|
+
// --- Translations ----------------------------------------------------------
|
|
49
|
+
/** List available Bible translations (KJV, ASV, BBE, YLT). */
|
|
50
|
+
async listTranslations() {
|
|
51
|
+
return this.get("/translations/");
|
|
52
|
+
}
|
|
53
|
+
/** Get translation details by code (e.g. 'kjv', 'asv'). */
|
|
54
|
+
async getTranslation(code) {
|
|
55
|
+
return this.get(`/translations/${code}/`);
|
|
56
|
+
}
|
|
57
|
+
// --- Chapters --------------------------------------------------------------
|
|
58
|
+
/** List chapters, optionally filtered by book slug. */
|
|
59
|
+
async listChapters(book) {
|
|
60
|
+
const params = {};
|
|
61
|
+
if (book) params["book__slug"] = book;
|
|
62
|
+
return this.get("/chapters/", params);
|
|
63
|
+
}
|
|
64
|
+
// --- Verses ----------------------------------------------------------------
|
|
65
|
+
/**
|
|
66
|
+
* Get a specific Bible verse by book, chapter, and verse number.
|
|
67
|
+
*
|
|
68
|
+
* @param book - Book slug (e.g. 'john', 'genesis')
|
|
69
|
+
* @param chapter - Chapter number
|
|
70
|
+
* @param verse - Verse number
|
|
71
|
+
* @param translation - Translation code (default: 'kjv')
|
|
72
|
+
*/
|
|
73
|
+
async getVerse(book, chapter, verse, translation = "kjv") {
|
|
74
|
+
return this.get("/verses/", {
|
|
75
|
+
book__slug: book,
|
|
76
|
+
chapter: String(chapter),
|
|
77
|
+
verse: String(verse),
|
|
78
|
+
translation__code: translation
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Search Bible verses by keyword.
|
|
83
|
+
*
|
|
84
|
+
* @param query - Search query string
|
|
85
|
+
* @param limit - Maximum number of results (default: 25)
|
|
86
|
+
*/
|
|
87
|
+
async search(query, limit = 25) {
|
|
88
|
+
return this.get("/verses/", {
|
|
89
|
+
search: query,
|
|
90
|
+
page_size: String(limit)
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// --- People ----------------------------------------------------------------
|
|
94
|
+
/** List biblical people (prophets, kings, apostles, etc.). */
|
|
95
|
+
async listPeople() {
|
|
96
|
+
return this.get("/people/");
|
|
97
|
+
}
|
|
98
|
+
/** Get a biblical person's details by slug. */
|
|
99
|
+
async getPerson(slug) {
|
|
100
|
+
return this.get(`/people/${slug}/`);
|
|
101
|
+
}
|
|
102
|
+
// --- Places ----------------------------------------------------------------
|
|
103
|
+
/** List biblical places with geocoded coordinates. */
|
|
104
|
+
async listPlaces() {
|
|
105
|
+
return this.get("/places/");
|
|
106
|
+
}
|
|
107
|
+
/** Get a biblical place's details by slug. */
|
|
108
|
+
async getPlace(slug) {
|
|
109
|
+
return this.get(`/places/${slug}/`);
|
|
110
|
+
}
|
|
111
|
+
// --- Topics ----------------------------------------------------------------
|
|
112
|
+
/** List thematic verse collections (love, faith, prayer, etc.). */
|
|
113
|
+
async listTopics() {
|
|
114
|
+
return this.get("/topics/");
|
|
115
|
+
}
|
|
116
|
+
/** Get topic details and associated verses by slug. */
|
|
117
|
+
async getTopic(slug) {
|
|
118
|
+
return this.get(`/topics/${slug}/`);
|
|
119
|
+
}
|
|
120
|
+
// --- Cross-References ------------------------------------------------------
|
|
121
|
+
/**
|
|
122
|
+
* List cross-references between Bible passages.
|
|
123
|
+
*
|
|
124
|
+
* @param params - Optional filters: from_book, from_chapter, from_verse, to_book
|
|
125
|
+
*/
|
|
126
|
+
async listCrossReferences(params) {
|
|
127
|
+
return this.get("/cross-references/", params);
|
|
128
|
+
}
|
|
129
|
+
// --- Glossary --------------------------------------------------------------
|
|
130
|
+
/** List biblical glossary terms with Hebrew/Greek words. */
|
|
131
|
+
async listGlossary() {
|
|
132
|
+
return this.get("/glossary/");
|
|
133
|
+
}
|
|
134
|
+
/** Get a glossary term's definition by slug. */
|
|
135
|
+
async getGlossaryTerm(slug) {
|
|
136
|
+
return this.get(`/glossary/${slug}/`);
|
|
137
|
+
}
|
|
138
|
+
// --- Timeline --------------------------------------------------------------
|
|
139
|
+
/** List biblical timeline eras (Patriarchs, Exodus, Apostolic, etc.). */
|
|
140
|
+
async listEras() {
|
|
141
|
+
return this.get("/timeline-eras/");
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* List timeline events, optionally filtered by era slug.
|
|
145
|
+
*
|
|
146
|
+
* @param era - Era slug to filter by (e.g. 'patriarchs', 'exodus')
|
|
147
|
+
*/
|
|
148
|
+
async listEvents(era) {
|
|
149
|
+
const params = {};
|
|
150
|
+
if (era) params["era__slug"] = era;
|
|
151
|
+
return this.get("/timeline-events/", params);
|
|
152
|
+
}
|
|
153
|
+
// --- Reading Plans ---------------------------------------------------------
|
|
154
|
+
/** List Bible reading plans. */
|
|
155
|
+
async listReadingPlans() {
|
|
156
|
+
return this.get("/reading-plans/");
|
|
157
|
+
}
|
|
158
|
+
/** Get a reading plan's details and daily entries by slug. */
|
|
159
|
+
async getReadingPlan(slug) {
|
|
160
|
+
return this.get(`/reading-plans/${slug}/`);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
WideBible
|
|
165
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "widebible",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TypeScript SDK for WideBible -- Bible verses, people, places, cross-references, and study tools",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsup src/index.ts --format esm --dts",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"bible",
|
|
17
|
+
"scripture",
|
|
18
|
+
"verse",
|
|
19
|
+
"kjv",
|
|
20
|
+
"bible-api",
|
|
21
|
+
"cross-reference",
|
|
22
|
+
"biblical-people",
|
|
23
|
+
"biblical-places",
|
|
24
|
+
"reading-plan",
|
|
25
|
+
"bible-study",
|
|
26
|
+
"old-testament",
|
|
27
|
+
"new-testament",
|
|
28
|
+
"bible-search",
|
|
29
|
+
"bible-sdk",
|
|
30
|
+
"typescript"
|
|
31
|
+
],
|
|
32
|
+
"author": "WideHoly",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"homepage": "https://widebible.com",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/dobestan/widebible-js"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"tsup": "^8.0",
|
|
42
|
+
"typescript": "^5.7",
|
|
43
|
+
"vitest": "^2.0"
|
|
44
|
+
}
|
|
45
|
+
}
|