@youversion/platform-core 0.8.0 → 0.8.2

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.
@@ -4,14 +4,17 @@ import { handlers } from './handlers';
4
4
 
5
5
  export const server = setupServer(...handlers);
6
6
 
7
- beforeAll(() => {
8
- server.listen();
9
- });
7
+ // Only setup MSW if INTEGRATION_TESTS env var is not set
8
+ if (!process.env.INTEGRATION_TESTS) {
9
+ beforeAll(() => {
10
+ server.listen();
11
+ });
10
12
 
11
- afterEach(() => {
12
- server.resetHandlers();
13
- });
13
+ afterEach(() => {
14
+ server.resetHandlers();
15
+ });
14
16
 
15
- afterAll(() => {
16
- server.close();
17
- });
17
+ afterAll(() => {
18
+ server.close();
19
+ });
20
+ }
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { BOOK_IDS } from '../utils/constants';
3
+ import { BibleChapterSchema } from './chapter';
3
4
 
4
5
  export const CanonSchema = z.enum([
5
6
  'ot', // Old Testament
@@ -20,14 +21,14 @@ export const BibleBookSchema = z.object({
20
21
  id: BookUsfmSchema,
21
22
  /** Book title (e.g., "Genesis") */
22
23
  title: z.string(),
24
+ /** Full Book title (e.g., "The First Book of Moses, Commonly Called Genesis") */
25
+ full_title: z.string(),
23
26
  /** Book abbreviation (e.g., "Gen") */
24
27
  abbreviation: z.string().optional(),
25
28
  /** Canonical section (new_testament, old_testament, deuterocanon) */
26
29
  canon: CanonSchema,
27
30
  /** Array of chapter identifiers (e.g., ["GEN.1", "GEN.2", "GEN.3"]) */
28
- chapters: z
29
- .array(z.string().regex(/^\w{3}\.\d+$/, { message: 'Chapter must be an integer string' }))
30
- .optional(),
31
+ chapters: z.array(BibleChapterSchema).optional(),
31
32
  });
32
33
 
33
34
  export type BibleBook = z.infer<typeof BibleBookSchema>;
@@ -1,24 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { BookUsfmSchema } from './book';
2
+ import { BibleVerseSchema } from './verse';
3
3
 
4
4
  export const BibleChapterSchema = z.object({
5
5
  /** Chapter identifier (e.g., "1") */
6
6
  id: z.string(),
7
- /** Book identifier (e.g., "MAT") */
8
- book_id: BookUsfmSchema,
9
7
  /** Passage identifier (e.g., "MAT.1") */
10
8
  passage_id: z.string(),
11
9
  /** Chapter title (e.g., "1") */
12
10
  title: z.string(),
13
- /** Array of verse identifiers (e.g., ["1", "2", "3"]) */
14
- verses: z
15
- .array(
16
- z
17
- .string()
18
- .regex(/^\d+$/, { message: 'Verse must be an integer string' })
19
- .transform((val) => val as `${number}`),
20
- )
21
- .optional(),
11
+ /** Array of verses */
12
+ verses: z.array(BibleVerseSchema).optional(),
22
13
  });
23
14
 
24
15
  export type BibleChapter = z.infer<typeof BibleChapterSchema>;
@@ -5,10 +5,8 @@ export const BiblePassageSchema = z.object({
5
5
  id: z.string(),
6
6
  /** Passage content text */
7
7
  content: z.string(),
8
- /** Bible version identifier */
9
- bible_id: z.number().int().positive(),
10
8
  /** Human-readable reference (e.g., "Matthew 1:1") */
11
- human_reference: z.string(),
9
+ reference: z.string(),
12
10
  });
13
11
 
14
12
  export type BiblePassage = z.infer<typeof BiblePassageSchema>;
@@ -1,17 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { BookUsfmSchema } from './book';
3
2
 
4
3
  export const BibleVerseSchema = z.object({
5
4
  /** Verse identifier (e.g., "1") */
6
5
  id: z.string(),
7
- /** Book identifier (e.g., "MAT") */
8
- book_id: BookUsfmSchema,
9
- /** Chapter identifier (e.g., "1") */
10
- chapter_id: z.string(),
11
6
  /** Passage identifier (e.g., "MAT.1.1") */
12
7
  passage_id: z.string(),
13
- /** Human-readable reference (e.g., "Matthew 1:1") */
14
- reference: z.string(),
8
+ /** Verse Number (e.g., "1") */
9
+ title: z.string(),
15
10
  });
16
11
 
17
12
  export type BibleVerse = z.infer<typeof BibleVerseSchema>;
@@ -17,9 +17,9 @@ export const BibleVersionSchema = z.object({
17
17
  /** Language tag (e.g., "en") */
18
18
  language_tag: z.string(),
19
19
  /** Localized abbreviation */
20
- local_abbreviation: z.string(),
20
+ localized_abbreviation: z.string(),
21
21
  /** Localized title */
22
- local_title: z.string(),
22
+ localized_title: z.string(),
23
23
  /** Organization ID of publisher */
24
24
  organization_id: z.string().nullable().optional(),
25
25
  /** Full title */