@helloao/tools 0.1.0 → 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.
Files changed (78) hide show
  1. package/dist/cjs/generation/api.cjs +1580 -35
  2. package/dist/cjs/generation/api.cjs.map +3 -3
  3. package/dist/cjs/generation/audio.cjs +55 -8
  4. package/dist/cjs/generation/audio.cjs.map +2 -2
  5. package/dist/cjs/generation/book-order.cjs +1 -1
  6. package/dist/cjs/generation/book-order.cjs.map +2 -2
  7. package/dist/cjs/generation/common-types.cjs +996 -0
  8. package/dist/cjs/generation/common-types.cjs.map +2 -2
  9. package/dist/cjs/generation/dataset.cjs +44 -17
  10. package/dist/cjs/generation/dataset.cjs.map +2 -2
  11. package/dist/cjs/generation/index.cjs +8 -5
  12. package/dist/cjs/generation/index.cjs.map +2 -2
  13. package/dist/cjs/generation/simple.cjs +294 -0
  14. package/dist/cjs/generation/simple.cjs.map +7 -0
  15. package/dist/cjs/index.cjs +4 -4
  16. package/dist/cjs/parser/codex-parser.cjs +3 -3
  17. package/dist/cjs/parser/codex-parser.cjs.map +3 -3
  18. package/dist/cjs/parser/commentary-csv-parser.cjs +14 -3
  19. package/dist/cjs/parser/commentary-csv-parser.cjs.map +3 -3
  20. package/dist/cjs/parser/index.cjs +1 -1
  21. package/dist/cjs/parser/lockman-parser.cjs +334 -0
  22. package/dist/cjs/parser/lockman-parser.cjs.map +7 -0
  23. package/dist/cjs/parser/tyndale-xml-parser.cjs +1 -1
  24. package/dist/cjs/parser/tyndale-xml-parser.cjs.map +1 -1
  25. package/dist/cjs/parser/types.cjs.map +1 -1
  26. package/dist/cjs/parser/usfm-parser.cjs +2 -2
  27. package/dist/cjs/parser/usfm-parser.cjs.map +1 -1
  28. package/dist/cjs/parser/usx-parser.cjs +145 -32
  29. package/dist/cjs/parser/usx-parser.cjs.map +2 -2
  30. package/dist/cjs/parser/words.cjs +187 -0
  31. package/dist/cjs/parser/words.cjs.map +7 -0
  32. package/dist/cjs/utils.cjs +152 -0
  33. package/dist/cjs/utils.cjs.map +3 -3
  34. package/dist/esm/generation/api.js +1527 -35
  35. package/dist/esm/generation/api.js.map +3 -3
  36. package/dist/esm/generation/audio.js +47 -4
  37. package/dist/esm/generation/audio.js.map +2 -2
  38. package/dist/esm/generation/book-order.js +1 -1
  39. package/dist/esm/generation/book-order.js.map +2 -2
  40. package/dist/esm/generation/common-types.js +903 -0
  41. package/dist/esm/generation/common-types.js.map +3 -3
  42. package/dist/esm/generation/dataset.js +35 -10
  43. package/dist/esm/generation/dataset.js.map +2 -2
  44. package/dist/esm/generation/index.js +2 -1
  45. package/dist/esm/generation/index.js.map +2 -2
  46. package/dist/esm/generation/simple.js +260 -0
  47. package/dist/esm/generation/simple.js.map +7 -0
  48. package/dist/esm/parser/codex-parser.js +3 -3
  49. package/dist/esm/parser/codex-parser.js.map +3 -3
  50. package/dist/esm/parser/commentary-csv-parser.js +3 -2
  51. package/dist/esm/parser/commentary-csv-parser.js.map +2 -2
  52. package/dist/esm/parser/lockman-parser.js +306 -0
  53. package/dist/esm/parser/lockman-parser.js.map +7 -0
  54. package/dist/esm/parser/tyndale-xml-parser.js +1 -1
  55. package/dist/esm/parser/tyndale-xml-parser.js.map +1 -1
  56. package/dist/esm/parser/usfm-parser.js +1 -1
  57. package/dist/esm/parser/usfm-parser.js.map +1 -1
  58. package/dist/esm/parser/usx-parser.js +153 -32
  59. package/dist/esm/parser/usx-parser.js.map +2 -2
  60. package/dist/esm/parser/words.js +149 -0
  61. package/dist/esm/parser/words.js.map +7 -0
  62. package/dist/esm/utils.js +138 -0
  63. package/dist/esm/utils.js.map +2 -2
  64. package/dist/types/generation/api.d.ts +8478 -472
  65. package/dist/types/generation/audio.d.ts +5 -0
  66. package/dist/types/generation/common-types.d.ts +1646 -407
  67. package/dist/types/generation/dataset.d.ts +1 -0
  68. package/dist/types/generation/index.d.ts +2 -1
  69. package/dist/types/generation/simple.d.ts +110 -0
  70. package/dist/types/parser/codex-parser.d.ts +18 -138
  71. package/dist/types/parser/commentary-csv-parser.d.ts +1 -1
  72. package/dist/types/parser/lockman-parser.d.ts +14 -0
  73. package/dist/types/parser/tyndale-xml-parser.d.ts +1 -1
  74. package/dist/types/parser/types.d.ts +67 -0
  75. package/dist/types/parser/usx-parser.d.ts +6 -5
  76. package/dist/types/parser/words.d.ts +104 -0
  77. package/dist/types/utils.d.ts +223 -18
  78. package/package.json +7 -4
@@ -18,8 +18,44 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var api_exports = {};
20
20
  __export(api_exports, {
21
+ ApiAvailableCommentariesSchema: () => ApiAvailableCommentariesSchema,
22
+ ApiAvailableDatasetsSchema: () => ApiAvailableDatasetsSchema,
23
+ ApiAvailableTranslationsSchema: () => ApiAvailableTranslationsSchema,
24
+ ApiCommentaryBookChapterSchema: () => ApiCommentaryBookChapterSchema,
25
+ ApiCommentaryBookSchema: () => ApiCommentaryBookSchema,
26
+ ApiCommentaryBooksSchema: () => ApiCommentaryBooksSchema,
27
+ ApiCommentaryProfileContentSchema: () => ApiCommentaryProfileContentSchema,
28
+ ApiCommentaryProfileSchema: () => ApiCommentaryProfileSchema,
29
+ ApiCommentaryProfilesSchema: () => ApiCommentaryProfilesSchema,
30
+ ApiCommentarySchema: () => ApiCommentarySchema,
31
+ ApiDatasetBookChapterSchema: () => ApiDatasetBookChapterSchema,
32
+ ApiDatasetBookSchema: () => ApiDatasetBookSchema,
33
+ ApiDatasetBooksSchema: () => ApiDatasetBooksSchema,
34
+ ApiDatasetSchema: () => ApiDatasetSchema,
35
+ ApiSimpleCommentaryBookChapterSchema: () => ApiSimpleCommentaryBookChapterSchema,
36
+ ApiSimpleTranslationBookChapterSchema: () => ApiSimpleTranslationBookChapterSchema,
37
+ ApiSimpleTranslationBookChapterWordsSchema: () => ApiSimpleTranslationBookChapterWordsSchema,
38
+ ApiSimpleTranslationCompleteBookSchema: () => ApiSimpleTranslationCompleteBookSchema,
39
+ ApiSimpleTranslationCompleteSchema: () => ApiSimpleTranslationCompleteSchema,
40
+ ApiTranslationBookChapterAudioSchema: () => ApiTranslationBookChapterAudioSchema,
41
+ ApiTranslationBookChapterAudioTimingsSchema: () => ApiTranslationBookChapterAudioTimingsSchema,
42
+ ApiTranslationBookChapterSchema: () => ApiTranslationBookChapterSchema,
43
+ ApiTranslationBookChapterWordsSchema: () => ApiTranslationBookChapterWordsSchema,
44
+ ApiTranslationBookSchema: () => ApiTranslationBookSchema,
45
+ ApiTranslationBooksSchema: () => ApiTranslationBooksSchema,
46
+ ApiTranslationCompleteBookSchema: () => ApiTranslationCompleteBookSchema,
47
+ ApiTranslationCompleteSchema: () => ApiTranslationCompleteSchema,
48
+ ApiTranslationSchema: () => ApiTranslationSchema,
49
+ CommentaryChapterReferenceSchema: () => CommentaryChapterReferenceSchema,
50
+ DatasetChapterReferenceSchema: () => DatasetChapterReferenceSchema,
51
+ SIMPLE_JSON_EXTENSION: () => SIMPLE_JSON_EXTENSION,
52
+ SimpleTranslationCompleteChapterSchema: () => SimpleTranslationCompleteChapterSchema,
53
+ TranslationChapterReferenceSchema: () => TranslationChapterReferenceSchema,
54
+ TranslationCompleteChapterSchema: () => TranslationCompleteChapterSchema,
21
55
  bookChapterApiLink: () => bookChapterApiLink,
22
56
  bookChapterAudioApiLink: () => bookChapterAudioApiLink,
57
+ bookChapterAudioTimingsApiLink: () => bookChapterAudioTimingsApiLink,
58
+ bookChapterWordsApiLink: () => bookChapterWordsApiLink,
23
59
  bookCommentaryChapterApiLink: () => bookCommentaryChapterApiLink,
24
60
  bookDatasetChapterApiLink: () => bookDatasetChapterApiLink,
25
61
  completeTranslationApiLink: () => completeTranslationApiLink,
@@ -36,9 +72,1114 @@ __export(api_exports, {
36
72
  replaceSpacesWithUnderscores: () => replaceSpacesWithUnderscores
37
73
  });
38
74
  module.exports = __toCommonJS(api_exports);
75
+ var import_zod = require("zod");
76
+ var import_common_types = require("./common-types.js");
77
+ var import_simple = require("./simple.js");
78
+ var import_utils = require("../utils.js");
79
+ const ApiAvailableTranslationsSchema = import_zod.z.object({
80
+ /**
81
+ * The list of translations.
82
+ */
83
+ translations: import_zod.z.array(import_zod.z.lazy(() => ApiTranslationSchema)).meta({
84
+ description: "The list of translations that are available in the API."
85
+ })
86
+ }).meta({
87
+ id: "ApiAvailableTranslations",
88
+ description: "The list of available translations. Maps to the /api/available-translations.json endpoint."
89
+ });
90
+ const ApiAvailableCommentariesSchema = import_zod.z.object({
91
+ /**
92
+ * The list of commentaries.
93
+ */
94
+ commentaries: import_zod.z.array(import_zod.z.lazy(() => ApiCommentarySchema)).meta({
95
+ description: "The list of commentaries that are available in the API."
96
+ })
97
+ }).meta({
98
+ id: "ApiAvailableCommentaries",
99
+ description: "The list of available commentaries. Maps to the /api/available-commentaries.json endpoint."
100
+ });
101
+ const ApiAvailableDatasetsSchema = import_zod.z.object({
102
+ datasets: import_zod.z.array(import_zod.z.lazy(() => ApiDatasetSchema)).meta({
103
+ description: "The list of datasets that are available in the API."
104
+ })
105
+ }).meta({
106
+ id: "ApiAvailableDatasets",
107
+ description: "The list of available datasets. Maps to the /api/available-datasets.json endpoint."
108
+ });
109
+ const ApiDatasetSchema = import_common_types.DatasetSchema.extend({
110
+ /**
111
+ * The API link for the list of books for this dataset.
112
+ */
113
+ listOfBooksApiLink: import_zod.z.string().meta({
114
+ description: "The API link for the list of books for this dataset. Relative to the API origin."
115
+ }),
116
+ /**
117
+ * The available list of formats.
118
+ */
119
+ availableFormats: import_zod.z.array(import_zod.z.literal("json")),
120
+ /**
121
+ * The number of books that are contained in this dataset.
122
+ */
123
+ numberOfBooks: import_zod.z.number().meta({
124
+ description: "The number of books that are contained in this dataset."
125
+ }),
126
+ /**
127
+ * The total number of chapters that are contained in this dataset.
128
+ */
129
+ totalNumberOfChapters: import_zod.z.number().meta({
130
+ description: "The total number of chapters that are contained in this dataset."
131
+ }),
132
+ /**
133
+ * The total number of verses that are contained in this dataset.
134
+ */
135
+ totalNumberOfVerses: import_zod.z.number().meta({
136
+ description: "The total number of verses that are contained in this dataset."
137
+ }),
138
+ /**
139
+ * The total number of references that are contained in this dataset.
140
+ */
141
+ totalNumberOfReferences: import_zod.z.number().meta({
142
+ description: "The total number of references that are contained in this dataset."
143
+ }),
144
+ /**
145
+ * Gets the name of the language that the commentary is in.
146
+ * Null or undefined if the name of the language is not known.
147
+ */
148
+ languageName: import_zod.z.string().optional().meta({
149
+ description: "Gets the name of the language that the dataset is in. Null or undefined if the name of the language is not known."
150
+ }),
151
+ /**
152
+ * Gets the name of the language in English.
153
+ * Null or undefined if the language doesn't have an english name.
154
+ */
155
+ languageEnglishName: import_zod.z.string().optional().meta({
156
+ description: "Gets the name of the language in English. Null or undefined if the language doesn't have an english name."
157
+ })
158
+ }).meta({
159
+ id: "ApiDataset",
160
+ description: "Defines a dataset that is used in the API."
161
+ });
162
+ const ApiTranslationSchema = import_common_types.TranslationSchema.extend({
163
+ /**
164
+ * The API link for the list of available books for this translation.
165
+ */
166
+ listOfBooksApiLink: import_zod.z.string().meta({
167
+ description: "The API link for the list of books for this translation. Relative to the API origin."
168
+ }),
169
+ /**
170
+ * The available list of formats.
171
+ */
172
+ availableFormats: import_zod.z.array(import_zod.z.enum(["json", "usfm"])),
173
+ /**
174
+ * The number of books that are contained in this translation.
175
+ *
176
+ * Complete translations should have the same number of books as the Bible (66).
177
+ */
178
+ numberOfBooks: import_zod.z.number().meta({
179
+ description: "The number of books that are contained in this translation. Complete translations should have the same number of books as the Bible (66)."
180
+ }),
181
+ /**
182
+ * The total number of chapters that are contained in this translation.
183
+ *
184
+ * Complete translations should have the same number of chapters as the Bible (1,189).
185
+ */
186
+ totalNumberOfChapters: import_zod.z.number().meta({
187
+ description: "The total number of chapters that are contained in this translation. Complete translations should have the same number of chapters as the Bible (1,189)."
188
+ }),
189
+ /**
190
+ * The total number of verses that are contained in this translation.
191
+ *
192
+ * Complete translations should have the same number of verses as the Bible (around 31,102 - some translations exclude verses based on the aparent likelyhood of existing in the original source texts).
193
+ */
194
+ totalNumberOfVerses: import_zod.z.number().meta({
195
+ description: "The total number of verses that are contained in this translation. Complete translations should have the same number of verses as the Bible (around 31,102 - some translations exclude verses based on the aparent likelyhood of existing in the original source texts)."
196
+ }),
197
+ /**
198
+ * The total number of apocryphal books that are contained in this translation.
199
+ */
200
+ numberOfApocryphalBooks: import_zod.z.number().optional().meta({
201
+ description: "The total number of apocryphal books that are contained in this translation."
202
+ }),
203
+ /**
204
+ * The total number of apocryphal chapters that are contained in this translation.
205
+ */
206
+ totalNumberOfApocryphalChapters: import_zod.z.number().optional().meta({
207
+ description: "The total number of apocryphal chapters that are contained in this translation."
208
+ }),
209
+ /**
210
+ * The total number of apocryphal verses that are contained in this translation.
211
+ */
212
+ totalNumberOfApocryphalVerses: import_zod.z.number().optional().meta({
213
+ description: "The total number of apocryphal verses that are contained in this translation."
214
+ }),
215
+ /**
216
+ * Gets the name of the language that the translation is in.
217
+ * Null or undefined if the name of the language is not known.
218
+ */
219
+ languageName: import_zod.z.string().optional().meta({
220
+ description: "Gets the name of the language that the translation is in. Null or undefined if the name of the language is not known."
221
+ }),
222
+ /**
223
+ * Gets the name of the language in English.
224
+ * Null or undefined if the language doesn't have an english name.
225
+ */
226
+ languageEnglishName: import_zod.z.string().optional().meta({
227
+ description: "Gets the name of the language in English. Null or undefined if the language doesn't have an english name."
228
+ }),
229
+ /**
230
+ * The API link for downloading the complete translation as a single JSON file.
231
+ *
232
+ * Undefined if complete translation files are not available.
233
+ */
234
+ completeTranslationApiLink: import_zod.z.string().optional().meta({
235
+ description: "The API link for downloading the complete translation as a single JSON file. Relative to the API origin. Undefined if complete translation files are not available."
236
+ }),
237
+ /**
238
+ * The API link for downloading the complete translation as a single JSON file,
239
+ * using the simplified chapter format.
240
+ *
241
+ * Undefined if complete translation files are not available.
242
+ */
243
+ simpleCompleteTranslationApiLink: import_zod.z.string().optional().meta({
244
+ description: "The API link for downloading the complete translation as a single JSON file, using the simplified chapter format. Relative to the API origin. Undefined if complete translation files are not available."
245
+ })
246
+ }).meta({
247
+ id: "ApiTranslation",
248
+ description: "Defines a translation that is used in the API."
249
+ });
250
+ const ApiTranslationCompleteSchema = import_zod.z.object({
251
+ /**
252
+ * The translation metadata.
253
+ */
254
+ translation: import_zod.z.lazy(() => ApiTranslationSchema).meta({
255
+ description: "The translation metadata."
256
+ }),
257
+ /**
258
+ * The complete list of books with all their chapters.
259
+ */
260
+ books: import_zod.z.array(import_zod.z.lazy(() => ApiTranslationCompleteBookSchema)).meta({
261
+ description: "The complete list of books with all their chapters."
262
+ })
263
+ }).meta({
264
+ id: "ApiTranslationComplete",
265
+ description: "Defines the complete translation download data. Maps to the /api/:translationId/complete.json endpoint."
266
+ });
267
+ const TranslationCompleteChapterSchema = import_common_types.TranslationBookChapterSchema.extend({
268
+ /**
269
+ * The number of verses that the chapter contains.
270
+ */
271
+ numberOfVerses: import_zod.z.number().meta({
272
+ description: "The number of verses that the chapter contains."
273
+ })
274
+ }).meta({
275
+ id: "TranslationCompleteChapter",
276
+ description: "A chapter in the complete translation download."
277
+ });
278
+ const SimpleTranslationCompleteChapterSchema = import_common_types.SimpleTranslationBookChapterSchema.extend({
279
+ /**
280
+ * The number of verses that the chapter contains.
281
+ */
282
+ numberOfVerses: import_zod.z.number().meta({
283
+ description: "The number of verses that the chapter contains."
284
+ })
285
+ }).meta({
286
+ id: "SimpleTranslationCompleteChapter",
287
+ description: "A chapter in the complete translation download, using the simplified chapter format."
288
+ });
289
+ const ApiTranslationCompleteBookSchema = import_common_types.TranslationBookSchema.extend({
290
+ /**
291
+ * The number of chapters in the book.
292
+ */
293
+ numberOfChapters: import_zod.z.number().meta({
294
+ description: "The number of chapters in the book."
295
+ }),
296
+ /**
297
+ * The total number of verses in the book.
298
+ */
299
+ totalNumberOfVerses: import_zod.z.number().meta({
300
+ description: "The total number of verses in the book."
301
+ }),
302
+ /**
303
+ * The complete list of chapters with all content.
304
+ */
305
+ chapters: import_zod.z.array(TranslationCompleteChapterSchema).meta({
306
+ description: "The complete list of chapters with all content."
307
+ })
308
+ }).meta({
309
+ id: "ApiTranslationCompleteBook",
310
+ description: "A book in the complete translation download."
311
+ });
312
+ const ApiSimpleTranslationCompleteSchema = import_zod.z.object({
313
+ /**
314
+ * The translation metadata.
315
+ */
316
+ translation: import_zod.z.lazy(() => ApiTranslationSchema).meta({
317
+ description: "The translation metadata."
318
+ }),
319
+ /**
320
+ * The complete list of books with all their chapters.
321
+ */
322
+ books: import_zod.z.array(import_zod.z.lazy(() => ApiSimpleTranslationCompleteBookSchema)).meta({
323
+ description: "The complete list of books with all their chapters."
324
+ })
325
+ }).meta({
326
+ id: "ApiSimpleTranslationComplete",
327
+ description: "Defines the complete translation download data, using the simplified chapter format. Maps to the /api/:translationId/complete.simple.json endpoint."
328
+ });
329
+ const ApiSimpleTranslationCompleteBookSchema = ApiTranslationCompleteBookSchema.extend({
330
+ /**
331
+ * The complete list of chapters with all content.
332
+ */
333
+ chapters: import_zod.z.array(SimpleTranslationCompleteChapterSchema).meta({
334
+ description: "The complete list of chapters with all content."
335
+ })
336
+ }).meta({
337
+ id: "ApiSimpleTranslationCompleteBook",
338
+ description: "A book in the complete translation download, using the simplified chapter format."
339
+ });
340
+ const ApiCommentarySchema = import_common_types.CommentarySchema.extend({
341
+ /**
342
+ * The API link for the list of available books for this translation.
343
+ */
344
+ listOfBooksApiLink: import_zod.z.string().meta({
345
+ description: "The API link for the list of books for this commentary. Relative to the API origin."
346
+ }),
347
+ /**
348
+ * The API link for the list of available profiles for this commentary.
349
+ */
350
+ listOfProfilesApiLink: import_zod.z.string().meta({
351
+ description: "The API link for the list of profiles for this commentary. Relative to the API origin."
352
+ }),
353
+ /**
354
+ * The available list of formats.
355
+ */
356
+ availableFormats: import_zod.z.array(import_zod.z.enum(["json", "usfm"])),
357
+ /**
358
+ * The number of books that are contained in this commentary.
359
+ *
360
+ * Complete commentaries should have the same number of books as the Bible (66).
361
+ */
362
+ numberOfBooks: import_zod.z.number().meta({
363
+ description: "The number of books that are contained in this commentary. Complete commentaries should have the same number of books as the Bible (66)."
364
+ }),
365
+ /**
366
+ * The total number of chapters that are contained in this translation.
367
+ *
368
+ * Complete commentaries should have the same number of chapters as the Bible (1,189).
369
+ */
370
+ totalNumberOfChapters: import_zod.z.number().meta({
371
+ description: "The total number of chapters that are contained in this commentary. Complete commentaries should have the same number of chapters as the Bible (1,189)."
372
+ }),
373
+ /**
374
+ * The total number of verses that are contained in this commentary.
375
+ *
376
+ * Complete commentaries should have the same number of verses as the Bible (around 31,102 - some commentaries exclude verses based on the aparent likelyhood of existing in the original source texts).
377
+ */
378
+ totalNumberOfVerses: import_zod.z.number().meta({
379
+ description: "The total number of verses that are contained in this commentary. Complete commentaries should have the same number of verses as the Bible (around 31,102 - some commentaries exclude verses based on the aparent likelyhood of existing in the original source texts)."
380
+ }),
381
+ /**
382
+ * The total number of profiles that are contained in this commentary.
383
+ *
384
+ * Profiles are used to provide additional information about people and people groups that are mentioned in the Bible.
385
+ */
386
+ totalNumberOfProfiles: import_zod.z.number().meta({
387
+ description: "The total number of profiles that are contained in this commentary. Profiles are used to provide additional information about people and people groups that are mentioned in the Bible."
388
+ }),
389
+ /**
390
+ * Gets the name of the language that the commentary is in.
391
+ * Null or undefined if the name of the language is not known.
392
+ */
393
+ languageName: import_zod.z.string().optional().meta({
394
+ description: "Gets the name of the language that the commentary is in. Null or undefined if the name of the language is not known."
395
+ }),
396
+ /**
397
+ * Gets the name of the language in English.
398
+ * Null or undefined if the language doesn't have an english name.
399
+ */
400
+ languageEnglishName: import_zod.z.string().optional().meta({
401
+ description: "Gets the name of the language in English. Null or undefined if the language doesn't have an english name."
402
+ })
403
+ }).meta({
404
+ id: "ApiCommentary",
405
+ description: "Defines a commentary that is used in the API."
406
+ });
407
+ const ApiTranslationBooksSchema = import_zod.z.object({
408
+ /**
409
+ * The translation information for the books.
410
+ */
411
+ translation: import_zod.z.lazy(() => ApiTranslationSchema).meta({
412
+ description: "The translation information for the books."
413
+ }),
414
+ /**
415
+ * The list of books that are available for the translation.
416
+ */
417
+ books: import_zod.z.array(import_zod.z.lazy(() => ApiTranslationBookSchema)).meta({
418
+ description: "The list of books that are available for the translation."
419
+ })
420
+ }).meta({
421
+ id: "ApiTranslationBooks",
422
+ description: "Defines an interface that contains information about the books that are available for a translation."
423
+ });
424
+ const ApiCommentaryBooksSchema = import_zod.z.object({
425
+ /**
426
+ * The commentary information for the books.
427
+ */
428
+ commentary: import_zod.z.lazy(() => ApiCommentarySchema).meta({
429
+ description: "The commentary information for the books."
430
+ }),
431
+ /**
432
+ * The list of books that are available for the commentary.
433
+ */
434
+ books: import_zod.z.array(import_zod.z.lazy(() => ApiCommentaryBookSchema)).meta({
435
+ description: "The list of books that are available for the commentary."
436
+ })
437
+ }).meta({
438
+ id: "ApiCommentaryBooks",
439
+ description: "Defines an interface that contains information about the books that are available for a commentary."
440
+ });
441
+ const ApiDatasetBooksSchema = import_zod.z.object({
442
+ /**
443
+ * The dataset information for the books.
444
+ */
445
+ dataset: import_zod.z.lazy(() => ApiDatasetSchema).meta({
446
+ description: "The dataset information for the books."
447
+ }),
448
+ /**
449
+ * The list of books that are available for the dataset.
450
+ */
451
+ books: import_zod.z.array(import_zod.z.lazy(() => ApiDatasetBookSchema)).meta({
452
+ description: "The list of books that are available for the dataset."
453
+ })
454
+ }).meta({
455
+ id: "ApiDatasetBooks",
456
+ description: "Defines an interface that contains information about the books that are available for a dataset."
457
+ });
458
+ const ApiCommentaryProfilesSchema = import_zod.z.object({
459
+ /**
460
+ * The commentary information for the books.
461
+ */
462
+ commentary: import_zod.z.lazy(() => ApiCommentarySchema).meta({
463
+ description: "The commentary information for the profiles."
464
+ }),
465
+ /**
466
+ * The list of profiles that are available for the commentary.
467
+ */
468
+ profiles: import_zod.z.array(import_zod.z.lazy(() => ApiCommentaryProfileSchema)).meta({
469
+ description: "The list of profiles that are available for the commentary."
470
+ })
471
+ }).meta({
472
+ id: "ApiCommentaryProfiles",
473
+ description: "Defines an interface that contains information about the profiles that are available for a commentary."
474
+ });
475
+ const ApiCommentaryProfileSchema = import_common_types.CommentaryProfileSchema.extend({
476
+ /**
477
+ * The link to this profile.
478
+ */
479
+ thisProfileLink: import_zod.z.string().meta({
480
+ description: "The API link for this profile. Relative to the API origin."
481
+ }),
482
+ /**
483
+ * The link to the chapter that this profile references in the commentary.
484
+ */
485
+ referenceChapterLink: import_zod.z.string().nullable().meta({
486
+ description: "The API link to the chapter that this profile references in the commentary. Relative to the API origin. Null if the profile doesn't reference a specific chapter."
487
+ })
488
+ }).meta({
489
+ id: "ApiCommentaryProfile",
490
+ description: "Defines an interface that contains information about a profile."
491
+ });
492
+ const TranslationChapterReferenceSchema = import_zod.z.object({
493
+ translationId: import_zod.z.string().meta({
494
+ description: "The ID of the translation that the chapter reference is for."
495
+ }),
496
+ book: import_utils.BookIdSchema,
497
+ chapter: import_zod.z.int().positive().meta({
498
+ description: "The chapter number of the chapter reference."
499
+ })
500
+ }).meta({
501
+ id: "TranslationChapterReference",
502
+ description: "Defines a reference to a chapter in a translation."
503
+ });
504
+ const CommentaryChapterReferenceSchema = import_zod.z.object({
505
+ commentaryId: import_zod.z.string().meta({
506
+ description: "The ID of the commentary that the chapter reference is for."
507
+ }),
508
+ book: import_utils.BookIdSchema,
509
+ chapter: import_zod.z.int().positive().meta({
510
+ description: "The chapter number of the chapter reference."
511
+ })
512
+ }).meta({
513
+ id: "CommentaryChapterReference",
514
+ description: "Defines a reference to a chapter in a commentary."
515
+ });
516
+ const DatasetChapterReferenceSchema = import_zod.z.object({
517
+ datasetId: import_zod.z.string().meta({
518
+ description: "The ID of the dataset that the chapter reference is for."
519
+ }),
520
+ book: import_utils.BookIdSchema,
521
+ chapter: import_zod.z.int().positive().meta({
522
+ description: "The chapter number of the chapter reference."
523
+ })
524
+ }).meta({
525
+ id: "DatasetChapterReference",
526
+ description: "Defines a reference to a chapter in a dataset."
527
+ });
528
+ const ApiTranslationBookSchema = import_common_types.TranslationBookSchema.extend({
529
+ /**
530
+ * The number of the first chapter in the book.
531
+ */
532
+ firstChapterNumber: import_zod.z.number().meta({
533
+ description: "The number of the first chapter in the book."
534
+ }),
535
+ /**
536
+ * The link to the first chapter of the book.
537
+ */
538
+ firstChapterApiLink: import_zod.z.string().meta({
539
+ description: "The link to the first chapter of the book."
540
+ }),
541
+ /**
542
+ * The reference for the first chapter in the book.
543
+ */
544
+ firstChapterReference: TranslationChapterReferenceSchema,
545
+ /**
546
+ * The number of the last chapter in the book.
547
+ */
548
+ lastChapterNumber: import_zod.z.number().meta({
549
+ description: "The number of the last chapter in the book."
550
+ }),
551
+ /**
552
+ * The link to the last chapter of the book.
553
+ */
554
+ lastChapterApiLink: import_zod.z.string().meta({
555
+ description: "The link to the last chapter of the book."
556
+ }),
557
+ /**
558
+ * The reference for the last chapter in the book.
559
+ */
560
+ lastChapterReference: TranslationChapterReferenceSchema,
561
+ /**
562
+ * The number of chapters that the book contains.
563
+ */
564
+ numberOfChapters: import_zod.z.number().meta({
565
+ description: "The number of chapters that the book contains."
566
+ }),
567
+ /**
568
+ * The number of verses that the book contains.
569
+ */
570
+ totalNumberOfVerses: import_zod.z.number().meta({
571
+ description: "The number of verses that the book contains."
572
+ })
573
+ }).meta({
574
+ id: "ApiTranslationBook",
575
+ description: "Defines a schema that contains information about a translation book."
576
+ });
577
+ const ApiCommentaryBookSchema = import_common_types.CommentaryBookSchema.extend({
578
+ /**
579
+ * The number of the first chapter in the book.
580
+ *
581
+ * Null if the comentary book has no chapters.
582
+ */
583
+ firstChapterNumber: import_zod.z.number().nullable().meta({
584
+ description: "The number of the first chapter in the book. Null if the comentary book has no chapters."
585
+ }),
586
+ /**
587
+ * The link to the first chapter of the book.
588
+ *
589
+ * Null if the comentary book has no chapters.
590
+ */
591
+ firstChapterApiLink: import_zod.z.string().nullable().meta({
592
+ description: "The link to the first chapter of the book. Null if the comentary book has no chapters."
593
+ }),
594
+ /**
595
+ * The reference for the first chapter in the book.
596
+ */
597
+ firstChapterReference: CommentaryChapterReferenceSchema.nullable().meta({
598
+ description: "The reference for the first chapter in the book. Null if the comentary book has no chapters."
599
+ }),
600
+ /**
601
+ * The number of the last chapter in the book.
602
+ *
603
+ * Null if the comentary book has no chapters.
604
+ */
605
+ lastChapterNumber: import_zod.z.number().nullable().meta({
606
+ description: "The number of the last chapter in the book. Null if the comentary book has no chapters."
607
+ }),
608
+ /**
609
+ * The link to the last chapter of the book.
610
+ *
611
+ * Null if the comentary book has no chapters.
612
+ */
613
+ lastChapterApiLink: import_zod.z.string().nullable().meta({
614
+ description: "The link to the last chapter of the book. Null if the comentary book has no chapters."
615
+ }),
616
+ /**
617
+ * The reference for the last chapter in the book.
618
+ */
619
+ lastChapterReference: CommentaryChapterReferenceSchema.nullable().meta({
620
+ description: "The reference for the last chapter in the book. Null if the comentary book has no chapters."
621
+ }),
622
+ /**
623
+ * The number of chapters that the book contains.
624
+ */
625
+ numberOfChapters: import_zod.z.number().meta({
626
+ description: "The number of chapters that the book contains."
627
+ }),
628
+ /**
629
+ * The number of verses that the book contains.
630
+ */
631
+ totalNumberOfVerses: import_zod.z.number().meta({
632
+ description: "The number of verses that the book contains."
633
+ })
634
+ }).meta({
635
+ id: "ApiCommentaryBook",
636
+ description: "Defines a schema that contains information about a commentary book."
637
+ });
638
+ const ApiDatasetBookSchema = import_common_types.DatasetBookSchema.extend({
639
+ /**
640
+ * The number of the first chapter in the book.
641
+ */
642
+ firstChapterNumber: import_zod.z.number().meta({
643
+ description: "The number of the first chapter in the book."
644
+ }),
645
+ /**
646
+ * The link to the first chapter of the book.
647
+ */
648
+ firstChapterApiLink: import_zod.z.string().meta({
649
+ description: "The link to the first chapter of the book."
650
+ }),
651
+ /**
652
+ * The reference for the first chapter in the book.
653
+ */
654
+ firstChapterReference: DatasetChapterReferenceSchema,
655
+ /**
656
+ * The number of the last chapter in the book.
657
+ */
658
+ lastChapterNumber: import_zod.z.number().meta({
659
+ description: "The number of the last chapter in the book."
660
+ }),
661
+ /**
662
+ * The link to the last chapter of the book.
663
+ */
664
+ lastChapterApiLink: import_zod.z.string().meta({
665
+ description: "The link to the last chapter of the book."
666
+ }),
667
+ /**
668
+ * The reference for the last chapter in the book.
669
+ */
670
+ lastChapterReference: DatasetChapterReferenceSchema,
671
+ /**
672
+ * The number of chapters that the book contains.
673
+ */
674
+ numberOfChapters: import_zod.z.number().meta({
675
+ description: "The number of chapters that the book contains."
676
+ }),
677
+ /**
678
+ * The number of verses that the book contains.
679
+ */
680
+ totalNumberOfVerses: import_zod.z.number().meta({
681
+ description: "The number of verses that the book contains."
682
+ }),
683
+ /**
684
+ * The number of references that the book contains.
685
+ */
686
+ totalNumberOfReferences: import_zod.z.number().meta({
687
+ description: "The number of references that the book contains."
688
+ })
689
+ }).meta({
690
+ id: "ApiDatasetBook",
691
+ description: "Defines a schema that contains information about a book in a dataset."
692
+ });
693
+ const ApiTranslationBookChapterBaseSchema = import_common_types.TranslationBookChapterSchema.omit({
694
+ thisChapterWords: true
695
+ });
696
+ const ApiTranslationBookChapterSchema = ApiTranslationBookChapterBaseSchema.extend({
697
+ /**
698
+ * The translation information for the book chapter.
699
+ */
700
+ translation: import_zod.z.lazy(() => ApiTranslationSchema).meta({
701
+ description: "The translation information for the book chapter."
702
+ }),
703
+ /**
704
+ * The book information for the book chapter.
705
+ */
706
+ book: import_zod.z.lazy(() => ApiTranslationBookSchema).meta({
707
+ description: "The book information for the book chapter."
708
+ }),
709
+ /**
710
+ * The link to this chapter.
711
+ */
712
+ thisChapterLink: import_zod.z.string().meta({
713
+ description: "The API link for this chapter. Relative to the API origin."
714
+ }),
715
+ /**
716
+ * The reference for this chapter.
717
+ */
718
+ thisChapterReference: TranslationChapterReferenceSchema,
719
+ /**
720
+ * The link to the next chapter.
721
+ * Null if this is the last chapter in the translation.
722
+ */
723
+ nextChapterApiLink: import_zod.z.string().nullable().meta({
724
+ description: "The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation."
725
+ }),
726
+ /**
727
+ * The reference for the next chapter.
728
+ * Null if this is the last chapter in the translation.
729
+ */
730
+ nextChapterReference: TranslationChapterReferenceSchema.nullable().meta(
731
+ {
732
+ description: "The reference for the next chapter. Null if this is the last chapter in the translation."
733
+ }
734
+ ),
735
+ /**
736
+ * The links to the audio versions for the next chapter.
737
+ * Null if this is the last chapter in the translation.
738
+ */
739
+ nextChapterAudioLinks: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).nullable().meta({
740
+ description: "The links to the audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation."
741
+ }),
742
+ /**
743
+ * The links to the audio timings for different audio versions for the chapter.
744
+ */
745
+ thisChapterAudioTimings: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).meta({
746
+ description: "The links to the audio timings for different audio versions for the chapter. Relative to the API origin."
747
+ }),
748
+ /**
749
+ * The links to the audio timings for different audio versions for the next chapter.
750
+ * Null if this is the last chapter in the translation.
751
+ */
752
+ nextChapterAudioTimings: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).nullable().meta({
753
+ description: "The links to the audio timings for different audio versions for the next chapter. Relative to the API origin. Null if this is the last chapter in the translation."
754
+ }),
755
+ /**
756
+ * The links to the audio timings for different audio versions for the previous chapter.
757
+ * Null if this is the first chapter in the translation.
758
+ */
759
+ previousChapterAudioTimings: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).nullable().meta({
760
+ description: "The links to the audio timings for different audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation."
761
+ }),
762
+ /**
763
+ * The link to the previous chapter.
764
+ * Null if this is the first chapter in the translation.
765
+ */
766
+ previousChapterApiLink: import_zod.z.string().nullable().meta({
767
+ description: "The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation."
768
+ }),
769
+ /**
770
+ * The reference for the previous chapter.
771
+ * Null if this is the first chapter in the translation.
772
+ */
773
+ previousChapterReference: TranslationChapterReferenceSchema.nullable().meta({
774
+ description: "The reference for the previous chapter. Null if this is the first chapter in the translation."
775
+ }),
776
+ /**
777
+ * The links to the audio versions for the previous chapter.
778
+ * Null if this is the first chapter in the translation.
779
+ */
780
+ previousChapterAudioLinks: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).nullable().meta({
781
+ description: "The links to the audio versions for the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation."
782
+ }),
783
+ /**
784
+ * The link to the word-level annotations for the chapter.
785
+ * Omitted if the chapter doesn't have any word-level annotations.
786
+ */
787
+ thisChapterWordsLink: import_zod.z.string().optional().meta({
788
+ description: "The link to the word-level annotations for this chapter. Relative to the API origin. Omitted if the chapter doesn't have any word-level annotations."
789
+ }),
790
+ /**
791
+ * The link to the word-level annotations for the next chapter.
792
+ * Omitted if this is the last chapter in the translation, or if the next
793
+ * chapter doesn't have any word-level annotations.
794
+ */
795
+ nextChapterWordsLink: import_zod.z.string().optional().meta({
796
+ description: "The link to the word-level annotations for the next chapter. Relative to the API origin. Omitted if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations."
797
+ }),
798
+ /**
799
+ * The link to the word-level annotations for the previous chapter.
800
+ * Omitted if this is the first chapter in the translation, or if the
801
+ * previous chapter doesn't have any word-level annotations.
802
+ */
803
+ previousChapterWordsLink: import_zod.z.string().optional().meta({
804
+ description: "The link to the word-level annotations for the previous chapter. Relative to the API origin. Omitted if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations."
805
+ }),
806
+ /**
807
+ * The number of verses that the chapter contains.
808
+ */
809
+ numberOfVerses: import_zod.z.number().meta({
810
+ description: "The number of verses that the chapter contains."
811
+ }),
812
+ /**
813
+ * The link to the simplified version of this chapter.
814
+ * Omitted if simplified chapters were not generated.
815
+ */
816
+ simpleChapterApiLink: import_zod.z.string().optional().meta({
817
+ description: "The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available."
818
+ })
819
+ }).meta({
820
+ id: "ApiTranslationBookChapter",
821
+ description: "Defines an interface that contains information about a book chapter in a translation."
822
+ });
823
+ const ApiSimpleTranslationBookChapterSchema = ApiTranslationBookChapterSchema.omit({
824
+ chapter: true,
825
+ simpleChapterApiLink: true
826
+ }).extend({
827
+ /**
828
+ * The simplified information for the chapter.
829
+ */
830
+ chapter: import_zod.z.lazy(() => import_common_types.SimpleChapterDataSchema).meta({
831
+ description: "The simplified information for the chapter. Each verse contains a single text string, and the footnotes and formatting are represented by offsets into that string."
832
+ }),
833
+ /**
834
+ * The link to the regular version of this chapter.
835
+ */
836
+ fullChapterApiLink: import_zod.z.string().meta({
837
+ description: "The API link to the regular (non-simplified) version of this chapter. Relative to the API origin."
838
+ })
839
+ }).meta({
840
+ id: "ApiSimpleTranslationBookChapter",
841
+ description: "Defines an interface that contains information about a book chapter in a translation, using the simplified chapter format."
842
+ });
843
+ const ApiCommentaryBookChapterSchema = import_common_types.CommentaryBookChapterSchema.extend({
844
+ /**
845
+ * The commentary information for the book chapter.
846
+ */
847
+ commentary: import_zod.z.lazy(() => ApiCommentarySchema).meta({
848
+ description: "The commentary information for the book chapter."
849
+ }),
850
+ /**
851
+ * The book information for the book chapter.
852
+ */
853
+ book: import_zod.z.lazy(() => ApiCommentaryBookSchema).meta({
854
+ description: "The book information for the book chapter."
855
+ }),
856
+ /**
857
+ * The link to this chapter.
858
+ */
859
+ thisChapterLink: import_zod.z.string().meta({
860
+ description: "The API link for this chapter. Relative to the API origin."
861
+ }),
862
+ thisChapterReference: CommentaryChapterReferenceSchema,
863
+ /**
864
+ * The link to the next chapter.
865
+ * Null if this is the last chapter in the translation.
866
+ */
867
+ nextChapterApiLink: import_zod.z.string().nullable().meta({
868
+ description: "The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary."
869
+ }),
870
+ nextChapterReference: CommentaryChapterReferenceSchema.nullable().meta({
871
+ description: "The reference for the next chapter. Null if this is the last chapter in the commentary."
872
+ }),
873
+ /**
874
+ * The link to the previous chapter.
875
+ * Null if this is the first chapter in the translation.
876
+ */
877
+ previousChapterApiLink: import_zod.z.string().nullable().meta({
878
+ description: "The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary."
879
+ }),
880
+ previousChapterReference: CommentaryChapterReferenceSchema.nullable().meta({
881
+ description: "The reference for the previous chapter. Null if this is the first chapter in the commentary."
882
+ }),
883
+ /**
884
+ * The number of verses that the chapter contains.
885
+ */
886
+ numberOfVerses: import_zod.z.number().meta({
887
+ description: "The number of verses that the chapter contains."
888
+ }),
889
+ /**
890
+ * The link to the simplified version of this chapter.
891
+ * Omitted if simplified chapters were not generated.
892
+ */
893
+ simpleChapterApiLink: import_zod.z.string().optional().meta({
894
+ description: "The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available."
895
+ })
896
+ }).meta({
897
+ id: "ApiCommentaryBookChapter",
898
+ description: "Defines a schema that contains information about a book chapter in a commentary."
899
+ });
900
+ const ApiSimpleCommentaryBookChapterSchema = ApiCommentaryBookChapterSchema.omit({
901
+ chapter: true,
902
+ simpleChapterApiLink: true
903
+ }).extend({
904
+ /**
905
+ * The simplified information for the chapter.
906
+ */
907
+ chapter: import_zod.z.lazy(() => import_common_types.SimpleCommentaryChapterDataSchema).meta({
908
+ description: "The simplified information for the chapter. Each verse contains a single text string, and the footnotes and formatting are represented by offsets into that string."
909
+ }),
910
+ /**
911
+ * The link to the regular version of this chapter.
912
+ */
913
+ fullChapterApiLink: import_zod.z.string().meta({
914
+ description: "The API link to the regular (non-simplified) version of this chapter. Relative to the API origin."
915
+ })
916
+ }).meta({
917
+ id: "ApiSimpleCommentaryBookChapter",
918
+ description: "Defines a schema that contains information about a book chapter in a commentary, using the simplified chapter format."
919
+ });
920
+ const ApiDatasetBookChapterSchema = import_common_types.DatasetBookChapterSchema.extend({
921
+ /**
922
+ * The dataset information for the book chapter.
923
+ */
924
+ dataset: import_zod.z.lazy(() => ApiDatasetSchema).meta({
925
+ description: "The dataset information for the book chapter."
926
+ }),
927
+ /**
928
+ * The book information for the book chapter.
929
+ */
930
+ book: import_zod.z.lazy(() => ApiDatasetBookSchema).meta({
931
+ description: "The book information for the book chapter."
932
+ }),
933
+ /**
934
+ * The link to this chapter.
935
+ */
936
+ thisChapterLink: import_zod.z.string().meta({
937
+ description: "The API link for this chapter. Relative to the API origin."
938
+ }),
939
+ thisChapterReference: DatasetChapterReferenceSchema,
940
+ /**
941
+ * The link to the next chapter.
942
+ * Null if this is the last chapter in the translation.
943
+ */
944
+ nextChapterApiLink: import_zod.z.string().nullable().meta({
945
+ description: "The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset."
946
+ }),
947
+ nextChapterReference: DatasetChapterReferenceSchema.nullable().meta({
948
+ description: "The reference for the next chapter. Null if this is the last chapter in the dataset."
949
+ }),
950
+ /**
951
+ * The link to the previous chapter.
952
+ * Null if this is the first chapter in the translation.
953
+ */
954
+ previousChapterApiLink: import_zod.z.string().nullable().meta({
955
+ description: "The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset."
956
+ }),
957
+ previousChapterReference: DatasetChapterReferenceSchema.nullable().meta({
958
+ description: "The reference for the previous chapter. Null if this is the first chapter in the dataset."
959
+ }),
960
+ /**
961
+ * The number of verses that the chapter contains.
962
+ */
963
+ numberOfVerses: import_zod.z.number().meta({
964
+ description: "The number of verses that the chapter contains."
965
+ }),
966
+ /**
967
+ * The number of references that the chapter contains.
968
+ */
969
+ numberOfReferences: import_zod.z.number().meta({
970
+ description: "The number of references that the chapter contains."
971
+ })
972
+ }).meta({
973
+ id: "ApiDatasetBookChapter",
974
+ description: "Defines a schema that contains information about a book chapter in a dataset."
975
+ });
976
+ const ApiTranslationBookChapterAudioSchema = import_zod.z.object({
977
+ /**
978
+ * The chapter that the audio is for.
979
+ */
980
+ chapter: import_zod.z.lazy(() => ApiTranslationBookChapterSchema).meta({
981
+ description: "The chapter that the audio is for."
982
+ }),
983
+ /**
984
+ * The link that the audio should be placed at.
985
+ */
986
+ link: import_zod.z.string().meta({
987
+ description: "The link that the audio should be placed at. Relative to the API origin."
988
+ }),
989
+ /**
990
+ * The original URL of the audio.
991
+ */
992
+ originalUrl: import_zod.z.string().meta({
993
+ description: "The original URL of the audio."
994
+ })
995
+ });
996
+ const ApiTranslationBookChapterAudioTimingsSchema = import_zod.z.object({
997
+ /**
998
+ * The ID of the translation.
999
+ */
1000
+ translationId: import_zod.z.string().meta({
1001
+ description: "The ID of the translation."
1002
+ }),
1003
+ /**
1004
+ * The ID of the book.
1005
+ */
1006
+ bookId: import_zod.z.string().meta({
1007
+ description: "The ID of the book."
1008
+ }),
1009
+ /**
1010
+ * The number of the chapter.
1011
+ */
1012
+ chapterNumber: import_zod.z.number().meta({
1013
+ description: "The number of the chapter."
1014
+ }),
1015
+ /**
1016
+ * The reader for the chapter.
1017
+ */
1018
+ reader: import_zod.z.string().meta({
1019
+ description: "The reader for the chapter."
1020
+ }),
1021
+ /**
1022
+ * The link to the audio for these timings.
1023
+ */
1024
+ audioLink: import_zod.z.string().meta({
1025
+ description: "The link to the audio for these timings."
1026
+ }),
1027
+ /**
1028
+ * The link to the information for this chapter.
1029
+ */
1030
+ thisChapterLink: import_zod.z.string().meta({
1031
+ description: "The link to the information for this chapter."
1032
+ }),
1033
+ /**
1034
+ * The link to the information for the next chapter.
1035
+ * Null if this is the last chapter in the translation.
1036
+ */
1037
+ nextChapterLink: import_zod.z.string().nullable().meta({
1038
+ description: "The link to the information for the next chapter. Null if this is the last chapter in the translation."
1039
+ }),
1040
+ /**
1041
+ * The link to the information for the previous chapter.
1042
+ * Null if this is the first chapter in the translation.
1043
+ */
1044
+ previousChapterLink: import_zod.z.string().nullable().meta({
1045
+ description: "The link to the information for the previous chapter. Null if this is the first chapter in the translation."
1046
+ }),
1047
+ /**
1048
+ * The link to this audio timings file.
1049
+ */
1050
+ thisChapterAudioTimingsLink: import_zod.z.string().meta({
1051
+ description: "The link to this audio timings file."
1052
+ }),
1053
+ /**
1054
+ * The link to the timings for the next chapter.
1055
+ * Null if this is the last chapter in the translation.
1056
+ */
1057
+ nextChapterAudioTimingsLink: import_zod.z.string().nullable().meta({
1058
+ description: "The link to the timings for the next chapter. Null if this is the last chapter in the translation."
1059
+ }),
1060
+ /**
1061
+ * The link to the timings for the previous chapter.
1062
+ * Null if this is the first chapter in the translation.
1063
+ */
1064
+ previousChapterAudioTimingsLink: import_zod.z.string().nullable().meta({
1065
+ description: "The link to the timings for the previous chapter. Null if this is the first chapter in the translation."
1066
+ }),
1067
+ /**
1068
+ * The times in seconds at which each verse starts, in order.
1069
+ */
1070
+ verses: import_zod.z.array(import_zod.z.number()).meta({
1071
+ description: "The times in seconds at which each verse starts, in order. The first number (index 0) is the time in the recording at which the first verse starts."
1072
+ })
1073
+ }).meta({
1074
+ id: "ApiTranslationBookChapterAudioTimings",
1075
+ description: "Defines an interface that contains the audio timings for a book chapter, for a specific reader."
1076
+ });
1077
+ const ApiTranslationBookChapterWordsSchema = import_zod.z.object({
1078
+ /**
1079
+ * The ID of the translation.
1080
+ */
1081
+ translationId: import_zod.z.string().meta({
1082
+ description: "The ID of the translation."
1083
+ }),
1084
+ /**
1085
+ * The ID of the book.
1086
+ */
1087
+ bookId: import_zod.z.string().meta({
1088
+ description: "The ID of the book."
1089
+ }),
1090
+ /**
1091
+ * The number of the chapter.
1092
+ */
1093
+ chapterNumber: import_zod.z.number().meta({
1094
+ description: "The number of the chapter."
1095
+ }),
1096
+ /**
1097
+ * The link to the information for this chapter.
1098
+ */
1099
+ thisChapterLink: import_zod.z.string().meta({
1100
+ description: "The link to the information for this chapter."
1101
+ }),
1102
+ /**
1103
+ * The link to the information for the next chapter.
1104
+ * Null if this is the last chapter in the translation.
1105
+ */
1106
+ nextChapterLink: import_zod.z.string().nullable().meta({
1107
+ description: "The link to the information for the next chapter. Null if this is the last chapter in the translation."
1108
+ }),
1109
+ /**
1110
+ * The link to the information for the previous chapter.
1111
+ * Null if this is the first chapter in the translation.
1112
+ */
1113
+ previousChapterLink: import_zod.z.string().nullable().meta({
1114
+ description: "The link to the information for the previous chapter. Null if this is the first chapter in the translation."
1115
+ }),
1116
+ /**
1117
+ * The link to this words file.
1118
+ */
1119
+ thisChapterWordsLink: import_zod.z.string().meta({
1120
+ description: "The link to this words file."
1121
+ }),
1122
+ /**
1123
+ * The link to the words for the next chapter.
1124
+ * Null if this is the last chapter in the translation, or if the next chapter
1125
+ * doesn't have any word-level annotations.
1126
+ */
1127
+ nextChapterWordsLink: import_zod.z.string().nullable().meta({
1128
+ description: "The link to the words for the next chapter. Null if this is the last chapter in the translation, or if the next chapter doesn't have any word-level annotations."
1129
+ }),
1130
+ /**
1131
+ * The link to the words for the previous chapter.
1132
+ * Null if this is the first chapter in the translation, or if the previous
1133
+ * chapter doesn't have any word-level annotations.
1134
+ */
1135
+ previousChapterWordsLink: import_zod.z.string().nullable().meta({
1136
+ description: "The link to the words for the previous chapter. Null if this is the first chapter in the translation, or if the previous chapter doesn't have any word-level annotations."
1137
+ }),
1138
+ /**
1139
+ * The annotated words for each verse in the chapter.
1140
+ */
1141
+ verses: import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.lazy(() => import_common_types.ChapterWordSchema))).meta({
1142
+ description: "The annotated words for each verse in the chapter, keyed by verse number. Each list is in the order that the words occur in the verse."
1143
+ })
1144
+ }).meta({
1145
+ id: "ApiTranslationBookChapterWords",
1146
+ description: "Defines an interface that contains the word-level annotations for a book chapter."
1147
+ });
1148
+ const ApiSimpleTranslationBookChapterWordsSchema = ApiTranslationBookChapterWordsSchema.extend({
1149
+ /**
1150
+ * The annotated words for each verse in the chapter.
1151
+ */
1152
+ verses: import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.lazy(() => import_common_types.SimpleChapterWordSchema))).meta({
1153
+ description: "The annotated words for each verse in the chapter, keyed by verse number. Each list is in the order that the words occur in the verse. The offsets are into the text of the simplified verse."
1154
+ })
1155
+ }).meta({
1156
+ id: "ApiSimpleTranslationBookChapterWords",
1157
+ description: "Defines an interface that contains the word-level annotations for a book chapter, with their offsets remapped onto the text of each simplified verse."
1158
+ });
1159
+ const ApiCommentaryProfileContentSchema = import_zod.z.object({
1160
+ /**
1161
+ * The commentary information for the profile.
1162
+ */
1163
+ commentary: import_zod.z.lazy(() => ApiCommentarySchema).meta({
1164
+ description: "The commentary information for the profile."
1165
+ }),
1166
+ /**
1167
+ * The information about the profile.
1168
+ */
1169
+ profile: import_zod.z.lazy(() => ApiCommentaryProfileSchema).meta({
1170
+ description: "The information about the profile."
1171
+ }),
1172
+ /**
1173
+ * The content of the profile.
1174
+ */
1175
+ content: import_zod.z.array(import_zod.z.string()).meta({
1176
+ description: "The content of the profile. This is an array of strings, where each string is a paragraph of the profile content."
1177
+ })
1178
+ });
39
1179
  function generateApiForDataset(dataset, options = {}) {
40
1180
  const { useCommonName, pathPrefix } = options;
41
1181
  const apiPathPrefix = pathPrefix ? pathPrefix : "";
1182
+ const generateSimpleChapterFiles = !!options.generateSimpleChapterFiles;
42
1183
  let api = {
43
1184
  availableTranslations: {
44
1185
  translations: []
@@ -46,7 +1187,10 @@ function generateApiForDataset(dataset, options = {}) {
46
1187
  translationBooks: [],
47
1188
  translationBookChapters: [],
48
1189
  translationBookChapterAudio: [],
1190
+ translationBookChapterAudioTimings: [],
1191
+ translationBookChapterWords: [],
49
1192
  translationComplete: [],
1193
+ simpleTranslationComplete: [],
50
1194
  availableCommentaries: {
51
1195
  commentaries: []
52
1196
  },
@@ -56,6 +1200,11 @@ function generateApiForDataset(dataset, options = {}) {
56
1200
  commentaryProfileContents: [],
57
1201
  pathPrefix: apiPathPrefix
58
1202
  };
1203
+ if (generateSimpleChapterFiles) {
1204
+ api.simpleTranslationBookChapters = [];
1205
+ api.simpleTranslationBookChapterWords = [];
1206
+ api.simpleCommentaryBookChapters = [];
1207
+ }
59
1208
  const getNativeName = options.getNativeName;
60
1209
  const getEnglishName = options.getEnglishName;
61
1210
  for (let { books, ...translation } of dataset.translations) {
@@ -76,6 +1225,11 @@ function generateApiForDataset(dataset, options = {}) {
76
1225
  apiPathPrefix
77
1226
  ),
78
1227
  completeTranslationApiLink: options.generateCompleteTranslationFiles ? completeTranslationApiLink(translation.id, apiPathPrefix) : void 0,
1228
+ simpleCompleteTranslationApiLink: options.generateCompleteTranslationFiles ? completeTranslationApiLink(
1229
+ translation.id,
1230
+ apiPathPrefix,
1231
+ SIMPLE_JSON_EXTENSION
1232
+ ) : void 0,
79
1233
  numberOfBooks,
80
1234
  totalNumberOfChapters: 0,
81
1235
  totalNumberOfVerses: 0,
@@ -90,9 +1244,12 @@ function generateApiForDataset(dataset, options = {}) {
90
1244
  books: []
91
1245
  };
92
1246
  let translationChapters = [];
1247
+ let pendingAudioTimings = [];
1248
+ let rawAudioTimingsByChapter = /* @__PURE__ */ new Map();
1249
+ let rawWordsByChapter = /* @__PURE__ */ new Map();
93
1250
  for (let { chapters, ...book } of books) {
94
- const firstChapterNumber = chapters[0].chapter.number;
95
- const lastChapterNumber = chapters[chapters.length - 1].chapter.number;
1251
+ const firstChapterNumber = chapters[0]?.chapter.number;
1252
+ const lastChapterNumber = chapters[chapters.length - 1]?.chapter.number;
96
1253
  const apiBook = {
97
1254
  ...book,
98
1255
  firstChapterNumber,
@@ -103,6 +1260,11 @@ function generateApiForDataset(dataset, options = {}) {
103
1260
  "json",
104
1261
  apiPathPrefix
105
1262
  ),
1263
+ firstChapterReference: {
1264
+ translationId: translation.id,
1265
+ book: book.id,
1266
+ chapter: firstChapterNumber
1267
+ },
106
1268
  lastChapterNumber,
107
1269
  lastChapterApiLink: bookChapterApiLink(
108
1270
  translation.id,
@@ -111,11 +1273,22 @@ function generateApiForDataset(dataset, options = {}) {
111
1273
  "json",
112
1274
  apiPathPrefix
113
1275
  ),
1276
+ lastChapterReference: {
1277
+ translationId: translation.id,
1278
+ book: book.id,
1279
+ chapter: lastChapterNumber
1280
+ },
114
1281
  numberOfChapters: chapters.length,
115
1282
  totalNumberOfVerses: 0
116
1283
  };
117
- for (let { chapter, thisChapterAudioLinks } of chapters) {
1284
+ for (let {
1285
+ chapter,
1286
+ thisChapterAudioLinks,
1287
+ thisChapterAudioTimings,
1288
+ thisChapterWords
1289
+ } of chapters) {
118
1290
  const audio = {};
1291
+ const audioTimings = {};
119
1292
  const apiBookChapter = {
120
1293
  translation: apiTranslation,
121
1294
  book: apiBook,
@@ -127,12 +1300,29 @@ function generateApiForDataset(dataset, options = {}) {
127
1300
  "json",
128
1301
  apiPathPrefix
129
1302
  ),
1303
+ thisChapterReference: {
1304
+ translationId: translation.id,
1305
+ book: book.id,
1306
+ chapter: chapter.number
1307
+ },
130
1308
  thisChapterAudioLinks: audio,
131
1309
  nextChapterApiLink: null,
1310
+ nextChapterReference: null,
132
1311
  nextChapterAudioLinks: null,
133
1312
  previousChapterApiLink: null,
1313
+ previousChapterReference: null,
134
1314
  previousChapterAudioLinks: null,
135
- numberOfVerses: 0
1315
+ thisChapterAudioTimings: audioTimings,
1316
+ nextChapterAudioTimings: null,
1317
+ previousChapterAudioTimings: null,
1318
+ numberOfVerses: 0,
1319
+ simpleChapterApiLink: generateSimpleChapterFiles ? bookChapterApiLink(
1320
+ translation.id,
1321
+ getBookLink(book),
1322
+ chapter.number,
1323
+ SIMPLE_JSON_EXTENSION,
1324
+ apiPathPrefix
1325
+ ) : void 0
136
1326
  };
137
1327
  for (let reader in thisChapterAudioLinks) {
138
1328
  if (options.generateAudioFiles) {
@@ -153,6 +1343,34 @@ function generateApiForDataset(dataset, options = {}) {
153
1343
  audio[reader] = thisChapterAudioLinks[reader];
154
1344
  }
155
1345
  }
1346
+ rawAudioTimingsByChapter.set(
1347
+ apiBookChapter,
1348
+ thisChapterAudioTimings
1349
+ );
1350
+ if (thisChapterWords) {
1351
+ apiBookChapter.thisChapterWordsLink = bookChapterWordsApiLink(
1352
+ translation.id,
1353
+ getBookLink(book),
1354
+ chapter.number,
1355
+ apiPathPrefix
1356
+ );
1357
+ rawWordsByChapter.set(apiBookChapter, thisChapterWords);
1358
+ }
1359
+ for (let reader in thisChapterAudioTimings) {
1360
+ const verses = thisChapterAudioTimings[reader];
1361
+ audioTimings[reader] = bookChapterAudioTimingsApiLink(
1362
+ translation.id,
1363
+ getBookLink(book),
1364
+ chapter.number,
1365
+ reader,
1366
+ apiPathPrefix
1367
+ );
1368
+ pendingAudioTimings.push({
1369
+ reader,
1370
+ verses,
1371
+ apiBookChapter
1372
+ });
1373
+ }
156
1374
  for (let c of chapter.content) {
157
1375
  if (c.type === "verse") {
158
1376
  apiBookChapter.numberOfVerses++;
@@ -178,54 +1396,226 @@ function generateApiForDataset(dataset, options = {}) {
178
1396
  }
179
1397
  }
180
1398
  for (let i = 0; i < translationChapters.length; i++) {
1399
+ const currentChapter = translationChapters[i];
181
1400
  if (i > 0) {
182
- translationChapters[i].previousChapterApiLink = bookChapterApiLink(
1401
+ const previousChapter = translationChapters[i - 1];
1402
+ currentChapter.previousChapterApiLink = bookChapterApiLink(
183
1403
  translation.id,
184
- getBookLink(translationChapters[i - 1].book),
185
- translationChapters[i - 1].chapter.number,
1404
+ getBookLink(previousChapter.book),
1405
+ previousChapter.chapter.number,
186
1406
  "json",
187
1407
  apiPathPrefix
188
1408
  );
189
- translationChapters[i].previousChapterAudioLinks = translationChapters[i - 1].thisChapterAudioLinks;
1409
+ currentChapter.previousChapterReference = {
1410
+ translationId: translation.id,
1411
+ book: previousChapter.book.id,
1412
+ chapter: previousChapter.chapter.number
1413
+ };
1414
+ currentChapter.previousChapterAudioLinks = previousChapter.thisChapterAudioLinks;
1415
+ currentChapter.previousChapterAudioTimings = previousChapter.thisChapterAudioTimings;
1416
+ if (previousChapter.thisChapterWordsLink) {
1417
+ currentChapter.previousChapterWordsLink = previousChapter.thisChapterWordsLink;
1418
+ }
190
1419
  }
191
1420
  if (i < translationChapters.length - 1) {
192
- translationChapters[i].nextChapterApiLink = bookChapterApiLink(
1421
+ const nextChapter = translationChapters[i + 1];
1422
+ currentChapter.nextChapterApiLink = bookChapterApiLink(
193
1423
  translation.id,
194
- getBookLink(translationChapters[i + 1].book),
195
- translationChapters[i + 1].chapter.number,
1424
+ getBookLink(nextChapter.book),
1425
+ nextChapter.chapter.number,
196
1426
  "json",
197
1427
  apiPathPrefix
198
1428
  );
199
- translationChapters[i].nextChapterAudioLinks = translationChapters[i + 1].thisChapterAudioLinks;
1429
+ currentChapter.nextChapterReference = {
1430
+ translationId: translation.id,
1431
+ book: nextChapter.book.id,
1432
+ chapter: nextChapter.chapter.number
1433
+ };
1434
+ currentChapter.nextChapterAudioLinks = nextChapter.thisChapterAudioLinks;
1435
+ currentChapter.nextChapterAudioTimings = nextChapter.thisChapterAudioTimings;
1436
+ if (nextChapter.thisChapterWordsLink) {
1437
+ currentChapter.nextChapterWordsLink = nextChapter.thisChapterWordsLink;
1438
+ }
1439
+ }
1440
+ }
1441
+ const simplifiedChapters = /* @__PURE__ */ new Map();
1442
+ if (generateSimpleChapterFiles || options.generateCompleteTranslationFiles) {
1443
+ for (let chapter of translationChapters) {
1444
+ simplifiedChapters.set(
1445
+ chapter,
1446
+ (0, import_simple.simplifyChapter)(
1447
+ chapter.chapter,
1448
+ rawWordsByChapter.get(chapter)
1449
+ )
1450
+ );
200
1451
  }
201
1452
  }
1453
+ if (api.simpleTranslationBookChapters) {
1454
+ let hasSimpleWords2 = function(chapter) {
1455
+ const words = simplifiedChapters.get(chapter)?.words;
1456
+ return !!words && Object.keys(words).length > 0;
1457
+ };
1458
+ var hasSimpleWords = hasSimpleWords2;
1459
+ const simpleChapterLink = (chapter) => bookChapterApiLink(
1460
+ translation.id,
1461
+ getBookLink(chapter.book),
1462
+ chapter.chapter.number,
1463
+ SIMPLE_JSON_EXTENSION,
1464
+ apiPathPrefix
1465
+ );
1466
+ const simpleWordsLink = (chapter) => hasSimpleWords2(chapter) ? bookChapterWordsApiLink(
1467
+ translation.id,
1468
+ getBookLink(chapter.book),
1469
+ chapter.chapter.number,
1470
+ apiPathPrefix,
1471
+ SIMPLE_JSON_EXTENSION
1472
+ ) : void 0;
1473
+ for (let i = 0; i < translationChapters.length; i++) {
1474
+ const currentChapter = translationChapters[i];
1475
+ const {
1476
+ chapter,
1477
+ simpleChapterApiLink,
1478
+ thisChapterWordsLink,
1479
+ nextChapterWordsLink,
1480
+ previousChapterWordsLink,
1481
+ ...rest
1482
+ } = currentChapter;
1483
+ const previousChapter = translationChapters[i - 1];
1484
+ const nextChapter = translationChapters[i + 1];
1485
+ const simplified = simplifiedChapters.get(currentChapter);
1486
+ const simpleChapter = {
1487
+ ...rest,
1488
+ chapter: simplified.chapter,
1489
+ thisChapterLink: simpleChapterLink(currentChapter),
1490
+ fullChapterApiLink: rest.thisChapterLink,
1491
+ previousChapterApiLink: previousChapter ? simpleChapterLink(previousChapter) : null,
1492
+ nextChapterApiLink: nextChapter ? simpleChapterLink(nextChapter) : null
1493
+ };
1494
+ const thisWordsLink = simpleWordsLink(currentChapter);
1495
+ if (thisWordsLink) {
1496
+ simpleChapter.thisChapterWordsLink = thisWordsLink;
1497
+ api.simpleTranslationBookChapterWords?.push({
1498
+ translationId: translation.id,
1499
+ bookId: currentChapter.book.id,
1500
+ chapterNumber: currentChapter.chapter.number,
1501
+ thisChapterLink: simpleChapter.thisChapterLink,
1502
+ nextChapterLink: simpleChapter.nextChapterApiLink,
1503
+ previousChapterLink: simpleChapter.previousChapterApiLink,
1504
+ thisChapterWordsLink: thisWordsLink,
1505
+ nextChapterWordsLink: nextChapter ? simpleWordsLink(nextChapter) ?? null : null,
1506
+ previousChapterWordsLink: previousChapter ? simpleWordsLink(previousChapter) ?? null : null,
1507
+ verses: simplified.words
1508
+ });
1509
+ }
1510
+ const nextWordsLink = nextChapter ? simpleWordsLink(nextChapter) : void 0;
1511
+ if (nextWordsLink) {
1512
+ simpleChapter.nextChapterWordsLink = nextWordsLink;
1513
+ }
1514
+ const previousWordsLink = previousChapter ? simpleWordsLink(previousChapter) : void 0;
1515
+ if (previousWordsLink) {
1516
+ simpleChapter.previousChapterWordsLink = previousWordsLink;
1517
+ }
1518
+ api.simpleTranslationBookChapters.push(simpleChapter);
1519
+ }
1520
+ }
1521
+ for (let { reader, verses, apiBookChapter } of pendingAudioTimings) {
1522
+ api.translationBookChapterAudioTimings.push({
1523
+ translationId: translation.id,
1524
+ bookId: apiBookChapter.book.id,
1525
+ chapterNumber: apiBookChapter.chapter.number,
1526
+ reader,
1527
+ audioLink: apiBookChapter.thisChapterAudioLinks[reader] ?? "",
1528
+ thisChapterLink: apiBookChapter.thisChapterLink,
1529
+ nextChapterLink: apiBookChapter.nextChapterApiLink,
1530
+ previousChapterLink: apiBookChapter.previousChapterApiLink,
1531
+ thisChapterAudioTimingsLink: apiBookChapter.thisChapterAudioTimings[reader],
1532
+ nextChapterAudioTimingsLink: apiBookChapter.nextChapterAudioTimings?.[reader] ?? null,
1533
+ previousChapterAudioTimingsLink: apiBookChapter.previousChapterAudioTimings?.[reader] ?? null,
1534
+ verses
1535
+ });
1536
+ }
1537
+ for (let apiBookChapter of translationChapters) {
1538
+ const words = rawWordsByChapter.get(apiBookChapter);
1539
+ if (!words || !apiBookChapter.thisChapterWordsLink) {
1540
+ continue;
1541
+ }
1542
+ api.translationBookChapterWords.push({
1543
+ translationId: translation.id,
1544
+ bookId: apiBookChapter.book.id,
1545
+ chapterNumber: apiBookChapter.chapter.number,
1546
+ thisChapterLink: apiBookChapter.thisChapterLink,
1547
+ nextChapterLink: apiBookChapter.nextChapterApiLink,
1548
+ previousChapterLink: apiBookChapter.previousChapterApiLink,
1549
+ thisChapterWordsLink: apiBookChapter.thisChapterWordsLink,
1550
+ nextChapterWordsLink: apiBookChapter.nextChapterWordsLink ?? null,
1551
+ previousChapterWordsLink: apiBookChapter.previousChapterWordsLink ?? null,
1552
+ verses: words
1553
+ });
1554
+ }
202
1555
  api.availableTranslations.translations.push(apiTranslation);
203
1556
  api.translationBooks.push(translationBooks);
204
1557
  if (options.generateCompleteTranslationFiles) {
1558
+ const completeBooks = translationBooks.books.map((book) => ({
1559
+ book,
1560
+ chapters: translationChapters.filter(
1561
+ (ch) => ch.book.id === book.id
1562
+ )
1563
+ }));
1564
+ const completeBook = (book, chapters) => ({
1565
+ id: book.id,
1566
+ name: book.name,
1567
+ commonName: book.commonName,
1568
+ title: book.title,
1569
+ order: book.order,
1570
+ numberOfChapters: book.numberOfChapters,
1571
+ totalNumberOfVerses: book.totalNumberOfVerses,
1572
+ isApocryphal: book.isApocryphal,
1573
+ chapters
1574
+ });
1575
+ const completeChapter = (chapter) => ({
1576
+ numberOfVerses: chapter.numberOfVerses,
1577
+ thisChapterAudioLinks: chapter.thisChapterAudioLinks,
1578
+ // The complete files contain the raw audio timings rather than links
1579
+ // to them, since the point is to have everything in one file.
1580
+ thisChapterAudioTimings: rawAudioTimingsByChapter.get(chapter) ?? {}
1581
+ });
205
1582
  const completeTranslation = {
206
1583
  translation: apiTranslation,
207
- books: translationBooks.books.map((book) => {
208
- const bookChapters = translationChapters.filter(
209
- (ch) => ch.book.id === book.id
210
- );
211
- return {
212
- id: book.id,
213
- name: book.name,
214
- commonName: book.commonName,
215
- title: book.title,
216
- order: book.order,
217
- numberOfChapters: book.numberOfChapters,
218
- totalNumberOfVerses: book.totalNumberOfVerses,
219
- isApocryphal: book.isApocryphal,
220
- chapters: bookChapters.map((ch) => ({
221
- numberOfVerses: ch.numberOfVerses,
222
- thisChapterAudioLinks: ch.thisChapterAudioLinks,
223
- chapter: ch.chapter
224
- }))
225
- };
226
- })
1584
+ books: completeBooks.map(
1585
+ ({ book, chapters }) => completeBook(
1586
+ book,
1587
+ chapters.map((ch) => {
1588
+ const words = rawWordsByChapter.get(ch);
1589
+ return {
1590
+ ...completeChapter(ch),
1591
+ // The complete files also contain the word annotations
1592
+ // themselves rather than links to them.
1593
+ ...words ? { thisChapterWords: words } : {},
1594
+ chapter: ch.chapter
1595
+ };
1596
+ })
1597
+ )
1598
+ )
227
1599
  };
228
1600
  api.translationComplete.push(completeTranslation);
1601
+ const simpleCompleteTranslation = {
1602
+ translation: apiTranslation,
1603
+ books: completeBooks.map(
1604
+ ({ book, chapters }) => completeBook(
1605
+ book,
1606
+ chapters.map((ch) => {
1607
+ const simplified = simplifiedChapters.get(ch);
1608
+ const hasWords = Object.keys(simplified.words).length > 0;
1609
+ return {
1610
+ ...completeChapter(ch),
1611
+ ...hasWords ? { thisChapterWords: simplified.words } : {},
1612
+ chapter: simplified.chapter
1613
+ };
1614
+ })
1615
+ )
1616
+ )
1617
+ };
1618
+ api.simpleTranslationComplete.push(simpleCompleteTranslation);
229
1619
  }
230
1620
  }
231
1621
  for (let { books, profiles, ...commentary } of dataset.commentaries) {
@@ -270,6 +1660,11 @@ function generateApiForDataset(dataset, options = {}) {
270
1660
  "json",
271
1661
  apiPathPrefix
272
1662
  ) : null,
1663
+ firstChapterReference: firstChapterNumber ? {
1664
+ commentaryId: commentary.id,
1665
+ book: book.id,
1666
+ chapter: firstChapterNumber
1667
+ } : null,
273
1668
  lastChapterNumber,
274
1669
  lastChapterApiLink: lastChapterNumber ? bookCommentaryChapterApiLink(
275
1670
  commentary.id,
@@ -278,6 +1673,11 @@ function generateApiForDataset(dataset, options = {}) {
278
1673
  "json",
279
1674
  apiPathPrefix
280
1675
  ) : null,
1676
+ lastChapterReference: lastChapterNumber ? {
1677
+ commentaryId: commentary.id,
1678
+ book: book.id,
1679
+ chapter: lastChapterNumber
1680
+ } : null,
281
1681
  numberOfChapters: chapters.length,
282
1682
  totalNumberOfVerses: 0
283
1683
  };
@@ -293,9 +1693,23 @@ function generateApiForDataset(dataset, options = {}) {
293
1693
  "json",
294
1694
  apiPathPrefix
295
1695
  ),
1696
+ thisChapterReference: {
1697
+ commentaryId: commentary.id,
1698
+ book: book.id,
1699
+ chapter: chapter.number
1700
+ },
296
1701
  nextChapterApiLink: null,
1702
+ nextChapterReference: null,
297
1703
  previousChapterApiLink: null,
298
- numberOfVerses: 0
1704
+ previousChapterReference: null,
1705
+ numberOfVerses: 0,
1706
+ simpleChapterApiLink: generateSimpleChapterFiles ? bookCommentaryChapterApiLink(
1707
+ commentary.id,
1708
+ getBookLink(book),
1709
+ chapter.number,
1710
+ SIMPLE_JSON_EXTENSION,
1711
+ apiPathPrefix
1712
+ ) : void 0
299
1713
  };
300
1714
  for (let c of chapter.content) {
301
1715
  if (c.type === "verse") {
@@ -349,6 +1763,11 @@ function generateApiForDataset(dataset, options = {}) {
349
1763
  "json",
350
1764
  apiPathPrefix
351
1765
  );
1766
+ commentaryChapters[i].previousChapterReference = {
1767
+ commentaryId: commentary.id,
1768
+ book: commentaryChapters[i - 1].book.id,
1769
+ chapter: commentaryChapters[i - 1].chapter.number
1770
+ };
352
1771
  }
353
1772
  if (i < commentaryChapters.length - 1) {
354
1773
  commentaryChapters[i].nextChapterApiLink = bookCommentaryChapterApiLink(
@@ -358,6 +1777,33 @@ function generateApiForDataset(dataset, options = {}) {
358
1777
  "json",
359
1778
  apiPathPrefix
360
1779
  );
1780
+ commentaryChapters[i].nextChapterReference = {
1781
+ commentaryId: commentary.id,
1782
+ book: commentaryChapters[i + 1].book.id,
1783
+ chapter: commentaryChapters[i + 1].chapter.number
1784
+ };
1785
+ }
1786
+ }
1787
+ if (api.simpleCommentaryBookChapters) {
1788
+ const simpleChapterLink = (chapter) => bookCommentaryChapterApiLink(
1789
+ commentary.id,
1790
+ getBookLink(chapter.book),
1791
+ chapter.chapter.number,
1792
+ SIMPLE_JSON_EXTENSION,
1793
+ apiPathPrefix
1794
+ );
1795
+ for (let i = 0; i < commentaryChapters.length; i++) {
1796
+ const { chapter, simpleChapterApiLink, ...currentChapter } = commentaryChapters[i];
1797
+ const previousChapter = commentaryChapters[i - 1];
1798
+ const nextChapter = commentaryChapters[i + 1];
1799
+ api.simpleCommentaryBookChapters.push({
1800
+ ...currentChapter,
1801
+ chapter: (0, import_simple.simplifyCommentaryChapter)(chapter),
1802
+ thisChapterLink: simpleChapterLink(commentaryChapters[i]),
1803
+ fullChapterApiLink: currentChapter.thisChapterLink,
1804
+ previousChapterApiLink: previousChapter ? simpleChapterLink(previousChapter) : null,
1805
+ nextChapterApiLink: nextChapter ? simpleChapterLink(nextChapter) : null
1806
+ });
361
1807
  }
362
1808
  }
363
1809
  api.availableCommentaries.commentaries.push(apiCommentary);
@@ -397,6 +1843,11 @@ function generateApiForDataset(dataset, options = {}) {
397
1843
  "json",
398
1844
  apiPathPrefix
399
1845
  ),
1846
+ firstChapterReference: {
1847
+ datasetId: datasetInfo.id,
1848
+ book: book.id,
1849
+ chapter: firstChapterNumber
1850
+ },
400
1851
  lastChapterNumber,
401
1852
  lastChapterApiLink: bookDatasetChapterApiLink(
402
1853
  datasetInfo.id,
@@ -405,6 +1856,11 @@ function generateApiForDataset(dataset, options = {}) {
405
1856
  "json",
406
1857
  apiPathPrefix
407
1858
  ),
1859
+ lastChapterReference: {
1860
+ datasetId: datasetInfo.id,
1861
+ book: book.id,
1862
+ chapter: lastChapterNumber
1863
+ },
408
1864
  numberOfChapters: chapters.length,
409
1865
  totalNumberOfVerses: 0,
410
1866
  totalNumberOfReferences: 0
@@ -421,8 +1877,15 @@ function generateApiForDataset(dataset, options = {}) {
421
1877
  "json",
422
1878
  apiPathPrefix
423
1879
  ),
1880
+ thisChapterReference: {
1881
+ datasetId: datasetInfo.id,
1882
+ book: book.id,
1883
+ chapter: chapter.number
1884
+ },
424
1885
  nextChapterApiLink: null,
1886
+ nextChapterReference: null,
425
1887
  previousChapterApiLink: null,
1888
+ previousChapterReference: null,
426
1889
  numberOfVerses: chapter.content.length,
427
1890
  numberOfReferences: 0
428
1891
  };
@@ -451,6 +1914,11 @@ function generateApiForDataset(dataset, options = {}) {
451
1914
  "json",
452
1915
  apiPathPrefix
453
1916
  );
1917
+ datasetChapters[i].previousChapterReference = {
1918
+ datasetId: datasetInfo.id,
1919
+ book: datasetChapters[i - 1].book.id,
1920
+ chapter: datasetChapters[i - 1].chapter.number
1921
+ };
454
1922
  }
455
1923
  if (i < datasetChapters.length - 1) {
456
1924
  datasetChapters[i].nextChapterApiLink = bookDatasetChapterApiLink(
@@ -460,6 +1928,11 @@ function generateApiForDataset(dataset, options = {}) {
460
1928
  "json",
461
1929
  apiPathPrefix
462
1930
  );
1931
+ datasetChapters[i].nextChapterReference = {
1932
+ datasetId: datasetInfo.id,
1933
+ book: datasetChapters[i + 1].book.id,
1934
+ chapter: datasetChapters[i + 1].chapter.number
1935
+ };
463
1936
  }
464
1937
  }
465
1938
  if (!api.availableDatasets) {
@@ -498,9 +1971,21 @@ function generateFilesForApi(api) {
498
1971
  for (let bookChapter of api.translationBookChapters) {
499
1972
  files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));
500
1973
  }
1974
+ for (let bookChapter of api.simpleTranslationBookChapters ?? []) {
1975
+ files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));
1976
+ }
501
1977
  for (let audio of api.translationBookChapterAudio) {
502
1978
  files.push(downloadedFile(audio.link, audio.originalUrl));
503
1979
  }
1980
+ for (let timings of api.translationBookChapterAudioTimings) {
1981
+ files.push(jsonFile(timings.thisChapterAudioTimingsLink, timings));
1982
+ }
1983
+ for (let words of api.translationBookChapterWords) {
1984
+ files.push(jsonFile(words.thisChapterWordsLink, words));
1985
+ }
1986
+ for (let words of api.simpleTranslationBookChapterWords ?? []) {
1987
+ files.push(jsonFile(words.thisChapterWordsLink, words));
1988
+ }
504
1989
  for (let complete of api.translationComplete) {
505
1990
  if (complete.translation.completeTranslationApiLink) {
506
1991
  files.push(
@@ -511,6 +1996,16 @@ function generateFilesForApi(api) {
511
1996
  );
512
1997
  }
513
1998
  }
1999
+ for (let complete of api.simpleTranslationComplete) {
2000
+ if (complete.translation.simpleCompleteTranslationApiLink) {
2001
+ files.push(
2002
+ jsonFile(
2003
+ complete.translation.simpleCompleteTranslationApiLink,
2004
+ complete
2005
+ )
2006
+ );
2007
+ }
2008
+ }
514
2009
  files.push(
515
2010
  jsonFile(
516
2011
  `${api.pathPrefix}/api/available_commentaries.json`,
@@ -542,6 +2037,9 @@ function generateFilesForApi(api) {
542
2037
  for (let bookChapter of api.commentaryBookChapters) {
543
2038
  files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));
544
2039
  }
2040
+ for (let bookChapter of api.simpleCommentaryBookChapters ?? []) {
2041
+ files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));
2042
+ }
545
2043
  if (api.availableDatasets) {
546
2044
  files.push(
547
2045
  jsonFile(
@@ -577,8 +2075,8 @@ async function* generateOutputFilesFromDatasets(datasets, options) {
577
2075
  function listOfBooksApiLink(translationId, prefix = "") {
578
2076
  return `${prefix}/api/${translationId}/books.json`;
579
2077
  }
580
- function completeTranslationApiLink(translationId, prefix = "") {
581
- return `${prefix}/api/${translationId}/complete.json`;
2078
+ function completeTranslationApiLink(translationId, prefix = "", extension = "json") {
2079
+ return `${prefix}/api/${translationId}/complete.${extension}`;
582
2080
  }
583
2081
  function listOfCommentaryBooksApiLink(commentaryId, prefix = "") {
584
2082
  return `${prefix}/api/c/${commentaryId}/books.json`;
@@ -586,6 +2084,7 @@ function listOfCommentaryBooksApiLink(commentaryId, prefix = "") {
586
2084
  function listOfDatasetBooksApiLink(datasetId, prefix = "") {
587
2085
  return `${prefix}/api/d/${datasetId}/books.json`;
588
2086
  }
2087
+ const SIMPLE_JSON_EXTENSION = "simple.json";
589
2088
  function bookChapterApiLink(translationId, commonName, chapterNumber, extension, prefix = "") {
590
2089
  return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(
591
2090
  commonName
@@ -601,6 +2100,16 @@ function bookChapterAudioApiLink(translationId, bookId, chapterNumber, reader, p
601
2100
  bookId
602
2101
  )}/${chapterNumber}.${reader}.mp3`;
603
2102
  }
2103
+ function bookChapterAudioTimingsApiLink(translationId, bookId, chapterNumber, reader, prefix = "") {
2104
+ return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(
2105
+ bookId
2106
+ )}/${chapterNumber}.${reader}.audioTimings.json`;
2107
+ }
2108
+ function bookChapterWordsApiLink(translationId, bookId, chapterNumber, prefix = "", extension = "json") {
2109
+ return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(
2110
+ bookId
2111
+ )}/${chapterNumber}.words.${extension}`;
2112
+ }
604
2113
  function bookDatasetChapterApiLink(translationId, commonName, chapterNumber, extension, prefix = "") {
605
2114
  return `${prefix}/api/d/${translationId}/${replaceSpacesWithUnderscores(
606
2115
  commonName
@@ -632,8 +2141,44 @@ function replaceSpacesWithUnderscores(str) {
632
2141
  }
633
2142
  // Annotate the CommonJS export names for ESM import in node:
634
2143
  0 && (module.exports = {
2144
+ ApiAvailableCommentariesSchema,
2145
+ ApiAvailableDatasetsSchema,
2146
+ ApiAvailableTranslationsSchema,
2147
+ ApiCommentaryBookChapterSchema,
2148
+ ApiCommentaryBookSchema,
2149
+ ApiCommentaryBooksSchema,
2150
+ ApiCommentaryProfileContentSchema,
2151
+ ApiCommentaryProfileSchema,
2152
+ ApiCommentaryProfilesSchema,
2153
+ ApiCommentarySchema,
2154
+ ApiDatasetBookChapterSchema,
2155
+ ApiDatasetBookSchema,
2156
+ ApiDatasetBooksSchema,
2157
+ ApiDatasetSchema,
2158
+ ApiSimpleCommentaryBookChapterSchema,
2159
+ ApiSimpleTranslationBookChapterSchema,
2160
+ ApiSimpleTranslationBookChapterWordsSchema,
2161
+ ApiSimpleTranslationCompleteBookSchema,
2162
+ ApiSimpleTranslationCompleteSchema,
2163
+ ApiTranslationBookChapterAudioSchema,
2164
+ ApiTranslationBookChapterAudioTimingsSchema,
2165
+ ApiTranslationBookChapterSchema,
2166
+ ApiTranslationBookChapterWordsSchema,
2167
+ ApiTranslationBookSchema,
2168
+ ApiTranslationBooksSchema,
2169
+ ApiTranslationCompleteBookSchema,
2170
+ ApiTranslationCompleteSchema,
2171
+ ApiTranslationSchema,
2172
+ CommentaryChapterReferenceSchema,
2173
+ DatasetChapterReferenceSchema,
2174
+ SIMPLE_JSON_EXTENSION,
2175
+ SimpleTranslationCompleteChapterSchema,
2176
+ TranslationChapterReferenceSchema,
2177
+ TranslationCompleteChapterSchema,
635
2178
  bookChapterApiLink,
636
2179
  bookChapterAudioApiLink,
2180
+ bookChapterAudioTimingsApiLink,
2181
+ bookChapterWordsApiLink,
637
2182
  bookCommentaryChapterApiLink,
638
2183
  bookDatasetChapterApiLink,
639
2184
  completeTranslationApiLink,