@youversion/platform-core 1.10.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.
package/dist/index.js CHANGED
@@ -152,16 +152,462 @@ var ApiClient = class {
152
152
  };
153
153
 
154
154
  // src/bible.ts
155
+ import { z as z12 } from "zod";
156
+
157
+ // src/schemas/bible-index.ts
158
+ import { z as z4 } from "zod";
159
+
160
+ // src/schemas/book.ts
161
+ import { z as z3 } from "zod";
162
+
163
+ // src/utils/constants.ts
164
+ var BOOK_IDS = [
165
+ "GEN",
166
+ "EXO",
167
+ "LEV",
168
+ "NUM",
169
+ "DEU",
170
+ "JOS",
171
+ "JDG",
172
+ "RUT",
173
+ "1SA",
174
+ "2SA",
175
+ "1KI",
176
+ "2KI",
177
+ "1CH",
178
+ "2CH",
179
+ "EZR",
180
+ "NEH",
181
+ "EST",
182
+ "JOB",
183
+ "PSA",
184
+ "PRO",
185
+ "ECC",
186
+ "SNG",
187
+ "ISA",
188
+ "JER",
189
+ "LAM",
190
+ "EZK",
191
+ "DAN",
192
+ "HOS",
193
+ "JOL",
194
+ "AMO",
195
+ "OBA",
196
+ "JON",
197
+ "MIC",
198
+ "NAM",
199
+ "HAB",
200
+ "ZEP",
201
+ "HAG",
202
+ "ZEC",
203
+ "MAL",
204
+ "MAT",
205
+ "MRK",
206
+ "LUK",
207
+ "JHN",
208
+ "ACT",
209
+ "ROM",
210
+ "1CO",
211
+ "2CO",
212
+ "GAL",
213
+ "EPH",
214
+ "PHP",
215
+ "COL",
216
+ "1TH",
217
+ "2TH",
218
+ "1TI",
219
+ "2TI",
220
+ "TIT",
221
+ "PHM",
222
+ "HEB",
223
+ "JAS",
224
+ "1PE",
225
+ "2PE",
226
+ "1JN",
227
+ "2JN",
228
+ "3JN",
229
+ "JUD",
230
+ "REV",
231
+ // dc (Apocrypha) books
232
+ "TOB",
233
+ "JDT",
234
+ "ESG",
235
+ "WIS",
236
+ "SIR",
237
+ "BAR",
238
+ "LJE",
239
+ "S3Y",
240
+ "SUS",
241
+ "BEL",
242
+ "1MA",
243
+ "2MA",
244
+ "3MA",
245
+ "4MA",
246
+ "1ES",
247
+ "2ES",
248
+ "MAN",
249
+ "PS2",
250
+ "ODA",
251
+ "PSS",
252
+ "3ES",
253
+ "EZA",
254
+ "5EZ",
255
+ "6EZ",
256
+ "DAG",
257
+ "PS3",
258
+ "2BA",
259
+ "LBA",
260
+ "JUB",
261
+ "ENO",
262
+ "1MQ",
263
+ "2MQ",
264
+ "3MQ",
265
+ "REP",
266
+ "4BA",
267
+ "LAO",
268
+ // Luke-Acts combo, treated canonically as New Testament
269
+ "LKA"
270
+ ];
271
+ var BOOK_CANON = {
272
+ GEN: "old_testament",
273
+ EXO: "old_testament",
274
+ LEV: "old_testament",
275
+ NUM: "old_testament",
276
+ DEU: "old_testament",
277
+ JOS: "old_testament",
278
+ JDG: "old_testament",
279
+ RUT: "old_testament",
280
+ "1SA": "old_testament",
281
+ "2SA": "old_testament",
282
+ "1KI": "old_testament",
283
+ "2KI": "old_testament",
284
+ "1CH": "old_testament",
285
+ "2CH": "old_testament",
286
+ EZR: "old_testament",
287
+ NEH: "old_testament",
288
+ EST: "old_testament",
289
+ JOB: "old_testament",
290
+ PSA: "old_testament",
291
+ PRO: "old_testament",
292
+ ECC: "old_testament",
293
+ SNG: "old_testament",
294
+ ISA: "old_testament",
295
+ JER: "old_testament",
296
+ LAM: "old_testament",
297
+ EZK: "old_testament",
298
+ DAN: "old_testament",
299
+ HOS: "old_testament",
300
+ JOL: "old_testament",
301
+ AMO: "old_testament",
302
+ OBA: "old_testament",
303
+ JON: "old_testament",
304
+ MIC: "old_testament",
305
+ NAM: "old_testament",
306
+ HAB: "old_testament",
307
+ ZEP: "old_testament",
308
+ HAG: "old_testament",
309
+ ZEC: "old_testament",
310
+ MAL: "old_testament",
311
+ MAT: "new_testament",
312
+ MRK: "new_testament",
313
+ LUK: "new_testament",
314
+ JHN: "new_testament",
315
+ ACT: "new_testament",
316
+ ROM: "new_testament",
317
+ "1CO": "new_testament",
318
+ "2CO": "new_testament",
319
+ GAL: "new_testament",
320
+ EPH: "new_testament",
321
+ PHP: "new_testament",
322
+ COL: "new_testament",
323
+ "1TH": "new_testament",
324
+ "2TH": "new_testament",
325
+ "1TI": "new_testament",
326
+ "2TI": "new_testament",
327
+ TIT: "new_testament",
328
+ PHM: "new_testament",
329
+ HEB: "new_testament",
330
+ JAS: "new_testament",
331
+ "1PE": "new_testament",
332
+ "2PE": "new_testament",
333
+ "1JN": "new_testament",
334
+ "2JN": "new_testament",
335
+ "3JN": "new_testament",
336
+ JUD: "new_testament",
337
+ REV: "new_testament",
338
+ TOB: "deuterocanon",
339
+ JDT: "deuterocanon",
340
+ ESG: "deuterocanon",
341
+ WIS: "deuterocanon",
342
+ SIR: "deuterocanon",
343
+ BAR: "deuterocanon",
344
+ LJE: "deuterocanon",
345
+ S3Y: "deuterocanon",
346
+ SUS: "deuterocanon",
347
+ BEL: "deuterocanon",
348
+ "1MA": "deuterocanon",
349
+ "2MA": "deuterocanon",
350
+ "3MA": "deuterocanon",
351
+ "4MA": "deuterocanon",
352
+ "1ES": "deuterocanon",
353
+ "2ES": "deuterocanon",
354
+ MAN: "deuterocanon",
355
+ PS2: "deuterocanon",
356
+ ODA: "deuterocanon",
357
+ PSS: "deuterocanon",
358
+ "3ES": "deuterocanon",
359
+ EZA: "deuterocanon",
360
+ "5EZ": "deuterocanon",
361
+ "6EZ": "deuterocanon",
362
+ DAG: "deuterocanon",
363
+ PS3: "deuterocanon",
364
+ "2BA": "deuterocanon",
365
+ LBA: "deuterocanon",
366
+ JUB: "deuterocanon",
367
+ ENO: "deuterocanon",
368
+ "1MQ": "deuterocanon",
369
+ "2MQ": "deuterocanon",
370
+ "3MQ": "deuterocanon",
371
+ REP: "deuterocanon",
372
+ "4BA": "deuterocanon",
373
+ LAO: "deuterocanon",
374
+ LKA: "new_testament"
375
+ // Luke-Acts combo, treated canonically as New Testament
376
+ };
377
+
378
+ // src/schemas/chapter.ts
379
+ import { z as z2 } from "zod";
380
+
381
+ // src/schemas/verse.ts
155
382
  import { z } from "zod";
156
- var BibleClient = class {
383
+ var BibleVerseSchema = z.object({
384
+ /** Verse identifier (e.g., "1") */
385
+ id: z.string(),
386
+ /** Passage identifier (e.g., "MAT.1.1") */
387
+ passage_id: z.string(),
388
+ /** Verse Number (e.g., "1") */
389
+ title: z.string()
390
+ });
391
+
392
+ // src/schemas/chapter.ts
393
+ var BibleChapterSchema = z2.object({
394
+ /** Chapter identifier (e.g., "1") */
395
+ id: z2.string(),
396
+ /** Passage identifier (e.g., "MAT.1") */
397
+ passage_id: z2.string(),
398
+ /** Chapter title (e.g., "1") */
399
+ title: z2.string(),
400
+ /** Array of verses */
401
+ verses: z2.array(BibleVerseSchema).optional()
402
+ });
403
+
404
+ // src/schemas/book.ts
405
+ var CanonSchema = z3.enum(["old_testament", "new_testament", "deuterocanon"]);
406
+ var BibleBookIntroSchema = z3.object({
407
+ /** Intro identifier */
408
+ id: z3.string(),
409
+ /** Intro passage identifier */
410
+ passage_id: z3.string(),
411
+ /** Intro title */
412
+ title: z3.string()
413
+ });
414
+ var BookUsfmSchema = z3.union([
415
+ ...BOOK_IDS.map((id) => z3.literal(id)),
416
+ z3.string().length(3)
417
+ ]);
418
+ var BibleBookSchema = z3.object({
419
+ /** Book identifier (e.g., "MAT") */
420
+ id: BookUsfmSchema,
421
+ /** Book title (e.g., "Genesis") */
422
+ title: z3.string(),
423
+ /** Full Book title (e.g., "The First Book of Moses, Commonly Called Genesis") */
424
+ full_title: z3.string(),
425
+ /** Book abbreviation (e.g., "Gen") */
426
+ abbreviation: z3.string().optional(),
427
+ /** Canonical section (new_testament, old_testament, deuterocanon) */
428
+ canon: CanonSchema,
429
+ /** Intro metadata (optional) */
430
+ intro: BibleBookIntroSchema.optional(),
431
+ /** Array of chapter identifiers (e.g., ["GEN.1", "GEN.2", "GEN.3"]) */
432
+ chapters: z3.array(BibleChapterSchema).optional()
433
+ });
434
+
435
+ // src/schemas/bible-index.ts
436
+ var BibleIndexVerseSchema = z4.object({
437
+ /** Verse identifier */
438
+ id: z4.string(),
439
+ /** Verse title */
440
+ title: z4.string()
441
+ });
442
+ var BibleIndexChapterSchema = z4.object({
443
+ /** Chapter identifier */
444
+ id: z4.string(),
445
+ /** Chapter title */
446
+ title: z4.string(),
447
+ /** Array of verses in this chapter */
448
+ verses: z4.array(BibleIndexVerseSchema)
449
+ });
450
+ var BibleIndexBookSchema = z4.object({
451
+ /** Book identifier */
452
+ id: BookUsfmSchema,
453
+ /** Book title */
454
+ title: z4.string(),
455
+ /** Full book title */
456
+ full_title: z4.string(),
457
+ /** Book abbreviation */
458
+ abbreviation: z4.string(),
459
+ /** Canonical section */
460
+ canon: CanonSchema,
461
+ /** Array of chapters in this book */
462
+ chapters: z4.array(BibleIndexChapterSchema)
463
+ });
464
+ var _BibleIndexSchema = z4.object({
465
+ /** Text direction (e.g., "ltr") */
466
+ text_direction: z4.string(),
467
+ /** Array of books with chapters and verses */
468
+ books: z4.array(BibleIndexBookSchema)
469
+ });
470
+
471
+ // src/schemas/collection.ts
472
+ import { z as z5 } from "zod";
473
+
474
+ // src/schemas/highlight.ts
475
+ import { z as z6 } from "zod";
476
+ var _HighlightSchema = z6.object({
477
+ /** Bible version identifier */
478
+ version_id: z6.number().int().positive(),
479
+ /** Passage identifier (e.g., "MAT.1.1") */
480
+ passage_id: z6.string(),
481
+ /** Hex color code (6 digits, no #) */
482
+ color: z6.string().regex(/^[0-9a-f]{6}$/)
483
+ });
484
+ var _CreateHighlightSchema = z6.object({
485
+ /** Bible version identifier */
486
+ version_id: z6.number().int().positive(),
487
+ /** Passage identifier (e.g., "MAT.1.1") */
488
+ passage_id: z6.string(),
489
+ /** Hex color code (6 digits, no #) */
490
+ color: z6.string().regex(/^[0-9a-f]{6}$/)
491
+ });
492
+
493
+ // src/schemas/language.ts
494
+ import { z as z7 } from "zod";
495
+ var LanguageSchema = z7.object({
496
+ /** BCP 47 language identifier (e.g., "en") */
497
+ id: z7.string().regex(/^[a-z]{2,3}(?:-[A-Z][a-z]{3})?$/, "BCP 47 id limited to language or language+script"),
498
+ /** ISO 639 language code */
499
+ language: z7.string().regex(/^[a-z]{2,3}$/, "ISO 639 canonical language subtag"),
500
+ /** ISO 15924 script code (e.g., "Latn") */
501
+ script: z7.string().regex(/^[A-Z][a-z]{3}$/, 'Script must match ISO 15924 format (e.g., "Latn")').nullable().optional(),
502
+ /** Script name (e.g., "Latin") */
503
+ script_name: z7.string().nullable().optional(),
504
+ /** Language aliases */
505
+ aliases: z7.array(z7.string()).optional(),
506
+ /** Display names for different locales */
507
+ display_names: z7.record(z7.string(), z7.string()).optional(),
508
+ /** Available scripts for this language (e.g., ["Cyrl", "Latn"]) */
509
+ scripts: z7.array(z7.string().regex(/^[A-Z][a-z]{3}$/, "ISO 15924 script code")).optional(),
510
+ /** Language variants (e.g., ["1996", "fonipa"]) */
511
+ variants: z7.array(z7.string()).optional(),
512
+ /** ISO 3166-1 alpha-2 country codes (e.g., ["RS", "BA", "ME"]) */
513
+ countries: z7.array(z7.string().regex(/^[A-Z]{2}$/, "ISO 3166-1 alpha-2 country code")).optional(),
514
+ /** Text direction (ltr or rtl) */
515
+ text_direction: z7.enum(["ltr", "rtl"]).optional(),
516
+ /** Writing population count */
517
+ writing_population: z7.number().int().optional(),
518
+ /** Speaking population count */
519
+ speaking_population: z7.number().int().optional(),
520
+ /** Default Bible version ID for this language */
521
+ default_bible_id: z7.number().int().nullable().optional()
522
+ });
523
+
524
+ // src/schemas/passage.ts
525
+ import { z as z8 } from "zod";
526
+ var BiblePassageSchema = z8.object({
527
+ /** Passage identifier (e.g., "MAT.1.1") */
528
+ id: z8.string(),
529
+ /** Passage content text */
530
+ content: z8.string(),
531
+ /** Human-readable reference (e.g., "Matthew 1:1") */
532
+ reference: z8.string()
533
+ });
534
+
535
+ // src/schemas/version.ts
536
+ import { z as z9 } from "zod";
537
+ var BibleVersionSchema = z9.object({
538
+ /** Bible version identifier */
539
+ id: z9.number().int(),
540
+ /** Bible version abbreviation */
541
+ abbreviation: z9.string(),
542
+ /** Long copyright text */
543
+ promotional_content: z9.string().nullable().optional(),
544
+ /** Short copyright text */
545
+ copyright: z9.string().nullable().optional(),
546
+ /** Bible information text */
547
+ info: z9.string().nullable().optional(),
548
+ /** Publisher URL */
549
+ publisher_url: z9.url().nullable().optional(),
550
+ /** Language tag (e.g., "en") */
551
+ language_tag: z9.string(),
552
+ /** Localized abbreviation */
553
+ localized_abbreviation: z9.string(),
554
+ /** Localized title */
555
+ localized_title: z9.string(),
556
+ /** Organization ID of publisher */
557
+ organization_id: z9.string().nullable().optional(),
558
+ /** Full title */
559
+ title: z9.string(),
560
+ /** Array of book identifiers (e.g., ["GEN", "EXO", "LEV"]) */
561
+ books: z9.array(BookUsfmSchema),
562
+ /** YouVersion deep link URL */
563
+ youversion_deep_link: z9.url()
564
+ });
565
+
566
+ // src/schemas/votd.ts
567
+ import { z as z10 } from "zod";
568
+ var VOTDSchema = z10.object({
569
+ /** Day of year (1-366) */
570
+ day: z10.number().int().min(1).max(366),
571
+ /** Passage identifier (e.g., "JHN.3.16") */
572
+ passage_id: z10.string()
573
+ });
574
+
575
+ // src/schemas/user.ts
576
+ import { z as z11 } from "zod";
577
+ var _UserSchema = z11.object({
578
+ avatar_url: z11.string(),
579
+ first_name: z11.string(),
580
+ id: z11.uuid(),
581
+ last_name: z11.string()
582
+ });
583
+
584
+ // src/bible.ts
585
+ var BibleClient = class _BibleClient {
157
586
  client;
158
587
  // Validation schemas
159
- versionIdSchema = z.number().int().positive("Version ID must be a positive integer");
160
- bookSchema = z.string().trim().min(3, "Book ID must be exactly 3 characters").max(3, "Book ID must be exactly 3 characters");
161
- chapterSchema = z.number().int("Chapter must be an integer").positive("Chapter must be a positive integer");
162
- verseSchema = z.number().int("Verse must be an integer").positive("Verse must be a positive integer");
163
- languageRangesSchema = z.string().trim().min(1, "Language ranges must be a non-empty string");
164
- booleanSchema = z.boolean();
588
+ static versionIdSchema = z12.number().int().positive("Version ID must be a positive integer");
589
+ static bookSchema = z12.string().trim().min(3, "Book ID must be exactly 3 characters").max(3, "Book ID must be exactly 3 characters");
590
+ static chapterSchema = z12.number().int("Chapter must be an integer").positive("Chapter must be a positive integer");
591
+ static verseSchema = z12.number().int("Verse must be an integer").positive("Verse must be a positive integer");
592
+ static languageRangesSchema = z12.string().trim().min(1, "Language ranges must be a non-empty string");
593
+ static booleanSchema = z12.boolean();
594
+ static GetVersionsOptionsSchema = z12.object({
595
+ page_size: z12.union([z12.number().int().positive(), z12.literal("*")]).optional(),
596
+ page_token: z12.string().optional(),
597
+ fields: z12.array(BibleVersionSchema.keyof()).optional(),
598
+ all_available: z12.boolean().optional()
599
+ }).optional().refine(
600
+ (data) => {
601
+ if (data?.page_size === "*") {
602
+ return data.fields && data.fields.length >= 1 && data.fields.length <= 3;
603
+ }
604
+ return true;
605
+ },
606
+ {
607
+ message: 'page_size="*" required 1-3 fields to be specified',
608
+ path: ["page_size", "fields"]
609
+ }
610
+ );
165
611
  /**
166
612
  * Creates a new BibleClient instance.
167
613
  * @param client The API client to use for requests.
@@ -178,21 +624,26 @@ var BibleClient = class {
178
624
  */
179
625
  async getVersions(language_ranges, license_id, options) {
180
626
  const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
181
- const parsedLanguageRanges = z.array(this.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
627
+ const parsedLanguageRanges = z12.array(_BibleClient.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
182
628
  const params = {
183
629
  "language_ranges[]": parsedLanguageRanges
184
630
  };
185
- if (license_id !== void 0) {
631
+ if (license_id) {
186
632
  params.license_id = license_id;
187
633
  }
188
- if (options?.page_size !== void 0) {
189
- const pageSizeSchema = z.number().int().positive();
190
- pageSizeSchema.parse(options.page_size);
634
+ _BibleClient.GetVersionsOptionsSchema.parse(options);
635
+ if (options?.page_size) {
191
636
  params.page_size = options.page_size;
192
637
  }
193
- if (options?.page_token !== void 0) {
638
+ if (options?.fields) {
639
+ params["fields[]"] = options.fields;
640
+ }
641
+ if (options?.page_token) {
194
642
  params.page_token = options.page_token;
195
643
  }
644
+ if (options?.all_available) {
645
+ params.all_available = "true";
646
+ }
196
647
  return this.client.get(`/v1/bibles`, params);
197
648
  }
198
649
  /**
@@ -201,7 +652,7 @@ var BibleClient = class {
201
652
  * @returns The requested BibleVersion object.
202
653
  */
203
654
  async getVersion(id) {
204
- this.versionIdSchema.parse(id);
655
+ _BibleClient.versionIdSchema.parse(id);
205
656
  return this.client.get(`/v1/bibles/${id}`);
206
657
  }
207
658
  /**
@@ -213,7 +664,7 @@ var BibleClient = class {
213
664
  * available in the Bible version.
214
665
  */
215
666
  async getBooks(versionId, canon) {
216
- this.versionIdSchema.parse(versionId);
667
+ _BibleClient.versionIdSchema.parse(versionId);
217
668
  return this.client.get(`/v1/bibles/${versionId}/books`, {
218
669
  ...canon && { canon }
219
670
  });
@@ -227,8 +678,8 @@ var BibleClient = class {
227
678
  * available. Use the `passage_id` with `getPassage()` to fetch intro content.
228
679
  */
229
680
  async getBook(versionId, book) {
230
- this.versionIdSchema.parse(versionId);
231
- this.bookSchema.parse(book);
681
+ _BibleClient.versionIdSchema.parse(versionId);
682
+ _BibleClient.bookSchema.parse(book);
232
683
  return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
233
684
  }
234
685
  /**
@@ -238,8 +689,8 @@ var BibleClient = class {
238
689
  * @returns An array of BibleChapter objects.
239
690
  */
240
691
  async getChapters(versionId, book) {
241
- this.versionIdSchema.parse(versionId);
242
- this.bookSchema.parse(book);
692
+ _BibleClient.versionIdSchema.parse(versionId);
693
+ _BibleClient.bookSchema.parse(book);
243
694
  return this.client.get(
244
695
  `/v1/bibles/${versionId}/books/${book}/chapters`
245
696
  );
@@ -252,9 +703,9 @@ var BibleClient = class {
252
703
  * @returns The requested BibleChapter object.
253
704
  */
254
705
  async getChapter(versionId, book, chapter) {
255
- this.versionIdSchema.parse(versionId);
256
- this.bookSchema.parse(book);
257
- this.chapterSchema.parse(chapter);
706
+ _BibleClient.versionIdSchema.parse(versionId);
707
+ _BibleClient.bookSchema.parse(book);
708
+ _BibleClient.chapterSchema.parse(chapter);
258
709
  return this.client.get(
259
710
  `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
260
711
  );
@@ -267,9 +718,9 @@ var BibleClient = class {
267
718
  * @returns An array of BibleVerse objects.
268
719
  */
269
720
  async getVerses(versionId, book, chapter) {
270
- this.versionIdSchema.parse(versionId);
271
- this.bookSchema.parse(book);
272
- this.chapterSchema.parse(chapter);
721
+ _BibleClient.versionIdSchema.parse(versionId);
722
+ _BibleClient.bookSchema.parse(book);
723
+ _BibleClient.chapterSchema.parse(chapter);
273
724
  return this.client.get(
274
725
  `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
275
726
  );
@@ -283,10 +734,10 @@ var BibleClient = class {
283
734
  * @returns The requested BibleVerse object.
284
735
  */
285
736
  async getVerse(versionId, book, chapter, verse) {
286
- this.versionIdSchema.parse(versionId);
287
- this.bookSchema.parse(book);
288
- this.chapterSchema.parse(chapter);
289
- this.verseSchema.parse(verse);
737
+ _BibleClient.versionIdSchema.parse(versionId);
738
+ _BibleClient.bookSchema.parse(book);
739
+ _BibleClient.chapterSchema.parse(chapter);
740
+ _BibleClient.verseSchema.parse(verse);
290
741
  return this.client.get(
291
742
  `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
292
743
  );
@@ -313,12 +764,12 @@ var BibleClient = class {
313
764
  * ```
314
765
  */
315
766
  async getPassage(versionId, usfm, format = "html", include_headings, include_notes) {
316
- this.versionIdSchema.parse(versionId);
767
+ _BibleClient.versionIdSchema.parse(versionId);
317
768
  if (include_headings !== void 0) {
318
- this.booleanSchema.parse(include_headings);
769
+ _BibleClient.booleanSchema.parse(include_headings);
319
770
  }
320
771
  if (include_notes !== void 0) {
321
- this.booleanSchema.parse(include_notes);
772
+ _BibleClient.booleanSchema.parse(include_notes);
322
773
  }
323
774
  const params = {
324
775
  format
@@ -337,7 +788,7 @@ var BibleClient = class {
337
788
  * @returns The BibleIndex object containing full hierarchy of books, chapters, and verses.
338
789
  */
339
790
  async getIndex(versionId) {
340
- this.versionIdSchema.parse(versionId);
791
+ _BibleClient.versionIdSchema.parse(versionId);
341
792
  return this.client.get(`/v1/bibles/${versionId}/index`);
342
793
  }
343
794
  /**
@@ -361,21 +812,38 @@ var BibleClient = class {
361
812
  * ```
362
813
  */
363
814
  async getVOTD(day) {
364
- const daySchema = z.number().int().min(1).max(366);
815
+ const daySchema = z12.number().int().min(1).max(366);
365
816
  daySchema.parse(day);
366
817
  return this.client.get(`/v1/verse_of_the_days/${day}`);
367
818
  }
368
819
  };
369
820
 
370
821
  // src/languages.ts
371
- import { z as z2 } from "zod";
372
- var LanguagesClient = class {
822
+ import { z as z13 } from "zod";
823
+ var LanguagesClient = class _LanguagesClient {
373
824
  client;
374
- languageIdSchema = z2.string().trim().min(1, "Language ID must be a non-empty string").regex(
825
+ static languageIdSchema = z13.string().trim().min(1, "Language ID must be a non-empty string").regex(
375
826
  /^[a-z]{2,3}(?:-[A-Z][a-z]{3})?$/,
376
827
  "Language ID must match BCP 47 format (language or language+script)"
377
828
  );
378
- countrySchema = z2.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase();
829
+ static countrySchema = z13.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase();
830
+ static GetLanguagesOptionsSchema = z13.object({
831
+ page_size: z13.union([z13.number(), z13.literal("*")]).optional(),
832
+ fields: z13.array(LanguageSchema.keyof()).optional(),
833
+ page_token: z13.string().optional(),
834
+ country: _LanguagesClient.countrySchema
835
+ }).refine(
836
+ (data) => {
837
+ if (data.page_size === "*") {
838
+ return data.fields && data.fields?.length >= 1 && data.fields?.length <= 3;
839
+ }
840
+ return true;
841
+ },
842
+ {
843
+ message: 'page_size="*" required 1-3 fields to be specified',
844
+ path: ["page_size", "fields"]
845
+ }
846
+ );
379
847
  /**
380
848
  * Creates a new LanguagesClient instance.
381
849
  * @param client The API client to use for requests.
@@ -391,12 +859,23 @@ var LanguagesClient = class {
391
859
  async getLanguages(options = {}) {
392
860
  const params = {};
393
861
  if (options.country !== void 0) {
394
- const country = this.countrySchema.parse(options.country);
862
+ const country = _LanguagesClient.countrySchema.parse(options.country);
395
863
  params.country = country;
396
864
  }
865
+ if (options.fields !== void 0) {
866
+ const fieldsSchema = z13.array(LanguageSchema.keyof());
867
+ fieldsSchema.parse(options.fields);
868
+ params["fields[]"] = options.fields;
869
+ }
397
870
  if (options.page_size !== void 0) {
398
- const pageSizeSchema = z2.number().int().positive();
871
+ const pageSizeSchema = z13.union([z13.number().int().positive(), z13.literal("*")]);
399
872
  pageSizeSchema.parse(options.page_size);
873
+ if (options.page_size === "*") {
874
+ const fieldsCount = options.fields?.length ?? 0;
875
+ if (fieldsCount < 1 || fieldsCount > 3) {
876
+ throw new Error('page_size="*" requires 1-3 fields to be specified');
877
+ }
878
+ }
400
879
  params.page_size = options.page_size;
401
880
  }
402
881
  if (options.page_token !== void 0) {
@@ -410,13 +889,13 @@ var LanguagesClient = class {
410
889
  * @returns The requested Language object.
411
890
  */
412
891
  async getLanguage(languageId) {
413
- this.languageIdSchema.parse(languageId);
892
+ _LanguagesClient.languageIdSchema.parse(languageId);
414
893
  return this.client.get(`/v1/languages/${languageId}`);
415
894
  }
416
895
  };
417
896
 
418
897
  // src/highlights.ts
419
- import { z as z3 } from "zod";
898
+ import { z as z14 } from "zod";
420
899
 
421
900
  // src/YouVersionPlatformConfiguration.ts
422
901
  var YouVersionPlatformConfiguration = class {
@@ -513,9 +992,9 @@ var YouVersionPlatformConfiguration = class {
513
992
  // src/highlights.ts
514
993
  var HighlightsClient = class {
515
994
  client;
516
- versionIdSchema = z3.number().int().positive("Version ID must be a positive integer");
517
- passageIdSchema = z3.string().trim().min(1, "Passage ID must be a non-empty string");
518
- colorSchema = z3.string().regex(/^[0-9a-f]{6}$/i, "Color must be a 6-character hex string without #");
995
+ versionIdSchema = z14.number().int().positive("Version ID must be a positive integer");
996
+ passageIdSchema = z14.string().trim().min(1, "Passage ID must be a non-empty string");
997
+ colorSchema = z14.string().regex(/^[0-9a-f]{6}$/i, "Color must be a 6-character hex string without #");
519
998
  /**
520
999
  * Creates a new HighlightsClient instance.
521
1000
  * @param client The API client to use for requests.
@@ -545,7 +1024,7 @@ var HighlightsClient = class {
545
1024
  try {
546
1025
  this.versionIdSchema.parse(value);
547
1026
  } catch (error) {
548
- if (error instanceof z3.ZodError) {
1027
+ if (error instanceof z14.ZodError) {
549
1028
  throw new Error("Version ID must be a positive integer");
550
1029
  }
551
1030
  throw error;
@@ -555,7 +1034,7 @@ var HighlightsClient = class {
555
1034
  try {
556
1035
  this.passageIdSchema.parse(value);
557
1036
  } catch (error) {
558
- if (error instanceof z3.ZodError) {
1037
+ if (error instanceof z14.ZodError) {
559
1038
  throw new Error("Passage ID must be a non-empty string");
560
1039
  }
561
1040
  throw error;
@@ -565,7 +1044,7 @@ var HighlightsClient = class {
565
1044
  try {
566
1045
  this.colorSchema.parse(value);
567
1046
  } catch (error) {
568
- if (error instanceof z3.ZodError) {
1047
+ if (error instanceof z14.ZodError) {
569
1048
  throw new Error("Color must be a 6-character hex string without #");
570
1049
  }
571
1050
  throw error;
@@ -1143,221 +1622,6 @@ var YouVersionAPI = class {
1143
1622
  return request;
1144
1623
  }
1145
1624
  };
1146
-
1147
- // src/utils/constants.ts
1148
- var BOOK_IDS = [
1149
- "GEN",
1150
- "EXO",
1151
- "LEV",
1152
- "NUM",
1153
- "DEU",
1154
- "JOS",
1155
- "JDG",
1156
- "RUT",
1157
- "1SA",
1158
- "2SA",
1159
- "1KI",
1160
- "2KI",
1161
- "1CH",
1162
- "2CH",
1163
- "EZR",
1164
- "NEH",
1165
- "EST",
1166
- "JOB",
1167
- "PSA",
1168
- "PRO",
1169
- "ECC",
1170
- "SNG",
1171
- "ISA",
1172
- "JER",
1173
- "LAM",
1174
- "EZK",
1175
- "DAN",
1176
- "HOS",
1177
- "JOL",
1178
- "AMO",
1179
- "OBA",
1180
- "JON",
1181
- "MIC",
1182
- "NAM",
1183
- "HAB",
1184
- "ZEP",
1185
- "HAG",
1186
- "ZEC",
1187
- "MAL",
1188
- "MAT",
1189
- "MRK",
1190
- "LUK",
1191
- "JHN",
1192
- "ACT",
1193
- "ROM",
1194
- "1CO",
1195
- "2CO",
1196
- "GAL",
1197
- "EPH",
1198
- "PHP",
1199
- "COL",
1200
- "1TH",
1201
- "2TH",
1202
- "1TI",
1203
- "2TI",
1204
- "TIT",
1205
- "PHM",
1206
- "HEB",
1207
- "JAS",
1208
- "1PE",
1209
- "2PE",
1210
- "1JN",
1211
- "2JN",
1212
- "3JN",
1213
- "JUD",
1214
- "REV",
1215
- // dc (Apocrypha) books
1216
- "TOB",
1217
- "JDT",
1218
- "ESG",
1219
- "WIS",
1220
- "SIR",
1221
- "BAR",
1222
- "LJE",
1223
- "S3Y",
1224
- "SUS",
1225
- "BEL",
1226
- "1MA",
1227
- "2MA",
1228
- "3MA",
1229
- "4MA",
1230
- "1ES",
1231
- "2ES",
1232
- "MAN",
1233
- "PS2",
1234
- "ODA",
1235
- "PSS",
1236
- "3ES",
1237
- "EZA",
1238
- "5EZ",
1239
- "6EZ",
1240
- "DAG",
1241
- "PS3",
1242
- "2BA",
1243
- "LBA",
1244
- "JUB",
1245
- "ENO",
1246
- "1MQ",
1247
- "2MQ",
1248
- "3MQ",
1249
- "REP",
1250
- "4BA",
1251
- "LAO",
1252
- // Luke-Acts combo, treated canonically as New Testament
1253
- "LKA"
1254
- ];
1255
- var BOOK_CANON = {
1256
- GEN: "old_testament",
1257
- EXO: "old_testament",
1258
- LEV: "old_testament",
1259
- NUM: "old_testament",
1260
- DEU: "old_testament",
1261
- JOS: "old_testament",
1262
- JDG: "old_testament",
1263
- RUT: "old_testament",
1264
- "1SA": "old_testament",
1265
- "2SA": "old_testament",
1266
- "1KI": "old_testament",
1267
- "2KI": "old_testament",
1268
- "1CH": "old_testament",
1269
- "2CH": "old_testament",
1270
- EZR: "old_testament",
1271
- NEH: "old_testament",
1272
- EST: "old_testament",
1273
- JOB: "old_testament",
1274
- PSA: "old_testament",
1275
- PRO: "old_testament",
1276
- ECC: "old_testament",
1277
- SNG: "old_testament",
1278
- ISA: "old_testament",
1279
- JER: "old_testament",
1280
- LAM: "old_testament",
1281
- EZK: "old_testament",
1282
- DAN: "old_testament",
1283
- HOS: "old_testament",
1284
- JOL: "old_testament",
1285
- AMO: "old_testament",
1286
- OBA: "old_testament",
1287
- JON: "old_testament",
1288
- MIC: "old_testament",
1289
- NAM: "old_testament",
1290
- HAB: "old_testament",
1291
- ZEP: "old_testament",
1292
- HAG: "old_testament",
1293
- ZEC: "old_testament",
1294
- MAL: "old_testament",
1295
- MAT: "new_testament",
1296
- MRK: "new_testament",
1297
- LUK: "new_testament",
1298
- JHN: "new_testament",
1299
- ACT: "new_testament",
1300
- ROM: "new_testament",
1301
- "1CO": "new_testament",
1302
- "2CO": "new_testament",
1303
- GAL: "new_testament",
1304
- EPH: "new_testament",
1305
- PHP: "new_testament",
1306
- COL: "new_testament",
1307
- "1TH": "new_testament",
1308
- "2TH": "new_testament",
1309
- "1TI": "new_testament",
1310
- "2TI": "new_testament",
1311
- TIT: "new_testament",
1312
- PHM: "new_testament",
1313
- HEB: "new_testament",
1314
- JAS: "new_testament",
1315
- "1PE": "new_testament",
1316
- "2PE": "new_testament",
1317
- "1JN": "new_testament",
1318
- "2JN": "new_testament",
1319
- "3JN": "new_testament",
1320
- JUD: "new_testament",
1321
- REV: "new_testament",
1322
- TOB: "deuterocanon",
1323
- JDT: "deuterocanon",
1324
- ESG: "deuterocanon",
1325
- WIS: "deuterocanon",
1326
- SIR: "deuterocanon",
1327
- BAR: "deuterocanon",
1328
- LJE: "deuterocanon",
1329
- S3Y: "deuterocanon",
1330
- SUS: "deuterocanon",
1331
- BEL: "deuterocanon",
1332
- "1MA": "deuterocanon",
1333
- "2MA": "deuterocanon",
1334
- "3MA": "deuterocanon",
1335
- "4MA": "deuterocanon",
1336
- "1ES": "deuterocanon",
1337
- "2ES": "deuterocanon",
1338
- MAN: "deuterocanon",
1339
- PS2: "deuterocanon",
1340
- ODA: "deuterocanon",
1341
- PSS: "deuterocanon",
1342
- "3ES": "deuterocanon",
1343
- EZA: "deuterocanon",
1344
- "5EZ": "deuterocanon",
1345
- "6EZ": "deuterocanon",
1346
- DAG: "deuterocanon",
1347
- PS3: "deuterocanon",
1348
- "2BA": "deuterocanon",
1349
- LBA: "deuterocanon",
1350
- JUB: "deuterocanon",
1351
- ENO: "deuterocanon",
1352
- "1MQ": "deuterocanon",
1353
- "2MQ": "deuterocanon",
1354
- "3MQ": "deuterocanon",
1355
- REP: "deuterocanon",
1356
- "4BA": "deuterocanon",
1357
- LAO: "deuterocanon",
1358
- LKA: "new_testament"
1359
- // Luke-Acts combo, treated canonically as New Testament
1360
- };
1361
1625
  export {
1362
1626
  ApiClient,
1363
1627
  BOOK_CANON,