@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.js CHANGED
@@ -530,12 +530,12 @@ var NEVER = Object.freeze({
530
530
  // @__NO_SIDE_EFFECTS__
531
531
  function $constructor(name, initializer3, params) {
532
532
  function init(inst, def) {
533
- var _a3;
533
+ var _a4;
534
534
  Object.defineProperty(inst, "_zod", {
535
535
  value: inst._zod ?? {},
536
536
  enumerable: false
537
537
  });
538
- (_a3 = inst._zod).traits ?? (_a3.traits = /* @__PURE__ */ new Set());
538
+ (_a4 = inst._zod).traits ?? (_a4.traits = /* @__PURE__ */ new Set());
539
539
  inst._zod.traits.add(name);
540
540
  initializer3(inst, def);
541
541
  for (const k in _.prototype) {
@@ -550,10 +550,10 @@ function $constructor(name, initializer3, params) {
550
550
  }
551
551
  Object.defineProperty(Definition, "name", { value: name });
552
552
  function _(def) {
553
- var _a3;
553
+ var _a4;
554
554
  const inst = params?.Parent ? new Definition() : this;
555
555
  init(inst, def);
556
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
556
+ (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
557
557
  for (const fn of inst._zod.deferred) {
558
558
  fn();
559
559
  }
@@ -1126,8 +1126,8 @@ function aborted(x, startIndex = 0) {
1126
1126
  }
1127
1127
  function prefixIssues(path, issues) {
1128
1128
  return issues.map((iss) => {
1129
- var _a3;
1130
- (_a3 = iss).path ?? (_a3.path = []);
1129
+ var _a4;
1130
+ (_a4 = iss).path ?? (_a4.path = []);
1131
1131
  iss.path.unshift(path);
1132
1132
  return iss;
1133
1133
  });
@@ -1291,7 +1291,7 @@ function formatError(error46, mapper = (issue2) => issue2.message) {
1291
1291
  function treeifyError(error46, mapper = (issue2) => issue2.message) {
1292
1292
  const result = { errors: [] };
1293
1293
  const processError = (error47, path = []) => {
1294
- var _a3, _b;
1294
+ var _a4, _b;
1295
1295
  for (const issue2 of error47.issues) {
1296
1296
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1297
1297
  issue2.errors.map((issues) => processError({ issues }, issue2.path));
@@ -1312,7 +1312,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
1312
1312
  const terminal = i === fullpath.length - 1;
1313
1313
  if (typeof el === "string") {
1314
1314
  curr.properties ?? (curr.properties = {});
1315
- (_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
1315
+ (_a4 = curr.properties)[el] ?? (_a4[el] = { errors: [] });
1316
1316
  curr = curr.properties[el];
1317
1317
  } else {
1318
1318
  curr.items ?? (curr.items = []);
@@ -1601,10 +1601,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
1601
1601
 
1602
1602
  // ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/checks.js
1603
1603
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1604
- var _a3;
1604
+ var _a4;
1605
1605
  inst._zod ?? (inst._zod = {});
1606
1606
  inst._zod.def = def;
1607
- (_a3 = inst._zod).onattach ?? (_a3.onattach = []);
1607
+ (_a4 = inst._zod).onattach ?? (_a4.onattach = []);
1608
1608
  });
1609
1609
  var numericOriginMap = {
1610
1610
  number: "number",
@@ -1670,8 +1670,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
1670
1670
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1671
1671
  $ZodCheck.init(inst, def);
1672
1672
  inst._zod.onattach.push((inst2) => {
1673
- var _a3;
1674
- (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
1673
+ var _a4;
1674
+ (_a4 = inst2._zod.bag).multipleOf ?? (_a4.multipleOf = def.value);
1675
1675
  });
1676
1676
  inst._zod.check = (payload) => {
1677
1677
  if (typeof payload.value !== typeof def.value)
@@ -1798,9 +1798,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
1798
1798
  };
1799
1799
  });
1800
1800
  var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1801
- var _a3;
1801
+ var _a4;
1802
1802
  $ZodCheck.init(inst, def);
1803
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1803
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1804
1804
  const val = payload.value;
1805
1805
  return !nullish(val) && val.size !== void 0;
1806
1806
  });
@@ -1826,9 +1826,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
1826
1826
  };
1827
1827
  });
1828
1828
  var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1829
- var _a3;
1829
+ var _a4;
1830
1830
  $ZodCheck.init(inst, def);
1831
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1831
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1832
1832
  const val = payload.value;
1833
1833
  return !nullish(val) && val.size !== void 0;
1834
1834
  });
@@ -1854,9 +1854,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
1854
1854
  };
1855
1855
  });
1856
1856
  var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1857
- var _a3;
1857
+ var _a4;
1858
1858
  $ZodCheck.init(inst, def);
1859
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1859
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1860
1860
  const val = payload.value;
1861
1861
  return !nullish(val) && val.size !== void 0;
1862
1862
  });
@@ -1884,9 +1884,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
1884
1884
  };
1885
1885
  });
1886
1886
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1887
- var _a3;
1887
+ var _a4;
1888
1888
  $ZodCheck.init(inst, def);
1889
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1889
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1890
1890
  const val = payload.value;
1891
1891
  return !nullish(val) && val.length !== void 0;
1892
1892
  });
@@ -1913,9 +1913,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
1913
1913
  };
1914
1914
  });
1915
1915
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1916
- var _a3;
1916
+ var _a4;
1917
1917
  $ZodCheck.init(inst, def);
1918
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1918
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1919
1919
  const val = payload.value;
1920
1920
  return !nullish(val) && val.length !== void 0;
1921
1921
  });
@@ -1942,9 +1942,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
1942
1942
  };
1943
1943
  });
1944
1944
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1945
- var _a3;
1945
+ var _a4;
1946
1946
  $ZodCheck.init(inst, def);
1947
- (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
1947
+ (_a4 = inst._zod.def).when ?? (_a4.when = (payload) => {
1948
1948
  const val = payload.value;
1949
1949
  return !nullish(val) && val.length !== void 0;
1950
1950
  });
@@ -1973,7 +1973,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
1973
1973
  };
1974
1974
  });
1975
1975
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1976
- var _a3, _b;
1976
+ var _a4, _b;
1977
1977
  $ZodCheck.init(inst, def);
1978
1978
  inst._zod.onattach.push((inst2) => {
1979
1979
  const bag = inst2._zod.bag;
@@ -1984,7 +1984,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
1984
1984
  }
1985
1985
  });
1986
1986
  if (def.pattern)
1987
- (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
1987
+ (_a4 = inst._zod).check ?? (_a4.check = (payload) => {
1988
1988
  def.pattern.lastIndex = 0;
1989
1989
  if (def.pattern.test(payload.value))
1990
1990
  return;
@@ -2186,7 +2186,7 @@ var version = {
2186
2186
 
2187
2187
  // ../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/schemas.js
2188
2188
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2189
- var _a3;
2189
+ var _a4;
2190
2190
  inst ?? (inst = {});
2191
2191
  inst._zod.def = def;
2192
2192
  inst._zod.bag = inst._zod.bag || {};
@@ -2201,7 +2201,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2201
2201
  }
2202
2202
  }
2203
2203
  if (checks.length === 0) {
2204
- (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
2204
+ (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
2205
2205
  inst._zod.deferred?.push(() => {
2206
2206
  inst._zod.run = inst._zod.parse;
2207
2207
  });
@@ -10642,7 +10642,7 @@ var JSONSchemaGenerator = class {
10642
10642
  this.seen = /* @__PURE__ */ new Map();
10643
10643
  }
10644
10644
  process(schema, _params = { path: [], schemaPath: [] }) {
10645
- var _a3;
10645
+ var _a4;
10646
10646
  const def = schema._zod.def;
10647
10647
  const formatMap = {
10648
10648
  guid: "uuid",
@@ -11151,7 +11151,7 @@ var JSONSchemaGenerator = class {
11151
11151
  delete result.schema.default;
11152
11152
  }
11153
11153
  if (this.io === "input" && result.schema._prefault)
11154
- (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
11154
+ (_a4 = result.schema).default ?? (_a4.default = result.schema._prefault);
11155
11155
  delete result.schema._prefault;
11156
11156
  const _result = this.seen.get(schema);
11157
11157
  return _result.schema;
@@ -12723,219 +12723,6 @@ var ApiClient = class {
12723
12723
  });
12724
12724
  }
12725
12725
  };
12726
- var BibleClient = class {
12727
- /**
12728
- * Creates a new BibleClient instance.
12729
- * @param client The API client to use for requests.
12730
- */
12731
- constructor(client) {
12732
- __publicField(this, "client");
12733
- // Validation schemas
12734
- __publicField(this, "versionIdSchema", external_exports.number().int().positive("Version ID must be a positive integer"));
12735
- __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"));
12736
- __publicField(this, "chapterSchema", external_exports.number().int("Chapter must be an integer").positive("Chapter must be a positive integer"));
12737
- __publicField(this, "verseSchema", external_exports.number().int("Verse must be an integer").positive("Verse must be a positive integer"));
12738
- __publicField(this, "languageRangesSchema", external_exports.string().trim().min(1, "Language ranges must be a non-empty string"));
12739
- __publicField(this, "booleanSchema", external_exports.boolean());
12740
- this.client = client;
12741
- }
12742
- /**
12743
- * Fetches a collection of Bible versions filtered by language ranges.
12744
- *
12745
- * @param language_ranges - One or more language codes or ranges to filter the versions (required).
12746
- * @param license_id - Optional license ID to filter versions by license.
12747
- * @returns A promise that resolves to a collection of BibleVersion objects.
12748
- */
12749
- async getVersions(language_ranges, license_id, options) {
12750
- const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
12751
- const parsedLanguageRanges = external_exports.array(this.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
12752
- const params = {
12753
- "language_ranges[]": parsedLanguageRanges
12754
- };
12755
- if (license_id !== void 0) {
12756
- params.license_id = license_id;
12757
- }
12758
- if (options?.page_size !== void 0) {
12759
- const pageSizeSchema = external_exports.number().int().positive();
12760
- pageSizeSchema.parse(options.page_size);
12761
- params.page_size = options.page_size;
12762
- }
12763
- if (options?.page_token !== void 0) {
12764
- params.page_token = options.page_token;
12765
- }
12766
- return this.client.get(`/v1/bibles`, params);
12767
- }
12768
- /**
12769
- * Fetches a Bible version by its ID.
12770
- * @param id The version ID.
12771
- * @returns The requested BibleVersion object.
12772
- */
12773
- async getVersion(id) {
12774
- this.versionIdSchema.parse(id);
12775
- return this.client.get(`/v1/bibles/${id}`);
12776
- }
12777
- /**
12778
- * Fetches all books for a given Bible version.
12779
- * @param versionId The version ID.
12780
- * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
12781
- * @returns An array of BibleBook objects. Each book may include an optional `intro` field
12782
- * containing metadata (id, passage_id, title) for the book's introduction when
12783
- * available in the Bible version.
12784
- */
12785
- async getBooks(versionId, canon) {
12786
- this.versionIdSchema.parse(versionId);
12787
- return this.client.get(`/v1/bibles/${versionId}/books`, {
12788
- ...canon && { canon }
12789
- });
12790
- }
12791
- /**
12792
- * Fetches a specific book by USFM code for a given version.
12793
- * @param versionId The version ID.
12794
- * @param book The Book Identifier code of the book.
12795
- * @returns The requested BibleBook object, which may include an optional `intro` field
12796
- * containing metadata (id, passage_id, title) for the book's introduction when
12797
- * available. Use the `passage_id` with `getPassage()` to fetch intro content.
12798
- */
12799
- async getBook(versionId, book) {
12800
- this.versionIdSchema.parse(versionId);
12801
- this.bookSchema.parse(book);
12802
- return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
12803
- }
12804
- /**
12805
- * Fetches all chapters for a specific book in a version.
12806
- * @param versionId The version ID.
12807
- * @param book The Book Identifier code of the book.
12808
- * @returns An array of BibleChapter objects.
12809
- */
12810
- async getChapters(versionId, book) {
12811
- this.versionIdSchema.parse(versionId);
12812
- this.bookSchema.parse(book);
12813
- return this.client.get(
12814
- `/v1/bibles/${versionId}/books/${book}/chapters`
12815
- );
12816
- }
12817
- /**
12818
- * Fetches a specific chapter for a book in a version.
12819
- * @param versionId The version ID.
12820
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12821
- * @param chapter The chapter number
12822
- * @returns The requested BibleChapter object.
12823
- */
12824
- async getChapter(versionId, book, chapter) {
12825
- this.versionIdSchema.parse(versionId);
12826
- this.bookSchema.parse(book);
12827
- this.chapterSchema.parse(chapter);
12828
- return this.client.get(
12829
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
12830
- );
12831
- }
12832
- /**
12833
- * Fetches all verses for a specific chapter in a book and version.
12834
- * @param versionId The version ID.
12835
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12836
- * @param chapter The chapter number.
12837
- * @returns An array of BibleVerse objects.
12838
- */
12839
- async getVerses(versionId, book, chapter) {
12840
- this.versionIdSchema.parse(versionId);
12841
- this.bookSchema.parse(book);
12842
- this.chapterSchema.parse(chapter);
12843
- return this.client.get(
12844
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12845
- );
12846
- }
12847
- /**
12848
- * Fetches a specific verse from a chapter, book, and version.
12849
- * @param versionId The version ID.
12850
- * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
12851
- * @param chapter The chapter number.
12852
- * @param verse The verse number.
12853
- * @returns The requested BibleVerse object.
12854
- */
12855
- async getVerse(versionId, book, chapter, verse) {
12856
- this.versionIdSchema.parse(versionId);
12857
- this.bookSchema.parse(book);
12858
- this.chapterSchema.parse(chapter);
12859
- this.verseSchema.parse(verse);
12860
- return this.client.get(
12861
- `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12862
- );
12863
- }
12864
- /**
12865
- * Fetches a passage (range of verses) from the Bible using the passages endpoint.
12866
- * This is the new API format that returns HTML-formatted content.
12867
- * @param versionId The version ID.
12868
- * @param usfm The USFM reference (e.g., "JHN.3.1-2", "GEN.1", "JHN.3.16").
12869
- * @param format The format to return ("html" or "text", default: "html").
12870
- * @param include_headings Whether to include headings in the content.
12871
- * @param include_notes Whether to include notes in the content.
12872
- * @returns The requested BiblePassage object with HTML content.
12873
- * @example
12874
- * ```ts
12875
- * // Get a single verse
12876
- * const verse = await bibleClient.getPassage(111, "JHN.3.16");
12877
- *
12878
- * // Get a range of verses
12879
- * const verses = await bibleClient.getPassage(111, "JHN.3.1-5");
12880
- *
12881
- * // Get an entire chapter
12882
- * const chapter = await bibleClient.getPassage(111, "GEN.1");
12883
- * ```
12884
- */
12885
- async getPassage(versionId, usfm, format = "html", include_headings, include_notes) {
12886
- this.versionIdSchema.parse(versionId);
12887
- if (include_headings !== void 0) {
12888
- this.booleanSchema.parse(include_headings);
12889
- }
12890
- if (include_notes !== void 0) {
12891
- this.booleanSchema.parse(include_notes);
12892
- }
12893
- const params = {
12894
- format
12895
- };
12896
- if (include_headings !== void 0) {
12897
- params.include_headings = include_headings;
12898
- }
12899
- if (include_notes !== void 0) {
12900
- params.include_notes = include_notes;
12901
- }
12902
- return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
12903
- }
12904
- /**
12905
- * Fetches the indexing structure for a Bible version.
12906
- * @param versionId The version ID.
12907
- * @returns The BibleIndex object containing full hierarchy of books, chapters, and verses.
12908
- */
12909
- async getIndex(versionId) {
12910
- this.versionIdSchema.parse(versionId);
12911
- return this.client.get(`/v1/bibles/${versionId}/index`);
12912
- }
12913
- /**
12914
- * Fetches the verse of the day calendar for an entire year.
12915
- * @returns A collection of VOTD objects for all days of the year.
12916
- */
12917
- async getAllVOTDs() {
12918
- return this.client.get(`/v1/verse_of_the_days`);
12919
- }
12920
- /**
12921
- * Fetches the passage_id for the Verse Of The Day.
12922
- * @param day The day of the year (1-366).
12923
- * @returns The day of the year and the passage_id for that day of the year
12924
- * @example
12925
- * ```ts
12926
- * // Get the passageId for the verse of the first day of the year.
12927
- * const passageId = await bibleClient.getVOTD(1);
12928
- *
12929
- * // Get the passageId for the verse of the 100th day of the year.
12930
- * const passageId = await bibleClient.getVOTD(100);
12931
- * ```
12932
- */
12933
- async getVOTD(day) {
12934
- const daySchema = external_exports.number().int().min(1).max(366);
12935
- daySchema.parse(day);
12936
- return this.client.get(`/v1/verse_of_the_days/${day}`);
12937
- }
12938
- };
12939
12726
  var BOOK_IDS = [
12940
12727
  "GEN",
12941
12728
  "EXO",
@@ -13323,7 +13110,236 @@ var _UserSchema = external_exports.object({
13323
13110
  last_name: external_exports.string()
13324
13111
  });
13325
13112
  var _a;
13326
- var LanguagesClient = (_a = class {
13113
+ var BibleClient = (_a = class {
13114
+ /**
13115
+ * Creates a new BibleClient instance.
13116
+ * @param client The API client to use for requests.
13117
+ */
13118
+ constructor(client) {
13119
+ __publicField(this, "client");
13120
+ this.client = client;
13121
+ }
13122
+ /**
13123
+ * Fetches a collection of Bible versions filtered by language ranges.
13124
+ *
13125
+ * @param language_ranges - One or more language codes or ranges to filter the versions (required).
13126
+ * @param license_id - Optional license ID to filter versions by license.
13127
+ * @returns A promise that resolves to a collection of BibleVersion objects.
13128
+ */
13129
+ async getVersions(language_ranges, license_id, options) {
13130
+ const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
13131
+ const parsedLanguageRanges = external_exports.array(_a.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
13132
+ const params = {
13133
+ "language_ranges[]": parsedLanguageRanges
13134
+ };
13135
+ if (license_id) {
13136
+ params.license_id = license_id;
13137
+ }
13138
+ _a.GetVersionsOptionsSchema.parse(options);
13139
+ if (options?.page_size) {
13140
+ params.page_size = options.page_size;
13141
+ }
13142
+ if (options?.fields) {
13143
+ params["fields[]"] = options.fields;
13144
+ }
13145
+ if (options?.page_token) {
13146
+ params.page_token = options.page_token;
13147
+ }
13148
+ if (options?.all_available) {
13149
+ params.all_available = "true";
13150
+ }
13151
+ return this.client.get(`/v1/bibles`, params);
13152
+ }
13153
+ /**
13154
+ * Fetches a Bible version by its ID.
13155
+ * @param id The version ID.
13156
+ * @returns The requested BibleVersion object.
13157
+ */
13158
+ async getVersion(id) {
13159
+ _a.versionIdSchema.parse(id);
13160
+ return this.client.get(`/v1/bibles/${id}`);
13161
+ }
13162
+ /**
13163
+ * Fetches all books for a given Bible version.
13164
+ * @param versionId The version ID.
13165
+ * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
13166
+ * @returns An array of BibleBook objects. Each book may include an optional `intro` field
13167
+ * containing metadata (id, passage_id, title) for the book's introduction when
13168
+ * available in the Bible version.
13169
+ */
13170
+ async getBooks(versionId, canon) {
13171
+ _a.versionIdSchema.parse(versionId);
13172
+ return this.client.get(`/v1/bibles/${versionId}/books`, {
13173
+ ...canon && { canon }
13174
+ });
13175
+ }
13176
+ /**
13177
+ * Fetches a specific book by USFM code for a given version.
13178
+ * @param versionId The version ID.
13179
+ * @param book The Book Identifier code of the book.
13180
+ * @returns The requested BibleBook object, which may include an optional `intro` field
13181
+ * containing metadata (id, passage_id, title) for the book's introduction when
13182
+ * available. Use the `passage_id` with `getPassage()` to fetch intro content.
13183
+ */
13184
+ async getBook(versionId, book) {
13185
+ _a.versionIdSchema.parse(versionId);
13186
+ _a.bookSchema.parse(book);
13187
+ return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
13188
+ }
13189
+ /**
13190
+ * Fetches all chapters for a specific book in a version.
13191
+ * @param versionId The version ID.
13192
+ * @param book The Book Identifier code of the book.
13193
+ * @returns An array of BibleChapter objects.
13194
+ */
13195
+ async getChapters(versionId, book) {
13196
+ _a.versionIdSchema.parse(versionId);
13197
+ _a.bookSchema.parse(book);
13198
+ return this.client.get(
13199
+ `/v1/bibles/${versionId}/books/${book}/chapters`
13200
+ );
13201
+ }
13202
+ /**
13203
+ * Fetches a specific chapter for a book in a version.
13204
+ * @param versionId The version ID.
13205
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13206
+ * @param chapter The chapter number
13207
+ * @returns The requested BibleChapter object.
13208
+ */
13209
+ async getChapter(versionId, book, chapter) {
13210
+ _a.versionIdSchema.parse(versionId);
13211
+ _a.bookSchema.parse(book);
13212
+ _a.chapterSchema.parse(chapter);
13213
+ return this.client.get(
13214
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
13215
+ );
13216
+ }
13217
+ /**
13218
+ * Fetches all verses for a specific chapter in a book and version.
13219
+ * @param versionId The version ID.
13220
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13221
+ * @param chapter The chapter number.
13222
+ * @returns An array of BibleVerse objects.
13223
+ */
13224
+ async getVerses(versionId, book, chapter) {
13225
+ _a.versionIdSchema.parse(versionId);
13226
+ _a.bookSchema.parse(book);
13227
+ _a.chapterSchema.parse(chapter);
13228
+ return this.client.get(
13229
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
13230
+ );
13231
+ }
13232
+ /**
13233
+ * Fetches a specific verse from a chapter, book, and version.
13234
+ * @param versionId The version ID.
13235
+ * @param book The Book Identifier code of the book (3 characters, e.g., "MAT").
13236
+ * @param chapter The chapter number.
13237
+ * @param verse The verse number.
13238
+ * @returns The requested BibleVerse object.
13239
+ */
13240
+ async getVerse(versionId, book, chapter, verse) {
13241
+ _a.versionIdSchema.parse(versionId);
13242
+ _a.bookSchema.parse(book);
13243
+ _a.chapterSchema.parse(chapter);
13244
+ _a.verseSchema.parse(verse);
13245
+ return this.client.get(
13246
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
13247
+ );
13248
+ }
13249
+ /**
13250
+ * Fetches a passage (range of verses) from the Bible using the passages endpoint.
13251
+ * This is the new API format that returns HTML-formatted content.
13252
+ * @param versionId The version ID.
13253
+ * @param usfm The USFM reference (e.g., "JHN.3.1-2", "GEN.1", "JHN.3.16").
13254
+ * @param format The format to return ("html" or "text", default: "html").
13255
+ * @param include_headings Whether to include headings in the content.
13256
+ * @param include_notes Whether to include notes in the content.
13257
+ * @returns The requested BiblePassage object with HTML content.
13258
+ * @example
13259
+ * ```ts
13260
+ * // Get a single verse
13261
+ * const verse = await bibleClient.getPassage(111, "JHN.3.16");
13262
+ *
13263
+ * // Get a range of verses
13264
+ * const verses = await bibleClient.getPassage(111, "JHN.3.1-5");
13265
+ *
13266
+ * // Get an entire chapter
13267
+ * const chapter = await bibleClient.getPassage(111, "GEN.1");
13268
+ * ```
13269
+ */
13270
+ async getPassage(versionId, usfm, format = "html", include_headings, include_notes) {
13271
+ _a.versionIdSchema.parse(versionId);
13272
+ if (include_headings !== void 0) {
13273
+ _a.booleanSchema.parse(include_headings);
13274
+ }
13275
+ if (include_notes !== void 0) {
13276
+ _a.booleanSchema.parse(include_notes);
13277
+ }
13278
+ const params = {
13279
+ format
13280
+ };
13281
+ if (include_headings !== void 0) {
13282
+ params.include_headings = include_headings;
13283
+ }
13284
+ if (include_notes !== void 0) {
13285
+ params.include_notes = include_notes;
13286
+ }
13287
+ return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
13288
+ }
13289
+ /**
13290
+ * Fetches the indexing structure for a Bible version.
13291
+ * @param versionId The version ID.
13292
+ * @returns The BibleIndex object containing full hierarchy of books, chapters, and verses.
13293
+ */
13294
+ async getIndex(versionId) {
13295
+ _a.versionIdSchema.parse(versionId);
13296
+ return this.client.get(`/v1/bibles/${versionId}/index`);
13297
+ }
13298
+ /**
13299
+ * Fetches the verse of the day calendar for an entire year.
13300
+ * @returns A collection of VOTD objects for all days of the year.
13301
+ */
13302
+ async getAllVOTDs() {
13303
+ return this.client.get(`/v1/verse_of_the_days`);
13304
+ }
13305
+ /**
13306
+ * Fetches the passage_id for the Verse Of The Day.
13307
+ * @param day The day of the year (1-366).
13308
+ * @returns The day of the year and the passage_id for that day of the year
13309
+ * @example
13310
+ * ```ts
13311
+ * // Get the passageId for the verse of the first day of the year.
13312
+ * const passageId = await bibleClient.getVOTD(1);
13313
+ *
13314
+ * // Get the passageId for the verse of the 100th day of the year.
13315
+ * const passageId = await bibleClient.getVOTD(100);
13316
+ * ```
13317
+ */
13318
+ async getVOTD(day) {
13319
+ const daySchema = external_exports.number().int().min(1).max(366);
13320
+ daySchema.parse(day);
13321
+ return this.client.get(`/v1/verse_of_the_days/${day}`);
13322
+ }
13323
+ }, // Validation schemas
13324
+ __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({
13325
+ page_size: external_exports.union([external_exports.number().int().positive(), external_exports.literal("*")]).optional(),
13326
+ page_token: external_exports.string().optional(),
13327
+ fields: external_exports.array(BibleVersionSchema.keyof()).optional(),
13328
+ all_available: external_exports.boolean().optional()
13329
+ }).optional().refine(
13330
+ (data) => {
13331
+ if (data?.page_size === "*") {
13332
+ return data.fields && data.fields.length >= 1 && data.fields.length <= 3;
13333
+ }
13334
+ return true;
13335
+ },
13336
+ {
13337
+ message: 'page_size="*" required 1-3 fields to be specified',
13338
+ path: ["page_size", "fields"]
13339
+ }
13340
+ )), _a);
13341
+ var _a2;
13342
+ var LanguagesClient = (_a2 = class {
13327
13343
  /**
13328
13344
  * Creates a new LanguagesClient instance.
13329
13345
  * @param client The API client to use for requests.
@@ -13340,7 +13356,7 @@ var LanguagesClient = (_a = class {
13340
13356
  async getLanguages(options = {}) {
13341
13357
  const params = {};
13342
13358
  if (options.country !== void 0) {
13343
- const country = _a.countrySchema.parse(options.country);
13359
+ const country = _a2.countrySchema.parse(options.country);
13344
13360
  params.country = country;
13345
13361
  }
13346
13362
  if (options.fields !== void 0) {
@@ -13370,17 +13386,17 @@ var LanguagesClient = (_a = class {
13370
13386
  * @returns The requested Language object.
13371
13387
  */
13372
13388
  async getLanguage(languageId) {
13373
- _a.languageIdSchema.parse(languageId);
13389
+ _a2.languageIdSchema.parse(languageId);
13374
13390
  return this.client.get(`/v1/languages/${languageId}`);
13375
13391
  }
13376
- }, __publicField(_a, "languageIdSchema", external_exports.string().trim().min(1, "Language ID must be a non-empty string").regex(
13392
+ }, __publicField(_a2, "languageIdSchema", external_exports.string().trim().min(1, "Language ID must be a non-empty string").regex(
13377
13393
  /^[a-z]{2,3}(?:-[A-Z][a-z]{3})?$/,
13378
13394
  "Language ID must match BCP 47 format (language or language+script)"
13379
- )), __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({
13395
+ )), __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({
13380
13396
  page_size: external_exports.union([external_exports.number(), external_exports.literal("*")]).optional(),
13381
13397
  fields: external_exports.array(LanguageSchema.keyof()).optional(),
13382
13398
  page_token: external_exports.string().optional(),
13383
- country: _a.countrySchema
13399
+ country: _a2.countrySchema
13384
13400
  }).refine(
13385
13401
  (data) => {
13386
13402
  if (data.page_size === "*") {
@@ -13392,9 +13408,9 @@ var LanguagesClient = (_a = class {
13392
13408
  message: 'page_size="*" required 1-3 fields to be specified',
13393
13409
  path: ["page_size", "fields"]
13394
13410
  }
13395
- )), _a);
13396
- var _a2;
13397
- var YouVersionPlatformConfiguration = (_a2 = class {
13411
+ )), _a2);
13412
+ var _a3;
13413
+ var YouVersionPlatformConfiguration = (_a3 = class {
13398
13414
  static getOrSetInstallationId() {
13399
13415
  if (typeof window === "undefined") {
13400
13416
  return "";
@@ -13478,7 +13494,7 @@ var YouVersionPlatformConfiguration = (_a2 = class {
13478
13494
  static set expiryDateKey(value) {
13479
13495
  this._expiryDateKey = value;
13480
13496
  }
13481
- }, __publicField(_a2, "_appKey", null), __publicField(_a2, "_installationId", null), __publicField(_a2, "_apiHost", "api.youversion.com"), __publicField(_a2, "_refreshTokenKey", null), __publicField(_a2, "_expiryDateKey", null), _a2);
13497
+ }, __publicField(_a3, "_appKey", null), __publicField(_a3, "_installationId", null), __publicField(_a3, "_apiHost", "api.youversion.com"), __publicField(_a3, "_refreshTokenKey", null), __publicField(_a3, "_expiryDateKey", null), _a3);
13482
13498
  var HighlightsClient = class {
13483
13499
  /**
13484
13500
  * Creates a new HighlightsClient instance.