@youversion/platform-react-ui 1.11.0 → 1.12.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 (3) hide show
  1. package/dist/index.cjs +269 -253
  2. package/dist/index.js +269 -253
  3. package/package.json +3 -3
package/dist/index.cjs CHANGED
@@ -575,12 +575,12 @@ var NEVER = Object.freeze({
575
575
  // @__NO_SIDE_EFFECTS__
576
576
  function $constructor(name, initializer3, params) {
577
577
  function init(inst, def) {
578
- var _a3;
578
+ var _a4;
579
579
  Object.defineProperty(inst, "_zod", {
580
580
  value: inst._zod ?? {},
581
581
  enumerable: false
582
582
  });
583
- (_a3 = inst._zod).traits ?? (_a3.traits = /* @__PURE__ */ new Set());
583
+ (_a4 = inst._zod).traits ?? (_a4.traits = /* @__PURE__ */ new Set());
584
584
  inst._zod.traits.add(name);
585
585
  initializer3(inst, def);
586
586
  for (const k in _.prototype) {
@@ -595,10 +595,10 @@ function $constructor(name, initializer3, params) {
595
595
  }
596
596
  Object.defineProperty(Definition, "name", { value: name });
597
597
  function _(def) {
598
- var _a3;
598
+ var _a4;
599
599
  const inst = params?.Parent ? new Definition() : this;
600
600
  init(inst, def);
601
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
601
+ (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
602
602
  for (const fn of inst._zod.deferred) {
603
603
  fn();
604
604
  }
@@ -1171,8 +1171,8 @@ function aborted(x, startIndex = 0) {
1171
1171
  }
1172
1172
  function prefixIssues(path, issues) {
1173
1173
  return issues.map((iss) => {
1174
- var _a3;
1175
- (_a3 = iss).path ?? (_a3.path = []);
1174
+ var _a4;
1175
+ (_a4 = iss).path ?? (_a4.path = []);
1176
1176
  iss.path.unshift(path);
1177
1177
  return iss;
1178
1178
  });
@@ -1336,7 +1336,7 @@ function formatError(error46, mapper = (issue2) => issue2.message) {
1336
1336
  function treeifyError(error46, mapper = (issue2) => issue2.message) {
1337
1337
  const result = { errors: [] };
1338
1338
  const processError = (error47, path = []) => {
1339
- var _a3, _b;
1339
+ var _a4, _b;
1340
1340
  for (const issue2 of error47.issues) {
1341
1341
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1342
1342
  issue2.errors.map((issues) => processError({ issues }, issue2.path));
@@ -1357,7 +1357,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
1357
1357
  const terminal = i === fullpath.length - 1;
1358
1358
  if (typeof el === "string") {
1359
1359
  curr.properties ?? (curr.properties = {});
1360
- (_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
1360
+ (_a4 = curr.properties)[el] ?? (_a4[el] = { errors: [] });
1361
1361
  curr = curr.properties[el];
1362
1362
  } else {
1363
1363
  curr.items ?? (curr.items = []);
@@ -1646,10 +1646,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
1646
1646
 
1647
1647
  // ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js
1648
1648
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1649
- var _a3;
1649
+ var _a4;
1650
1650
  inst._zod ?? (inst._zod = {});
1651
1651
  inst._zod.def = def;
1652
- (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
1652
+ (_a4 = inst._zod).onattach ?? (_a4.onattach = []);
1653
1653
  });
1654
1654
  var numericOriginMap = {
1655
1655
  number: "number",
@@ -1715,8 +1715,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
1715
1715
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1716
1716
  $ZodCheck.init(inst, def);
1717
1717
  inst._zod.onattach.push((inst2) => {
1718
- var _a3;
1719
- (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
1718
+ var _a4;
1719
+ (_a4 = inst2._zod.bag).multipleOf ?? (_a4.multipleOf = def.value);
1720
1720
  });
1721
1721
  inst._zod.check = (payload) => {
1722
1722
  if (typeof payload.value !== typeof def.value)
@@ -1843,9 +1843,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
1843
1843
  };
1844
1844
  });
1845
1845
  var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1846
- var _a3;
1846
+ var _a4;
1847
1847
  $ZodCheck.init(inst, def);
1848
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1848
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1849
1849
  const val = payload.value;
1850
1850
  return !nullish(val) && val.size !== void 0;
1851
1851
  });
@@ -1871,9 +1871,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
1871
1871
  };
1872
1872
  });
1873
1873
  var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1874
- var _a3;
1874
+ var _a4;
1875
1875
  $ZodCheck.init(inst, def);
1876
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1876
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1877
1877
  const val = payload.value;
1878
1878
  return !nullish(val) && val.size !== void 0;
1879
1879
  });
@@ -1899,9 +1899,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
1899
1899
  };
1900
1900
  });
1901
1901
  var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1902
- var _a3;
1902
+ var _a4;
1903
1903
  $ZodCheck.init(inst, def);
1904
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1904
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1905
1905
  const val = payload.value;
1906
1906
  return !nullish(val) && val.size !== void 0;
1907
1907
  });
@@ -1929,9 +1929,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
1929
1929
  };
1930
1930
  });
1931
1931
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1932
- var _a3;
1932
+ var _a4;
1933
1933
  $ZodCheck.init(inst, def);
1934
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1934
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1935
1935
  const val = payload.value;
1936
1936
  return !nullish(val) && val.length !== void 0;
1937
1937
  });
@@ -1958,9 +1958,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
1958
1958
  };
1959
1959
  });
1960
1960
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1961
- var _a3;
1961
+ var _a4;
1962
1962
  $ZodCheck.init(inst, def);
1963
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1963
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1964
1964
  const val = payload.value;
1965
1965
  return !nullish(val) && val.length !== void 0;
1966
1966
  });
@@ -1987,9 +1987,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
1987
1987
  };
1988
1988
  });
1989
1989
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1990
- var _a3;
1990
+ var _a4;
1991
1991
  $ZodCheck.init(inst, def);
1992
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1992
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1993
1993
  const val = payload.value;
1994
1994
  return !nullish(val) && val.length !== void 0;
1995
1995
  });
@@ -2018,7 +2018,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2018
2018
  };
2019
2019
  });
2020
2020
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
2021
- var _a3, _b;
2021
+ var _a4, _b;
2022
2022
  $ZodCheck.init(inst, def);
2023
2023
  inst._zod.onattach.push((inst2) => {
2024
2024
  const bag = inst2._zod.bag;
@@ -2029,7 +2029,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
2029
2029
  }
2030
2030
  });
2031
2031
  if (def.pattern)
2032
- (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
2032
+ (_a4 = inst._zod).check ?? (_a4.check = (payload) => {
2033
2033
  def.pattern.lastIndex = 0;
2034
2034
  if (def.pattern.test(payload.value))
2035
2035
  return;
@@ -2231,7 +2231,7 @@ var version = {
2231
2231
 
2232
2232
  // ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js
2233
2233
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2234
- var _a3;
2234
+ var _a4;
2235
2235
  inst ?? (inst = {});
2236
2236
  inst._zod.def = def;
2237
2237
  inst._zod.bag = inst._zod.bag || {};
@@ -2246,7 +2246,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2246
2246
  }
2247
2247
  }
2248
2248
  if (checks.length === 0) {
2249
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
2249
+ (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
2250
2250
  inst._zod.deferred?.push(() => {
2251
2251
  inst._zod.run = inst._zod.parse;
2252
2252
  });
@@ -10687,7 +10687,7 @@ var JSONSchemaGenerator = class {
10687
10687
  this.seen = /* @__PURE__ */ new Map();
10688
10688
  }
10689
10689
  process(schema, _params = { path: [], schemaPath: [] }) {
10690
- var _a3;
10690
+ var _a4;
10691
10691
  const def = schema._zod.def;
10692
10692
  const formatMap = {
10693
10693
  guid: "uuid",
@@ -11196,7 +11196,7 @@ var JSONSchemaGenerator = class {
11196
11196
  delete result.schema.default;
11197
11197
  }
11198
11198
  if (this.io === "input" && result.schema._prefault)
11199
- (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
11199
+ (_a4 = result.schema).default ?? (_a4.default = result.schema._prefault);
11200
11200
  delete result.schema._prefault;
11201
11201
  const _result = this.seen.get(schema);
11202
11202
  return _result.schema;
@@ -12768,219 +12768,6 @@ var ApiClient = class {
12768
12768
  });
12769
12769
  }
12770
12770
  };
12771
- var BibleClient = class {
12772
- /**
12773
- * Creates a new BibleClient instance.
12774
- * @param client The API client to use for requests.
12775
- */
12776
- constructor(client) {
12777
- __publicField(this, "client");
12778
- // Validation schemas
12779
- __publicField(this, "versionIdSchema", external_exports.number().int().positive("Version ID must be a positive integer"));
12780
- __publicField(this, "bookSchema", external_exports.string().trim().min(3, "Book ID must be exactly 3 characters").max(3, "Book ID must be exactly 3 characters"));
12781
- __publicField(this, "chapterSchema", external_exports.number().int("Chapter must be an integer").positive("Chapter must be a positive integer"));
12782
- __publicField(this, "verseSchema", external_exports.number().int("Verse must be an integer").positive("Verse must be a positive integer"));
12783
- __publicField(this, "languageRangesSchema", external_exports.string().trim().min(1, "Language ranges must be a non-empty string"));
12784
- __publicField(this, "booleanSchema", external_exports.boolean());
12785
- this.client = client;
12786
- }
12787
- /**
12788
- * Fetches a collection of Bible versions filtered by language ranges.
12789
- *
12790
- * @param language_ranges - One or more language codes or ranges to filter the versions (required).
12791
- * @param license_id - Optional license ID to filter versions by license.
12792
- * @returns A promise that resolves to a collection of BibleVersion objects.
12793
- */
12794
- async getVersions(language_ranges, license_id, options) {
12795
- const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
12796
- const parsedLanguageRanges = external_exports.array(this.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
12797
- const params = {
12798
- "language_ranges[]": parsedLanguageRanges
12799
- };
12800
- if (license_id !== void 0) {
12801
- params.license_id = license_id;
12802
- }
12803
- if (options?.page_size !== void 0) {
12804
- const pageSizeSchema = external_exports.number().int().positive();
12805
- pageSizeSchema.parse(options.page_size);
12806
- params.page_size = options.page_size;
12807
- }
12808
- if (options?.page_token !== void 0) {
12809
- params.page_token = options.page_token;
12810
- }
12811
- return this.client.get(`/v1/bibles`, params);
12812
- }
12813
- /**
12814
- * Fetches a Bible version by its ID.
12815
- * @param id The version ID.
12816
- * @returns The requested BibleVersion object.
12817
- */
12818
- async getVersion(id) {
12819
- this.versionIdSchema.parse(id);
12820
- return this.client.get(`/v1/bibles/${id}`);
12821
- }
12822
- /**
12823
- * Fetches all books for a given Bible version.
12824
- * @param versionId The version ID.
12825
- * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
12826
- * @returns An array of BibleBook objects. Each book may include an optional `intro` field
12827
- * containing metadata (id, passage_id, title) for the book's introduction when
12828
- * available in the Bible version.
12829
- */
12830
- async getBooks(versionId, canon) {
12831
- this.versionIdSchema.parse(versionId);
12832
- return this.client.get(`/v1/bibles/${versionId}/books`, {
12833
- ...canon && { canon }
12834
- });
12835
- }
12836
- /**
12837
- * Fetches a specific book by USFM code for a given version.
12838
- * @param versionId The version ID.
12839
- * @param book The Book Identifier code of the book.
12840
- * @returns The requested BibleBook object, which may include an optional `intro` field
12841
- * containing metadata (id, passage_id, title) for the book's introduction when
12842
- * available. Use the `passage_id` with `getPassage()` to fetch intro content.
12843
- */
12844
- async getBook(versionId, book) {
12845
- this.versionIdSchema.parse(versionId);
12846
- this.bookSchema.parse(book);
12847
- return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
12848
- }
12849
- /**
12850
- * Fetches all chapters for a specific book in a version.
12851
- * @param versionId The version ID.
12852
- * @param book The Book Identifier code of the book.
12853
- * @returns An array of BibleChapter objects.
12854
- */
12855
- async getChapters(versionId, book) {
12856
- this.versionIdSchema.parse(versionId);
12857
- this.bookSchema.parse(book);
12858
- return this.client.get(
12859
- `/v1/bibles/${versionId}/books/${book}/chapters`
12860
- );
12861
- }
12862
- /**
12863
- * Fetches a specific chapter for a book in a version.
12864
- * @param versionId The version ID.
12865
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12866
- * @param chapter The chapter number
12867
- * @returns The requested BibleChapter object.
12868
- */
12869
- async getChapter(versionId, book, chapter) {
12870
- this.versionIdSchema.parse(versionId);
12871
- this.bookSchema.parse(book);
12872
- this.chapterSchema.parse(chapter);
12873
- return this.client.get(
12874
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
12875
- );
12876
- }
12877
- /**
12878
- * Fetches all verses for a specific chapter in a book and version.
12879
- * @param versionId The version ID.
12880
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12881
- * @param chapter The chapter number.
12882
- * @returns An array of BibleVerse objects.
12883
- */
12884
- async getVerses(versionId, book, chapter) {
12885
- this.versionIdSchema.parse(versionId);
12886
- this.bookSchema.parse(book);
12887
- this.chapterSchema.parse(chapter);
12888
- return this.client.get(
12889
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12890
- );
12891
- }
12892
- /**
12893
- * Fetches a specific verse from a chapter, book, and version.
12894
- * @param versionId The version ID.
12895
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12896
- * @param chapter The chapter number.
12897
- * @param verse The verse number.
12898
- * @returns The requested BibleVerse object.
12899
- */
12900
- async getVerse(versionId, book, chapter, verse) {
12901
- this.versionIdSchema.parse(versionId);
12902
- this.bookSchema.parse(book);
12903
- this.chapterSchema.parse(chapter);
12904
- this.verseSchema.parse(verse);
12905
- return this.client.get(
12906
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12907
- );
12908
- }
12909
- /**
12910
- * Fetches a passage (range of verses) from the Bible using the passages endpoint.
12911
- * This is the new API format that returns HTML-formatted content.
12912
- * @param versionId The version ID.
12913
- * @param usfm The USFM reference (e.g., "JHN.3.1-2", "GEN.1", "JHN.3.16").
12914
- * @param format The format to return ("html" or "text", default: "html").
12915
- * @param include_headings Whether to include headings in the content.
12916
- * @param include_notes Whether to include notes in the content.
12917
- * @returns The requested BiblePassage object with HTML content.
12918
- * @example
12919
- * ```ts
12920
- * // Get a single verse
12921
- * const verse = await bibleClient.getPassage(111, "JHN.3.16");
12922
- *
12923
- * // Get a range of verses
12924
- * const verses = await bibleClient.getPassage(111, "JHN.3.1-5");
12925
- *
12926
- * // Get an entire chapter
12927
- * const chapter = await bibleClient.getPassage(111, "GEN.1");
12928
- * ```
12929
- */
12930
- async getPassage(versionId, usfm, format = "html", include_headings, include_notes) {
12931
- this.versionIdSchema.parse(versionId);
12932
- if (include_headings !== void 0) {
12933
- this.booleanSchema.parse(include_headings);
12934
- }
12935
- if (include_notes !== void 0) {
12936
- this.booleanSchema.parse(include_notes);
12937
- }
12938
- const params = {
12939
- format
12940
- };
12941
- if (include_headings !== void 0) {
12942
- params.include_headings = include_headings;
12943
- }
12944
- if (include_notes !== void 0) {
12945
- params.include_notes = include_notes;
12946
- }
12947
- return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
12948
- }
12949
- /**
12950
- * Fetches the indexing structure for a Bible version.
12951
- * @param versionId The version ID.
12952
- * @returns The BibleIndex object containing full hierarchy of books, chapters, and verses.
12953
- */
12954
- async getIndex(versionId) {
12955
- this.versionIdSchema.parse(versionId);
12956
- return this.client.get(`/v1/bibles/${versionId}/index`);
12957
- }
12958
- /**
12959
- * Fetches the verse of the day calendar for an entire year.
12960
- * @returns A collection of VOTD objects for all days of the year.
12961
- */
12962
- async getAllVOTDs() {
12963
- return this.client.get(`/v1/verse_of_the_days`);
12964
- }
12965
- /**
12966
- * Fetches the passage_id for the Verse Of The Day.
12967
- * @param day The day of the year (1-366).
12968
- * @returns The day of the year and the passage_id for that day of the year
12969
- * @example
12970
- * ```ts
12971
- * // Get the passageId for the verse of the first day of the year.
12972
- * const passageId = await bibleClient.getVOTD(1);
12973
- *
12974
- * // Get the passageId for the verse of the 100th day of the year.
12975
- * const passageId = await bibleClient.getVOTD(100);
12976
- * ```
12977
- */
12978
- async getVOTD(day) {
12979
- const daySchema = external_exports.number().int().min(1).max(366);
12980
- daySchema.parse(day);
12981
- return this.client.get(`/v1/verse_of_the_days/${day}`);
12982
- }
12983
- };
12984
12771
  var BOOK_IDS = [
12985
12772
  "GEN",
12986
12773
  "EXO",
@@ -13368,7 +13155,236 @@ var _UserSchema = external_exports.object({
13368
13155
  last_name: external_exports.string()
13369
13156
  });
13370
13157
  var _a;
13371
- var LanguagesClient = (_a = class {
13158
+ var BibleClient = (_a = class {
13159
+ /**
13160
+ * Creates a new BibleClient instance.
13161
+ * @param client The API client to use for requests.
13162
+ */
13163
+ constructor(client) {
13164
+ __publicField(this, "client");
13165
+ this.client = client;
13166
+ }
13167
+ /**
13168
+ * Fetches a collection of Bible versions filtered by language ranges.
13169
+ *
13170
+ * @param language_ranges - One or more language codes or ranges to filter the versions (required).
13171
+ * @param license_id - Optional license ID to filter versions by license.
13172
+ * @returns A promise that resolves to a collection of BibleVersion objects.
13173
+ */
13174
+ async getVersions(language_ranges, license_id, options) {
13175
+ const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
13176
+ const parsedLanguageRanges = external_exports.array(_a.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
13177
+ const params = {
13178
+ "language_ranges[]": parsedLanguageRanges
13179
+ };
13180
+ if (license_id) {
13181
+ params.license_id = license_id;
13182
+ }
13183
+ _a.GetVersionsOptionsSchema.parse(options);
13184
+ if (options?.page_size) {
13185
+ params.page_size = options.page_size;
13186
+ }
13187
+ if (options?.fields) {
13188
+ params["fields[]"] = options.fields;
13189
+ }
13190
+ if (options?.page_token) {
13191
+ params.page_token = options.page_token;
13192
+ }
13193
+ if (options?.all_available) {
13194
+ params.all_available = "true";
13195
+ }
13196
+ return this.client.get(`/v1/bibles`, params);
13197
+ }
13198
+ /**
13199
+ * Fetches a Bible version by its ID.
13200
+ * @param id The version ID.
13201
+ * @returns The requested BibleVersion object.
13202
+ */
13203
+ async getVersion(id) {
13204
+ _a.versionIdSchema.parse(id);
13205
+ return this.client.get(`/v1/bibles/${id}`);
13206
+ }
13207
+ /**
13208
+ * Fetches all books for a given Bible version.
13209
+ * @param versionId The version ID.
13210
+ * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
13211
+ * @returns An array of BibleBook objects. Each book may include an optional `intro` field
13212
+ * containing metadata (id, passage_id, title) for the book's introduction when
13213
+ * available in the Bible version.
13214
+ */
13215
+ async getBooks(versionId, canon) {
13216
+ _a.versionIdSchema.parse(versionId);
13217
+ return this.client.get(`/v1/bibles/${versionId}/books`, {
13218
+ ...canon && { canon }
13219
+ });
13220
+ }
13221
+ /**
13222
+ * Fetches a specific book by USFM code for a given version.
13223
+ * @param versionId The version ID.
13224
+ * @param book The Book Identifier code of the book.
13225
+ * @returns The requested BibleBook object, which may include an optional `intro` field
13226
+ * containing metadata (id, passage_id, title) for the book's introduction when
13227
+ * available. Use the `passage_id` with `getPassage()` to fetch intro content.
13228
+ */
13229
+ async getBook(versionId, book) {
13230
+ _a.versionIdSchema.parse(versionId);
13231
+ _a.bookSchema.parse(book);
13232
+ return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
13233
+ }
13234
+ /**
13235
+ * Fetches all chapters for a specific book in a version.
13236
+ * @param versionId The version ID.
13237
+ * @param book The Book Identifier code of the book.
13238
+ * @returns An array of BibleChapter objects.
13239
+ */
13240
+ async getChapters(versionId, book) {
13241
+ _a.versionIdSchema.parse(versionId);
13242
+ _a.bookSchema.parse(book);
13243
+ return this.client.get(
13244
+ `/v1/bibles/${versionId}/books/${book}/chapters`
13245
+ );
13246
+ }
13247
+ /**
13248
+ * Fetches a specific chapter for a book in a version.
13249
+ * @param versionId The version ID.
13250
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13251
+ * @param chapter The chapter number
13252
+ * @returns The requested BibleChapter object.
13253
+ */
13254
+ async getChapter(versionId, book, chapter) {
13255
+ _a.versionIdSchema.parse(versionId);
13256
+ _a.bookSchema.parse(book);
13257
+ _a.chapterSchema.parse(chapter);
13258
+ return this.client.get(
13259
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
13260
+ );
13261
+ }
13262
+ /**
13263
+ * Fetches all verses for a specific chapter in a book and version.
13264
+ * @param versionId The version ID.
13265
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13266
+ * @param chapter The chapter number.
13267
+ * @returns An array of BibleVerse objects.
13268
+ */
13269
+ async getVerses(versionId, book, chapter) {
13270
+ _a.versionIdSchema.parse(versionId);
13271
+ _a.bookSchema.parse(book);
13272
+ _a.chapterSchema.parse(chapter);
13273
+ return this.client.get(
13274
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
13275
+ );
13276
+ }
13277
+ /**
13278
+ * Fetches a specific verse from a chapter, book, and version.
13279
+ * @param versionId The version ID.
13280
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13281
+ * @param chapter The chapter number.
13282
+ * @param verse The verse number.
13283
+ * @returns The requested BibleVerse object.
13284
+ */
13285
+ async getVerse(versionId, book, chapter, verse) {
13286
+ _a.versionIdSchema.parse(versionId);
13287
+ _a.bookSchema.parse(book);
13288
+ _a.chapterSchema.parse(chapter);
13289
+ _a.verseSchema.parse(verse);
13290
+ return this.client.get(
13291
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
13292
+ );
13293
+ }
13294
+ /**
13295
+ * Fetches a passage (range of verses) from the Bible using the passages endpoint.
13296
+ * This is the new API format that returns HTML-formatted content.
13297
+ * @param versionId The version ID.
13298
+ * @param usfm The USFM reference (e.g., "JHN.3.1-2", "GEN.1", "JHN.3.16").
13299
+ * @param format The format to return ("html" or "text", default: "html").
13300
+ * @param include_headings Whether to include headings in the content.
13301
+ * @param include_notes Whether to include notes in the content.
13302
+ * @returns The requested BiblePassage object with HTML content.
13303
+ * @example
13304
+ * ```ts
13305
+ * // Get a single verse
13306
+ * const verse = await bibleClient.getPassage(111, "JHN.3.16");
13307
+ *
13308
+ * // Get a range of verses
13309
+ * const verses = await bibleClient.getPassage(111, "JHN.3.1-5");
13310
+ *
13311
+ * // Get an entire chapter
13312
+ * const chapter = await bibleClient.getPassage(111, "GEN.1");
13313
+ * ```
13314
+ */
13315
+ async getPassage(versionId, usfm, format = "html", include_headings, include_notes) {
13316
+ _a.versionIdSchema.parse(versionId);
13317
+ if (include_headings !== void 0) {
13318
+ _a.booleanSchema.parse(include_headings);
13319
+ }
13320
+ if (include_notes !== void 0) {
13321
+ _a.booleanSchema.parse(include_notes);
13322
+ }
13323
+ const params = {
13324
+ format
13325
+ };
13326
+ if (include_headings !== void 0) {
13327
+ params.include_headings = include_headings;
13328
+ }
13329
+ if (include_notes !== void 0) {
13330
+ params.include_notes = include_notes;
13331
+ }
13332
+ return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
13333
+ }
13334
+ /**
13335
+ * Fetches the indexing structure for a Bible version.
13336
+ * @param versionId The version ID.
13337
+ * @returns The BibleIndex object containing full hierarchy of books, chapters, and verses.
13338
+ */
13339
+ async getIndex(versionId) {
13340
+ _a.versionIdSchema.parse(versionId);
13341
+ return this.client.get(`/v1/bibles/${versionId}/index`);
13342
+ }
13343
+ /**
13344
+ * Fetches the verse of the day calendar for an entire year.
13345
+ * @returns A collection of VOTD objects for all days of the year.
13346
+ */
13347
+ async getAllVOTDs() {
13348
+ return this.client.get(`/v1/verse_of_the_days`);
13349
+ }
13350
+ /**
13351
+ * Fetches the passage_id for the Verse Of The Day.
13352
+ * @param day The day of the year (1-366).
13353
+ * @returns The day of the year and the passage_id for that day of the year
13354
+ * @example
13355
+ * ```ts
13356
+ * // Get the passageId for the verse of the first day of the year.
13357
+ * const passageId = await bibleClient.getVOTD(1);
13358
+ *
13359
+ * // Get the passageId for the verse of the 100th day of the year.
13360
+ * const passageId = await bibleClient.getVOTD(100);
13361
+ * ```
13362
+ */
13363
+ async getVOTD(day) {
13364
+ const daySchema = external_exports.number().int().min(1).max(366);
13365
+ daySchema.parse(day);
13366
+ return this.client.get(`/v1/verse_of_the_days/${day}`);
13367
+ }
13368
+ }, // Validation schemas
13369
+ __publicField(_a, "versionIdSchema", external_exports.number().int().positive("Version ID must be a positive integer")), __publicField(_a, "bookSchema", external_exports.string().trim().min(3, "Book ID must be exactly 3 characters").max(3, "Book ID must be exactly 3 characters")), __publicField(_a, "chapterSchema", external_exports.number().int("Chapter must be an integer").positive("Chapter must be a positive integer")), __publicField(_a, "verseSchema", external_exports.number().int("Verse must be an integer").positive("Verse must be a positive integer")), __publicField(_a, "languageRangesSchema", external_exports.string().trim().min(1, "Language ranges must be a non-empty string")), __publicField(_a, "booleanSchema", external_exports.boolean()), __publicField(_a, "GetVersionsOptionsSchema", external_exports.object({
13370
+ page_size: external_exports.union([external_exports.number().int().positive(), external_exports.literal("*")]).optional(),
13371
+ page_token: external_exports.string().optional(),
13372
+ fields: external_exports.array(BibleVersionSchema.keyof()).optional(),
13373
+ all_available: external_exports.boolean().optional()
13374
+ }).optional().refine(
13375
+ (data) => {
13376
+ if (data?.page_size === "*") {
13377
+ return data.fields && data.fields.length >= 1 && data.fields.length <= 3;
13378
+ }
13379
+ return true;
13380
+ },
13381
+ {
13382
+ message: 'page_size="*" required 1-3 fields to be specified',
13383
+ path: ["page_size", "fields"]
13384
+ }
13385
+ )), _a);
13386
+ var _a2;
13387
+ var LanguagesClient = (_a2 = class {
13372
13388
  /**
13373
13389
  * Creates a new LanguagesClient instance.
13374
13390
  * @param client The API client to use for requests.
@@ -13385,7 +13401,7 @@ var LanguagesClient = (_a = class {
13385
13401
  async getLanguages(options = {}) {
13386
13402
  const params = {};
13387
13403
  if (options.country !== void 0) {
13388
- const country = _a.countrySchema.parse(options.country);
13404
+ const country = _a2.countrySchema.parse(options.country);
13389
13405
  params.country = country;
13390
13406
  }
13391
13407
  if (options.fields !== void 0) {
@@ -13415,17 +13431,17 @@ var LanguagesClient = (_a = class {
13415
13431
  * @returns The requested Language object.
13416
13432
  */
13417
13433
  async getLanguage(languageId) {
13418
- _a.languageIdSchema.parse(languageId);
13434
+ _a2.languageIdSchema.parse(languageId);
13419
13435
  return this.client.get(`/v1/languages/${languageId}`);
13420
13436
  }
13421
- }, __publicField(_a, "languageIdSchema", external_exports.string().trim().min(1, "Language ID must be a non-empty string").regex(
13437
+ }, __publicField(_a2, "languageIdSchema", external_exports.string().trim().min(1, "Language ID must be a non-empty string").regex(
13422
13438
  /^[a-z]{2,3}(?:-[A-Z][a-z]{3})?$/,
13423
13439
  "Language ID must match BCP 47 format (language or language+script)"
13424
- )), __publicField(_a, "countrySchema", external_exports.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase()), __publicField(_a, "GetLanguagesOptionsSchema", external_exports.object({
13440
+ )), __publicField(_a2, "countrySchema", external_exports.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase()), __publicField(_a2, "GetLanguagesOptionsSchema", external_exports.object({
13425
13441
  page_size: external_exports.union([external_exports.number(), external_exports.literal("*")]).optional(),
13426
13442
  fields: external_exports.array(LanguageSchema.keyof()).optional(),
13427
13443
  page_token: external_exports.string().optional(),
13428
- country: _a.countrySchema
13444
+ country: _a2.countrySchema
13429
13445
  }).refine(
13430
13446
  (data) => {
13431
13447
  if (data.page_size === "*") {
@@ -13437,9 +13453,9 @@ var LanguagesClient = (_a = class {
13437
13453
  message: 'page_size="*" required 1-3 fields to be specified',
13438
13454
  path: ["page_size", "fields"]
13439
13455
  }
13440
- )), _a);
13441
- var _a2;
13442
- var YouVersionPlatformConfiguration = (_a2 = class {
13456
+ )), _a2);
13457
+ var _a3;
13458
+ var YouVersionPlatformConfiguration = (_a3 = class {
13443
13459
  static getOrSetInstallationId() {
13444
13460
  if (typeof window === "undefined") {
13445
13461
  return "";
@@ -13523,7 +13539,7 @@ var YouVersionPlatformConfiguration = (_a2 = class {
13523
13539
  static set expiryDateKey(value) {
13524
13540
  this._expiryDateKey = value;
13525
13541
  }
13526
- }, __publicField(_a2, "_appKey", null), __publicField(_a2, "_installationId", null), __publicField(_a2, "_apiHost", "api.youversion.com"), __publicField(_a2, "_refreshTokenKey", null), __publicField(_a2, "_expiryDateKey", null), _a2);
13542
+ }, __publicField(_a3, "_appKey", null), __publicField(_a3, "_installationId", null), __publicField(_a3, "_apiHost", "api.youversion.com"), __publicField(_a3, "_refreshTokenKey", null), __publicField(_a3, "_expiryDateKey", null), _a3);
13527
13543
  var HighlightsClient = class {
13528
13544
  /**
13529
13545
  * Creates a new HighlightsClient instance.