@helloao/cli 0.1.0 → 0.2.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 (34) hide show
  1. package/README.md +136 -136
  2. package/dist/cjs/cli.cjs +5442 -6646
  3. package/dist/cjs/index.cjs +3825 -5209
  4. package/dist/esm/index.js +1233 -342
  5. package/dist/esm/index.js.map +4 -4
  6. package/dist/types/actions.d.ts +36 -0
  7. package/dist/types/db.d.ts +2 -2
  8. package/dist/types/ebible.d.ts +1 -1
  9. package/dist/types/files.d.ts +7 -1
  10. package/dist/types/openapi.d.ts +2 -0
  11. package/dist/types/uploads.d.ts +6 -0
  12. package/meta/ARBNAV.json +10 -10
  13. package/meta/BSB.json +10 -10
  14. package/meta/HBOMAS.json +10 -10
  15. package/meta/HINIRV.json +10 -10
  16. package/meta/eng_dra.json +10 -10
  17. package/migrations/20240420231455_initial/migration.sql +66 -66
  18. package/migrations/20240711173108_add_chapter_audio/migration.sql +13 -13
  19. package/migrations/20240724212651_add_hashing/migration.sql +25 -25
  20. package/migrations/20250625201152_add_extra_ebible_metadata/migration.sql +3 -3
  21. package/migrations/20250630200532_add_apocryhpa_flag/migration.sql +2 -2
  22. package/migrations/20250701195337_add_file_warnings/migration.sql +8 -8
  23. package/migrations/20251028135135_add_datasets/migration.sql +72 -72
  24. package/migrations/20251028144932_fix_dataset_types/migration.sql +50 -50
  25. package/migrations/20260217200934_add_license_notice/migration.sql +5 -0
  26. package/package.json +5 -2
  27. package/prisma-gen/edge.js +5 -3
  28. package/prisma-gen/index-browser.js +2 -0
  29. package/prisma-gen/index.d.ts +92 -0
  30. package/prisma-gen/index.js +5 -3
  31. package/prisma-gen/wasm.js +2 -0
  32. package/schema.prisma +2 -0
  33. package/prisma-gen/client.d.ts +0 -1
  34. package/prisma-gen/client.js +0 -4
package/dist/esm/index.js CHANGED
@@ -1482,19 +1482,19 @@ ${(0, ps.default)(pc(n), 2)}
1482
1482
  for (; !n[0] && n.length > 1; ) n.shift();
1483
1483
  }
1484
1484
  return function(n, i, o, s, a, l) {
1485
- var u, c, p, d, f, g, h, O, T, S, C, E, me, ae, Bt, U, ne, Ie, z, dt, Lr = n.constructor, qn = n.s == i.s ? 1 : -1, Y = n.d, _ = i.d;
1485
+ var u, c, p, d, f, g, h, O, T, S, C, E, me, ae, Bt, U, ne, Ie, z2, dt, Lr = n.constructor, qn = n.s == i.s ? 1 : -1, Y = n.d, _ = i.d;
1486
1486
  if (!Y || !Y[0] || !_ || !_[0]) return new Lr(!n.s || !i.s || (Y ? _ && Y[0] == _[0] : !_) ? NaN : Y && Y[0] == 0 || !_ ? qn * 0 : qn / 0);
1487
- for (l ? (f = 1, c = n.e - i.e) : (l = ge, f = b, c = ee(n.e / f) - ee(i.e / f)), z = _.length, ne = Y.length, T = new Lr(qn), S = T.d = [], p = 0; _[p] == (Y[p] || 0); p++) ;
1487
+ for (l ? (f = 1, c = n.e - i.e) : (l = ge, f = b, c = ee(n.e / f) - ee(i.e / f)), z2 = _.length, ne = Y.length, T = new Lr(qn), S = T.d = [], p = 0; _[p] == (Y[p] || 0); p++) ;
1488
1488
  if (_[p] > (Y[p] || 0) && c--, o == null ? (ae = o = Lr.precision, s = Lr.rounding) : a ? ae = o + (n.e - i.e) + 1 : ae = o, ae < 0) S.push(1), g = true;
1489
1489
  else {
1490
- if (ae = ae / f + 2 | 0, p = 0, z == 1) {
1490
+ if (ae = ae / f + 2 | 0, p = 0, z2 == 1) {
1491
1491
  for (d = 0, _ = _[0], ae++; (p < ne || d) && ae--; p++) Bt = d * l + (Y[p] || 0), S[p] = Bt / _ | 0, d = Bt % _ | 0;
1492
1492
  g = d || p < ne;
1493
1493
  } else {
1494
- for (d = l / (_[0] + 1) | 0, d > 1 && (_ = e(_, d, l), Y = e(Y, d, l), z = _.length, ne = Y.length), U = z, C = Y.slice(0, z), E = C.length; E < z; ) C[E++] = 0;
1494
+ for (d = l / (_[0] + 1) | 0, d > 1 && (_ = e(_, d, l), Y = e(Y, d, l), z2 = _.length, ne = Y.length), U = z2, C = Y.slice(0, z2), E = C.length; E < z2; ) C[E++] = 0;
1495
1495
  dt = _.slice(), dt.unshift(0), Ie = _[0], _[1] >= l / 2 && ++Ie;
1496
1496
  do
1497
- d = 0, u = t(_, C, z, E), u < 0 ? (me = C[0], z != E && (me = me * l + (C[1] || 0)), d = me / Ie | 0, d > 1 ? (d >= l && (d = l - 1), h = e(_, d, l), O = h.length, E = C.length, u = t(h, C, O, E), u == 1 && (d--, r(h, z < O ? dt : _, O, l))) : (d == 0 && (u = d = 1), h = _.slice()), O = h.length, O < E && h.unshift(0), r(C, h, E, l), u == -1 && (E = C.length, u = t(_, C, z, E), u < 1 && (d++, r(C, z < E ? dt : _, E, l))), E = C.length) : u === 0 && (d++, C = [0]), S[p++] = d, u && C[0] ? C[E++] = Y[U] || 0 : (C = [Y[U]], E = 1);
1497
+ d = 0, u = t(_, C, z2, E), u < 0 ? (me = C[0], z2 != E && (me = me * l + (C[1] || 0)), d = me / Ie | 0, d > 1 ? (d >= l && (d = l - 1), h = e(_, d, l), O = h.length, E = C.length, u = t(h, C, O, E), u == 1 && (d--, r(h, z2 < O ? dt : _, O, l))) : (d == 0 && (u = d = 1), h = _.slice()), O = h.length, O < E && h.unshift(0), r(C, h, E, l), u == -1 && (E = C.length, u = t(_, C, z2, E), u < 1 && (d++, r(C, z2 < E ? dt : _, E, l))), E = C.length) : u === 0 && (d++, C = [0]), S[p++] = d, u && C[0] ? C[E++] = Y[U] || 0 : (C = [Y[U]], E = 1);
1498
1498
  while ((U++ < ne || C[0] !== void 0) && ae--);
1499
1499
  g = C[0] !== void 0;
1500
1500
  }
@@ -2019,10 +2019,10 @@ ${(0, ps.default)(pc(n), 2)}
2019
2019
  }
2020
2020
  E && (ae = p[1] ? p[1].length : 0);
2021
2021
  var c = p.index + ae, p = p[0].slice(ae), d = c + p.length, f = Ie.slice(0, c), g = Ie.slice(d);
2022
- let z = [U, u];
2023
- f && (++U, ne += f.length, z.push(f));
2022
+ let z2 = [U, u];
2023
+ f && (++U, ne += f.length, z2.push(f));
2024
2024
  let dt = new he(h, C ? P.tokenize(p, C) : p, Bt, p, me);
2025
- if (z.push(dt), g && z.push(g), Array.prototype.splice.apply(t, z), u != 1 && P.matchGrammar(e, t, r, U, ne, true, h), o) break;
2025
+ if (z2.push(dt), g && z2.push(g), Array.prototype.splice.apply(t, z2), u != 1 && P.matchGrammar(e, t, r, U, ne, true, h), o) break;
2026
2026
  }
2027
2027
  }
2028
2028
  }
@@ -5490,6 +5490,7 @@ var require_prisma_gen = __commonJS({
5490
5490
  website: "website",
5491
5491
  licenseUrl: "licenseUrl",
5492
5492
  licenseNotes: "licenseNotes",
5493
+ licenseNotice: "licenseNotice",
5493
5494
  shortName: "shortName",
5494
5495
  englishName: "englishName",
5495
5496
  language: "language",
@@ -5502,6 +5503,7 @@ var require_prisma_gen = __commonJS({
5502
5503
  website: "website",
5503
5504
  licenseUrl: "licenseUrl",
5504
5505
  licenseNotes: "licenseNotes",
5506
+ licenseNotice: "licenseNotice",
5505
5507
  englishName: "englishName",
5506
5508
  language: "language",
5507
5509
  textDirection: "textDirection",
@@ -5749,8 +5751,8 @@ var require_prisma_gen = __commonJS({
5749
5751
  }
5750
5752
  }
5751
5753
  },
5752
- "inlineSchema": 'datasource db {\n provider = "sqlite"\n url = "file:../../bible-api.dev.db"\n}\n\ngenerator client {\n provider = "prisma-client-js"\n output = "./prisma-gen"\n}\n\nmodel Translation {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n shortName String?\n englishName String\n language String\n textDirection String\n\n // The SHA-256 hash of the translation\n // includes everything about the translation, including the books, chapters, verses, footnotes, etc.\n sha256 String?\n\n books Book[]\n chapters Chapter[]\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n}\n\nmodel Commentary {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n englishName String\n language String\n textDirection String\n\n // The SHA-256 hash of the translation\n // includes everything about the translation, including the books, chapters, verses, footnotes, etc.\n sha256 String?\n\n books CommentaryBook[]\n chapters CommentaryChapter[]\n verses CommentaryChapterVerse[]\n profiles CommentaryProfile[]\n}\n\n// The ebible.org source for a particular translation\n// Contains metadata that is useful for managing downloads\nmodel EBibleSource {\n id String @id\n\n // The URL to the USFM zip file download\n usfmZipUrl String?\n // The ETag of the downloaded USFM zip file\n usfmZipEtag String?\n\n languageCode String\n title String\n shortTitle String?\n textDirection String?\n redistributable Boolean\n description String\n copyright String\n FCBHID String\n updateDate DateTime\n sourceDate DateTime\n\n oldTestamentBooks Int\n oldTestamentChapters Int\n oldTestamentVerses Int\n newTestamentBooks Int\n newTestamentChapters Int\n newTestamentVerses Int\n apocryphaBooks Int\n apocryphaChapters Int\n apocryphaVerses Int\n\n // The ID of the translation that the source is for\n translationId String\n\n // The date that the source was downloaded\n usfmDownloadDate DateTime?\n\n // The path that the USFM was downloaded to\n usfmDownloadPath String?\n\n // The SHA-256 hash of the source\n // Can be used to determine if the source has changed\n sha256 String?\n}\n\n// Files that were input into the API generator\nmodel InputFile {\n // The ID of the translation that the file is for\n translationId String\n\n // The name of the file\n name String\n\n format String\n\n // The SHA-256 hash of the file\n sha256 String\n\n sizeInBytes Int\n\n @@id([translationId, name])\n}\n\nmodel InputFileWarning {\n // The name of the file\n name String\n\n // The type of the warning\n type String\n\n // The message of the warning\n message String\n\n @@id([name, type, message])\n}\n\nmodel Book {\n id String\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n name String\n commonName String\n title String?\n order Int\n\n numberOfChapters Int\n\n isApocryphal Boolean? // Whether the book is an apocryphal book\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters Chapter[]\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n\n @@id([translationId, id])\n}\n\nmodel CommentaryBook {\n id String\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n name String\n commonName String\n introduction String?\n introductionSummary String?\n order Int\n\n numberOfChapters Int\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters CommentaryChapter[]\n verses CommentaryChapterVerse[]\n\n @@id([commentaryId, id])\n}\n\nmodel CommentaryProfile {\n id String\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n subject String\n content String\n\n referenceBook String?\n referenceChapter Int?\n referenceVerse Int?\n referenceEndChapter Int?\n referenceEndVerse Int?\n\n json String // The JSON of the profile\n\n // The SHA-256 hash of the profile\n sha256 String?\n\n @@id([commentaryId, id])\n}\n\nmodel Chapter {\n number Int\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n\n @@id([translationId, bookId, number])\n}\n\nmodel CommentaryChapter {\n number Int\n\n bookId String\n book CommentaryBook @relation(fields: [commentaryId, bookId], references: [commentaryId, id])\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n introduction String?\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses CommentaryChapterVerse[]\n\n @@id([commentaryId, bookId, number])\n}\n\nmodel ChapterAudioUrl {\n number Int\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n chapter Chapter @relation(fields: [translationId, bookId, number], references: [translationId, bookId, number])\n\n reader String\n url String\n\n @@id([translationId, bookId, number, reader])\n}\n\nmodel ChapterVerse {\n number Int\n\n chapterNumber Int\n chapter Chapter @relation(fields: [translationId, bookId, chapterNumber], references: [translationId, bookId, number])\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n text String // The text of the verse\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n footnotes ChapterFootnote[]\n\n @@id([translationId, bookId, chapterNumber, number])\n}\n\nmodel CommentaryChapterVerse {\n number Int\n\n chapterNumber Int\n chapter CommentaryChapter @relation(fields: [commentaryId, bookId, chapterNumber], references: [commentaryId, bookId, number])\n\n bookId String\n book CommentaryBook @relation(fields: [commentaryId, bookId], references: [commentaryId, id])\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n text String // The text of the verse\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n @@id([commentaryId, bookId, chapterNumber, number])\n}\n\nmodel ChapterFootnote {\n id Int\n\n chapterNumber Int\n chapter Chapter @relation(fields: [translationId, bookId, chapterNumber], references: [translationId, bookId, number])\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n text String\n\n // The SHA-256 hash of the footnote\n sha256 String?\n\n verseNumber Int?\n verse ChapterVerse? @relation(fields: [translationId, bookId, chapterNumber, verseNumber], references: [translationId, bookId, chapterNumber, number])\n\n @@id([translationId, bookId, chapterNumber, id])\n}\n\nmodel Dataset {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n englishName String\n language String\n textDirection String\n\n sha256 String?\n\n books DatasetBook[]\n chapters DatasetChapter[]\n verses DatasetChapterVerse[]\n references DatasetReference[]\n}\n\nmodel DatasetBook {\n id String\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n order Int\n\n numberOfChapters Int\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters DatasetChapter[]\n verses DatasetChapterVerse[]\n references DatasetReference[]\n\n @@id([datasetId, id])\n}\n\nmodel DatasetChapter {\n number Int\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses DatasetChapterVerse[]\n references DatasetReference[]\n\n @@id([datasetId, bookId, number])\n}\n\nmodel DatasetChapterVerse {\n number Int\n\n chapterNumber Int\n chapter DatasetChapter @relation(fields: [datasetId, bookId, chapterNumber], references: [datasetId, bookId, number])\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n references DatasetReference[]\n\n @@id([datasetId, bookId, chapterNumber, number])\n}\n\nmodel DatasetReference {\n id Int @id @default(autoincrement())\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n chapterNumber Int\n chapter DatasetChapter @relation(fields: [datasetId, bookId, chapterNumber], references: [datasetId, bookId, number])\n\n verseNumber Int\n verse DatasetChapterVerse @relation(fields: [datasetId, bookId, chapterNumber, verseNumber], references: [datasetId, bookId, chapterNumber, number])\n\n referenceBookId String\n referenceChapter Int\n referenceVerse Int\n\n endVerseNumber Int?\n score Int?\n}\n',
5753
- "inlineSchemaHash": "7a10a7fbc4f723508362c0cc38d7d07c19ce68e1db29be580483fe78ade713d3",
5754
+ "inlineSchema": 'datasource db {\n provider = "sqlite"\n url = "file:../../bible-api.dev.db"\n}\n\ngenerator client {\n provider = "prisma-client-js"\n output = "./prisma-gen"\n}\n\nmodel Translation {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n licenseNotice String?\n shortName String?\n englishName String\n language String\n textDirection String\n\n // The SHA-256 hash of the translation\n // includes everything about the translation, including the books, chapters, verses, footnotes, etc.\n sha256 String?\n\n books Book[]\n chapters Chapter[]\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n}\n\nmodel Commentary {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n licenseNotice String?\n englishName String\n language String\n textDirection String\n\n // The SHA-256 hash of the translation\n // includes everything about the translation, including the books, chapters, verses, footnotes, etc.\n sha256 String?\n\n books CommentaryBook[]\n chapters CommentaryChapter[]\n verses CommentaryChapterVerse[]\n profiles CommentaryProfile[]\n}\n\n// The ebible.org source for a particular translation\n// Contains metadata that is useful for managing downloads\nmodel EBibleSource {\n id String @id\n\n // The URL to the USFM zip file download\n usfmZipUrl String?\n // The ETag of the downloaded USFM zip file\n usfmZipEtag String?\n\n languageCode String\n title String\n shortTitle String?\n textDirection String?\n redistributable Boolean\n description String\n copyright String\n FCBHID String\n updateDate DateTime\n sourceDate DateTime\n\n oldTestamentBooks Int\n oldTestamentChapters Int\n oldTestamentVerses Int\n newTestamentBooks Int\n newTestamentChapters Int\n newTestamentVerses Int\n apocryphaBooks Int\n apocryphaChapters Int\n apocryphaVerses Int\n\n // The ID of the translation that the source is for\n translationId String\n\n // The date that the source was downloaded\n usfmDownloadDate DateTime?\n\n // The path that the USFM was downloaded to\n usfmDownloadPath String?\n\n // The SHA-256 hash of the source\n // Can be used to determine if the source has changed\n sha256 String?\n}\n\n// Files that were input into the API generator\nmodel InputFile {\n // The ID of the translation that the file is for\n translationId String\n\n // The name of the file\n name String\n\n format String\n\n // The SHA-256 hash of the file\n sha256 String\n\n sizeInBytes Int\n\n @@id([translationId, name])\n}\n\nmodel InputFileWarning {\n // The name of the file\n name String\n\n // The type of the warning\n type String\n\n // The message of the warning\n message String\n\n @@id([name, type, message])\n}\n\nmodel Book {\n id String\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n name String\n commonName String\n title String?\n order Int\n\n numberOfChapters Int\n\n isApocryphal Boolean? // Whether the book is an apocryphal book\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters Chapter[]\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n\n @@id([translationId, id])\n}\n\nmodel CommentaryBook {\n id String\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n name String\n commonName String\n introduction String?\n introductionSummary String?\n order Int\n\n numberOfChapters Int\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters CommentaryChapter[]\n verses CommentaryChapterVerse[]\n\n @@id([commentaryId, id])\n}\n\nmodel CommentaryProfile {\n id String\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n subject String\n content String\n\n referenceBook String?\n referenceChapter Int?\n referenceVerse Int?\n referenceEndChapter Int?\n referenceEndVerse Int?\n\n json String // The JSON of the profile\n\n // The SHA-256 hash of the profile\n sha256 String?\n\n @@id([commentaryId, id])\n}\n\nmodel Chapter {\n number Int\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses ChapterVerse[]\n footnotes ChapterFootnote[]\n audioUrls ChapterAudioUrl[]\n\n @@id([translationId, bookId, number])\n}\n\nmodel CommentaryChapter {\n number Int\n\n bookId String\n book CommentaryBook @relation(fields: [commentaryId, bookId], references: [commentaryId, id])\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n introduction String?\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses CommentaryChapterVerse[]\n\n @@id([commentaryId, bookId, number])\n}\n\nmodel ChapterAudioUrl {\n number Int\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n chapter Chapter @relation(fields: [translationId, bookId, number], references: [translationId, bookId, number])\n\n reader String\n url String\n\n @@id([translationId, bookId, number, reader])\n}\n\nmodel ChapterVerse {\n number Int\n\n chapterNumber Int\n chapter Chapter @relation(fields: [translationId, bookId, chapterNumber], references: [translationId, bookId, number])\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n text String // The text of the verse\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n footnotes ChapterFootnote[]\n\n @@id([translationId, bookId, chapterNumber, number])\n}\n\nmodel CommentaryChapterVerse {\n number Int\n\n chapterNumber Int\n chapter CommentaryChapter @relation(fields: [commentaryId, bookId, chapterNumber], references: [commentaryId, bookId, number])\n\n bookId String\n book CommentaryBook @relation(fields: [commentaryId, bookId], references: [commentaryId, id])\n\n commentaryId String\n commentary Commentary @relation(fields: [commentaryId], references: [id])\n\n text String // The text of the verse\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n @@id([commentaryId, bookId, chapterNumber, number])\n}\n\nmodel ChapterFootnote {\n id Int\n\n chapterNumber Int\n chapter Chapter @relation(fields: [translationId, bookId, chapterNumber], references: [translationId, bookId, number])\n\n bookId String\n book Book @relation(fields: [translationId, bookId], references: [translationId, id])\n\n translationId String\n translation Translation @relation(fields: [translationId], references: [id])\n\n text String\n\n // The SHA-256 hash of the footnote\n sha256 String?\n\n verseNumber Int?\n verse ChapterVerse? @relation(fields: [translationId, bookId, chapterNumber, verseNumber], references: [translationId, bookId, chapterNumber, number])\n\n @@id([translationId, bookId, chapterNumber, id])\n}\n\nmodel Dataset {\n id String @id\n name String\n website String\n licenseUrl String\n licenseNotes String?\n englishName String\n language String\n textDirection String\n\n sha256 String?\n\n books DatasetBook[]\n chapters DatasetChapter[]\n verses DatasetChapterVerse[]\n references DatasetReference[]\n}\n\nmodel DatasetBook {\n id String\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n order Int\n\n numberOfChapters Int\n\n // The SHA-256 hash of the book\n sha256 String?\n\n chapters DatasetChapter[]\n verses DatasetChapterVerse[]\n references DatasetReference[]\n\n @@id([datasetId, id])\n}\n\nmodel DatasetChapter {\n number Int\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n json String // The JSON of the chapter\n\n // The SHA-256 hash of the chapter\n sha256 String?\n\n verses DatasetChapterVerse[]\n references DatasetReference[]\n\n @@id([datasetId, bookId, number])\n}\n\nmodel DatasetChapterVerse {\n number Int\n\n chapterNumber Int\n chapter DatasetChapter @relation(fields: [datasetId, bookId, chapterNumber], references: [datasetId, bookId, number])\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n contentJson String // The JSON of the verse content\n\n // The SHA-256 hash of the verse\n sha256 String?\n\n references DatasetReference[]\n\n @@id([datasetId, bookId, chapterNumber, number])\n}\n\nmodel DatasetReference {\n id Int @id @default(autoincrement())\n\n datasetId String\n dataset Dataset @relation(fields: [datasetId], references: [id])\n\n bookId String\n book DatasetBook @relation(fields: [datasetId, bookId], references: [datasetId, id])\n\n chapterNumber Int\n chapter DatasetChapter @relation(fields: [datasetId, bookId, chapterNumber], references: [datasetId, bookId, number])\n\n verseNumber Int\n verse DatasetChapterVerse @relation(fields: [datasetId, bookId, chapterNumber, verseNumber], references: [datasetId, bookId, chapterNumber, number])\n\n referenceBookId String\n referenceChapter Int\n referenceVerse Int\n\n endVerseNumber Int?\n score Int?\n}\n',
5755
+ "inlineSchemaHash": "e2aaf3cc3b6e715df0215511f40a97cea4835315a485acba51efd13f7b86b783",
5754
5756
  "copyEngine": true
5755
5757
  };
5756
5758
  var fs2 = __require("fs");
@@ -5766,7 +5768,7 @@ var require_prisma_gen = __commonJS({
5766
5768
  config2.dirname = path5.join(process.cwd(), alternativePath);
5767
5769
  config2.isBundled = true;
5768
5770
  }
5769
- config2.runtimeDataModel = JSON.parse('{"models":{"Translation":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"shortName","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterVerseToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterFootnoteToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"ChapterAudioUrlToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Commentary":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryToCommentaryBook","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryToCommentaryChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"profiles","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryProfile","relationName":"CommentaryToCommentaryProfile","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"EBibleSource":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmZipUrl","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmZipEtag","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"languageCode","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"title","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"shortTitle","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"redistributable","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Boolean","isGenerated":false,"isUpdatedAt":false},{"name":"description","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"copyright","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"FCBHID","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"updateDate","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"sourceDate","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmDownloadDate","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"usfmDownloadPath","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"InputFile":{"dbName":null,"fields":[{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"format","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sizeInBytes","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","name"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"InputFileWarning":{"dbName":null,"fields":[{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"type","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"message","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["name","type","message"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Book":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"BookToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commonName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"title","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"isApocryphal","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Boolean","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"BookToChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"BookToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"BookToChapterFootnote","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"BookToChapterAudioUrl","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryBook":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryBook","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commonName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"introduction","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"introductionSummary","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryBookToCommentaryChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryBookToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryProfile":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryProfile","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"subject","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"content","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceBook","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceChapter","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceVerse","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceEndChapter","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceEndVerse","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Chapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapter","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterToChapterFootnote","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"ChapterToChapterAudioUrl","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryChapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryBookToCommentaryChapter","relationFromFields":["commentaryId","bookId"],"relationToFields":["commentaryId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryChapter","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"introduction","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryChapterToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterAudioUrl":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterAudioUrl","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterAudioUrlToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterAudioUrl","relationFromFields":["translationId","bookId","number"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"reader","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"url","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","number","reader"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterVerse","relationFromFields":["translationId","bookId","chapterNumber"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterVerse","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterVerseToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterFootnoteToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryChapterToCommentaryChapterVerse","relationFromFields":["commentaryId","bookId","chapterNumber"],"relationToFields":["commentaryId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryBookToCommentaryChapterVerse","relationFromFields":["commentaryId","bookId"],"relationToFields":["commentaryId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryChapterVerse","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterFootnote":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterFootnote","relationFromFields":["translationId","bookId","chapterNumber"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterFootnote","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterFootnoteToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verseNumber","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"verse","kind":"object","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterFootnoteToChapterVerse","relationFromFields":["translationId","bookId","chapterNumber","verseNumber"],"relationToFields":["translationId","bookId","chapterNumber","number"],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","chapterNumber","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Dataset":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetToDatasetBook","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetToDatasetChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetBook":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetBook","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetBookToDatasetChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetBookToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetBookToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetChapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetChapter","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetChapter","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetChapterToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetChapterToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetChapterToDatasetChapterVerse","relationFromFields":["datasetId","bookId","chapterNumber"],"relationToFields":["datasetId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetChapterVerse","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetChapterVerse","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetChapterVerseToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetReference":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":true,"type":"Int","default":{"name":"autoincrement","args":[]},"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetReference","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetReference","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetChapterToDatasetReference","relationFromFields":["datasetId","bookId","chapterNumber"],"relationToFields":["datasetId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"verseNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"verse","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetChapterVerseToDatasetReference","relationFromFields":["datasetId","bookId","chapterNumber","verseNumber"],"relationToFields":["datasetId","bookId","chapterNumber","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"referenceBookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceChapter","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceVerse","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"endVerseNumber","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"score","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false}},"enums":{},"types":{}}');
5771
+ config2.runtimeDataModel = JSON.parse('{"models":{"Translation":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotice","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"shortName","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterVerseToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterFootnoteToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"ChapterAudioUrlToTranslation","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Commentary":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotice","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryToCommentaryBook","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryToCommentaryChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"profiles","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryProfile","relationName":"CommentaryToCommentaryProfile","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"EBibleSource":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmZipUrl","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmZipEtag","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"languageCode","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"title","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"shortTitle","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"redistributable","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Boolean","isGenerated":false,"isUpdatedAt":false},{"name":"description","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"copyright","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"FCBHID","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"updateDate","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"sourceDate","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"oldTestamentVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"newTestamentVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaBooks","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"apocryphaVerses","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"usfmDownloadDate","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"usfmDownloadPath","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"InputFile":{"dbName":null,"fields":[{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"format","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sizeInBytes","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","name"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"InputFileWarning":{"dbName":null,"fields":[{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"type","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"message","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["name","type","message"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Book":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"BookToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commonName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"title","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"isApocryphal","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Boolean","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"BookToChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"BookToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"BookToChapterFootnote","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"BookToChapterAudioUrl","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryBook":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryBook","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commonName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"introduction","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"introductionSummary","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryBookToCommentaryChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryBookToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryProfile":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryProfile","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"subject","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"content","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceBook","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceChapter","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceVerse","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceEndChapter","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceEndVerse","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Chapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapter","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterToChapterFootnote","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"audioUrls","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterAudioUrl","relationName":"ChapterToChapterAudioUrl","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryChapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryBookToCommentaryChapter","relationFromFields":["commentaryId","bookId"],"relationToFields":["commentaryId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryChapter","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"introduction","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapterVerse","relationName":"CommentaryChapterToCommentaryChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterAudioUrl":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterAudioUrl","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterAudioUrlToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterAudioUrl","relationFromFields":["translationId","bookId","number"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"reader","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"url","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","number","reader"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterVerse","relationFromFields":["translationId","bookId","chapterNumber"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterVerse","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterVerseToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"footnotes","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterFootnote","relationName":"ChapterFootnoteToChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"CommentaryChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryChapter","relationName":"CommentaryChapterToCommentaryChapterVerse","relationFromFields":["commentaryId","bookId","chapterNumber"],"relationToFields":["commentaryId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"CommentaryBook","relationName":"CommentaryBookToCommentaryChapterVerse","relationFromFields":["commentaryId","bookId"],"relationToFields":["commentaryId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"commentaryId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"commentary","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Commentary","relationName":"CommentaryToCommentaryChapterVerse","relationFromFields":["commentaryId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["commentaryId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"ChapterFootnote":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Chapter","relationName":"ChapterToChapterFootnote","relationFromFields":["translationId","bookId","chapterNumber"],"relationToFields":["translationId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Book","relationName":"BookToChapterFootnote","relationFromFields":["translationId","bookId"],"relationToFields":["translationId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"translationId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"translation","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Translation","relationName":"ChapterFootnoteToTranslation","relationFromFields":["translationId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"text","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verseNumber","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"verse","kind":"object","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"ChapterVerse","relationName":"ChapterFootnoteToChapterVerse","relationFromFields":["translationId","bookId","chapterNumber","verseNumber"],"relationToFields":["translationId","bookId","chapterNumber","number"],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["translationId","bookId","chapterNumber","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"Dataset":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"name","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"website","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseUrl","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"licenseNotes","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"englishName","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"language","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"textDirection","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"books","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetToDatasetBook","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetToDatasetChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetBook":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetBook","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"order","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"numberOfChapters","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"chapters","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetBookToDatasetChapter","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetBookToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetBookToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","id"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetChapter":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetChapter","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetChapter","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"json","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"verses","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetChapterToDatasetChapterVerse","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetChapterToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","bookId","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetChapterVerse":{"dbName":null,"fields":[{"name":"number","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetChapterToDatasetChapterVerse","relationFromFields":["datasetId","bookId","chapterNumber"],"relationToFields":["datasetId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetChapterVerse","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetChapterVerse","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"contentJson","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"sha256","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"references","kind":"object","isList":true,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetReference","relationName":"DatasetChapterVerseToDatasetReference","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":{"name":null,"fields":["datasetId","bookId","chapterNumber","number"]},"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},"DatasetReference":{"dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":true,"type":"Int","default":{"name":"autoincrement","args":[]},"isGenerated":false,"isUpdatedAt":false},{"name":"datasetId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"dataset","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Dataset","relationName":"DatasetToDatasetReference","relationFromFields":["datasetId"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false},{"name":"bookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"book","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetBook","relationName":"DatasetBookToDatasetReference","relationFromFields":["datasetId","bookId"],"relationToFields":["datasetId","id"],"isGenerated":false,"isUpdatedAt":false},{"name":"chapterNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"chapter","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapter","relationName":"DatasetChapterToDatasetReference","relationFromFields":["datasetId","bookId","chapterNumber"],"relationToFields":["datasetId","bookId","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"verseNumber","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"verse","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"DatasetChapterVerse","relationName":"DatasetChapterVerseToDatasetReference","relationFromFields":["datasetId","bookId","chapterNumber","verseNumber"],"relationToFields":["datasetId","bookId","chapterNumber","number"],"isGenerated":false,"isUpdatedAt":false},{"name":"referenceBookId","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"referenceChapter","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"referenceVerse","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"endVerseNumber","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"score","kind":"scalar","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"Int","isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false}},"enums":{},"types":{}}');
5770
5772
  defineDmmfProperty2(exports2.Prisma, config2.runtimeDataModel);
5771
5773
  config2.engineWasm = void 0;
5772
5774
  var { warnEnvConflicts: warnEnvConflicts2 } = require_library();
@@ -5841,6 +5843,7 @@ __export(files_exports, {
5841
5843
  loadDatasetsFromDirectory: () => loadDatasetsFromDirectory,
5842
5844
  loadTranslationFiles: () => loadTranslationFiles,
5843
5845
  loadTranslationsFiles: () => loadTranslationsFiles,
5846
+ loadTranslationsFromDirectory: () => loadTranslationsFromDirectory,
5844
5847
  serializeFile: () => serializeFile,
5845
5848
  serializeOutputFiles: () => serializeOutputFiles
5846
5849
  });
@@ -5862,7 +5865,11 @@ import { mergeWith } from "lodash";
5862
5865
  import { fromByteArray } from "base64-js";
5863
5866
  import { log } from "@helloao/tools";
5864
5867
  import { bookOrderMap } from "@helloao/tools/generation/book-order.js";
5868
+ import {
5869
+ DATASET_VERSION
5870
+ } from "@helloao/tools/generation/dataset.js";
5865
5871
  import { getBookId } from "@helloao/tools/utils.js";
5872
+ import { LOCKMAN_PARSER_VERSION } from "@helloao/tools/parser/lockman-parser.js";
5866
5873
  async function* serializeOutputFiles(files, options) {
5867
5874
  const mergableFiles = /* @__PURE__ */ new Map();
5868
5875
  for await (let batch2 of files) {
@@ -5974,26 +5981,26 @@ async function loadTranslationsFiles(dirs) {
5974
5981
  const files = allFiles.flat();
5975
5982
  return files;
5976
5983
  }
5977
- async function loadTranslationFiles(translation, translationMetadata) {
5984
+ async function loadTranslationFiles(translation2, translationMetadata) {
5978
5985
  const logger = log.getLogger();
5979
- const metadata = translationMetadata ?? await loadTranslationMetadata(translation);
5986
+ const metadata = translationMetadata ?? await loadTranslationMetadata(translation2);
5980
5987
  if (!metadata) {
5981
- logger.error("Could not load metadata for translation!", translation);
5988
+ logger.error("Could not load metadata for translation!", translation2);
5982
5989
  return null;
5983
5990
  }
5984
- let files = await readdir(translation);
5991
+ let files = await readdir(translation2);
5985
5992
  let usfmFiles = files.filter(
5986
- (f) => extname(f) === ".usfm" || extname(f) === ".usx" || extname(f) === ".json" || extname(f) === ".codex"
5993
+ (f) => extname(f) === ".usfm" || extname(f) === ".usx" || extname(f) === ".json" || extname(f) === ".codex" || f.endsWith(".lockman.txt")
5987
5994
  );
5988
5995
  if (usfmFiles.length <= 0) {
5989
- translation = path.resolve(translation, "usfm");
5990
- if (existsSync(translation)) {
5991
- files = await readdir(translation);
5996
+ translation2 = path.resolve(translation2, "usfm");
5997
+ if (existsSync(translation2)) {
5998
+ files = await readdir(translation2);
5992
5999
  usfmFiles = files.filter((f) => extname(f) === ".usfm");
5993
6000
  }
5994
6001
  }
5995
6002
  if (usfmFiles.length <= 0) {
5996
- logger.error("Could not find USFM files for translation!", translation);
6003
+ logger.error("Could not find files for translation!", translation2);
5997
6004
  return [];
5998
6005
  }
5999
6006
  let promises = [];
@@ -6001,8 +6008,8 @@ async function loadTranslationFiles(translation, translationMetadata) {
6001
6008
  if (path.parse(file).name === "metadata") {
6002
6009
  continue;
6003
6010
  }
6004
- const filePath = path.resolve(translation, file);
6005
- let fileType = getFileType(path.extname(file).slice(1));
6011
+ const filePath = path.resolve(translation2, file);
6012
+ let fileType = getFileType(file);
6006
6013
  if (!fileType) {
6007
6014
  logger.warn(`Unknown file type for ${filePath}, skipping file.`);
6008
6015
  continue;
@@ -6023,19 +6030,19 @@ async function loadCommentariesFiles(dirs) {
6023
6030
  const files = allFiles.flat();
6024
6031
  return files;
6025
6032
  }
6026
- async function loadCommentaryFiles(commentary) {
6033
+ async function loadCommentaryFiles(commentary2) {
6027
6034
  const logger = log.getLogger();
6028
- const metadata = await loadCommentaryMetadata(commentary);
6035
+ const metadata = await loadCommentaryMetadata(commentary2);
6029
6036
  if (!metadata) {
6030
- logger.error("Could not load metadata for commentary!", commentary);
6037
+ logger.error("Could not load metadata for commentary!", commentary2);
6031
6038
  return null;
6032
6039
  }
6033
- let files = await readdir(commentary);
6040
+ let files = await readdir(commentary2);
6034
6041
  let commentaryFiles = files.filter(
6035
6042
  (f) => extname(f) === ".csv" || f.endsWith(".tyndale.xml")
6036
6043
  );
6037
6044
  if (commentaryFiles.length <= 0) {
6038
- logger.error("Could not find files for commentary!", commentary);
6045
+ logger.error("Could not find files for commentary!", commentary2);
6039
6046
  return [];
6040
6047
  }
6041
6048
  let promises = [];
@@ -6043,18 +6050,100 @@ async function loadCommentaryFiles(commentary) {
6043
6050
  if (path.parse(file).name === "metadata") {
6044
6051
  continue;
6045
6052
  }
6046
- const filePath = path.resolve(commentary, file);
6053
+ const filePath = path.resolve(commentary2, file);
6047
6054
  const type = extname(filePath) === ".csv" ? "commentary/csv" : "commentary/tyndale-xml";
6048
6055
  promises.push(loadFile(type, filePath, metadata));
6049
6056
  }
6050
6057
  return await Promise.all(promises);
6051
6058
  }
6059
+ async function loadTranslationsFromDirectory(dir) {
6060
+ const logger = log.getLogger();
6061
+ let translations = [];
6062
+ const apiDir = path.resolve(dir, "api");
6063
+ const availableTranslationsPath = path.resolve(
6064
+ apiDir,
6065
+ "available_translations.json"
6066
+ );
6067
+ if (!existsSync(availableTranslationsPath)) {
6068
+ logger.warn(
6069
+ `Could not find available_translations.json at ${availableTranslationsPath}, skipping translation loading.`
6070
+ );
6071
+ return [];
6072
+ }
6073
+ const availableTranslations = JSON.parse(
6074
+ await readFile(availableTranslationsPath, "utf-8")
6075
+ );
6076
+ translations.push(
6077
+ ...availableTranslations.translations.map((d) => ({
6078
+ ...d,
6079
+ books: []
6080
+ }))
6081
+ );
6082
+ for (let dataset2 of translations) {
6083
+ const datasetDir = path.resolve(apiDir, dataset2.id);
6084
+ const booksList = await readdir(datasetDir);
6085
+ const booksPath = path.resolve(datasetDir, "books.json");
6086
+ const booksData = existsSync(booksPath) ? JSON.parse(await readFile(booksPath, "utf-8")) : null;
6087
+ for (let bookId of booksList) {
6088
+ if (bookId === "books.json") {
6089
+ continue;
6090
+ }
6091
+ const id2 = getBookId(bookId);
6092
+ if (!id2) {
6093
+ logger.warn(`Unknown book directory: ${bookId}`);
6094
+ continue;
6095
+ }
6096
+ const bookData = booksData?.books.find((b2) => b2.id === id2);
6097
+ if (!bookData) {
6098
+ logger.warn(
6099
+ `Could not find book data for book ${id2} in translation ${dataset2.id}`
6100
+ );
6101
+ }
6102
+ const book2 = {
6103
+ id: id2,
6104
+ commonName: bookData?.commonName ?? "",
6105
+ name: bookData?.name ?? "",
6106
+ title: bookData?.title ?? "",
6107
+ chapters: [],
6108
+ order: bookOrderMap.get(id2)
6109
+ };
6110
+ dataset2.books.push(book2);
6111
+ const bookDir = path.resolve(datasetDir, bookId);
6112
+ const chapters = await readdir(bookDir);
6113
+ for (let chapterFile of chapters) {
6114
+ const chapterJson = JSON.parse(
6115
+ await readFile(path.resolve(bookDir, chapterFile), "utf-8")
6116
+ );
6117
+ if (chapterJson.chapter) {
6118
+ book2.chapters.push({
6119
+ chapter: chapterJson.chapter,
6120
+ thisChapterAudioLinks: chapterJson.thisChapterAudioLinks
6121
+ });
6122
+ } else {
6123
+ logger.warn(`Unknown chapter format: ${chapterFile}`);
6124
+ continue;
6125
+ }
6126
+ }
6127
+ }
6128
+ }
6129
+ return translations;
6130
+ }
6052
6131
  async function loadDatasetsFromDirectory(dir) {
6053
6132
  const logger = log.getLogger();
6054
6133
  let datasets = [];
6055
6134
  const apiDir = path.resolve(dir, "api");
6135
+ const availableDatasetsPath = path.resolve(
6136
+ apiDir,
6137
+ "available_datasets.json"
6138
+ );
6139
+ if (!existsSync(availableDatasetsPath)) {
6140
+ logger.warn(
6141
+ `Could not find available_datasets.json at ${availableDatasetsPath}, skipping dataset loading.`
6142
+ );
6143
+ return [];
6144
+ }
6056
6145
  const availableDatasets = JSON.parse(
6057
- await readFile(path.resolve(apiDir, "available_datasets.json"), "utf-8")
6146
+ await readFile(availableDatasetsPath, "utf-8")
6058
6147
  );
6059
6148
  datasets.push(
6060
6149
  ...availableDatasets.datasets.map((d) => ({
@@ -6062,8 +6151,8 @@ async function loadDatasetsFromDirectory(dir) {
6062
6151
  books: []
6063
6152
  }))
6064
6153
  );
6065
- for (let dataset of datasets) {
6066
- const datasetDir = path.resolve(apiDir, "d", dataset.id);
6154
+ for (let dataset2 of datasets) {
6155
+ const datasetDir = path.resolve(apiDir, "d", dataset2.id);
6067
6156
  const booksList = await readdir(datasetDir);
6068
6157
  for (let bookId of booksList) {
6069
6158
  if (bookId === "books.json") {
@@ -6074,12 +6163,12 @@ async function loadDatasetsFromDirectory(dir) {
6074
6163
  logger.warn(`Unknown book directory: ${bookId}`);
6075
6164
  continue;
6076
6165
  }
6077
- const book = {
6166
+ const book2 = {
6078
6167
  id: id2,
6079
6168
  chapters: [],
6080
6169
  order: bookOrderMap.get(id2)
6081
6170
  };
6082
- dataset.books.push(book);
6171
+ dataset2.books.push(book2);
6083
6172
  const bookDir = path.resolve(datasetDir, bookId);
6084
6173
  const chapters = await readdir(bookDir);
6085
6174
  for (let chapterFile of chapters) {
@@ -6087,7 +6176,7 @@ async function loadDatasetsFromDirectory(dir) {
6087
6176
  await readFile(path.resolve(bookDir, chapterFile), "utf-8")
6088
6177
  );
6089
6178
  if (chapterJson.chapter) {
6090
- book.chapters.push({
6179
+ book2.chapters.push({
6091
6180
  chapter: chapterJson.chapter
6092
6181
  });
6093
6182
  } else if (chapterJson.content) {
@@ -6098,7 +6187,7 @@ async function loadDatasetsFromDirectory(dir) {
6098
6187
  logger.warn(`Unknown chapter format: ${chapterFile}`);
6099
6188
  continue;
6100
6189
  }
6101
- book.chapters.push({
6190
+ book2.chapters.push({
6102
6191
  chapter: {
6103
6192
  number: chapterNumber,
6104
6193
  content: chapterJson.content.map((c) => ({
@@ -6124,14 +6213,14 @@ async function loadDatasetsFromDirectory(dir) {
6124
6213
  }
6125
6214
  return datasets;
6126
6215
  }
6127
- async function loadTranslationMetadata(translation) {
6216
+ async function loadTranslationMetadata(translation2) {
6128
6217
  const logger = log.getLogger();
6129
- const metadataTs = path.resolve(translation, "metadata.ts");
6218
+ const metadataTs = path.resolve(translation2, "metadata.ts");
6130
6219
  if (existsSync(metadataTs)) {
6131
6220
  const importPath = new URL("file://" + metadataTs).href;
6132
6221
  return (await import(importPath)).default;
6133
6222
  } else {
6134
- const metadataJson = path.resolve(translation, "meta.json");
6223
+ const metadataJson = path.resolve(translation2, "meta.json");
6135
6224
  if (existsSync(metadataJson)) {
6136
6225
  const data = await readFile(metadataJson, { encoding: "utf-8" });
6137
6226
  const metadata = JSON.parse(data);
@@ -6146,7 +6235,7 @@ async function loadTranslationMetadata(translation) {
6146
6235
  direction: metadata.direction
6147
6236
  };
6148
6237
  } else {
6149
- const metadataJson2 = path.resolve(translation, "metadata.json");
6238
+ const metadataJson2 = path.resolve(translation2, "metadata.json");
6150
6239
  if (existsSync(metadataJson2)) {
6151
6240
  const data = await readFile(metadataJson2, {
6152
6241
  encoding: "utf-8"
@@ -6155,16 +6244,16 @@ async function loadTranslationMetadata(translation) {
6155
6244
  }
6156
6245
  }
6157
6246
  }
6158
- logger.error("Could not find metadata for translation!", translation);
6247
+ logger.error("Could not find metadata for translation!", translation2);
6159
6248
  return null;
6160
6249
  }
6161
- async function loadCommentaryMetadata(commentary) {
6250
+ async function loadCommentaryMetadata(commentary2) {
6162
6251
  const logger = log.getLogger();
6163
- const metadataTs = path.resolve(commentary, "metadata.ts");
6252
+ const metadataTs = path.resolve(commentary2, "metadata.ts");
6164
6253
  if (existsSync(metadataTs)) {
6165
6254
  return (await import(metadataTs)).default;
6166
6255
  } else {
6167
- const metadataJson = path.resolve(commentary, "metadata.json");
6256
+ const metadataJson = path.resolve(commentary2, "metadata.json");
6168
6257
  if (existsSync(metadataJson)) {
6169
6258
  const data = await readFile(metadataJson, {
6170
6259
  encoding: "utf-8"
@@ -6172,28 +6261,31 @@ async function loadCommentaryMetadata(commentary) {
6172
6261
  return JSON.parse(data);
6173
6262
  }
6174
6263
  }
6175
- logger.error("Could not find metadata for commentary!", commentary);
6264
+ logger.error("Could not find metadata for commentary!", commentary2);
6176
6265
  return null;
6177
6266
  }
6178
- function getFileType(ext) {
6179
- switch (ext) {
6180
- case "usfm":
6181
- return "usfm";
6182
- case "usx":
6183
- return "usx";
6184
- case "json":
6185
- return "json";
6186
- case "codex":
6187
- return "json";
6188
- default:
6189
- return null;
6267
+ function getFileType(path5) {
6268
+ if (path5.endsWith(".lockman.txt")) {
6269
+ return "lockman";
6270
+ } else if (extname(path5) === ".usfm") {
6271
+ return "usfm";
6272
+ } else if (extname(path5) === ".usx") {
6273
+ return "usx";
6274
+ } else if (extname(path5) === ".json") {
6275
+ return "json";
6276
+ } else if (extname(path5) === ".codex") {
6277
+ return "json";
6278
+ } else {
6279
+ return null;
6190
6280
  }
6191
6281
  }
6192
6282
  async function loadFile(fileType, file, metadata) {
6193
6283
  const content = await readFile(file, {
6194
6284
  encoding: "utf-8"
6195
6285
  });
6196
- const hash = sha256().update(content).update(PARSER_VERSION).digest("hex");
6286
+ const hash = sha256().update(content).update(
6287
+ (fileType === "lockman" ? LOCKMAN_PARSER_VERSION : PARSER_VERSION) + DATASET_VERSION
6288
+ ).digest("hex");
6197
6289
  return {
6198
6290
  content,
6199
6291
  metadata,
@@ -6431,6 +6523,7 @@ function insertTranslations(db, translations) {
6431
6523
  textDirection,
6432
6524
  licenseUrl,
6433
6525
  licenseNotes,
6526
+ licenseNotice,
6434
6527
  website,
6435
6528
  englishName
6436
6529
  ) VALUES (
@@ -6441,6 +6534,7 @@ function insertTranslations(db, translations) {
6441
6534
  @textDirection,
6442
6535
  @licenseUrl,
6443
6536
  @licenseNotes,
6537
+ @licenseNotice,
6444
6538
  @website,
6445
6539
  @englishName
6446
6540
  ) ON CONFLICT(id) DO
@@ -6451,31 +6545,33 @@ function insertTranslations(db, translations) {
6451
6545
  textDirection=excluded.textDirection,
6452
6546
  licenseUrl=excluded.licenseUrl,
6453
6547
  licenseNotes=excluded.licenseNotes,
6548
+ licenseNotice=excluded.licenseNotice,
6454
6549
  website=excluded.website,
6455
6550
  englishName=excluded.englishName;`);
6456
6551
  const insertManyTranslations = db.transaction(
6457
6552
  (translations2) => {
6458
- for (let translation of translations2) {
6553
+ for (let translation2 of translations2) {
6459
6554
  translationUpsert.run({
6460
- id: translation.id,
6461
- name: translation.name,
6462
- language: translation.language,
6463
- shortName: translation.shortName,
6464
- textDirection: translation.textDirection,
6465
- licenseUrl: translation.licenseUrl,
6466
- licenseNotes: translation.licenseNotes,
6467
- website: translation.website,
6468
- englishName: translation.englishName
6555
+ id: translation2.id,
6556
+ name: translation2.name,
6557
+ language: translation2.language,
6558
+ shortName: translation2.shortName,
6559
+ textDirection: translation2.textDirection,
6560
+ licenseUrl: translation2.licenseUrl,
6561
+ licenseNotes: translation2.licenseNotes,
6562
+ licenseNotice: translation2.licenseNotice,
6563
+ website: translation2.website,
6564
+ englishName: translation2.englishName
6469
6565
  });
6470
6566
  }
6471
6567
  }
6472
6568
  );
6473
6569
  insertManyTranslations(translations);
6474
- for (let translation of translations) {
6475
- insertTranslationBooks(db, translation, translation.books);
6570
+ for (let translation2 of translations) {
6571
+ insertTranslationBooks(db, translation2, translation2.books);
6476
6572
  }
6477
6573
  }
6478
- function insertTranslationBooks(db, translation, translationBooks) {
6574
+ function insertTranslationBooks(db, translation2, translationBooks) {
6479
6575
  const bookUpsert = db.prepare(`INSERT INTO Book(
6480
6576
  id,
6481
6577
  translationId,
@@ -6502,28 +6598,28 @@ function insertTranslationBooks(db, translation, translationBooks) {
6502
6598
  numberOfChapters=excluded.numberOfChapters,
6503
6599
  isApocryphal=excluded.isApocryphal;`);
6504
6600
  const insertMany = db.transaction((books) => {
6505
- for (let book of books) {
6506
- if (!book) {
6601
+ for (let book2 of books) {
6602
+ if (!book2) {
6507
6603
  continue;
6508
6604
  }
6509
6605
  bookUpsert.run({
6510
- id: book.id,
6511
- translationId: translation.id,
6512
- title: book.title,
6513
- name: book.name,
6514
- commonName: book.commonName,
6515
- numberOfChapters: book.chapters.length,
6516
- bookOrder: book.order ?? 9999,
6517
- isApocryphal: Number(book.isApocryphal ?? false)
6606
+ id: book2.id,
6607
+ translationId: translation2.id,
6608
+ title: book2.title,
6609
+ name: book2.name,
6610
+ commonName: book2.commonName,
6611
+ numberOfChapters: book2.chapters.length,
6612
+ bookOrder: book2.order ?? 9999,
6613
+ isApocryphal: Number(book2.isApocryphal ?? false)
6518
6614
  });
6519
6615
  }
6520
6616
  });
6521
6617
  insertMany(translationBooks);
6522
- for (let book of translationBooks) {
6523
- insertTranslationContent(db, translation, book, book.chapters);
6618
+ for (let book2 of translationBooks) {
6619
+ insertTranslationContent(db, translation2, book2, book2.chapters);
6524
6620
  }
6525
6621
  }
6526
- function insertTranslationContent(db, translation, book, chapters) {
6622
+ function insertTranslationContent(db, translation2, book2, chapters) {
6527
6623
  const logger = log2.getLogger();
6528
6624
  const chapterUpsert = db.prepare(`INSERT INTO Chapter(
6529
6625
  translationId,
@@ -6590,24 +6686,24 @@ function insertTranslationContent(db, translation, book, chapters) {
6590
6686
  UPDATE SET
6591
6687
  url=excluded.url;`);
6592
6688
  const insertChaptersAndVerses = db.transaction(() => {
6593
- for (let chapter of chapters) {
6689
+ for (let chapter2 of chapters) {
6594
6690
  let verses = [];
6595
6691
  let footnotes = /* @__PURE__ */ new Map();
6596
- for (let c of chapter.chapter.footnotes) {
6692
+ for (let c of chapter2.chapter.footnotes) {
6597
6693
  footnotes.set(c.noteId, {
6598
6694
  id: c.noteId,
6599
6695
  text: c.text
6600
6696
  });
6601
6697
  }
6602
- for (let c of chapter.chapter.content) {
6698
+ for (let c of chapter2.chapter.content) {
6603
6699
  if (c.type === "verse") {
6604
6700
  const verse = c;
6605
6701
  if (!verse.number) {
6606
6702
  logger.error(
6607
6703
  "Verse missing number",
6608
- translation.id,
6609
- book.id,
6610
- chapter.chapter.number,
6704
+ translation2.id,
6705
+ book2.id,
6706
+ chapter2.chapter.number,
6611
6707
  verse.number
6612
6708
  );
6613
6709
  continue;
@@ -6638,16 +6734,16 @@ function insertTranslationContent(db, translation, book, chapters) {
6638
6734
  }
6639
6735
  }
6640
6736
  chapterUpsert.run({
6641
- translationId: translation.id,
6642
- bookId: book.id,
6643
- number: chapter.chapter.number,
6644
- json: JSON.stringify(chapter.chapter)
6737
+ translationId: translation2.id,
6738
+ bookId: book2.id,
6739
+ number: chapter2.chapter.number,
6740
+ json: JSON.stringify(chapter2.chapter)
6645
6741
  });
6646
6742
  for (let verse of verses) {
6647
6743
  verseUpsert.run({
6648
- translationId: translation.id,
6649
- bookId: book.id,
6650
- chapterNumber: chapter.chapter.number,
6744
+ translationId: translation2.id,
6745
+ bookId: book2.id,
6746
+ chapterNumber: chapter2.chapter.number,
6651
6747
  number: verse.number,
6652
6748
  text: verse.text,
6653
6749
  contentJson: verse.contentJson
@@ -6655,21 +6751,21 @@ function insertTranslationContent(db, translation, book, chapters) {
6655
6751
  }
6656
6752
  for (let footnote of footnotes.values()) {
6657
6753
  footnoteUpsert.run({
6658
- translationId: translation.id,
6659
- bookId: book.id,
6660
- chapterNumber: chapter.chapter.number,
6754
+ translationId: translation2.id,
6755
+ bookId: book2.id,
6756
+ chapterNumber: chapter2.chapter.number,
6661
6757
  id: footnote.id,
6662
6758
  verseNumber: footnote.verseNumber,
6663
6759
  text: footnote.text
6664
6760
  });
6665
6761
  }
6666
- for (let reader in chapter.thisChapterAudioLinks) {
6667
- const url = chapter.thisChapterAudioLinks[reader];
6762
+ for (let reader in chapter2.thisChapterAudioLinks) {
6763
+ const url = chapter2.thisChapterAudioLinks[reader];
6668
6764
  if (url) {
6669
6765
  chapterAudioUpsert.run({
6670
- translationId: translation.id,
6671
- bookId: book.id,
6672
- number: chapter.chapter.number,
6766
+ translationId: translation2.id,
6767
+ bookId: book2.id,
6768
+ number: chapter2.chapter.number,
6673
6769
  reader,
6674
6770
  url
6675
6771
  });
@@ -6695,53 +6791,53 @@ function updateTranslationHashes(db, translations) {
6695
6791
  const getChapters = db.prepare(
6696
6792
  "SELECT * FROM Chapter WHERE translationId = @translationId AND bookId = @bookId;"
6697
6793
  );
6698
- for (let translation of translations) {
6699
- const translationSha = sha2562().update(translation.id).update(translation.name).update(translation.language).update(translation.licenseUrl).update(translation.textDirection).update(translation.website).update(translation.englishName).update(translation.shortName);
6700
- const books = getBooks.all(translation.id);
6701
- for (let book of books) {
6794
+ for (let translation2 of translations) {
6795
+ const translationSha = sha2562().update(translation2.id).update(translation2.name).update(translation2.language).update(translation2.licenseUrl).update(translation2.textDirection).update(translation2.website).update(translation2.englishName).update(translation2.shortName);
6796
+ const books = getBooks.all(translation2.id);
6797
+ for (let book2 of books) {
6702
6798
  const chapters = getChapters.all({
6703
- translationId: translation.id,
6704
- bookId: book.id
6799
+ translationId: translation2.id,
6800
+ bookId: book2.id
6705
6801
  });
6706
- const bookSha = sha2562().update(book.translationId).update(book.id).update(book.numberOfChapters).update(book.order).update(book.name).update(book.title).update(book.commonName);
6707
- for (let chapter of chapters) {
6708
- const hash2 = sha2562().update(chapter.translationId).update(chapter.bookId).update(chapter.number).update(chapter.json).digest("hex");
6709
- chapter.sha256 = hash2;
6802
+ const bookSha = sha2562().update(book2.translationId).update(book2.id).update(book2.numberOfChapters).update(book2.order).update(book2.name).update(book2.title).update(book2.commonName);
6803
+ for (let chapter2 of chapters) {
6804
+ const hash2 = sha2562().update(chapter2.translationId).update(chapter2.bookId).update(chapter2.number).update(chapter2.json).digest("hex");
6805
+ chapter2.sha256 = hash2;
6710
6806
  bookSha.update(hash2);
6711
6807
  }
6712
6808
  const updateChapters = db.transaction(() => {
6713
- for (let chapter of chapters) {
6809
+ for (let chapter2 of chapters) {
6714
6810
  updateChapterHash.run({
6715
- sha256: chapter.sha256,
6716
- translationId: chapter.translationId,
6717
- bookId: chapter.bookId,
6718
- chapterNumber: chapter.number
6811
+ sha256: chapter2.sha256,
6812
+ translationId: chapter2.translationId,
6813
+ bookId: chapter2.bookId,
6814
+ chapterNumber: chapter2.number
6719
6815
  });
6720
6816
  }
6721
6817
  });
6722
6818
  updateChapters();
6723
6819
  const bookHash = bookSha.digest("hex");
6724
- book.sha256 = bookHash;
6820
+ book2.sha256 = bookHash;
6725
6821
  translationSha.update(bookHash);
6726
6822
  }
6727
6823
  const updateBooks = db.transaction(() => {
6728
- for (let book of books) {
6824
+ for (let book2 of books) {
6729
6825
  updateBookHash.run({
6730
- sha256: book.sha256,
6731
- translationId: book.translationId,
6732
- bookId: book.id
6826
+ sha256: book2.sha256,
6827
+ translationId: book2.translationId,
6828
+ bookId: book2.id
6733
6829
  });
6734
6830
  }
6735
6831
  });
6736
6832
  updateBooks();
6737
6833
  const hash = translationSha.digest("hex");
6738
- translation.sha256 = hash;
6834
+ translation2.sha256 = hash;
6739
6835
  }
6740
6836
  const updateTranslations = db.transaction(() => {
6741
- for (let translation of translations) {
6837
+ for (let translation2 of translations) {
6742
6838
  updateTranslationHash.run({
6743
- sha256: translation.sha256,
6744
- translationId: translation.id
6839
+ sha256: translation2.sha256,
6840
+ translationId: translation2.id
6745
6841
  });
6746
6842
  }
6747
6843
  });
@@ -6778,27 +6874,27 @@ function insertCommentaries(db, commentaries) {
6778
6874
  englishName=excluded.englishName;`);
6779
6875
  const insertManyTranslations = db.transaction(
6780
6876
  (commentaries2) => {
6781
- for (let commentary of commentaries2) {
6877
+ for (let commentary2 of commentaries2) {
6782
6878
  translationUpsert.run({
6783
- id: commentary.id,
6784
- name: commentary.name,
6785
- language: commentary.language,
6786
- textDirection: commentary.textDirection,
6787
- licenseUrl: commentary.licenseUrl,
6788
- licenseNotes: commentary.licenseNotes,
6789
- website: commentary.website,
6790
- englishName: commentary.englishName
6879
+ id: commentary2.id,
6880
+ name: commentary2.name,
6881
+ language: commentary2.language,
6882
+ textDirection: commentary2.textDirection,
6883
+ licenseUrl: commentary2.licenseUrl,
6884
+ licenseNotes: commentary2.licenseNotes,
6885
+ website: commentary2.website,
6886
+ englishName: commentary2.englishName
6791
6887
  });
6792
6888
  }
6793
6889
  }
6794
6890
  );
6795
6891
  insertManyTranslations(commentaries);
6796
- for (let commentary of commentaries) {
6797
- insertCommentaryBooks(db, commentary, commentary.books);
6798
- insertCommentaryProfiles(db, commentary, commentary.profiles);
6892
+ for (let commentary2 of commentaries) {
6893
+ insertCommentaryBooks(db, commentary2, commentary2.books);
6894
+ insertCommentaryProfiles(db, commentary2, commentary2.profiles);
6799
6895
  }
6800
6896
  }
6801
- function insertCommentaryBooks(db, commentary, commentaryBooks) {
6897
+ function insertCommentaryBooks(db, commentary2, commentaryBooks) {
6802
6898
  const bookUpsert = db.prepare(`INSERT INTO CommentaryBook(
6803
6899
  id,
6804
6900
  commentaryId,
@@ -6825,28 +6921,28 @@ function insertCommentaryBooks(db, commentary, commentaryBooks) {
6825
6921
  commonName=excluded.commonName,
6826
6922
  numberOfChapters=excluded.numberOfChapters;`);
6827
6923
  const insertMany = db.transaction((books) => {
6828
- for (let book of books) {
6829
- if (!book) {
6924
+ for (let book2 of books) {
6925
+ if (!book2) {
6830
6926
  continue;
6831
6927
  }
6832
6928
  bookUpsert.run({
6833
- id: book.id,
6834
- commentaryId: commentary.id,
6835
- introduction: book.introduction ?? null,
6836
- introductionSummary: book.introductionSummary ?? null,
6837
- name: book.name,
6838
- commonName: book.commonName,
6839
- numberOfChapters: book.chapters.length,
6840
- bookOrder: book.order ?? 9999
6929
+ id: book2.id,
6930
+ commentaryId: commentary2.id,
6931
+ introduction: book2.introduction ?? null,
6932
+ introductionSummary: book2.introductionSummary ?? null,
6933
+ name: book2.name,
6934
+ commonName: book2.commonName,
6935
+ numberOfChapters: book2.chapters.length,
6936
+ bookOrder: book2.order ?? 9999
6841
6937
  });
6842
6938
  }
6843
6939
  });
6844
6940
  insertMany(commentaryBooks);
6845
- for (let book of commentaryBooks) {
6846
- insertCommentaryContent(db, commentary, book, book.chapters);
6941
+ for (let book2 of commentaryBooks) {
6942
+ insertCommentaryContent(db, commentary2, book2, book2.chapters);
6847
6943
  }
6848
6944
  }
6849
- function insertCommentaryProfiles(db, commentary, commentaryProfiles) {
6945
+ function insertCommentaryProfiles(db, commentary2, commentaryProfiles) {
6850
6946
  const profileUpsert = db.prepare(`INSERT INTO CommentaryProfile(
6851
6947
  id,
6852
6948
  commentaryId,
@@ -6886,7 +6982,7 @@ function insertCommentaryProfiles(db, commentary, commentaryProfiles) {
6886
6982
  }
6887
6983
  profileUpsert.run({
6888
6984
  id: profile.id,
6889
- commentaryId: commentary.id,
6985
+ commentaryId: commentary2.id,
6890
6986
  subject: profile.subject,
6891
6987
  content: profile.content.join("\n"),
6892
6988
  referenceBook: profile.reference?.book ?? null,
@@ -6901,7 +6997,7 @@ function insertCommentaryProfiles(db, commentary, commentaryProfiles) {
6901
6997
  );
6902
6998
  insertMany(commentaryProfiles);
6903
6999
  }
6904
- function insertCommentaryContent(db, commentary, book, chapters) {
7000
+ function insertCommentaryContent(db, commentary2, book2, chapters) {
6905
7001
  const logger = log2.getLogger();
6906
7002
  const chapterUpsert = db.prepare(`INSERT INTO CommentaryChapter(
6907
7003
  commentaryId,
@@ -6938,17 +7034,17 @@ function insertCommentaryContent(db, commentary, book, chapters) {
6938
7034
  text=excluded.text,
6939
7035
  contentJson=excluded.contentJson;`);
6940
7036
  const insertChaptersAndVerses = db.transaction(() => {
6941
- for (let chapter of chapters) {
7037
+ for (let chapter2 of chapters) {
6942
7038
  let verses = [];
6943
- for (let c of chapter.chapter.content) {
7039
+ for (let c of chapter2.chapter.content) {
6944
7040
  if (c.type === "verse") {
6945
7041
  const verse = c;
6946
7042
  if (!verse.number) {
6947
7043
  logger.error(
6948
7044
  "Verse missing number",
6949
- commentary.id,
6950
- book.id,
6951
- chapter.chapter.number,
7045
+ commentary2.id,
7046
+ book2.id,
7047
+ chapter2.chapter.number,
6952
7048
  verse.number
6953
7049
  );
6954
7050
  continue;
@@ -6974,17 +7070,17 @@ function insertCommentaryContent(db, commentary, book, chapters) {
6974
7070
  }
6975
7071
  }
6976
7072
  chapterUpsert.run({
6977
- commentaryId: commentary.id,
6978
- bookId: book.id,
6979
- number: chapter.chapter.number,
6980
- introduction: chapter.chapter.introduction ?? null,
6981
- json: JSON.stringify(chapter.chapter)
7073
+ commentaryId: commentary2.id,
7074
+ bookId: book2.id,
7075
+ number: chapter2.chapter.number,
7076
+ introduction: chapter2.chapter.introduction ?? null,
7077
+ json: JSON.stringify(chapter2.chapter)
6982
7078
  });
6983
7079
  for (let verse of verses) {
6984
7080
  verseUpsert.run({
6985
- commentaryId: commentary.id,
6986
- bookId: book.id,
6987
- chapterNumber: chapter.chapter.number,
7081
+ commentaryId: commentary2.id,
7082
+ bookId: book2.id,
7083
+ chapterNumber: chapter2.chapter.number,
6988
7084
  number: verse.number,
6989
7085
  text: verse.text,
6990
7086
  contentJson: verse.contentJson
@@ -7018,46 +7114,46 @@ function updateCommentaryHashes(db, commentaries) {
7018
7114
  const getProfiles = db.prepare(
7019
7115
  "SELECT * FROM CommentaryProfile WHERE commentaryId = ?;"
7020
7116
  );
7021
- for (let commentary of commentaries) {
7022
- const commentarySha = sha2562().update(commentary.id).update(commentary.name).update(commentary.language).update(commentary.licenseUrl).update(commentary.textDirection).update(commentary.website).update(commentary.englishName);
7023
- const books = getBooks.all(commentary.id);
7024
- for (let book of books) {
7117
+ for (let commentary2 of commentaries) {
7118
+ const commentarySha = sha2562().update(commentary2.id).update(commentary2.name).update(commentary2.language).update(commentary2.licenseUrl).update(commentary2.textDirection).update(commentary2.website).update(commentary2.englishName);
7119
+ const books = getBooks.all(commentary2.id);
7120
+ for (let book2 of books) {
7025
7121
  const chapters = getChapters.all({
7026
- commentaryId: commentary.id,
7027
- bookId: book.id
7122
+ commentaryId: commentary2.id,
7123
+ bookId: book2.id
7028
7124
  });
7029
- const bookSha = sha2562().update(book.commentaryId).update(book.id).update(book.numberOfChapters).update(book.order).update(book.name).update(book.title).update(book.commonName).update(book.introduction);
7030
- for (let chapter of chapters) {
7031
- const hash2 = sha2562().update(chapter.commentaryId).update(chapter.bookId).update(chapter.number).update(chapter.introduction).update(chapter.json).digest("hex");
7032
- chapter.sha256 = hash2;
7125
+ const bookSha = sha2562().update(book2.commentaryId).update(book2.id).update(book2.numberOfChapters).update(book2.order).update(book2.name).update(book2.title).update(book2.commonName).update(book2.introduction);
7126
+ for (let chapter2 of chapters) {
7127
+ const hash2 = sha2562().update(chapter2.commentaryId).update(chapter2.bookId).update(chapter2.number).update(chapter2.introduction).update(chapter2.json).digest("hex");
7128
+ chapter2.sha256 = hash2;
7033
7129
  bookSha.update(hash2);
7034
7130
  }
7035
7131
  const updateChapters = db.transaction(() => {
7036
- for (let chapter of chapters) {
7132
+ for (let chapter2 of chapters) {
7037
7133
  updateChapterHash.run({
7038
- sha256: chapter.sha256,
7039
- commentaryId: chapter.commentaryId,
7040
- bookId: chapter.bookId,
7041
- chapterNumber: chapter.number
7134
+ sha256: chapter2.sha256,
7135
+ commentaryId: chapter2.commentaryId,
7136
+ bookId: chapter2.bookId,
7137
+ chapterNumber: chapter2.number
7042
7138
  });
7043
7139
  }
7044
7140
  });
7045
7141
  updateChapters();
7046
7142
  const bookHash = bookSha.digest("hex");
7047
- book.sha256 = bookHash;
7143
+ book2.sha256 = bookHash;
7048
7144
  commentarySha.update(bookHash);
7049
7145
  }
7050
7146
  const updateBooks = db.transaction(() => {
7051
- for (let book of books) {
7147
+ for (let book2 of books) {
7052
7148
  updateBookHash.run({
7053
- sha256: book.sha256,
7054
- commentaryId: book.commentaryId,
7055
- bookId: book.id
7149
+ sha256: book2.sha256,
7150
+ commentaryId: book2.commentaryId,
7151
+ bookId: book2.id
7056
7152
  });
7057
7153
  }
7058
7154
  });
7059
7155
  updateBooks();
7060
- const profiles = getProfiles.all(commentary.id);
7156
+ const profiles = getProfiles.all(commentary2.id);
7061
7157
  for (let profile of profiles) {
7062
7158
  const profileSha = sha2562().update(profile.commentaryId).update(profile.id).update(profile.subject).update(profile.content).update(profile.referenceBook).update(profile.referenceChapter).update(profile.referenceVerse).update(profile.referenceEndChapter).update(profile.referenceEndVerse);
7063
7159
  profile.sha256 = profileSha.digest("hex");
@@ -7073,13 +7169,13 @@ function updateCommentaryHashes(db, commentaries) {
7073
7169
  });
7074
7170
  updateProfiles();
7075
7171
  const hash = commentarySha.digest("hex");
7076
- commentary.sha256 = hash;
7172
+ commentary2.sha256 = hash;
7077
7173
  }
7078
7174
  const updateCommentaries = db.transaction(() => {
7079
- for (let commentary of commentaries) {
7175
+ for (let commentary2 of commentaries) {
7080
7176
  updateTranslationHash.run({
7081
- sha256: commentary.sha256,
7082
- commentaryId: commentary.id
7177
+ sha256: commentary2.sha256,
7178
+ commentaryId: commentary2.id
7083
7179
  });
7084
7180
  }
7085
7181
  });
@@ -7116,16 +7212,16 @@ function insertDatasets(db, datasets) {
7116
7212
  englishName=excluded.englishName;`);
7117
7213
  const insertManyTranslations = db.transaction(
7118
7214
  (datasets2) => {
7119
- for (let dataset of datasets2) {
7215
+ for (let dataset2 of datasets2) {
7120
7216
  translationUpsert.run({
7121
- id: dataset.id,
7122
- name: dataset.name,
7123
- language: dataset.language,
7124
- textDirection: dataset.textDirection,
7125
- licenseUrl: dataset.licenseUrl,
7126
- licenseNotes: dataset.licenseNotes,
7127
- website: dataset.website,
7128
- englishName: dataset.englishName
7217
+ id: dataset2.id,
7218
+ name: dataset2.name,
7219
+ language: dataset2.language,
7220
+ textDirection: dataset2.textDirection,
7221
+ licenseUrl: dataset2.licenseUrl,
7222
+ licenseNotes: dataset2.licenseNotes,
7223
+ website: dataset2.website,
7224
+ englishName: dataset2.englishName
7129
7225
  });
7130
7226
  }
7131
7227
  }
@@ -7133,14 +7229,14 @@ function insertDatasets(db, datasets) {
7133
7229
  insertManyTranslations(datasets);
7134
7230
  const deleteReferences = db.prepare(`DELETE FROM DatasetReference
7135
7231
  WHERE datasetId = @datasetId;`);
7136
- for (let dataset of datasets) {
7232
+ for (let dataset2 of datasets) {
7137
7233
  deleteReferences.run({
7138
- datasetId: dataset.id
7234
+ datasetId: dataset2.id
7139
7235
  });
7140
- insertDatasetBooks(db, dataset, dataset.books);
7236
+ insertDatasetBooks(db, dataset2, dataset2.books);
7141
7237
  }
7142
7238
  }
7143
- function insertDatasetBooks(db, dataset, datasetBooks) {
7239
+ function insertDatasetBooks(db, dataset2, datasetBooks) {
7144
7240
  const bookUpsert = db.prepare(`INSERT INTO DatasetBook(
7145
7241
  id,
7146
7242
  datasetId,
@@ -7155,24 +7251,24 @@ function insertDatasetBooks(db, dataset, datasetBooks) {
7155
7251
  UPDATE SET
7156
7252
  numberOfChapters=excluded.numberOfChapters;`);
7157
7253
  const insertMany = db.transaction((books) => {
7158
- for (let book of books) {
7159
- if (!book) {
7254
+ for (let book2 of books) {
7255
+ if (!book2) {
7160
7256
  continue;
7161
7257
  }
7162
7258
  bookUpsert.run({
7163
- id: book.id,
7164
- datasetId: dataset.id,
7165
- numberOfChapters: book.chapters.length,
7166
- bookOrder: book.order ?? 9999
7259
+ id: book2.id,
7260
+ datasetId: dataset2.id,
7261
+ numberOfChapters: book2.chapters.length,
7262
+ bookOrder: book2.order ?? 9999
7167
7263
  });
7168
7264
  }
7169
7265
  });
7170
7266
  insertMany(datasetBooks);
7171
- for (let book of datasetBooks) {
7172
- insertDatasetContent(db, dataset, book, book.chapters);
7267
+ for (let book2 of datasetBooks) {
7268
+ insertDatasetContent(db, dataset2, book2, book2.chapters);
7173
7269
  }
7174
7270
  }
7175
- function insertDatasetContent(db, dataset, book, chapters) {
7271
+ function insertDatasetContent(db, dataset2, book2, chapters) {
7176
7272
  const logger = log2.getLogger();
7177
7273
  const chapterUpsert = db.prepare(`INSERT INTO DatasetChapter(
7178
7274
  datasetId,
@@ -7224,26 +7320,26 @@ function insertDatasetContent(db, dataset, book, chapters) {
7224
7320
  @score
7225
7321
  );`);
7226
7322
  const insertChaptersAndVerses = db.transaction(() => {
7227
- for (let chapter of chapters) {
7323
+ for (let chapter2 of chapters) {
7228
7324
  chapterUpsert.run({
7229
- datasetId: dataset.id,
7230
- bookId: book.id,
7231
- number: chapter.chapter.number,
7232
- json: JSON.stringify(chapter.chapter)
7325
+ datasetId: dataset2.id,
7326
+ bookId: book2.id,
7327
+ number: chapter2.chapter.number,
7328
+ json: JSON.stringify(chapter2.chapter)
7233
7329
  });
7234
- for (let verse of chapter.chapter.content) {
7330
+ for (let verse of chapter2.chapter.content) {
7235
7331
  verseUpsert.run({
7236
- datasetId: dataset.id,
7237
- bookId: book.id,
7238
- chapterNumber: chapter.chapter.number,
7332
+ datasetId: dataset2.id,
7333
+ bookId: book2.id,
7334
+ chapterNumber: chapter2.chapter.number,
7239
7335
  number: verse.verse,
7240
7336
  contentJson: JSON.stringify(verse)
7241
7337
  });
7242
7338
  for (let ref of verse.references) {
7243
7339
  referenceInsert.run({
7244
- datasetId: dataset.id,
7245
- bookId: book.id,
7246
- chapterNumber: chapter.chapter.number,
7340
+ datasetId: dataset2.id,
7341
+ bookId: book2.id,
7342
+ chapterNumber: chapter2.chapter.number,
7247
7343
  verseNumber: verse.verse,
7248
7344
  referenceBookId: ref.book,
7249
7345
  referenceChapter: ref.chapter,
@@ -7275,53 +7371,53 @@ function updateDatasetHashes(db, datasets) {
7275
7371
  const getChapters = db.prepare(
7276
7372
  "SELECT * FROM DatasetChapter WHERE datasetId = @datasetId AND bookId = @bookId;"
7277
7373
  );
7278
- for (let dataset of datasets) {
7279
- const commentarySha = sha2562().update(dataset.id).update(dataset.name).update(dataset.language).update(dataset.licenseUrl).update(dataset.textDirection).update(dataset.website).update(dataset.englishName);
7280
- const books = getBooks.all(dataset.id);
7281
- for (let book of books) {
7374
+ for (let dataset2 of datasets) {
7375
+ const commentarySha = sha2562().update(dataset2.id).update(dataset2.name).update(dataset2.language).update(dataset2.licenseUrl).update(dataset2.textDirection).update(dataset2.website).update(dataset2.englishName);
7376
+ const books = getBooks.all(dataset2.id);
7377
+ for (let book2 of books) {
7282
7378
  const chapters = getChapters.all({
7283
- datasetId: dataset.id,
7284
- bookId: book.id
7379
+ datasetId: dataset2.id,
7380
+ bookId: book2.id
7285
7381
  });
7286
- const bookSha = sha2562().update(book.datasetId).update(book.id).update(book.numberOfChapters).update(book.order);
7287
- for (let chapter of chapters) {
7288
- const hash2 = sha2562().update(chapter.datasetId).update(chapter.bookId).update(chapter.number).update(chapter.json).digest("hex");
7289
- chapter.sha256 = hash2;
7382
+ const bookSha = sha2562().update(book2.datasetId).update(book2.id).update(book2.numberOfChapters).update(book2.order);
7383
+ for (let chapter2 of chapters) {
7384
+ const hash2 = sha2562().update(chapter2.datasetId).update(chapter2.bookId).update(chapter2.number).update(chapter2.json).digest("hex");
7385
+ chapter2.sha256 = hash2;
7290
7386
  bookSha.update(hash2);
7291
7387
  }
7292
7388
  const updateChapters = db.transaction(() => {
7293
- for (let chapter of chapters) {
7389
+ for (let chapter2 of chapters) {
7294
7390
  updateChapterHash.run({
7295
- sha256: chapter.sha256,
7296
- datasetId: chapter.datasetId,
7297
- bookId: chapter.bookId,
7298
- chapterNumber: chapter.number
7391
+ sha256: chapter2.sha256,
7392
+ datasetId: chapter2.datasetId,
7393
+ bookId: chapter2.bookId,
7394
+ chapterNumber: chapter2.number
7299
7395
  });
7300
7396
  }
7301
7397
  });
7302
7398
  updateChapters();
7303
7399
  const bookHash = bookSha.digest("hex");
7304
- book.sha256 = bookHash;
7400
+ book2.sha256 = bookHash;
7305
7401
  commentarySha.update(bookHash);
7306
7402
  }
7307
7403
  const updateBooks = db.transaction(() => {
7308
- for (let book of books) {
7404
+ for (let book2 of books) {
7309
7405
  updateBookHash.run({
7310
- sha256: book.sha256,
7311
- datasetId: book.datasetId,
7312
- bookId: book.id
7406
+ sha256: book2.sha256,
7407
+ datasetId: book2.datasetId,
7408
+ bookId: book2.id
7313
7409
  });
7314
7410
  }
7315
7411
  });
7316
7412
  updateBooks();
7317
7413
  const hash = commentarySha.digest("hex");
7318
- dataset.sha256 = hash;
7414
+ dataset2.sha256 = hash;
7319
7415
  }
7320
7416
  const updateDatasets = db.transaction(() => {
7321
- for (let dataset of datasets) {
7417
+ for (let dataset2 of datasets) {
7322
7418
  updateTranslationHash.run({
7323
- sha256: dataset.sha256,
7324
- datasetId: dataset.id
7419
+ sha256: dataset2.sha256,
7420
+ datasetId: dataset2.id
7325
7421
  });
7326
7422
  }
7327
7423
  });
@@ -7338,7 +7434,9 @@ function getDbPath(p) {
7338
7434
  }
7339
7435
  return getDbPathFromDir(process.cwd());
7340
7436
  }
7341
- function getPrismaDb(path5) {
7437
+ async function getPrismaDb(path5) {
7438
+ const db = await getDb(path5);
7439
+ db.close();
7342
7440
  const dbPath = getDbPath(path5);
7343
7441
  console.log("Opening database at", dbPath);
7344
7442
  const prisma = new import_prisma_gen.PrismaClient({
@@ -7454,31 +7552,40 @@ async function* loadTranslationDatasets(db, translationsPerBatch = 50, translati
7454
7552
  if (translations.length <= 0) {
7455
7553
  break;
7456
7554
  }
7457
- const dataset = {
7555
+ const dataset2 = {
7458
7556
  translations: [],
7459
7557
  commentaries: []
7460
7558
  };
7461
- for (let translation of translations) {
7559
+ const optionalTranslationKeys = [
7560
+ "licenseNotes",
7561
+ "licenseNotice"
7562
+ ];
7563
+ for (let translation2 of translations) {
7462
7564
  const datasetTranslation = {
7463
- ...translation,
7464
- shortName: translation.shortName,
7465
- textDirection: translation.textDirection,
7565
+ ...translation2,
7566
+ shortName: translation2.shortName,
7567
+ textDirection: translation2.textDirection,
7466
7568
  books: []
7467
7569
  };
7468
- dataset.translations.push(datasetTranslation);
7570
+ for (let key of optionalTranslationKeys) {
7571
+ if (!datasetTranslation[key]) {
7572
+ delete datasetTranslation[key];
7573
+ }
7574
+ }
7575
+ dataset2.translations.push(datasetTranslation);
7469
7576
  const books = await db.book.findMany({
7470
7577
  where: {
7471
- translationId: translation.id
7578
+ translationId: translation2.id
7472
7579
  },
7473
7580
  orderBy: {
7474
7581
  order: "asc"
7475
7582
  }
7476
7583
  });
7477
- for (let book of books) {
7584
+ for (let book2 of books) {
7478
7585
  const chapters = await db.chapter.findMany({
7479
7586
  where: {
7480
- translationId: translation.id,
7481
- bookId: book.id
7587
+ translationId: translation2.id,
7588
+ bookId: book2.id
7482
7589
  },
7483
7590
  orderBy: {
7484
7591
  number: "asc"
@@ -7486,17 +7593,17 @@ async function* loadTranslationDatasets(db, translationsPerBatch = 50, translati
7486
7593
  });
7487
7594
  const audioLinks = await db.chapterAudioUrl.findMany({
7488
7595
  where: {
7489
- translationId: translation.id,
7490
- bookId: book.id
7596
+ translationId: translation2.id,
7597
+ bookId: book2.id
7491
7598
  },
7492
7599
  orderBy: [{ number: "asc" }, { reader: "asc" }]
7493
7600
  });
7494
7601
  const bookChapters = chapters.map(
7495
- (chapter) => {
7602
+ (chapter2) => {
7496
7603
  return {
7497
- chapter: JSON.parse(chapter.json),
7604
+ chapter: JSON.parse(chapter2.json),
7498
7605
  thisChapterAudioLinks: audioLinks.filter(
7499
- (link) => link.number === chapter.number
7606
+ (link) => link.number === chapter2.number
7500
7607
  ).reduce((acc, link) => {
7501
7608
  acc[link.reader] = link.url;
7502
7609
  return acc;
@@ -7505,9 +7612,10 @@ async function* loadTranslationDatasets(db, translationsPerBatch = 50, translati
7505
7612
  }
7506
7613
  );
7507
7614
  const datasetBook = {
7508
- ...book,
7615
+ ...book2,
7616
+ id: book2.id,
7509
7617
  chapters: bookChapters,
7510
- isApocryphal: book.isApocryphal ?? false
7618
+ isApocryphal: book2.isApocryphal ?? false
7511
7619
  };
7512
7620
  if (!datasetBook.isApocryphal) {
7513
7621
  delete datasetBook.isApocryphal;
@@ -7515,7 +7623,7 @@ async function* loadTranslationDatasets(db, translationsPerBatch = 50, translati
7515
7623
  datasetTranslation.books.push(datasetBook);
7516
7624
  }
7517
7625
  }
7518
- yield dataset;
7626
+ yield dataset2;
7519
7627
  offset += pageSize;
7520
7628
  }
7521
7629
  }
@@ -7550,54 +7658,55 @@ async function* loadCommentaryDatasets(db, perBatch = 50, commentariesToLoad) {
7550
7658
  if (commentaries.length <= 0) {
7551
7659
  break;
7552
7660
  }
7553
- const dataset = {
7661
+ const dataset2 = {
7554
7662
  translations: [],
7555
7663
  commentaries: []
7556
7664
  };
7557
- for (let commentary of commentaries) {
7665
+ for (let commentary2 of commentaries) {
7558
7666
  const datasetCommentary = {
7559
- ...commentary,
7560
- textDirection: commentary.textDirection,
7667
+ ...commentary2,
7668
+ textDirection: commentary2.textDirection,
7561
7669
  books: [],
7562
7670
  profiles: []
7563
7671
  };
7564
- dataset.commentaries.push(datasetCommentary);
7672
+ dataset2.commentaries.push(datasetCommentary);
7565
7673
  const books = await db.commentaryBook.findMany({
7566
7674
  where: {
7567
- commentaryId: commentary.id
7675
+ commentaryId: commentary2.id
7568
7676
  },
7569
7677
  orderBy: {
7570
7678
  order: "asc"
7571
7679
  }
7572
7680
  });
7573
- for (let book of books) {
7681
+ for (let book2 of books) {
7574
7682
  const chapters = await db.commentaryChapter.findMany({
7575
7683
  where: {
7576
- commentaryId: commentary.id,
7577
- bookId: book.id
7684
+ commentaryId: commentary2.id,
7685
+ bookId: book2.id
7578
7686
  },
7579
7687
  orderBy: {
7580
7688
  number: "asc"
7581
7689
  }
7582
7690
  });
7583
7691
  const bookChapters = chapters.map(
7584
- (chapter) => {
7692
+ (chapter2) => {
7585
7693
  return {
7586
- chapter: JSON.parse(chapter.json)
7694
+ chapter: JSON.parse(chapter2.json)
7587
7695
  };
7588
7696
  }
7589
7697
  );
7590
7698
  const datasetBook = {
7591
- ...book,
7592
- introduction: book.introduction ?? void 0,
7593
- introductionSummary: book.introductionSummary ?? void 0,
7699
+ ...book2,
7700
+ id: book2.id,
7701
+ introduction: book2.introduction ?? void 0,
7702
+ introductionSummary: book2.introductionSummary ?? void 0,
7594
7703
  chapters: bookChapters
7595
7704
  };
7596
7705
  datasetCommentary.books.push(datasetBook);
7597
7706
  }
7598
7707
  const profiles = await db.commentaryProfile.findMany({
7599
7708
  where: {
7600
- commentaryId: commentary.id
7709
+ commentaryId: commentary2.id
7601
7710
  },
7602
7711
  orderBy: {
7603
7712
  id: "asc"
@@ -7608,7 +7717,7 @@ async function* loadCommentaryDatasets(db, perBatch = 50, commentariesToLoad) {
7608
7717
  datasetCommentary.profiles.push(JSON.parse(json));
7609
7718
  }
7610
7719
  }
7611
- yield dataset;
7720
+ yield dataset2;
7612
7721
  offset += pageSize;
7613
7722
  }
7614
7723
  }
@@ -7643,35 +7752,35 @@ async function* loadDatasetDatasets(db, perBatch = 50, datasetsToLoad) {
7643
7752
  commentaries: [],
7644
7753
  datasets: []
7645
7754
  };
7646
- for (let dataset of datasets) {
7755
+ for (let dataset2 of datasets) {
7647
7756
  const datasetDataset = {
7648
- ...dataset,
7649
- textDirection: dataset.textDirection,
7757
+ ...dataset2,
7758
+ textDirection: dataset2.textDirection,
7650
7759
  books: []
7651
7760
  };
7652
7761
  output.datasets.push(datasetDataset);
7653
7762
  const books = await db.datasetBook.findMany({
7654
7763
  where: {
7655
- datasetId: dataset.id
7764
+ datasetId: dataset2.id
7656
7765
  },
7657
7766
  orderBy: {
7658
7767
  order: "asc"
7659
7768
  }
7660
7769
  });
7661
- for (let book of books) {
7770
+ for (let book2 of books) {
7662
7771
  const chapters = await db.datasetChapter.findMany({
7663
7772
  where: {
7664
- datasetId: dataset.id,
7665
- bookId: book.id
7773
+ datasetId: dataset2.id,
7774
+ bookId: book2.id
7666
7775
  },
7667
7776
  orderBy: {
7668
7777
  number: "asc"
7669
7778
  }
7670
7779
  });
7671
7780
  const bookChapters = chapters.map(
7672
- (chapter) => {
7781
+ (chapter2) => {
7673
7782
  const bookChapter = {
7674
- chapter: JSON.parse(chapter.json)
7783
+ chapter: JSON.parse(chapter2.json)
7675
7784
  };
7676
7785
  for (let verse of bookChapter.chapter.content) {
7677
7786
  verse.references.sort((a, b2) => b2.score - a.score);
@@ -7680,7 +7789,8 @@ async function* loadDatasetDatasets(db, perBatch = 50, datasetsToLoad) {
7680
7789
  }
7681
7790
  );
7682
7791
  const datasetBook = {
7683
- ...book,
7792
+ ...book2,
7793
+ id: book2.id,
7684
7794
  chapters: bookChapters
7685
7795
  };
7686
7796
  datasetDataset.books.push(datasetBook);
@@ -7796,7 +7906,8 @@ __export(uploads_exports, {
7796
7906
  serializeAndUploadDatasets: () => serializeAndUploadDatasets,
7797
7907
  uploadApiFilesFromDatabase: () => uploadApiFilesFromDatabase,
7798
7908
  uploadFiles: () => uploadFiles,
7799
- uploadFilesUsingUploader: () => uploadFilesUsingUploader
7909
+ uploadFilesUsingUploader: () => uploadFilesUsingUploader,
7910
+ uploadOpenApiDocument: () => uploadOpenApiDocument
7800
7911
  });
7801
7912
 
7802
7913
  // packages/helloao-cli/s3.ts
@@ -7830,7 +7941,9 @@ var S3Uploader = class {
7830
7941
  this._keyPrefix = keyPrefix;
7831
7942
  this._client = new S3Client({
7832
7943
  region,
7833
- credentials: !profile || typeof profile === "string" ? fromNodeProviderChain({ profile: profile ?? void 0 }) : profile
7944
+ credentials: !profile || typeof profile === "string" ? fromNodeProviderChain({ profile: profile ?? void 0 }) : profile,
7945
+ maxAttempts: 10,
7946
+ retryMode: "standard"
7834
7947
  });
7835
7948
  if ((!process.env.AWS_REGION || !process.env.AWS_PROFILE) && !region) {
7836
7949
  const logger = log4.getLogger();
@@ -7959,9 +8072,289 @@ function defaultProviderForOptions(options) {
7959
8072
  }
7960
8073
 
7961
8074
  // packages/helloao-cli/uploads.ts
7962
- import { extname as extname3 } from "path";
8075
+ import { extname as extname2 } from "path";
7963
8076
  import { Readable as Readable3 } from "node:stream";
7964
8077
  import { log as log5 } from "@helloao/tools";
8078
+
8079
+ // packages/helloao-cli/openapi.ts
8080
+ import {
8081
+ ApiAvailableCommentariesSchema,
8082
+ ApiAvailableDatasetsSchema,
8083
+ ApiAvailableTranslationsSchema,
8084
+ ApiCommentaryBookChapterSchema,
8085
+ ApiCommentaryBooksSchema,
8086
+ ApiDatasetBookChapterSchema,
8087
+ ApiDatasetBooksSchema,
8088
+ ApiTranslationBookChapterSchema,
8089
+ ApiTranslationBooksSchema,
8090
+ ApiTranslationCompleteSchema
8091
+ } from "@helloao/tools/generation/api.js";
8092
+ import { createDocument } from "zod-openapi";
8093
+ import { z } from "zod";
8094
+ import { BookIdSchema } from "@helloao/tools/utils.js";
8095
+ var translation = z.string().meta({
8096
+ description: 'The translation ID of the Bible translation to get the books for. For example, "eng_kjv" for the King James Version.'
8097
+ });
8098
+ var commentary = z.string().meta({
8099
+ description: "The commentary ID of the commentary to get the books or chapter content for."
8100
+ });
8101
+ var dataset = z.string().meta({
8102
+ description: "The dataset ID of the dataset to get the books or chapter content for."
8103
+ });
8104
+ var book = BookIdSchema;
8105
+ var chapter = z.number().positive().meta({
8106
+ description: "The chapter number to get the content for. This should be a positive integer."
8107
+ });
8108
+ function createFreeUseBibleApiOpenApiDocument() {
8109
+ return createDocument({
8110
+ openapi: "3.1.0",
8111
+ info: {
8112
+ title: "Free Use Bible API",
8113
+ version: "1.0.0",
8114
+ description: "An API for accessing over 1000 different Bible translations.",
8115
+ contact: {
8116
+ name: "HelloAO",
8117
+ url: "https://bible.helloao.org",
8118
+ email: "hello@helloao.org"
8119
+ }
8120
+ },
8121
+ servers: [
8122
+ {
8123
+ url: "https://bible.helloao.org",
8124
+ description: "Free Use Bible API production server"
8125
+ }
8126
+ ],
8127
+ paths: {
8128
+ "/api/available_translations.json": {
8129
+ get: {
8130
+ operationId: "getAvailableTranslations",
8131
+ description: "Get the list of available Bible translations.",
8132
+ responses: {
8133
+ "200": {
8134
+ description: "200 OK",
8135
+ content: {
8136
+ "application/json": {
8137
+ schema: ApiAvailableTranslationsSchema
8138
+ }
8139
+ }
8140
+ }
8141
+ }
8142
+ }
8143
+ },
8144
+ "/api/{translation}/books.json": {
8145
+ get: {
8146
+ operationId: "getTranslationBooks",
8147
+ description: "Get the list of books available for a specific translation.",
8148
+ requestParams: {
8149
+ path: z.object({
8150
+ translation
8151
+ })
8152
+ },
8153
+ responses: {
8154
+ "200": {
8155
+ description: "200 OK",
8156
+ content: {
8157
+ "application/json": {
8158
+ schema: ApiTranslationBooksSchema
8159
+ }
8160
+ }
8161
+ },
8162
+ "404": {
8163
+ description: "404 Not Found - The specified translation was not found."
8164
+ }
8165
+ }
8166
+ }
8167
+ },
8168
+ "/api/{translation}/{book}/{chapter}.json": {
8169
+ get: {
8170
+ operationId: "getTranslationBookChapter",
8171
+ description: "Get the content of a specific chapter of a specific book for a specific translation.",
8172
+ requestParams: {
8173
+ path: z.object({
8174
+ translation,
8175
+ book,
8176
+ chapter
8177
+ })
8178
+ },
8179
+ responses: {
8180
+ "200": {
8181
+ description: "200 OK",
8182
+ content: {
8183
+ "application/json": {
8184
+ schema: ApiTranslationBookChapterSchema
8185
+ }
8186
+ },
8187
+ links: {
8188
+ nextChapter: {}
8189
+ }
8190
+ },
8191
+ "404": {
8192
+ description: "404 Not Found - The specified translation, book, or chapter was not found."
8193
+ }
8194
+ }
8195
+ }
8196
+ },
8197
+ "/api/{translation}/complete.json": {
8198
+ get: {
8199
+ operationId: "getTranslationComplete",
8200
+ description: "Get the complete content of a specific translation.",
8201
+ requestParams: {
8202
+ path: z.object({
8203
+ translation
8204
+ })
8205
+ },
8206
+ responses: {
8207
+ "200": {
8208
+ description: "200 OK",
8209
+ content: {
8210
+ "application/json": {
8211
+ schema: ApiTranslationCompleteSchema
8212
+ }
8213
+ }
8214
+ },
8215
+ "404": {
8216
+ description: "404 Not Found - The specified translation was not found, or complete translations are not available."
8217
+ }
8218
+ }
8219
+ }
8220
+ },
8221
+ "/api/available_commentaries.json": {
8222
+ get: {
8223
+ operationId: "getAvailableCommentaries",
8224
+ description: "Get the list of available commentaries.",
8225
+ responses: {
8226
+ "200": {
8227
+ description: "200 OK",
8228
+ content: {
8229
+ "application/json": {
8230
+ schema: ApiAvailableCommentariesSchema
8231
+ }
8232
+ }
8233
+ }
8234
+ }
8235
+ }
8236
+ },
8237
+ "/api/c/{commentary}/books.json": {
8238
+ get: {
8239
+ operationId: "getCommentaryBooks",
8240
+ description: "Get the list of books available for a specific commentary.",
8241
+ requestParams: {
8242
+ path: z.object({
8243
+ commentary
8244
+ })
8245
+ },
8246
+ responses: {
8247
+ "200": {
8248
+ description: "200 OK",
8249
+ content: {
8250
+ "application/json": {
8251
+ schema: ApiCommentaryBooksSchema
8252
+ }
8253
+ }
8254
+ },
8255
+ "404": {
8256
+ description: "404 Not Found - The specified commentary was not found."
8257
+ }
8258
+ }
8259
+ }
8260
+ },
8261
+ "/api/c/{commentary}/{book}/{chapter}.json": {
8262
+ get: {
8263
+ operationId: "getCommentaryBookChapter",
8264
+ description: "Get the content of a specific chapter of a specific book for a specific commentary.",
8265
+ requestParams: {
8266
+ path: z.object({
8267
+ commentary,
8268
+ book,
8269
+ chapter
8270
+ })
8271
+ },
8272
+ responses: {
8273
+ "200": {
8274
+ description: "200 OK",
8275
+ content: {
8276
+ "application/json": {
8277
+ schema: ApiCommentaryBookChapterSchema
8278
+ }
8279
+ }
8280
+ },
8281
+ "404": {
8282
+ description: "404 Not Found - The specified commentary, book, or chapter was not found."
8283
+ }
8284
+ }
8285
+ }
8286
+ },
8287
+ "/api/available_datasets.json": {
8288
+ get: {
8289
+ operationId: "getAvailableDatasets",
8290
+ description: "Get the list of available datasets.",
8291
+ responses: {
8292
+ "200": {
8293
+ description: "200 OK",
8294
+ content: {
8295
+ "application/json": {
8296
+ schema: ApiAvailableDatasetsSchema
8297
+ }
8298
+ }
8299
+ }
8300
+ }
8301
+ }
8302
+ },
8303
+ "/api/d/{dataset}/books.json": {
8304
+ get: {
8305
+ operationId: "getDatasetBooks",
8306
+ description: "Get the list of books available for a specific dataset.",
8307
+ requestParams: {
8308
+ path: z.object({
8309
+ dataset
8310
+ })
8311
+ },
8312
+ responses: {
8313
+ "200": {
8314
+ description: "200 OK",
8315
+ content: {
8316
+ "application/json": {
8317
+ schema: ApiDatasetBooksSchema
8318
+ }
8319
+ }
8320
+ },
8321
+ "404": {
8322
+ description: "404 Not Found - The specified dataset was not found."
8323
+ }
8324
+ }
8325
+ }
8326
+ },
8327
+ "/api/d/{dataset}/{book}/{chapter}.json": {
8328
+ get: {
8329
+ operationId: "getDatasetBookChapter",
8330
+ description: "Get the content of a specific chapter of a specific book for a specific dataset.",
8331
+ requestParams: {
8332
+ path: z.object({
8333
+ dataset,
8334
+ book,
8335
+ chapter
8336
+ })
8337
+ },
8338
+ responses: {
8339
+ "200": {
8340
+ description: "200 OK",
8341
+ content: {
8342
+ "application/json": {
8343
+ schema: ApiDatasetBookChapterSchema
8344
+ }
8345
+ }
8346
+ },
8347
+ "404": {
8348
+ description: "404 Not Found - The specified dataset, book, or chapter was not found."
8349
+ }
8350
+ }
8351
+ }
8352
+ }
8353
+ }
8354
+ });
8355
+ }
8356
+
8357
+ // packages/helloao-cli/uploads.ts
7965
8358
  async function uploadApiFilesFromDatabase(db, dest, options) {
7966
8359
  const logger = log5.getLogger();
7967
8360
  if (options.overwrite) {
@@ -7981,6 +8374,9 @@ async function uploadApiFilesFromDatabase(db, dest, options) {
7981
8374
  } else {
7982
8375
  logger.log("Generating for all translations");
7983
8376
  }
8377
+ if (options.generateOpenApiDocument !== false) {
8378
+ logger.log("Generating OpenAPI document");
8379
+ }
7984
8380
  if (options.pretty) {
7985
8381
  logger.log("Generating pretty-printed JSON files");
7986
8382
  }
@@ -7993,6 +8389,22 @@ async function uploadApiFilesFromDatabase(db, dest, options) {
7993
8389
  loadDatasets(db, pageSize, options.translations),
7994
8390
  options
7995
8391
  );
8392
+ if (options.generateOpenApiDocument !== false) {
8393
+ await uploadOpenApiDocument(dest, options);
8394
+ }
8395
+ }
8396
+ async function uploadOpenApiDocument(dest, options) {
8397
+ async function* iterator() {
8398
+ const file = await serializeFile("/openapi.json", createFreeUseBibleApiOpenApiDocument(), {
8399
+ pretty: true
8400
+ });
8401
+ if (file) {
8402
+ yield [file];
8403
+ } else {
8404
+ yield [];
8405
+ }
8406
+ }
8407
+ await uploadFiles(dest, options, iterator());
7996
8408
  }
7997
8409
  async function serializeAndUploadDatasets(dest, datasets, options = {}) {
7998
8410
  const logger = log5.getLogger();
@@ -8064,7 +8476,7 @@ Unable to determine bucket name`
8064
8476
  return true;
8065
8477
  }
8066
8478
  };
8067
- } else if (extname3(dest) === ".zip") {
8479
+ } else if (extname2(dest) === ".zip") {
8068
8480
  logger.log("Writing to zip file:", dest);
8069
8481
  uploader = new ZipUploader(dest);
8070
8482
  } else if (dest) {
@@ -8151,6 +8563,7 @@ var actions_exports = {};
8151
8563
  __export(actions_exports, {
8152
8564
  CONVERSION_INSTRUCTIONS: () => CONVERSION_INSTRUCTIONS,
8153
8565
  askForMetadata: () => askForMetadata,
8566
+ copyOpenBibleAudio: () => copyOpenBibleAudio,
8154
8567
  fetchAudio: () => fetchAudio,
8155
8568
  generateTranslationFiles: () => generateTranslationFiles,
8156
8569
  generateTranslationsFiles: () => generateTranslationsFiles,
@@ -8163,12 +8576,15 @@ __export(actions_exports, {
8163
8576
  initDb: () => initDb,
8164
8577
  listEBibleTranslations: () => listEBibleTranslations,
8165
8578
  printConversionInstructions: () => printConversionInstructions,
8579
+ searchTypesenseVerses: () => searchTypesenseVerses,
8166
8580
  sourceTranslations: () => sourceTranslations,
8167
8581
  uploadTestTranslation: () => uploadTestTranslation,
8168
- uploadTestTranslations: () => uploadTestTranslations
8582
+ uploadTestTranslations: () => uploadTestTranslations,
8583
+ uploadTypesenseVerses: () => uploadTypesenseVerses
8169
8584
  });
8170
- import path4, { basename as basename2, extname as extname4 } from "node:path";
8585
+ import path4, { basename as basename2, extname as extname3 } from "node:path";
8171
8586
  import Sql3 from "better-sqlite3";
8587
+ import Typesense from "typesense";
8172
8588
  import { DOMParser, Element, Node } from "linkedom";
8173
8589
  import { mkdir as mkdir3, readdir as readdir4, rm as rm2, writeFile as writeFile3 } from "node:fs/promises";
8174
8590
  import {
@@ -8176,7 +8592,11 @@ import {
8176
8592
  normalizeLanguage
8177
8593
  } from "@helloao/tools/utils.js";
8178
8594
  import { exists as exists3, readFile as readFile3 } from "fs-extra";
8179
- import { KNOWN_AUDIO_TRANSLATIONS } from "@helloao/tools/generation/audio.js";
8595
+ import { copyFile } from "node:fs/promises";
8596
+ import {
8597
+ KNOWN_AUDIO_TRANSLATIONS,
8598
+ KNOWN_AUDIO_FILE_TRANSLATIONS
8599
+ } from "@helloao/tools/generation/audio.js";
8180
8600
  import {
8181
8601
  bookChapterCountMap
8182
8602
  } from "@helloao/tools/generation/book-order.js";
@@ -8302,36 +8722,36 @@ async function fetchEBibleMetadata() {
8302
8722
  const ebibleTranslations = parse2(translationsCsv.trimEnd(), {
8303
8723
  header: true
8304
8724
  });
8305
- return ebibleTranslations.data.map((translation) => {
8306
- const fcbhid = translation.FCBHID.trim();
8307
- const languageCode = translation.languageCode.trim();
8725
+ return ebibleTranslations.data.map((translation2) => {
8726
+ const fcbhid = translation2.FCBHID.trim();
8727
+ const languageCode = translation2.languageCode.trim();
8308
8728
  const source = {
8309
- id: translation.translationId,
8729
+ id: translation2.translationId,
8310
8730
  translationId: getTranslationId(
8311
8731
  `${languageCode.toLowerCase()}_${fcbhid.slice(3).toLowerCase()}`
8312
8732
  ),
8313
- title: translation.title.trim(),
8314
- shortTitle: translation.shortTitle.trim(),
8315
- textDirection: translation.textDirection.trim(),
8733
+ title: translation2.title.trim(),
8734
+ shortTitle: translation2.shortTitle.trim(),
8735
+ textDirection: translation2.textDirection.trim(),
8316
8736
  languageCode,
8317
- copyright: translation.Copyright.trim(),
8318
- description: translation.description.trim(),
8319
- oldTestamentBooks: parseInt(translation.OTbooks.trim()),
8320
- oldTestamentChapters: parseInt(translation.OTchapters.trim()),
8321
- oldTestamentVerses: parseInt(translation.OTverses.trim()),
8322
- newTestamentBooks: parseInt(translation.NTbooks.trim()),
8323
- newTestamentChapters: parseInt(translation.NTchapters.trim()),
8324
- newTestamentVerses: parseInt(translation.NTverses.trim()),
8325
- apocryphaBooks: parseInt(translation.DCbooks.trim()),
8326
- apocryphaChapters: parseInt(translation.DCchapters.trim()),
8327
- apocryphaVerses: parseInt(translation.DCverses.trim()),
8328
- redistributable: translation.Redistributable.trim().toUpperCase() === "TRUE" ? "TRUE" : "FALSE",
8737
+ copyright: translation2.Copyright.trim(),
8738
+ description: translation2.description.trim(),
8739
+ oldTestamentBooks: parseInt(translation2.OTbooks.trim()),
8740
+ oldTestamentChapters: parseInt(translation2.OTchapters.trim()),
8741
+ oldTestamentVerses: parseInt(translation2.OTverses.trim()),
8742
+ newTestamentBooks: parseInt(translation2.NTbooks.trim()),
8743
+ newTestamentChapters: parseInt(translation2.NTchapters.trim()),
8744
+ newTestamentVerses: parseInt(translation2.NTverses.trim()),
8745
+ apocryphaBooks: parseInt(translation2.DCbooks.trim()),
8746
+ apocryphaChapters: parseInt(translation2.DCchapters.trim()),
8747
+ apocryphaVerses: parseInt(translation2.DCverses.trim()),
8748
+ redistributable: translation2.Redistributable.trim().toUpperCase() === "TRUE" ? "TRUE" : "FALSE",
8329
8749
  FCBHID: fcbhid,
8330
8750
  sourceDate: DateTime.fromISO(
8331
- translation.sourceDate.trim()
8751
+ translation2.sourceDate.trim()
8332
8752
  ).toISO(),
8333
8753
  updateDate: DateTime.fromISO(
8334
- translation.UpdateDate.trim()
8754
+ translation2.UpdateDate.trim()
8335
8755
  ).toISO(),
8336
8756
  usfmDownloadDate: null,
8337
8757
  usfmDownloadPath: null,
@@ -8345,6 +8765,7 @@ async function fetchEBibleMetadata() {
8345
8765
  }
8346
8766
 
8347
8767
  // packages/helloao-cli/actions.ts
8768
+ import { groupBy } from "lodash";
8348
8769
  var dirname4 = __dirname;
8349
8770
  if (!dirname4) {
8350
8771
  dirname4 = import.meta.dirname;
@@ -8629,9 +9050,10 @@ async function importApi(dir, options) {
8629
9050
  const db = await getDb(options.db);
8630
9051
  try {
8631
9052
  const datasets = await loadDatasetsFromDirectory(dir);
9053
+ const translations = await loadTranslationsFromDirectory(dir);
8632
9054
  importDatasetOutput(db, {
8633
9055
  commentaries: [],
8634
- translations: [],
9056
+ translations,
8635
9057
  datasets
8636
9058
  });
8637
9059
  } finally {
@@ -8640,19 +9062,19 @@ async function importApi(dir, options) {
8640
9062
  }
8641
9063
  async function fetchAudio(dir, translations, options = {}) {
8642
9064
  const logger = log7.getLogger();
8643
- for (let translation of translations) {
8644
- const [translationId, reader] = translation.split("/");
9065
+ for (let translation2 of translations) {
9066
+ const [translationId, reader] = translation2.split("/");
8645
9067
  const generator = KNOWN_AUDIO_TRANSLATIONS.get(translationId)?.get(reader);
8646
9068
  if (!generator) {
8647
- logger.warn("Unknown translation:", translation);
9069
+ logger.warn("Unknown translation:", translation2);
8648
9070
  continue;
8649
9071
  }
8650
9072
  for (let [bookId, chapters] of bookChapterCountMap) {
8651
- for (let chapter = 1; chapter <= chapters; chapter++) {
8652
- const url = generator(bookId, chapter);
8653
- const ext = extname4(url);
8654
- const [translationId2, reader2] = translation.split("/");
8655
- const name = `${chapter}.${reader2}${ext}`;
9073
+ for (let chapter2 = 1; chapter2 <= chapters; chapter2++) {
9074
+ const url = generator(bookId, chapter2);
9075
+ const ext = extname3(url);
9076
+ const [translationId2, reader2] = translation2.split("/");
9077
+ const name = `${chapter2}.${reader2}${ext}`;
8656
9078
  const fullPath = path4.resolve(
8657
9079
  dir,
8658
9080
  "audio",
@@ -8677,10 +9099,10 @@ async function generateTranslationsFiles(input4, dest, options) {
8677
9099
  const batchSize = typeof options.batchSize === "number" ? options.batchSize : parseInt(options.batchSize);
8678
9100
  for (let b2 of batch(dirs, batchSize)) {
8679
9101
  const files = await loadTranslationsFiles(b2);
8680
- const dataset = generateDataset2(files, parser);
9102
+ const dataset2 = generateDataset2(files, parser);
8681
9103
  await serializeAndUploadDatasets(
8682
9104
  dest,
8683
- toAsyncIterable([dataset]),
9105
+ toAsyncIterable([dataset2]),
8684
9106
  options
8685
9107
  );
8686
9108
  }
@@ -8829,6 +9251,20 @@ async function sourceTranslations(outputDir, translations, options = {}) {
8829
9251
  let db = null;
8830
9252
  let sourceExists = null;
8831
9253
  let sourceUpsert = null;
9254
+ let ignorelist = [];
9255
+ const ignorelistPath = path4.resolve(outputDir, "ignorelist.txt");
9256
+ if (await exists3(ignorelistPath)) {
9257
+ const ignorelistContent = await readFile3(ignorelistPath, "utf-8");
9258
+ ignorelist = ignorelistContent.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
9259
+ }
9260
+ if (ignorelist.length > 0) {
9261
+ logger.log(
9262
+ `Applying ignorelist from ${ignorelistPath}: ${ignorelist.length} entries`
9263
+ );
9264
+ filteredSources = filteredSources.filter(
9265
+ (source) => !ignorelist.includes(source.id)
9266
+ );
9267
+ }
8832
9268
  if (useDatabase) {
8833
9269
  if (!overwrite) {
8834
9270
  overwrite = true;
@@ -9204,8 +9640,8 @@ async function generateTranslationFiles(input4, dest, options) {
9204
9640
  logger.log("No translation files found.");
9205
9641
  return;
9206
9642
  }
9207
- const dataset = generateDataset2(files, parser);
9208
- await serializeAndUploadDatasets(dest, toAsyncIterable([dataset]), options);
9643
+ const dataset2 = generateDataset2(files, parser);
9644
+ await serializeAndUploadDatasets(dest, toAsyncIterable([dataset2]), options);
9209
9645
  }
9210
9646
  async function uploadTestTranslations(input4, options) {
9211
9647
  const parser = new DOMParser();
@@ -9215,9 +9651,9 @@ async function uploadTestTranslations(input4, options) {
9215
9651
  const dirs = await readdir4(path4.resolve(input4));
9216
9652
  const files = await loadTranslationsFiles(dirs);
9217
9653
  const hash = hashInputFiles(files);
9218
- const dataset = generateDataset2(files, parser, options.bookNameMap);
9654
+ const dataset2 = generateDataset2(files, parser, options.bookNameMap);
9219
9655
  const url = options.s3Url || "s3://ao-bible-api-public-uploads";
9220
- await serializeAndUploadDatasets(url, toAsyncIterable([dataset]), {
9656
+ await serializeAndUploadDatasets(url, toAsyncIterable([dataset2]), {
9221
9657
  ...options,
9222
9658
  pathPrefix: `/${hash}`
9223
9659
  });
@@ -9244,9 +9680,9 @@ async function uploadTestTranslation(input4, options) {
9244
9680
  return;
9245
9681
  }
9246
9682
  const hash = hashInputFiles(files);
9247
- const dataset = generateDataset2(files, parser, options.bookNameMap);
9683
+ const dataset2 = generateDataset2(files, parser, options.bookNameMap);
9248
9684
  const url = options.s3Url || "s3://ao-bible-api-public-uploads";
9249
- await serializeAndUploadDatasets(url, toAsyncIterable([dataset]), {
9685
+ await serializeAndUploadDatasets(url, toAsyncIterable([dataset2]), {
9250
9686
  ...options,
9251
9687
  pathPrefix: `/${hash}`
9252
9688
  });
@@ -9290,6 +9726,382 @@ async function loadTranslationFilesOrAskForMetadata(dir, translationMetadata) {
9290
9726
  }
9291
9727
  return files;
9292
9728
  }
9729
+ var ISO_639_3_TO_1_LOCALE = {
9730
+ aar: "aa",
9731
+ abk: "ab",
9732
+ afr: "af",
9733
+ aka: "ak",
9734
+ amh: "am",
9735
+ ara: "ar",
9736
+ arg: "an",
9737
+ asm: "as",
9738
+ ava: "av",
9739
+ ave: "ae",
9740
+ aym: "ay",
9741
+ aze: "az",
9742
+ bak: "ba",
9743
+ bam: "bm",
9744
+ bel: "be",
9745
+ ben: "bn",
9746
+ bis: "bi",
9747
+ bod: "bo",
9748
+ bos: "bs",
9749
+ bre: "br",
9750
+ bul: "bg",
9751
+ cat: "ca",
9752
+ ces: "cs",
9753
+ cha: "ch",
9754
+ che: "ce",
9755
+ chu: "cu",
9756
+ chv: "cv",
9757
+ cor: "kw",
9758
+ cos: "co",
9759
+ cre: "cr",
9760
+ cym: "cy",
9761
+ dan: "da",
9762
+ deu: "de",
9763
+ div: "dv",
9764
+ dzo: "dz",
9765
+ ell: "el",
9766
+ eng: "en",
9767
+ epo: "eo",
9768
+ est: "et",
9769
+ eus: "eu",
9770
+ ewe: "ee",
9771
+ fao: "fo",
9772
+ fas: "fa",
9773
+ fij: "fj",
9774
+ fin: "fi",
9775
+ fra: "fr",
9776
+ fry: "fy",
9777
+ ful: "ff",
9778
+ gla: "gd",
9779
+ gle: "ga",
9780
+ glg: "gl",
9781
+ glv: "gv",
9782
+ grn: "gn",
9783
+ guj: "gu",
9784
+ hat: "ht",
9785
+ hau: "ha",
9786
+ hbs: "sh",
9787
+ heb: "he",
9788
+ her: "hz",
9789
+ hin: "hi",
9790
+ hmo: "ho",
9791
+ hrv: "hr",
9792
+ hun: "hu",
9793
+ hye: "hy",
9794
+ ibo: "ig",
9795
+ ido: "io",
9796
+ iii: "ii",
9797
+ iku: "iu",
9798
+ ile: "ie",
9799
+ ina: "ia",
9800
+ ind: "id",
9801
+ ipk: "ik",
9802
+ isl: "is",
9803
+ ita: "it",
9804
+ jav: "jv",
9805
+ jpn: "ja",
9806
+ kal: "kl",
9807
+ kan: "kn",
9808
+ kas: "ks",
9809
+ kat: "ka",
9810
+ kau: "kr",
9811
+ kaz: "kk",
9812
+ khm: "km",
9813
+ kik: "ki",
9814
+ kin: "rw",
9815
+ kir: "ky",
9816
+ kom: "kv",
9817
+ kon: "kg",
9818
+ kor: "ko",
9819
+ kua: "kj",
9820
+ kur: "ku",
9821
+ lao: "lo",
9822
+ lat: "la",
9823
+ lav: "lv",
9824
+ lim: "li",
9825
+ lin: "ln",
9826
+ lit: "lt",
9827
+ ltz: "lb",
9828
+ lub: "lu",
9829
+ lug: "lg",
9830
+ mah: "mh",
9831
+ mal: "ml",
9832
+ mar: "mr",
9833
+ mkd: "mk",
9834
+ mlg: "mg",
9835
+ mlt: "mt",
9836
+ mon: "mn",
9837
+ mri: "mi",
9838
+ msa: "ms",
9839
+ mya: "my",
9840
+ nau: "na",
9841
+ nav: "nv",
9842
+ nbl: "nr",
9843
+ nde: "nd",
9844
+ ndo: "ng",
9845
+ nep: "ne",
9846
+ nld: "nl",
9847
+ nno: "nn",
9848
+ nob: "nb",
9849
+ nor: "no",
9850
+ nya: "ny",
9851
+ oci: "oc",
9852
+ oji: "oj",
9853
+ ori: "or",
9854
+ orm: "om",
9855
+ oss: "os",
9856
+ pan: "pa",
9857
+ pli: "pi",
9858
+ pol: "pl",
9859
+ por: "pt",
9860
+ pus: "ps",
9861
+ que: "qu",
9862
+ roh: "rm",
9863
+ ron: "ro",
9864
+ run: "rn",
9865
+ rus: "ru",
9866
+ sag: "sg",
9867
+ san: "sa",
9868
+ sin: "si",
9869
+ slk: "sk",
9870
+ slv: "sl",
9871
+ sme: "se",
9872
+ smo: "sm",
9873
+ sna: "sn",
9874
+ snd: "sd",
9875
+ som: "so",
9876
+ sot: "st",
9877
+ spa: "es",
9878
+ sqi: "sq",
9879
+ srd: "sc",
9880
+ srp: "sr",
9881
+ ssw: "ss",
9882
+ sun: "su",
9883
+ swa: "sw",
9884
+ swe: "sv",
9885
+ tah: "ty",
9886
+ tam: "ta",
9887
+ tat: "tt",
9888
+ tel: "te",
9889
+ tgk: "tg",
9890
+ tgl: "tl",
9891
+ tha: "th",
9892
+ tir: "ti",
9893
+ ton: "to",
9894
+ tsn: "tn",
9895
+ tso: "ts",
9896
+ tuk: "tk",
9897
+ tur: "tr",
9898
+ twi: "tw",
9899
+ uig: "ug",
9900
+ ukr: "uk",
9901
+ urd: "ur",
9902
+ uzb: "uz",
9903
+ ven: "ve",
9904
+ vie: "vi",
9905
+ vol: "vo",
9906
+ wln: "wa",
9907
+ wol: "wo",
9908
+ xho: "xh",
9909
+ yid: "yi",
9910
+ yor: "yo",
9911
+ zha: "za",
9912
+ zho: "zh",
9913
+ zul: "zu"
9914
+ };
9915
+ async function uploadTypesenseVerses(nodes, apiKey, db, options) {
9916
+ const logger = log7.getLogger();
9917
+ const parsedNodes = nodes.map((node) => {
9918
+ const url = new URL(node);
9919
+ const protocol = url.protocol.replace(":", "");
9920
+ const host = url.hostname;
9921
+ const port = url.port ? parseInt(url.port, 10) : protocol === "https" ? 443 : 80;
9922
+ return { host, port, protocol };
9923
+ });
9924
+ const client = new Typesense.Client({
9925
+ nodes: parsedNodes,
9926
+ apiKey,
9927
+ connectionTimeoutSeconds: 10
9928
+ });
9929
+ let translationWhere = options.translations && options.translations.length > 0 ? { id: { in: options.translations } } : void 0;
9930
+ if (options.language) {
9931
+ if (!translationWhere) {
9932
+ translationWhere = {};
9933
+ }
9934
+ translationWhere.language = options.language;
9935
+ }
9936
+ const translations = await db.translation.findMany({
9937
+ where: translationWhere,
9938
+ select: { id: true, language: true }
9939
+ });
9940
+ const translationsByLanguage = groupBy(translations, (t) => t.language);
9941
+ logger.log(`Uploading verses for ${translations.length} translation(s)...`);
9942
+ logger.log(
9943
+ `Grouped into ${Object.keys(translationsByLanguage).length} language collection(s).`
9944
+ );
9945
+ const BATCH_SIZE = 1e3;
9946
+ for (const [languageCode, languageTranslations] of Object.entries(
9947
+ translationsByLanguage
9948
+ )) {
9949
+ const locale = ISO_639_3_TO_1_LOCALE[languageCode] ?? null;
9950
+ if (!locale) {
9951
+ logger.warn(
9952
+ `No ISO-639-1 locale mapping found for language code '${languageCode}'. Skipping.`
9953
+ );
9954
+ continue;
9955
+ }
9956
+ const collectionName = `bibleVerses.${languageCode}`;
9957
+ const schema = {
9958
+ name: collectionName,
9959
+ fields: [
9960
+ { name: "translation", type: "string" },
9961
+ { name: "reference", type: "string" },
9962
+ { name: "referenceNormalized", type: "string" },
9963
+ { name: "book", type: "string" },
9964
+ { name: "chapter", type: "int32" },
9965
+ { name: "verse", type: "int32" },
9966
+ { name: "language", type: "string" },
9967
+ {
9968
+ name: "text",
9969
+ type: "string",
9970
+ stem: true,
9971
+ locale
9972
+ }
9973
+ ],
9974
+ token_separators: [":"]
9975
+ };
9976
+ try {
9977
+ const existing = await client.collections(collectionName).retrieve();
9978
+ logger.log(`Collection '${collectionName}' already exists.`);
9979
+ const existingFields = existing.fields.map((f) => f.name);
9980
+ const requiredFields = schema.fields.map((f) => f.name);
9981
+ const missingFields = requiredFields.filter(
9982
+ (f) => !existingFields.includes(f)
9983
+ );
9984
+ if (missingFields.length > 0) {
9985
+ logger.log(
9986
+ `Collection '${collectionName}' is missing fields: ${missingFields.join(", ")}. Updating schema...`
9987
+ );
9988
+ await client.collections(collectionName).update(schema);
9989
+ }
9990
+ } catch {
9991
+ logger.log(
9992
+ `Creating collection '${collectionName}' with locale '${locale}'...`
9993
+ );
9994
+ await client.collections().create(schema);
9995
+ logger.log(`Collection '${collectionName}' created.`);
9996
+ }
9997
+ for (const translation2 of languageTranslations) {
9998
+ logger.log(
9999
+ `Processing translation: ${translation2.id} -> ${collectionName}`
10000
+ );
10001
+ let skip2 = 0;
10002
+ while (true) {
10003
+ const verses = await db.chapterVerse.findMany({
10004
+ where: { translationId: translation2.id },
10005
+ select: {
10006
+ translationId: true,
10007
+ bookId: true,
10008
+ chapterNumber: true,
10009
+ number: true,
10010
+ text: true
10011
+ },
10012
+ orderBy: [
10013
+ { bookId: "asc" },
10014
+ { chapterNumber: "asc" },
10015
+ { number: "asc" }
10016
+ ],
10017
+ skip: skip2,
10018
+ take: BATCH_SIZE
10019
+ });
10020
+ if (verses.length === 0) {
10021
+ break;
10022
+ }
10023
+ let documents = [];
10024
+ let books = /* @__PURE__ */ new Map();
10025
+ for (const verse of verses) {
10026
+ let book2 = books.get(verse.bookId) ?? null;
10027
+ if (!book2) {
10028
+ book2 = await db.book.findFirst({
10029
+ where: {
10030
+ translationId: translation2.id,
10031
+ id: verse.bookId
10032
+ }
10033
+ });
10034
+ if (book2) {
10035
+ books.set(verse.bookId, book2);
10036
+ } else {
10037
+ logger.warn(
10038
+ `Book not found for translation ${verse.translationId} and book ID ${verse.bookId}`
10039
+ );
10040
+ }
10041
+ }
10042
+ let normalizedReference = `${verse.bookId} ${verse.chapterNumber}:${verse.number}`;
10043
+ documents.push({
10044
+ id: `${verse.translationId}_${verse.bookId}_${verse.chapterNumber}_${verse.number}`,
10045
+ translation: verse.translationId,
10046
+ reference: `${book2 ? book2.commonName : verse.bookId} ${verse.chapterNumber}:${verse.number}`,
10047
+ referenceNormalized: normalizedReference,
10048
+ book: verse.bookId,
10049
+ chapter: verse.chapterNumber,
10050
+ verse: verse.number,
10051
+ language: translation2.language,
10052
+ text: verse.text
10053
+ });
10054
+ }
10055
+ await client.collections(collectionName).documents().import(documents, { action: "upsert" });
10056
+ logger.log(
10057
+ ` Uploaded ${skip2 + verses.length} verses for ${translation2.id}`
10058
+ );
10059
+ if (verses.length < BATCH_SIZE) {
10060
+ break;
10061
+ }
10062
+ skip2 += BATCH_SIZE;
10063
+ }
10064
+ }
10065
+ }
10066
+ logger.log("Done uploading verses to Typesense language collections.");
10067
+ }
10068
+ async function searchTypesenseVerses(nodes, apiKey, options) {
10069
+ const parsedNodes = nodes.map((node) => {
10070
+ const url = new URL(node);
10071
+ const protocol = url.protocol.replace(":", "");
10072
+ const host = url.hostname;
10073
+ const port = url.port ? parseInt(url.port, 10) : protocol === "https" ? 443 : 80;
10074
+ return { host, port, protocol };
10075
+ });
10076
+ const client = new Typesense.Client({
10077
+ nodes: parsedNodes,
10078
+ apiKey,
10079
+ connectionTimeoutSeconds: 10
10080
+ });
10081
+ const filterByParts = [];
10082
+ if (options.translation) {
10083
+ filterByParts.push(`translation:=${options.translation}`);
10084
+ }
10085
+ if (options.book) {
10086
+ filterByParts.push(`book:=${options.book}`);
10087
+ }
10088
+ if (options.chapter !== void 0 && options.chapter !== null) {
10089
+ const chapter2 = Number.parseInt(String(options.chapter), 10);
10090
+ if (!Number.isNaN(chapter2)) {
10091
+ filterByParts.push(`chapter:=${chapter2}`);
10092
+ }
10093
+ }
10094
+ if (options.language) {
10095
+ filterByParts.push(`language:=${options.language}`);
10096
+ }
10097
+ const collectionName = `bibleVerses.${options.language || "en"}`;
10098
+ return await client.collections(collectionName).documents().search({
10099
+ q: options.search?.trim() ? options.search : "*",
10100
+ query_by: ["referenceNormalized", "reference", "text"],
10101
+ filter_by: filterByParts.length > 0 ? filterByParts.join(" && ") : void 0,
10102
+ per_page: 50
10103
+ });
10104
+ }
9293
10105
  async function askForMetadata(defaultId) {
9294
10106
  const id2 = await input3({
9295
10107
  message: "Enter the translation ID",
@@ -9343,6 +10155,85 @@ async function askForMetadata(defaultId) {
9343
10155
  website
9344
10156
  };
9345
10157
  }
10158
+ async function copyOpenBibleAudio(srcDir, destDir, options = {}) {
10159
+ const logger = log7.getLogger();
10160
+ const folders = /* @__PURE__ */ new Map([
10161
+ [
10162
+ "BSB",
10163
+ /* @__PURE__ */ new Map([
10164
+ ["hays", "BSB_Chapters_Hays"],
10165
+ ["souer", "BSB_Chapters_Souer"],
10166
+ ["david", "BSB_Chapters_David"]
10167
+ ])
10168
+ ]
10169
+ ]);
10170
+ const translationsToProcess = options.translation ? (options.readers?.length ? options.readers : Array.from(
10171
+ KNOWN_AUDIO_FILE_TRANSLATIONS.get(
10172
+ options.translation
10173
+ )?.keys() ?? []
10174
+ )).map((reader) => [options.translation, reader]) : Array.from(KNOWN_AUDIO_FILE_TRANSLATIONS.entries()).flatMap(
10175
+ ([translationId, readers]) => Array.from(readers.keys()).map((reader) => [
10176
+ translationId,
10177
+ reader
10178
+ ])
10179
+ );
10180
+ const tasks = [];
10181
+ for (const [translationId, reader] of translationsToProcess) {
10182
+ const generator = KNOWN_AUDIO_FILE_TRANSLATIONS.get(translationId)?.get(reader);
10183
+ if (!generator) {
10184
+ logger.warn(
10185
+ "Unknown translation/reader:",
10186
+ `${translationId}/${reader}`
10187
+ );
10188
+ continue;
10189
+ }
10190
+ const folder = folders.get(translationId)?.get(reader);
10191
+ if (!folder) {
10192
+ logger.warn(
10193
+ "No folder mapping found for translation/reader:",
10194
+ `${translationId}/${reader}`
10195
+ );
10196
+ continue;
10197
+ }
10198
+ for (const [bookId, chapters] of bookChapterCountMap) {
10199
+ for (let chapter2 = 1; chapter2 <= chapters; chapter2++) {
10200
+ const filename = generator(bookId, chapter2);
10201
+ tasks.push({
10202
+ translationId,
10203
+ reader,
10204
+ bookId,
10205
+ chapter: chapter2,
10206
+ filename,
10207
+ srcPath: path4.resolve(srcDir, folder, filename),
10208
+ destPath: path4.resolve(
10209
+ destDir,
10210
+ "api",
10211
+ translationId,
10212
+ bookId,
10213
+ chapter2.toString(),
10214
+ "audio",
10215
+ `${reader}.mp3`
10216
+ )
10217
+ });
10218
+ }
10219
+ }
10220
+ }
10221
+ for (const task of tasks) {
10222
+ const { filename, srcPath, destPath } = task;
10223
+ if (!await exists3(srcPath)) {
10224
+ logger.warn("Source file not found:", srcPath);
10225
+ continue;
10226
+ }
10227
+ if (!options.overwrite && await exists3(destPath)) {
10228
+ continue;
10229
+ }
10230
+ await mkdir3(path4.dirname(destPath), { recursive: true });
10231
+ await copyFile(srcPath, destPath);
10232
+ logger.log(
10233
+ `Copied: ${filename} -> ${path4.relative(destDir, destPath)}`
10234
+ );
10235
+ }
10236
+ }
9346
10237
  export {
9347
10238
  actions_exports as actions,
9348
10239
  db_exports as db,