@iflow-mcp/kdcokenny-lsbible 0.3.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/README.md +529 -0
- package/dist/index.cjs +2269 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +81 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +2254 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.cjs +2716 -0
- package/dist/mcp/index.cjs.map +1 -0
- package/dist/mcp/index.d.cts +230 -0
- package/dist/mcp/index.d.ts +230 -0
- package/dist/mcp/index.js +2707 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/stdio.cjs +2709 -0
- package/dist/mcp/stdio.cjs.map +1 -0
- package/dist/mcp/stdio.d.cts +1 -0
- package/dist/mcp/stdio.d.ts +1 -0
- package/dist/mcp/stdio.js +2707 -0
- package/dist/mcp/stdio.js.map +1 -0
- package/dist/noop-B62cxzKZ.d.cts +1157 -0
- package/dist/noop-B62cxzKZ.d.ts +1157 -0
- package/package.json +1 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2269 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zod = require('zod');
|
|
4
|
+
var linkedom = require('linkedom');
|
|
5
|
+
|
|
6
|
+
// src/books.ts
|
|
7
|
+
var Testament = /* @__PURE__ */ ((Testament2) => {
|
|
8
|
+
Testament2["OLD_TESTAMENT"] = "OT";
|
|
9
|
+
Testament2["NEW_TESTAMENT"] = "NT";
|
|
10
|
+
return Testament2;
|
|
11
|
+
})(Testament || {});
|
|
12
|
+
var BibleSection = /* @__PURE__ */ ((BibleSection2) => {
|
|
13
|
+
BibleSection2["PENTATEUCH"] = "Pentateuch";
|
|
14
|
+
BibleSection2["HISTORY"] = "History";
|
|
15
|
+
BibleSection2["WISDOM_AND_POETRY"] = "Wisdom and Poetry";
|
|
16
|
+
BibleSection2["MAJOR_PROPHETS"] = "Major Prophets";
|
|
17
|
+
BibleSection2["MINOR_PROPHETS"] = "Minor Prophets";
|
|
18
|
+
BibleSection2["GOSPELS_AND_ACTS"] = "Gospels and Acts";
|
|
19
|
+
BibleSection2["PAULINE_EPISTLES"] = "Pauline Epistles";
|
|
20
|
+
BibleSection2["GENERAL_EPISTLES"] = "General Epistles";
|
|
21
|
+
return BibleSection2;
|
|
22
|
+
})(BibleSection || {});
|
|
23
|
+
var BIBLE_STRUCTURE = {
|
|
24
|
+
1: {
|
|
25
|
+
number: 1,
|
|
26
|
+
name: "Genesis",
|
|
27
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
28
|
+
chapters: 50,
|
|
29
|
+
verses: [
|
|
30
|
+
31,
|
|
31
|
+
25,
|
|
32
|
+
24,
|
|
33
|
+
26,
|
|
34
|
+
32,
|
|
35
|
+
22,
|
|
36
|
+
24,
|
|
37
|
+
22,
|
|
38
|
+
29,
|
|
39
|
+
32,
|
|
40
|
+
32,
|
|
41
|
+
20,
|
|
42
|
+
18,
|
|
43
|
+
24,
|
|
44
|
+
21,
|
|
45
|
+
16,
|
|
46
|
+
27,
|
|
47
|
+
33,
|
|
48
|
+
38,
|
|
49
|
+
18,
|
|
50
|
+
34,
|
|
51
|
+
24,
|
|
52
|
+
20,
|
|
53
|
+
67,
|
|
54
|
+
34,
|
|
55
|
+
35,
|
|
56
|
+
46,
|
|
57
|
+
22,
|
|
58
|
+
35,
|
|
59
|
+
43,
|
|
60
|
+
55,
|
|
61
|
+
32,
|
|
62
|
+
20,
|
|
63
|
+
31,
|
|
64
|
+
29,
|
|
65
|
+
43,
|
|
66
|
+
36,
|
|
67
|
+
30,
|
|
68
|
+
23,
|
|
69
|
+
23,
|
|
70
|
+
57,
|
|
71
|
+
38,
|
|
72
|
+
34,
|
|
73
|
+
34,
|
|
74
|
+
28,
|
|
75
|
+
34,
|
|
76
|
+
31,
|
|
77
|
+
22,
|
|
78
|
+
33,
|
|
79
|
+
26
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
2: {
|
|
83
|
+
number: 2,
|
|
84
|
+
name: "Exodus",
|
|
85
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
86
|
+
chapters: 40,
|
|
87
|
+
verses: [
|
|
88
|
+
22,
|
|
89
|
+
25,
|
|
90
|
+
22,
|
|
91
|
+
31,
|
|
92
|
+
23,
|
|
93
|
+
30,
|
|
94
|
+
25,
|
|
95
|
+
32,
|
|
96
|
+
35,
|
|
97
|
+
29,
|
|
98
|
+
10,
|
|
99
|
+
51,
|
|
100
|
+
22,
|
|
101
|
+
31,
|
|
102
|
+
27,
|
|
103
|
+
36,
|
|
104
|
+
16,
|
|
105
|
+
27,
|
|
106
|
+
25,
|
|
107
|
+
26,
|
|
108
|
+
36,
|
|
109
|
+
31,
|
|
110
|
+
33,
|
|
111
|
+
18,
|
|
112
|
+
40,
|
|
113
|
+
37,
|
|
114
|
+
21,
|
|
115
|
+
43,
|
|
116
|
+
46,
|
|
117
|
+
38,
|
|
118
|
+
18,
|
|
119
|
+
35,
|
|
120
|
+
23,
|
|
121
|
+
35,
|
|
122
|
+
35,
|
|
123
|
+
38,
|
|
124
|
+
29,
|
|
125
|
+
31,
|
|
126
|
+
43,
|
|
127
|
+
38
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
3: {
|
|
131
|
+
number: 3,
|
|
132
|
+
name: "Leviticus",
|
|
133
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
134
|
+
chapters: 27,
|
|
135
|
+
verses: [
|
|
136
|
+
17,
|
|
137
|
+
16,
|
|
138
|
+
17,
|
|
139
|
+
35,
|
|
140
|
+
19,
|
|
141
|
+
30,
|
|
142
|
+
38,
|
|
143
|
+
36,
|
|
144
|
+
24,
|
|
145
|
+
20,
|
|
146
|
+
47,
|
|
147
|
+
8,
|
|
148
|
+
59,
|
|
149
|
+
57,
|
|
150
|
+
33,
|
|
151
|
+
34,
|
|
152
|
+
16,
|
|
153
|
+
30,
|
|
154
|
+
37,
|
|
155
|
+
27,
|
|
156
|
+
24,
|
|
157
|
+
33,
|
|
158
|
+
44,
|
|
159
|
+
23,
|
|
160
|
+
55,
|
|
161
|
+
46,
|
|
162
|
+
34
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
4: {
|
|
166
|
+
number: 4,
|
|
167
|
+
name: "Numbers",
|
|
168
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
169
|
+
chapters: 36,
|
|
170
|
+
verses: [
|
|
171
|
+
54,
|
|
172
|
+
34,
|
|
173
|
+
51,
|
|
174
|
+
49,
|
|
175
|
+
31,
|
|
176
|
+
27,
|
|
177
|
+
89,
|
|
178
|
+
26,
|
|
179
|
+
23,
|
|
180
|
+
36,
|
|
181
|
+
35,
|
|
182
|
+
16,
|
|
183
|
+
33,
|
|
184
|
+
45,
|
|
185
|
+
41,
|
|
186
|
+
50,
|
|
187
|
+
13,
|
|
188
|
+
32,
|
|
189
|
+
22,
|
|
190
|
+
29,
|
|
191
|
+
35,
|
|
192
|
+
41,
|
|
193
|
+
30,
|
|
194
|
+
25,
|
|
195
|
+
18,
|
|
196
|
+
65,
|
|
197
|
+
23,
|
|
198
|
+
31,
|
|
199
|
+
40,
|
|
200
|
+
16,
|
|
201
|
+
54,
|
|
202
|
+
42,
|
|
203
|
+
56,
|
|
204
|
+
29,
|
|
205
|
+
34,
|
|
206
|
+
13
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
5: {
|
|
210
|
+
number: 5,
|
|
211
|
+
name: "Deuteronomy",
|
|
212
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
213
|
+
chapters: 34,
|
|
214
|
+
verses: [
|
|
215
|
+
46,
|
|
216
|
+
37,
|
|
217
|
+
29,
|
|
218
|
+
49,
|
|
219
|
+
33,
|
|
220
|
+
25,
|
|
221
|
+
26,
|
|
222
|
+
20,
|
|
223
|
+
29,
|
|
224
|
+
22,
|
|
225
|
+
32,
|
|
226
|
+
32,
|
|
227
|
+
18,
|
|
228
|
+
29,
|
|
229
|
+
23,
|
|
230
|
+
22,
|
|
231
|
+
20,
|
|
232
|
+
22,
|
|
233
|
+
21,
|
|
234
|
+
20,
|
|
235
|
+
23,
|
|
236
|
+
30,
|
|
237
|
+
25,
|
|
238
|
+
22,
|
|
239
|
+
19,
|
|
240
|
+
19,
|
|
241
|
+
26,
|
|
242
|
+
68,
|
|
243
|
+
29,
|
|
244
|
+
20,
|
|
245
|
+
30,
|
|
246
|
+
52,
|
|
247
|
+
29,
|
|
248
|
+
12
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
6: {
|
|
252
|
+
number: 6,
|
|
253
|
+
name: "Joshua",
|
|
254
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
255
|
+
chapters: 24,
|
|
256
|
+
verses: [
|
|
257
|
+
18,
|
|
258
|
+
24,
|
|
259
|
+
17,
|
|
260
|
+
24,
|
|
261
|
+
15,
|
|
262
|
+
27,
|
|
263
|
+
26,
|
|
264
|
+
35,
|
|
265
|
+
27,
|
|
266
|
+
43,
|
|
267
|
+
23,
|
|
268
|
+
24,
|
|
269
|
+
33,
|
|
270
|
+
15,
|
|
271
|
+
63,
|
|
272
|
+
10,
|
|
273
|
+
18,
|
|
274
|
+
28,
|
|
275
|
+
51,
|
|
276
|
+
9,
|
|
277
|
+
45,
|
|
278
|
+
34,
|
|
279
|
+
16,
|
|
280
|
+
33
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
7: {
|
|
284
|
+
number: 7,
|
|
285
|
+
name: "Judges",
|
|
286
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
287
|
+
chapters: 21,
|
|
288
|
+
verses: [36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25]
|
|
289
|
+
},
|
|
290
|
+
8: {
|
|
291
|
+
number: 8,
|
|
292
|
+
name: "Ruth",
|
|
293
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
294
|
+
chapters: 4,
|
|
295
|
+
verses: [22, 23, 18, 22]
|
|
296
|
+
},
|
|
297
|
+
9: {
|
|
298
|
+
number: 9,
|
|
299
|
+
name: "1 Samuel",
|
|
300
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
301
|
+
chapters: 31,
|
|
302
|
+
verses: [
|
|
303
|
+
28,
|
|
304
|
+
36,
|
|
305
|
+
21,
|
|
306
|
+
22,
|
|
307
|
+
12,
|
|
308
|
+
21,
|
|
309
|
+
17,
|
|
310
|
+
22,
|
|
311
|
+
27,
|
|
312
|
+
27,
|
|
313
|
+
15,
|
|
314
|
+
25,
|
|
315
|
+
23,
|
|
316
|
+
52,
|
|
317
|
+
35,
|
|
318
|
+
23,
|
|
319
|
+
58,
|
|
320
|
+
30,
|
|
321
|
+
24,
|
|
322
|
+
42,
|
|
323
|
+
15,
|
|
324
|
+
23,
|
|
325
|
+
29,
|
|
326
|
+
22,
|
|
327
|
+
44,
|
|
328
|
+
25,
|
|
329
|
+
12,
|
|
330
|
+
25,
|
|
331
|
+
11,
|
|
332
|
+
31,
|
|
333
|
+
13
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
10: {
|
|
337
|
+
number: 10,
|
|
338
|
+
name: "2 Samuel",
|
|
339
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
340
|
+
chapters: 24,
|
|
341
|
+
verses: [
|
|
342
|
+
27,
|
|
343
|
+
32,
|
|
344
|
+
39,
|
|
345
|
+
12,
|
|
346
|
+
25,
|
|
347
|
+
23,
|
|
348
|
+
29,
|
|
349
|
+
18,
|
|
350
|
+
13,
|
|
351
|
+
19,
|
|
352
|
+
27,
|
|
353
|
+
31,
|
|
354
|
+
39,
|
|
355
|
+
33,
|
|
356
|
+
37,
|
|
357
|
+
23,
|
|
358
|
+
29,
|
|
359
|
+
33,
|
|
360
|
+
43,
|
|
361
|
+
26,
|
|
362
|
+
22,
|
|
363
|
+
51,
|
|
364
|
+
39,
|
|
365
|
+
25
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
11: {
|
|
369
|
+
number: 11,
|
|
370
|
+
name: "1 Kings",
|
|
371
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
372
|
+
chapters: 22,
|
|
373
|
+
verses: [
|
|
374
|
+
53,
|
|
375
|
+
46,
|
|
376
|
+
28,
|
|
377
|
+
34,
|
|
378
|
+
18,
|
|
379
|
+
38,
|
|
380
|
+
51,
|
|
381
|
+
66,
|
|
382
|
+
28,
|
|
383
|
+
29,
|
|
384
|
+
43,
|
|
385
|
+
33,
|
|
386
|
+
34,
|
|
387
|
+
31,
|
|
388
|
+
34,
|
|
389
|
+
34,
|
|
390
|
+
24,
|
|
391
|
+
46,
|
|
392
|
+
21,
|
|
393
|
+
43,
|
|
394
|
+
29,
|
|
395
|
+
53
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
12: {
|
|
399
|
+
number: 12,
|
|
400
|
+
name: "2 Kings",
|
|
401
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
402
|
+
chapters: 25,
|
|
403
|
+
verses: [
|
|
404
|
+
18,
|
|
405
|
+
25,
|
|
406
|
+
27,
|
|
407
|
+
44,
|
|
408
|
+
27,
|
|
409
|
+
33,
|
|
410
|
+
20,
|
|
411
|
+
29,
|
|
412
|
+
37,
|
|
413
|
+
36,
|
|
414
|
+
21,
|
|
415
|
+
21,
|
|
416
|
+
25,
|
|
417
|
+
29,
|
|
418
|
+
38,
|
|
419
|
+
20,
|
|
420
|
+
41,
|
|
421
|
+
37,
|
|
422
|
+
37,
|
|
423
|
+
21,
|
|
424
|
+
26,
|
|
425
|
+
20,
|
|
426
|
+
37,
|
|
427
|
+
20,
|
|
428
|
+
30
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
13: {
|
|
432
|
+
number: 13,
|
|
433
|
+
name: "1 Chronicles",
|
|
434
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
435
|
+
chapters: 29,
|
|
436
|
+
verses: [
|
|
437
|
+
54,
|
|
438
|
+
55,
|
|
439
|
+
24,
|
|
440
|
+
43,
|
|
441
|
+
26,
|
|
442
|
+
81,
|
|
443
|
+
40,
|
|
444
|
+
40,
|
|
445
|
+
44,
|
|
446
|
+
14,
|
|
447
|
+
47,
|
|
448
|
+
40,
|
|
449
|
+
14,
|
|
450
|
+
17,
|
|
451
|
+
29,
|
|
452
|
+
43,
|
|
453
|
+
27,
|
|
454
|
+
17,
|
|
455
|
+
19,
|
|
456
|
+
8,
|
|
457
|
+
30,
|
|
458
|
+
19,
|
|
459
|
+
32,
|
|
460
|
+
31,
|
|
461
|
+
31,
|
|
462
|
+
32,
|
|
463
|
+
34,
|
|
464
|
+
21,
|
|
465
|
+
30
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
14: {
|
|
469
|
+
number: 14,
|
|
470
|
+
name: "2 Chronicles",
|
|
471
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
472
|
+
chapters: 36,
|
|
473
|
+
verses: [
|
|
474
|
+
17,
|
|
475
|
+
18,
|
|
476
|
+
17,
|
|
477
|
+
22,
|
|
478
|
+
14,
|
|
479
|
+
42,
|
|
480
|
+
22,
|
|
481
|
+
18,
|
|
482
|
+
31,
|
|
483
|
+
19,
|
|
484
|
+
23,
|
|
485
|
+
16,
|
|
486
|
+
22,
|
|
487
|
+
15,
|
|
488
|
+
19,
|
|
489
|
+
14,
|
|
490
|
+
19,
|
|
491
|
+
34,
|
|
492
|
+
11,
|
|
493
|
+
37,
|
|
494
|
+
20,
|
|
495
|
+
12,
|
|
496
|
+
21,
|
|
497
|
+
27,
|
|
498
|
+
28,
|
|
499
|
+
23,
|
|
500
|
+
9,
|
|
501
|
+
27,
|
|
502
|
+
36,
|
|
503
|
+
27,
|
|
504
|
+
21,
|
|
505
|
+
33,
|
|
506
|
+
25,
|
|
507
|
+
33,
|
|
508
|
+
27,
|
|
509
|
+
23
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
15: {
|
|
513
|
+
number: 15,
|
|
514
|
+
name: "Ezra",
|
|
515
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
516
|
+
chapters: 10,
|
|
517
|
+
verses: [11, 70, 13, 24, 17, 22, 28, 36, 15, 44]
|
|
518
|
+
},
|
|
519
|
+
16: {
|
|
520
|
+
number: 16,
|
|
521
|
+
name: "Nehemiah",
|
|
522
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
523
|
+
chapters: 13,
|
|
524
|
+
verses: [11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31]
|
|
525
|
+
},
|
|
526
|
+
17: {
|
|
527
|
+
number: 17,
|
|
528
|
+
name: "Esther",
|
|
529
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
530
|
+
chapters: 10,
|
|
531
|
+
verses: [22, 23, 15, 17, 14, 14, 10, 17, 32, 3]
|
|
532
|
+
},
|
|
533
|
+
18: {
|
|
534
|
+
number: 18,
|
|
535
|
+
name: "Job",
|
|
536
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
537
|
+
chapters: 42,
|
|
538
|
+
verses: [
|
|
539
|
+
22,
|
|
540
|
+
13,
|
|
541
|
+
26,
|
|
542
|
+
21,
|
|
543
|
+
27,
|
|
544
|
+
30,
|
|
545
|
+
21,
|
|
546
|
+
22,
|
|
547
|
+
35,
|
|
548
|
+
22,
|
|
549
|
+
20,
|
|
550
|
+
25,
|
|
551
|
+
28,
|
|
552
|
+
22,
|
|
553
|
+
35,
|
|
554
|
+
22,
|
|
555
|
+
16,
|
|
556
|
+
21,
|
|
557
|
+
29,
|
|
558
|
+
29,
|
|
559
|
+
34,
|
|
560
|
+
30,
|
|
561
|
+
17,
|
|
562
|
+
25,
|
|
563
|
+
6,
|
|
564
|
+
14,
|
|
565
|
+
23,
|
|
566
|
+
28,
|
|
567
|
+
25,
|
|
568
|
+
31,
|
|
569
|
+
40,
|
|
570
|
+
22,
|
|
571
|
+
33,
|
|
572
|
+
37,
|
|
573
|
+
16,
|
|
574
|
+
33,
|
|
575
|
+
24,
|
|
576
|
+
41,
|
|
577
|
+
30,
|
|
578
|
+
24,
|
|
579
|
+
34,
|
|
580
|
+
17
|
|
581
|
+
]
|
|
582
|
+
},
|
|
583
|
+
19: {
|
|
584
|
+
number: 19,
|
|
585
|
+
name: "Psalms",
|
|
586
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
587
|
+
chapters: 150,
|
|
588
|
+
verses: [
|
|
589
|
+
6,
|
|
590
|
+
12,
|
|
591
|
+
8,
|
|
592
|
+
8,
|
|
593
|
+
12,
|
|
594
|
+
10,
|
|
595
|
+
17,
|
|
596
|
+
9,
|
|
597
|
+
20,
|
|
598
|
+
18,
|
|
599
|
+
7,
|
|
600
|
+
8,
|
|
601
|
+
6,
|
|
602
|
+
7,
|
|
603
|
+
5,
|
|
604
|
+
11,
|
|
605
|
+
15,
|
|
606
|
+
50,
|
|
607
|
+
14,
|
|
608
|
+
9,
|
|
609
|
+
13,
|
|
610
|
+
31,
|
|
611
|
+
6,
|
|
612
|
+
10,
|
|
613
|
+
22,
|
|
614
|
+
12,
|
|
615
|
+
14,
|
|
616
|
+
9,
|
|
617
|
+
11,
|
|
618
|
+
12,
|
|
619
|
+
24,
|
|
620
|
+
11,
|
|
621
|
+
22,
|
|
622
|
+
22,
|
|
623
|
+
28,
|
|
624
|
+
12,
|
|
625
|
+
40,
|
|
626
|
+
22,
|
|
627
|
+
13,
|
|
628
|
+
17,
|
|
629
|
+
13,
|
|
630
|
+
11,
|
|
631
|
+
5,
|
|
632
|
+
26,
|
|
633
|
+
17,
|
|
634
|
+
11,
|
|
635
|
+
9,
|
|
636
|
+
14,
|
|
637
|
+
20,
|
|
638
|
+
23,
|
|
639
|
+
19,
|
|
640
|
+
9,
|
|
641
|
+
6,
|
|
642
|
+
7,
|
|
643
|
+
23,
|
|
644
|
+
13,
|
|
645
|
+
11,
|
|
646
|
+
11,
|
|
647
|
+
17,
|
|
648
|
+
12,
|
|
649
|
+
8,
|
|
650
|
+
12,
|
|
651
|
+
11,
|
|
652
|
+
10,
|
|
653
|
+
13,
|
|
654
|
+
20,
|
|
655
|
+
7,
|
|
656
|
+
35,
|
|
657
|
+
36,
|
|
658
|
+
5,
|
|
659
|
+
24,
|
|
660
|
+
20,
|
|
661
|
+
28,
|
|
662
|
+
23,
|
|
663
|
+
10,
|
|
664
|
+
12,
|
|
665
|
+
20,
|
|
666
|
+
72,
|
|
667
|
+
13,
|
|
668
|
+
19,
|
|
669
|
+
16,
|
|
670
|
+
8,
|
|
671
|
+
18,
|
|
672
|
+
12,
|
|
673
|
+
13,
|
|
674
|
+
17,
|
|
675
|
+
7,
|
|
676
|
+
18,
|
|
677
|
+
52,
|
|
678
|
+
17,
|
|
679
|
+
16,
|
|
680
|
+
15,
|
|
681
|
+
5,
|
|
682
|
+
23,
|
|
683
|
+
11,
|
|
684
|
+
13,
|
|
685
|
+
12,
|
|
686
|
+
9,
|
|
687
|
+
9,
|
|
688
|
+
5,
|
|
689
|
+
8,
|
|
690
|
+
28,
|
|
691
|
+
22,
|
|
692
|
+
35,
|
|
693
|
+
45,
|
|
694
|
+
48,
|
|
695
|
+
43,
|
|
696
|
+
13,
|
|
697
|
+
31,
|
|
698
|
+
7,
|
|
699
|
+
10,
|
|
700
|
+
10,
|
|
701
|
+
9,
|
|
702
|
+
8,
|
|
703
|
+
18,
|
|
704
|
+
19,
|
|
705
|
+
2,
|
|
706
|
+
29,
|
|
707
|
+
176,
|
|
708
|
+
7,
|
|
709
|
+
8,
|
|
710
|
+
9,
|
|
711
|
+
4,
|
|
712
|
+
8,
|
|
713
|
+
5,
|
|
714
|
+
6,
|
|
715
|
+
5,
|
|
716
|
+
6,
|
|
717
|
+
8,
|
|
718
|
+
8,
|
|
719
|
+
3,
|
|
720
|
+
18,
|
|
721
|
+
3,
|
|
722
|
+
3,
|
|
723
|
+
21,
|
|
724
|
+
26,
|
|
725
|
+
9,
|
|
726
|
+
8,
|
|
727
|
+
24,
|
|
728
|
+
13,
|
|
729
|
+
10,
|
|
730
|
+
7,
|
|
731
|
+
12,
|
|
732
|
+
15,
|
|
733
|
+
21,
|
|
734
|
+
10,
|
|
735
|
+
20,
|
|
736
|
+
14,
|
|
737
|
+
9,
|
|
738
|
+
6
|
|
739
|
+
]
|
|
740
|
+
},
|
|
741
|
+
20: {
|
|
742
|
+
number: 20,
|
|
743
|
+
name: "Proverbs",
|
|
744
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
745
|
+
chapters: 31,
|
|
746
|
+
verses: [
|
|
747
|
+
33,
|
|
748
|
+
22,
|
|
749
|
+
35,
|
|
750
|
+
27,
|
|
751
|
+
23,
|
|
752
|
+
35,
|
|
753
|
+
27,
|
|
754
|
+
36,
|
|
755
|
+
18,
|
|
756
|
+
32,
|
|
757
|
+
31,
|
|
758
|
+
28,
|
|
759
|
+
25,
|
|
760
|
+
35,
|
|
761
|
+
33,
|
|
762
|
+
33,
|
|
763
|
+
28,
|
|
764
|
+
24,
|
|
765
|
+
29,
|
|
766
|
+
30,
|
|
767
|
+
31,
|
|
768
|
+
29,
|
|
769
|
+
35,
|
|
770
|
+
34,
|
|
771
|
+
28,
|
|
772
|
+
28,
|
|
773
|
+
27,
|
|
774
|
+
28,
|
|
775
|
+
27,
|
|
776
|
+
33,
|
|
777
|
+
31
|
|
778
|
+
]
|
|
779
|
+
},
|
|
780
|
+
21: {
|
|
781
|
+
number: 21,
|
|
782
|
+
name: "Ecclesiastes",
|
|
783
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
784
|
+
chapters: 12,
|
|
785
|
+
verses: [18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14]
|
|
786
|
+
},
|
|
787
|
+
22: {
|
|
788
|
+
number: 22,
|
|
789
|
+
name: "Song of Songs",
|
|
790
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
791
|
+
chapters: 8,
|
|
792
|
+
verses: [17, 17, 11, 16, 16, 13, 13, 14]
|
|
793
|
+
},
|
|
794
|
+
23: {
|
|
795
|
+
number: 23,
|
|
796
|
+
name: "Isaiah",
|
|
797
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
798
|
+
chapters: 66,
|
|
799
|
+
verses: [
|
|
800
|
+
31,
|
|
801
|
+
22,
|
|
802
|
+
26,
|
|
803
|
+
6,
|
|
804
|
+
30,
|
|
805
|
+
13,
|
|
806
|
+
25,
|
|
807
|
+
22,
|
|
808
|
+
21,
|
|
809
|
+
34,
|
|
810
|
+
16,
|
|
811
|
+
6,
|
|
812
|
+
22,
|
|
813
|
+
32,
|
|
814
|
+
9,
|
|
815
|
+
14,
|
|
816
|
+
14,
|
|
817
|
+
7,
|
|
818
|
+
25,
|
|
819
|
+
6,
|
|
820
|
+
17,
|
|
821
|
+
25,
|
|
822
|
+
18,
|
|
823
|
+
23,
|
|
824
|
+
12,
|
|
825
|
+
21,
|
|
826
|
+
13,
|
|
827
|
+
29,
|
|
828
|
+
24,
|
|
829
|
+
33,
|
|
830
|
+
9,
|
|
831
|
+
20,
|
|
832
|
+
24,
|
|
833
|
+
17,
|
|
834
|
+
10,
|
|
835
|
+
22,
|
|
836
|
+
38,
|
|
837
|
+
22,
|
|
838
|
+
8,
|
|
839
|
+
31,
|
|
840
|
+
29,
|
|
841
|
+
25,
|
|
842
|
+
28,
|
|
843
|
+
28,
|
|
844
|
+
25,
|
|
845
|
+
13,
|
|
846
|
+
15,
|
|
847
|
+
22,
|
|
848
|
+
26,
|
|
849
|
+
11,
|
|
850
|
+
23,
|
|
851
|
+
15,
|
|
852
|
+
12,
|
|
853
|
+
17,
|
|
854
|
+
13,
|
|
855
|
+
12,
|
|
856
|
+
21,
|
|
857
|
+
14,
|
|
858
|
+
21,
|
|
859
|
+
22,
|
|
860
|
+
11,
|
|
861
|
+
12,
|
|
862
|
+
19,
|
|
863
|
+
12,
|
|
864
|
+
25,
|
|
865
|
+
24
|
|
866
|
+
]
|
|
867
|
+
},
|
|
868
|
+
24: {
|
|
869
|
+
number: 24,
|
|
870
|
+
name: "Jeremiah",
|
|
871
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
872
|
+
chapters: 52,
|
|
873
|
+
verses: [
|
|
874
|
+
19,
|
|
875
|
+
37,
|
|
876
|
+
25,
|
|
877
|
+
31,
|
|
878
|
+
31,
|
|
879
|
+
30,
|
|
880
|
+
34,
|
|
881
|
+
22,
|
|
882
|
+
26,
|
|
883
|
+
25,
|
|
884
|
+
23,
|
|
885
|
+
17,
|
|
886
|
+
27,
|
|
887
|
+
22,
|
|
888
|
+
21,
|
|
889
|
+
21,
|
|
890
|
+
27,
|
|
891
|
+
23,
|
|
892
|
+
15,
|
|
893
|
+
18,
|
|
894
|
+
14,
|
|
895
|
+
30,
|
|
896
|
+
40,
|
|
897
|
+
10,
|
|
898
|
+
38,
|
|
899
|
+
24,
|
|
900
|
+
22,
|
|
901
|
+
17,
|
|
902
|
+
32,
|
|
903
|
+
24,
|
|
904
|
+
40,
|
|
905
|
+
44,
|
|
906
|
+
26,
|
|
907
|
+
22,
|
|
908
|
+
19,
|
|
909
|
+
32,
|
|
910
|
+
21,
|
|
911
|
+
28,
|
|
912
|
+
18,
|
|
913
|
+
16,
|
|
914
|
+
18,
|
|
915
|
+
22,
|
|
916
|
+
13,
|
|
917
|
+
30,
|
|
918
|
+
5,
|
|
919
|
+
28,
|
|
920
|
+
7,
|
|
921
|
+
47,
|
|
922
|
+
39,
|
|
923
|
+
46,
|
|
924
|
+
64,
|
|
925
|
+
34
|
|
926
|
+
]
|
|
927
|
+
},
|
|
928
|
+
25: {
|
|
929
|
+
number: 25,
|
|
930
|
+
name: "Lamentations",
|
|
931
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
932
|
+
chapters: 5,
|
|
933
|
+
verses: [22, 22, 66, 22, 22]
|
|
934
|
+
},
|
|
935
|
+
26: {
|
|
936
|
+
number: 26,
|
|
937
|
+
name: "Ezekiel",
|
|
938
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
939
|
+
chapters: 48,
|
|
940
|
+
verses: [
|
|
941
|
+
28,
|
|
942
|
+
10,
|
|
943
|
+
27,
|
|
944
|
+
17,
|
|
945
|
+
17,
|
|
946
|
+
14,
|
|
947
|
+
27,
|
|
948
|
+
18,
|
|
949
|
+
11,
|
|
950
|
+
22,
|
|
951
|
+
25,
|
|
952
|
+
28,
|
|
953
|
+
23,
|
|
954
|
+
23,
|
|
955
|
+
8,
|
|
956
|
+
63,
|
|
957
|
+
24,
|
|
958
|
+
32,
|
|
959
|
+
14,
|
|
960
|
+
49,
|
|
961
|
+
32,
|
|
962
|
+
31,
|
|
963
|
+
49,
|
|
964
|
+
27,
|
|
965
|
+
17,
|
|
966
|
+
21,
|
|
967
|
+
36,
|
|
968
|
+
26,
|
|
969
|
+
21,
|
|
970
|
+
26,
|
|
971
|
+
18,
|
|
972
|
+
32,
|
|
973
|
+
33,
|
|
974
|
+
31,
|
|
975
|
+
15,
|
|
976
|
+
38,
|
|
977
|
+
28,
|
|
978
|
+
23,
|
|
979
|
+
29,
|
|
980
|
+
49,
|
|
981
|
+
26,
|
|
982
|
+
20,
|
|
983
|
+
27,
|
|
984
|
+
31,
|
|
985
|
+
25,
|
|
986
|
+
24,
|
|
987
|
+
23,
|
|
988
|
+
35
|
|
989
|
+
]
|
|
990
|
+
},
|
|
991
|
+
27: {
|
|
992
|
+
number: 27,
|
|
993
|
+
name: "Daniel",
|
|
994
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
995
|
+
chapters: 12,
|
|
996
|
+
verses: [21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13]
|
|
997
|
+
},
|
|
998
|
+
28: {
|
|
999
|
+
number: 28,
|
|
1000
|
+
name: "Hosea",
|
|
1001
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1002
|
+
chapters: 14,
|
|
1003
|
+
verses: [11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9]
|
|
1004
|
+
},
|
|
1005
|
+
29: {
|
|
1006
|
+
number: 29,
|
|
1007
|
+
name: "Joel",
|
|
1008
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1009
|
+
chapters: 3,
|
|
1010
|
+
verses: [20, 32, 21]
|
|
1011
|
+
},
|
|
1012
|
+
30: {
|
|
1013
|
+
number: 30,
|
|
1014
|
+
name: "Amos",
|
|
1015
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1016
|
+
chapters: 9,
|
|
1017
|
+
verses: [15, 16, 15, 13, 27, 14, 17, 14, 15]
|
|
1018
|
+
},
|
|
1019
|
+
31: {
|
|
1020
|
+
number: 31,
|
|
1021
|
+
name: "Obadiah",
|
|
1022
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1023
|
+
chapters: 1,
|
|
1024
|
+
verses: [21]
|
|
1025
|
+
},
|
|
1026
|
+
32: {
|
|
1027
|
+
number: 32,
|
|
1028
|
+
name: "Jonah",
|
|
1029
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1030
|
+
chapters: 4,
|
|
1031
|
+
verses: [17, 10, 10, 11]
|
|
1032
|
+
},
|
|
1033
|
+
33: {
|
|
1034
|
+
number: 33,
|
|
1035
|
+
name: "Micah",
|
|
1036
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1037
|
+
chapters: 7,
|
|
1038
|
+
verses: [16, 13, 12, 13, 15, 16, 20]
|
|
1039
|
+
},
|
|
1040
|
+
34: {
|
|
1041
|
+
number: 34,
|
|
1042
|
+
name: "Nahum",
|
|
1043
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1044
|
+
chapters: 3,
|
|
1045
|
+
verses: [15, 13, 19]
|
|
1046
|
+
},
|
|
1047
|
+
35: {
|
|
1048
|
+
number: 35,
|
|
1049
|
+
name: "Habakkuk",
|
|
1050
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1051
|
+
chapters: 3,
|
|
1052
|
+
verses: [17, 20, 19]
|
|
1053
|
+
},
|
|
1054
|
+
36: {
|
|
1055
|
+
number: 36,
|
|
1056
|
+
name: "Zephaniah",
|
|
1057
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1058
|
+
chapters: 3,
|
|
1059
|
+
verses: [18, 15, 20]
|
|
1060
|
+
},
|
|
1061
|
+
37: {
|
|
1062
|
+
number: 37,
|
|
1063
|
+
name: "Haggai",
|
|
1064
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1065
|
+
chapters: 2,
|
|
1066
|
+
verses: [15, 23]
|
|
1067
|
+
},
|
|
1068
|
+
38: {
|
|
1069
|
+
number: 38,
|
|
1070
|
+
name: "Zechariah",
|
|
1071
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1072
|
+
chapters: 14,
|
|
1073
|
+
verses: [21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21]
|
|
1074
|
+
},
|
|
1075
|
+
39: {
|
|
1076
|
+
number: 39,
|
|
1077
|
+
name: "Malachi",
|
|
1078
|
+
testament: "OT" /* OLD_TESTAMENT */,
|
|
1079
|
+
chapters: 4,
|
|
1080
|
+
verses: [14, 17, 18, 6]
|
|
1081
|
+
},
|
|
1082
|
+
40: {
|
|
1083
|
+
number: 40,
|
|
1084
|
+
name: "Matthew",
|
|
1085
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1086
|
+
chapters: 28,
|
|
1087
|
+
verses: [
|
|
1088
|
+
25,
|
|
1089
|
+
23,
|
|
1090
|
+
17,
|
|
1091
|
+
25,
|
|
1092
|
+
48,
|
|
1093
|
+
34,
|
|
1094
|
+
29,
|
|
1095
|
+
34,
|
|
1096
|
+
38,
|
|
1097
|
+
42,
|
|
1098
|
+
30,
|
|
1099
|
+
50,
|
|
1100
|
+
58,
|
|
1101
|
+
36,
|
|
1102
|
+
39,
|
|
1103
|
+
28,
|
|
1104
|
+
27,
|
|
1105
|
+
35,
|
|
1106
|
+
30,
|
|
1107
|
+
34,
|
|
1108
|
+
46,
|
|
1109
|
+
46,
|
|
1110
|
+
39,
|
|
1111
|
+
51,
|
|
1112
|
+
46,
|
|
1113
|
+
75,
|
|
1114
|
+
66,
|
|
1115
|
+
20
|
|
1116
|
+
]
|
|
1117
|
+
},
|
|
1118
|
+
41: {
|
|
1119
|
+
number: 41,
|
|
1120
|
+
name: "Mark",
|
|
1121
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1122
|
+
chapters: 16,
|
|
1123
|
+
verses: [45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20]
|
|
1124
|
+
},
|
|
1125
|
+
42: {
|
|
1126
|
+
number: 42,
|
|
1127
|
+
name: "Luke",
|
|
1128
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1129
|
+
chapters: 24,
|
|
1130
|
+
verses: [
|
|
1131
|
+
80,
|
|
1132
|
+
52,
|
|
1133
|
+
38,
|
|
1134
|
+
44,
|
|
1135
|
+
39,
|
|
1136
|
+
49,
|
|
1137
|
+
50,
|
|
1138
|
+
56,
|
|
1139
|
+
62,
|
|
1140
|
+
42,
|
|
1141
|
+
54,
|
|
1142
|
+
59,
|
|
1143
|
+
35,
|
|
1144
|
+
35,
|
|
1145
|
+
32,
|
|
1146
|
+
31,
|
|
1147
|
+
37,
|
|
1148
|
+
43,
|
|
1149
|
+
48,
|
|
1150
|
+
47,
|
|
1151
|
+
38,
|
|
1152
|
+
71,
|
|
1153
|
+
56,
|
|
1154
|
+
53
|
|
1155
|
+
]
|
|
1156
|
+
},
|
|
1157
|
+
43: {
|
|
1158
|
+
number: 43,
|
|
1159
|
+
name: "John",
|
|
1160
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1161
|
+
chapters: 21,
|
|
1162
|
+
verses: [51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25]
|
|
1163
|
+
},
|
|
1164
|
+
44: {
|
|
1165
|
+
number: 44,
|
|
1166
|
+
name: "Acts",
|
|
1167
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1168
|
+
chapters: 28,
|
|
1169
|
+
verses: [
|
|
1170
|
+
26,
|
|
1171
|
+
47,
|
|
1172
|
+
26,
|
|
1173
|
+
37,
|
|
1174
|
+
42,
|
|
1175
|
+
15,
|
|
1176
|
+
60,
|
|
1177
|
+
40,
|
|
1178
|
+
43,
|
|
1179
|
+
48,
|
|
1180
|
+
30,
|
|
1181
|
+
25,
|
|
1182
|
+
52,
|
|
1183
|
+
28,
|
|
1184
|
+
41,
|
|
1185
|
+
40,
|
|
1186
|
+
34,
|
|
1187
|
+
28,
|
|
1188
|
+
41,
|
|
1189
|
+
38,
|
|
1190
|
+
40,
|
|
1191
|
+
30,
|
|
1192
|
+
35,
|
|
1193
|
+
27,
|
|
1194
|
+
27,
|
|
1195
|
+
32,
|
|
1196
|
+
44,
|
|
1197
|
+
31
|
|
1198
|
+
]
|
|
1199
|
+
},
|
|
1200
|
+
45: {
|
|
1201
|
+
number: 45,
|
|
1202
|
+
name: "Romans",
|
|
1203
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1204
|
+
chapters: 16,
|
|
1205
|
+
verses: [32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27]
|
|
1206
|
+
},
|
|
1207
|
+
46: {
|
|
1208
|
+
number: 46,
|
|
1209
|
+
name: "1 Corinthians",
|
|
1210
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1211
|
+
chapters: 16,
|
|
1212
|
+
verses: [31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24]
|
|
1213
|
+
},
|
|
1214
|
+
47: {
|
|
1215
|
+
number: 47,
|
|
1216
|
+
name: "2 Corinthians",
|
|
1217
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1218
|
+
chapters: 13,
|
|
1219
|
+
verses: [24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14]
|
|
1220
|
+
},
|
|
1221
|
+
48: {
|
|
1222
|
+
number: 48,
|
|
1223
|
+
name: "Galatians",
|
|
1224
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1225
|
+
chapters: 6,
|
|
1226
|
+
verses: [24, 21, 29, 31, 26, 18]
|
|
1227
|
+
},
|
|
1228
|
+
49: {
|
|
1229
|
+
number: 49,
|
|
1230
|
+
name: "Ephesians",
|
|
1231
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1232
|
+
chapters: 6,
|
|
1233
|
+
verses: [23, 22, 21, 32, 33, 24]
|
|
1234
|
+
},
|
|
1235
|
+
50: {
|
|
1236
|
+
number: 50,
|
|
1237
|
+
name: "Philippians",
|
|
1238
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1239
|
+
chapters: 4,
|
|
1240
|
+
verses: [30, 30, 21, 23]
|
|
1241
|
+
},
|
|
1242
|
+
51: {
|
|
1243
|
+
number: 51,
|
|
1244
|
+
name: "Colossians",
|
|
1245
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1246
|
+
chapters: 4,
|
|
1247
|
+
verses: [29, 23, 25, 18]
|
|
1248
|
+
},
|
|
1249
|
+
52: {
|
|
1250
|
+
number: 52,
|
|
1251
|
+
name: "1 Thessalonians",
|
|
1252
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1253
|
+
chapters: 5,
|
|
1254
|
+
verses: [10, 20, 13, 18, 28]
|
|
1255
|
+
},
|
|
1256
|
+
53: {
|
|
1257
|
+
number: 53,
|
|
1258
|
+
name: "2 Thessalonians",
|
|
1259
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1260
|
+
chapters: 3,
|
|
1261
|
+
verses: [12, 17, 18]
|
|
1262
|
+
},
|
|
1263
|
+
54: {
|
|
1264
|
+
number: 54,
|
|
1265
|
+
name: "1 Timothy",
|
|
1266
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1267
|
+
chapters: 6,
|
|
1268
|
+
verses: [20, 15, 16, 16, 25, 21]
|
|
1269
|
+
},
|
|
1270
|
+
55: {
|
|
1271
|
+
number: 55,
|
|
1272
|
+
name: "2 Timothy",
|
|
1273
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1274
|
+
chapters: 4,
|
|
1275
|
+
verses: [18, 26, 17, 22]
|
|
1276
|
+
},
|
|
1277
|
+
56: {
|
|
1278
|
+
number: 56,
|
|
1279
|
+
name: "Titus",
|
|
1280
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1281
|
+
chapters: 3,
|
|
1282
|
+
verses: [16, 15, 15]
|
|
1283
|
+
},
|
|
1284
|
+
57: {
|
|
1285
|
+
number: 57,
|
|
1286
|
+
name: "Philemon",
|
|
1287
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1288
|
+
chapters: 1,
|
|
1289
|
+
verses: [25]
|
|
1290
|
+
},
|
|
1291
|
+
58: {
|
|
1292
|
+
number: 58,
|
|
1293
|
+
name: "Hebrews",
|
|
1294
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1295
|
+
chapters: 13,
|
|
1296
|
+
verses: [14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25]
|
|
1297
|
+
},
|
|
1298
|
+
59: {
|
|
1299
|
+
number: 59,
|
|
1300
|
+
name: "James",
|
|
1301
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1302
|
+
chapters: 5,
|
|
1303
|
+
verses: [27, 26, 18, 17, 20]
|
|
1304
|
+
},
|
|
1305
|
+
60: {
|
|
1306
|
+
number: 60,
|
|
1307
|
+
name: "1 Peter",
|
|
1308
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1309
|
+
chapters: 5,
|
|
1310
|
+
verses: [25, 25, 22, 19, 14]
|
|
1311
|
+
},
|
|
1312
|
+
61: {
|
|
1313
|
+
number: 61,
|
|
1314
|
+
name: "2 Peter",
|
|
1315
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1316
|
+
chapters: 3,
|
|
1317
|
+
verses: [21, 22, 18]
|
|
1318
|
+
},
|
|
1319
|
+
62: {
|
|
1320
|
+
number: 62,
|
|
1321
|
+
name: "1 John",
|
|
1322
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1323
|
+
chapters: 5,
|
|
1324
|
+
verses: [10, 29, 24, 21, 21]
|
|
1325
|
+
},
|
|
1326
|
+
63: {
|
|
1327
|
+
number: 63,
|
|
1328
|
+
name: "2 John",
|
|
1329
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1330
|
+
chapters: 1,
|
|
1331
|
+
verses: [13]
|
|
1332
|
+
},
|
|
1333
|
+
64: {
|
|
1334
|
+
number: 64,
|
|
1335
|
+
name: "3 John",
|
|
1336
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1337
|
+
chapters: 1,
|
|
1338
|
+
verses: [14]
|
|
1339
|
+
},
|
|
1340
|
+
65: {
|
|
1341
|
+
number: 65,
|
|
1342
|
+
name: "Jude",
|
|
1343
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1344
|
+
chapters: 1,
|
|
1345
|
+
verses: [25]
|
|
1346
|
+
},
|
|
1347
|
+
66: {
|
|
1348
|
+
number: 66,
|
|
1349
|
+
name: "Revelation",
|
|
1350
|
+
testament: "NT" /* NEW_TESTAMENT */,
|
|
1351
|
+
chapters: 22,
|
|
1352
|
+
verses: [20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21]
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
var BOOK_NAMES = Object.fromEntries(
|
|
1356
|
+
Object.values(BIBLE_STRUCTURE).map((book) => [book.number, book.name])
|
|
1357
|
+
);
|
|
1358
|
+
var BOOK_NUMBERS = Object.fromEntries(
|
|
1359
|
+
Object.values(BIBLE_STRUCTURE).map((book) => [book.name.toLowerCase(), book.number])
|
|
1360
|
+
);
|
|
1361
|
+
|
|
1362
|
+
// src/cache/interface.ts
|
|
1363
|
+
var CacheTTL = {
|
|
1364
|
+
/** 1 month - for immutable Bible content (verses, passages, chapters) */
|
|
1365
|
+
BIBLE_CONTENT: 2592e3,
|
|
1366
|
+
/** 1 week - for search results that may change with API updates */
|
|
1367
|
+
SEARCH_RESULTS: 604800,
|
|
1368
|
+
/** 1 year - for static resources that never change */
|
|
1369
|
+
STATIC: 31536e3
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
// src/exceptions.ts
|
|
1373
|
+
var LSBibleError = class extends Error {
|
|
1374
|
+
constructor(message) {
|
|
1375
|
+
super(message);
|
|
1376
|
+
this.name = "LSBibleError";
|
|
1377
|
+
if (Error.captureStackTrace) {
|
|
1378
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
var InvalidReferenceError = class extends LSBibleError {
|
|
1383
|
+
constructor(message) {
|
|
1384
|
+
super(message);
|
|
1385
|
+
this.name = "InvalidReferenceError";
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
var APIError = class extends LSBibleError {
|
|
1389
|
+
constructor(message) {
|
|
1390
|
+
super(message);
|
|
1391
|
+
this.name = "APIError";
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
var BuildIDError = class extends LSBibleError {
|
|
1395
|
+
constructor(message) {
|
|
1396
|
+
super(message);
|
|
1397
|
+
this.name = "BuildIDError";
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
var BookName = /* @__PURE__ */ ((BookName2) => {
|
|
1401
|
+
BookName2["GENESIS"] = "Genesis";
|
|
1402
|
+
BookName2["EXODUS"] = "Exodus";
|
|
1403
|
+
BookName2["LEVITICUS"] = "Leviticus";
|
|
1404
|
+
BookName2["NUMBERS"] = "Numbers";
|
|
1405
|
+
BookName2["DEUTERONOMY"] = "Deuteronomy";
|
|
1406
|
+
BookName2["JOSHUA"] = "Joshua";
|
|
1407
|
+
BookName2["JUDGES"] = "Judges";
|
|
1408
|
+
BookName2["RUTH"] = "Ruth";
|
|
1409
|
+
BookName2["SAMUEL_1"] = "1 Samuel";
|
|
1410
|
+
BookName2["SAMUEL_2"] = "2 Samuel";
|
|
1411
|
+
BookName2["KINGS_1"] = "1 Kings";
|
|
1412
|
+
BookName2["KINGS_2"] = "2 Kings";
|
|
1413
|
+
BookName2["CHRONICLES_1"] = "1 Chronicles";
|
|
1414
|
+
BookName2["CHRONICLES_2"] = "2 Chronicles";
|
|
1415
|
+
BookName2["EZRA"] = "Ezra";
|
|
1416
|
+
BookName2["NEHEMIAH"] = "Nehemiah";
|
|
1417
|
+
BookName2["ESTHER"] = "Esther";
|
|
1418
|
+
BookName2["JOB"] = "Job";
|
|
1419
|
+
BookName2["PSALMS"] = "Psalms";
|
|
1420
|
+
BookName2["PROVERBS"] = "Proverbs";
|
|
1421
|
+
BookName2["ECCLESIASTES"] = "Ecclesiastes";
|
|
1422
|
+
BookName2["SONG_OF_SONGS"] = "Song of Songs";
|
|
1423
|
+
BookName2["ISAIAH"] = "Isaiah";
|
|
1424
|
+
BookName2["JEREMIAH"] = "Jeremiah";
|
|
1425
|
+
BookName2["LAMENTATIONS"] = "Lamentations";
|
|
1426
|
+
BookName2["EZEKIEL"] = "Ezekiel";
|
|
1427
|
+
BookName2["DANIEL"] = "Daniel";
|
|
1428
|
+
BookName2["HOSEA"] = "Hosea";
|
|
1429
|
+
BookName2["JOEL"] = "Joel";
|
|
1430
|
+
BookName2["AMOS"] = "Amos";
|
|
1431
|
+
BookName2["OBADIAH"] = "Obadiah";
|
|
1432
|
+
BookName2["JONAH"] = "Jonah";
|
|
1433
|
+
BookName2["MICAH"] = "Micah";
|
|
1434
|
+
BookName2["NAHUM"] = "Nahum";
|
|
1435
|
+
BookName2["HABAKKUK"] = "Habakkuk";
|
|
1436
|
+
BookName2["ZEPHANIAH"] = "Zephaniah";
|
|
1437
|
+
BookName2["HAGGAI"] = "Haggai";
|
|
1438
|
+
BookName2["ZECHARIAH"] = "Zechariah";
|
|
1439
|
+
BookName2["MALACHI"] = "Malachi";
|
|
1440
|
+
BookName2["MATTHEW"] = "Matthew";
|
|
1441
|
+
BookName2["MARK"] = "Mark";
|
|
1442
|
+
BookName2["LUKE"] = "Luke";
|
|
1443
|
+
BookName2["JOHN"] = "John";
|
|
1444
|
+
BookName2["ACTS"] = "Acts";
|
|
1445
|
+
BookName2["ROMANS"] = "Romans";
|
|
1446
|
+
BookName2["CORINTHIANS_1"] = "1 Corinthians";
|
|
1447
|
+
BookName2["CORINTHIANS_2"] = "2 Corinthians";
|
|
1448
|
+
BookName2["GALATIANS"] = "Galatians";
|
|
1449
|
+
BookName2["EPHESIANS"] = "Ephesians";
|
|
1450
|
+
BookName2["PHILIPPIANS"] = "Philippians";
|
|
1451
|
+
BookName2["COLOSSIANS"] = "Colossians";
|
|
1452
|
+
BookName2["THESSALONIANS_1"] = "1 Thessalonians";
|
|
1453
|
+
BookName2["THESSALONIANS_2"] = "2 Thessalonians";
|
|
1454
|
+
BookName2["TIMOTHY_1"] = "1 Timothy";
|
|
1455
|
+
BookName2["TIMOTHY_2"] = "2 Timothy";
|
|
1456
|
+
BookName2["TITUS"] = "Titus";
|
|
1457
|
+
BookName2["PHILEMON"] = "Philemon";
|
|
1458
|
+
BookName2["HEBREWS"] = "Hebrews";
|
|
1459
|
+
BookName2["JAMES"] = "James";
|
|
1460
|
+
BookName2["PETER_1"] = "1 Peter";
|
|
1461
|
+
BookName2["PETER_2"] = "2 Peter";
|
|
1462
|
+
BookName2["JOHN_1"] = "1 John";
|
|
1463
|
+
BookName2["JOHN_2"] = "2 John";
|
|
1464
|
+
BookName2["JOHN_3"] = "3 John";
|
|
1465
|
+
BookName2["JUDE"] = "Jude";
|
|
1466
|
+
BookName2["REVELATION"] = "Revelation";
|
|
1467
|
+
return BookName2;
|
|
1468
|
+
})(BookName || {});
|
|
1469
|
+
var VerseReferenceSchema = zod.z.object({
|
|
1470
|
+
bookNumber: zod.z.number().int().min(1).max(66),
|
|
1471
|
+
chapter: zod.z.number().int().min(1),
|
|
1472
|
+
verse: zod.z.number().int().min(1)
|
|
1473
|
+
}).refine(
|
|
1474
|
+
(data) => {
|
|
1475
|
+
const bookInfo = BIBLE_STRUCTURE[data.bookNumber];
|
|
1476
|
+
if (!bookInfo) return false;
|
|
1477
|
+
return data.chapter <= bookInfo.chapters;
|
|
1478
|
+
},
|
|
1479
|
+
(data) => {
|
|
1480
|
+
const bookInfo = BIBLE_STRUCTURE[data.bookNumber];
|
|
1481
|
+
const bookName = BOOK_NAMES[data.bookNumber];
|
|
1482
|
+
return {
|
|
1483
|
+
message: `${bookName} only has ${bookInfo?.chapters} chapters, but chapter ${data.chapter} was requested`,
|
|
1484
|
+
path: ["chapter"]
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
).refine(
|
|
1488
|
+
(data) => {
|
|
1489
|
+
const bookInfo = BIBLE_STRUCTURE[data.bookNumber];
|
|
1490
|
+
if (!bookInfo) return false;
|
|
1491
|
+
const maxVerse = bookInfo.verses[data.chapter - 1];
|
|
1492
|
+
if (!maxVerse) return false;
|
|
1493
|
+
return data.verse <= maxVerse;
|
|
1494
|
+
},
|
|
1495
|
+
(data) => {
|
|
1496
|
+
const bookInfo = BIBLE_STRUCTURE[data.bookNumber];
|
|
1497
|
+
const bookName = BOOK_NAMES[data.bookNumber];
|
|
1498
|
+
const maxVerse = bookInfo?.verses[data.chapter - 1];
|
|
1499
|
+
return {
|
|
1500
|
+
message: `${bookName} ${data.chapter} only has ${maxVerse} verses, but verse ${data.verse} was requested`,
|
|
1501
|
+
path: ["verse"]
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
);
|
|
1505
|
+
function createVerseReference(data) {
|
|
1506
|
+
const validated = VerseReferenceSchema.parse(data);
|
|
1507
|
+
return {
|
|
1508
|
+
...validated,
|
|
1509
|
+
get bookName() {
|
|
1510
|
+
return BookName[BOOK_NAMES[this.bookNumber]] || BOOK_NAMES[this.bookNumber];
|
|
1511
|
+
},
|
|
1512
|
+
toString() {
|
|
1513
|
+
return `${BOOK_NAMES[this.bookNumber]} ${this.chapter}:${this.verse}`;
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
var TextSegmentSchema = zod.z.object({
|
|
1518
|
+
text: zod.z.string(),
|
|
1519
|
+
isRedLetter: zod.z.boolean().default(false),
|
|
1520
|
+
// Words of Jesus in red
|
|
1521
|
+
isItalic: zod.z.boolean().default(false),
|
|
1522
|
+
// Italicized text (clarifications)
|
|
1523
|
+
isBold: zod.z.boolean().default(false),
|
|
1524
|
+
// Bold text
|
|
1525
|
+
isSmallCaps: zod.z.boolean().default(false)
|
|
1526
|
+
// LORD (Yahweh) in small caps
|
|
1527
|
+
});
|
|
1528
|
+
var VerseContentSchema = zod.z.object({
|
|
1529
|
+
reference: VerseReferenceSchema,
|
|
1530
|
+
verseNumber: zod.z.number().int().min(1),
|
|
1531
|
+
segments: zod.z.array(TextSegmentSchema),
|
|
1532
|
+
hasSubheading: zod.z.boolean().default(false),
|
|
1533
|
+
subheadingText: zod.z.string().nullable().default(null),
|
|
1534
|
+
isPoetry: zod.z.boolean().default(false),
|
|
1535
|
+
isProse: zod.z.boolean().default(false),
|
|
1536
|
+
chapterStart: zod.z.boolean().default(false)
|
|
1537
|
+
// First verse of chapter
|
|
1538
|
+
});
|
|
1539
|
+
function createVerseContent(data) {
|
|
1540
|
+
const validated = VerseContentSchema.parse(data);
|
|
1541
|
+
const reference = createVerseReference(validated.reference);
|
|
1542
|
+
return {
|
|
1543
|
+
...validated,
|
|
1544
|
+
reference,
|
|
1545
|
+
get plainText() {
|
|
1546
|
+
return this.segments.map((seg) => seg.text).join(" ");
|
|
1547
|
+
},
|
|
1548
|
+
get formattedText() {
|
|
1549
|
+
const parts = this.segments.map((seg) => {
|
|
1550
|
+
let text = seg.text;
|
|
1551
|
+
if (seg.isItalic) text = `[${text}]`;
|
|
1552
|
+
if (seg.isRedLetter) text = `"${text}"`;
|
|
1553
|
+
return text;
|
|
1554
|
+
});
|
|
1555
|
+
return parts.join(" ");
|
|
1556
|
+
}
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
var PassageSchema = zod.z.object({
|
|
1560
|
+
fromRef: VerseReferenceSchema,
|
|
1561
|
+
toRef: VerseReferenceSchema,
|
|
1562
|
+
title: zod.z.string(),
|
|
1563
|
+
verses: zod.z.array(VerseContentSchema)
|
|
1564
|
+
});
|
|
1565
|
+
function createPassage(data) {
|
|
1566
|
+
const validated = PassageSchema.parse(data);
|
|
1567
|
+
const fromRef = createVerseReference(validated.fromRef);
|
|
1568
|
+
const toRef = createVerseReference(validated.toRef);
|
|
1569
|
+
const verses = validated.verses.map((v) => createVerseContent(v));
|
|
1570
|
+
return {
|
|
1571
|
+
...validated,
|
|
1572
|
+
fromRef,
|
|
1573
|
+
toRef,
|
|
1574
|
+
verses,
|
|
1575
|
+
get isSingleVerse() {
|
|
1576
|
+
return this.fromRef.bookNumber === this.toRef.bookNumber && this.fromRef.chapter === this.toRef.chapter && this.fromRef.verse === this.toRef.verse;
|
|
1577
|
+
},
|
|
1578
|
+
get verseCount() {
|
|
1579
|
+
return this.verses.length;
|
|
1580
|
+
}
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
var SearchResponseSchema = zod.z.object({
|
|
1584
|
+
query: zod.z.string(),
|
|
1585
|
+
matchCount: zod.z.number().int().min(0),
|
|
1586
|
+
passages: zod.z.array(PassageSchema),
|
|
1587
|
+
durationMs: zod.z.number().int().min(0),
|
|
1588
|
+
timestamp: zod.z.number().int(),
|
|
1589
|
+
// Optional metadata for text searches
|
|
1590
|
+
totalCount: zod.z.number().int().min(0).optional(),
|
|
1591
|
+
filteredCount: zod.z.number().int().min(0).optional(),
|
|
1592
|
+
countsByBook: zod.z.record(zod.z.string(), zod.z.number()).optional(),
|
|
1593
|
+
countsBySection: zod.z.record(zod.z.string(), zod.z.number()).optional()
|
|
1594
|
+
});
|
|
1595
|
+
function createSearchResponse(data) {
|
|
1596
|
+
const validated = SearchResponseSchema.parse(data);
|
|
1597
|
+
const passages = validated.passages.map((p) => createPassage(p));
|
|
1598
|
+
return {
|
|
1599
|
+
...validated,
|
|
1600
|
+
passages,
|
|
1601
|
+
get passageCount() {
|
|
1602
|
+
return this.passages.length;
|
|
1603
|
+
},
|
|
1604
|
+
get totalVerses() {
|
|
1605
|
+
return this.passages.reduce((sum, p) => sum + p.verseCount, 0);
|
|
1606
|
+
},
|
|
1607
|
+
get hasSearchMetadata() {
|
|
1608
|
+
return this.totalCount !== void 0;
|
|
1609
|
+
}
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
function parseSearchResultHtml(html) {
|
|
1613
|
+
const { document } = linkedom.parseHTML(`<!DOCTYPE html><html><body>${html}</body></html>`);
|
|
1614
|
+
return document.body.textContent?.trim() ?? "";
|
|
1615
|
+
}
|
|
1616
|
+
function parsePassageHtml(html) {
|
|
1617
|
+
const { document } = linkedom.parseHTML(`<!DOCTYPE html><html><body>${html}</body></html>`);
|
|
1618
|
+
const verses = [];
|
|
1619
|
+
const verseSpans = document.querySelectorAll("span.verse");
|
|
1620
|
+
for (const verseSpan of verseSpans) {
|
|
1621
|
+
const verse = parseVerse(verseSpan);
|
|
1622
|
+
verses.push(verse);
|
|
1623
|
+
}
|
|
1624
|
+
return verses;
|
|
1625
|
+
}
|
|
1626
|
+
function parseVerse(verseSpan, _document) {
|
|
1627
|
+
const dataKey = verseSpan.getAttribute("data-key");
|
|
1628
|
+
if (!dataKey) {
|
|
1629
|
+
throw new Error("Verse span missing data-key attribute");
|
|
1630
|
+
}
|
|
1631
|
+
const reference = parseVerseReference(dataKey);
|
|
1632
|
+
const verseNumElem = verseSpan.querySelector("small[data-verse]");
|
|
1633
|
+
let verseNumber;
|
|
1634
|
+
if (verseNumElem) {
|
|
1635
|
+
verseNumber = Number.parseInt(verseNumElem.getAttribute("data-verse") ?? "0", 10);
|
|
1636
|
+
} else {
|
|
1637
|
+
verseNumber = reference.verse;
|
|
1638
|
+
}
|
|
1639
|
+
let hasSubheading = false;
|
|
1640
|
+
let subheadingText = null;
|
|
1641
|
+
const prevSibling = verseSpan.previousElementSibling;
|
|
1642
|
+
if (prevSibling?.classList.contains("subhead")) {
|
|
1643
|
+
hasSubheading = true;
|
|
1644
|
+
subheadingText = prevSibling.textContent?.trim() ?? null;
|
|
1645
|
+
}
|
|
1646
|
+
let currentNode = verseSpan;
|
|
1647
|
+
let isPoetry = false;
|
|
1648
|
+
while (currentNode) {
|
|
1649
|
+
if (currentNode.classList?.contains("poetry")) {
|
|
1650
|
+
isPoetry = true;
|
|
1651
|
+
break;
|
|
1652
|
+
}
|
|
1653
|
+
currentNode = currentNode.parentElement;
|
|
1654
|
+
}
|
|
1655
|
+
const isProse = verseSpan.querySelector(".prose") !== null;
|
|
1656
|
+
const chapterStart = verseSpan.querySelector(".chapter-number") !== null;
|
|
1657
|
+
const segments = extractSegments(verseSpan);
|
|
1658
|
+
return createVerseContent({
|
|
1659
|
+
reference,
|
|
1660
|
+
verseNumber,
|
|
1661
|
+
segments,
|
|
1662
|
+
hasSubheading,
|
|
1663
|
+
subheadingText,
|
|
1664
|
+
isPoetry,
|
|
1665
|
+
isProse,
|
|
1666
|
+
chapterStart
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
function parseVerseReference(dataKey) {
|
|
1670
|
+
const parts = dataKey.split("-");
|
|
1671
|
+
if (parts.length !== 3) {
|
|
1672
|
+
throw new Error(`Invalid data-key format: ${dataKey}`);
|
|
1673
|
+
}
|
|
1674
|
+
const bookNumber = Number.parseInt(parts[0] ?? "0", 10);
|
|
1675
|
+
const chapter = Number.parseInt(parts[1] ?? "0", 10);
|
|
1676
|
+
const verse = Number.parseInt(parts[2] ?? "0", 10);
|
|
1677
|
+
return createVerseReference({ bookNumber, chapter, verse });
|
|
1678
|
+
}
|
|
1679
|
+
function extractSegments(element) {
|
|
1680
|
+
const segments = [];
|
|
1681
|
+
for (const smallElem of element.querySelectorAll("small[data-verse]")) {
|
|
1682
|
+
smallElem.remove();
|
|
1683
|
+
}
|
|
1684
|
+
for (const chapterElem of element.querySelectorAll(".chapter-number")) {
|
|
1685
|
+
chapterElem.remove();
|
|
1686
|
+
}
|
|
1687
|
+
for (const subheadElem of element.querySelectorAll(".subhead")) {
|
|
1688
|
+
subheadElem.remove();
|
|
1689
|
+
}
|
|
1690
|
+
extractTextNodes(element, segments);
|
|
1691
|
+
return segments;
|
|
1692
|
+
}
|
|
1693
|
+
function extractTextNodes(node, segments) {
|
|
1694
|
+
for (const child of node.childNodes) {
|
|
1695
|
+
if (child.nodeType === 3) {
|
|
1696
|
+
const text = child.textContent?.trim();
|
|
1697
|
+
if (!text) continue;
|
|
1698
|
+
let isRedLetter = false;
|
|
1699
|
+
let isItalic = false;
|
|
1700
|
+
let isBold = false;
|
|
1701
|
+
let isSmallCaps = false;
|
|
1702
|
+
let parent = child.parentElement;
|
|
1703
|
+
while (parent) {
|
|
1704
|
+
if (parent.classList.contains("red-letter")) {
|
|
1705
|
+
isRedLetter = true;
|
|
1706
|
+
}
|
|
1707
|
+
if (parent.tagName === "I" || parent.classList.contains("italic")) {
|
|
1708
|
+
isItalic = true;
|
|
1709
|
+
}
|
|
1710
|
+
if (parent.tagName === "B" || parent.classList.contains("bold")) {
|
|
1711
|
+
isBold = true;
|
|
1712
|
+
}
|
|
1713
|
+
if (parent.classList.contains("small-caps")) {
|
|
1714
|
+
isSmallCaps = true;
|
|
1715
|
+
}
|
|
1716
|
+
parent = parent.parentElement;
|
|
1717
|
+
}
|
|
1718
|
+
segments.push({
|
|
1719
|
+
text,
|
|
1720
|
+
isRedLetter,
|
|
1721
|
+
isItalic,
|
|
1722
|
+
isBold,
|
|
1723
|
+
isSmallCaps
|
|
1724
|
+
});
|
|
1725
|
+
} else if (child.nodeType === 1) {
|
|
1726
|
+
extractTextNodes(child, segments);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
// src/validators.ts
|
|
1732
|
+
function normalizeBookName(book) {
|
|
1733
|
+
if (typeof book === "string" && Object.values(BookName).includes(book)) {
|
|
1734
|
+
return book;
|
|
1735
|
+
}
|
|
1736
|
+
if (typeof book !== "string") {
|
|
1737
|
+
throw new InvalidReferenceError(`Invalid book type: ${typeof book}`);
|
|
1738
|
+
}
|
|
1739
|
+
const bookStr = book.trim();
|
|
1740
|
+
const bookLower = bookStr.toLowerCase();
|
|
1741
|
+
if (bookLower in BOOK_NUMBERS) {
|
|
1742
|
+
const bookNum = BOOK_NUMBERS[bookLower];
|
|
1743
|
+
if (bookNum) {
|
|
1744
|
+
return BIBLE_STRUCTURE[bookNum]?.name ?? book;
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
const normalized = bookLower.split(/\s+/).join(" ");
|
|
1748
|
+
if (normalized in BOOK_NUMBERS) {
|
|
1749
|
+
const bookNum = BOOK_NUMBERS[normalized];
|
|
1750
|
+
if (bookNum) {
|
|
1751
|
+
return BIBLE_STRUCTURE[bookNum]?.name ?? book;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
if (/^\d/.test(bookLower)) {
|
|
1755
|
+
const spaced = bookLower.replace(/^(\d+)([a-z])/, "$1 $2");
|
|
1756
|
+
if (spaced in BOOK_NUMBERS) {
|
|
1757
|
+
const bookNum = BOOK_NUMBERS[spaced];
|
|
1758
|
+
if (bookNum) {
|
|
1759
|
+
return BIBLE_STRUCTURE[bookNum]?.name ?? book;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
throw new InvalidReferenceError(`Unknown book: ${book}`);
|
|
1764
|
+
}
|
|
1765
|
+
function getBookNumber(book) {
|
|
1766
|
+
const normalized = normalizeBookName(book);
|
|
1767
|
+
const bookNum = BOOK_NUMBERS[normalized.toLowerCase()];
|
|
1768
|
+
if (!bookNum) {
|
|
1769
|
+
throw new InvalidReferenceError(`Unknown book: ${book}`);
|
|
1770
|
+
}
|
|
1771
|
+
return bookNum;
|
|
1772
|
+
}
|
|
1773
|
+
function validateReference(book, chapter, verse) {
|
|
1774
|
+
try {
|
|
1775
|
+
const bookNumber = getBookNumber(book);
|
|
1776
|
+
return createVerseReference({
|
|
1777
|
+
bookNumber,
|
|
1778
|
+
chapter,
|
|
1779
|
+
verse
|
|
1780
|
+
});
|
|
1781
|
+
} catch (error) {
|
|
1782
|
+
if (error instanceof Error) {
|
|
1783
|
+
throw new InvalidReferenceError(error.message);
|
|
1784
|
+
}
|
|
1785
|
+
throw error;
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
// src/client.ts
|
|
1790
|
+
function getSdkVersion() {
|
|
1791
|
+
return "0.1.0";
|
|
1792
|
+
}
|
|
1793
|
+
function getUserAgent() {
|
|
1794
|
+
const version = getSdkVersion();
|
|
1795
|
+
const runtime = "Bun" in globalThis ? "Bun" : "Deno" in globalThis ? "Deno" : "Node.js";
|
|
1796
|
+
return `lsbible-typescript/${version} (${runtime}; +https://github.com/kdcokenny/lsbible)`;
|
|
1797
|
+
}
|
|
1798
|
+
var LSBibleClient = class _LSBibleClient {
|
|
1799
|
+
static BASE_URL = "https://read.lsbible.org";
|
|
1800
|
+
cacheProvider;
|
|
1801
|
+
cacheTtls;
|
|
1802
|
+
timeout;
|
|
1803
|
+
buildId;
|
|
1804
|
+
buildIdFetched;
|
|
1805
|
+
headers;
|
|
1806
|
+
/**
|
|
1807
|
+
* Create a new LSBible client.
|
|
1808
|
+
*
|
|
1809
|
+
* @param options - Client configuration options
|
|
1810
|
+
*/
|
|
1811
|
+
constructor(options = {}) {
|
|
1812
|
+
this.cacheProvider = options.cache?.provider ?? void 0;
|
|
1813
|
+
this.cacheTtls = {
|
|
1814
|
+
verse: options.cache?.ttl?.verse ?? CacheTTL.BIBLE_CONTENT,
|
|
1815
|
+
passage: options.cache?.ttl?.passage ?? CacheTTL.BIBLE_CONTENT,
|
|
1816
|
+
chapter: options.cache?.ttl?.chapter ?? CacheTTL.BIBLE_CONTENT,
|
|
1817
|
+
search: options.cache?.ttl?.search ?? CacheTTL.SEARCH_RESULTS
|
|
1818
|
+
};
|
|
1819
|
+
this.timeout = (options.timeout ?? 30) * 1e3;
|
|
1820
|
+
this.buildId = options.buildId;
|
|
1821
|
+
this.buildIdFetched = options.buildId !== void 0;
|
|
1822
|
+
this.headers = {
|
|
1823
|
+
"User-Agent": getUserAgent(),
|
|
1824
|
+
Accept: "*/*",
|
|
1825
|
+
...options.headers
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* Get the Next.js build ID.
|
|
1830
|
+
*
|
|
1831
|
+
* Strategies:
|
|
1832
|
+
* 1. Use cached/provided build ID
|
|
1833
|
+
* 2. Extract from homepage HTML (__NEXT_DATA__ script)
|
|
1834
|
+
* 3. Try to find it in script tags
|
|
1835
|
+
*
|
|
1836
|
+
* @throws BuildIDError if build ID cannot be determined
|
|
1837
|
+
*/
|
|
1838
|
+
async getBuildId() {
|
|
1839
|
+
if (this.buildId && this.buildIdFetched) {
|
|
1840
|
+
return this.buildId;
|
|
1841
|
+
}
|
|
1842
|
+
try {
|
|
1843
|
+
const controller = new AbortController();
|
|
1844
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
1845
|
+
const response = await fetch(_LSBibleClient.BASE_URL, {
|
|
1846
|
+
signal: controller.signal,
|
|
1847
|
+
headers: this.headers
|
|
1848
|
+
});
|
|
1849
|
+
clearTimeout(timeoutId);
|
|
1850
|
+
if (!response.ok) {
|
|
1851
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
1852
|
+
}
|
|
1853
|
+
const html = await response.text();
|
|
1854
|
+
const buildIdMatch = html.match(/"buildId":"([^"]+)"/);
|
|
1855
|
+
if (buildIdMatch?.[1]) {
|
|
1856
|
+
this.buildId = buildIdMatch[1];
|
|
1857
|
+
this.buildIdFetched = true;
|
|
1858
|
+
return this.buildId;
|
|
1859
|
+
}
|
|
1860
|
+
const scriptMatch = html.match(/\/_next\/data\/([^/]+)\//);
|
|
1861
|
+
if (scriptMatch?.[1]) {
|
|
1862
|
+
this.buildId = scriptMatch[1];
|
|
1863
|
+
this.buildIdFetched = true;
|
|
1864
|
+
return this.buildId;
|
|
1865
|
+
}
|
|
1866
|
+
} catch (error) {
|
|
1867
|
+
throw new BuildIDError(
|
|
1868
|
+
`Failed to fetch build ID: ${error instanceof Error ? error.message : String(error)}`
|
|
1869
|
+
);
|
|
1870
|
+
}
|
|
1871
|
+
throw new BuildIDError("Could not determine build ID from homepage");
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* Cache wrapper for async operations.
|
|
1875
|
+
*
|
|
1876
|
+
* @param key - Cache key
|
|
1877
|
+
* @param ttl - Time to live in seconds
|
|
1878
|
+
* @param fetcher - Function to fetch fresh data
|
|
1879
|
+
* @returns Cached or fresh data
|
|
1880
|
+
*/
|
|
1881
|
+
async withCache(key, ttl, fetcher) {
|
|
1882
|
+
if (!this.cacheProvider) {
|
|
1883
|
+
return fetcher();
|
|
1884
|
+
}
|
|
1885
|
+
const cached = await this.cacheProvider.get(key);
|
|
1886
|
+
if (cached !== void 0) {
|
|
1887
|
+
return cached;
|
|
1888
|
+
}
|
|
1889
|
+
const data = await fetcher();
|
|
1890
|
+
await this.cacheProvider.set(key, data, ttl);
|
|
1891
|
+
return data;
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Make a request to the LSBible API.
|
|
1895
|
+
*
|
|
1896
|
+
* @param query - Search query or verse reference
|
|
1897
|
+
* @returns API response JSON
|
|
1898
|
+
* @throws APIError if request fails
|
|
1899
|
+
*/
|
|
1900
|
+
async makeRequest(query) {
|
|
1901
|
+
const buildId = await this.getBuildId();
|
|
1902
|
+
const url = new URL(`${_LSBibleClient.BASE_URL}/_next/data/${buildId}/index.json`);
|
|
1903
|
+
url.searchParams.set("q", query);
|
|
1904
|
+
try {
|
|
1905
|
+
const controller = new AbortController();
|
|
1906
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
1907
|
+
const response = await fetch(url.toString(), {
|
|
1908
|
+
signal: controller.signal,
|
|
1909
|
+
headers: {
|
|
1910
|
+
...this.headers,
|
|
1911
|
+
referer: `${_LSBibleClient.BASE_URL}/`,
|
|
1912
|
+
"x-nextjs-data": "1"
|
|
1913
|
+
}
|
|
1914
|
+
});
|
|
1915
|
+
clearTimeout(timeoutId);
|
|
1916
|
+
if (!response.ok) {
|
|
1917
|
+
throw new APIError(
|
|
1918
|
+
`API request failed with status ${response.status}: ${response.statusText}`
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
return await response.json();
|
|
1922
|
+
} catch (error) {
|
|
1923
|
+
if (error instanceof APIError) {
|
|
1924
|
+
throw error;
|
|
1925
|
+
}
|
|
1926
|
+
throw new APIError(
|
|
1927
|
+
`API request failed: ${error instanceof Error ? error.message : String(error)}`
|
|
1928
|
+
);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
/**
|
|
1932
|
+
* Detect if response is from text search or Bible reference lookup.
|
|
1933
|
+
*
|
|
1934
|
+
* Text searches have initialItems array with metadata.
|
|
1935
|
+
* Bible reference lookups have passages array with full HTML.
|
|
1936
|
+
*/
|
|
1937
|
+
isTextSearch(pageProps) {
|
|
1938
|
+
return "initialItems" in pageProps && "totalCount" in pageProps;
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Parse text search results from initialItems format.
|
|
1942
|
+
*/
|
|
1943
|
+
parseSearchResults(pageProps, query) {
|
|
1944
|
+
const passages = [];
|
|
1945
|
+
const initialItems = pageProps.initialItems ?? [];
|
|
1946
|
+
for (const item of initialItems) {
|
|
1947
|
+
const key = item.key;
|
|
1948
|
+
const parts = key.split("-");
|
|
1949
|
+
if (parts.length !== 3) continue;
|
|
1950
|
+
const bookNumber = Number.parseInt(parts[0] ?? "0", 10);
|
|
1951
|
+
const chapter = Number.parseInt(parts[1] ?? "0", 10);
|
|
1952
|
+
const verse = Number.parseInt(parts[2] ?? "0", 10);
|
|
1953
|
+
const verseRef = createVerseReference({ bookNumber, chapter, verse });
|
|
1954
|
+
const htmlSnippet = item.html ?? "";
|
|
1955
|
+
const plainText = parseSearchResultHtml(htmlSnippet);
|
|
1956
|
+
const segment = {
|
|
1957
|
+
text: plainText,
|
|
1958
|
+
isRedLetter: false,
|
|
1959
|
+
isItalic: false,
|
|
1960
|
+
isBold: false,
|
|
1961
|
+
isSmallCaps: false
|
|
1962
|
+
};
|
|
1963
|
+
const verseContent = createVerseContent({
|
|
1964
|
+
reference: verseRef,
|
|
1965
|
+
verseNumber: verse,
|
|
1966
|
+
segments: [segment],
|
|
1967
|
+
hasSubheading: false,
|
|
1968
|
+
subheadingText: null,
|
|
1969
|
+
isPoetry: false,
|
|
1970
|
+
isProse: false,
|
|
1971
|
+
chapterStart: false
|
|
1972
|
+
});
|
|
1973
|
+
passages.push(
|
|
1974
|
+
createPassage({
|
|
1975
|
+
fromRef: verseRef,
|
|
1976
|
+
toRef: verseRef,
|
|
1977
|
+
title: verseRef.toString(),
|
|
1978
|
+
verses: [verseContent]
|
|
1979
|
+
})
|
|
1980
|
+
);
|
|
1981
|
+
}
|
|
1982
|
+
const totalCount = pageProps.totalCount ?? 0;
|
|
1983
|
+
const filteredCount = pageProps.filteredCount ?? 0;
|
|
1984
|
+
const countsByBook = pageProps.countsByBook;
|
|
1985
|
+
const countsBySection = pageProps.countsBySection;
|
|
1986
|
+
return createSearchResponse({
|
|
1987
|
+
query,
|
|
1988
|
+
matchCount: totalCount,
|
|
1989
|
+
passages,
|
|
1990
|
+
durationMs: pageProps.duration ?? 0,
|
|
1991
|
+
timestamp: pageProps.start ?? 0,
|
|
1992
|
+
totalCount,
|
|
1993
|
+
filteredCount,
|
|
1994
|
+
countsByBook,
|
|
1995
|
+
countsBySection
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* Parse Bible reference lookup results from passages format.
|
|
2000
|
+
*/
|
|
2001
|
+
parseReferenceResults(pageProps, query) {
|
|
2002
|
+
const passages = [];
|
|
2003
|
+
const passagesData = pageProps.passages ?? [];
|
|
2004
|
+
for (const passageData of passagesData) {
|
|
2005
|
+
const fromData = passageData.from;
|
|
2006
|
+
const toData = passageData.to;
|
|
2007
|
+
const fromRef = createVerseReference({
|
|
2008
|
+
bookNumber: fromData.bn ?? 0,
|
|
2009
|
+
chapter: fromData.cn ?? 0,
|
|
2010
|
+
verse: fromData.vn ?? 0
|
|
2011
|
+
});
|
|
2012
|
+
const toRef = createVerseReference({
|
|
2013
|
+
bookNumber: toData.bn ?? 0,
|
|
2014
|
+
chapter: toData.cn ?? 0,
|
|
2015
|
+
verse: toData.vn ?? 0
|
|
2016
|
+
});
|
|
2017
|
+
const passageHtml = passageData.passageHtml ?? "";
|
|
2018
|
+
const verses = parsePassageHtml(passageHtml);
|
|
2019
|
+
passages.push(
|
|
2020
|
+
createPassage({
|
|
2021
|
+
fromRef,
|
|
2022
|
+
toRef,
|
|
2023
|
+
title: passageData.title ?? "",
|
|
2024
|
+
verses
|
|
2025
|
+
})
|
|
2026
|
+
);
|
|
2027
|
+
}
|
|
2028
|
+
return createSearchResponse({
|
|
2029
|
+
query,
|
|
2030
|
+
matchCount: pageProps.searchMatchCount ?? 0,
|
|
2031
|
+
passages,
|
|
2032
|
+
durationMs: pageProps.duration ?? 0,
|
|
2033
|
+
timestamp: pageProps.start ?? 0
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Parse API response into SearchResponse.
|
|
2038
|
+
*/
|
|
2039
|
+
parseResponse(data, query) {
|
|
2040
|
+
const responseData = data;
|
|
2041
|
+
const pageProps = responseData.pageProps ?? {};
|
|
2042
|
+
if (this.isTextSearch(pageProps)) {
|
|
2043
|
+
return this.parseSearchResults(pageProps, query);
|
|
2044
|
+
}
|
|
2045
|
+
return this.parseReferenceResults(pageProps, query);
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Search for passages containing text.
|
|
2049
|
+
*
|
|
2050
|
+
* @param query - Search text (e.g., "love", "faith")
|
|
2051
|
+
* @returns SearchResponse with structured passage data
|
|
2052
|
+
* @throws APIError if API request fails
|
|
2053
|
+
*/
|
|
2054
|
+
async search(query) {
|
|
2055
|
+
return this.withCache(`search:${query}`, this.cacheTtls.search, async () => {
|
|
2056
|
+
const data = await this.makeRequest(query);
|
|
2057
|
+
return this.parseResponse(data, query);
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* Get a specific verse with validated parameters.
|
|
2062
|
+
*
|
|
2063
|
+
* @param book - Book name as enum or string
|
|
2064
|
+
* @param chapter - Chapter number (validated against book)
|
|
2065
|
+
* @param verse - Verse number (validated against chapter)
|
|
2066
|
+
* @returns Single Passage containing the verse
|
|
2067
|
+
* @throws InvalidReferenceError if book/chapter/verse combination is invalid
|
|
2068
|
+
* @throws APIError if API request fails
|
|
2069
|
+
*
|
|
2070
|
+
* @example
|
|
2071
|
+
* ```ts
|
|
2072
|
+
* // Using enum (recommended - type-safe with autocomplete)
|
|
2073
|
+
* const passage = await client.getVerse(BookName.JOHN, 3, 16);
|
|
2074
|
+
*
|
|
2075
|
+
* // Using string (validated at runtime)
|
|
2076
|
+
* const passage2 = await client.getVerse("John", 3, 16);
|
|
2077
|
+
* ```
|
|
2078
|
+
*/
|
|
2079
|
+
async getVerse(book, chapter, verse) {
|
|
2080
|
+
validateReference(book, chapter, verse);
|
|
2081
|
+
const bookName = normalizeBookName(book);
|
|
2082
|
+
const query = `${bookName} ${chapter}:${verse}`;
|
|
2083
|
+
return this.withCache(`verse:${query}`, this.cacheTtls.verse, async () => {
|
|
2084
|
+
const response = await this.search(query);
|
|
2085
|
+
if (response.passages.length === 0) {
|
|
2086
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2087
|
+
}
|
|
2088
|
+
const passage = response.passages[0];
|
|
2089
|
+
if (!passage) {
|
|
2090
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2091
|
+
}
|
|
2092
|
+
return passage;
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Get a passage spanning multiple verses.
|
|
2097
|
+
*
|
|
2098
|
+
* @param fromBook - Starting book
|
|
2099
|
+
* @param fromChapter - Starting chapter
|
|
2100
|
+
* @param fromVerse - Starting verse
|
|
2101
|
+
* @param toBook - Ending book
|
|
2102
|
+
* @param toChapter - Ending chapter
|
|
2103
|
+
* @param toVerse - Ending verse
|
|
2104
|
+
* @returns Passage containing all verses in range
|
|
2105
|
+
* @throws InvalidReferenceError if any reference is invalid
|
|
2106
|
+
* @throws APIError if API request fails
|
|
2107
|
+
*
|
|
2108
|
+
* @example
|
|
2109
|
+
* ```ts
|
|
2110
|
+
* // Get John 3:16-18
|
|
2111
|
+
* const passage = await client.getPassage(
|
|
2112
|
+
* BookName.JOHN, 3, 16,
|
|
2113
|
+
* BookName.JOHN, 3, 18
|
|
2114
|
+
* );
|
|
2115
|
+
* ```
|
|
2116
|
+
*/
|
|
2117
|
+
async getPassage(fromBook, fromChapter, fromVerse, toBook, toChapter, toVerse) {
|
|
2118
|
+
const fromRef = validateReference(fromBook, fromChapter, fromVerse);
|
|
2119
|
+
const toRef = validateReference(toBook, toChapter, toVerse);
|
|
2120
|
+
const fromBookName = normalizeBookName(fromBook);
|
|
2121
|
+
const toBookName = normalizeBookName(toBook);
|
|
2122
|
+
let query;
|
|
2123
|
+
if (fromRef.bookNumber === toRef.bookNumber) {
|
|
2124
|
+
if (fromChapter === toChapter) {
|
|
2125
|
+
query = `${fromBookName} ${fromChapter}:${fromVerse}-${toVerse}`;
|
|
2126
|
+
} else {
|
|
2127
|
+
query = `${fromBookName} ${fromChapter}:${fromVerse}-${toChapter}:${toVerse}`;
|
|
2128
|
+
}
|
|
2129
|
+
} else {
|
|
2130
|
+
query = `${fromBookName} ${fromChapter}:${fromVerse}-${toBookName} ${toChapter}:${toVerse}`;
|
|
2131
|
+
}
|
|
2132
|
+
return this.withCache(`passage:${query}`, this.cacheTtls.passage, async () => {
|
|
2133
|
+
const response = await this.search(query);
|
|
2134
|
+
if (response.passages.length === 0) {
|
|
2135
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2136
|
+
}
|
|
2137
|
+
const passage = response.passages[0];
|
|
2138
|
+
if (!passage) {
|
|
2139
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2140
|
+
}
|
|
2141
|
+
return passage;
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Get an entire chapter.
|
|
2146
|
+
*
|
|
2147
|
+
* @param book - Book name
|
|
2148
|
+
* @param chapter - Chapter number
|
|
2149
|
+
* @returns Passage containing all verses in the chapter
|
|
2150
|
+
* @throws InvalidReferenceError if book/chapter is invalid
|
|
2151
|
+
* @throws APIError if API request fails
|
|
2152
|
+
*
|
|
2153
|
+
* @example
|
|
2154
|
+
* ```ts
|
|
2155
|
+
* // Get all of John chapter 3
|
|
2156
|
+
* const passage = await client.getChapter(BookName.JOHN, 3);
|
|
2157
|
+
* ```
|
|
2158
|
+
*/
|
|
2159
|
+
async getChapter(book, chapter) {
|
|
2160
|
+
const bookNumber = getBookNumber(book);
|
|
2161
|
+
const bookInfo = BIBLE_STRUCTURE[bookNumber];
|
|
2162
|
+
if (!bookInfo) {
|
|
2163
|
+
throw new APIError(`Invalid book number: ${bookNumber}`);
|
|
2164
|
+
}
|
|
2165
|
+
const maxChapter = bookInfo.chapters;
|
|
2166
|
+
if (chapter < 1 || chapter > maxChapter) {
|
|
2167
|
+
const bookName2 = normalizeBookName(book);
|
|
2168
|
+
throw new APIError(
|
|
2169
|
+
`${bookName2} only has ${maxChapter} chapters, but chapter ${chapter} was requested`
|
|
2170
|
+
);
|
|
2171
|
+
}
|
|
2172
|
+
const bookName = normalizeBookName(book);
|
|
2173
|
+
const query = `${bookName} ${chapter}`;
|
|
2174
|
+
return this.withCache(`chapter:${query}`, this.cacheTtls.chapter, async () => {
|
|
2175
|
+
const response = await this.search(query);
|
|
2176
|
+
if (response.passages.length === 0) {
|
|
2177
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2178
|
+
}
|
|
2179
|
+
const passage = response.passages[0];
|
|
2180
|
+
if (!passage) {
|
|
2181
|
+
throw new APIError(`No passage found for ${query}`);
|
|
2182
|
+
}
|
|
2183
|
+
return passage;
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Clear all cached data.
|
|
2188
|
+
*
|
|
2189
|
+
* This method calls the cache provider's clear method if one is configured.
|
|
2190
|
+
* If the cache provider doesn't implement a clear method, this is a no-op.
|
|
2191
|
+
*
|
|
2192
|
+
* @example
|
|
2193
|
+
* ```ts
|
|
2194
|
+
* const client = new LSBibleClient({
|
|
2195
|
+
* cache: { provider: new MemoryCacheProvider() }
|
|
2196
|
+
* });
|
|
2197
|
+
*
|
|
2198
|
+
* // Clear all cached data
|
|
2199
|
+
* client.clearCache();
|
|
2200
|
+
* ```
|
|
2201
|
+
*/
|
|
2202
|
+
clearCache() {
|
|
2203
|
+
if (this.cacheProvider && "clear" in this.cacheProvider) {
|
|
2204
|
+
this.cacheProvider.clear();
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
// src/cache/memory.ts
|
|
2210
|
+
var MemoryCacheProvider = class {
|
|
2211
|
+
cache = /* @__PURE__ */ new Map();
|
|
2212
|
+
async get(key) {
|
|
2213
|
+
const entry = this.cache.get(key);
|
|
2214
|
+
if (!entry) {
|
|
2215
|
+
return void 0;
|
|
2216
|
+
}
|
|
2217
|
+
if (Date.now() > entry.expires) {
|
|
2218
|
+
this.cache.delete(key);
|
|
2219
|
+
return void 0;
|
|
2220
|
+
}
|
|
2221
|
+
return entry.data;
|
|
2222
|
+
}
|
|
2223
|
+
async set(key, value, ttl) {
|
|
2224
|
+
const expires = Date.now() + ttl * 1e3;
|
|
2225
|
+
this.cache.set(key, { data: value, expires });
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Clear all cache entries.
|
|
2229
|
+
*
|
|
2230
|
+
* Useful for testing or manual cache invalidation.
|
|
2231
|
+
*/
|
|
2232
|
+
clear() {
|
|
2233
|
+
this.cache.clear();
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* Get the number of entries in the cache.
|
|
2237
|
+
*
|
|
2238
|
+
* Includes expired entries that haven't been accessed yet.
|
|
2239
|
+
*/
|
|
2240
|
+
size() {
|
|
2241
|
+
return this.cache.size;
|
|
2242
|
+
}
|
|
2243
|
+
};
|
|
2244
|
+
|
|
2245
|
+
// src/cache/noop.ts
|
|
2246
|
+
var NoopCacheProvider = class {
|
|
2247
|
+
async get(_key) {
|
|
2248
|
+
return void 0;
|
|
2249
|
+
}
|
|
2250
|
+
async set(_key, _value, _ttl) {
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
exports.APIError = APIError;
|
|
2255
|
+
exports.BIBLE_STRUCTURE = BIBLE_STRUCTURE;
|
|
2256
|
+
exports.BOOK_NAMES = BOOK_NAMES;
|
|
2257
|
+
exports.BOOK_NUMBERS = BOOK_NUMBERS;
|
|
2258
|
+
exports.BibleSection = BibleSection;
|
|
2259
|
+
exports.BookName = BookName;
|
|
2260
|
+
exports.BuildIDError = BuildIDError;
|
|
2261
|
+
exports.CacheTTL = CacheTTL;
|
|
2262
|
+
exports.InvalidReferenceError = InvalidReferenceError;
|
|
2263
|
+
exports.LSBibleClient = LSBibleClient;
|
|
2264
|
+
exports.LSBibleError = LSBibleError;
|
|
2265
|
+
exports.MemoryCacheProvider = MemoryCacheProvider;
|
|
2266
|
+
exports.NoopCacheProvider = NoopCacheProvider;
|
|
2267
|
+
exports.Testament = Testament;
|
|
2268
|
+
//# sourceMappingURL=index.cjs.map
|
|
2269
|
+
//# sourceMappingURL=index.cjs.map
|