@helloao/tools 0.2.0 → 0.4.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/dist/cjs/generation/api.cjs +2213 -216
- package/dist/cjs/generation/api.cjs.map +3 -3
- package/dist/cjs/generation/audio.cjs +5 -5
- package/dist/cjs/generation/audio.cjs.map +1 -1
- package/dist/cjs/generation/book-order.cjs.map +1 -1
- package/dist/cjs/generation/common-types.cjs +782 -14
- package/dist/cjs/generation/common-types.cjs.map +2 -2
- package/dist/cjs/generation/dataset.cjs +13 -9
- package/dist/cjs/generation/dataset.cjs.map +2 -2
- package/dist/cjs/generation/index.cjs +8 -5
- package/dist/cjs/generation/index.cjs.map +2 -2
- package/dist/cjs/generation/simple.cjs +294 -0
- package/dist/cjs/generation/simple.cjs.map +7 -0
- package/dist/cjs/generation/theographic.cjs +446 -0
- package/dist/cjs/generation/theographic.cjs.map +7 -0
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/log.cjs.map +1 -1
- package/dist/cjs/parser/codex-parser.cjs +3 -3
- package/dist/cjs/parser/codex-parser.cjs.map +3 -3
- package/dist/cjs/parser/commentary-csv-parser.cjs +14 -3
- package/dist/cjs/parser/commentary-csv-parser.cjs.map +3 -3
- package/dist/cjs/parser/index.cjs +1 -1
- package/dist/cjs/parser/iterators.cjs.map +1 -1
- package/dist/cjs/parser/lockman-parser.cjs +1 -1
- package/dist/cjs/parser/lockman-parser.cjs.map +1 -1
- package/dist/cjs/parser/tyndale-xml-parser.cjs +1 -1
- package/dist/cjs/parser/tyndale-xml-parser.cjs.map +1 -1
- package/dist/cjs/parser/types.cjs.map +1 -1
- package/dist/cjs/parser/usfm-parser.cjs +2 -2
- package/dist/cjs/parser/usfm-parser.cjs.map +1 -1
- package/dist/cjs/parser/usx-parser.cjs +122 -26
- package/dist/cjs/parser/usx-parser.cjs.map +2 -2
- package/dist/cjs/parser/words.cjs +187 -0
- package/dist/cjs/parser/words.cjs.map +7 -0
- package/dist/cjs/utils.cjs +1 -1
- package/dist/esm/generation/api.js +2155 -214
- package/dist/esm/generation/api.js.map +3 -3
- package/dist/esm/generation/audio.js +1 -1
- package/dist/esm/generation/audio.js.map +1 -1
- package/dist/esm/generation/book-order.js.map +1 -1
- package/dist/esm/generation/common-types.js +738 -14
- package/dist/esm/generation/common-types.js.map +2 -2
- package/dist/esm/generation/dataset.js +6 -2
- package/dist/esm/generation/dataset.js.map +2 -2
- package/dist/esm/generation/index.js +2 -1
- package/dist/esm/generation/index.js.map +2 -2
- package/dist/esm/generation/simple.js +260 -0
- package/dist/esm/generation/simple.js.map +7 -0
- package/dist/esm/generation/theographic.js +412 -0
- package/dist/esm/generation/theographic.js.map +7 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/log.js.map +1 -1
- package/dist/esm/parser/codex-parser.js +3 -3
- package/dist/esm/parser/codex-parser.js.map +3 -3
- package/dist/esm/parser/commentary-csv-parser.js +3 -2
- package/dist/esm/parser/commentary-csv-parser.js.map +2 -2
- package/dist/esm/parser/iterators.js.map +1 -1
- package/dist/esm/parser/lockman-parser.js +1 -1
- package/dist/esm/parser/lockman-parser.js.map +1 -1
- package/dist/esm/parser/tyndale-xml-parser.js +1 -1
- package/dist/esm/parser/tyndale-xml-parser.js.map +1 -1
- package/dist/esm/parser/usfm-parser.js +1 -1
- package/dist/esm/parser/usfm-parser.js.map +1 -1
- package/dist/esm/parser/usx-parser.js +130 -26
- package/dist/esm/parser/usx-parser.js.map +2 -2
- package/dist/esm/parser/words.js +149 -0
- package/dist/esm/parser/words.js.map +7 -0
- package/dist/types/generation/api.d.ts +9006 -1101
- package/dist/types/generation/common-types.d.ts +1318 -106
- package/dist/types/generation/dataset.d.ts +17 -1
- package/dist/types/generation/index.d.ts +2 -1
- package/dist/types/generation/simple.d.ts +110 -0
- package/dist/types/generation/theographic.d.ts +64 -0
- package/dist/types/parser/commentary-csv-parser.d.ts +1 -1
- package/dist/types/parser/lockman-parser.d.ts +1 -1
- package/dist/types/parser/tyndale-xml-parser.d.ts +1 -1
- package/dist/types/parser/types.d.ts +63 -0
- package/dist/types/parser/usx-parser.d.ts +6 -5
- package/dist/types/parser/words.d.ts +104 -0
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../generation/api.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\r\nimport {\r\n ChapterContent,\r\n ChapterData,\r\n ChapterFootnote,\r\n Commentary,\r\n CommentaryBook,\r\n CommentaryBookChapterSchema,\r\n CommentaryBookSchema,\r\n CommentaryBookChapter,\r\n CommentaryProfile,\r\n CommentaryProfileSchema,\r\n Dataset,\r\n DatasetBook,\r\n DatasetBookChapterSchema,\r\n DatasetBookSchema,\r\n DatasetBookChapter,\r\n OutputFile,\r\n DatasetSchema,\r\n TranslationSchema,\r\n Translation,\r\n TranslationBook,\r\n TranslationBookSchema,\r\n TranslationBookChapter,\r\n TranslationBookChapterSchema,\r\n TranslationBookChapterAudioLinks,\r\n CommentarySchema,\r\n} from './common-types.js';\r\nimport { DatasetOutput } from './dataset.js';\r\nimport \"zod-openapi\";\r\n\r\n/**\r\n * Defines the output of the API generation.\r\n */\r\nexport interface ApiOutput {\r\n /**\r\n * The list of available translations.\r\n * This maps to the /api/available-translations.json endpoint.\r\n */\r\n availableTranslations: ApiAvailableTranslations;\r\n\r\n /**\r\n * The list of books for each translation.\r\n * This maps to the /api/:translationId/books.json endpoint.\r\n */\r\n translationBooks: ApiTranslationBooks[];\r\n\r\n /**\r\n * The list of chapters for each book.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.json\r\n * - /api/:translationId/:bookCommonName/:chapterNumber.json\r\n */\r\n translationBookChapters: ApiTranslationBookChapter[];\r\n\r\n /**\r\n * The list of audio files.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.:reader.mp3\r\n */\r\n translationBookChapterAudio: ApiTranslationBookChapterAudio[];\r\n\r\n /**\r\n * The list of available commentaries.\r\n * This maps to the /api/available-commentaries.json endpoint.\r\n */\r\n availableCommentaries: ApiAvailableCommentaries;\r\n\r\n /**\r\n * The list of books for each commentary.\r\n * This maps to the /api/c/:commentaryId/books.json endpoint.\r\n */\r\n commentaryBooks: ApiCommentaryBooks[];\r\n\r\n /**\r\n * The list of profiles for each commentary.\r\n * This maps to the /api/c/:commentaryId/profiles.json endpoint.\r\n */\r\n commentaryProfiles: ApiCommentaryProfiles[];\r\n\r\n /**\r\n * The list of chapters for each commentary book.\r\n * This maps to the following endpoint:\r\n * - /api/c/:commentaryId/:bookId/:chapterNumber.json\r\n */\r\n commentaryBookChapters: ApiCommentaryBookChapter[];\r\n\r\n /**\r\n * The list of individual profiles for each commentary.\r\n * This maps to the following endpoint:\r\n * - /api/c/:commentaryId/profiles/:profileId.json\r\n */\r\n commentaryProfileContents: ApiCommentaryProfileContent[];\r\n\r\n /**\r\n * The list of available datasets.\r\n * This maps to the /api/available-datasets.json endpoint.\r\n */\r\n availableDatasets?: ApiAvailableDatasets;\r\n\r\n /**\r\n * The list of books for each dataset.\r\n * This maps to the /api/d/:datasetId/books.json endpoint.\r\n */\r\n datasetBooks?: ApiDatasetBooks[];\r\n\r\n /**\r\n * The list of chapters for each dataset book.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/:bookId/:chapterNumber.json\r\n */\r\n datasetBookChapters?: ApiDatasetBookChapter[];\r\n\r\n /**\r\n * The complete translation data for each translation.\r\n * This maps to the /api/:translationId/complete.json endpoint.\r\n */\r\n translationComplete: ApiTranslationComplete[];\r\n\r\n /**\r\n * The path prefix that the API should use.\r\n */\r\n pathPrefix: string;\r\n}\r\n\r\n/**\r\n * The list of available translations.\r\n * Maps to the /api/available-translations.json endpoint.\r\n */\r\nexport const ApiAvailableTranslationsSchema = z.object({\r\n /**\r\n * The list of translations.\r\n */\r\n translations: z.array(z.lazy(() => ApiTranslationSchema))\r\n .meta({\r\n description: 'The list of translations that are available in the API.',\r\n }),\r\n}).meta({\r\n id: 'ApiAvailableTranslations',\r\n description: 'The list of available translations. Maps to the /api/available-translations.json endpoint.',\r\n});\r\n\r\nexport type ApiAvailableTranslations = z.infer<\r\n typeof ApiAvailableTranslationsSchema\r\n>;\r\n\r\n/**\r\n * The list of available commentaries.\r\n * Maps to the /api/available-commentaries.json endpoint.\r\n */\r\nexport const ApiAvailableCommentariesSchema = z.object({\r\n /**\r\n * The list of commentaries.\r\n */\r\n commentaries: z.array(z.lazy(() => ApiCommentarySchema)).meta({\r\n description: 'The list of commentaries that are available in the API.',\r\n }),\r\n}).meta({\r\n id: 'ApiAvailableCommentaries',\r\n description: 'The list of available commentaries. Maps to the /api/available-commentaries.json endpoint.',\r\n});\r\n\r\nexport type ApiAvailableCommentaries = z.infer<\r\n typeof ApiAvailableCommentariesSchema\r\n>;\r\n\r\n/**\r\n * The list of available datasets.\r\n * Maps to the /api/available-datasets.json endpoint.\r\n */\r\nexport const ApiAvailableDatasetsSchema = z.object({\r\n datasets: z.array(z.lazy(() => ApiDatasetSchema)).meta({\r\n description: 'The list of datasets that are available in the API.',\r\n }),\r\n}).meta({\r\n id: 'ApiAvailableDatasets',\r\n description: 'The list of available datasets. Maps to the /api/available-datasets.json endpoint.',\r\n});\r\n\r\nexport type ApiAvailableDatasets = z.infer<typeof ApiAvailableDatasetsSchema>;\r\n\r\n/**\r\n * Defines a dataset that is used in the API.\r\n */\r\nexport const ApiDatasetSchema = DatasetSchema.extend({\r\n /**\r\n * The API link for the list of books for this dataset.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description: 'The API link for the list of books for this dataset. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.literal('json')),\r\n\r\n /**\r\n * The number of books that are contained in this dataset.\r\n */\r\n numberOfBooks: z.number().meta({\r\n description: 'The number of books that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this dataset.\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n description: 'The total number of chapters that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this dataset.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The total number of verses that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of references that are contained in this dataset.\r\n */\r\n totalNumberOfReferences: z.number().meta({\r\n description: 'The total number of references that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the commentary is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description: 'Gets the name of the language that the dataset is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description: 'Gets the name of the language in English. Null or undefined if the language doesn\\'t have an english name.',\r\n }),\r\n}).meta({\r\n id: 'ApiDataset',\r\n description: 'Defines a dataset that is used in the API.',\r\n});\r\n\r\nexport type ApiDataset = z.infer<typeof ApiDatasetSchema>;\r\n\r\n/**\r\n * Defines a translation that is used in the API.\r\n */\r\nexport const ApiTranslationSchema = TranslationSchema.extend({\r\n /**\r\n * The API link for the list of available books for this translation.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description: 'The API link for the list of books for this translation. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.enum(['json', 'usfm'])),\r\n\r\n /**\r\n * The number of books that are contained in this translation.\r\n *\r\n * Complete translations should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: z.number().meta({\r\n description: 'The number of books that are contained in this translation. Complete translations should have the same number of books as the Bible (66).',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this translation.\r\n *\r\n * Complete translations should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n 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).',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this translation.\r\n *\r\n * 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).\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n 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).',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal books that are contained in this translation.\r\n */\r\n numberOfApocryphalBooks: z.number().optional().meta({\r\n description: 'The total number of apocryphal books that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal chapters that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalChapters: z.number().optional().meta({\r\n description: 'The total number of apocryphal chapters that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal verses that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalVerses: z.number().optional().meta({\r\n description: 'The total number of apocryphal verses that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the translation is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description: 'Gets the name of the language that the translation is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description: 'Gets the name of the language in English. Null or undefined if the language doesn\\'t have an english name.',\r\n }),\r\n\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file.\r\n *\r\n * Undefined if complete translation files are not available.\r\n */\r\n completeTranslationApiLink: z.string().optional().meta({\r\n 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.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslation',\r\n description: 'Defines a translation that is used in the API.',\r\n});\r\n\r\nexport type ApiTranslation = z.infer<typeof ApiTranslationSchema>;\r\n\r\n/**\r\n * Defines the complete translation download data.\r\n * Maps to the /api/:translationId/complete.json endpoint.\r\n */\r\nexport const ApiTranslationCompleteSchema = z.object({\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: z.lazy(() => ApiTranslationSchema).meta({\r\n description: 'The translation metadata.',\r\n }),\r\n\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: z.array(z.lazy(() => ApiTranslationCompleteBookSchema)).meta({\r\n description: 'The complete list of books with all their chapters.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationComplete',\r\n description: 'Defines the complete translation download data. Maps to the /api/:translationId/complete.json endpoint.',\r\n});\r\n\r\nexport type ApiTranslationComplete = z.infer<typeof ApiTranslationCompleteSchema>;\r\n\r\n/**\r\n * A book in the complete translation download.\r\n */\r\nexport const ApiTranslationCompleteBookSchema = TranslationBookSchema.extend({\r\n /**\r\n * The number of chapters in the book.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters in the book.',\r\n }),\r\n\r\n /**\r\n * The total number of verses in the book.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The total number of verses in the book.',\r\n }),\r\n\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: z.array(TranslationBookChapterSchema).meta({\r\n description: 'The complete list of chapters with all content.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationCompleteBook',\r\n description: 'A book in the complete translation download.',\r\n});\r\n\r\nexport type ApiTranslationCompleteBook = z.infer<\r\n typeof ApiTranslationCompleteBookSchema\r\n>;\r\n\r\n/**\r\n * Defines a commentary that is used in the API.\r\n */\r\nexport const ApiCommentarySchema = CommentarySchema.extend({\r\n /**\r\n * The API link for the list of available books for this translation.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description: 'The API link for the list of books for this commentary. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The API link for the list of available profiles for this commentary.\r\n */\r\n listOfProfilesApiLink: z.string().meta({\r\n description: 'The API link for the list of profiles for this commentary. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.enum(['json', 'usfm'])),\r\n\r\n /**\r\n * The number of books that are contained in this commentary.\r\n *\r\n * Complete commentaries should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: z.number().meta({\r\n description: 'The number of books that are contained in this commentary. Complete commentaries should have the same number of books as the Bible (66).',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this translation.\r\n *\r\n * Complete commentaries should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n 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).',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this commentary.\r\n *\r\n * 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).\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n 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).',\r\n }),\r\n\r\n /**\r\n * The total number of profiles that are contained in this commentary.\r\n *\r\n * Profiles are used to provide additional information about people and people groups that are mentioned in the Bible.\r\n */\r\n totalNumberOfProfiles: z.number().meta({\r\n 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.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the commentary is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description: 'Gets the name of the language that the commentary is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description: 'Gets the name of the language in English. Null or undefined if the language doesn\\'t have an english name.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentary',\r\n description: 'Defines a commentary that is used in the API.',\r\n});\r\n\r\nexport type ApiCommentary = z.infer<typeof ApiCommentarySchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a translation.\r\n */\r\nexport const ApiTranslationBooksSchema = z.object({\r\n /**\r\n * The translation information for the books.\r\n */\r\n translation: z.lazy(() => ApiTranslationSchema).meta({\r\n description: 'The translation information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: z.array(z.lazy(() => ApiTranslationBookSchema)).meta({\r\n description: 'The list of books that are available for the translation.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBooks',\r\n description: 'Defines an interface that contains information about the books that are available for a translation.',\r\n});\r\n\r\nexport type ApiTranslationBooks = z.infer<typeof ApiTranslationBooksSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a commentary.\r\n */\r\nexport const ApiCommentaryBooksSchema = z.object({\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: z.lazy(() => ApiCommentarySchema).meta({\r\n description: 'The commentary information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: z.array(z.lazy(() => ApiCommentaryBookSchema)).meta({\r\n description: 'The list of books that are available for the commentary.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryBooks',\r\n description: 'Defines an interface that contains information about the books that are available for a commentary.',\r\n});\r\n\r\nexport type ApiCommentaryBooks = z.infer<typeof ApiCommentaryBooksSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a dataset.\r\n */\r\nexport const ApiDatasetBooksSchema = z.object({\r\n /**\r\n * The dataset information for the books.\r\n */\r\n dataset: z.lazy(() => ApiDatasetSchema).meta({\r\n description: 'The dataset information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the dataset.\r\n */\r\n books: z.array(z.lazy(() => ApiDatasetBookSchema)).meta({\r\n description: 'The list of books that are available for the dataset.',\r\n }),\r\n}).meta({\r\n id: 'ApiDatasetBooks',\r\n description: 'Defines an interface that contains information about the books that are available for a dataset.',\r\n});\r\n\r\nexport type ApiDatasetBooks = z.infer<typeof ApiDatasetBooksSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the profiles that are available for a commentary.\r\n */\r\nexport const ApiCommentaryProfilesSchema = z.object({\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: z.lazy(() => ApiCommentarySchema).meta({\r\n description: 'The commentary information for the profiles.',\r\n }),\r\n\r\n /**\r\n * The list of profiles that are available for the commentary.\r\n */\r\n profiles: z.array(z.lazy(() => ApiCommentaryProfileSchema)).meta({\r\n description: 'The list of profiles that are available for the commentary.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryProfiles',\r\n description: 'Defines an interface that contains information about the profiles that are available for a commentary.',\r\n});\r\n\r\nexport type ApiCommentaryProfiles = z.infer<typeof ApiCommentaryProfilesSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a profile.\r\n */\r\nexport const ApiCommentaryProfileSchema = CommentaryProfileSchema.extend({\r\n /**\r\n * The link to this profile.\r\n */\r\n thisProfileLink: z.string().meta({\r\n description: 'The API link for this profile. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The link to the chapter that this profile references in the commentary.\r\n */\r\n referenceChapterLink: z.string().nullable().meta({\r\n 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.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryProfile',\r\n description: 'Defines an interface that contains information about a profile.',\r\n});\r\n\r\nexport type ApiCommentaryProfile = z.infer<typeof ApiCommentaryProfileSchema>;\r\n\r\n/**\r\n * Defines a translation book that is used in the API.\r\n */\r\nexport const ApiTranslationBookSchema = TranslationBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: z.number().meta({\r\n description: 'The number of the first chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: z.string().meta({\r\n description: 'The link to the first chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: z.number().meta({\r\n description: 'The number of the last chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: z.string().meta({\r\n description: 'The link to the last chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBook',\r\n description: 'Defines a schema that contains information about a translation book.',\r\n});\r\n\r\nexport type ApiTranslationBook = z.infer<typeof ApiTranslationBookSchema>;\r\n\r\n/**\r\n * Defines a commentary book that is used in the API.\r\n */\r\nexport const ApiCommentaryBookSchema = CommentaryBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n firstChapterNumber: z.number().nullable().meta({\r\n description: 'The number of the first chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n firstChapterApiLink: z.string().nullable().meta({\r\n description: 'The link to the first chapter of the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n lastChapterNumber: z.number().nullable().meta({\r\n description: 'The number of the last chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n lastChapterApiLink: z.string().nullable().meta({\r\n description: 'The link to the last chapter of the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryBook',\r\n description: 'Defines a schema that contains information about a commentary book.',\r\n});\r\n\r\nexport type ApiCommentaryBook = z.infer<typeof ApiCommentaryBookSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book in a dataset.\r\n */\r\nexport const ApiDatasetBookSchema = DatasetBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: z.number().meta({\r\n description: 'The number of the first chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: z.string().meta({\r\n description: 'The link to the first chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: z.number().meta({\r\n description: 'The number of the last chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: z.string().meta({\r\n description: 'The link to the last chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of references that the book contains.\r\n */\r\n totalNumberOfReferences: z.number().meta({\r\n description: 'The number of references that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiDatasetBook',\r\n description: 'Defines a schema that contains information about a book in a dataset.',\r\n});\r\n\r\nexport type ApiDatasetBook = z.infer<typeof ApiDatasetBookSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\nexport const ApiTranslationBookChapterSchema = TranslationBookChapterSchema.extend({\r\n /**\r\n * The translation information for the book chapter.\r\n */\r\n translation: z.lazy(() => ApiTranslationSchema).meta({\r\n description: 'The translation information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z.lazy(() => ApiTranslationBookSchema).meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description: 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The links to the audio versions for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioLinks: z.record(z.string(), z.string()).nullable().meta({\r\n 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.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The links to the audio versions for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioLinks: z.record(z.string(), z.string()).nullable().meta({\r\n 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.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBookChapter',\r\n description: 'Defines an interface that contains information about a book chapter in a translation.',\r\n});\r\n\r\nexport type ApiTranslationBookChapter = z.infer<\r\n typeof ApiTranslationBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\nexport const ApiCommentaryBookChapterSchema = CommentaryBookChapterSchema.extend({\r\n /**\r\n * The commentary information for the book chapter.\r\n */\r\n commentary: z.lazy(() => ApiCommentarySchema).meta({\r\n description: 'The commentary information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z.lazy(() => ApiCommentaryBookSchema).meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description: 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryBookChapter',\r\n description: 'Defines a schema that contains information about a book chapter in a commentary.',\r\n});\r\n\r\nexport type ApiCommentaryBookChapter = z.infer<\r\n typeof ApiCommentaryBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\nexport const ApiDatasetBookChapterSchema = DatasetBookChapterSchema.extend({\r\n /**\r\n * The dataset information for the book chapter.\r\n */\r\n dataset: z.lazy(() => ApiDatasetSchema).meta({\r\n description: 'The dataset information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z.lazy(() => ApiDatasetBookSchema).meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description: 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description: 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The number of references that the chapter contains.\r\n */\r\n numberOfReferences: z.number().meta({\r\n description: 'The number of references that the chapter contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiDatasetBookChapter',\r\n description: 'Defines a schema that contains information about a book chapter in a dataset.',\r\n});\r\n\r\nexport type ApiDatasetBookChapter = z.infer<typeof ApiDatasetBookChapterSchema>;\r\n\r\nexport const ApiTranslationBookChapterAudioSchema = z.object({\r\n /**\r\n * The chapter that the audio is for.\r\n */\r\n chapter: z.lazy(() => ApiTranslationBookChapterSchema).meta({\r\n description: 'The chapter that the audio is for.',\r\n }),\r\n\r\n /**\r\n * The link that the audio should be placed at.\r\n */\r\n link: z.string().meta({\r\n description: 'The link that the audio should be placed at. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The original URL of the audio.\r\n */\r\n originalUrl: z.string().meta({\r\n description: 'The original URL of the audio.',\r\n }),\r\n});\r\n\r\nexport type ApiTranslationBookChapterAudio = z.infer<\r\n typeof ApiTranslationBookChapterAudioSchema\r\n>;\r\n\r\nexport const ApiCommentaryProfileContentSchema = z.object({\r\n /**\r\n * The commentary information for the profile.\r\n */\r\n commentary: z.lazy(() => ApiCommentarySchema).meta({\r\n description: 'The commentary information for the profile.',\r\n }),\r\n\r\n /**\r\n * The information about the profile.\r\n */\r\n profile: z.lazy(() => ApiCommentaryProfileSchema).meta({\r\n description: 'The information about the profile.',\r\n }),\r\n\r\n /**\r\n * The content of the profile.\r\n */\r\n content: z.array(z.string()).meta({\r\n description: 'The content of the profile. This is an array of strings, where each string is a paragraph of the profile content.',\r\n }),\r\n});\r\n\r\nexport type ApiCommentaryProfileContent = z.infer<\r\n typeof ApiCommentaryProfileContentSchema\r\n>;\r\n\r\n/**\r\n * The options for generating the API.\r\n */\r\nexport interface GenerateApiOptions {\r\n /**\r\n * Whether to use the common name for the book chapter API link. If false, then book IDs are used.\r\n * Audio URLs will always use the book ID.\r\n * Defaults to false.\r\n */\r\n useCommonName?: boolean;\r\n\r\n /**\r\n * Whether to replace the audio URLs in the dataset with ones that are hosted locally.\r\n * If true, then the audio URLs in the dataset will be replaced with ones that reference files hosted by the API itself.\r\n * If false, then the audio URLs in the dataset will be left as is.\r\n * Defaults to false.\r\n */\r\n generateAudioFiles?: boolean;\r\n\r\n /**\r\n * Gets the english name of the given language.\r\n * If not provided, then the english name for the language will be unknown and omitted.\r\n * @param language The language to get the english name for.\r\n */\r\n getEnglishName?: (language: string) => string | null | undefined;\r\n\r\n /**\r\n * Gets the native name of the given language.\r\n * If not provided, then the native name for the language will be unknown and omitted.\r\n * @param language The language to get the native name for.\r\n */\r\n getNativeName?: (language: string) => string | null | undefined;\r\n\r\n /**\r\n * The prefix that should be added to paths that are generated.\r\n */\r\n pathPrefix?: string;\r\n\r\n /**\r\n * Whether to generate complete translation files for each translation.\r\n */\r\n generateCompleteTranslationFiles?: boolean;\r\n}\r\n\r\n/**\r\n * Generates the API output for the given dataset.\r\n * @param dataset The dataset to generate the API for.\r\n * @param options The options for generating the API.\r\n */\r\nexport function generateApiForDataset(\r\n dataset: DatasetOutput,\r\n options: GenerateApiOptions = {}\r\n): ApiOutput {\r\n const { useCommonName, pathPrefix } = options;\r\n const apiPathPrefix = pathPrefix ? pathPrefix : '';\r\n let api: ApiOutput = {\r\n availableTranslations: {\r\n translations: [],\r\n },\r\n translationBooks: [],\r\n translationBookChapters: [],\r\n translationBookChapterAudio: [],\r\n translationComplete: [],\r\n availableCommentaries: {\r\n commentaries: [],\r\n },\r\n commentaryBookChapters: [],\r\n commentaryBooks: [],\r\n commentaryProfiles: [],\r\n commentaryProfileContents: [],\r\n pathPrefix: apiPathPrefix,\r\n };\r\n\r\n const getNativeName = options.getNativeName;\r\n const getEnglishName = options.getEnglishName;\r\n\r\n for (let { books, ...translation } of dataset.translations) {\r\n let numberOfBooks = 0;\r\n let numberOfApocryphalBooks = 0;\r\n\r\n for (let book of books) {\r\n if (book.isApocryphal) {\r\n numberOfApocryphalBooks++;\r\n } else {\r\n numberOfBooks++;\r\n }\r\n }\r\n\r\n const apiTranslation: ApiTranslation = {\r\n ...translation,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfBooksApiLink(\r\n translation.id,\r\n apiPathPrefix\r\n ),\r\n completeTranslationApiLink: options.generateCompleteTranslationFiles\r\n ? completeTranslationApiLink(translation.id, apiPathPrefix)\r\n : undefined,\r\n numberOfBooks,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(translation.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(translation.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n if (numberOfApocryphalBooks > 0) {\r\n apiTranslation.numberOfApocryphalBooks = numberOfApocryphalBooks;\r\n }\r\n\r\n const translationBooks: ApiTranslationBooks = {\r\n translation: apiTranslation,\r\n books: [],\r\n };\r\n\r\n let translationChapters: ApiTranslationBookChapter[] = [];\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number;\r\n const apiBook: ApiTranslationBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n lastChapterNumber,\r\n lastChapterApiLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n };\r\n\r\n for (let { chapter, thisChapterAudioLinks } of chapters) {\r\n const audio: TranslationBookChapterAudioLinks = {};\r\n const apiBookChapter: ApiTranslationBookChapter = {\r\n translation: apiTranslation,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n thisChapterAudioLinks: audio,\r\n nextChapterApiLink: null,\r\n nextChapterAudioLinks: null,\r\n previousChapterApiLink: null,\r\n previousChapterAudioLinks: null,\r\n numberOfVerses: 0,\r\n };\r\n\r\n for (let reader in thisChapterAudioLinks) {\r\n if (options.generateAudioFiles) {\r\n const apiAudio: ApiTranslationBookChapterAudio = {\r\n chapter: apiBookChapter,\r\n link: bookChapterAudioApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n reader,\r\n apiPathPrefix\r\n ),\r\n originalUrl: thisChapterAudioLinks[reader],\r\n };\r\n audio[reader] = apiAudio.link;\r\n api.translationBookChapterAudio.push(apiAudio);\r\n } else {\r\n audio[reader] = thisChapterAudioLinks[reader];\r\n }\r\n }\r\n\r\n for (let c of chapter.content) {\r\n if (c.type === 'verse') {\r\n apiBookChapter.numberOfVerses++;\r\n }\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n\r\n translationChapters.push(apiBookChapter);\r\n api.translationBookChapters.push(apiBookChapter);\r\n }\r\n\r\n translationBooks.books.push(apiBook);\r\n\r\n if (apiBook.isApocryphal) {\r\n if (!apiTranslation.totalNumberOfApocryphalChapters) {\r\n apiTranslation.totalNumberOfApocryphalChapters = 0;\r\n }\r\n if (!apiTranslation.totalNumberOfApocryphalVerses) {\r\n apiTranslation.totalNumberOfApocryphalVerses = 0;\r\n }\r\n apiTranslation.totalNumberOfApocryphalChapters +=\r\n apiBook.numberOfChapters;\r\n apiTranslation.totalNumberOfApocryphalVerses +=\r\n apiBook.totalNumberOfVerses;\r\n } else {\r\n apiTranslation.totalNumberOfChapters +=\r\n apiBook.numberOfChapters;\r\n apiTranslation.totalNumberOfVerses +=\r\n apiBook.totalNumberOfVerses;\r\n }\r\n }\r\n\r\n for (let i = 0; i < translationChapters.length; i++) {\r\n if (i > 0) {\r\n translationChapters[i].previousChapterApiLink =\r\n bookChapterApiLink(\r\n translation.id,\r\n getBookLink(translationChapters[i - 1].book),\r\n translationChapters[i - 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n translationChapters[i].previousChapterAudioLinks =\r\n translationChapters[i - 1].thisChapterAudioLinks;\r\n }\r\n\r\n if (i < translationChapters.length - 1) {\r\n translationChapters[i].nextChapterApiLink = bookChapterApiLink(\r\n translation.id,\r\n getBookLink(translationChapters[i + 1].book),\r\n translationChapters[i + 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n translationChapters[i].nextChapterAudioLinks =\r\n translationChapters[i + 1].thisChapterAudioLinks;\r\n }\r\n }\r\n\r\n api.availableTranslations.translations.push(apiTranslation);\r\n api.translationBooks.push(translationBooks);\r\n\r\n if (options.generateCompleteTranslationFiles) {\r\n // Build the complete translation data for download\r\n const completeTranslation: ApiTranslationComplete = {\r\n translation: apiTranslation,\r\n books: translationBooks.books.map((book) => {\r\n const bookChapters = translationChapters.filter(\r\n (ch) => ch.book.id === book.id\r\n );\r\n return {\r\n id: book.id,\r\n name: book.name,\r\n commonName: book.commonName,\r\n title: book.title,\r\n order: book.order,\r\n numberOfChapters: book.numberOfChapters,\r\n totalNumberOfVerses: book.totalNumberOfVerses,\r\n isApocryphal: book.isApocryphal,\r\n chapters: bookChapters.map((ch) => ({\r\n numberOfVerses: ch.numberOfVerses,\r\n thisChapterAudioLinks: ch.thisChapterAudioLinks,\r\n chapter: ch.chapter,\r\n })),\r\n };\r\n }),\r\n };\r\n api.translationComplete.push(completeTranslation);\r\n }\r\n }\r\n\r\n for (let { books, profiles, ...commentary } of dataset.commentaries) {\r\n const apiCommentary: ApiCommentary = {\r\n ...commentary,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfCommentaryBooksApiLink(\r\n commentary.id,\r\n apiPathPrefix\r\n ),\r\n listOfProfilesApiLink: profilesCommentaryApiLink(\r\n commentary.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n numberOfBooks: books.length,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfProfiles: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(commentary.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(commentary.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n const commentaryBooks: ApiCommentaryBooks = {\r\n commentary: apiCommentary,\r\n books: [],\r\n };\r\n\r\n const commentaryProfiles: ApiCommentaryProfiles = {\r\n commentary: apiCommentary,\r\n profiles: [],\r\n };\r\n\r\n let commentaryChapters: ApiCommentaryBookChapter[] = [];\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number ?? null;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number ?? null;\r\n const apiBook: ApiCommentaryBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: firstChapterNumber\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n lastChapterNumber,\r\n lastChapterApiLink: lastChapterNumber\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n };\r\n\r\n for (let { chapter } of chapters) {\r\n const apiBookChapter: ApiCommentaryBookChapter = {\r\n commentary: apiCommentary,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n nextChapterApiLink: null,\r\n previousChapterApiLink: null,\r\n numberOfVerses: 0,\r\n };\r\n\r\n for (let c of chapter.content) {\r\n if (c.type === 'verse') {\r\n apiBookChapter.numberOfVerses++;\r\n }\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n\r\n commentaryChapters.push(apiBookChapter);\r\n api.commentaryBookChapters.push(apiBookChapter);\r\n }\r\n\r\n commentaryBooks.books.push(apiBook);\r\n\r\n apiCommentary.totalNumberOfChapters += apiBook.numberOfChapters;\r\n apiCommentary.totalNumberOfVerses += apiBook.totalNumberOfVerses;\r\n }\r\n\r\n if (profiles) {\r\n for (let profile of profiles) {\r\n const apiProfile: ApiCommentaryProfile = {\r\n id: profile.id,\r\n reference: profile.reference,\r\n subject: profile.subject,\r\n thisProfileLink: profileCommentaryApiLink(\r\n commentary.id,\r\n profile.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n referenceChapterLink: profile.reference\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n profile.reference.book,\r\n profile.reference.chapter,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n };\r\n\r\n const apiProfileContent: ApiCommentaryProfileContent = {\r\n commentary: apiCommentary,\r\n profile: apiProfile,\r\n content: profile.content,\r\n };\r\n\r\n apiCommentary.totalNumberOfProfiles += 1;\r\n commentaryProfiles.profiles.push(apiProfile);\r\n api.commentaryProfileContents.push(apiProfileContent);\r\n }\r\n }\r\n\r\n for (let i = 0; i < commentaryChapters.length; i++) {\r\n if (i > 0) {\r\n commentaryChapters[i].previousChapterApiLink =\r\n bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(commentaryChapters[i - 1].book),\r\n commentaryChapters[i - 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n // commentaryChapters[i].previousChapterAudioLinks =\r\n // commentaryChapters[i - 1].thisChapterAudioLinks;\r\n }\r\n\r\n if (i < commentaryChapters.length - 1) {\r\n commentaryChapters[i].nextChapterApiLink =\r\n bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(commentaryChapters[i + 1].book),\r\n commentaryChapters[i + 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n // commentaryChapters[i].nextChapterAudioLinks =\r\n // commentaryChapters[i + 1].thisChapterAudioLinks;\r\n }\r\n }\r\n\r\n api.availableCommentaries.commentaries.push(apiCommentary);\r\n api.commentaryBooks.push(commentaryBooks);\r\n api.commentaryProfiles.push(commentaryProfiles);\r\n }\r\n\r\n for (let { books, ...datasetInfo } of dataset.datasets ?? []) {\r\n const apiDataset: ApiDataset = {\r\n ...datasetInfo,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfDatasetBooksApiLink(\r\n datasetInfo.id,\r\n apiPathPrefix\r\n ),\r\n numberOfBooks: books.length,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfReferences: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(datasetInfo.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(datasetInfo.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n const datasetBooks: ApiDatasetBooks = {\r\n dataset: apiDataset,\r\n books: [],\r\n };\r\n\r\n let datasetChapters: ApiDatasetBookChapter[] = [];\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number ?? null;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number ?? null;\r\n const apiBook: ApiDatasetBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n lastChapterNumber,\r\n lastChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfReferences: 0,\r\n };\r\n\r\n for (let { chapter } of chapters) {\r\n const apiBookChapter: ApiDatasetBookChapter = {\r\n dataset: apiDataset,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n nextChapterApiLink: null,\r\n previousChapterApiLink: null,\r\n numberOfVerses: chapter.content.length,\r\n numberOfReferences: 0,\r\n };\r\n\r\n // apiBookChapter.numberOfVerses += ;\r\n for (let verse of chapter.content) {\r\n apiBookChapter.numberOfReferences +=\r\n verse.references.length;\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n apiBook.totalNumberOfReferences +=\r\n apiBookChapter.numberOfReferences;\r\n\r\n datasetChapters.push(apiBookChapter);\r\n if (!api.datasetBookChapters) {\r\n api.datasetBookChapters = [];\r\n }\r\n api.datasetBookChapters.push(apiBookChapter);\r\n }\r\n\r\n datasetBooks.books.push(apiBook);\r\n\r\n apiDataset.totalNumberOfChapters += apiBook.numberOfChapters;\r\n apiDataset.totalNumberOfVerses += apiBook.totalNumberOfVerses;\r\n apiDataset.totalNumberOfReferences +=\r\n apiBook.totalNumberOfReferences;\r\n }\r\n\r\n for (let i = 0; i < datasetChapters.length; i++) {\r\n if (i > 0) {\r\n datasetChapters[i].previousChapterApiLink =\r\n bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n datasetChapters[i - 1].book.id,\r\n datasetChapters[i - 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n }\r\n\r\n if (i < datasetChapters.length - 1) {\r\n datasetChapters[i].nextChapterApiLink =\r\n bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n datasetChapters[i + 1].book.id,\r\n datasetChapters[i + 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n }\r\n }\r\n\r\n if (!api.availableDatasets) {\r\n api.availableDatasets = {\r\n datasets: [],\r\n };\r\n }\r\n api.availableDatasets.datasets.push(apiDataset);\r\n if (!api.datasetBooks) {\r\n api.datasetBooks = [];\r\n }\r\n api.datasetBooks.push(datasetBooks);\r\n }\r\n\r\n return api;\r\n\r\n function getBookLink(book: TranslationBook | CommentaryBook): string {\r\n return useCommonName ? book.commonName : book.id;\r\n }\r\n}\r\n\r\n/**\r\n * Generates the output files for the given API.\r\n * @param api The API that the files should be generated for.\r\n */\r\nexport function generateFilesForApi(api: ApiOutput): OutputFile[] {\r\n let files: OutputFile[] = [];\r\n\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_translations.json`,\r\n api.availableTranslations,\r\n true\r\n )\r\n );\r\n for (let translationBooks of api.translationBooks) {\r\n files.push(\r\n jsonFile(\r\n translationBooks.translation.listOfBooksApiLink,\r\n translationBooks\r\n )\r\n );\r\n }\r\n\r\n for (let bookChapter of api.translationBookChapters) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n for (let audio of api.translationBookChapterAudio) {\r\n files.push(downloadedFile(audio.link, audio.originalUrl));\r\n }\r\n\r\n // Generate complete translation download files\r\n for (let complete of api.translationComplete) {\r\n if (complete.translation.completeTranslationApiLink) {\r\n files.push(\r\n jsonFile(\r\n complete.translation.completeTranslationApiLink,\r\n complete\r\n )\r\n );\r\n }\r\n }\r\n\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_commentaries.json`,\r\n api.availableCommentaries,\r\n true\r\n )\r\n );\r\n for (let commentaryBooks of api.commentaryBooks) {\r\n files.push(\r\n jsonFile(\r\n commentaryBooks.commentary.listOfBooksApiLink,\r\n commentaryBooks\r\n )\r\n );\r\n }\r\n\r\n for (let commentaryProfiles of api.commentaryProfiles) {\r\n files.push(\r\n jsonFile(\r\n commentaryProfiles.commentary.listOfProfilesApiLink,\r\n commentaryProfiles\r\n )\r\n );\r\n }\r\n\r\n for (let profileContent of api.commentaryProfileContents) {\r\n files.push(\r\n jsonFile(profileContent.profile.thisProfileLink, profileContent)\r\n );\r\n }\r\n\r\n for (let bookChapter of api.commentaryBookChapters) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n if (api.availableDatasets) {\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_datasets.json`,\r\n api.availableDatasets,\r\n true\r\n )\r\n );\r\n }\r\n\r\n if (api.datasetBooks) {\r\n for (let datasetBook of api.datasetBooks) {\r\n files.push(\r\n jsonFile(datasetBook.dataset.listOfBooksApiLink, datasetBook)\r\n );\r\n }\r\n }\r\n\r\n if (api.datasetBookChapters) {\r\n for (let datasetBookChapter of api.datasetBookChapters) {\r\n files.push(\r\n jsonFile(datasetBookChapter.thisChapterLink, datasetBookChapter)\r\n );\r\n }\r\n }\r\n\r\n // for (let audio of api.translationBookChapterAudio) {\r\n // files.push(downloadedFile(audio.link, audio.originalUrl));\r\n // }\r\n\r\n return files;\r\n}\r\n\r\n/**\r\n * Generates the output files for the given datasets.\r\n * @param datasets The datasets to generate the output files for.\r\n * @param options The options for generating the API files.\r\n */\r\nexport async function* generateOutputFilesFromDatasets(\r\n datasets: AsyncIterable<DatasetOutput>,\r\n options?: GenerateApiOptions\r\n): AsyncGenerator<OutputFile[]> {\r\n for await (let dataset of datasets) {\r\n const api = generateApiForDataset(dataset, options);\r\n const files = generateFilesForApi(api);\r\n\r\n yield files;\r\n }\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a translation.\r\n * @param translationId The ID of the translation.\r\n * @returns\r\n */\r\nexport function listOfBooksApiLink(\r\n translationId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/${translationId}/books.json`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the complete translation download endpoint.\r\n * @param translationId The ID of the translation.\r\n * @param prefix The path prefix.\r\n * @returns\r\n */\r\nexport function completeTranslationApiLink(\r\n translationId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/${translationId}/complete.json`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a commentary.\r\n * @param commentaryId The ID of the commentary.\r\n * @returns\r\n */\r\nexport function listOfCommentaryBooksApiLink(\r\n commentaryId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/c/${commentaryId}/books.json`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a dataset.\r\n * @param datasetId The ID of the dataset.\r\n * @returns\r\n */\r\nexport function listOfDatasetBooksApiLink(\r\n datasetId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/d/${datasetId}/books.json`;\r\n}\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookCommentaryChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\nexport function bookChapterAudioApiLink(\r\n translationId: string,\r\n bookId: string,\r\n chapterNumber: number,\r\n reader: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n bookId\r\n )}/${chapterNumber}.${reader}.mp3`;\r\n}\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookDatasetChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/d/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API link for a profile.\r\n * @param translationId The ID of the translation.\r\n * @param profileId The ID of the profile.\r\n * @param extension The extension of the file.\r\n */\r\nexport function profilesCommentaryApiLink(\r\n translationId: string,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/profiles.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API link for a profile.\r\n * @param translationId The ID of the translation.\r\n * @param profileId The ID of the profile.\r\n * @param extension The extension of the file.\r\n */\r\nexport function profileCommentaryApiLink(\r\n translationId: string,\r\n profileId: string,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/profiles/${replaceSpacesWithUnderscores(\r\n profileId\r\n )}.${extension}`;\r\n}\r\n\r\nexport function jsonFile(\r\n path: string,\r\n content: any,\r\n mergable?: boolean\r\n): OutputFile {\r\n return {\r\n path,\r\n content,\r\n mergable,\r\n };\r\n}\r\n\r\nexport function downloadedFile(path: string, url: string): OutputFile {\r\n return {\r\n path,\r\n content: () => fetch(url).then((response) => response.body),\r\n };\r\n}\r\n\r\nexport function replaceSpacesWithUnderscores(str: string): string {\r\n return str.replace(/[<>:\"/\\\\|?*\\s]/g, '_');\r\n}\r\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,SAAS;AAClB;AAAA,EAMI;AAAA,EACA;AAAA,EAGA;AAAA,EAGA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAGA;AAAA,EAEA;AAAA,EAEA;AAAA,OACG;AAEP,OAAO;AAoGA,aAAM,iCAAiC,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAInD,cAAc,EAAE,MAAM,EAAE,KAAK,MAAM,oBAAoB,CAAC,EACnD,KAAK;AAAA,IACF,aAAa;AAAA,EACjB,CAAC;AACT,CAAC,EAAE,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,aAAa;AACjB,CAAC;AAUM,aAAM,iCAAiC,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAInD,cAAc,EAAE,MAAM,EAAE,KAAK,MAAM,mBAAmB,CAAC,EAAE,KAAK;AAAA,IAC1D,aAAa;AAAA,EACjB,CAAC;AACL,CAAC,EAAE,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,aAAa;AACjB,CAAC;AAUM,aAAM,6BAA6B,EAAE,OAAO;AAAA,EAC/C,UAAU,EAAE,MAAM,EAAE,KAAK,MAAM,gBAAgB,CAAC,EAAE,KAAK;AAAA,IACnD,aAAa;AAAA,EACjB,CAAC;AACL,CAAC,EAAE,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,aAAa;AACjB,CAAC;AAOM,aAAM,mBAAmB,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA,EAIjD,oBAAoB,EAAE,OAAO,EAAE,KAAK;AAAA,IAChC,aAAa;AAAA,E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BAAS,6BAA6B,KAAqB;AAC9D,SAAO,IAAI,QAAQ,mBAAmB,GAAG;AAC7C;",
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod';\r\nimport {\r\n ChapterContent,\r\n ChapterData,\r\n ChapterFootnote,\r\n Commentary,\r\n CommentaryBook,\r\n CommentaryBookChapterSchema,\r\n CommentaryBookSchema,\r\n CommentaryBookChapter,\r\n CommentaryProfile,\r\n CommentaryProfileSchema,\r\n Dataset,\r\n DatasetBook,\r\n DatasetBookChapterSchema,\r\n DatasetBookSchema,\r\n DatasetBookChapter,\r\n DatasetEntityRef,\r\n DatasetEntityType,\r\n DatasetEvent,\r\n DatasetEventSchema,\r\n DatasetPeopleGroup,\r\n DatasetPeopleGroupSchema,\r\n DatasetPerson,\r\n DatasetPersonSchema,\r\n DatasetPlace,\r\n DatasetPlaceSchema,\r\n OutputFile,\r\n DatasetSchema,\r\n TranslationSchema,\r\n Translation,\r\n TranslationBook,\r\n TranslationBookSchema,\r\n TranslationBookChapter,\r\n TranslationBookChapterSchema,\r\n TranslationBookChapterAudioLinks,\r\n TranslationBookChapterAudioTimings,\r\n TranslationBookChapterWords,\r\n ChapterWordSchema,\r\n CommentarySchema,\r\n SimpleChapterDataSchema,\r\n SimpleChapterWordSchema,\r\n SimpleCommentaryChapterDataSchema,\r\n SimpleTranslationBookChapterSchema,\r\n} from './common-types.js';\r\nimport { DatasetOutput } from './dataset.js';\r\nimport {\r\n SimplifiedChapter,\r\n simplifyChapter,\r\n simplifyCommentaryChapter,\r\n} from './simple.js';\r\nimport { BookId, BookIdSchema, VerseRef } from '../utils.js';\r\nimport { bookOrderMap } from './book-order.js';\r\n\r\n/**\r\n * Defines the output of the API generation.\r\n */\r\nexport interface ApiOutput {\r\n /**\r\n * The list of available translations.\r\n * This maps to the /api/available-translations.json endpoint.\r\n */\r\n availableTranslations: ApiAvailableTranslations;\r\n\r\n /**\r\n * The list of books for each translation.\r\n * This maps to the /api/:translationId/books.json endpoint.\r\n */\r\n translationBooks: ApiTranslationBooks[];\r\n\r\n /**\r\n * The list of chapters for each book.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.json\r\n * - /api/:translationId/:bookCommonName/:chapterNumber.json\r\n */\r\n translationBookChapters: ApiTranslationBookChapter[];\r\n\r\n /**\r\n * The list of chapters for each book, in the simplified format.\r\n * Omitted unless simplified chapter generation is enabled.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.simple.json\r\n * - /api/:translationId/:bookCommonName/:chapterNumber.simple.json\r\n */\r\n simpleTranslationBookChapters?: ApiSimpleTranslationBookChapter[];\r\n\r\n /**\r\n * The list of word-level annotations for chapters, in the simplified format.\r\n * Omitted unless simplified chapter generation is enabled.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.words.simple.json\r\n */\r\n simpleTranslationBookChapterWords?: ApiSimpleTranslationBookChapterWords[];\r\n\r\n /**\r\n * The list of audio files.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.:reader.mp3\r\n */\r\n translationBookChapterAudio: ApiTranslationBookChapterAudio[];\r\n\r\n /**\r\n * The list of audio timings.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.:reader.audioTimings.json\r\n */\r\n translationBookChapterAudioTimings: ApiTranslationBookChapterAudioTimings[];\r\n\r\n /**\r\n * The list of word-level annotations for chapters.\r\n * This maps to the following endpoints:\r\n * - /api/:translationId/:bookId/:chapterNumber.words.json\r\n */\r\n translationBookChapterWords: ApiTranslationBookChapterWords[];\r\n\r\n /**\r\n * The list of available commentaries.\r\n * This maps to the /api/available-commentaries.json endpoint.\r\n */\r\n availableCommentaries: ApiAvailableCommentaries;\r\n\r\n /**\r\n * The list of books for each commentary.\r\n * This maps to the /api/c/:commentaryId/books.json endpoint.\r\n */\r\n commentaryBooks: ApiCommentaryBooks[];\r\n\r\n /**\r\n * The list of profiles for each commentary.\r\n * This maps to the /api/c/:commentaryId/profiles.json endpoint.\r\n */\r\n commentaryProfiles: ApiCommentaryProfiles[];\r\n\r\n /**\r\n * The list of chapters for each commentary book.\r\n * This maps to the following endpoint:\r\n * - /api/c/:commentaryId/:bookId/:chapterNumber.json\r\n */\r\n commentaryBookChapters: ApiCommentaryBookChapter[];\r\n\r\n /**\r\n * The list of chapters for each commentary book, in the simplified format.\r\n * Omitted unless simplified chapter generation is enabled.\r\n * This maps to the following endpoint:\r\n * - /api/c/:commentaryId/:bookId/:chapterNumber.simple.json\r\n */\r\n simpleCommentaryBookChapters?: ApiSimpleCommentaryBookChapter[];\r\n\r\n /**\r\n * The list of individual profiles for each commentary.\r\n * This maps to the following endpoint:\r\n * - /api/c/:commentaryId/profiles/:profileId.json\r\n */\r\n commentaryProfileContents: ApiCommentaryProfileContent[];\r\n\r\n /**\r\n * The list of available datasets.\r\n * This maps to the /api/available-datasets.json endpoint.\r\n */\r\n availableDatasets?: ApiAvailableDatasets;\r\n\r\n /**\r\n * The list of books for each dataset.\r\n * This maps to the /api/d/:datasetId/books.json endpoint.\r\n */\r\n datasetBooks?: ApiDatasetBooks[];\r\n\r\n /**\r\n * The list of chapters for each dataset book.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/:bookId/:chapterNumber.json\r\n */\r\n datasetBookChapters?: ApiDatasetBookChapter[];\r\n\r\n /**\r\n * The list of chapters that contain entity data for each dataset book.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/:bookId/:chapterNumber.json\r\n */\r\n datasetEntityBookChapters?: ApiDatasetEntityBookChapter[];\r\n\r\n /**\r\n * The list of people for each dataset.\r\n * This maps to the /api/d/:datasetId/people.json endpoint.\r\n */\r\n datasetPeople?: ApiDatasetPeople[];\r\n\r\n /**\r\n * The list of individual people for each dataset.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/people/:personId.json\r\n */\r\n datasetPeopleContents?: ApiDatasetPerson[];\r\n\r\n /**\r\n * The list of places for each dataset.\r\n * This maps to the /api/d/:datasetId/places.json endpoint.\r\n */\r\n datasetPlaces?: ApiDatasetPlaces[];\r\n\r\n /**\r\n * The list of individual places for each dataset.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/places/:placeId.json\r\n */\r\n datasetPlaceContents?: ApiDatasetPlace[];\r\n\r\n /**\r\n * The list of events for each dataset.\r\n * This maps to the /api/d/:datasetId/events.json endpoint.\r\n */\r\n datasetEvents?: ApiDatasetEvents[];\r\n\r\n /**\r\n * The list of individual events for each dataset.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/events/:eventId.json\r\n */\r\n datasetEventContents?: ApiDatasetEvent[];\r\n\r\n /**\r\n * The list of people groups for each dataset.\r\n * This maps to the /api/d/:datasetId/groups.json endpoint.\r\n */\r\n datasetPeopleGroups?: ApiDatasetPeopleGroups[];\r\n\r\n /**\r\n * The list of individual people groups for each dataset.\r\n * This maps to the following endpoint:\r\n * - /api/d/:datasetId/groups/:groupId.json\r\n */\r\n datasetPeopleGroupContents?: ApiDatasetPeopleGroup[];\r\n\r\n /**\r\n * The complete translation data for each translation.\r\n * This maps to the /api/:translationId/complete.json endpoint.\r\n */\r\n translationComplete: ApiTranslationComplete[];\r\n\r\n /**\r\n * The complete translation data for each translation, in the simplified format.\r\n * This maps to the /api/:translationId/complete.simple.json endpoint.\r\n */\r\n simpleTranslationComplete: ApiSimpleTranslationComplete[];\r\n\r\n /**\r\n * The path prefix that the API should use.\r\n */\r\n pathPrefix: string;\r\n}\r\n\r\n/**\r\n * The list of available translations.\r\n * Maps to the /api/available-translations.json endpoint.\r\n */\r\nexport const ApiAvailableTranslationsSchema = z\r\n .object({\r\n /**\r\n * The list of translations.\r\n */\r\n translations: z.array(z.lazy(() => ApiTranslationSchema)).meta({\r\n description:\r\n 'The list of translations that are available in the API.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiAvailableTranslations',\r\n description:\r\n 'The list of available translations. Maps to the /api/available-translations.json endpoint.',\r\n });\r\n\r\nexport type ApiAvailableTranslations = z.infer<\r\n typeof ApiAvailableTranslationsSchema\r\n>;\r\n\r\n/**\r\n * The list of available commentaries.\r\n * Maps to the /api/available-commentaries.json endpoint.\r\n */\r\nexport const ApiAvailableCommentariesSchema = z\r\n .object({\r\n /**\r\n * The list of commentaries.\r\n */\r\n commentaries: z.array(z.lazy(() => ApiCommentarySchema)).meta({\r\n description:\r\n 'The list of commentaries that are available in the API.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiAvailableCommentaries',\r\n description:\r\n 'The list of available commentaries. Maps to the /api/available-commentaries.json endpoint.',\r\n });\r\n\r\nexport type ApiAvailableCommentaries = z.infer<\r\n typeof ApiAvailableCommentariesSchema\r\n>;\r\n\r\n/**\r\n * The list of available datasets.\r\n * Maps to the /api/available-datasets.json endpoint.\r\n */\r\nexport const ApiAvailableDatasetsSchema = z\r\n .object({\r\n datasets: z.array(z.lazy(() => ApiDatasetSchema)).meta({\r\n description: 'The list of datasets that are available in the API.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiAvailableDatasets',\r\n description:\r\n 'The list of available datasets. Maps to the /api/available-datasets.json endpoint.',\r\n });\r\n\r\nexport type ApiAvailableDatasets = z.infer<typeof ApiAvailableDatasetsSchema>;\r\n\r\n/**\r\n * Defines a dataset that is used in the API.\r\n */\r\nexport const ApiDatasetSchema = DatasetSchema.extend({\r\n /**\r\n * The API link for the list of books for this dataset.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description:\r\n 'The API link for the list of books for this dataset. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.literal('json')),\r\n\r\n /**\r\n * The number of books that are contained in this dataset.\r\n */\r\n numberOfBooks: z.number().meta({\r\n description: 'The number of books that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this dataset.\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n description:\r\n 'The total number of chapters that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this dataset.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description:\r\n 'The total number of verses that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * The total number of references that are contained in this dataset.\r\n */\r\n totalNumberOfReferences: z.number().meta({\r\n description:\r\n 'The total number of references that are contained in this dataset.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the commentary is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description:\r\n 'Gets the name of the language that the dataset is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description:\r\n \"Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\",\r\n }),\r\n\r\n /**\r\n * The API link for the list of people for this dataset.\r\n * Omitted if the dataset doesn't contain people.\r\n */\r\n listOfPeopleApiLink: z.string().optional().meta({\r\n description:\r\n \"The API link for the list of people for this dataset. Relative to the API origin. Omitted if the dataset doesn't contain people.\",\r\n }),\r\n\r\n /**\r\n * The API link for the list of places for this dataset.\r\n * Omitted if the dataset doesn't contain places.\r\n */\r\n listOfPlacesApiLink: z.string().optional().meta({\r\n description:\r\n \"The API link for the list of places for this dataset. Relative to the API origin. Omitted if the dataset doesn't contain places.\",\r\n }),\r\n\r\n /**\r\n * The API link for the list of events for this dataset.\r\n * Omitted if the dataset doesn't contain events.\r\n */\r\n listOfEventsApiLink: z.string().optional().meta({\r\n description:\r\n \"The API link for the list of events for this dataset. Relative to the API origin. Omitted if the dataset doesn't contain events.\",\r\n }),\r\n\r\n /**\r\n * The API link for the list of people groups for this dataset.\r\n * Omitted if the dataset doesn't contain people groups.\r\n */\r\n listOfPeopleGroupsApiLink: z.string().optional().meta({\r\n description:\r\n \"The API link for the list of people groups for this dataset. Relative to the API origin. Omitted if the dataset doesn't contain people groups.\",\r\n }),\r\n\r\n /**\r\n * The total number of people that are contained in this dataset.\r\n * Omitted if the dataset doesn't contain people.\r\n */\r\n totalNumberOfPeople: z.number().optional().meta({\r\n description:\r\n \"The total number of people that are contained in this dataset. Omitted if the dataset doesn't contain people.\",\r\n }),\r\n\r\n /**\r\n * The total number of places that are contained in this dataset.\r\n * Omitted if the dataset doesn't contain places.\r\n */\r\n totalNumberOfPlaces: z.number().optional().meta({\r\n description:\r\n \"The total number of places that are contained in this dataset. Omitted if the dataset doesn't contain places.\",\r\n }),\r\n\r\n /**\r\n * The total number of events that are contained in this dataset.\r\n * Omitted if the dataset doesn't contain events.\r\n */\r\n totalNumberOfEvents: z.number().optional().meta({\r\n description:\r\n \"The total number of events that are contained in this dataset. Omitted if the dataset doesn't contain events.\",\r\n }),\r\n\r\n /**\r\n * The total number of people groups that are contained in this dataset.\r\n * Omitted if the dataset doesn't contain people groups.\r\n */\r\n totalNumberOfPeopleGroups: z.number().optional().meta({\r\n description:\r\n \"The total number of people groups that are contained in this dataset. Omitted if the dataset doesn't contain people groups.\",\r\n }),\r\n}).meta({\r\n id: 'ApiDataset',\r\n description: 'Defines a dataset that is used in the API.',\r\n});\r\n\r\nexport type ApiDataset = z.infer<typeof ApiDatasetSchema>;\r\n\r\n/**\r\n * Defines a translation that is used in the API.\r\n */\r\nexport const ApiTranslationSchema = TranslationSchema.extend({\r\n /**\r\n * The API link for the list of available books for this translation.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description:\r\n 'The API link for the list of books for this translation. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.enum(['json', 'usfm'])),\r\n\r\n /**\r\n * The number of books that are contained in this translation.\r\n *\r\n * Complete translations should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: z.number().meta({\r\n description:\r\n 'The number of books that are contained in this translation. Complete translations should have the same number of books as the Bible (66).',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this translation.\r\n *\r\n * Complete translations should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n description:\r\n '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).',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this translation.\r\n *\r\n * 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).\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description:\r\n '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).',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal books that are contained in this translation.\r\n */\r\n numberOfApocryphalBooks: z.number().optional().meta({\r\n description:\r\n 'The total number of apocryphal books that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal chapters that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalChapters: z.number().optional().meta({\r\n description:\r\n 'The total number of apocryphal chapters that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * The total number of apocryphal verses that are contained in this translation.\r\n */\r\n totalNumberOfApocryphalVerses: z.number().optional().meta({\r\n description:\r\n 'The total number of apocryphal verses that are contained in this translation.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the translation is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description:\r\n 'Gets the name of the language that the translation is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description:\r\n \"Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\",\r\n }),\r\n\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file.\r\n *\r\n * Undefined if complete translation files are not available.\r\n */\r\n completeTranslationApiLink: z.string().optional().meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The API link for downloading the complete translation as a single JSON file,\r\n * using the simplified chapter format.\r\n *\r\n * Undefined if complete translation files are not available.\r\n */\r\n simpleCompleteTranslationApiLink: z.string().optional().meta({\r\n description:\r\n '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.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslation',\r\n description: 'Defines a translation that is used in the API.',\r\n});\r\n\r\nexport type ApiTranslation = z.infer<typeof ApiTranslationSchema>;\r\n\r\n/**\r\n * Defines the complete translation download data.\r\n * Maps to the /api/:translationId/complete.json endpoint.\r\n */\r\nexport const ApiTranslationCompleteSchema = z\r\n .object({\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: z\r\n .lazy(() => ApiTranslationSchema)\r\n .meta({\r\n description: 'The translation metadata.',\r\n }),\r\n\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: z.array(z.lazy(() => ApiTranslationCompleteBookSchema)).meta({\r\n description: 'The complete list of books with all their chapters.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiTranslationComplete',\r\n description:\r\n 'Defines the complete translation download data. Maps to the /api/:translationId/complete.json endpoint.',\r\n });\r\n\r\nexport type ApiTranslationComplete = z.infer<\r\n typeof ApiTranslationCompleteSchema\r\n>;\r\n\r\n/**\r\n * A chapter in the complete translation download.\r\n */\r\n// Word annotations are published as separate files, and are linked to by\r\n// thisChapterWordsLink instead of being included inline, same as the regular\r\n// per-chapter endpoint.\r\nexport const TranslationCompleteChapterSchema =\r\n TranslationBookChapterSchema.omit({ thisChapterWords: true })\r\n .extend({\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The link to the word-level annotations for the chapter.\r\n * Omitted if the chapter doesn't have any word-level annotations.\r\n */\r\n thisChapterWordsLink: z.string().optional().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n })\r\n .meta({\r\n id: 'TranslationCompleteChapter',\r\n description: 'A chapter in the complete translation download.',\r\n });\r\n\r\nexport type TranslationCompleteChapter = z.infer<\r\n typeof TranslationCompleteChapterSchema\r\n>;\r\n\r\n/**\r\n * A chapter in the complete translation download, using the simplified chapter format.\r\n */\r\nexport const SimpleTranslationCompleteChapterSchema =\r\n SimpleTranslationBookChapterSchema.omit({ thisChapterWords: true })\r\n .extend({\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The link to the word-level annotations for the chapter.\r\n * Omitted if the chapter doesn't have any word-level annotations.\r\n */\r\n thisChapterWordsLink: z.string().optional().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleTranslationCompleteChapter',\r\n description:\r\n 'A chapter in the complete translation download, using the simplified chapter format.',\r\n });\r\n\r\nexport type SimpleTranslationCompleteChapter = z.infer<\r\n typeof SimpleTranslationCompleteChapterSchema\r\n>;\r\n\r\n/**\r\n * A book in the complete translation download.\r\n */\r\nexport const ApiTranslationCompleteBookSchema = TranslationBookSchema.extend({\r\n /**\r\n * The number of chapters in the book.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters in the book.',\r\n }),\r\n\r\n /**\r\n * The total number of verses in the book.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The total number of verses in the book.',\r\n }),\r\n\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: z.array(TranslationCompleteChapterSchema).meta({\r\n description: 'The complete list of chapters with all content.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationCompleteBook',\r\n description: 'A book in the complete translation download.',\r\n});\r\n\r\nexport type ApiTranslationCompleteBook = z.infer<\r\n typeof ApiTranslationCompleteBookSchema\r\n>;\r\n\r\n/**\r\n * Defines the complete translation download data, using the simplified chapter format.\r\n * Maps to the /api/:translationId/complete.simple.json endpoint.\r\n */\r\nexport const ApiSimpleTranslationCompleteSchema = z\r\n .object({\r\n /**\r\n * The translation metadata.\r\n */\r\n translation: z\r\n .lazy(() => ApiTranslationSchema)\r\n .meta({\r\n description: 'The translation metadata.',\r\n }),\r\n\r\n /**\r\n * The complete list of books with all their chapters.\r\n */\r\n books: z\r\n .array(z.lazy(() => ApiSimpleTranslationCompleteBookSchema))\r\n .meta({\r\n description:\r\n 'The complete list of books with all their chapters.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiSimpleTranslationComplete',\r\n description:\r\n 'Defines the complete translation download data, using the simplified chapter format. Maps to the /api/:translationId/complete.simple.json endpoint.',\r\n });\r\n\r\nexport type ApiSimpleTranslationComplete = z.infer<\r\n typeof ApiSimpleTranslationCompleteSchema\r\n>;\r\n\r\n/**\r\n * A book in the complete translation download, using the simplified chapter format.\r\n */\r\nexport const ApiSimpleTranslationCompleteBookSchema =\r\n ApiTranslationCompleteBookSchema.extend({\r\n /**\r\n * The complete list of chapters with all content.\r\n */\r\n chapters: z.array(SimpleTranslationCompleteChapterSchema).meta({\r\n description: 'The complete list of chapters with all content.',\r\n }),\r\n }).meta({\r\n id: 'ApiSimpleTranslationCompleteBook',\r\n description:\r\n 'A book in the complete translation download, using the simplified chapter format.',\r\n });\r\n\r\nexport type ApiSimpleTranslationCompleteBook = z.infer<\r\n typeof ApiSimpleTranslationCompleteBookSchema\r\n>;\r\n\r\n/**\r\n * Defines a commentary that is used in the API.\r\n */\r\nexport const ApiCommentarySchema = CommentarySchema.extend({\r\n /**\r\n * The API link for the list of available books for this translation.\r\n */\r\n listOfBooksApiLink: z.string().meta({\r\n description:\r\n 'The API link for the list of books for this commentary. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The API link for the list of available profiles for this commentary.\r\n */\r\n listOfProfilesApiLink: z.string().meta({\r\n description:\r\n 'The API link for the list of profiles for this commentary. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The available list of formats.\r\n */\r\n availableFormats: z.array(z.enum(['json', 'usfm'])),\r\n\r\n /**\r\n * The number of books that are contained in this commentary.\r\n *\r\n * Complete commentaries should have the same number of books as the Bible (66).\r\n */\r\n numberOfBooks: z.number().meta({\r\n description:\r\n 'The number of books that are contained in this commentary. Complete commentaries should have the same number of books as the Bible (66).',\r\n }),\r\n\r\n /**\r\n * The total number of chapters that are contained in this translation.\r\n *\r\n * Complete commentaries should have the same number of chapters as the Bible (1,189).\r\n */\r\n totalNumberOfChapters: z.number().meta({\r\n description:\r\n '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).',\r\n }),\r\n\r\n /**\r\n * The total number of verses that are contained in this commentary.\r\n *\r\n * 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).\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description:\r\n '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).',\r\n }),\r\n\r\n /**\r\n * The total number of profiles that are contained in this commentary.\r\n *\r\n * Profiles are used to provide additional information about people and people groups that are mentioned in the Bible.\r\n */\r\n totalNumberOfProfiles: z.number().meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language that the commentary is in.\r\n * Null or undefined if the name of the language is not known.\r\n */\r\n languageName: z.string().optional().meta({\r\n description:\r\n 'Gets the name of the language that the commentary is in. Null or undefined if the name of the language is not known.',\r\n }),\r\n\r\n /**\r\n * Gets the name of the language in English.\r\n * Null or undefined if the language doesn't have an english name.\r\n */\r\n languageEnglishName: z.string().optional().meta({\r\n description:\r\n \"Gets the name of the language in English. Null or undefined if the language doesn't have an english name.\",\r\n }),\r\n}).meta({\r\n id: 'ApiCommentary',\r\n description: 'Defines a commentary that is used in the API.',\r\n});\r\n\r\nexport type ApiCommentary = z.infer<typeof ApiCommentarySchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a translation.\r\n */\r\nexport const ApiTranslationBooksSchema = z\r\n .object({\r\n /**\r\n * The translation information for the books.\r\n */\r\n translation: z\r\n .lazy(() => ApiTranslationSchema)\r\n .meta({\r\n description: 'The translation information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: z.array(z.lazy(() => ApiTranslationBookSchema)).meta({\r\n description:\r\n 'The list of books that are available for the translation.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiTranslationBooks',\r\n description:\r\n 'Defines an interface that contains information about the books that are available for a translation.',\r\n });\r\n\r\nexport type ApiTranslationBooks = z.infer<typeof ApiTranslationBooksSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a commentary.\r\n */\r\nexport const ApiCommentaryBooksSchema = z\r\n .object({\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: z\r\n .lazy(() => ApiCommentarySchema)\r\n .meta({\r\n description: 'The commentary information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: z.array(z.lazy(() => ApiCommentaryBookSchema)).meta({\r\n description:\r\n 'The list of books that are available for the commentary.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiCommentaryBooks',\r\n description:\r\n 'Defines an interface that contains information about the books that are available for a commentary.',\r\n });\r\n\r\nexport type ApiCommentaryBooks = z.infer<typeof ApiCommentaryBooksSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about the books that are available for a dataset.\r\n */\r\nexport const ApiDatasetBooksSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the books.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the books.',\r\n }),\r\n\r\n /**\r\n * The list of books that are available for the dataset.\r\n */\r\n books: z.array(z.lazy(() => ApiDatasetBookSchema)).meta({\r\n description:\r\n 'The list of books that are available for the dataset.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetBooks',\r\n description:\r\n 'Defines an interface that contains information about the books that are available for a dataset.',\r\n });\r\n\r\nexport type ApiDatasetBooks = z.infer<typeof ApiDatasetBooksSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for a summary of a person in a dataset.\r\n */\r\nexport const ApiDatasetPersonSummarySchema = z\r\n .object({\r\n /**\r\n * The ID of the person.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the person.',\r\n }),\r\n\r\n /**\r\n * The name of the person.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the person.',\r\n }),\r\n\r\n /**\r\n * Whether the name of the person is a proper name.\r\n */\r\n isProperName: z.boolean().optional().meta({\r\n description: 'Whether the name of the person is a proper name.',\r\n }),\r\n\r\n /**\r\n * The gender of the person.\r\n */\r\n gender: z.string().optional().meta({\r\n description: 'The gender of the person.',\r\n }),\r\n\r\n /**\r\n * The number of Bible references that mention the person.\r\n */\r\n numberOfReferences: z.number().meta({\r\n description:\r\n 'The number of Bible references that mention the person.',\r\n }),\r\n\r\n /**\r\n * The API link for the person.\r\n */\r\n thisPersonApiLink: z.string().meta({\r\n description:\r\n 'The API link for the person. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPersonSummary',\r\n description: 'Defines a summary of a person in a dataset.',\r\n });\r\n\r\nexport type ApiDatasetPersonSummary = z.infer<\r\n typeof ApiDatasetPersonSummarySchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the list of people in a dataset.\r\n * Maps to the /api/d/:datasetId/people.json endpoint.\r\n */\r\nexport const ApiDatasetPeopleSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the people.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the people.',\r\n }),\r\n\r\n /**\r\n * The list of people that are available for the dataset.\r\n */\r\n people: z.array(ApiDatasetPersonSummarySchema).meta({\r\n description:\r\n 'The list of people that are available for the dataset.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPeople',\r\n description:\r\n 'The list of people in a dataset. Maps to the /api/d/:datasetId/people.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPeople = z.infer<typeof ApiDatasetPeopleSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the information about a person in a dataset.\r\n * Maps to the /api/d/:datasetId/people/:personId.json endpoint.\r\n */\r\nexport const ApiDatasetPersonSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the person.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the person.',\r\n }),\r\n\r\n /**\r\n * The information about the person.\r\n */\r\n person: DatasetPersonSchema.meta({\r\n description: 'The information about the person.',\r\n }),\r\n\r\n /**\r\n * The API link for this person.\r\n */\r\n thisPersonApiLink: z.string().meta({\r\n description:\r\n 'The API link for this person. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPerson',\r\n description:\r\n 'The information about a person in a dataset. Maps to the /api/d/:datasetId/people/:personId.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPerson = z.infer<typeof ApiDatasetPersonSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for a summary of a place in a dataset.\r\n */\r\nexport const ApiDatasetPlaceSummarySchema = z\r\n .object({\r\n /**\r\n * The ID of the place.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the place.',\r\n }),\r\n\r\n /**\r\n * The name of the place.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the place.',\r\n }),\r\n\r\n /**\r\n * The type of geographical feature that the place is.\r\n */\r\n featureType: z.string().optional().meta({\r\n description:\r\n 'The type of geographical feature that the place is. For example, \"City\", \"Region\", \"Mountain\", \"Water\", etc.',\r\n }),\r\n\r\n /**\r\n * The latitude of the place.\r\n */\r\n latitude: z.number().optional().meta({\r\n description: 'The latitude of the place.',\r\n }),\r\n\r\n /**\r\n * The longitude of the place.\r\n */\r\n longitude: z.number().optional().meta({\r\n description: 'The longitude of the place.',\r\n }),\r\n\r\n /**\r\n * The number of Bible references that mention the place.\r\n */\r\n numberOfReferences: z.number().meta({\r\n description:\r\n 'The number of Bible references that mention the place.',\r\n }),\r\n\r\n /**\r\n * The API link for the place.\r\n */\r\n thisPlaceApiLink: z.string().meta({\r\n description:\r\n 'The API link for the place. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPlaceSummary',\r\n description: 'Defines a summary of a place in a dataset.',\r\n });\r\n\r\nexport type ApiDatasetPlaceSummary = z.infer<\r\n typeof ApiDatasetPlaceSummarySchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the list of places in a dataset.\r\n * Maps to the /api/d/:datasetId/places.json endpoint.\r\n */\r\nexport const ApiDatasetPlacesSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the places.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the places.',\r\n }),\r\n\r\n /**\r\n * The list of places that are available for the dataset.\r\n */\r\n places: z.array(ApiDatasetPlaceSummarySchema).meta({\r\n description:\r\n 'The list of places that are available for the dataset.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPlaces',\r\n description:\r\n 'The list of places in a dataset. Maps to the /api/d/:datasetId/places.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPlaces = z.infer<typeof ApiDatasetPlacesSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the information about a place in a dataset.\r\n * Maps to the /api/d/:datasetId/places/:placeId.json endpoint.\r\n */\r\nexport const ApiDatasetPlaceSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the place.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the place.',\r\n }),\r\n\r\n /**\r\n * The information about the place.\r\n */\r\n place: DatasetPlaceSchema.meta({\r\n description: 'The information about the place.',\r\n }),\r\n\r\n /**\r\n * The API link for this place.\r\n */\r\n thisPlaceApiLink: z.string().meta({\r\n description:\r\n 'The API link for this place. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPlace',\r\n description:\r\n 'The information about a place in a dataset. Maps to the /api/d/:datasetId/places/:placeId.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPlace = z.infer<typeof ApiDatasetPlaceSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for a summary of an event in a dataset.\r\n */\r\nexport const ApiDatasetEventSummarySchema = z\r\n .object({\r\n /**\r\n * The ID of the event.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the event.',\r\n }),\r\n\r\n /**\r\n * The name of the event.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the event.',\r\n }),\r\n\r\n /**\r\n * The date that the event started at.\r\n */\r\n startDate: z.string().optional().meta({\r\n description:\r\n 'The date that the event started at. Negative numbers are years BC. Positive numbers are years AD. More specific dates use the `YYYY-MM-DD` format.',\r\n }),\r\n\r\n /**\r\n * The number of Bible references that describe the event.\r\n */\r\n numberOfReferences: z.number().meta({\r\n description:\r\n 'The number of Bible references that describe the event.',\r\n }),\r\n\r\n /**\r\n * The API link for the event.\r\n */\r\n thisEventApiLink: z.string().meta({\r\n description:\r\n 'The API link for the event. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetEventSummary',\r\n description: 'Defines a summary of an event in a dataset.',\r\n });\r\n\r\nexport type ApiDatasetEventSummary = z.infer<\r\n typeof ApiDatasetEventSummarySchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the list of events in a dataset.\r\n * Maps to the /api/d/:datasetId/events.json endpoint.\r\n */\r\nexport const ApiDatasetEventsSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the events.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the events.',\r\n }),\r\n\r\n /**\r\n * The list of events that are available for the dataset.\r\n */\r\n events: z.array(ApiDatasetEventSummarySchema).meta({\r\n description:\r\n 'The list of events that are available for the dataset.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetEvents',\r\n description:\r\n 'The list of events in a dataset. Maps to the /api/d/:datasetId/events.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetEvents = z.infer<typeof ApiDatasetEventsSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the information about an event in a dataset.\r\n * Maps to the /api/d/:datasetId/events/:eventId.json endpoint.\r\n */\r\nexport const ApiDatasetEventSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the event.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the event.',\r\n }),\r\n\r\n /**\r\n * The information about the event.\r\n */\r\n event: DatasetEventSchema.meta({\r\n description: 'The information about the event.',\r\n }),\r\n\r\n /**\r\n * The API link for this event.\r\n */\r\n thisEventApiLink: z.string().meta({\r\n description:\r\n 'The API link for this event. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetEvent',\r\n description:\r\n 'The information about an event in a dataset. Maps to the /api/d/:datasetId/events/:eventId.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetEvent = z.infer<typeof ApiDatasetEventSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for a summary of a people group in a dataset.\r\n */\r\nexport const ApiDatasetPeopleGroupSummarySchema = z\r\n .object({\r\n /**\r\n * The ID of the people group.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the people group.',\r\n }),\r\n\r\n /**\r\n * The name of the people group.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the people group.',\r\n }),\r\n\r\n /**\r\n * The number of people that are members of the people group.\r\n */\r\n numberOfMembers: z.number().meta({\r\n description:\r\n 'The number of people that are members of the people group.',\r\n }),\r\n\r\n /**\r\n * The API link for the people group.\r\n */\r\n thisPeopleGroupApiLink: z.string().meta({\r\n description:\r\n 'The API link for the people group. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPeopleGroupSummary',\r\n description: 'Defines a summary of a people group in a dataset.',\r\n });\r\n\r\nexport type ApiDatasetPeopleGroupSummary = z.infer<\r\n typeof ApiDatasetPeopleGroupSummarySchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the list of people groups in a dataset.\r\n * Maps to the /api/d/:datasetId/groups.json endpoint.\r\n */\r\nexport const ApiDatasetPeopleGroupsSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the people groups.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the people groups.',\r\n }),\r\n\r\n /**\r\n * The list of people groups that are available for the dataset.\r\n */\r\n groups: z.array(ApiDatasetPeopleGroupSummarySchema).meta({\r\n description:\r\n 'The list of people groups that are available for the dataset.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPeopleGroups',\r\n description:\r\n 'The list of people groups in a dataset. Maps to the /api/d/:datasetId/groups.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPeopleGroups = z.infer<\r\n typeof ApiDatasetPeopleGroupsSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the information about a people group in a dataset.\r\n * Maps to the /api/d/:datasetId/groups/:groupId.json endpoint.\r\n */\r\nexport const ApiDatasetPeopleGroupSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the people group.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the people group.',\r\n }),\r\n\r\n /**\r\n * The information about the people group.\r\n */\r\n group: DatasetPeopleGroupSchema.meta({\r\n description: 'The information about the people group.',\r\n }),\r\n\r\n /**\r\n * The API link for this people group.\r\n */\r\n thisPeopleGroupApiLink: z.string().meta({\r\n description:\r\n 'The API link for this people group. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetPeopleGroup',\r\n description:\r\n 'The information about a people group in a dataset. Maps to the /api/d/:datasetId/groups/:groupId.json endpoint.',\r\n });\r\n\r\nexport type ApiDatasetPeopleGroup = z.infer<typeof ApiDatasetPeopleGroupSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for a person that appears in a chapter of a dataset.\r\n */\r\nexport const ApiDatasetChapterPersonSchema = z\r\n .object({\r\n /**\r\n * The ID of the person.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the person.',\r\n }),\r\n\r\n /**\r\n * The name of the person.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the person.',\r\n }),\r\n\r\n /**\r\n * Whether the name of the person is a proper name.\r\n */\r\n isProperName: z.boolean().optional().meta({\r\n description: 'Whether the name of the person is a proper name.',\r\n }),\r\n\r\n /**\r\n * The gender of the person.\r\n */\r\n gender: z.string().optional().meta({\r\n description: 'The gender of the person.',\r\n }),\r\n\r\n /**\r\n * The year that the person was born.\r\n * Negative numbers are years BC. Positive numbers are years AD.\r\n */\r\n birthYear: z.number().optional().meta({\r\n description:\r\n 'The year that the person was born. Negative numbers are years BC. Positive numbers are years AD.',\r\n }),\r\n\r\n /**\r\n * The year that the person died.\r\n * Negative numbers are years BC. Positive numbers are years AD.\r\n */\r\n deathYear: z.number().optional().meta({\r\n description:\r\n 'The year that the person died. Negative numbers are years BC. Positive numbers are years AD.',\r\n }),\r\n\r\n /**\r\n * The API link for the person.\r\n */\r\n apiLink: z.string().meta({\r\n description:\r\n 'The API link for the person. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The numbers of the verses in the chapter that mention the person.\r\n * Sorted in ascending order.\r\n */\r\n verses: z.array(z.number()).meta({\r\n description:\r\n 'The numbers of the verses in the chapter that mention the person. Sorted in ascending order.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetChapterPerson',\r\n description: 'Defines a person that appears in a chapter of a dataset.',\r\n });\r\n\r\nexport type ApiDatasetChapterPerson = z.infer<\r\n typeof ApiDatasetChapterPersonSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for a place that appears in a chapter of a dataset.\r\n */\r\nexport const ApiDatasetChapterPlaceSchema = z\r\n .object({\r\n /**\r\n * The ID of the place.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the place.',\r\n }),\r\n\r\n /**\r\n * The name of the place.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the place.',\r\n }),\r\n\r\n /**\r\n * The type of geographical feature that the place is.\r\n */\r\n featureType: z.string().optional().meta({\r\n description:\r\n 'The type of geographical feature that the place is. For example, \"City\", \"Region\", \"Mountain\", \"Water\", etc.',\r\n }),\r\n\r\n /**\r\n * The latitude of the place.\r\n */\r\n latitude: z.number().optional().meta({\r\n description: 'The latitude of the place.',\r\n }),\r\n\r\n /**\r\n * The longitude of the place.\r\n */\r\n longitude: z.number().optional().meta({\r\n description: 'The longitude of the place.',\r\n }),\r\n\r\n /**\r\n * The API link for the place.\r\n */\r\n apiLink: z.string().meta({\r\n description:\r\n 'The API link for the place. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The numbers of the verses in the chapter that mention the place.\r\n * Sorted in ascending order.\r\n */\r\n verses: z.array(z.number()).meta({\r\n description:\r\n 'The numbers of the verses in the chapter that mention the place. Sorted in ascending order.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetChapterPlace',\r\n description: 'Defines a place that appears in a chapter of a dataset.',\r\n });\r\n\r\nexport type ApiDatasetChapterPlace = z.infer<\r\n typeof ApiDatasetChapterPlaceSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for an event that appears in a chapter of a dataset.\r\n */\r\nexport const ApiDatasetChapterEventSchema = z\r\n .object({\r\n /**\r\n * The ID of the event.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the event.',\r\n }),\r\n\r\n /**\r\n * The name of the event.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the event.',\r\n }),\r\n\r\n /**\r\n * The date that the event started at.\r\n */\r\n startDate: z.string().optional().meta({\r\n description:\r\n 'The date that the event started at. Negative numbers are years BC. Positive numbers are years AD. More specific dates use the `YYYY-MM-DD` format.',\r\n }),\r\n\r\n /**\r\n * The API link for the event.\r\n */\r\n apiLink: z.string().meta({\r\n description:\r\n 'The API link for the event. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The numbers of the verses in the chapter that describe the event.\r\n * Sorted in ascending order.\r\n */\r\n verses: z.array(z.number()).meta({\r\n description:\r\n 'The numbers of the verses in the chapter that describe the event. Sorted in ascending order.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetChapterEvent',\r\n description: 'Defines an event that appears in a chapter of a dataset.',\r\n });\r\n\r\nexport type ApiDatasetChapterEvent = z.infer<\r\n typeof ApiDatasetChapterEventSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the entity data for a chapter in a dataset.\r\n */\r\nexport const ApiDatasetEntityChapterDataSchema = z\r\n .object({\r\n /**\r\n * The number of the chapter.\r\n */\r\n number: z.number().meta({\r\n description: 'The number of the chapter.',\r\n }),\r\n\r\n /**\r\n * The people that appear in the chapter.\r\n * Sorted by the first verse that they appear in.\r\n */\r\n people: z.array(ApiDatasetChapterPersonSchema).meta({\r\n description:\r\n 'The people that appear in the chapter. Sorted by the first verse that they appear in.',\r\n }),\r\n\r\n /**\r\n * The places that appear in the chapter.\r\n * Sorted by the first verse that they appear in.\r\n */\r\n places: z.array(ApiDatasetChapterPlaceSchema).meta({\r\n description:\r\n 'The places that appear in the chapter. Sorted by the first verse that they appear in.',\r\n }),\r\n\r\n /**\r\n * The events that appear in the chapter.\r\n * Sorted by the first verse that they appear in.\r\n */\r\n events: z.array(ApiDatasetChapterEventSchema).meta({\r\n description:\r\n 'The events that appear in the chapter. Sorted by the first verse that they appear in.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetEntityChapterData',\r\n description:\r\n 'Defines the entity data for a chapter in a dataset. Contains the people, places, and events that appear in the chapter.',\r\n });\r\n\r\nexport type ApiDatasetEntityChapterData = z.infer<\r\n typeof ApiDatasetEntityChapterDataSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the entities that appear in a chapter of a book for a dataset.\r\n * Maps to the /api/d/:datasetId/:bookId/:chapterNumber.json endpoint for datasets that contain entities.\r\n */\r\nexport const ApiDatasetEntityBookChapterSchema = z\r\n .object({\r\n /**\r\n * The dataset information for the book chapter.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z\r\n .lazy(() => ApiDatasetBookSchema)\r\n .meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The entity data for the chapter.\r\n */\r\n chapter: ApiDatasetEntityChapterDataSchema.meta({\r\n description: 'The entity data for the chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description:\r\n 'The link to this chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The reference for this chapter.\r\n */\r\n thisChapterReference: z\r\n .lazy(() => DatasetChapterReferenceSchema)\r\n .meta({\r\n description: 'The reference for this chapter.',\r\n }),\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The reference for the next chapter.\r\n * Null if this is the last chapter in the dataset.\r\n */\r\n nextChapterReference: z\r\n .lazy(() => DatasetChapterReferenceSchema)\r\n .nullable()\r\n .meta({\r\n description:\r\n 'The reference for the next chapter. Null if this is the last chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The reference for the previous chapter.\r\n * Null if this is the first chapter in the dataset.\r\n */\r\n previousChapterReference: z\r\n .lazy(() => DatasetChapterReferenceSchema)\r\n .nullable()\r\n .meta({\r\n description:\r\n 'The reference for the previous chapter. Null if this is the first chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The number of people that appear in the chapter.\r\n */\r\n numberOfPeople: z.number().meta({\r\n description: 'The number of people that appear in the chapter.',\r\n }),\r\n\r\n /**\r\n * The number of places that appear in the chapter.\r\n */\r\n numberOfPlaces: z.number().meta({\r\n description: 'The number of places that appear in the chapter.',\r\n }),\r\n\r\n /**\r\n * The number of events that appear in the chapter.\r\n */\r\n numberOfEvents: z.number().meta({\r\n description: 'The number of events that appear in the chapter.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiDatasetEntityBookChapter',\r\n description:\r\n 'The entities (people, places, and events) that appear in a chapter of a book for a dataset. Maps to the /api/d/:datasetId/:bookId/:chapterNumber.json endpoint for datasets that contain entities.',\r\n });\r\n\r\nexport type ApiDatasetEntityBookChapter = z.infer<\r\n typeof ApiDatasetEntityBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about the profiles that are available for a commentary.\r\n */\r\nexport const ApiCommentaryProfilesSchema = z\r\n .object({\r\n /**\r\n * The commentary information for the books.\r\n */\r\n commentary: z\r\n .lazy(() => ApiCommentarySchema)\r\n .meta({\r\n description: 'The commentary information for the profiles.',\r\n }),\r\n\r\n /**\r\n * The list of profiles that are available for the commentary.\r\n */\r\n profiles: z.array(z.lazy(() => ApiCommentaryProfileSchema)).meta({\r\n description:\r\n 'The list of profiles that are available for the commentary.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiCommentaryProfiles',\r\n description:\r\n 'Defines an interface that contains information about the profiles that are available for a commentary.',\r\n });\r\n\r\nexport type ApiCommentaryProfiles = z.infer<typeof ApiCommentaryProfilesSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a profile.\r\n */\r\nexport const ApiCommentaryProfileSchema = CommentaryProfileSchema.extend({\r\n /**\r\n * The link to this profile.\r\n */\r\n thisProfileLink: z.string().meta({\r\n description:\r\n 'The API link for this profile. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The link to the chapter that this profile references in the commentary.\r\n */\r\n referenceChapterLink: z.string().nullable().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryProfile',\r\n description:\r\n 'Defines an interface that contains information about a profile.',\r\n});\r\n\r\nexport type ApiCommentaryProfile = z.infer<typeof ApiCommentaryProfileSchema>;\r\n\r\nexport const TranslationChapterReferenceSchema = z\r\n .object({\r\n translationId: z.string().meta({\r\n description:\r\n 'The ID of the translation that the chapter reference is for.',\r\n }),\r\n\r\n book: BookIdSchema,\r\n\r\n chapter: z.int().positive().meta({\r\n description: 'The chapter number of the chapter reference.',\r\n }),\r\n })\r\n .meta({\r\n id: 'TranslationChapterReference',\r\n description: 'Defines a reference to a chapter in a translation.',\r\n });\r\n\r\nexport type TranslationChapterReference = z.infer<\r\n typeof TranslationChapterReferenceSchema\r\n>;\r\n\r\nexport const CommentaryChapterReferenceSchema = z\r\n .object({\r\n commentaryId: z.string().meta({\r\n description:\r\n 'The ID of the commentary that the chapter reference is for.',\r\n }),\r\n\r\n book: BookIdSchema,\r\n\r\n chapter: z.int().positive().meta({\r\n description: 'The chapter number of the chapter reference.',\r\n }),\r\n })\r\n .meta({\r\n id: 'CommentaryChapterReference',\r\n description: 'Defines a reference to a chapter in a commentary.',\r\n });\r\n\r\nexport type CommentaryChapterReference = z.infer<\r\n typeof CommentaryChapterReferenceSchema\r\n>;\r\n\r\nexport const DatasetChapterReferenceSchema = z\r\n .object({\r\n datasetId: z.string().meta({\r\n description:\r\n 'The ID of the dataset that the chapter reference is for.',\r\n }),\r\n\r\n book: BookIdSchema,\r\n\r\n chapter: z.int().positive().meta({\r\n description: 'The chapter number of the chapter reference.',\r\n }),\r\n })\r\n .meta({\r\n id: 'DatasetChapterReference',\r\n description: 'Defines a reference to a chapter in a dataset.',\r\n });\r\n\r\nexport type DatasetChapterReference = z.infer<\r\n typeof DatasetChapterReferenceSchema\r\n>;\r\n\r\n/**\r\n * Defines a translation book that is used in the API.\r\n */\r\nexport const ApiTranslationBookSchema = TranslationBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: z.number().meta({\r\n description: 'The number of the first chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: z.string().meta({\r\n description: 'The link to the first chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The reference for the first chapter in the book.\r\n */\r\n firstChapterReference: TranslationChapterReferenceSchema,\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: z.number().meta({\r\n description: 'The number of the last chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: z.string().meta({\r\n description: 'The link to the last chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The reference for the last chapter in the book.\r\n */\r\n lastChapterReference: TranslationChapterReferenceSchema,\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBook',\r\n description:\r\n 'Defines a schema that contains information about a translation book.',\r\n});\r\n\r\nexport type ApiTranslationBook = z.infer<typeof ApiTranslationBookSchema>;\r\n\r\n/**\r\n * Defines a commentary book that is used in the API.\r\n */\r\nexport const ApiCommentaryBookSchema = CommentaryBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n firstChapterNumber: z.number().nullable().meta({\r\n description:\r\n 'The number of the first chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n firstChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the first chapter of the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The reference for the first chapter in the book.\r\n */\r\n firstChapterReference: CommentaryChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the first chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n lastChapterNumber: z.number().nullable().meta({\r\n description:\r\n 'The number of the last chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n *\r\n * Null if the comentary book has no chapters.\r\n */\r\n lastChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the last chapter of the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The reference for the last chapter in the book.\r\n */\r\n lastChapterReference: CommentaryChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the last chapter in the book. Null if the comentary book has no chapters.',\r\n }),\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiCommentaryBook',\r\n description:\r\n 'Defines a schema that contains information about a commentary book.',\r\n});\r\n\r\nexport type ApiCommentaryBook = z.infer<typeof ApiCommentaryBookSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book in a dataset.\r\n */\r\nexport const ApiDatasetBookSchema = DatasetBookSchema.extend({\r\n /**\r\n * The number of the first chapter in the book.\r\n */\r\n firstChapterNumber: z.number().meta({\r\n description: 'The number of the first chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the first chapter of the book.\r\n */\r\n firstChapterApiLink: z.string().meta({\r\n description: 'The link to the first chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The reference for the first chapter in the book.\r\n */\r\n firstChapterReference: DatasetChapterReferenceSchema,\r\n\r\n /**\r\n * The number of the last chapter in the book.\r\n */\r\n lastChapterNumber: z.number().meta({\r\n description: 'The number of the last chapter in the book.',\r\n }),\r\n\r\n /**\r\n * The link to the last chapter of the book.\r\n */\r\n lastChapterApiLink: z.string().meta({\r\n description: 'The link to the last chapter of the book.',\r\n }),\r\n\r\n /**\r\n * The reference for the last chapter in the book.\r\n */\r\n lastChapterReference: DatasetChapterReferenceSchema,\r\n\r\n /**\r\n * The number of chapters that the book contains.\r\n */\r\n numberOfChapters: z.number().meta({\r\n description: 'The number of chapters that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the book contains.\r\n */\r\n totalNumberOfVerses: z.number().meta({\r\n description: 'The number of verses that the book contains.',\r\n }),\r\n\r\n /**\r\n * The number of references that the book contains.\r\n */\r\n totalNumberOfReferences: z.number().meta({\r\n description: 'The number of references that the book contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiDatasetBook',\r\n description:\r\n 'Defines a schema that contains information about a book in a dataset.',\r\n});\r\n\r\nexport type ApiDatasetBook = z.infer<typeof ApiDatasetBookSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\n// The word annotations are published as a separate file, and are linked to by\r\n// thisChapterWordsLink instead of being included inline.\r\nconst ApiTranslationBookChapterBaseSchema = TranslationBookChapterSchema.omit({\r\n thisChapterWords: true,\r\n});\r\n\r\nexport const ApiTranslationBookChapterSchema =\r\n ApiTranslationBookChapterBaseSchema.extend({\r\n /**\r\n * The translation information for the book chapter.\r\n */\r\n translation: z\r\n .lazy(() => ApiTranslationSchema)\r\n .meta({\r\n description:\r\n 'The translation information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z\r\n .lazy(() => ApiTranslationBookSchema)\r\n .meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description:\r\n 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The reference for this chapter.\r\n */\r\n thisChapterReference: TranslationChapterReferenceSchema,\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The reference for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterReference: TranslationChapterReferenceSchema.nullable().meta(\r\n {\r\n description:\r\n 'The reference for the next chapter. Null if this is the last chapter in the translation.',\r\n }\r\n ),\r\n\r\n /**\r\n * The links to the audio versions for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioLinks: z\r\n .record(z.string(), z.string())\r\n .nullable()\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The links to the audio timings for different audio versions for the chapter.\r\n */\r\n thisChapterAudioTimings: z\r\n .record(z.string(), z.string())\r\n .meta({\r\n description:\r\n 'The links to the audio timings for different audio versions for the chapter. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The links to the audio timings for different audio versions for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioTimings: z\r\n .record(z.string(), z.string())\r\n .nullable()\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The links to the audio timings for different audio versions for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioTimings: z\r\n .record(z.string(), z.string())\r\n .nullable()\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The reference for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterReference:\r\n TranslationChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the previous chapter. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The links to the audio versions for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioLinks: z\r\n .record(z.string(), z.string())\r\n .nullable()\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The link to the word-level annotations for the chapter.\r\n * Omitted if the chapter doesn't have any word-level annotations.\r\n */\r\n thisChapterWordsLink: z.string().optional().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n\r\n /**\r\n * The link to the word-level annotations for the next chapter.\r\n * Omitted if this is the last chapter in the translation, or if the next\r\n * chapter doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink: z.string().optional().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n\r\n /**\r\n * The link to the word-level annotations for the previous chapter.\r\n * Omitted if this is the first chapter in the translation, or if the\r\n * previous chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink: z.string().optional().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The link to the simplified version of this chapter.\r\n * Omitted if simplified chapters were not generated.\r\n */\r\n simpleChapterApiLink: z.string().optional().meta({\r\n description:\r\n 'The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available.',\r\n }),\r\n }).meta({\r\n id: 'ApiTranslationBookChapter',\r\n description:\r\n 'Defines an interface that contains information about a book chapter in a translation.',\r\n });\r\n\r\nexport type ApiTranslationBookChapter = z.infer<\r\n typeof ApiTranslationBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter in a translation,\r\n * using the simplified chapter format.\r\n */\r\nexport const ApiSimpleTranslationBookChapterSchema =\r\n ApiTranslationBookChapterSchema.omit({\r\n chapter: true,\r\n simpleChapterApiLink: true,\r\n })\r\n .extend({\r\n /**\r\n * The simplified information for the chapter.\r\n */\r\n chapter: z\r\n .lazy(() => SimpleChapterDataSchema)\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The link to the regular version of this chapter.\r\n */\r\n fullChapterApiLink: z.string().meta({\r\n description:\r\n 'The API link to the regular (non-simplified) version of this chapter. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiSimpleTranslationBookChapter',\r\n description:\r\n 'Defines an interface that contains information about a book chapter in a translation, using the simplified chapter format.',\r\n });\r\n\r\nexport type ApiSimpleTranslationBookChapter = z.infer<\r\n typeof ApiSimpleTranslationBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\nexport const ApiCommentaryBookChapterSchema =\r\n CommentaryBookChapterSchema.extend({\r\n /**\r\n * The commentary information for the book chapter.\r\n */\r\n commentary: z\r\n .lazy(() => ApiCommentarySchema)\r\n .meta({\r\n description: 'The commentary information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z\r\n .lazy(() => ApiCommentaryBookSchema)\r\n .meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description:\r\n 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n thisChapterReference: CommentaryChapterReferenceSchema,\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the commentary.',\r\n }),\r\n\r\n nextChapterReference: CommentaryChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the next chapter. Null if this is the last chapter in the commentary.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the commentary.',\r\n }),\r\n\r\n previousChapterReference:\r\n CommentaryChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the previous chapter. Null if this is the first chapter in the commentary.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The link to the simplified version of this chapter.\r\n * Omitted if simplified chapters were not generated.\r\n */\r\n simpleChapterApiLink: z.string().optional().meta({\r\n description:\r\n 'The API link to the simplified version of this chapter. Relative to the API origin. Omitted if simplified chapters are not available.',\r\n }),\r\n }).meta({\r\n id: 'ApiCommentaryBookChapter',\r\n description:\r\n 'Defines a schema that contains information about a book chapter in a commentary.',\r\n });\r\n\r\nexport type ApiCommentaryBookChapter = z.infer<\r\n typeof ApiCommentaryBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines a schema that contains information about a book chapter in a commentary,\r\n * using the simplified chapter format.\r\n */\r\nexport const ApiSimpleCommentaryBookChapterSchema =\r\n ApiCommentaryBookChapterSchema.omit({\r\n chapter: true,\r\n simpleChapterApiLink: true,\r\n })\r\n .extend({\r\n /**\r\n * The simplified information for the chapter.\r\n */\r\n chapter: z\r\n .lazy(() => SimpleCommentaryChapterDataSchema)\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n\r\n /**\r\n * The link to the regular version of this chapter.\r\n */\r\n fullChapterApiLink: z.string().meta({\r\n description:\r\n 'The API link to the regular (non-simplified) version of this chapter. Relative to the API origin.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ApiSimpleCommentaryBookChapter',\r\n description:\r\n 'Defines a schema that contains information about a book chapter in a commentary, using the simplified chapter format.',\r\n });\r\n\r\nexport type ApiSimpleCommentaryBookChapter = z.infer<\r\n typeof ApiSimpleCommentaryBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a book chapter.\r\n */\r\nexport const ApiDatasetBookChapterSchema = DatasetBookChapterSchema.extend({\r\n /**\r\n * The dataset information for the book chapter.\r\n */\r\n dataset: z\r\n .lazy(() => ApiDatasetSchema)\r\n .meta({\r\n description: 'The dataset information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The book information for the book chapter.\r\n */\r\n book: z\r\n .lazy(() => ApiDatasetBookSchema)\r\n .meta({\r\n description: 'The book information for the book chapter.',\r\n }),\r\n\r\n /**\r\n * The link to this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description:\r\n 'The API link for this chapter. Relative to the API origin.',\r\n }),\r\n\r\n thisChapterReference: DatasetChapterReferenceSchema,\r\n\r\n /**\r\n * The link to the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the next chapter. Relative to the API origin. Null if this is the last chapter in the dataset.',\r\n }),\r\n\r\n nextChapterReference: DatasetChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the next chapter. Null if this is the last chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The link to the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterApiLink: z.string().nullable().meta({\r\n description:\r\n 'The API link to the previous chapter. Relative to the API origin. Null if this is the first chapter in the dataset.',\r\n }),\r\n\r\n previousChapterReference: DatasetChapterReferenceSchema.nullable().meta({\r\n description:\r\n 'The reference for the previous chapter. Null if this is the first chapter in the dataset.',\r\n }),\r\n\r\n /**\r\n * The number of verses that the chapter contains.\r\n */\r\n numberOfVerses: z.number().meta({\r\n description: 'The number of verses that the chapter contains.',\r\n }),\r\n\r\n /**\r\n * The number of references that the chapter contains.\r\n */\r\n numberOfReferences: z.number().meta({\r\n description: 'The number of references that the chapter contains.',\r\n }),\r\n}).meta({\r\n id: 'ApiDatasetBookChapter',\r\n description:\r\n 'Defines a schema that contains information about a book chapter in a dataset.',\r\n});\r\n\r\nexport type ApiDatasetBookChapter = z.infer<typeof ApiDatasetBookChapterSchema>;\r\n\r\nexport const ApiTranslationBookChapterAudioSchema = z.object({\r\n /**\r\n * The chapter that the audio is for.\r\n */\r\n chapter: z\r\n .lazy(() => ApiTranslationBookChapterSchema)\r\n .meta({\r\n description: 'The chapter that the audio is for.',\r\n }),\r\n\r\n /**\r\n * The link that the audio should be placed at.\r\n */\r\n link: z.string().meta({\r\n description:\r\n 'The link that the audio should be placed at. Relative to the API origin.',\r\n }),\r\n\r\n /**\r\n * The original URL of the audio.\r\n */\r\n originalUrl: z.string().meta({\r\n description: 'The original URL of the audio.',\r\n }),\r\n});\r\n\r\nexport type ApiTranslationBookChapterAudio = z.infer<\r\n typeof ApiTranslationBookChapterAudioSchema\r\n>;\r\n\r\nexport const ApiTranslationBookChapterAudioTimingsSchema = z.object({\r\n /**\r\n * The ID of the translation.\r\n */\r\n translationId: z.string().meta({\r\n description: 'The ID of the translation.',\r\n }),\r\n\r\n /**\r\n * The ID of the book.\r\n */\r\n bookId: z.string().meta({\r\n description: 'The ID of the book.',\r\n }),\r\n\r\n /**\r\n * The number of the chapter.\r\n */\r\n chapterNumber: z.number().meta({\r\n description: 'The number of the chapter.',\r\n }),\r\n\r\n /**\r\n * The reader for the chapter.\r\n */\r\n reader: z.string().meta({\r\n description: 'The reader for the chapter.',\r\n }),\r\n\r\n /**\r\n * The link to the audio for these timings.\r\n */\r\n audioLink: z.string().meta({\r\n description: 'The link to the audio for these timings.',\r\n }),\r\n\r\n /**\r\n * The link to the information for this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description: 'The link to the information for this chapter.',\r\n }),\r\n\r\n /**\r\n * The link to the information for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the information for the next chapter. Null if this is the last chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The link to the information for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the information for the previous chapter. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The link to this audio timings file.\r\n */\r\n thisChapterAudioTimingsLink: z.string().meta({\r\n description: 'The link to this audio timings file.',\r\n }),\r\n\r\n /**\r\n * The link to the timings for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterAudioTimingsLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the timings for the next chapter. Null if this is the last chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The link to the timings for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterAudioTimingsLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the timings for the previous chapter. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The times in seconds at which each verse starts, in order.\r\n */\r\n verses: z.array(z.number()).meta({\r\n description:\r\n '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.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBookChapterAudioTimings',\r\n description:\r\n 'Defines an interface that contains the audio timings for a book chapter, for a specific reader.',\r\n});\r\n\r\nexport type ApiTranslationBookChapterAudioTimings = z.infer<\r\n typeof ApiTranslationBookChapterAudioTimingsSchema\r\n>;\r\n\r\nexport const ApiTranslationBookChapterWordsSchema = z.object({\r\n /**\r\n * The ID of the translation.\r\n */\r\n translationId: z.string().meta({\r\n description: 'The ID of the translation.',\r\n }),\r\n\r\n /**\r\n * The ID of the book.\r\n */\r\n bookId: z.string().meta({\r\n description: 'The ID of the book.',\r\n }),\r\n\r\n /**\r\n * The number of the chapter.\r\n */\r\n chapterNumber: z.number().meta({\r\n description: 'The number of the chapter.',\r\n }),\r\n\r\n /**\r\n * The link to the information for this chapter.\r\n */\r\n thisChapterLink: z.string().meta({\r\n description: 'The link to the information for this chapter.',\r\n }),\r\n\r\n /**\r\n * The link to the information for the next chapter.\r\n * Null if this is the last chapter in the translation.\r\n */\r\n nextChapterLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the information for the next chapter. Null if this is the last chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The link to the information for the previous chapter.\r\n * Null if this is the first chapter in the translation.\r\n */\r\n previousChapterLink: z.string().nullable().meta({\r\n description:\r\n 'The link to the information for the previous chapter. Null if this is the first chapter in the translation.',\r\n }),\r\n\r\n /**\r\n * The link to this words file.\r\n */\r\n thisChapterWordsLink: z.string().meta({\r\n description: 'The link to this words file.',\r\n }),\r\n\r\n /**\r\n * The link to the words for the next chapter.\r\n * Null if this is the last chapter in the translation, or if the next chapter\r\n * doesn't have any word-level annotations.\r\n */\r\n nextChapterWordsLink: z.string().nullable().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n\r\n /**\r\n * The link to the words for the previous chapter.\r\n * Null if this is the first chapter in the translation, or if the previous\r\n * chapter doesn't have any word-level annotations.\r\n */\r\n previousChapterWordsLink: z.string().nullable().meta({\r\n description:\r\n \"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.\",\r\n }),\r\n\r\n /**\r\n * The annotated words for each verse in the chapter.\r\n */\r\n verses: z.record(z.string(), z.array(z.lazy(() => ChapterWordSchema))).meta({\r\n description:\r\n '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.',\r\n }),\r\n}).meta({\r\n id: 'ApiTranslationBookChapterWords',\r\n description:\r\n 'Defines an interface that contains the word-level annotations for a book chapter.',\r\n});\r\n\r\n/**\r\n * Defines an interface that contains the word-level annotations for a book chapter,\r\n * with their offsets remapped onto the text of each simplified verse.\r\n */\r\nexport const ApiSimpleTranslationBookChapterWordsSchema =\r\n ApiTranslationBookChapterWordsSchema.extend({\r\n /**\r\n * The annotated words for each verse in the chapter.\r\n */\r\n verses: z\r\n .record(z.string(), z.array(z.lazy(() => SimpleChapterWordSchema)))\r\n .meta({\r\n description:\r\n '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.',\r\n }),\r\n }).meta({\r\n id: 'ApiSimpleTranslationBookChapterWords',\r\n description:\r\n 'Defines an interface that contains the word-level annotations for a book chapter, with their offsets remapped onto the text of each simplified verse.',\r\n });\r\n\r\nexport type ApiSimpleTranslationBookChapterWords = z.infer<\r\n typeof ApiSimpleTranslationBookChapterWordsSchema\r\n>;\r\n\r\nexport type ApiTranslationBookChapterWords = z.infer<\r\n typeof ApiTranslationBookChapterWordsSchema\r\n>;\r\n\r\nexport const ApiCommentaryProfileContentSchema = z.object({\r\n /**\r\n * The commentary information for the profile.\r\n */\r\n commentary: z\r\n .lazy(() => ApiCommentarySchema)\r\n .meta({\r\n description: 'The commentary information for the profile.',\r\n }),\r\n\r\n /**\r\n * The information about the profile.\r\n */\r\n profile: z\r\n .lazy(() => ApiCommentaryProfileSchema)\r\n .meta({\r\n description: 'The information about the profile.',\r\n }),\r\n\r\n /**\r\n * The content of the profile.\r\n */\r\n content: z.array(z.string()).meta({\r\n description:\r\n 'The content of the profile. This is an array of strings, where each string is a paragraph of the profile content.',\r\n }),\r\n});\r\n\r\nexport type ApiCommentaryProfileContent = z.infer<\r\n typeof ApiCommentaryProfileContentSchema\r\n>;\r\n\r\n/**\r\n * The options for generating the API.\r\n */\r\nexport interface GenerateApiOptions {\r\n /**\r\n * Whether to use the common name for the book chapter API link. If false, then book IDs are used.\r\n * Audio URLs will always use the book ID.\r\n * Defaults to false.\r\n */\r\n useCommonName?: boolean;\r\n\r\n /**\r\n * Whether to replace the audio URLs in the dataset with ones that are hosted locally.\r\n * If true, then the audio URLs in the dataset will be replaced with ones that reference files hosted by the API itself.\r\n * If false, then the audio URLs in the dataset will be left as is.\r\n * Defaults to false.\r\n */\r\n generateAudioFiles?: boolean;\r\n\r\n /**\r\n * Gets the english name of the given language.\r\n * If not provided, then the english name for the language will be unknown and omitted.\r\n * @param language The language to get the english name for.\r\n */\r\n getEnglishName?: (language: string) => string | null | undefined;\r\n\r\n /**\r\n * Gets the native name of the given language.\r\n * If not provided, then the native name for the language will be unknown and omitted.\r\n * @param language The language to get the native name for.\r\n */\r\n getNativeName?: (language: string) => string | null | undefined;\r\n\r\n /**\r\n * The prefix that should be added to paths that are generated.\r\n */\r\n pathPrefix?: string;\r\n\r\n /**\r\n * Whether to generate complete translation files for each translation.\r\n */\r\n generateCompleteTranslationFiles?: boolean;\r\n\r\n /**\r\n * Whether to generate simplified chapter files for each translation and commentary chapter.\r\n * In the simplified format, the content of each verse is a single string instead of a list of\r\n * formatted content, and the footnotes are available on the verses that they occur in.\r\n * Defaults to false.\r\n */\r\n generateSimpleChapterFiles?: boolean;\r\n}\r\n\r\n/**\r\n * Generates the API output for the given dataset.\r\n * @param dataset The dataset to generate the API for.\r\n * @param options The options for generating the API.\r\n */\r\nexport function generateApiForDataset(\r\n dataset: DatasetOutput,\r\n options: GenerateApiOptions = {}\r\n): ApiOutput {\r\n const { useCommonName, pathPrefix } = options;\r\n const apiPathPrefix = pathPrefix ? pathPrefix : '';\r\n const generateSimpleChapterFiles = !!options.generateSimpleChapterFiles;\r\n let api: ApiOutput = {\r\n availableTranslations: {\r\n translations: [],\r\n },\r\n translationBooks: [],\r\n translationBookChapters: [],\r\n translationBookChapterAudio: [],\r\n translationBookChapterAudioTimings: [],\r\n translationBookChapterWords: [],\r\n translationComplete: [],\r\n simpleTranslationComplete: [],\r\n availableCommentaries: {\r\n commentaries: [],\r\n },\r\n commentaryBookChapters: [],\r\n commentaryBooks: [],\r\n commentaryProfiles: [],\r\n commentaryProfileContents: [],\r\n pathPrefix: apiPathPrefix,\r\n };\r\n\r\n if (generateSimpleChapterFiles) {\r\n api.simpleTranslationBookChapters = [];\r\n api.simpleCommentaryBookChapters = [];\r\n }\r\n\r\n // The simplified chapter-words files are also needed by the complete\r\n // translation files, which link to them instead of embedding the words\r\n // directly. Generate them whenever either feature needs them, so the\r\n // links in complete.simple.json always resolve even if per-chapter\r\n // simplified files aren't being generated.\r\n if (\r\n generateSimpleChapterFiles ||\r\n options.generateCompleteTranslationFiles\r\n ) {\r\n api.simpleTranslationBookChapterWords = [];\r\n }\r\n\r\n const getNativeName = options.getNativeName;\r\n const getEnglishName = options.getEnglishName;\r\n\r\n for (let { books, ...translation } of dataset.translations) {\r\n let numberOfBooks = 0;\r\n let numberOfApocryphalBooks = 0;\r\n\r\n for (let book of books) {\r\n if (book.isApocryphal) {\r\n numberOfApocryphalBooks++;\r\n } else {\r\n numberOfBooks++;\r\n }\r\n }\r\n\r\n const apiTranslation: ApiTranslation = {\r\n ...translation,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfBooksApiLink(\r\n translation.id,\r\n apiPathPrefix\r\n ),\r\n completeTranslationApiLink: options.generateCompleteTranslationFiles\r\n ? completeTranslationApiLink(translation.id, apiPathPrefix)\r\n : undefined,\r\n simpleCompleteTranslationApiLink:\r\n options.generateCompleteTranslationFiles\r\n ? completeTranslationApiLink(\r\n translation.id,\r\n apiPathPrefix,\r\n SIMPLE_JSON_EXTENSION\r\n )\r\n : undefined,\r\n numberOfBooks,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(translation.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(translation.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n if (numberOfApocryphalBooks > 0) {\r\n apiTranslation.numberOfApocryphalBooks = numberOfApocryphalBooks;\r\n }\r\n\r\n const translationBooks: ApiTranslationBooks = {\r\n translation: apiTranslation,\r\n books: [],\r\n };\r\n\r\n let translationChapters: ApiTranslationBookChapter[] = [];\r\n let pendingAudioTimings: {\r\n reader: string;\r\n verses: number[];\r\n apiBookChapter: ApiTranslationBookChapter;\r\n }[] = [];\r\n let rawAudioTimingsByChapter = new Map<\r\n ApiTranslationBookChapter,\r\n TranslationBookChapterAudioTimings\r\n >();\r\n let rawWordsByChapter = new Map<\r\n ApiTranslationBookChapter,\r\n TranslationBookChapterWords\r\n >();\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number;\r\n const apiBook: ApiTranslationBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n firstChapterReference: {\r\n translationId: translation.id,\r\n book: book.id,\r\n chapter: firstChapterNumber,\r\n },\r\n lastChapterNumber,\r\n lastChapterApiLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n lastChapterReference: {\r\n translationId: translation.id,\r\n book: book.id,\r\n chapter: lastChapterNumber,\r\n },\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n };\r\n\r\n for (let {\r\n chapter,\r\n thisChapterAudioLinks,\r\n thisChapterAudioTimings,\r\n thisChapterWords,\r\n } of chapters) {\r\n const audio: TranslationBookChapterAudioLinks = {};\r\n const audioTimings: Record<string, string> = {};\r\n const apiBookChapter: ApiTranslationBookChapter = {\r\n translation: apiTranslation,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n thisChapterReference: {\r\n translationId: translation.id,\r\n book: book.id,\r\n chapter: chapter.number,\r\n },\r\n thisChapterAudioLinks: audio,\r\n nextChapterApiLink: null,\r\n nextChapterReference: null,\r\n nextChapterAudioLinks: null,\r\n previousChapterApiLink: null,\r\n previousChapterReference: null,\r\n previousChapterAudioLinks: null,\r\n thisChapterAudioTimings: audioTimings,\r\n nextChapterAudioTimings: null,\r\n previousChapterAudioTimings: null,\r\n numberOfVerses: 0,\r\n simpleChapterApiLink: generateSimpleChapterFiles\r\n ? bookChapterApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n SIMPLE_JSON_EXTENSION,\r\n apiPathPrefix\r\n )\r\n : undefined,\r\n };\r\n\r\n for (let reader in thisChapterAudioLinks) {\r\n if (options.generateAudioFiles) {\r\n const apiAudio: ApiTranslationBookChapterAudio = {\r\n chapter: apiBookChapter,\r\n link: bookChapterAudioApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n reader,\r\n apiPathPrefix\r\n ),\r\n originalUrl: thisChapterAudioLinks[reader],\r\n };\r\n audio[reader] = apiAudio.link;\r\n api.translationBookChapterAudio.push(apiAudio);\r\n } else {\r\n audio[reader] = thisChapterAudioLinks[reader];\r\n }\r\n }\r\n\r\n rawAudioTimingsByChapter.set(\r\n apiBookChapter,\r\n thisChapterAudioTimings\r\n );\r\n\r\n if (thisChapterWords) {\r\n apiBookChapter.thisChapterWordsLink =\r\n bookChapterWordsApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n apiPathPrefix\r\n );\r\n rawWordsByChapter.set(apiBookChapter, thisChapterWords);\r\n }\r\n\r\n for (let reader in thisChapterAudioTimings) {\r\n const verses = thisChapterAudioTimings[reader];\r\n audioTimings[reader] = bookChapterAudioTimingsApiLink(\r\n translation.id,\r\n getBookLink(book),\r\n chapter.number,\r\n reader,\r\n apiPathPrefix\r\n );\r\n pendingAudioTimings.push({\r\n reader,\r\n verses,\r\n apiBookChapter,\r\n });\r\n }\r\n\r\n for (let c of chapter.content) {\r\n if (c.type === 'verse') {\r\n apiBookChapter.numberOfVerses++;\r\n }\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n\r\n translationChapters.push(apiBookChapter);\r\n api.translationBookChapters.push(apiBookChapter);\r\n }\r\n\r\n translationBooks.books.push(apiBook);\r\n\r\n if (apiBook.isApocryphal) {\r\n if (!apiTranslation.totalNumberOfApocryphalChapters) {\r\n apiTranslation.totalNumberOfApocryphalChapters = 0;\r\n }\r\n if (!apiTranslation.totalNumberOfApocryphalVerses) {\r\n apiTranslation.totalNumberOfApocryphalVerses = 0;\r\n }\r\n apiTranslation.totalNumberOfApocryphalChapters +=\r\n apiBook.numberOfChapters;\r\n apiTranslation.totalNumberOfApocryphalVerses +=\r\n apiBook.totalNumberOfVerses;\r\n } else {\r\n apiTranslation.totalNumberOfChapters +=\r\n apiBook.numberOfChapters;\r\n apiTranslation.totalNumberOfVerses +=\r\n apiBook.totalNumberOfVerses;\r\n }\r\n }\r\n\r\n for (let i = 0; i < translationChapters.length; i++) {\r\n const currentChapter = translationChapters[i];\r\n if (i > 0) {\r\n const previousChapter = translationChapters[i - 1];\r\n currentChapter.previousChapterApiLink = bookChapterApiLink(\r\n translation.id,\r\n getBookLink(previousChapter.book),\r\n previousChapter.chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n currentChapter.previousChapterReference = {\r\n translationId: translation.id,\r\n book: previousChapter.book.id,\r\n chapter: previousChapter.chapter.number,\r\n };\r\n currentChapter.previousChapterAudioLinks =\r\n previousChapter.thisChapterAudioLinks;\r\n currentChapter.previousChapterAudioTimings =\r\n previousChapter.thisChapterAudioTimings;\r\n\r\n if (previousChapter.thisChapterWordsLink) {\r\n currentChapter.previousChapterWordsLink =\r\n previousChapter.thisChapterWordsLink;\r\n }\r\n }\r\n\r\n if (i < translationChapters.length - 1) {\r\n const nextChapter = translationChapters[i + 1];\r\n currentChapter.nextChapterApiLink = bookChapterApiLink(\r\n translation.id,\r\n getBookLink(nextChapter.book),\r\n nextChapter.chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n currentChapter.nextChapterReference = {\r\n translationId: translation.id,\r\n book: nextChapter.book.id,\r\n chapter: nextChapter.chapter.number,\r\n };\r\n currentChapter.nextChapterAudioLinks =\r\n nextChapter.thisChapterAudioLinks;\r\n currentChapter.nextChapterAudioTimings =\r\n nextChapter.thisChapterAudioTimings;\r\n\r\n if (nextChapter.thisChapterWordsLink) {\r\n currentChapter.nextChapterWordsLink =\r\n nextChapter.thisChapterWordsLink;\r\n }\r\n }\r\n }\r\n\r\n // The simplified chapters are shared between the per-chapter files and the\r\n // complete translation file, which are controlled by separate options.\r\n // Simplifying each chapter once means enabling both options doesn't do the\r\n // work twice or keep two copies of the result in memory.\r\n const simplifiedChapters = new Map<\r\n ApiTranslationBookChapter,\r\n SimplifiedChapter\r\n >();\r\n if (\r\n generateSimpleChapterFiles ||\r\n options.generateCompleteTranslationFiles\r\n ) {\r\n for (let chapter of translationChapters) {\r\n simplifiedChapters.set(\r\n chapter,\r\n simplifyChapter(\r\n chapter.chapter,\r\n rawWordsByChapter.get(chapter)\r\n )\r\n );\r\n }\r\n }\r\n\r\n const simpleChapterLink = (chapter: ApiTranslationBookChapter) =>\r\n bookChapterApiLink(\r\n translation.id,\r\n getBookLink(chapter.book),\r\n chapter.chapter.number,\r\n SIMPLE_JSON_EXTENSION,\r\n apiPathPrefix\r\n );\r\n\r\n // The words for a simplified chapter are only published when the chapter\r\n // itself is, since their offsets are anchored to the simplified text.\r\n const simpleWordsLink = (chapter: ApiTranslationBookChapter) =>\r\n hasSimpleWords(chapter)\r\n ? bookChapterWordsApiLink(\r\n translation.id,\r\n getBookLink(chapter.book),\r\n chapter.chapter.number,\r\n apiPathPrefix,\r\n SIMPLE_JSON_EXTENSION\r\n )\r\n : undefined;\r\n\r\n function hasSimpleWords(chapter: ApiTranslationBookChapter) {\r\n const words = simplifiedChapters.get(chapter)?.words;\r\n return !!words && Object.keys(words).length > 0;\r\n }\r\n\r\n if (\r\n api.simpleTranslationBookChapters ||\r\n api.simpleTranslationBookChapterWords\r\n ) {\r\n for (let i = 0; i < translationChapters.length; i++) {\r\n const currentChapter = translationChapters[i];\r\n const previousChapter = translationChapters[i - 1];\r\n const nextChapter = translationChapters[i + 1];\r\n const simplified = simplifiedChapters.get(currentChapter)!;\r\n\r\n // Per-chapter simplified files aren't necessarily being\r\n // generated (e.g. when only the complete translation file\r\n // needs the simplified words), so `simpleChapter` may be\r\n // undefined below.\r\n let simpleChapter: ApiSimpleTranslationBookChapter | undefined;\r\n if (api.simpleTranslationBookChapters) {\r\n const {\r\n chapter,\r\n simpleChapterApiLink,\r\n thisChapterWordsLink,\r\n nextChapterWordsLink,\r\n previousChapterWordsLink,\r\n ...rest\r\n } = currentChapter;\r\n\r\n simpleChapter = {\r\n ...rest,\r\n chapter: simplified.chapter,\r\n thisChapterLink: simpleChapterLink(currentChapter),\r\n fullChapterApiLink: rest.thisChapterLink,\r\n previousChapterApiLink: previousChapter\r\n ? simpleChapterLink(previousChapter)\r\n : null,\r\n nextChapterApiLink: nextChapter\r\n ? simpleChapterLink(nextChapter)\r\n : null,\r\n };\r\n }\r\n\r\n const thisWordsLink = simpleWordsLink(currentChapter);\r\n if (thisWordsLink) {\r\n if (simpleChapter) {\r\n simpleChapter.thisChapterWordsLink = thisWordsLink;\r\n }\r\n\r\n // When per-chapter simplified files aren't generated,\r\n // there's no simple chapter link to point to, so fall\r\n // back to the regular chapter's links.\r\n api.simpleTranslationBookChapterWords?.push({\r\n translationId: translation.id,\r\n bookId: currentChapter.book.id,\r\n chapterNumber: currentChapter.chapter.number,\r\n thisChapterLink:\r\n simpleChapter?.thisChapterLink ??\r\n currentChapter.thisChapterLink,\r\n nextChapterLink:\r\n simpleChapter?.nextChapterApiLink ??\r\n currentChapter.nextChapterApiLink,\r\n previousChapterLink:\r\n simpleChapter?.previousChapterApiLink ??\r\n currentChapter.previousChapterApiLink,\r\n thisChapterWordsLink: thisWordsLink,\r\n nextChapterWordsLink: nextChapter\r\n ? (simpleWordsLink(nextChapter) ?? null)\r\n : null,\r\n previousChapterWordsLink: previousChapter\r\n ? (simpleWordsLink(previousChapter) ?? null)\r\n : null,\r\n verses: simplified.words,\r\n });\r\n }\r\n\r\n if (simpleChapter) {\r\n const nextWordsLink = nextChapter\r\n ? simpleWordsLink(nextChapter)\r\n : undefined;\r\n if (nextWordsLink) {\r\n simpleChapter.nextChapterWordsLink = nextWordsLink;\r\n }\r\n\r\n const previousWordsLink = previousChapter\r\n ? simpleWordsLink(previousChapter)\r\n : undefined;\r\n if (previousWordsLink) {\r\n simpleChapter.previousChapterWordsLink =\r\n previousWordsLink;\r\n }\r\n\r\n api.simpleTranslationBookChapters!.push(simpleChapter);\r\n }\r\n }\r\n }\r\n\r\n for (let { reader, verses, apiBookChapter } of pendingAudioTimings) {\r\n api.translationBookChapterAudioTimings.push({\r\n translationId: translation.id,\r\n bookId: apiBookChapter.book.id,\r\n chapterNumber: apiBookChapter.chapter.number,\r\n reader,\r\n audioLink:\r\n apiBookChapter.thisChapterAudioLinks[reader] ?? '',\r\n thisChapterLink: apiBookChapter.thisChapterLink,\r\n nextChapterLink: apiBookChapter.nextChapterApiLink,\r\n previousChapterLink: apiBookChapter.previousChapterApiLink,\r\n thisChapterAudioTimingsLink:\r\n apiBookChapter.thisChapterAudioTimings[reader],\r\n nextChapterAudioTimingsLink:\r\n apiBookChapter.nextChapterAudioTimings?.[reader] ?? null,\r\n previousChapterAudioTimingsLink:\r\n apiBookChapter.previousChapterAudioTimings?.[reader] ??\r\n null,\r\n verses,\r\n });\r\n }\r\n\r\n for (let apiBookChapter of translationChapters) {\r\n const words = rawWordsByChapter.get(apiBookChapter);\r\n if (!words || !apiBookChapter.thisChapterWordsLink) {\r\n continue;\r\n }\r\n\r\n api.translationBookChapterWords.push({\r\n translationId: translation.id,\r\n bookId: apiBookChapter.book.id,\r\n chapterNumber: apiBookChapter.chapter.number,\r\n thisChapterLink: apiBookChapter.thisChapterLink,\r\n nextChapterLink: apiBookChapter.nextChapterApiLink,\r\n previousChapterLink: apiBookChapter.previousChapterApiLink,\r\n thisChapterWordsLink: apiBookChapter.thisChapterWordsLink,\r\n nextChapterWordsLink:\r\n apiBookChapter.nextChapterWordsLink ?? null,\r\n previousChapterWordsLink:\r\n apiBookChapter.previousChapterWordsLink ?? null,\r\n verses: words,\r\n });\r\n }\r\n\r\n api.availableTranslations.translations.push(apiTranslation);\r\n api.translationBooks.push(translationBooks);\r\n\r\n if (options.generateCompleteTranslationFiles) {\r\n // Build the complete translation data for download.\r\n // The regular and simplified files only differ by the content of each\r\n // chapter, so they share the book grouping and the per-chapter metadata.\r\n const completeBooks = translationBooks.books.map((book) => ({\r\n book,\r\n chapters: translationChapters.filter(\r\n (ch) => ch.book.id === book.id\r\n ),\r\n }));\r\n\r\n const completeBook = <T>(\r\n book: ApiTranslationBook,\r\n chapters: T[]\r\n ) => ({\r\n id: book.id,\r\n name: book.name,\r\n commonName: book.commonName,\r\n title: book.title,\r\n order: book.order,\r\n numberOfChapters: book.numberOfChapters,\r\n totalNumberOfVerses: book.totalNumberOfVerses,\r\n isApocryphal: book.isApocryphal,\r\n chapters,\r\n });\r\n\r\n const completeChapter = (chapter: ApiTranslationBookChapter) => ({\r\n numberOfVerses: chapter.numberOfVerses,\r\n thisChapterAudioLinks: chapter.thisChapterAudioLinks,\r\n // The complete files contain the raw audio timings rather than links\r\n // to them, since the point is to have everything in one file.\r\n thisChapterAudioTimings:\r\n rawAudioTimingsByChapter.get(chapter) ?? {},\r\n });\r\n\r\n const completeTranslation: ApiTranslationComplete = {\r\n translation: apiTranslation,\r\n books: completeBooks.map(({ book, chapters }) =>\r\n completeBook(\r\n book,\r\n chapters.map((ch) => ({\r\n ...completeChapter(ch),\r\n // The complete files link to the word annotations\r\n // rather than embedding them, same as the regular\r\n // per-chapter endpoint.\r\n ...(ch.thisChapterWordsLink\r\n ? {\r\n thisChapterWordsLink:\r\n ch.thisChapterWordsLink,\r\n }\r\n : {}),\r\n chapter: ch.chapter,\r\n }))\r\n )\r\n ),\r\n };\r\n api.translationComplete.push(completeTranslation);\r\n\r\n const simpleCompleteTranslation: ApiSimpleTranslationComplete = {\r\n translation: apiTranslation,\r\n books: completeBooks.map(({ book, chapters }) =>\r\n completeBook(\r\n book,\r\n chapters.map((ch) => {\r\n const simplified = simplifiedChapters.get(ch)!;\r\n const wordsLink = simpleWordsLink(ch);\r\n return {\r\n ...completeChapter(ch),\r\n ...(wordsLink\r\n ? { thisChapterWordsLink: wordsLink }\r\n : {}),\r\n chapter: simplified.chapter,\r\n };\r\n })\r\n )\r\n ),\r\n };\r\n api.simpleTranslationComplete.push(simpleCompleteTranslation);\r\n }\r\n }\r\n\r\n for (let { books, profiles, ...commentary } of dataset.commentaries) {\r\n const apiCommentary: ApiCommentary = {\r\n ...commentary,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfCommentaryBooksApiLink(\r\n commentary.id,\r\n apiPathPrefix\r\n ),\r\n listOfProfilesApiLink: profilesCommentaryApiLink(\r\n commentary.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n numberOfBooks: books.length,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfProfiles: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(commentary.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(commentary.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n const commentaryBooks: ApiCommentaryBooks = {\r\n commentary: apiCommentary,\r\n books: [],\r\n };\r\n\r\n const commentaryProfiles: ApiCommentaryProfiles = {\r\n commentary: apiCommentary,\r\n profiles: [],\r\n };\r\n\r\n let commentaryChapters: ApiCommentaryBookChapter[] = [];\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number ?? null;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number ?? null;\r\n const apiBook: ApiCommentaryBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: firstChapterNumber\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n firstChapterReference: firstChapterNumber\r\n ? {\r\n commentaryId: commentary.id,\r\n book: book.id,\r\n chapter: firstChapterNumber,\r\n }\r\n : null,\r\n lastChapterNumber,\r\n lastChapterApiLink: lastChapterNumber\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n lastChapterReference: lastChapterNumber\r\n ? {\r\n commentaryId: commentary.id,\r\n book: book.id,\r\n chapter: lastChapterNumber,\r\n }\r\n : null,\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n };\r\n\r\n for (let { chapter } of chapters) {\r\n const apiBookChapter: ApiCommentaryBookChapter = {\r\n commentary: apiCommentary,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n thisChapterReference: {\r\n commentaryId: commentary.id,\r\n book: book.id,\r\n chapter: chapter.number,\r\n },\r\n nextChapterApiLink: null,\r\n nextChapterReference: null,\r\n previousChapterApiLink: null,\r\n previousChapterReference: null,\r\n numberOfVerses: 0,\r\n simpleChapterApiLink: generateSimpleChapterFiles\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(book),\r\n chapter.number,\r\n SIMPLE_JSON_EXTENSION,\r\n apiPathPrefix\r\n )\r\n : undefined,\r\n };\r\n\r\n for (let c of chapter.content) {\r\n if (c.type === 'verse') {\r\n apiBookChapter.numberOfVerses++;\r\n }\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n\r\n commentaryChapters.push(apiBookChapter);\r\n api.commentaryBookChapters.push(apiBookChapter);\r\n }\r\n\r\n commentaryBooks.books.push(apiBook);\r\n\r\n apiCommentary.totalNumberOfChapters += apiBook.numberOfChapters;\r\n apiCommentary.totalNumberOfVerses += apiBook.totalNumberOfVerses;\r\n }\r\n\r\n if (profiles) {\r\n for (let profile of profiles) {\r\n const apiProfile: ApiCommentaryProfile = {\r\n id: profile.id,\r\n reference: profile.reference,\r\n subject: profile.subject,\r\n thisProfileLink: profileCommentaryApiLink(\r\n commentary.id,\r\n profile.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n referenceChapterLink: profile.reference\r\n ? bookCommentaryChapterApiLink(\r\n commentary.id,\r\n profile.reference.book,\r\n profile.reference.chapter,\r\n 'json',\r\n apiPathPrefix\r\n )\r\n : null,\r\n };\r\n\r\n const apiProfileContent: ApiCommentaryProfileContent = {\r\n commentary: apiCommentary,\r\n profile: apiProfile,\r\n content: profile.content,\r\n };\r\n\r\n apiCommentary.totalNumberOfProfiles += 1;\r\n commentaryProfiles.profiles.push(apiProfile);\r\n api.commentaryProfileContents.push(apiProfileContent);\r\n }\r\n }\r\n\r\n for (let i = 0; i < commentaryChapters.length; i++) {\r\n if (i > 0) {\r\n commentaryChapters[i].previousChapterApiLink =\r\n bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(commentaryChapters[i - 1].book),\r\n commentaryChapters[i - 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n commentaryChapters[i].previousChapterReference = {\r\n commentaryId: commentary.id,\r\n book: commentaryChapters[i - 1].book.id,\r\n chapter: commentaryChapters[i - 1].chapter.number,\r\n };\r\n // commentaryChapters[i].previousChapterAudioLinks =\r\n // commentaryChapters[i - 1].thisChapterAudioLinks;\r\n }\r\n\r\n if (i < commentaryChapters.length - 1) {\r\n commentaryChapters[i].nextChapterApiLink =\r\n bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(commentaryChapters[i + 1].book),\r\n commentaryChapters[i + 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n commentaryChapters[i].nextChapterReference = {\r\n commentaryId: commentary.id,\r\n book: commentaryChapters[i + 1].book.id,\r\n chapter: commentaryChapters[i + 1].chapter.number,\r\n };\r\n // commentaryChapters[i].nextChapterAudioLinks =\r\n // commentaryChapters[i + 1].thisChapterAudioLinks;\r\n }\r\n }\r\n\r\n if (api.simpleCommentaryBookChapters) {\r\n const simpleChapterLink = (chapter: ApiCommentaryBookChapter) =>\r\n bookCommentaryChapterApiLink(\r\n commentary.id,\r\n getBookLink(chapter.book),\r\n chapter.chapter.number,\r\n SIMPLE_JSON_EXTENSION,\r\n apiPathPrefix\r\n );\r\n\r\n for (let i = 0; i < commentaryChapters.length; i++) {\r\n const { chapter, simpleChapterApiLink, ...currentChapter } =\r\n commentaryChapters[i];\r\n const previousChapter = commentaryChapters[i - 1];\r\n const nextChapter = commentaryChapters[i + 1];\r\n\r\n api.simpleCommentaryBookChapters.push({\r\n ...currentChapter,\r\n chapter: simplifyCommentaryChapter(chapter),\r\n thisChapterLink: simpleChapterLink(commentaryChapters[i]),\r\n fullChapterApiLink: currentChapter.thisChapterLink,\r\n previousChapterApiLink: previousChapter\r\n ? simpleChapterLink(previousChapter)\r\n : null,\r\n nextChapterApiLink: nextChapter\r\n ? simpleChapterLink(nextChapter)\r\n : null,\r\n });\r\n }\r\n }\r\n\r\n api.availableCommentaries.commentaries.push(apiCommentary);\r\n api.commentaryBooks.push(commentaryBooks);\r\n api.commentaryProfiles.push(commentaryProfiles);\r\n }\r\n\r\n for (let {\r\n books,\r\n people,\r\n places,\r\n events,\r\n peopleGroups,\r\n ...datasetInfo\r\n } of dataset.datasets ?? []) {\r\n const apiDataset: ApiDataset = {\r\n ...datasetInfo,\r\n availableFormats: ['json'],\r\n listOfBooksApiLink: listOfDatasetBooksApiLink(\r\n datasetInfo.id,\r\n apiPathPrefix\r\n ),\r\n numberOfBooks: books.length,\r\n totalNumberOfChapters: 0,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfReferences: 0,\r\n languageName: getNativeName\r\n ? (getNativeName(datasetInfo.language) ?? undefined)\r\n : undefined,\r\n languageEnglishName: getEnglishName\r\n ? (getEnglishName(datasetInfo.language) ?? undefined)\r\n : undefined,\r\n };\r\n\r\n const datasetBooks: ApiDatasetBooks = {\r\n dataset: apiDataset,\r\n books: [],\r\n };\r\n\r\n let datasetChapters: ApiDatasetBookChapter[] = [];\r\n\r\n for (let { chapters, ...book } of books) {\r\n const firstChapterNumber = chapters[0]?.chapter.number ?? null;\r\n const lastChapterNumber =\r\n chapters[chapters.length - 1]?.chapter.number ?? null;\r\n const apiBook: ApiDatasetBook = {\r\n ...book,\r\n firstChapterNumber,\r\n firstChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n firstChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: book.id,\r\n chapter: firstChapterNumber,\r\n },\r\n lastChapterNumber,\r\n lastChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n lastChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: book.id,\r\n chapter: lastChapterNumber,\r\n },\r\n numberOfChapters: chapters.length,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfReferences: 0,\r\n };\r\n\r\n for (let { chapter } of chapters) {\r\n const apiBookChapter: ApiDatasetBookChapter = {\r\n dataset: apiDataset,\r\n book: apiBook,\r\n chapter: chapter,\r\n thisChapterLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n book.id,\r\n chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n thisChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: book.id,\r\n chapter: chapter.number,\r\n },\r\n nextChapterApiLink: null,\r\n nextChapterReference: null,\r\n previousChapterApiLink: null,\r\n previousChapterReference: null,\r\n numberOfVerses: chapter.content.length,\r\n numberOfReferences: 0,\r\n };\r\n\r\n // apiBookChapter.numberOfVerses += ;\r\n for (let verse of chapter.content) {\r\n apiBookChapter.numberOfReferences +=\r\n verse.references.length;\r\n }\r\n\r\n apiBook.totalNumberOfVerses += apiBookChapter.numberOfVerses;\r\n apiBook.totalNumberOfReferences +=\r\n apiBookChapter.numberOfReferences;\r\n\r\n datasetChapters.push(apiBookChapter);\r\n if (!api.datasetBookChapters) {\r\n api.datasetBookChapters = [];\r\n }\r\n api.datasetBookChapters.push(apiBookChapter);\r\n }\r\n\r\n datasetBooks.books.push(apiBook);\r\n\r\n apiDataset.totalNumberOfChapters += apiBook.numberOfChapters;\r\n apiDataset.totalNumberOfVerses += apiBook.totalNumberOfVerses;\r\n apiDataset.totalNumberOfReferences +=\r\n apiBook.totalNumberOfReferences;\r\n }\r\n\r\n for (let i = 0; i < datasetChapters.length; i++) {\r\n if (i > 0) {\r\n datasetChapters[i].previousChapterApiLink =\r\n bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n datasetChapters[i - 1].book.id,\r\n datasetChapters[i - 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n datasetChapters[i].previousChapterReference = {\r\n datasetId: datasetInfo.id,\r\n book: datasetChapters[i - 1].book.id,\r\n chapter: datasetChapters[i - 1].chapter.number,\r\n };\r\n }\r\n\r\n if (i < datasetChapters.length - 1) {\r\n datasetChapters[i].nextChapterApiLink =\r\n bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n datasetChapters[i + 1].book.id,\r\n datasetChapters[i + 1].chapter.number,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n datasetChapters[i].nextChapterReference = {\r\n datasetId: datasetInfo.id,\r\n book: datasetChapters[i + 1].book.id,\r\n chapter: datasetChapters[i + 1].chapter.number,\r\n };\r\n }\r\n }\r\n\r\n const linkEntityRef = (\r\n collection: DatasetEntityCollection,\r\n ref: DatasetEntityRef | undefined\r\n ): DatasetEntityRef | undefined =>\r\n ref\r\n ? {\r\n ...ref,\r\n type: collection,\r\n apiLink: datasetEntityApiLink(\r\n datasetInfo.id,\r\n collection,\r\n ref.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n }\r\n : undefined;\r\n\r\n const linkEntityRefs = (\r\n collection: DatasetEntityCollection,\r\n refs: DatasetEntityRef[] | undefined\r\n ): DatasetEntityRef[] | undefined =>\r\n refs?.map((ref) => linkEntityRef(collection, ref)!);\r\n\r\n if (people) {\r\n const datasetPeople: ApiDatasetPeople = {\r\n dataset: apiDataset,\r\n people: [],\r\n };\r\n\r\n for (let person of people) {\r\n const thisPersonApiLink = datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'people',\r\n person.id,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n\r\n datasetPeople.people.push({\r\n id: person.id,\r\n name: person.name,\r\n isProperName: person.isProperName,\r\n gender: person.gender,\r\n numberOfReferences: person.references.length,\r\n thisPersonApiLink,\r\n });\r\n\r\n const apiPerson: ApiDatasetPerson = {\r\n dataset: apiDataset,\r\n person: {\r\n ...person,\r\n birthPlace: linkEntityRef('places', person.birthPlace),\r\n deathPlace: linkEntityRef('places', person.deathPlace),\r\n father: linkEntityRefs('people', person.father),\r\n mother: linkEntityRefs('people', person.mother),\r\n partners: linkEntityRefs('people', person.partners),\r\n children: linkEntityRefs('people', person.children),\r\n siblings: linkEntityRefs('people', person.siblings),\r\n halfSiblingsSameMother: linkEntityRefs(\r\n 'people',\r\n person.halfSiblingsSameMother\r\n ),\r\n halfSiblingsSameFather: linkEntityRefs(\r\n 'people',\r\n person.halfSiblingsSameFather\r\n ),\r\n memberOf: linkEntityRefs('groups', person.memberOf),\r\n events: linkEntityRefs('events', person.events),\r\n },\r\n thisPersonApiLink,\r\n };\r\n\r\n if (!api.datasetPeopleContents) {\r\n api.datasetPeopleContents = [];\r\n }\r\n api.datasetPeopleContents.push(apiPerson);\r\n }\r\n\r\n apiDataset.listOfPeopleApiLink = listOfDatasetEntitiesApiLink(\r\n datasetInfo.id,\r\n 'people',\r\n 'json',\r\n apiPathPrefix\r\n );\r\n apiDataset.totalNumberOfPeople = people.length;\r\n if (!api.datasetPeople) {\r\n api.datasetPeople = [];\r\n }\r\n api.datasetPeople.push(datasetPeople);\r\n }\r\n\r\n if (places) {\r\n const datasetPlaces: ApiDatasetPlaces = {\r\n dataset: apiDataset,\r\n places: [],\r\n };\r\n\r\n for (let place of places) {\r\n const thisPlaceApiLink = datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'places',\r\n place.id,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n\r\n datasetPlaces.places.push({\r\n id: place.id,\r\n name: place.name,\r\n featureType: place.featureType,\r\n latitude: place.latitude,\r\n longitude: place.longitude,\r\n numberOfReferences: place.references.length,\r\n thisPlaceApiLink,\r\n });\r\n\r\n const apiPlace: ApiDatasetPlace = {\r\n dataset: apiDataset,\r\n place: {\r\n ...place,\r\n rootPlace: linkEntityRef('places', place.rootPlace),\r\n duplicateOf: linkEntityRef('places', place.duplicateOf),\r\n people: linkEntityRefs('people', place.people),\r\n peopleBorn: linkEntityRefs('people', place.peopleBorn),\r\n peopleDied: linkEntityRefs('people', place.peopleDied),\r\n events: linkEntityRefs('events', place.events),\r\n },\r\n thisPlaceApiLink,\r\n };\r\n\r\n if (!api.datasetPlaceContents) {\r\n api.datasetPlaceContents = [];\r\n }\r\n api.datasetPlaceContents.push(apiPlace);\r\n }\r\n\r\n apiDataset.listOfPlacesApiLink = listOfDatasetEntitiesApiLink(\r\n datasetInfo.id,\r\n 'places',\r\n 'json',\r\n apiPathPrefix\r\n );\r\n apiDataset.totalNumberOfPlaces = places.length;\r\n if (!api.datasetPlaces) {\r\n api.datasetPlaces = [];\r\n }\r\n api.datasetPlaces.push(datasetPlaces);\r\n }\r\n\r\n if (events) {\r\n const datasetEvents: ApiDatasetEvents = {\r\n dataset: apiDataset,\r\n events: [],\r\n };\r\n\r\n for (let event of events) {\r\n const thisEventApiLink = datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'events',\r\n event.id,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n\r\n datasetEvents.events.push({\r\n id: event.id,\r\n name: event.name,\r\n startDate: event.startDate,\r\n numberOfReferences: event.references.length,\r\n thisEventApiLink,\r\n });\r\n\r\n const apiEvent: ApiDatasetEvent = {\r\n dataset: apiDataset,\r\n event: {\r\n ...event,\r\n participants: linkEntityRefs(\r\n 'people',\r\n event.participants\r\n ),\r\n locations: linkEntityRefs('places', event.locations),\r\n groups: linkEntityRefs('groups', event.groups),\r\n partOf: linkEntityRef('events', event.partOf),\r\n predecessor: linkEntityRef('events', event.predecessor),\r\n },\r\n thisEventApiLink,\r\n };\r\n\r\n if (!api.datasetEventContents) {\r\n api.datasetEventContents = [];\r\n }\r\n api.datasetEventContents.push(apiEvent);\r\n }\r\n\r\n apiDataset.listOfEventsApiLink = listOfDatasetEntitiesApiLink(\r\n datasetInfo.id,\r\n 'events',\r\n 'json',\r\n apiPathPrefix\r\n );\r\n apiDataset.totalNumberOfEvents = events.length;\r\n if (!api.datasetEvents) {\r\n api.datasetEvents = [];\r\n }\r\n api.datasetEvents.push(datasetEvents);\r\n }\r\n\r\n if (peopleGroups) {\r\n const datasetPeopleGroups: ApiDatasetPeopleGroups = {\r\n dataset: apiDataset,\r\n groups: [],\r\n };\r\n\r\n for (let group of peopleGroups) {\r\n const thisPeopleGroupApiLink = datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'groups',\r\n group.id,\r\n 'json',\r\n apiPathPrefix\r\n );\r\n\r\n datasetPeopleGroups.groups.push({\r\n id: group.id,\r\n name: group.name,\r\n numberOfMembers: group.members?.length ?? 0,\r\n thisPeopleGroupApiLink,\r\n });\r\n\r\n const apiGroup: ApiDatasetPeopleGroup = {\r\n dataset: apiDataset,\r\n group: {\r\n ...group,\r\n members: linkEntityRefs('people', group.members),\r\n events: linkEntityRefs('events', group.events),\r\n },\r\n thisPeopleGroupApiLink,\r\n };\r\n\r\n if (!api.datasetPeopleGroupContents) {\r\n api.datasetPeopleGroupContents = [];\r\n }\r\n api.datasetPeopleGroupContents.push(apiGroup);\r\n }\r\n\r\n apiDataset.listOfPeopleGroupsApiLink = listOfDatasetEntitiesApiLink(\r\n datasetInfo.id,\r\n 'groups',\r\n 'json',\r\n apiPathPrefix\r\n );\r\n apiDataset.totalNumberOfPeopleGroups = peopleGroups.length;\r\n if (!api.datasetPeopleGroups) {\r\n api.datasetPeopleGroups = [];\r\n }\r\n api.datasetPeopleGroups.push(datasetPeopleGroups);\r\n }\r\n\r\n // Generate chapter-aligned entity data for datasets that contain\r\n // entities but no chapter books of their own. Each chapter file\r\n // contains the people, places, and events that appear in that\r\n // chapter, derived from the entities' Bible references.\r\n if (books.length <= 0 && (people || places || events)) {\r\n interface ChapterEntities {\r\n people: Map<string, ApiDatasetChapterPerson>;\r\n places: Map<string, ApiDatasetChapterPlace>;\r\n events: Map<string, ApiDatasetChapterEvent>;\r\n }\r\n\r\n // bookId -> chapterNumber -> entities\r\n const chapterMap = new Map<BookId, Map<number, ChapterEntities>>();\r\n\r\n function addEntityVerses<\r\n T extends { verses: number[] },\r\n K extends 'people' | 'places' | 'events',\r\n >(\r\n collection: K,\r\n references: VerseRef[],\r\n createEntry: () => Omit<T, 'verses'>\r\n ) {\r\n for (let reference of references) {\r\n let bookChapters = chapterMap.get(reference.book);\r\n if (!bookChapters) {\r\n bookChapters = new Map();\r\n chapterMap.set(reference.book, bookChapters);\r\n }\r\n let chapterEntities = bookChapters.get(reference.chapter);\r\n if (!chapterEntities) {\r\n chapterEntities = {\r\n people: new Map(),\r\n places: new Map(),\r\n events: new Map(),\r\n };\r\n bookChapters.set(reference.chapter, chapterEntities);\r\n }\r\n\r\n const entry = createEntry() as T;\r\n const entities = chapterEntities[\r\n collection\r\n ] as unknown as Map<string, T>;\r\n let existing = entities.get((entry as any).id);\r\n if (!existing) {\r\n existing = { ...entry, verses: [] } as T;\r\n entities.set((entry as any).id, existing);\r\n }\r\n const endVerse = reference.endVerse ?? reference.verse;\r\n for (\r\n let verse = reference.verse;\r\n verse <= endVerse;\r\n verse++\r\n ) {\r\n existing.verses.push(verse);\r\n }\r\n }\r\n }\r\n\r\n for (let person of people ?? []) {\r\n addEntityVerses<ApiDatasetChapterPerson, 'people'>(\r\n 'people',\r\n person.references,\r\n () => ({\r\n id: person.id,\r\n name: person.name,\r\n isProperName: person.isProperName,\r\n gender: person.gender,\r\n birthYear: person.birthYear,\r\n deathYear: person.deathYear,\r\n apiLink: datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'people',\r\n person.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n })\r\n );\r\n }\r\n\r\n for (let place of places ?? []) {\r\n addEntityVerses<ApiDatasetChapterPlace, 'places'>(\r\n 'places',\r\n place.references,\r\n () => ({\r\n id: place.id,\r\n name: place.name,\r\n featureType: place.featureType,\r\n latitude: place.latitude,\r\n longitude: place.longitude,\r\n apiLink: datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'places',\r\n place.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n })\r\n );\r\n }\r\n\r\n for (let event of events ?? []) {\r\n addEntityVerses<ApiDatasetChapterEvent, 'events'>(\r\n 'events',\r\n event.references,\r\n () => ({\r\n id: event.id,\r\n name: event.name,\r\n startDate: event.startDate,\r\n apiLink: datasetEntityApiLink(\r\n datasetInfo.id,\r\n 'events',\r\n event.id,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n })\r\n );\r\n }\r\n\r\n const sortedBooks = [...chapterMap.keys()].sort(\r\n (a, b) =>\r\n (bookOrderMap.get(a) ?? 9999) -\r\n (bookOrderMap.get(b) ?? 9999)\r\n );\r\n\r\n function sortEntities<T extends { id: string; verses: number[] }>(\r\n entities: Map<string, T>\r\n ): T[] {\r\n const list = [...entities.values()];\r\n for (let entity of list) {\r\n entity.verses.sort((a, b) => a - b);\r\n }\r\n return list.sort(\r\n (a, b) =>\r\n a.verses[0] - b.verses[0] || a.id.localeCompare(b.id)\r\n );\r\n }\r\n\r\n const entityChapters: ApiDatasetEntityBookChapter[] = [];\r\n\r\n for (let bookId of sortedBooks) {\r\n const bookChapters = chapterMap.get(bookId)!;\r\n const chapterNumbers = [...bookChapters.keys()].sort(\r\n (a, b) => a - b\r\n );\r\n const firstChapterNumber = chapterNumbers[0];\r\n const lastChapterNumber =\r\n chapterNumbers[chapterNumbers.length - 1];\r\n\r\n const apiBook: ApiDatasetBook = {\r\n id: bookId,\r\n order: bookOrderMap.get(bookId) ?? 9999,\r\n firstChapterNumber,\r\n firstChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n bookId,\r\n firstChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n firstChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: bookId,\r\n chapter: firstChapterNumber,\r\n },\r\n lastChapterNumber,\r\n lastChapterApiLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n bookId,\r\n lastChapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n lastChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: bookId,\r\n chapter: lastChapterNumber,\r\n },\r\n numberOfChapters: chapterNumbers.length,\r\n totalNumberOfVerses: 0,\r\n totalNumberOfReferences: 0,\r\n };\r\n\r\n for (let chapterNumber of chapterNumbers) {\r\n const chapterEntities = bookChapters.get(chapterNumber)!;\r\n const chapterPeople = sortEntities(chapterEntities.people);\r\n const chapterPlaces = sortEntities(chapterEntities.places);\r\n const chapterEvents = sortEntities(chapterEntities.events);\r\n\r\n const distinctVerses = new Set<number>();\r\n let numberOfReferences = 0;\r\n for (let list of [\r\n chapterPeople,\r\n chapterPlaces,\r\n chapterEvents,\r\n ]) {\r\n for (let entity of list as {\r\n verses: number[];\r\n }[]) {\r\n numberOfReferences += entity.verses.length;\r\n for (let verse of entity.verses) {\r\n distinctVerses.add(verse);\r\n }\r\n }\r\n }\r\n\r\n apiBook.totalNumberOfVerses += distinctVerses.size;\r\n apiBook.totalNumberOfReferences += numberOfReferences;\r\n\r\n const apiChapter: ApiDatasetEntityBookChapter = {\r\n dataset: apiDataset,\r\n book: apiBook,\r\n chapter: {\r\n number: chapterNumber,\r\n people: chapterPeople,\r\n places: chapterPlaces,\r\n events: chapterEvents,\r\n },\r\n thisChapterLink: bookDatasetChapterApiLink(\r\n datasetInfo.id,\r\n bookId,\r\n chapterNumber,\r\n 'json',\r\n apiPathPrefix\r\n ),\r\n thisChapterReference: {\r\n datasetId: datasetInfo.id,\r\n book: bookId,\r\n chapter: chapterNumber,\r\n },\r\n nextChapterApiLink: null,\r\n nextChapterReference: null,\r\n previousChapterApiLink: null,\r\n previousChapterReference: null,\r\n numberOfPeople: chapterPeople.length,\r\n numberOfPlaces: chapterPlaces.length,\r\n numberOfEvents: chapterEvents.length,\r\n };\r\n\r\n entityChapters.push(apiChapter);\r\n }\r\n\r\n datasetBooks.books.push(apiBook);\r\n\r\n apiDataset.totalNumberOfChapters += apiBook.numberOfChapters;\r\n apiDataset.totalNumberOfVerses += apiBook.totalNumberOfVerses;\r\n apiDataset.totalNumberOfReferences +=\r\n apiBook.totalNumberOfReferences;\r\n }\r\n\r\n apiDataset.numberOfBooks = datasetBooks.books.length;\r\n\r\n for (let i = 0; i < entityChapters.length; i++) {\r\n if (i > 0) {\r\n entityChapters[i].previousChapterApiLink =\r\n entityChapters[i - 1].thisChapterLink;\r\n entityChapters[i].previousChapterReference =\r\n entityChapters[i - 1].thisChapterReference;\r\n }\r\n if (i < entityChapters.length - 1) {\r\n entityChapters[i].nextChapterApiLink =\r\n entityChapters[i + 1].thisChapterLink;\r\n entityChapters[i].nextChapterReference =\r\n entityChapters[i + 1].thisChapterReference;\r\n }\r\n }\r\n\r\n if (entityChapters.length > 0) {\r\n if (!api.datasetEntityBookChapters) {\r\n api.datasetEntityBookChapters = [];\r\n }\r\n api.datasetEntityBookChapters.push(...entityChapters);\r\n }\r\n }\r\n\r\n if (!api.availableDatasets) {\r\n api.availableDatasets = {\r\n datasets: [],\r\n };\r\n }\r\n api.availableDatasets.datasets.push(apiDataset);\r\n if (!api.datasetBooks) {\r\n api.datasetBooks = [];\r\n }\r\n api.datasetBooks.push(datasetBooks);\r\n }\r\n\r\n return api;\r\n\r\n function getBookLink(book: TranslationBook | CommentaryBook): string {\r\n return useCommonName ? book.commonName : book.id;\r\n }\r\n}\r\n\r\n/**\r\n * Generates the output files for the given API.\r\n * @param api The API that the files should be generated for.\r\n */\r\nexport function generateFilesForApi(api: ApiOutput): OutputFile[] {\r\n let files: OutputFile[] = [];\r\n\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_translations.json`,\r\n api.availableTranslations,\r\n true\r\n )\r\n );\r\n for (let translationBooks of api.translationBooks) {\r\n files.push(\r\n jsonFile(\r\n translationBooks.translation.listOfBooksApiLink,\r\n translationBooks\r\n )\r\n );\r\n }\r\n\r\n for (let bookChapter of api.translationBookChapters) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n for (let bookChapter of api.simpleTranslationBookChapters ?? []) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n for (let audio of api.translationBookChapterAudio) {\r\n files.push(downloadedFile(audio.link, audio.originalUrl));\r\n }\r\n\r\n for (let timings of api.translationBookChapterAudioTimings) {\r\n files.push(jsonFile(timings.thisChapterAudioTimingsLink, timings));\r\n }\r\n\r\n for (let words of api.translationBookChapterWords) {\r\n files.push(jsonFile(words.thisChapterWordsLink, words));\r\n }\r\n\r\n for (let words of api.simpleTranslationBookChapterWords ?? []) {\r\n files.push(jsonFile(words.thisChapterWordsLink, words));\r\n }\r\n\r\n // Generate complete translation download files\r\n for (let complete of api.translationComplete) {\r\n if (complete.translation.completeTranslationApiLink) {\r\n files.push(\r\n jsonFile(\r\n complete.translation.completeTranslationApiLink,\r\n complete\r\n )\r\n );\r\n }\r\n }\r\n\r\n for (let complete of api.simpleTranslationComplete) {\r\n if (complete.translation.simpleCompleteTranslationApiLink) {\r\n files.push(\r\n jsonFile(\r\n complete.translation.simpleCompleteTranslationApiLink,\r\n complete\r\n )\r\n );\r\n }\r\n }\r\n\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_commentaries.json`,\r\n api.availableCommentaries,\r\n true\r\n )\r\n );\r\n for (let commentaryBooks of api.commentaryBooks) {\r\n files.push(\r\n jsonFile(\r\n commentaryBooks.commentary.listOfBooksApiLink,\r\n commentaryBooks\r\n )\r\n );\r\n }\r\n\r\n for (let commentaryProfiles of api.commentaryProfiles) {\r\n files.push(\r\n jsonFile(\r\n commentaryProfiles.commentary.listOfProfilesApiLink,\r\n commentaryProfiles\r\n )\r\n );\r\n }\r\n\r\n for (let profileContent of api.commentaryProfileContents) {\r\n files.push(\r\n jsonFile(profileContent.profile.thisProfileLink, profileContent)\r\n );\r\n }\r\n\r\n for (let bookChapter of api.commentaryBookChapters) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n for (let bookChapter of api.simpleCommentaryBookChapters ?? []) {\r\n files.push(jsonFile(bookChapter.thisChapterLink, bookChapter));\r\n }\r\n\r\n if (api.availableDatasets) {\r\n files.push(\r\n jsonFile(\r\n `${api.pathPrefix}/api/available_datasets.json`,\r\n api.availableDatasets,\r\n true\r\n )\r\n );\r\n }\r\n\r\n if (api.datasetBooks) {\r\n for (let datasetBook of api.datasetBooks) {\r\n files.push(\r\n jsonFile(datasetBook.dataset.listOfBooksApiLink, datasetBook)\r\n );\r\n }\r\n }\r\n\r\n if (api.datasetBookChapters) {\r\n for (let datasetBookChapter of api.datasetBookChapters) {\r\n files.push(\r\n jsonFile(datasetBookChapter.thisChapterLink, datasetBookChapter)\r\n );\r\n }\r\n }\r\n\r\n for (let entityChapter of api.datasetEntityBookChapters ?? []) {\r\n files.push(jsonFile(entityChapter.thisChapterLink, entityChapter));\r\n }\r\n\r\n for (let datasetPeople of api.datasetPeople ?? []) {\r\n files.push(\r\n jsonFile(datasetPeople.dataset.listOfPeopleApiLink!, datasetPeople)\r\n );\r\n }\r\n\r\n for (let person of api.datasetPeopleContents ?? []) {\r\n files.push(jsonFile(person.thisPersonApiLink, person));\r\n }\r\n\r\n for (let datasetPlaces of api.datasetPlaces ?? []) {\r\n files.push(\r\n jsonFile(datasetPlaces.dataset.listOfPlacesApiLink!, datasetPlaces)\r\n );\r\n }\r\n\r\n for (let place of api.datasetPlaceContents ?? []) {\r\n files.push(jsonFile(place.thisPlaceApiLink, place));\r\n }\r\n\r\n for (let datasetEvents of api.datasetEvents ?? []) {\r\n files.push(\r\n jsonFile(datasetEvents.dataset.listOfEventsApiLink!, datasetEvents)\r\n );\r\n }\r\n\r\n for (let event of api.datasetEventContents ?? []) {\r\n files.push(jsonFile(event.thisEventApiLink, event));\r\n }\r\n\r\n for (let datasetPeopleGroups of api.datasetPeopleGroups ?? []) {\r\n files.push(\r\n jsonFile(\r\n datasetPeopleGroups.dataset.listOfPeopleGroupsApiLink!,\r\n datasetPeopleGroups\r\n )\r\n );\r\n }\r\n\r\n for (let group of api.datasetPeopleGroupContents ?? []) {\r\n files.push(jsonFile(group.thisPeopleGroupApiLink, group));\r\n }\r\n\r\n // for (let audio of api.translationBookChapterAudio) {\r\n // files.push(downloadedFile(audio.link, audio.originalUrl));\r\n // }\r\n\r\n return files;\r\n}\r\n\r\n/**\r\n * Generates the output files for the given datasets.\r\n * @param datasets The datasets to generate the output files for.\r\n * @param options The options for generating the API files.\r\n */\r\nexport async function* generateOutputFilesFromDatasets(\r\n datasets: AsyncIterable<DatasetOutput>,\r\n options?: GenerateApiOptions\r\n): AsyncGenerator<OutputFile[]> {\r\n for await (let dataset of datasets) {\r\n const api = generateApiForDataset(dataset, options);\r\n const files = generateFilesForApi(api);\r\n\r\n yield files;\r\n }\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a translation.\r\n * @param translationId The ID of the translation.\r\n * @returns\r\n */\r\nexport function listOfBooksApiLink(\r\n translationId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/${translationId}/books.json`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the complete translation download endpoint.\r\n * @param translationId The ID of the translation.\r\n * @param prefix The path prefix.\r\n * @param extension The extension of the file. Use SIMPLE_JSON_EXTENSION for the simplified format.\r\n * @returns\r\n */\r\nexport function completeTranslationApiLink(\r\n translationId: string,\r\n prefix: string = '',\r\n extension: string = 'json'\r\n): string {\r\n return `${prefix}/api/${translationId}/complete.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a commentary.\r\n * @param commentaryId The ID of the commentary.\r\n * @returns\r\n */\r\nexport function listOfCommentaryBooksApiLink(\r\n commentaryId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/c/${commentaryId}/books.json`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for the list of books endpoint for a dataset.\r\n * @param datasetId The ID of the dataset.\r\n * @returns\r\n */\r\nexport function listOfDatasetBooksApiLink(\r\n datasetId: string,\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/d/${datasetId}/books.json`;\r\n}\r\n\r\n/**\r\n * The collections of entities that a dataset can contain.\r\n */\r\nexport type DatasetEntityCollection = DatasetEntityType;\r\n\r\n/**\r\n * Gets the API Link for the list of entities in a collection for a dataset.\r\n * @param datasetId The ID of the dataset.\r\n * @param collection The collection of entities.\r\n * @param extension The extension of the file.\r\n * @param prefix The prefix for the API links.\r\n */\r\nexport function listOfDatasetEntitiesApiLink(\r\n datasetId: string,\r\n collection: DatasetEntityCollection,\r\n extension: string = 'json',\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/d/${datasetId}/${collection}.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API Link for an entity in a collection for a dataset.\r\n * @param datasetId The ID of the dataset.\r\n * @param collection The collection of entities.\r\n * @param entityId The ID of the entity.\r\n * @param extension The extension of the file.\r\n * @param prefix The prefix for the API links.\r\n */\r\nexport function datasetEntityApiLink(\r\n datasetId: string,\r\n collection: DatasetEntityCollection,\r\n entityId: string,\r\n extension: string = 'json',\r\n prefix: string = ''\r\n): string {\r\n return `${prefix}/api/d/${datasetId}/${collection}/${replaceSpacesWithUnderscores(\r\n entityId\r\n )}.${extension}`;\r\n}\r\n\r\n/**\r\n * The file extension that is used for chapters that are in the simplified format.\r\n */\r\nexport const SIMPLE_JSON_EXTENSION = 'simple.json';\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookCommentaryChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\nexport function bookChapterAudioApiLink(\r\n translationId: string,\r\n bookId: string,\r\n chapterNumber: number,\r\n reader: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n bookId\r\n )}/${chapterNumber}.${reader}.mp3`;\r\n}\r\n\r\nexport function bookChapterAudioTimingsApiLink(\r\n translationId: string,\r\n bookId: string,\r\n chapterNumber: number,\r\n reader: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n bookId\r\n )}/${chapterNumber}.${reader}.audioTimings.json`;\r\n}\r\n\r\n/**\r\n * Gets the API link for the word-level annotations of a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param bookId The ID of the book.\r\n * @param chapterNumber The number of the chapter.\r\n * @param prefix The prefix that should be added to the link.\r\n * @param extension The extension of the file. Use SIMPLE_JSON_EXTENSION for the simplified format.\r\n */\r\nexport function bookChapterWordsApiLink(\r\n translationId: string,\r\n bookId: string,\r\n chapterNumber: number,\r\n prefix: string = '',\r\n extension: string = 'json'\r\n) {\r\n return `${prefix}/api/${translationId}/${replaceSpacesWithUnderscores(\r\n bookId\r\n )}/${chapterNumber}.words.${extension}`;\r\n}\r\n\r\n/**\r\n * Getes the API link for a book chapter.\r\n * @param translationId The ID of the translation.\r\n * @param commonName The name of the book.\r\n * @param chapterNumber The number of the book.\r\n * @param extension The extension of the file.\r\n */\r\nexport function bookDatasetChapterApiLink(\r\n translationId: string,\r\n commonName: string,\r\n chapterNumber: number,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/d/${translationId}/${replaceSpacesWithUnderscores(\r\n commonName\r\n )}/${chapterNumber}.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API link for a profile.\r\n * @param translationId The ID of the translation.\r\n * @param profileId The ID of the profile.\r\n * @param extension The extension of the file.\r\n */\r\nexport function profilesCommentaryApiLink(\r\n translationId: string,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/profiles.${extension}`;\r\n}\r\n\r\n/**\r\n * Gets the API link for a profile.\r\n * @param translationId The ID of the translation.\r\n * @param profileId The ID of the profile.\r\n * @param extension The extension of the file.\r\n */\r\nexport function profileCommentaryApiLink(\r\n translationId: string,\r\n profileId: string,\r\n extension: string,\r\n prefix: string = ''\r\n) {\r\n return `${prefix}/api/c/${translationId}/profiles/${replaceSpacesWithUnderscores(\r\n profileId\r\n )}.${extension}`;\r\n}\r\n\r\nexport function jsonFile(\r\n path: string,\r\n content: any,\r\n mergable?: boolean\r\n): OutputFile {\r\n return {\r\n path,\r\n content,\r\n mergable,\r\n };\r\n}\r\n\r\nexport function downloadedFile(path: string, url: string): OutputFile {\r\n return {\r\n path,\r\n content: () => fetch(url).then((response) => response.body),\r\n };\r\n}\r\n\r\nexport function replaceSpacesWithUnderscores(str: string): string {\r\n return str.replace(/[<>:\"/\\\\|?*\\s]/g, '_');\r\n}\r\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS;AAClB;AAAA,EAMI;AAAA,EACA;AAAA,EAGA;AAAA,EAGA;AAAA,EACA;AAAA,EAKA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EAGA;AAAA,EAEA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,O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