@helloao/tools 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/generation/api.cjs +856 -36
  2. package/dist/cjs/generation/api.cjs.map +3 -3
  3. package/dist/cjs/generation/audio.cjs +5 -5
  4. package/dist/cjs/generation/audio.cjs.map +1 -1
  5. package/dist/cjs/generation/book-order.cjs.map +1 -1
  6. package/dist/cjs/generation/common-types.cjs +359 -14
  7. package/dist/cjs/generation/common-types.cjs.map +2 -2
  8. package/dist/cjs/generation/dataset.cjs +13 -9
  9. package/dist/cjs/generation/dataset.cjs.map +2 -2
  10. package/dist/cjs/generation/index.cjs +8 -5
  11. package/dist/cjs/generation/index.cjs.map +2 -2
  12. package/dist/cjs/generation/simple.cjs +294 -0
  13. package/dist/cjs/generation/simple.cjs.map +7 -0
  14. package/dist/cjs/index.cjs +4 -4
  15. package/dist/cjs/index.cjs.map +1 -1
  16. package/dist/cjs/log.cjs.map +1 -1
  17. package/dist/cjs/parser/codex-parser.cjs +3 -3
  18. package/dist/cjs/parser/codex-parser.cjs.map +3 -3
  19. package/dist/cjs/parser/commentary-csv-parser.cjs +14 -3
  20. package/dist/cjs/parser/commentary-csv-parser.cjs.map +3 -3
  21. package/dist/cjs/parser/index.cjs +1 -1
  22. package/dist/cjs/parser/iterators.cjs.map +1 -1
  23. package/dist/cjs/parser/lockman-parser.cjs +1 -1
  24. package/dist/cjs/parser/lockman-parser.cjs.map +1 -1
  25. package/dist/cjs/parser/tyndale-xml-parser.cjs +1 -1
  26. package/dist/cjs/parser/tyndale-xml-parser.cjs.map +1 -1
  27. package/dist/cjs/parser/types.cjs.map +1 -1
  28. package/dist/cjs/parser/usfm-parser.cjs +2 -2
  29. package/dist/cjs/parser/usfm-parser.cjs.map +1 -1
  30. package/dist/cjs/parser/usx-parser.cjs +122 -26
  31. package/dist/cjs/parser/usx-parser.cjs.map +2 -2
  32. package/dist/cjs/parser/words.cjs +187 -0
  33. package/dist/cjs/parser/words.cjs.map +7 -0
  34. package/dist/cjs/utils.cjs +1 -1
  35. package/dist/esm/generation/api.js +835 -37
  36. package/dist/esm/generation/api.js.map +3 -3
  37. package/dist/esm/generation/audio.js +1 -1
  38. package/dist/esm/generation/audio.js.map +1 -1
  39. package/dist/esm/generation/book-order.js.map +1 -1
  40. package/dist/esm/generation/common-types.js +327 -14
  41. package/dist/esm/generation/common-types.js.map +2 -2
  42. package/dist/esm/generation/dataset.js +6 -2
  43. package/dist/esm/generation/dataset.js.map +2 -2
  44. package/dist/esm/generation/index.js +2 -1
  45. package/dist/esm/generation/index.js.map +2 -2
  46. package/dist/esm/generation/simple.js +260 -0
  47. package/dist/esm/generation/simple.js.map +7 -0
  48. package/dist/esm/index.js.map +1 -1
  49. package/dist/esm/log.js.map +1 -1
  50. package/dist/esm/parser/codex-parser.js +3 -3
  51. package/dist/esm/parser/codex-parser.js.map +3 -3
  52. package/dist/esm/parser/commentary-csv-parser.js +3 -2
  53. package/dist/esm/parser/commentary-csv-parser.js.map +2 -2
  54. package/dist/esm/parser/iterators.js.map +1 -1
  55. package/dist/esm/parser/lockman-parser.js +1 -1
  56. package/dist/esm/parser/lockman-parser.js.map +1 -1
  57. package/dist/esm/parser/tyndale-xml-parser.js +1 -1
  58. package/dist/esm/parser/tyndale-xml-parser.js.map +1 -1
  59. package/dist/esm/parser/usfm-parser.js +1 -1
  60. package/dist/esm/parser/usfm-parser.js.map +1 -1
  61. package/dist/esm/parser/usx-parser.js +130 -26
  62. package/dist/esm/parser/usx-parser.js.map +2 -2
  63. package/dist/esm/parser/words.js +149 -0
  64. package/dist/esm/parser/words.js.map +7 -0
  65. package/dist/types/generation/api.d.ts +6879 -918
  66. package/dist/types/generation/common-types.d.ts +432 -2
  67. package/dist/types/generation/index.d.ts +2 -1
  68. package/dist/types/generation/simple.d.ts +110 -0
  69. package/dist/types/parser/commentary-csv-parser.d.ts +1 -1
  70. package/dist/types/parser/lockman-parser.d.ts +1 -1
  71. package/dist/types/parser/tyndale-xml-parser.d.ts +1 -1
  72. package/dist/types/parser/types.d.ts +63 -0
  73. package/dist/types/parser/usx-parser.d.ts +6 -5
  74. package/dist/types/parser/words.d.ts +104 -0
  75. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../generation/common-types.ts"],
4
- "sourcesContent": ["import { z } from 'zod';\r\nimport { BookIdSchema, VerseRef, VerseRefSchema } from '../utils.js';\r\n\r\n/**\r\n * Defines an interface that contains information about a input file.\r\n */\r\nexport type InputFile = InputTranslationFile | InputCommentaryFile;\r\n\r\nexport interface InputFileBase {\r\n name?: string;\r\n content: string;\r\n sha256?: string;\r\n}\r\n\r\nexport type InputFileMetadata =\r\n | InputTranslationMetadata\r\n | InputCommentaryMetadata;\r\n\r\nexport interface InputTranslationFile extends InputFileBase {\r\n fileType: 'usfm' | 'usx' | 'json' | 'lockman';\r\n metadata: InputTranslationMetadata;\r\n}\r\n\r\nexport interface InputCommentaryFile extends InputFileBase {\r\n fileType: 'commentary/csv' | 'commentary/tyndale-xml';\r\n metadata: InputCommentaryMetadata;\r\n}\r\n\r\nexport type OutputFileContent = object | ReadableStream;\r\n\r\n/**\r\n * Defines an interface that contains information about a output file.\r\n */\r\nexport interface OutputFile {\r\n /**\r\n * The path that the file should be stored at.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The content of the file.\r\n */\r\n content: OutputFileContent | (() => Promise<OutputFileContent>);\r\n\r\n /**\r\n * Whether the file can be merged with files of the same name but from other datasets.\r\n */\r\n mergable?: boolean;\r\n}\r\n\r\nexport interface MetadataBase {\r\n /**\r\n * The name of the translation.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The english name of the translation.\r\n */\r\n englishName: string;\r\n\r\n /**\r\n * The website for the translation.\r\n */\r\n website: string;\r\n\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: string;\r\n\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice?: string | null;\r\n\r\n /**\r\n * The ISO 639 letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n\r\n /**\r\n * The direction that the text is written in.\r\n */\r\n direction: 'ltr' | 'rtl';\r\n}\r\n\r\n/**\r\n * The metadata for a translation that is input into the generator.\r\n */\r\nexport interface InputTranslationMetadata extends MetadataBase {\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName: string;\r\n}\r\n\r\n/**\r\n * The metadata for a translation that is input into the generator.\r\n */\r\nexport interface InputCommentaryMetadata extends MetadataBase {\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: string;\r\n}\r\n\r\n/**\r\n * Defines a Zod schema for information about a translation.\r\n */\r\nexport const TranslationSchema = z.object({\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the translation.',\r\n }),\r\n\r\n /**\r\n * The name of the translation.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the translation.',\r\n }),\r\n\r\n /**\r\n * The website for the translation.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the translation.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description: 'The URL that the license for the translation can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice: z.string().nullable().optional().meta({\r\n description: 'The notice that should be displayed when displaying content from the translation.',\r\n }),\r\n\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName: z.string().optional().meta({\r\n description: 'The short name for the translation.',\r\n }),\r\n\r\n /**\r\n * The English name for the translation.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the translation.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: z.string().meta({\r\n description: 'The ISO 639 3-letter language tag that the translation is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n * \"ltr\" indicates that the text is written from the left side of the page to the right.\r\n * \"rtl\" indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description: 'The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.',\r\n }),\r\n});\r\n\r\nexport type Translation = z.infer<typeof TranslationSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a commentary.\r\n */\r\nexport const CommentarySchema = z.object({\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the commentary.',\r\n }),\r\n\r\n /**\r\n * The name of the commentary.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the commentary.',\r\n }),\r\n\r\n /**\r\n * The website for the commentary.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the commentary.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the commentary can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description: 'The URL that the license for the commentary can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The english name for the commentary.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the commentary.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: z.string().meta({\r\n description: 'The ISO 639 3-letter language tag that the translation is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n * \"ltr\" indicates that the text is written from the left side of the page to the right.\r\n * \"rtl\" indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description: 'The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.',\r\n }),\r\n});\r\n\r\nexport type Commentary = z.infer<typeof CommentarySchema>;\r\n\r\nexport const DatasetSchema = z.object({\r\n /**\r\n * The ID of the dataset.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the dataset.',\r\n }),\r\n\r\n /**\r\n * The name of the dataset.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the dataset.',\r\n }),\r\n\r\n /**\r\n * The website for the dataset.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the dataset.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the dataset can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description: 'The URL that the license for the dataset can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The English name for the dataset.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the dataset.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the dataset is primarily in.\r\n */\r\n language: z.string().meta({\r\n description: 'The ISO 639 3-letter language tag that the dataset is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description: 'The direction that the language is written in.',\r\n }),\r\n});\r\n\r\nexport type Dataset = z.infer<typeof DatasetSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book.\r\n */\r\nexport const TranslationBookSchema = z.object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: z.string().meta({\r\n description: 'The name that the translation provided for the book.',\r\n }),\r\n\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: z.string().meta({\r\n description: 'The common name for the book.',\r\n }),\r\n\r\n /**\r\n * The title of the book.\r\n * This is usually a more descriptive version of the book name.\r\n * If not available, then one was not provided by the translation.\r\n */\r\n title: z.string().nullable().meta({\r\n description: 'The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.',\r\n }),\r\n\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: z.number().meta({\r\n description: 'The numerical order of the book in the translation.',\r\n }),\r\n\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal: z.boolean().optional().meta({\r\n description: 'Whether the book is an apocryphal book.',\r\n }),\r\n}).meta({\r\n id: 'TranslationBook',\r\n description: 'Defines the schema for information about a book.',\r\n});\r\n\r\nexport type TranslationBook = z.infer<typeof TranslationBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book in a commentary.\r\n */\r\nexport const CommentaryBookSchema = z.object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The name that the commentary provided for the book.\r\n */\r\n name: z.string().meta({\r\n description: 'The name that the commentary provided for the book.',\r\n }),\r\n\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: z.string().meta({\r\n description: 'The common name for the book.',\r\n }),\r\n\r\n /**\r\n * The commentary's introduction for the book.\r\n */\r\n introduction: z.string().optional().meta({\r\n description: 'The commentary\\'s introduction for the book. Undefined if the commentary didn\\'t provide an introduction for the book.',\r\n }),\r\n\r\n /**\r\n * The summary of the commentary's introduction for the book.\r\n */\r\n introductionSummary: z.string().optional().meta({\r\n description: 'The summary of the commentary\\'s introduction for the book. Undefined if the commentary didn\\'t provide a summary for the book.',\r\n }),\r\n\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: z.number().meta({\r\n description: 'The order of the book in the Bible.',\r\n }),\r\n}).meta({\r\n id: \"CommentaryBook\",\r\n description: \"Defines the schema for information about a book in a commentary.\",\r\n});\r\n\r\nexport type CommentaryBook = z.infer<typeof CommentaryBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a dataset book.\r\n */\r\nexport const DatasetBookSchema = z.object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: z.number().meta({\r\n description: 'The order of the book in the Bible.',\r\n }),\r\n}).meta({\r\n id: 'DatasetBook',\r\n description: 'Defines the schema for information about a book in a dataset.',\r\n});\r\n\r\nexport type DatasetBook = z.infer<typeof DatasetBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a chapter in a dataset.\r\n */\r\nexport const DatasetBookChapterSchema = z.object({\r\n /**\r\n * The data for the chapter.\r\n */\r\n chapter: z.lazy(() => DatasetChapterDataSchema).meta({\r\n description: 'The data for the chapter.',\r\n }),\r\n}).meta({\r\n id: 'DatasetBookChapter',\r\n description: 'Defines the schema for information about a chapter in a dataset.',\r\n});\r\n\r\nexport type DatasetBookChapter = z.infer<typeof DatasetBookChapterSchema>;\r\n\r\nexport const DatasetChapterDataSchema = z.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 content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => DatasetChapterVerseContentSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n}).meta({\r\n id: 'DatasetChapterData',\r\n description: 'Defines the schema for information about a chapter in a dataset.',\r\n});\r\n\r\nexport type DatasetChapterData = z.infer<typeof DatasetChapterDataSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a verse in a dataset chapter.\r\n */\r\nexport const DatasetChapterVerseContentSchema = z.object({\r\n /**\r\n * The number of the verse.\r\n */\r\n verse: z.number().meta({\r\n description: 'The number of the verse.',\r\n }),\r\n\r\n /**\r\n * The list of references for the verse.\r\n */\r\n references: z.array(z.lazy(() => ScoredVerseRefSchema)).meta({\r\n description: 'The list of references for the verse.',\r\n }),\r\n}).meta({\r\n id: 'DatasetChapterVerseContent',\r\n description: 'Defines the schema for information about a verse in a dataset chapter.',\r\n});\r\n\r\nexport type DatasetChapterVerseContent = z.infer<typeof DatasetChapterVerseContentSchema>;\r\n\r\n/**\r\n * Defines an interface that contains information about a verse reference that has an arbitrary score attached to it.\r\n */\r\nexport const ScoredVerseRefSchema = VerseRefSchema.extend({\r\n score: z.number().meta({\r\n description: 'The score for the verse reference. The meaning of the score is arbitrary and is determined by the dataset.',\r\n }),\r\n}).meta({\r\n id: 'ScoredVerseRef',\r\n description: 'Defines the schema for information about a verse reference that has an arbitrary score attached to it.',\r\n});\r\n\r\nexport type ScoredVerseRef = z.infer<typeof ScoredVerseRefSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a profile in a commentary.\r\n */\r\nexport const CommentaryProfileSchema = z.object({\r\n /**\r\n * The ID of the profile.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the profile.',\r\n }),\r\n\r\n /**\r\n * The subject of the profile.\r\n */\r\n subject: z.string().meta({\r\n description: 'The subject of the profile.',\r\n }),\r\n\r\n /**\r\n * The Bible reference that the profile is associated with.\r\n */\r\n reference: VerseRefSchema.nullable().meta({\r\n description: 'The Bible reference that the profile is associated with. Null if the profile isn\\'t associated with a specific Bible reference.',\r\n }),\r\n});\r\n\r\nexport type CommentaryProfile = z.infer<typeof CommentaryProfileSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book chapter.\r\n */\r\nexport const TranslationBookChapterSchema = z.object({\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: z.lazy(() => ChapterDataSchema).meta({\r\n description: 'The information for the chapter.',\r\n }),\r\n\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: z.lazy(() => TranslationBookChapterAudioLinksSchema).meta({\r\n description: 'The links to different audio versions for the chapter.',\r\n }),\r\n}).meta({\r\n id: 'TranslationBookChapter',\r\n description: 'Defines the schema for information about a book chapter.',\r\n});\r\n\r\nexport type TranslationBookChapter = z.infer<typeof TranslationBookChapterSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book chapter in a commentary.\r\n */\r\nexport const CommentaryBookChapterSchema = z.object({\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: z.lazy(() => CommentaryChapterDataSchema).meta({\r\n description: 'The information for the chapter.',\r\n }),\r\n}).meta({\r\n id: 'CommentaryBookChapter',\r\n description: 'Defines the schema for information about a book chapter in a commentary.',\r\n});\r\n\r\nexport type CommentaryBookChapter = z.infer<typeof CommentaryBookChapterSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the audio links for a book chapter.\r\n */\r\nexport const TranslationBookChapterAudioLinksSchema = z.record(z.string(), z.string()).meta({\r\n id: 'TranslationBookChapterAudioLinks',\r\n description: 'Defines the schema for the audio links for a book chapter.',\r\n});\r\n\r\nexport type TranslationBookChapterAudioLinks = z.infer<typeof TranslationBookChapterAudioLinksSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about data in a chapter.\r\n */\r\nexport const ChapterDataSchema = z.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 content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => ChapterContentSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: z.array(z.lazy(() => ChapterFootnoteSchema)).meta({\r\n description: 'The list of footnotes for the chapter.',\r\n }),\r\n});\r\n\r\nexport type ChapterData = z.infer<typeof ChapterDataSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about data in a chapter in a commentary.\r\n */\r\nexport const CommentaryChapterDataSchema = z.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 introduction that the commentary provided to the chapter.\r\n * Not all commentaries provide an introduction to a chapter.\r\n */\r\n introduction: z.string().optional().meta({\r\n description: 'The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.',\r\n }),\r\n\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => ChapterVerseSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n});\r\n\r\nexport type CommentaryChapterData = z.infer<typeof CommentaryChapterDataSchema>;\r\n\r\n/**\r\n * A Zod schema for a heading in a chapter.\r\n */\r\nexport const ChapterHeadingSchema = z.object({\r\n /**\r\n * Indicates that the content represents a heading.\r\n */\r\n type: z.literal('heading'),\r\n\r\n /**\r\n * The content for the heading.\r\n * If multiple strings are included in the array, they should be concatenated with a space.\r\n */\r\n content: z.array(z.string()).meta({\r\n description: 'The content for the heading. If multiple strings are included in the array, they should be concatenated with a space.',\r\n }),\r\n}).meta({\r\n id: 'ChapterHeading',\r\n description: 'Defines the schema for a heading in a chapter.',\r\n});\r\n\r\nexport type ChapterHeading = z.infer<typeof ChapterHeadingSchema>;\r\n\r\n/**\r\n * A Zod schema for a line break in a chapter.\r\n */\r\nexport const ChapterLineBreakSchema = z.object({\r\n /**\r\n * Indicates that the content represents a line break.\r\n */\r\n type: z.literal('line_break'),\r\n}).meta({\r\n id: 'ChapterLineBreak',\r\n description: 'Defines the schema for a line break in a chapter.',\r\n});\r\n\r\nexport type ChapterLineBreak = z.infer<typeof ChapterLineBreakSchema>;\r\n\r\n/**\r\n * A Zod schema for a Hebrew Subtitle in a chapter.\r\n * These are often used included as informational content that appeared in the original manuscripts.\r\n * For example, Psalms 49 has the Hebrew Subtitle \"To the choirmaster. A Psalm of the Sons of Korah.\"\r\n */\r\nexport const ChapterHebrewSubtitleSchema = z.object({\r\n /**\r\n * Indicates that the content represents a Hebrew Subtitle.\r\n */\r\n type: z.literal('hebrew_subtitle'),\r\n\r\n /**\r\n * The list of content that is contained in the subtitle.\r\n * Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: z.array(z.union([\r\n z.string(),\r\n z.lazy(() => FormattedTextSchema),\r\n z.lazy(() => VerseFootnoteReferenceSchema),\r\n ])).meta({\r\n description: 'The content that is contained in the subtitle. Each element in the list could be a string, formatted text, or a footnote reference.',\r\n }),\r\n}).meta({\r\n id: 'ChapterHebrewSubtitle',\r\n description: 'Defines the schema for a Hebrew Subtitle in a chapter.',\r\n});\r\n\r\nexport type ChapterHebrewSubtitle = z.infer<typeof ChapterHebrewSubtitleSchema>;\r\n\r\n/**\r\n * A Zod schema for a verse in a chapter.\r\n */\r\nexport const ChapterVerseSchema = z.object({\r\n /**\r\n * Indicates that the content is a verse.\r\n */\r\n type: z.literal('verse'),\r\n\r\n /**\r\n * The number of the verse.\r\n */\r\n number: z.number().meta({\r\n description: 'The number of the verse.',\r\n }),\r\n\r\n /**\r\n * The list of content for the verse.\r\n * Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: z.array(z.union([\r\n z.string(),\r\n z.lazy(() => FormattedTextSchema),\r\n z.lazy(() => InlineHeadingSchema),\r\n z.lazy(() => InlineLineBreakSchema),\r\n z.lazy(() => VerseFootnoteReferenceSchema),\r\n ])).meta({\r\n description: 'The list of content for the verse. Each element in the list could be a string, formatted text, or a footnote reference.',\r\n }),\r\n}).meta({\r\n id: 'ChapterVerse',\r\n description: 'Defines the schema for a verse in a chapter.',\r\n});\r\n\r\nexport type ChapterVerse = z.infer<typeof ChapterVerseSchema>;\r\n\r\n/**\r\n * A union type that represents a single piece of chapter content.\r\n * A piece of chapter content can be one of the following things:\r\n * - A heading.\r\n * - A line break.\r\n * - A verse.\r\n * - A Hebrew Subtitle.\r\n */\r\nexport const ChapterContentSchema = z.discriminatedUnion('type', [\r\n ChapterHeadingSchema,\r\n ChapterLineBreakSchema,\r\n ChapterVerseSchema,\r\n ChapterHebrewSubtitleSchema,\r\n]).meta({\r\n id: 'ChapterContent',\r\n description: 'Defines a union type that represents a single piece of chapter content. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.',\r\n});\r\n\r\n/**\r\n * A union type that represents a single piece of chapter content.\r\n * A piece of chapter content can be one of the following things:\r\n * - A heading.\r\n * - A line break.\r\n * - A verse.\r\n * - A Hebrew Subtitle.\r\n */\r\nexport type ChapterContent = z.infer<typeof ChapterContentSchema>;\r\n\r\n/**\r\n * A Zod schema for formatted text. That is, text that is formatted in a particular manner.\r\n */\r\nexport const FormattedTextSchema = z.object({\r\n /**\r\n * The text that is formatted.\r\n */\r\n text: z.string().meta({\r\n description: 'The text that is formatted.',\r\n }),\r\n\r\n /**\r\n * Whether the text represents a poem.\r\n * The number indicates the level of indent.\r\n *\r\n * Common in Psalms.\r\n */\r\n poem: z.number().optional().meta({\r\n description: 'Whether the text represents a poem. The number indicates the level of indent. Common in Psalms.',\r\n }),\r\n\r\n /**\r\n * Whether the text represents the Words of Jesus.\r\n */\r\n wordsOfJesus: z.boolean().optional().meta({\r\n description: 'Whether the text represents the Words of Jesus.',\r\n }),\r\n}).meta({\r\n id: 'FormattedText',\r\n description: 'Defines the schema for formatted text. That is, text that is formatted in a particular manner.',\r\n});\r\n\r\nexport type FormattedText = z.infer<typeof FormattedTextSchema>;\r\n\r\n/**\r\n * A Zod schema for a heading that is embedded in a verse.\r\n */\r\nexport const InlineHeadingSchema = z.object({\r\n /**\r\n * The text of the heading.\r\n */\r\n heading: z.string().meta({\r\n description: 'The text of the heading.',\r\n }),\r\n}).meta({\r\n id: 'InlineHeading',\r\n description: 'Defines the schema for a heading that is embedded in a verse.',\r\n});\r\n\r\nexport type InlineHeading = z.infer<typeof InlineHeadingSchema>;\r\n\r\n/**\r\n * A Zod schema for a line break that is embedded in a verse.\r\n */\r\nexport const InlineLineBreakSchema = z.object({\r\n lineBreak: z.literal(true),\r\n}).meta({\r\n id: 'InlineLineBreak',\r\n description: 'Defines the schema for a line break that is embedded in a verse.',\r\n});\r\n\r\nexport type InlineLineBreak = z.infer<typeof InlineLineBreakSchema>;\r\n\r\n/**\r\n * A Zod schema for a footnote reference in a verse or a Hebrew Subtitle.\r\n */\r\nexport const VerseFootnoteReferenceSchema = z.object({\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: z.number().meta({\r\n description: 'The ID of the note.',\r\n }),\r\n}).meta({\r\n id: 'VerseFootnoteReference',\r\n description: 'Defines the schema for a footnote reference in a verse or a Hebrew Subtitle.',\r\n});\r\n\r\nexport type VerseFootnoteReference = z.infer<typeof VerseFootnoteReferenceSchema>;\r\n\r\n/**\r\n * A Zod schema for information about a footnote.\r\n */\r\nexport const ChapterFootnoteSchema = z.object({\r\n /**\r\n * The ID of the note that is referenced.\r\n */\r\n noteId: z.number().meta({\r\n description: 'The ID of the note that is referenced.',\r\n }),\r\n\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: z.string().meta({\r\n description: 'The text of the footnote.',\r\n }),\r\n\r\n /**\r\n * The verse reference for the footnote.\r\n */\r\n reference: z.object({\r\n chapter: z.number(),\r\n verse: z.number(),\r\n }).optional().meta({\r\n description: 'The verse reference for the footnote. Undefined if the footnote isn\\'t associated with a specific verse.',\r\n }),\r\n\r\n /**\r\n * The caller that should be used for the footnote.\r\n * For footnotes, a \"caller\" is the character that is used in the text to reference to footnote.\r\n *\r\n * For example, in the text:\r\n * Hello (a) World\r\n *\r\n * ----\r\n * (a) This is a footnote.\r\n *\r\n * The \"(a)\" is the caller.\r\n *\r\n * If \"+\", then the caller should be autogenerated.\r\n * If null, then the caller should be empty.\r\n * If a string, then the caller should be that string.\r\n */\r\n caller: z.union([z.literal('+'), z.string(), z.null()]).meta({\r\n description: 'The caller that should be used for the footnote. For footnotes, a \"caller\" is the character that is used in the text to reference to footnote. For example, in the text: Hello (a) World ---- (a) This is a footnote. The \"(a)\" is the caller. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.',\r\n }),\r\n}).meta({\r\n id: 'ChapterFootnote',\r\n description: 'Defines the schema for information about a footnote.',\r\n});\r\n\r\nexport type ChapterFootnote = z.infer<typeof ChapterFootnoteSchema>;\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA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AA,EAIjD,QAAQ,aAAE,OAAO,EAAE,KAAK;AAAA,IACpB,aAAa;AAAA,EACjB,CAAC;AACL,CAAC,EAAE,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,aAAa;AACjB,CAAC;AAOM,MAAM,wBAAwB,aAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAI1C,QAAQ,aAAE,OAAO,EAAE,KAAK;AAAA,IACpB,aAAa;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,MAAM,aAAE,OAAO,EAAE,KAAK;AAAA,IAClB,aAAa;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,WAAW,aAAE,OAAO;AAAA,IAChB,SAAS,aAAE,OAAO;AAAA,IAClB,OAAO,aAAE,OAAO;AAAA,EACpB,CAAC,EAAE,SAAS,EAAE,KAAK;AAAA,IACf,aAAa;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBD,QAAQ,aAAE,MAAM,CAAC,aAAE,QAAQ,GAAG,GAAG,aAAE,OAAO,GAAG,aAAE,KAAK,CAAC,CAAC,EAAE,KAAK;AAAA,IACzD,aAAa;AAAA,EACjB,CAAC;AACL,CAAC,EAAE,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,aAAa;AACjB,CAAC;",
4
+ "sourcesContent": ["import { z } from 'zod';\r\nimport { BookIdSchema, VerseRef, VerseRefSchema } from '../utils.js';\r\n\r\n/**\r\n * Defines an interface that contains information about a input file.\r\n */\r\nexport type InputFile = InputTranslationFile | InputCommentaryFile;\r\n\r\nexport interface InputFileBase {\r\n name?: string;\r\n content: string;\r\n sha256?: string;\r\n}\r\n\r\nexport type InputFileMetadata =\r\n | InputTranslationMetadata\r\n | InputCommentaryMetadata;\r\n\r\nexport interface InputTranslationFile extends InputFileBase {\r\n fileType: 'usfm' | 'usx' | 'json' | 'lockman';\r\n metadata: InputTranslationMetadata;\r\n}\r\n\r\nexport interface InputCommentaryFile extends InputFileBase {\r\n fileType: 'commentary/csv' | 'commentary/tyndale-xml';\r\n metadata: InputCommentaryMetadata;\r\n}\r\n\r\nexport type OutputFileContent = object | ReadableStream;\r\n\r\n/**\r\n * Defines an interface that contains information about a output file.\r\n */\r\nexport interface OutputFile {\r\n /**\r\n * The path that the file should be stored at.\r\n */\r\n path: string;\r\n\r\n /**\r\n * The content of the file.\r\n */\r\n content: OutputFileContent | (() => Promise<OutputFileContent>);\r\n\r\n /**\r\n * Whether the file can be merged with files of the same name but from other datasets.\r\n */\r\n mergable?: boolean;\r\n}\r\n\r\nexport interface MetadataBase {\r\n /**\r\n * The name of the translation.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The english name of the translation.\r\n */\r\n englishName: string;\r\n\r\n /**\r\n * The website for the translation.\r\n */\r\n website: string;\r\n\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: string;\r\n\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice?: string | null;\r\n\r\n /**\r\n * The ISO 639 letter language tag that the translation is primarily in.\r\n */\r\n language: string;\r\n\r\n /**\r\n * The direction that the text is written in.\r\n */\r\n direction: 'ltr' | 'rtl';\r\n}\r\n\r\n/**\r\n * The metadata for a translation that is input into the generator.\r\n */\r\nexport interface InputTranslationMetadata extends MetadataBase {\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: string;\r\n\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName: string;\r\n}\r\n\r\n/**\r\n * The metadata for a translation that is input into the generator.\r\n */\r\nexport interface InputCommentaryMetadata extends MetadataBase {\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: string;\r\n}\r\n\r\n/**\r\n * Defines a Zod schema for information about a translation.\r\n */\r\nexport const TranslationSchema = z.object({\r\n /**\r\n * The ID of the translation.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the translation.',\r\n }),\r\n\r\n /**\r\n * The name of the translation.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the translation.',\r\n }),\r\n\r\n /**\r\n * The website for the translation.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the translation.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the translation can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description:\r\n 'The URL that the license for the translation can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The notice that should be displayed when displaying content from the translation.\r\n */\r\n licenseNotice: z.string().nullable().optional().meta({\r\n description:\r\n 'The notice that should be displayed when displaying content from the translation.',\r\n }),\r\n\r\n /**\r\n * The short name for the translation.\r\n */\r\n shortName: z.string().optional().meta({\r\n description: 'The short name for the translation.',\r\n }),\r\n\r\n /**\r\n * The English name for the translation.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the translation.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: z.string().meta({\r\n description:\r\n 'The ISO 639 3-letter language tag that the translation is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n * \"ltr\" indicates that the text is written from the left side of the page to the right.\r\n * \"rtl\" indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description:\r\n 'The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.',\r\n }),\r\n});\r\n\r\nexport type Translation = z.infer<typeof TranslationSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a commentary.\r\n */\r\nexport const CommentarySchema = z.object({\r\n /**\r\n * The ID of the commentary.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the commentary.',\r\n }),\r\n\r\n /**\r\n * The name of the commentary.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the commentary.',\r\n }),\r\n\r\n /**\r\n * The website for the commentary.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the commentary.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the commentary can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description:\r\n 'The URL that the license for the commentary can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The english name for the commentary.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the commentary.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the translation is primarily in.\r\n */\r\n language: z.string().meta({\r\n description:\r\n 'The ISO 639 3-letter language tag that the translation is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n * \"ltr\" indicates that the text is written from the left side of the page to the right.\r\n * \"rtl\" indicates that the text is written from the right side of the page to the left.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description:\r\n 'The direction that the language is written in. `ltr` indicates that the text is written from the left side of the page to the right. `rtl` indicates that the text is written from the right side of the page to the left.',\r\n }),\r\n});\r\n\r\nexport type Commentary = z.infer<typeof CommentarySchema>;\r\n\r\nexport const DatasetSchema = z.object({\r\n /**\r\n * The ID of the dataset.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the dataset.',\r\n }),\r\n\r\n /**\r\n * The name of the dataset.\r\n */\r\n name: z.string().meta({\r\n description: 'The name of the dataset.',\r\n }),\r\n\r\n /**\r\n * The website for the dataset.\r\n */\r\n website: z.string().meta({\r\n description: 'The website for the dataset.',\r\n }),\r\n\r\n /**\r\n * The URL that the license for the dataset can be found.\r\n */\r\n licenseUrl: z.string().meta({\r\n description: 'The URL that the license for the dataset can be found.',\r\n }),\r\n\r\n /**\r\n * The API-added notes for the license.\r\n */\r\n licenseNotes: z.string().nullable().optional().meta({\r\n description: 'The API-added notes for the license.',\r\n }),\r\n\r\n /**\r\n * The English name for the dataset.\r\n */\r\n englishName: z.string().meta({\r\n description: 'The English name for the dataset.',\r\n }),\r\n\r\n /**\r\n * The ISO 639 3-letter language tag that the dataset is primarily in.\r\n */\r\n language: z.string().meta({\r\n description:\r\n 'The ISO 639 3-letter language tag that the dataset is primarily in.',\r\n }),\r\n\r\n /**\r\n * The direction that the language is written in.\r\n */\r\n textDirection: z.enum(['ltr', 'rtl']).meta({\r\n description: 'The direction that the language is written in.',\r\n }),\r\n});\r\n\r\nexport type Dataset = z.infer<typeof DatasetSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book.\r\n */\r\nexport const TranslationBookSchema = z\r\n .object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The name that the translation provided for the book.\r\n */\r\n name: z.string().meta({\r\n description: 'The name that the translation provided for the book.',\r\n }),\r\n\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: z.string().meta({\r\n description: 'The common name for the book.',\r\n }),\r\n\r\n /**\r\n * The title of the book.\r\n * This is usually a more descriptive version of the book name.\r\n * If not available, then one was not provided by the translation.\r\n */\r\n title: z.string().nullable().meta({\r\n description:\r\n 'The title of the book. This is usually a more descriptive version of the book name. If not available, then one was not provided by the translation.',\r\n }),\r\n\r\n /**\r\n * The numerical order of the book in the translation.\r\n */\r\n order: z.number().meta({\r\n description: 'The numerical order of the book in the translation.',\r\n }),\r\n\r\n /**\r\n * Whether the book is an apocryphal book.\r\n */\r\n isApocryphal: z.boolean().optional().meta({\r\n description: 'Whether the book is an apocryphal book.',\r\n }),\r\n })\r\n .meta({\r\n id: 'TranslationBook',\r\n description: 'Defines the schema for information about a book.',\r\n });\r\n\r\nexport type TranslationBook = z.infer<typeof TranslationBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book in a commentary.\r\n */\r\nexport const CommentaryBookSchema = z\r\n .object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The name that the commentary provided for the book.\r\n */\r\n name: z.string().meta({\r\n description: 'The name that the commentary provided for the book.',\r\n }),\r\n\r\n /**\r\n * The common name for the book.\r\n */\r\n commonName: z.string().meta({\r\n description: 'The common name for the book.',\r\n }),\r\n\r\n /**\r\n * The commentary's introduction for the book.\r\n */\r\n introduction: z\r\n .string()\r\n .nullable()\r\n .transform((x) => x ?? undefined)\r\n .optional()\r\n .pipe(z.string().optional())\r\n .meta({\r\n description:\r\n \"The commentary's introduction for the book. Undefined if the commentary didn't provide an introduction for the book.\",\r\n }),\r\n\r\n /**\r\n * The summary of the commentary's introduction for the book.\r\n */\r\n introductionSummary: z\r\n .string()\r\n .nullable()\r\n .transform((x) => x ?? undefined)\r\n .optional()\r\n .pipe(z.string().optional())\r\n .meta({\r\n description:\r\n \"The summary of the commentary's introduction for the book. Undefined if the commentary didn't provide a summary for the book.\",\r\n }),\r\n\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: z.number().meta({\r\n description: 'The order of the book in the Bible.',\r\n }),\r\n })\r\n .meta({\r\n id: 'CommentaryBook',\r\n description:\r\n 'Defines the schema for information about a book in a commentary.',\r\n });\r\n\r\nexport type CommentaryBook = z.infer<typeof CommentaryBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a dataset book.\r\n */\r\nexport const DatasetBookSchema = z\r\n .object({\r\n /**\r\n * The ID of the book. Should match the USFM book ID.\r\n */\r\n id: BookIdSchema,\r\n\r\n /**\r\n * The order of the book in the Bible.\r\n */\r\n order: z.number().meta({\r\n description: 'The order of the book in the Bible.',\r\n }),\r\n })\r\n .meta({\r\n id: 'DatasetBook',\r\n description:\r\n 'Defines the schema for information about a book in a dataset.',\r\n });\r\n\r\nexport type DatasetBook = z.infer<typeof DatasetBookSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a chapter in a dataset.\r\n */\r\nexport const DatasetBookChapterSchema = z\r\n .object({\r\n /**\r\n * The data for the chapter.\r\n */\r\n chapter: z\r\n .lazy(() => DatasetChapterDataSchema)\r\n .meta({\r\n description: 'The data for the chapter.',\r\n }),\r\n })\r\n .meta({\r\n id: 'DatasetBookChapter',\r\n description:\r\n 'Defines the schema for information about a chapter in a dataset.',\r\n });\r\n\r\nexport type DatasetBookChapter = z.infer<typeof DatasetBookChapterSchema>;\r\n\r\nexport const DatasetChapterDataSchema = 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 content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => DatasetChapterVerseContentSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n })\r\n .meta({\r\n id: 'DatasetChapterData',\r\n description:\r\n 'Defines the schema for information about a chapter in a dataset.',\r\n });\r\n\r\nexport type DatasetChapterData = z.infer<typeof DatasetChapterDataSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a verse in a dataset chapter.\r\n */\r\nexport const DatasetChapterVerseContentSchema = z\r\n .object({\r\n /**\r\n * The number of the verse.\r\n */\r\n verse: z.number().meta({\r\n description: 'The number of the verse.',\r\n }),\r\n\r\n /**\r\n * The list of references for the verse.\r\n */\r\n references: z.array(z.lazy(() => ScoredVerseRefSchema)).meta({\r\n description: 'The list of references for the verse.',\r\n }),\r\n })\r\n .meta({\r\n id: 'DatasetChapterVerseContent',\r\n description:\r\n 'Defines the schema for information about a verse in a dataset chapter.',\r\n });\r\n\r\nexport type DatasetChapterVerseContent = z.infer<\r\n typeof DatasetChapterVerseContentSchema\r\n>;\r\n\r\n/**\r\n * Defines an interface that contains information about a verse reference that has an arbitrary score attached to it.\r\n */\r\nexport const ScoredVerseRefSchema = VerseRefSchema.extend({\r\n score: z.number().meta({\r\n description:\r\n 'The score for the verse reference. The meaning of the score is arbitrary and is determined by the dataset.',\r\n }),\r\n}).meta({\r\n id: 'ScoredVerseRef',\r\n description:\r\n 'Defines the schema for information about a verse reference that has an arbitrary score attached to it.',\r\n});\r\n\r\nexport type ScoredVerseRef = z.infer<typeof ScoredVerseRefSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a profile in a commentary.\r\n */\r\nexport const CommentaryProfileSchema = z.object({\r\n /**\r\n * The ID of the profile.\r\n */\r\n id: z.string().meta({\r\n description: 'The ID of the profile.',\r\n }),\r\n\r\n /**\r\n * The subject of the profile.\r\n */\r\n subject: z.string().meta({\r\n description: 'The subject of the profile.',\r\n }),\r\n\r\n /**\r\n * The Bible reference that the profile is associated with.\r\n */\r\n reference: VerseRefSchema.nullable().meta({\r\n description:\r\n \"The Bible reference that the profile is associated with. Null if the profile isn't associated with a specific Bible reference.\",\r\n }),\r\n});\r\n\r\nexport type CommentaryProfile = z.infer<typeof CommentaryProfileSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book chapter.\r\n */\r\nexport const TranslationBookChapterSchema = z\r\n .object({\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: z\r\n .lazy(() => ChapterDataSchema)\r\n .meta({\r\n description: 'The information for the chapter.',\r\n }),\r\n\r\n /**\r\n * The links to different audio versions for the chapter.\r\n */\r\n thisChapterAudioLinks: z\r\n .lazy(() => TranslationBookChapterAudioLinksSchema)\r\n .meta({\r\n description:\r\n 'The links to different audio versions for the chapter.',\r\n }),\r\n\r\n /**\r\n * The audio timings (per-verse start times, in seconds) for different audio versions for the chapter.\r\n */\r\n thisChapterAudioTimings: z\r\n .lazy(() => TranslationBookChapterAudioTimingsSchema)\r\n .meta({\r\n description:\r\n 'The audio timings (per-verse start times, in seconds) for different audio versions for the chapter.',\r\n }),\r\n\r\n /**\r\n * The word-level annotations for the chapter's verses.\r\n * Omitted if the translation doesn't have any word-level annotations for the chapter.\r\n */\r\n thisChapterWords: z\r\n .lazy(() => TranslationBookChapterWordsSchema)\r\n .optional()\r\n .meta({\r\n description:\r\n \"The word-level annotations (Strong's numbers and related source data) for the chapter's verses. Omitted if the translation doesn't have any word-level annotations for the chapter.\",\r\n }),\r\n })\r\n .meta({\r\n id: 'TranslationBookChapter',\r\n description: 'Defines the schema for information about a book chapter.',\r\n });\r\n\r\nexport type TranslationBookChapter = z.infer<\r\n typeof TranslationBookChapterSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book chapter in a commentary.\r\n */\r\nexport const CommentaryBookChapterSchema = z\r\n .object({\r\n /**\r\n * The information for the chapter.\r\n */\r\n chapter: z\r\n .lazy(() => CommentaryChapterDataSchema)\r\n .meta({\r\n description: 'The information for the chapter.',\r\n }),\r\n })\r\n .meta({\r\n id: 'CommentaryBookChapter',\r\n description:\r\n 'Defines the schema for information about a book chapter in a commentary.',\r\n });\r\n\r\nexport type CommentaryBookChapter = z.infer<typeof CommentaryBookChapterSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the audio links for a book chapter.\r\n */\r\nexport const TranslationBookChapterAudioLinksSchema = z\r\n .record(z.string(), z.string())\r\n .meta({\r\n id: 'TranslationBookChapterAudioLinks',\r\n description:\r\n 'Defines the schema for the audio links for a book chapter.',\r\n });\r\n\r\nexport type TranslationBookChapterAudioLinks = z.infer<\r\n typeof TranslationBookChapterAudioLinksSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for the audio timings for a book chapter.\r\n * Maps a reader ID to the list of times (in seconds) that each verse starts, in verse order.\r\n */\r\nexport const TranslationBookChapterAudioTimingsSchema = z\r\n .record(z.string(), z.array(z.number()))\r\n .meta({\r\n id: 'TranslationBookChapterAudioTimings',\r\n description:\r\n 'Defines the schema for the audio timings for a book chapter. Maps a reader ID to the list of times (in seconds) that each verse starts, in verse order.',\r\n });\r\n\r\nexport type TranslationBookChapterAudioTimings = z.infer<\r\n typeof TranslationBookChapterAudioTimingsSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for a word-level annotation in a chapter.\r\n *\r\n * The annotation is anchored to a range of characters in a single item of a\r\n * verse's content, so that consumers can highlight exactly the characters that\r\n * it applies to.\r\n */\r\nexport const ChapterWordSchema = z\r\n .object({\r\n /**\r\n * The index of the item in the verse's content array that the annotation applies to.\r\n */\r\n contentIndex: z.number().meta({\r\n description:\r\n \"The index of the item in the verse's content array that the annotation applies to.\",\r\n }),\r\n\r\n /**\r\n * The index of the first character of the annotated word.\r\n */\r\n start: z.number().meta({\r\n description:\r\n \"The index of the first character of the annotated word in the content item's text.\",\r\n }),\r\n\r\n /**\r\n * The index after the last character of the annotated word.\r\n */\r\n end: z.number().meta({\r\n description:\r\n \"The index after the last character of the annotated word in the content item's text. That is, text.slice(start, end) is the annotated word.\",\r\n }),\r\n\r\n /**\r\n * The Strong's number(s) for the word.\r\n */\r\n strongs: z.array(z.string()).optional().meta({\r\n description:\r\n \"The Strong's number(s) for the word. Omitted if the translation only provided other annotations for the word.\",\r\n }),\r\n\r\n /**\r\n * The dictionary (citation) form of the word.\r\n */\r\n lemma: z.string().optional().meta({\r\n description:\r\n 'The dictionary (citation) form of the word. Omitted if the translation did not provide one.',\r\n }),\r\n\r\n /**\r\n * The morphology parse code for the word.\r\n */\r\n morph: z.string().optional().meta({\r\n description:\r\n 'The morphology parse code for the word. Omitted if the translation did not provide one.',\r\n }),\r\n\r\n /**\r\n * The pointer to the word in the source text.\r\n */\r\n srcloc: z.string().optional().meta({\r\n description:\r\n 'The pointer to the word in the source text, in the <sourceName>:<location> format. Omitted if the translation did not provide one.',\r\n }),\r\n\r\n /**\r\n * Which occurrence of the source word this word is.\r\n */\r\n occurrence: z.number().optional().meta({\r\n description:\r\n 'Which occurrence of the source word this word is. 1-based. Omitted if the translation did not provide one.',\r\n }),\r\n\r\n /**\r\n * The total number of times that the source word occurs.\r\n */\r\n occurrences: z.number().optional().meta({\r\n description:\r\n 'The total number of times that the source word occurs. Omitted if the translation did not provide one.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ChapterWord',\r\n description:\r\n \"Defines the schema for a word-level annotation in a chapter. The annotation is anchored to a range of characters in a single item of a verse's content.\",\r\n });\r\n\r\nexport type ChapterWord = z.infer<typeof ChapterWordSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the word-level annotations for a book chapter.\r\n * Maps a verse number to the list of annotated words in the verse, in order.\r\n */\r\nexport const TranslationBookChapterWordsSchema = z\r\n .record(z.string(), z.array(z.lazy(() => ChapterWordSchema)))\r\n .meta({\r\n id: 'TranslationBookChapterWords',\r\n description:\r\n 'Defines the schema for the word-level annotations for a book chapter. Maps a verse number to the list of annotated words in the verse, in order.',\r\n });\r\n\r\nexport type TranslationBookChapterWords = z.infer<\r\n typeof TranslationBookChapterWordsSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for information about data in a chapter.\r\n */\r\nexport const ChapterDataSchema = z.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 content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => ChapterContentSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: z.array(z.lazy(() => ChapterFootnoteSchema)).meta({\r\n description: 'The list of footnotes for the chapter.',\r\n }),\r\n});\r\n\r\nexport type ChapterData = z.infer<typeof ChapterDataSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for information about data in a chapter in a commentary.\r\n */\r\nexport const CommentaryChapterDataSchema = z.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 introduction that the commentary provided to the chapter.\r\n * Not all commentaries provide an introduction to a chapter.\r\n */\r\n introduction: z.string().optional().meta({\r\n description:\r\n 'The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.',\r\n }),\r\n\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: z.array(z.lazy(() => ChapterVerseSchema)).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n});\r\n\r\nexport type CommentaryChapterData = z.infer<typeof CommentaryChapterDataSchema>;\r\n\r\n/**\r\n * A Zod schema for a heading in a chapter.\r\n */\r\nexport const ChapterHeadingSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content represents a heading.\r\n */\r\n type: z.literal('heading'),\r\n\r\n /**\r\n * The content for the heading.\r\n * If multiple strings are included in the array, they should be concatenated with a space.\r\n */\r\n content: z.array(z.string()).meta({\r\n description:\r\n 'The content for the heading. If multiple strings are included in the array, they should be concatenated with a space.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ChapterHeading',\r\n description: 'Defines the schema for a heading in a chapter.',\r\n });\r\n\r\nexport type ChapterHeading = z.infer<typeof ChapterHeadingSchema>;\r\n\r\n/**\r\n * A Zod schema for a line break in a chapter.\r\n */\r\nexport const ChapterLineBreakSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content represents a line break.\r\n */\r\n type: z.literal('line_break'),\r\n })\r\n .meta({\r\n id: 'ChapterLineBreak',\r\n description: 'Defines the schema for a line break in a chapter.',\r\n });\r\n\r\nexport type ChapterLineBreak = z.infer<typeof ChapterLineBreakSchema>;\r\n\r\n/**\r\n * A Zod schema for a Hebrew Subtitle in a chapter.\r\n * These are often used included as informational content that appeared in the original manuscripts.\r\n * For example, Psalms 49 has the Hebrew Subtitle \"To the choirmaster. A Psalm of the Sons of Korah.\"\r\n */\r\nexport const ChapterHebrewSubtitleSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content represents a Hebrew Subtitle.\r\n */\r\n type: z.literal('hebrew_subtitle'),\r\n\r\n /**\r\n * The list of content that is contained in the subtitle.\r\n * Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: z\r\n .array(\r\n z.union([\r\n z.string(),\r\n z.lazy(() => FormattedTextSchema),\r\n z.lazy(() => VerseFootnoteReferenceSchema),\r\n ])\r\n )\r\n .meta({\r\n description:\r\n 'The content that is contained in the subtitle. Each element in the list could be a string, formatted text, or a footnote reference.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ChapterHebrewSubtitle',\r\n description: 'Defines the schema for a Hebrew Subtitle in a chapter.',\r\n });\r\n\r\nexport type ChapterHebrewSubtitle = z.infer<typeof ChapterHebrewSubtitleSchema>;\r\n\r\n/**\r\n * A Zod schema for a verse in a chapter.\r\n */\r\nexport const ChapterVerseSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content is a verse.\r\n */\r\n type: z.literal('verse'),\r\n\r\n /**\r\n * The number of the verse.\r\n */\r\n number: z.number().meta({\r\n description: 'The number of the verse.',\r\n }),\r\n\r\n /**\r\n * The list of content for the verse.\r\n * Each element in the list could be a string, formatted text, or a footnote reference.\r\n */\r\n content: z\r\n .array(\r\n z.union([\r\n z.string(),\r\n z.lazy(() => FormattedTextSchema),\r\n z.lazy(() => InlineHeadingSchema),\r\n z.lazy(() => InlineLineBreakSchema),\r\n z.lazy(() => VerseFootnoteReferenceSchema),\r\n ])\r\n )\r\n .meta({\r\n description:\r\n 'The list of content for the verse. Each element in the list could be a string, formatted text, or a footnote reference.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ChapterVerse',\r\n description: 'Defines the schema for a verse in a chapter.',\r\n });\r\n\r\nexport type ChapterVerse = z.infer<typeof ChapterVerseSchema>;\r\n\r\n/**\r\n * A union type that represents a single piece of chapter content.\r\n * A piece of chapter content can be one of the following things:\r\n * - A heading.\r\n * - A line break.\r\n * - A verse.\r\n * - A Hebrew Subtitle.\r\n */\r\nexport const ChapterContentSchema = z\r\n .discriminatedUnion('type', [\r\n ChapterHeadingSchema,\r\n ChapterLineBreakSchema,\r\n ChapterVerseSchema,\r\n ChapterHebrewSubtitleSchema,\r\n ])\r\n .meta({\r\n id: 'ChapterContent',\r\n description:\r\n 'Defines a union type that represents a single piece of chapter content. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.',\r\n });\r\n\r\n/**\r\n * A union type that represents a single piece of chapter content.\r\n * A piece of chapter content can be one of the following things:\r\n * - A heading.\r\n * - A line break.\r\n * - A verse.\r\n * - A Hebrew Subtitle.\r\n */\r\nexport type ChapterContent = z.infer<typeof ChapterContentSchema>;\r\n\r\n/**\r\n * A Zod schema for formatted text. That is, text that is formatted in a particular manner.\r\n */\r\nexport const FormattedTextSchema = z\r\n .object({\r\n /**\r\n * The text that is formatted.\r\n */\r\n text: z.string().meta({\r\n description: 'The text that is formatted.',\r\n }),\r\n\r\n /**\r\n * Whether the text represents a poem.\r\n * The number indicates the level of indent.\r\n *\r\n * Common in Psalms.\r\n */\r\n poem: z.number().optional().meta({\r\n description:\r\n 'Whether the text represents a poem. The number indicates the level of indent. Common in Psalms.',\r\n }),\r\n\r\n /**\r\n * Whether the text represents the Words of Jesus.\r\n */\r\n wordsOfJesus: z.boolean().optional().meta({\r\n description: 'Whether the text represents the Words of Jesus.',\r\n }),\r\n })\r\n .meta({\r\n id: 'FormattedText',\r\n description:\r\n 'Defines the schema for formatted text. That is, text that is formatted in a particular manner.',\r\n });\r\n\r\nexport type FormattedText = z.infer<typeof FormattedTextSchema>;\r\n\r\n/**\r\n * A Zod schema for a heading that is embedded in a verse.\r\n */\r\nexport const InlineHeadingSchema = z\r\n .object({\r\n /**\r\n * The text of the heading.\r\n */\r\n heading: z.string().meta({\r\n description: 'The text of the heading.',\r\n }),\r\n })\r\n .meta({\r\n id: 'InlineHeading',\r\n description:\r\n 'Defines the schema for a heading that is embedded in a verse.',\r\n });\r\n\r\nexport type InlineHeading = z.infer<typeof InlineHeadingSchema>;\r\n\r\n/**\r\n * A Zod schema for a line break that is embedded in a verse.\r\n */\r\nexport const InlineLineBreakSchema = z\r\n .object({\r\n lineBreak: z.literal(true),\r\n })\r\n .meta({\r\n id: 'InlineLineBreak',\r\n description:\r\n 'Defines the schema for a line break that is embedded in a verse.',\r\n });\r\n\r\nexport type InlineLineBreak = z.infer<typeof InlineLineBreakSchema>;\r\n\r\n/**\r\n * A Zod schema for a footnote reference in a verse or a Hebrew Subtitle.\r\n */\r\nexport const VerseFootnoteReferenceSchema = z\r\n .object({\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: z.number().meta({\r\n description: 'The ID of the note.',\r\n }),\r\n })\r\n .meta({\r\n id: 'VerseFootnoteReference',\r\n description:\r\n 'Defines the schema for a footnote reference in a verse or a Hebrew Subtitle.',\r\n });\r\n\r\nexport type VerseFootnoteReference = z.infer<\r\n typeof VerseFootnoteReferenceSchema\r\n>;\r\n\r\n/**\r\n * A Zod schema for information about a footnote.\r\n */\r\nexport const ChapterFootnoteSchema = z\r\n .object({\r\n /**\r\n * The ID of the note that is referenced.\r\n */\r\n noteId: z.number().meta({\r\n description: 'The ID of the note that is referenced.',\r\n }),\r\n\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: z.string().meta({\r\n description: 'The text of the footnote.',\r\n }),\r\n\r\n /**\r\n * The verse reference for the footnote.\r\n */\r\n reference: z\r\n .object({\r\n chapter: z.number(),\r\n verse: z.number(),\r\n })\r\n .optional()\r\n .meta({\r\n description:\r\n \"The verse reference for the footnote. Undefined if the footnote isn't associated with a specific verse.\",\r\n }),\r\n\r\n /**\r\n * The caller that should be used for the footnote.\r\n * For footnotes, a \"caller\" is the character that is used in the text to reference to footnote.\r\n *\r\n * For example, in the text:\r\n * Hello (a) World\r\n *\r\n * ----\r\n * (a) This is a footnote.\r\n *\r\n * The \"(a)\" is the caller.\r\n *\r\n * If \"+\", then the caller should be autogenerated.\r\n * If null, then the caller should be empty.\r\n * If a string, then the caller should be that string.\r\n */\r\n caller: z.union([z.literal('+'), z.string(), z.null()]).meta({\r\n description:\r\n 'The caller that should be used for the footnote. For footnotes, a \"caller\" is the character that is used in the text to reference to footnote. For example, in the text: Hello (a) World ---- (a) This is a footnote. The \"(a)\" is the caller. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.',\r\n }),\r\n })\r\n .meta({\r\n id: 'ChapterFootnote',\r\n description: 'Defines the schema for information about a footnote.',\r\n });\r\n\r\nexport type ChapterFootnote = z.infer<typeof ChapterFootnoteSchema>;\r\n\r\n/**\r\n * A Zod schema for a range of text inside a simplified verse.\r\n *\r\n * Ranges are expressed as offsets into the `text` property of the verse that contains them.\r\n * Offsets are measured in UTF-16 code units, which is what JavaScript's `String.prototype.length`,\r\n * `String.prototype.slice()`, and `String.prototype.substring()` use.\r\n */\r\nexport const SimpleTextRangeSchema = z\r\n .object({\r\n /**\r\n * The index of the first character in the range.\r\n */\r\n start: z.number().meta({\r\n description:\r\n 'The index of the first character of the range in the verse text. Measured in UTF-16 code units.',\r\n }),\r\n\r\n /**\r\n * The index after the last character in the range.\r\n */\r\n end: z.number().meta({\r\n description:\r\n 'The index after the last character of the range in the verse text. Measured in UTF-16 code units.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleTextRange',\r\n description:\r\n 'Defines the schema for a range of text inside a simplified verse. Ranges are expressed as offsets into the text of the verse that contains them, measured in UTF-16 code units.',\r\n });\r\n\r\nexport type SimpleTextRange = z.infer<typeof SimpleTextRangeSchema>;\r\n\r\n/**\r\n * A Zod schema for a range of text inside a simplified verse that represents a line of poetry.\r\n */\r\nexport const SimplePoemRangeSchema = SimpleTextRangeSchema.extend({\r\n /**\r\n * The level of indent that the poem line should be displayed with.\r\n */\r\n level: z.number().meta({\r\n description:\r\n 'The level of indent that the line of poetry should be displayed with.',\r\n }),\r\n}).meta({\r\n id: 'SimplePoemRange',\r\n description:\r\n 'Defines the schema for a range of text inside a simplified verse that represents a line of poetry.',\r\n});\r\n\r\nexport type SimplePoemRange = z.infer<typeof SimplePoemRangeSchema>;\r\n\r\n/**\r\n * A Zod schema for a footnote in a simplified verse.\r\n */\r\nexport const SimpleVerseFootnoteSchema = z\r\n .object({\r\n /**\r\n * The ID of the note.\r\n */\r\n noteId: z.number().meta({\r\n description: 'The ID of the note.',\r\n }),\r\n\r\n /**\r\n * The index in the verse text that the footnote caller should be inserted at.\r\n */\r\n offset: z.number().meta({\r\n description:\r\n 'The index in the verse text that the footnote caller should be inserted at. Measured in UTF-16 code units.',\r\n }),\r\n\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: z.string().meta({\r\n description: 'The text of the footnote.',\r\n }),\r\n\r\n /**\r\n * The caller that should be used for the footnote.\r\n * See ChapterFootnote for more information.\r\n */\r\n caller: z.union([z.literal('+'), z.string(), z.null()]).meta({\r\n description:\r\n 'The caller that should be used for the footnote. If \"+\", then the caller should be autogenerated. If null, then the caller should be empty. If a string, then the caller should be that string.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleVerseFootnote',\r\n description:\r\n 'Defines the schema for a footnote in a simplified verse. Unlike the footnotes in the regular chapter format, simplified footnotes include the position that they occur at in the verse text.',\r\n });\r\n\r\nexport type SimpleVerseFootnote = z.infer<typeof SimpleVerseFootnoteSchema>;\r\n\r\n/**\r\n * A Zod schema for a heading that is embedded in a simplified verse.\r\n */\r\nexport const SimpleInlineHeadingSchema = z\r\n .object({\r\n /**\r\n * The index in the verse text that the heading occurs at.\r\n */\r\n offset: z.number().meta({\r\n description:\r\n 'The index in the verse text that the heading occurs at. Measured in UTF-16 code units.',\r\n }),\r\n\r\n /**\r\n * The text of the heading.\r\n */\r\n text: z.string().meta({\r\n description: 'The text of the heading.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleInlineHeading',\r\n description:\r\n 'Defines the schema for a heading that is embedded in a simplified verse.',\r\n });\r\n\r\nexport type SimpleInlineHeading = z.infer<typeof SimpleInlineHeadingSchema>;\r\n\r\n/**\r\n * A Zod schema for a verse in a simplified chapter.\r\n */\r\nexport const SimpleChapterVerseSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content is a verse.\r\n */\r\n type: z.literal('verse'),\r\n\r\n /**\r\n * The number of the verse.\r\n */\r\n number: z.number().meta({\r\n description: 'The number of the verse.',\r\n }),\r\n\r\n /**\r\n * The text of the verse.\r\n */\r\n text: z.string().meta({\r\n description:\r\n 'The text of the verse. Lines of poetry and line breaks are separated by newline (\\\\n) characters.',\r\n }),\r\n\r\n /**\r\n * The footnotes that occur in the verse.\r\n */\r\n footnotes: z.array(SimpleVerseFootnoteSchema).meta({\r\n description: 'The footnotes that occur in the verse.',\r\n }),\r\n\r\n /**\r\n * The headings that occur in the verse.\r\n */\r\n headings: z.array(SimpleInlineHeadingSchema).optional().meta({\r\n description:\r\n 'The headings that occur in the middle of the verse. Omitted if the verse contains no inline headings.',\r\n }),\r\n\r\n /**\r\n * The ranges of text that represent the Words of Jesus.\r\n */\r\n wordsOfJesus: z.array(SimpleTextRangeSchema).optional().meta({\r\n description:\r\n 'The ranges of the verse text that represent the Words of Jesus. Omitted if the verse contains none.',\r\n }),\r\n\r\n /**\r\n * The ranges of text that represent lines of poetry.\r\n */\r\n poem: z.array(SimplePoemRangeSchema).optional().meta({\r\n description:\r\n 'The ranges of the verse text that represent lines of poetry. Omitted if the verse contains none.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleChapterVerse',\r\n description: 'Defines the schema for a verse in a simplified chapter.',\r\n });\r\n\r\nexport type SimpleChapterVerse = z.infer<typeof SimpleChapterVerseSchema>;\r\n\r\n/**\r\n * A Zod schema for a Hebrew Subtitle in a simplified chapter.\r\n */\r\nexport const SimpleChapterHebrewSubtitleSchema = SimpleChapterVerseSchema.omit({\r\n type: true,\r\n number: true,\r\n})\r\n .extend({\r\n /**\r\n * Indicates that the content represents a Hebrew Subtitle.\r\n */\r\n type: z.literal('hebrew_subtitle'),\r\n })\r\n .meta({\r\n id: 'SimpleChapterHebrewSubtitle',\r\n description:\r\n 'Defines the schema for a Hebrew Subtitle in a simplified chapter.',\r\n });\r\n\r\nexport type SimpleChapterHebrewSubtitle = z.infer<\r\n typeof SimpleChapterHebrewSubtitleSchema\r\n>;\r\n\r\n/**\r\n * A Zod schema for a heading in a simplified chapter.\r\n */\r\nexport const SimpleChapterHeadingSchema = z\r\n .object({\r\n /**\r\n * Indicates that the content represents a heading.\r\n */\r\n type: z.literal('heading'),\r\n\r\n /**\r\n * The text of the heading.\r\n */\r\n text: z.string().meta({\r\n description: 'The text of the heading.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleChapterHeading',\r\n description:\r\n 'Defines the schema for a heading in a simplified chapter.',\r\n });\r\n\r\nexport type SimpleChapterHeading = z.infer<typeof SimpleChapterHeadingSchema>;\r\n\r\n/**\r\n * A union type that represents a single piece of content in a simplified chapter.\r\n * A piece of chapter content can be one of the following things:\r\n * - A heading.\r\n * - A line break.\r\n * - A verse.\r\n * - A Hebrew Subtitle.\r\n */\r\nexport const SimpleChapterContentSchema = z\r\n .discriminatedUnion('type', [\r\n SimpleChapterHeadingSchema,\r\n ChapterLineBreakSchema,\r\n SimpleChapterVerseSchema,\r\n SimpleChapterHebrewSubtitleSchema,\r\n ])\r\n .meta({\r\n id: 'SimpleChapterContent',\r\n description:\r\n 'Defines a union type that represents a single piece of content in a simplified chapter. A piece of chapter content can be one of the following things: A heading, a line break, a verse, or a Hebrew Subtitle.',\r\n });\r\n\r\nexport type SimpleChapterContent = z.infer<typeof SimpleChapterContentSchema>;\r\n\r\n/**\r\n * A Zod schema for the data in a simplified chapter.\r\n */\r\nexport const SimpleChapterDataSchema = 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 content of the chapter.\r\n */\r\n content: z.array(SimpleChapterContentSchema).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n\r\n /**\r\n * The footnotes that could not be associated with a verse.\r\n */\r\n footnotes: z.array(ChapterFootnoteSchema).meta({\r\n description:\r\n 'The list of footnotes that could not be associated with a verse. Footnotes that belong to a verse are included on the verse itself, so this list is usually empty.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleChapterData',\r\n description:\r\n 'Defines the schema for the data in a simplified chapter. Unlike the regular chapter format, each verse contains a single text string and the footnotes/formatting are represented by offsets into that string.',\r\n });\r\n\r\nexport type SimpleChapterData = z.infer<typeof SimpleChapterDataSchema>;\r\n\r\n/**\r\n * A Zod schema for the data in a simplified commentary chapter.\r\n */\r\nexport const SimpleCommentaryChapterDataSchema = 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 introduction that the commentary provided to the chapter.\r\n */\r\n introduction: z.string().optional().meta({\r\n description:\r\n 'The introduction that the commentary provided to the chapter. Not all commentaries provide an introduction to a chapter.',\r\n }),\r\n\r\n /**\r\n * The content of the chapter.\r\n */\r\n content: z.array(SimpleChapterVerseSchema).meta({\r\n description: 'The content of the chapter.',\r\n }),\r\n })\r\n .meta({\r\n id: 'SimpleCommentaryChapterData',\r\n description:\r\n 'Defines the schema for the data in a simplified commentary chapter.',\r\n });\r\n\r\nexport type SimpleCommentaryChapterData = z.infer<\r\n typeof SimpleCommentaryChapterDataSchema\r\n>;\r\n\r\n/**\r\n * Defines a Zod schema for information about a book chapter, using the simplified\r\n * chapter format.\r\n */\r\nexport const SimpleTranslationBookChapterSchema =\r\n TranslationBookChapterSchema.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: 'The simplified information for the chapter.',\r\n }),\r\n\r\n /**\r\n * The word-level annotations for the chapter's verses, using the simplified format.\r\n */\r\n thisChapterWords: z\r\n .lazy(() => SimpleTranslationBookChapterWordsSchema)\r\n .optional()\r\n .meta({\r\n description:\r\n \"The word-level annotations (Strong's numbers and related source data) for the chapter's verses, with their offsets remapped onto the simplified verse text. Omitted if the translation doesn't have any word-level annotations for the chapter.\",\r\n }),\r\n }).meta({\r\n id: 'SimpleTranslationBookChapter',\r\n description:\r\n 'Defines the schema for information about a book chapter, using the simplified chapter format.',\r\n });\r\n\r\nexport type SimpleTranslationBookChapter = z.infer<\r\n typeof SimpleTranslationBookChapterSchema\r\n>;\r\n\r\n/**\r\n * A Zod schema for a word-level annotation in a simplified chapter.\r\n *\r\n * Unlike the regular annotations, these are anchored to a range of characters in the\r\n * text of a verse, since the simplified format replaces the verse's content array with\r\n * a single string.\r\n */\r\nexport const SimpleChapterWordSchema = ChapterWordSchema.omit({\r\n contentIndex: true,\r\n}).meta({\r\n id: 'SimpleChapterWord',\r\n description:\r\n \"Defines the schema for a word-level annotation in a simplified chapter. The annotation is anchored to a range of characters in the verse's text.\",\r\n});\r\n\r\nexport type SimpleChapterWord = z.infer<typeof SimpleChapterWordSchema>;\r\n\r\n/**\r\n * Defines a Zod schema for the word-level annotations for a book chapter, using the\r\n * simplified format.\r\n * Maps a verse number to the list of annotated words in the verse, in order.\r\n */\r\nexport const SimpleTranslationBookChapterWordsSchema = z\r\n .record(z.string(), z.array(z.lazy(() => SimpleChapterWordSchema)))\r\n .meta({\r\n id: 'SimpleTranslationBookChapterWords',\r\n description:\r\n 'Defines the schema for the word-level annotations for a book chapter, using the simplified format. Maps a verse number to the list of annotated words in the verse, in order.',\r\n });\r\n\r\nexport type SimpleTranslationBookChapterWords = z.infer<\r\n typeof SimpleTranslationBookChapterWordsSchema\r\n>;\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAClB,mBAAuD;AAkHhD,MAAM,oBAAoB,aAAE,OAAO;AAAA;AAAA;AAAA;AAAA,EAItC,IAAI,aAAE,OAAO,EAAE,KAAK;AAAA,IAChB,aAAa;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,MAAM,aAAE,OAAO,EAAE,KAAK;AAAA,IAClB,aAAa;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,S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AM,aAAE,KAAK,MAAM,uBAAuB,CAAC,CAAC,EACjE,KAAK;AAAA,EACF,IAAI;AAAA,EACJ,aACI;AACR,CAAC;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(dataset_exports);
25
25
  var import_usfm_parser = require("../parser/usfm-parser.js");
26
26
  var import_usx_parser = require("../parser/usx-parser.js");
27
27
  var import_book_order = require("./book-order.js");
28
- var import_lodash = require("lodash");
28
+ var import_compat = require("es-toolkit/compat");
29
29
  var import_audio = require("./audio.js");
30
30
  var import_codex_parser = require("../parser/codex-parser.js");
31
31
  var import_commentary_csv_parser = require("../parser/commentary-csv-parser.js");
@@ -123,7 +123,7 @@ function generateDataset(files, parser = new globalThis.DOMParser(), bookMap) {
123
123
  let translation = parsedTranslations.get(file.metadata.id);
124
124
  if (!translation) {
125
125
  translation = {
126
- ...(0, import_lodash.omit)(file.metadata, "direction"),
126
+ ...(0, import_compat.omit)(file.metadata, "direction"),
127
127
  textDirection: file.metadata.direction,
128
128
  books: []
129
129
  };
@@ -159,19 +159,23 @@ function generateDataset(files, parser = new globalThis.DOMParser(), bookMap) {
159
159
  translation.id,
160
160
  id,
161
161
  content.number
162
- )
162
+ ),
163
+ thisChapterAudioTimings: {},
164
+ // Word annotations are kept out of the chapter itself so
165
+ // that they can be published as a separate file.
166
+ ...content.words ? { thisChapterWords: content.words } : {}
163
167
  });
164
168
  }
165
169
  }
166
- book.chapters = (0, import_lodash.sortBy)(book.chapters, (c) => c.chapter.number);
167
- const index = (0, import_lodash.sortedIndexBy)(translation.books, book, (b) => b.order);
170
+ book.chapters = (0, import_compat.sortBy)(book.chapters, (c) => c.chapter.number);
171
+ const index = (0, import_compat.sortedIndexBy)(translation.books, book, (b) => b.order);
168
172
  translation.books.splice(index, 0, book);
169
173
  }
170
174
  function addCommentaryTree(file, parsed) {
171
175
  let commentary = parsedCommentaries.get(file.metadata.id);
172
176
  if (!commentary) {
173
177
  commentary = {
174
- ...(0, import_lodash.omit)(file.metadata, "direction"),
178
+ ...(0, import_compat.omit)(file.metadata, "direction"),
175
179
  textDirection: file.metadata.direction,
176
180
  books: [],
177
181
  profiles: []
@@ -217,7 +221,7 @@ function generateDataset(files, parser = new globalThis.DOMParser(), bookMap) {
217
221
  chapter: data
218
222
  });
219
223
  }
220
- book.chapters = (0, import_lodash.sortBy)(book.chapters, (c) => c.chapter.number);
224
+ book.chapters = (0, import_compat.sortBy)(book.chapters, (c) => c.chapter.number);
221
225
  commentary.books.push(book);
222
226
  }
223
227
  if (parsed.profiles) {
@@ -242,8 +246,8 @@ function generateDataset(files, parser = new globalThis.DOMParser(), bookMap) {
242
246
  commentary.profiles.push(datasetProfile);
243
247
  }
244
248
  }
245
- commentary.books = (0, import_lodash.sortBy)(commentary.books, (b) => b.order);
246
- commentary.profiles = (0, import_lodash.sortBy)(commentary.profiles, (p) => p.id);
249
+ commentary.books = (0, import_compat.sortBy)(commentary.books, (b) => b.order);
250
+ commentary.profiles = (0, import_compat.sortBy)(commentary.profiles, (p) => p.id);
247
251
  }
248
252
  function getBookNames(file, metadata, id) {
249
253
  let exactMatch = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../generation/dataset.ts"],
4
- "sourcesContent": ["import { UsfmParser } from '../parser/usfm-parser.js';\r\nimport { USXParser } from '../parser/usx-parser.js';\r\nimport {\r\n Commentary,\r\n CommentaryBook,\r\n CommentaryBookChapter,\r\n CommentaryChapterData,\r\n CommentaryProfile,\r\n InputCommentaryFile,\r\n InputFile,\r\n InputFileBase,\r\n InputTranslationFile,\r\n MetadataBase,\r\n Translation,\r\n TranslationBook,\r\n TranslationBookChapter,\r\n Dataset as CommonDataset,\r\n DatasetBook,\r\n DatasetBookChapter,\r\n} from './common-types.js';\r\nimport {\r\n bookIdMap as defaultBookIdMap,\r\n bookOrderMap,\r\n apocryphaBooks,\r\n} from './book-order.js';\r\nimport { omit, sortBy, sortedIndexBy } from 'lodash';\r\nimport { getAudioUrlsForChapter } from './audio.js';\r\nimport { CodexParser } from '../parser/codex-parser.js';\r\nimport { CommentaryCsvParser } from '../parser/commentary-csv-parser.js';\r\nimport {\r\n CommentaryParseTree,\r\n ParseMessage,\r\n ParseTree,\r\n} from '../parser/types.js';\r\nimport { TyndaleXmlParser } from '../parser/tyndale-xml-parser.js';\r\nimport { getLogger } from '../log.js';\r\nimport { LockmanParser } from '../parser/lockman-parser.js';\r\nimport { BookId } from '../utils.js';\r\n\r\nexport const DATASET_VERSION = 1;\r\n\r\n/**\r\n * Defines an interface that contains generated dataset info.\r\n */\r\nexport interface DatasetOutput {\r\n /**\r\n * The list of translations that are available in the dataset.\r\n */\r\n translations: DatasetTranslation[];\r\n\r\n /**\r\n * The list of commentaries that are available in the dataset.\r\n */\r\n commentaries: DatasetCommentary[];\r\n\r\n /**\r\n * The list of datasets that are available in the dataset.\r\n */\r\n datasets?: DatasetDataset[];\r\n\r\n parseMessages?: {\r\n [key: string]: ParseMessage[];\r\n };\r\n}\r\n\r\n/**\r\n * Defines a translation that is used in the dataset.\r\n */\r\nexport interface DatasetTranslation extends Translation {\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: DatasetTranslationBook[];\r\n}\r\n\r\n/**\r\n * Defines a commentary that is used in the dataset.\r\n */\r\nexport interface DatasetCommentary extends Commentary {\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: DatasetCommentaryBook[];\r\n\r\n /**\r\n * The list of profiles that are available for the commentary.\r\n */\r\n profiles: DatasetCommentaryProfile[];\r\n}\r\n\r\n/**\r\n * Defines a translation book that is used in the dataset.\r\n */\r\nexport interface DatasetTranslationBook extends TranslationBook {\r\n /**\r\n * The list of chapters that are available for the book.\r\n */\r\n chapters: TranslationBookChapter[];\r\n}\r\n\r\n/**\r\n * Defines a commentary book that is used in the dataset.\r\n */\r\nexport interface DatasetCommentaryBook extends CommentaryBook {\r\n /**\r\n * The list of chapters that are available for the book.\r\n */\r\n chapters: CommentaryBookChapter[];\r\n}\r\n\r\nexport interface DatasetCommentaryProfile extends CommentaryProfile {\r\n /**\r\n * The contents of the profile.\r\n */\r\n content: string[];\r\n}\r\n\r\nexport interface DatasetDataset extends CommonDataset {\r\n books: DatasetDatasetBook[];\r\n}\r\n\r\nexport interface DatasetDatasetBook extends DatasetBook {\r\n chapters: DatasetBookChapter[];\r\n}\r\n\r\n/**\r\n * Generates a list of output files from the given list of input files.\r\n * @param file The list of files.\r\n * @param parser The parser to use for parsing the files.\r\n * @param bookMap The map of book IDs to names. If undefined, then a default map will be used.\r\n */\r\nexport function generateDataset(\r\n files: InputFile[],\r\n parser: DOMParser = new globalThis.DOMParser(),\r\n bookMap?: Map<string, { commonName: string }> | undefined\r\n): DatasetOutput {\r\n const logger = getLogger();\r\n let output: DatasetOutput = {\r\n translations: [],\r\n commentaries: [],\r\n };\r\n\r\n let usfmParser = new UsfmParser();\r\n let usxParser = new USXParser(parser);\r\n let codexParser = new CodexParser(parser);\r\n let csvCommentaryParser = new CommentaryCsvParser();\r\n let tyndaleXmlParser = new TyndaleXmlParser(parser);\r\n let lockmanParser = new LockmanParser();\r\n\r\n let parsedTranslations = new Map<string, DatasetTranslation>();\r\n let parsedCommentaries = new Map<string, DatasetCommentary>();\r\n\r\n const unknownLanguages = new Set<string>();\r\n for (let file of files) {\r\n try {\r\n let parser:\r\n | UsfmParser\r\n | USXParser\r\n | CodexParser\r\n | CommentaryCsvParser\r\n | TyndaleXmlParser\r\n | LockmanParser;\r\n if (file.fileType === 'usfm') {\r\n parser = usfmParser;\r\n } else if (file.fileType === 'usx') {\r\n parser = usxParser;\r\n } else if (file.fileType === 'json') {\r\n parser = codexParser;\r\n } else if (file.fileType === 'commentary/csv') {\r\n parser = csvCommentaryParser;\r\n } else if (file.fileType === 'commentary/tyndale-xml') {\r\n parser = tyndaleXmlParser;\r\n } else if (file.fileType === 'lockman') {\r\n parser = lockmanParser;\r\n } else {\r\n logger.warn(\r\n '[generate] File does not have a valid type!',\r\n file.name\r\n );\r\n continue;\r\n }\r\n\r\n const parsed:\r\n | ParseTree\r\n | CommentaryParseTree\r\n | (ParseTree | CommentaryParseTree)[] = parser.parse(\r\n file.content\r\n );\r\n\r\n if (Array.isArray(parsed)) {\r\n for (let p of parsed) {\r\n logParseMessages(p, file);\r\n if (p.type === 'root') {\r\n addTranslationTree(file as InputTranslationFile, p);\r\n } else {\r\n addCommentaryTree(file as InputCommentaryFile, p);\r\n }\r\n }\r\n } else {\r\n logParseMessages(parsed, file);\r\n if (parsed.type === 'root') {\r\n addTranslationTree(file as InputTranslationFile, parsed);\r\n } else {\r\n addCommentaryTree(file as InputCommentaryFile, parsed);\r\n }\r\n }\r\n } catch (err) {\r\n logger.error(\r\n `[generate] Error occurred while parsing ${file.name}`,\r\n err\r\n );\r\n }\r\n }\r\n\r\n function logParseMessages(\r\n parsed: ParseTree | CommentaryParseTree,\r\n file: InputFile\r\n ) {\r\n if ('parseMessages' in parsed && parsed.parseMessages && file.name) {\r\n const messages = (output.parseMessages =\r\n output.parseMessages || {});\r\n messages[file.name] = parsed.parseMessages;\r\n }\r\n }\r\n\r\n function addTranslationTree(file: InputTranslationFile, parsed: ParseTree) {\r\n const id = parsed.id;\r\n\r\n if (!id) {\r\n logger.warn(\r\n '[generate] File does not have a valid book ID!',\r\n file.name,\r\n id\r\n );\r\n return;\r\n }\r\n\r\n const order = bookOrderMap.get(id);\r\n\r\n if (typeof order !== 'number') {\r\n logger.warn('[generate] Book does not have an order!', id);\r\n return;\r\n }\r\n\r\n const isApocryphal = apocryphaBooks.has(id);\r\n\r\n const bookName = getBookNames(file, file.metadata, id);\r\n\r\n let translation = parsedTranslations.get(file.metadata.id);\r\n\r\n if (!translation) {\r\n translation = {\r\n ...omit(file.metadata, 'direction'),\r\n textDirection: file.metadata.direction,\r\n books: [],\r\n };\r\n output.translations.push(translation);\r\n parsedTranslations.set(file.metadata.id, translation);\r\n }\r\n\r\n const name =\r\n parsed.header ??\r\n (bookName?.exactMatch ? bookName?.bookName?.commonName : null) ??\r\n parsed.title ??\r\n bookName?.bookName?.commonName;\r\n\r\n if (!name) {\r\n logger.warn('[generate] Book does not have a name!', file.name, id);\r\n return;\r\n }\r\n\r\n const commonName =\r\n (bookName?.exactMatch ? bookName?.bookName?.commonName : null) ??\r\n parsed.header ??\r\n parsed.title ??\r\n bookName?.bookName?.commonName ??\r\n id;\r\n\r\n const book: DatasetTranslationBook = {\r\n id: id as BookId,\r\n name,\r\n commonName,\r\n title: parsed.title ?? null,\r\n order,\r\n chapters: [],\r\n };\r\n\r\n if (isApocryphal) {\r\n book.isApocryphal = true;\r\n }\r\n\r\n for (let content of parsed.content) {\r\n if (content.type === 'chapter') {\r\n book.chapters.push({\r\n chapter: {\r\n number: content.number,\r\n content: content.content,\r\n footnotes: content.footnotes,\r\n },\r\n thisChapterAudioLinks: getAudioUrlsForChapter(\r\n translation.id,\r\n id,\r\n content.number\r\n ),\r\n });\r\n }\r\n }\r\n\r\n book.chapters = sortBy(book.chapters, (c) => c.chapter.number);\r\n\r\n const index = sortedIndexBy(translation.books, book, (b) => b.order);\r\n translation.books.splice(index, 0, book);\r\n }\r\n\r\n function addCommentaryTree(\r\n file: InputCommentaryFile,\r\n parsed: CommentaryParseTree\r\n ) {\r\n let commentary = parsedCommentaries.get(file.metadata.id);\r\n\r\n if (!commentary) {\r\n commentary = {\r\n ...omit(file.metadata, 'direction'),\r\n textDirection: file.metadata.direction,\r\n books: [],\r\n profiles: [],\r\n };\r\n output.commentaries.push(commentary);\r\n parsedCommentaries.set(file.metadata.id, commentary);\r\n }\r\n\r\n for (let parsedBook of parsed.books) {\r\n let book = commentary.books.find((b) => b.id === parsedBook.book);\r\n if (book && book.introduction && parsedBook.introduction) {\r\n logger.warn(\r\n '[generate] Book already exists in commentary!',\r\n file.name,\r\n parsedBook.book\r\n );\r\n continue;\r\n }\r\n\r\n if (!book) {\r\n const name = getBookNames(file, file.metadata, parsedBook.book);\r\n book = {\r\n id: parsedBook.book as BookId,\r\n order: bookOrderMap.get(parsedBook.book) ?? -1,\r\n commonName: name?.bookName?.commonName ?? parsedBook.book,\r\n name: name?.bookName?.commonName ?? parsedBook.book,\r\n chapters: [],\r\n };\r\n }\r\n\r\n if (parsedBook.introduction) {\r\n book.introduction = parsedBook.introduction;\r\n }\r\n\r\n if (parsedBook.introductionSummary && !book.introductionSummary) {\r\n book.introductionSummary = parsedBook.introductionSummary;\r\n }\r\n\r\n for (let chapter of parsedBook.chapters) {\r\n let data: CommentaryChapterData = {\r\n number: chapter.number,\r\n content: chapter.verses,\r\n };\r\n\r\n if (chapter.introduction) {\r\n data.introduction = chapter.introduction;\r\n }\r\n\r\n book.chapters.push({\r\n chapter: data,\r\n });\r\n }\r\n\r\n book.chapters = sortBy(book.chapters, (c) => c.chapter.number);\r\n commentary.books.push(book);\r\n }\r\n\r\n if (parsed.profiles) {\r\n for (let profile of parsed.profiles) {\r\n const existing = commentary.profiles.find(\r\n (p) => p.id === profile.id\r\n );\r\n if (existing) {\r\n logger.warn(\r\n '[generate] Profile already exists in commentary!',\r\n file.name,\r\n profile.id\r\n );\r\n continue;\r\n }\r\n\r\n const datasetProfile: DatasetCommentaryProfile = {\r\n id: profile.id,\r\n subject: profile.subject,\r\n reference: profile.reference,\r\n content: profile.content,\r\n };\r\n\r\n commentary.profiles.push(datasetProfile);\r\n }\r\n }\r\n\r\n commentary.books = sortBy(commentary.books, (b) => b.order);\r\n commentary.profiles = sortBy(commentary.profiles, (p) => p.id);\r\n }\r\n\r\n function getBookNames(\r\n file: InputFileBase,\r\n metadata: MetadataBase,\r\n id: string\r\n ) {\r\n let exactMatch = true;\r\n let map = bookMap;\r\n if (!map) {\r\n map = defaultBookIdMap.get(metadata.language);\r\n\r\n if (!map) {\r\n if (!unknownLanguages.has(metadata.language)) {\r\n logger.warn(\r\n '[generate] File does not have a known language!',\r\n file.name,\r\n metadata.language\r\n );\r\n unknownLanguages.add(metadata.language);\r\n }\r\n\r\n logger.warn(\r\n '[generate] Using English book map for unknown language! This might result in outputting english book names.'\r\n );\r\n exactMatch = false;\r\n map = defaultBookIdMap.get('en');\r\n }\r\n }\r\n\r\n const bookName = map?.get(id);\r\n\r\n if (!!map && !bookName) {\r\n logger.warn(\r\n '[generate] Book name not found for ID!',\r\n file.name,\r\n id\r\n );\r\n return null;\r\n }\r\n\r\n return {\r\n exactMatch,\r\n bookName,\r\n };\r\n }\r\n\r\n return output;\r\n}\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B;AAC3B,wBAA0B;AAmB1B,wBAIO;AACP,oBAA4C;AAC5C,mBAAuC;AACvC,0BAA4B;AAC5B,mCAAoC;AAMpC,gCAAiC;AACjC,iBAA0B;AAC1B,4BAA8B;AAGvB,MAAM,kBAAkB;AA4FxB,SAAS,gBACZ,OACA,SAAoB,IAAI,WAAW,UAAU,GAC7C,SACa;AACb,QAAM,aAAS,sBAAU;AACzB,MAAI,SAAwB;AAAA,IACxB,cAAc,CAAC;AAAA,IACf,cAAc,CAAC;AAAA,EACnB;AAEA,MAAI,aAAa,IAAI,8BAAW;AAChC,MAAI,YAAY,IAAI,4BAAU,MAAM;AACpC,MAAI,cAAc,IAAI,gCAAY,MAAM;AACxC,MAAI,sBAAsB,IAAI,iDAAoB;AAClD,MAAI,mBAAmB,IAAI,2CAAiB,MAAM;AAClD,MAAI,gBAAgB,IAAI,oCAAc;AAEtC,MAAI,qBAAqB,oBAAI,IAAgC;AAC7D,MAAI,qBAAqB,oBAAI,IAA+B;AAE5D,QAAM,mBAAmB,oBAAI,IAAY;AACzC,WAAS,QAAQ,OAAO;AACpB,QAAI;AACA,UAAIA;AAOJ,UAAI,KAAK,aAAa,QAAQ;AAC1B,QAAAA,UAAS;AAAA,MACb,WAAW,KAAK,aAAa,OAAO;AAChC,QAAAA,UAAS;AAAA,MACb,WAAW,KAAK,aAAa,QAAQ;AACjC,QAAAA,UAAS;AAAA,MACb,WAAW,KAAK,aAAa,kBA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MACnC;AAAA,IACJ;AAEA,UAAM,WAAW,KAAK,IAAI,EAAE;AAE5B,QAAI,CAAC,CAAC,OAAO,CAAC,UAAU;AACpB,aAAO;AAAA,QACH;AAAA,QACA,KAAK;AAAA,QACL;AAAA,MACJ;AACA,aAAO;AAAA,IACX;AAEA,WAAO;AAAA,MACH;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO;AACX;",
4
+ "sourcesContent": ["import { UsfmParser } from '../parser/usfm-parser.js';\r\nimport { USXParser } from '../parser/usx-parser.js';\r\nimport {\r\n Commentary,\r\n CommentaryBook,\r\n CommentaryBookChapter,\r\n CommentaryChapterData,\r\n CommentaryProfile,\r\n InputCommentaryFile,\r\n InputFile,\r\n InputFileBase,\r\n InputTranslationFile,\r\n MetadataBase,\r\n Translation,\r\n TranslationBook,\r\n TranslationBookChapter,\r\n Dataset as CommonDataset,\r\n DatasetBook,\r\n DatasetBookChapter,\r\n} from './common-types.js';\r\nimport {\r\n bookIdMap as defaultBookIdMap,\r\n bookOrderMap,\r\n apocryphaBooks,\r\n} from './book-order.js';\r\nimport { omit, sortBy, sortedIndexBy } from 'es-toolkit/compat';\r\nimport { getAudioUrlsForChapter } from './audio.js';\r\nimport { CodexParser } from '../parser/codex-parser.js';\r\nimport { CommentaryCsvParser } from '../parser/commentary-csv-parser.js';\r\nimport {\r\n CommentaryParseTree,\r\n ParseMessage,\r\n ParseTree,\r\n} from '../parser/types.js';\r\nimport { TyndaleXmlParser } from '../parser/tyndale-xml-parser.js';\r\nimport { getLogger } from '../log.js';\r\nimport { LockmanParser } from '../parser/lockman-parser.js';\r\nimport { BookId } from '../utils.js';\r\n\r\nexport const DATASET_VERSION = 1;\r\n\r\n/**\r\n * Defines an interface that contains generated dataset info.\r\n */\r\nexport interface DatasetOutput {\r\n /**\r\n * The list of translations that are available in the dataset.\r\n */\r\n translations: DatasetTranslation[];\r\n\r\n /**\r\n * The list of commentaries that are available in the dataset.\r\n */\r\n commentaries: DatasetCommentary[];\r\n\r\n /**\r\n * The list of datasets that are available in the dataset.\r\n */\r\n datasets?: DatasetDataset[];\r\n\r\n parseMessages?: {\r\n [key: string]: ParseMessage[];\r\n };\r\n}\r\n\r\n/**\r\n * Defines a translation that is used in the dataset.\r\n */\r\nexport interface DatasetTranslation extends Translation {\r\n /**\r\n * The list of books that are available for the translation.\r\n */\r\n books: DatasetTranslationBook[];\r\n}\r\n\r\n/**\r\n * Defines a commentary that is used in the dataset.\r\n */\r\nexport interface DatasetCommentary extends Commentary {\r\n /**\r\n * The list of books that are available for the commentary.\r\n */\r\n books: DatasetCommentaryBook[];\r\n\r\n /**\r\n * The list of profiles that are available for the commentary.\r\n */\r\n profiles: DatasetCommentaryProfile[];\r\n}\r\n\r\n/**\r\n * Defines a translation book that is used in the dataset.\r\n */\r\nexport interface DatasetTranslationBook extends TranslationBook {\r\n /**\r\n * The list of chapters that are available for the book.\r\n */\r\n chapters: TranslationBookChapter[];\r\n}\r\n\r\n/**\r\n * Defines a commentary book that is used in the dataset.\r\n */\r\nexport interface DatasetCommentaryBook extends CommentaryBook {\r\n /**\r\n * The list of chapters that are available for the book.\r\n */\r\n chapters: CommentaryBookChapter[];\r\n}\r\n\r\nexport interface DatasetCommentaryProfile extends CommentaryProfile {\r\n /**\r\n * The contents of the profile.\r\n */\r\n content: string[];\r\n}\r\n\r\nexport interface DatasetDataset extends CommonDataset {\r\n books: DatasetDatasetBook[];\r\n}\r\n\r\nexport interface DatasetDatasetBook extends DatasetBook {\r\n chapters: DatasetBookChapter[];\r\n}\r\n\r\n/**\r\n * Generates a list of output files from the given list of input files.\r\n * @param file The list of files.\r\n * @param parser The parser to use for parsing the files.\r\n * @param bookMap The map of book IDs to names. If undefined, then a default map will be used.\r\n */\r\nexport function generateDataset(\r\n files: InputFile[],\r\n parser: DOMParser = new globalThis.DOMParser(),\r\n bookMap?: Map<string, { commonName: string }> | undefined\r\n): DatasetOutput {\r\n const logger = getLogger();\r\n let output: DatasetOutput = {\r\n translations: [],\r\n commentaries: [],\r\n };\r\n\r\n let usfmParser = new UsfmParser();\r\n let usxParser = new USXParser(parser);\r\n let codexParser = new CodexParser(parser);\r\n let csvCommentaryParser = new CommentaryCsvParser();\r\n let tyndaleXmlParser = new TyndaleXmlParser(parser);\r\n let lockmanParser = new LockmanParser();\r\n\r\n let parsedTranslations = new Map<string, DatasetTranslation>();\r\n let parsedCommentaries = new Map<string, DatasetCommentary>();\r\n\r\n const unknownLanguages = new Set<string>();\r\n for (let file of files) {\r\n try {\r\n let parser:\r\n | UsfmParser\r\n | USXParser\r\n | CodexParser\r\n | CommentaryCsvParser\r\n | TyndaleXmlParser\r\n | LockmanParser;\r\n if (file.fileType === 'usfm') {\r\n parser = usfmParser;\r\n } else if (file.fileType === 'usx') {\r\n parser = usxParser;\r\n } else if (file.fileType === 'json') {\r\n parser = codexParser;\r\n } else if (file.fileType === 'commentary/csv') {\r\n parser = csvCommentaryParser;\r\n } else if (file.fileType === 'commentary/tyndale-xml') {\r\n parser = tyndaleXmlParser;\r\n } else if (file.fileType === 'lockman') {\r\n parser = lockmanParser;\r\n } else {\r\n logger.warn(\r\n '[generate] File does not have a valid type!',\r\n file.name\r\n );\r\n continue;\r\n }\r\n\r\n const parsed:\r\n | ParseTree\r\n | CommentaryParseTree\r\n | (ParseTree | CommentaryParseTree)[] = parser.parse(\r\n file.content\r\n );\r\n\r\n if (Array.isArray(parsed)) {\r\n for (let p of parsed) {\r\n logParseMessages(p, file);\r\n if (p.type === 'root') {\r\n addTranslationTree(file as InputTranslationFile, p);\r\n } else {\r\n addCommentaryTree(file as InputCommentaryFile, p);\r\n }\r\n }\r\n } else {\r\n logParseMessages(parsed, file);\r\n if (parsed.type === 'root') {\r\n addTranslationTree(file as InputTranslationFile, parsed);\r\n } else {\r\n addCommentaryTree(file as InputCommentaryFile, parsed);\r\n }\r\n }\r\n } catch (err) {\r\n logger.error(\r\n `[generate] Error occurred while parsing ${file.name}`,\r\n err\r\n );\r\n }\r\n }\r\n\r\n function logParseMessages(\r\n parsed: ParseTree | CommentaryParseTree,\r\n file: InputFile\r\n ) {\r\n if ('parseMessages' in parsed && parsed.parseMessages && file.name) {\r\n const messages = (output.parseMessages =\r\n output.parseMessages || {});\r\n messages[file.name] = parsed.parseMessages;\r\n }\r\n }\r\n\r\n function addTranslationTree(file: InputTranslationFile, parsed: ParseTree) {\r\n const id = parsed.id;\r\n\r\n if (!id) {\r\n logger.warn(\r\n '[generate] File does not have a valid book ID!',\r\n file.name,\r\n id\r\n );\r\n return;\r\n }\r\n\r\n const order = bookOrderMap.get(id);\r\n\r\n if (typeof order !== 'number') {\r\n logger.warn('[generate] Book does not have an order!', id);\r\n return;\r\n }\r\n\r\n const isApocryphal = apocryphaBooks.has(id);\r\n\r\n const bookName = getBookNames(file, file.metadata, id);\r\n\r\n let translation = parsedTranslations.get(file.metadata.id);\r\n\r\n if (!translation) {\r\n translation = {\r\n ...omit(file.metadata, 'direction'),\r\n textDirection: file.metadata.direction,\r\n books: [],\r\n };\r\n output.translations.push(translation);\r\n parsedTranslations.set(file.metadata.id, translation);\r\n }\r\n\r\n const name =\r\n parsed.header ??\r\n (bookName?.exactMatch ? bookName?.bookName?.commonName : null) ??\r\n parsed.title ??\r\n bookName?.bookName?.commonName;\r\n\r\n if (!name) {\r\n logger.warn('[generate] Book does not have a name!', file.name, id);\r\n return;\r\n }\r\n\r\n const commonName =\r\n (bookName?.exactMatch ? bookName?.bookName?.commonName : null) ??\r\n parsed.header ??\r\n parsed.title ??\r\n bookName?.bookName?.commonName ??\r\n id;\r\n\r\n const book: DatasetTranslationBook = {\r\n id: id as BookId,\r\n name,\r\n commonName,\r\n title: parsed.title ?? null,\r\n order,\r\n chapters: [],\r\n };\r\n\r\n if (isApocryphal) {\r\n book.isApocryphal = true;\r\n }\r\n\r\n for (let content of parsed.content) {\r\n if (content.type === 'chapter') {\r\n book.chapters.push({\r\n chapter: {\r\n number: content.number,\r\n content: content.content,\r\n footnotes: content.footnotes,\r\n },\r\n thisChapterAudioLinks: getAudioUrlsForChapter(\r\n translation.id,\r\n id,\r\n content.number\r\n ),\r\n thisChapterAudioTimings: {},\r\n\r\n // Word annotations are kept out of the chapter itself so\r\n // that they can be published as a separate file.\r\n ...(content.words\r\n ? { thisChapterWords: content.words }\r\n : {}),\r\n });\r\n }\r\n }\r\n\r\n book.chapters = sortBy(book.chapters, (c) => c.chapter.number);\r\n\r\n const index = sortedIndexBy(translation.books, book, (b) => b.order);\r\n translation.books.splice(index, 0, book);\r\n }\r\n\r\n function addCommentaryTree(\r\n file: InputCommentaryFile,\r\n parsed: CommentaryParseTree\r\n ) {\r\n let commentary = parsedCommentaries.get(file.metadata.id);\r\n\r\n if (!commentary) {\r\n commentary = {\r\n ...omit(file.metadata, 'direction'),\r\n textDirection: file.metadata.direction,\r\n books: [],\r\n profiles: [],\r\n };\r\n output.commentaries.push(commentary);\r\n parsedCommentaries.set(file.metadata.id, commentary);\r\n }\r\n\r\n for (let parsedBook of parsed.books) {\r\n let book = commentary.books.find((b) => b.id === parsedBook.book);\r\n if (book && book.introduction && parsedBook.introduction) {\r\n logger.warn(\r\n '[generate] Book already exists in commentary!',\r\n file.name,\r\n parsedBook.book\r\n );\r\n continue;\r\n }\r\n\r\n if (!book) {\r\n const name = getBookNames(file, file.metadata, parsedBook.book);\r\n book = {\r\n id: parsedBook.book as BookId,\r\n order: bookOrderMap.get(parsedBook.book) ?? -1,\r\n commonName: name?.bookName?.commonName ?? parsedBook.book,\r\n name: name?.bookName?.commonName ?? parsedBook.book,\r\n chapters: [],\r\n };\r\n }\r\n\r\n if (parsedBook.introduction) {\r\n book.introduction = parsedBook.introduction;\r\n }\r\n\r\n if (parsedBook.introductionSummary && !book.introductionSummary) {\r\n book.introductionSummary = parsedBook.introductionSummary;\r\n }\r\n\r\n for (let chapter of parsedBook.chapters) {\r\n let data: CommentaryChapterData = {\r\n number: chapter.number,\r\n content: chapter.verses,\r\n };\r\n\r\n if (chapter.introduction) {\r\n data.introduction = chapter.introduction;\r\n }\r\n\r\n book.chapters.push({\r\n chapter: data,\r\n });\r\n }\r\n\r\n book.chapters = sortBy(book.chapters, (c) => c.chapter.number);\r\n commentary.books.push(book);\r\n }\r\n\r\n if (parsed.profiles) {\r\n for (let profile of parsed.profiles) {\r\n const existing = commentary.profiles.find(\r\n (p) => p.id === profile.id\r\n );\r\n if (existing) {\r\n logger.warn(\r\n '[generate] Profile already exists in commentary!',\r\n file.name,\r\n profile.id\r\n );\r\n continue;\r\n }\r\n\r\n const datasetProfile: DatasetCommentaryProfile = {\r\n id: profile.id,\r\n subject: profile.subject,\r\n reference: profile.reference,\r\n content: profile.content,\r\n };\r\n\r\n commentary.profiles.push(datasetProfile);\r\n }\r\n }\r\n\r\n commentary.books = sortBy(commentary.books, (b) => b.order);\r\n commentary.profiles = sortBy(commentary.profiles, (p) => p.id);\r\n }\r\n\r\n function getBookNames(\r\n file: InputFileBase,\r\n metadata: MetadataBase,\r\n id: string\r\n ) {\r\n let exactMatch = true;\r\n let map = bookMap;\r\n if (!map) {\r\n map = defaultBookIdMap.get(metadata.language);\r\n\r\n if (!map) {\r\n if (!unknownLanguages.has(metadata.language)) {\r\n logger.warn(\r\n '[generate] File does not have a known language!',\r\n file.name,\r\n metadata.language\r\n );\r\n unknownLanguages.add(metadata.language);\r\n }\r\n\r\n logger.warn(\r\n '[generate] Using English book map for unknown language! This might result in outputting english book names.'\r\n );\r\n exactMatch = false;\r\n map = defaultBookIdMap.get('en');\r\n }\r\n }\r\n\r\n const bookName = map?.get(id);\r\n\r\n if (!!map && !bookName) {\r\n logger.warn(\r\n '[generate] Book name not found for ID!',\r\n file.name,\r\n id\r\n );\r\n return null;\r\n }\r\n\r\n return {\r\n exactMatch,\r\n bookName,\r\n };\r\n }\r\n\r\n return output;\r\n}\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B;AAC3B,wBAA0B;AAmB1B,wBAIO;AACP,oBAA4C;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BookIdMap"]
7
7
  }
@@ -32,13 +32,15 @@ __export(generation_exports, {
32
32
  api: () => api,
33
33
  audio: () => audio,
34
34
  bookOrder: () => bookOrder,
35
- dataset: () => dataset
35
+ dataset: () => dataset,
36
+ simple: () => simple
36
37
  });
37
38
  module.exports = __toCommonJS(generation_exports);
38
- var api = __toESM(require("./api.js"));
39
- var audio = __toESM(require("./audio.js"));
40
- var dataset = __toESM(require("./dataset.js"));
41
- var bookOrder = __toESM(require("./book-order.js"));
39
+ var api = __toESM(require("./api.js"), 1);
40
+ var audio = __toESM(require("./audio.js"), 1);
41
+ var dataset = __toESM(require("./dataset.js"), 1);
42
+ var bookOrder = __toESM(require("./book-order.js"), 1);
43
+ var simple = __toESM(require("./simple.js"), 1);
42
44
  __reExport(generation_exports, require("./common-types.js"), module.exports);
43
45
  // Annotate the CommonJS export names for ESM import in node:
44
46
  0 && (module.exports = {
@@ -46,6 +48,7 @@ __reExport(generation_exports, require("./common-types.js"), module.exports);
46
48
  audio,
47
49
  bookOrder,
48
50
  dataset,
51
+ simple,
49
52
  ...require("./common-types.js")
50
53
  });
51
54
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../generation/index.ts"],
4
- "sourcesContent": ["import * as api from './api.js';\r\nimport * as audio from './audio.js';\r\nimport * as dataset from './dataset.js';\r\nimport * as bookOrder from './book-order.js';\r\nexport * from './common-types.js';\r\n\r\nexport { api, audio, dataset, bookOrder };\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAAqB;AACrB,YAAuB;AACvB,cAAyB;AACzB,gBAA2B;AAC3B,+BAAc,8BAJd;",
4
+ "sourcesContent": ["import * as api from './api.js';\r\nimport * as audio from './audio.js';\r\nimport * as dataset from './dataset.js';\r\nimport * as bookOrder from './book-order.js';\r\nimport * as simple from './simple.js';\r\nexport * from './common-types.js';\r\n\r\nexport { api, audio, dataset, bookOrder, simple };\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAAqB;AACrB,YAAuB;AACvB,cAAyB;AACzB,gBAA2B;AAC3B,aAAwB;AACxB,+BAAc,8BALd;",
6
6
  "names": []
7
7
  }