@youversion/platform-core 1.0.1 → 1.1.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @youversion/platform-core@1.0.1 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
2
+ > @youversion/platform-core@1.1.0 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
3
3
  > tsup src/index.ts --format cjs,esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es2022
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.js 40.66 KB
12
- ESM ⚡️ Build success in 45ms
13
11
  CJS dist/index.cjs 42.47 KB
14
- CJS ⚡️ Build success in 47ms
12
+ CJS ⚡️ Build success in 31ms
13
+ ESM dist/index.js 40.66 KB
14
+ ESM ⚡️ Build success in 31ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 1869ms
17
- DTS dist/index.d.cts 31.82 KB
18
- DTS dist/index.d.ts 31.82 KB
16
+ DTS ⚡️ Build success in 1861ms
17
+ DTS dist/index.d.cts 32.01 KB
18
+ DTS dist/index.d.ts 32.01 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @youversion/platform-core
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - efb1030: feat(core): make data objects that should be immutable readonly
8
+ - changed data types that come from api responses and should not
9
+ be mutated to be readonly.
10
+ - See the documentation on these types, https://developers.youversion.com/sdks/react#referenced-types
11
+
3
12
  ## 1.0.1
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -15,14 +15,14 @@ declare const BibleVersionSchema: z.ZodObject<{
15
15
  books: z.ZodArray<z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>>;
16
16
  youversion_deep_link: z.ZodURL;
17
17
  }, z.core.$strip>;
18
- type BibleVersion = z.infer<typeof BibleVersionSchema>;
18
+ type BibleVersion = Readonly<z.infer<typeof BibleVersionSchema>>;
19
19
 
20
20
  declare const CanonSchema: z.ZodEnum<{
21
21
  old_testament: "old_testament";
22
22
  new_testament: "new_testament";
23
23
  deuterocanon: "deuterocanon";
24
24
  }>;
25
- type Canon = z.infer<typeof CanonSchema>;
25
+ type Canon = Readonly<z.infer<typeof CanonSchema>>;
26
26
  declare const BookUsfmSchema: z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>;
27
27
  type BookUsfm = z.infer<typeof BookUsfmSchema>;
28
28
  declare const BibleBookSchema: z.ZodObject<{
@@ -46,8 +46,8 @@ declare const BibleBookSchema: z.ZodObject<{
46
46
  }, z.core.$strip>>>;
47
47
  }, z.core.$strip>>>;
48
48
  }, z.core.$strip>;
49
- type BibleBook = z.infer<typeof BibleBookSchema>;
50
- type CANON = z.infer<typeof CanonSchema>;
49
+ type BibleBook = Readonly<z.infer<typeof BibleBookSchema>>;
50
+ type CANON = Readonly<z.infer<typeof CanonSchema>>;
51
51
 
52
52
  declare const BibleChapterSchema: z.ZodObject<{
53
53
  id: z.ZodString;
@@ -59,33 +59,33 @@ declare const BibleChapterSchema: z.ZodObject<{
59
59
  title: z.ZodString;
60
60
  }, z.core.$strip>>>;
61
61
  }, z.core.$strip>;
62
- type BibleChapter = z.infer<typeof BibleChapterSchema>;
62
+ type BibleChapter = Readonly<z.infer<typeof BibleChapterSchema>>;
63
63
 
64
64
  declare const BibleVerseSchema: z.ZodObject<{
65
65
  id: z.ZodString;
66
66
  passage_id: z.ZodString;
67
67
  title: z.ZodString;
68
68
  }, z.core.$strip>;
69
- type BibleVerse = z.infer<typeof BibleVerseSchema>;
69
+ type BibleVerse = Readonly<z.infer<typeof BibleVerseSchema>>;
70
70
 
71
71
  declare const BiblePassageSchema: z.ZodObject<{
72
72
  id: z.ZodString;
73
73
  content: z.ZodString;
74
74
  reference: z.ZodString;
75
75
  }, z.core.$strip>;
76
- type BiblePassage = z.infer<typeof BiblePassageSchema>;
76
+ type BiblePassage = Readonly<z.infer<typeof BiblePassageSchema>>;
77
77
 
78
78
  declare const VOTDSchema: z.ZodObject<{
79
79
  day: z.ZodNumber;
80
80
  passage_id: z.ZodString;
81
81
  }, z.core.$strip>;
82
- type VOTD = z.infer<typeof VOTDSchema>;
82
+ type VOTD = Readonly<z.infer<typeof VOTDSchema>>;
83
83
 
84
84
  declare const BibleIndexVerseSchema: z.ZodObject<{
85
85
  id: z.ZodString;
86
86
  title: z.ZodString;
87
87
  }, z.core.$strip>;
88
- type BibleIndexVerse = z.infer<typeof BibleIndexVerseSchema>;
88
+ type BibleIndexVerse = Readonly<z.infer<typeof BibleIndexVerseSchema>>;
89
89
  declare const BibleIndexChapterSchema: z.ZodObject<{
90
90
  id: z.ZodString;
91
91
  title: z.ZodString;
@@ -94,7 +94,7 @@ declare const BibleIndexChapterSchema: z.ZodObject<{
94
94
  title: z.ZodString;
95
95
  }, z.core.$strip>>;
96
96
  }, z.core.$strip>;
97
- type BibleIndexChapter = z.infer<typeof BibleIndexChapterSchema>;
97
+ type BibleIndexChapter = Readonly<z.infer<typeof BibleIndexChapterSchema>>;
98
98
  declare const BibleIndexBookSchema: z.ZodObject<{
99
99
  id: z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>;
100
100
  title: z.ZodString;
@@ -114,7 +114,7 @@ declare const BibleIndexBookSchema: z.ZodObject<{
114
114
  }, z.core.$strip>>;
115
115
  }, z.core.$strip>>;
116
116
  }, z.core.$strip>;
117
- type BibleIndexBook = z.infer<typeof BibleIndexBookSchema>;
117
+ type BibleIndexBook = Readonly<z.infer<typeof BibleIndexBookSchema>>;
118
118
  declare const _BibleIndexSchema: z.ZodObject<{
119
119
  text_direction: z.ZodString;
120
120
  books: z.ZodArray<z.ZodObject<{
@@ -137,7 +137,7 @@ declare const _BibleIndexSchema: z.ZodObject<{
137
137
  }, z.core.$strip>>;
138
138
  }, z.core.$strip>>;
139
139
  }, z.core.$strip>;
140
- type BibleIndex = z.infer<typeof _BibleIndexSchema>;
140
+ type BibleIndex = Readonly<z.infer<typeof _BibleIndexSchema>>;
141
141
 
142
142
  declare const LanguageSchema: z.ZodObject<{
143
143
  id: z.ZodString;
@@ -157,7 +157,7 @@ declare const LanguageSchema: z.ZodObject<{
157
157
  speaking_population: z.ZodOptional<z.ZodNumber>;
158
158
  default_bible_version_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
159
159
  }, z.core.$strip>;
160
- type Language = z.infer<typeof LanguageSchema>;
160
+ type Language = Readonly<z.infer<typeof LanguageSchema>>;
161
161
 
162
162
  declare const _UserSchema: z.ZodObject<{
163
163
  avatar_url: z.ZodString;
@@ -183,11 +183,11 @@ type CreateHighlight = z.infer<typeof _CreateHighlightSchema>;
183
183
  /**
184
184
  * Generic Collection type for paginated responses
185
185
  */
186
- type Collection<T> = {
186
+ type Collection<T> = Readonly<{
187
187
  data: T[];
188
188
  next_page_token: string | null;
189
189
  total_size?: number;
190
- };
190
+ }>;
191
191
 
192
192
  interface ApiConfig {
193
193
  apiHost?: string;
@@ -228,12 +228,12 @@ declare class SignInWithYouVersionResult {
228
228
 
229
229
  type SignInWithYouVersionPermissionValues = (typeof SignInWithYouVersionPermission)[keyof typeof SignInWithYouVersionPermission];
230
230
  interface AuthenticationState {
231
- isAuthenticated: boolean;
232
- isLoading: boolean;
233
- accessToken: string | null;
234
- idToken: string | null;
235
- result: SignInWithYouVersionResult | null;
236
- error: Error | null;
231
+ readonly isAuthenticated: boolean;
232
+ readonly isLoading: boolean;
233
+ readonly accessToken: string | null;
234
+ readonly idToken: string | null;
235
+ readonly result: SignInWithYouVersionResult | null;
236
+ readonly error: Error | null;
237
237
  }
238
238
  type AuthenticationScopes = 'profile' | 'email';
239
239
 
package/dist/index.d.ts CHANGED
@@ -15,14 +15,14 @@ declare const BibleVersionSchema: z.ZodObject<{
15
15
  books: z.ZodArray<z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>>;
16
16
  youversion_deep_link: z.ZodURL;
17
17
  }, z.core.$strip>;
18
- type BibleVersion = z.infer<typeof BibleVersionSchema>;
18
+ type BibleVersion = Readonly<z.infer<typeof BibleVersionSchema>>;
19
19
 
20
20
  declare const CanonSchema: z.ZodEnum<{
21
21
  old_testament: "old_testament";
22
22
  new_testament: "new_testament";
23
23
  deuterocanon: "deuterocanon";
24
24
  }>;
25
- type Canon = z.infer<typeof CanonSchema>;
25
+ type Canon = Readonly<z.infer<typeof CanonSchema>>;
26
26
  declare const BookUsfmSchema: z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>;
27
27
  type BookUsfm = z.infer<typeof BookUsfmSchema>;
28
28
  declare const BibleBookSchema: z.ZodObject<{
@@ -46,8 +46,8 @@ declare const BibleBookSchema: z.ZodObject<{
46
46
  }, z.core.$strip>>>;
47
47
  }, z.core.$strip>>>;
48
48
  }, z.core.$strip>;
49
- type BibleBook = z.infer<typeof BibleBookSchema>;
50
- type CANON = z.infer<typeof CanonSchema>;
49
+ type BibleBook = Readonly<z.infer<typeof BibleBookSchema>>;
50
+ type CANON = Readonly<z.infer<typeof CanonSchema>>;
51
51
 
52
52
  declare const BibleChapterSchema: z.ZodObject<{
53
53
  id: z.ZodString;
@@ -59,33 +59,33 @@ declare const BibleChapterSchema: z.ZodObject<{
59
59
  title: z.ZodString;
60
60
  }, z.core.$strip>>>;
61
61
  }, z.core.$strip>;
62
- type BibleChapter = z.infer<typeof BibleChapterSchema>;
62
+ type BibleChapter = Readonly<z.infer<typeof BibleChapterSchema>>;
63
63
 
64
64
  declare const BibleVerseSchema: z.ZodObject<{
65
65
  id: z.ZodString;
66
66
  passage_id: z.ZodString;
67
67
  title: z.ZodString;
68
68
  }, z.core.$strip>;
69
- type BibleVerse = z.infer<typeof BibleVerseSchema>;
69
+ type BibleVerse = Readonly<z.infer<typeof BibleVerseSchema>>;
70
70
 
71
71
  declare const BiblePassageSchema: z.ZodObject<{
72
72
  id: z.ZodString;
73
73
  content: z.ZodString;
74
74
  reference: z.ZodString;
75
75
  }, z.core.$strip>;
76
- type BiblePassage = z.infer<typeof BiblePassageSchema>;
76
+ type BiblePassage = Readonly<z.infer<typeof BiblePassageSchema>>;
77
77
 
78
78
  declare const VOTDSchema: z.ZodObject<{
79
79
  day: z.ZodNumber;
80
80
  passage_id: z.ZodString;
81
81
  }, z.core.$strip>;
82
- type VOTD = z.infer<typeof VOTDSchema>;
82
+ type VOTD = Readonly<z.infer<typeof VOTDSchema>>;
83
83
 
84
84
  declare const BibleIndexVerseSchema: z.ZodObject<{
85
85
  id: z.ZodString;
86
86
  title: z.ZodString;
87
87
  }, z.core.$strip>;
88
- type BibleIndexVerse = z.infer<typeof BibleIndexVerseSchema>;
88
+ type BibleIndexVerse = Readonly<z.infer<typeof BibleIndexVerseSchema>>;
89
89
  declare const BibleIndexChapterSchema: z.ZodObject<{
90
90
  id: z.ZodString;
91
91
  title: z.ZodString;
@@ -94,7 +94,7 @@ declare const BibleIndexChapterSchema: z.ZodObject<{
94
94
  title: z.ZodString;
95
95
  }, z.core.$strip>>;
96
96
  }, z.core.$strip>;
97
- type BibleIndexChapter = z.infer<typeof BibleIndexChapterSchema>;
97
+ type BibleIndexChapter = Readonly<z.infer<typeof BibleIndexChapterSchema>>;
98
98
  declare const BibleIndexBookSchema: z.ZodObject<{
99
99
  id: z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>;
100
100
  title: z.ZodString;
@@ -114,7 +114,7 @@ declare const BibleIndexBookSchema: z.ZodObject<{
114
114
  }, z.core.$strip>>;
115
115
  }, z.core.$strip>>;
116
116
  }, z.core.$strip>;
117
- type BibleIndexBook = z.infer<typeof BibleIndexBookSchema>;
117
+ type BibleIndexBook = Readonly<z.infer<typeof BibleIndexBookSchema>>;
118
118
  declare const _BibleIndexSchema: z.ZodObject<{
119
119
  text_direction: z.ZodString;
120
120
  books: z.ZodArray<z.ZodObject<{
@@ -137,7 +137,7 @@ declare const _BibleIndexSchema: z.ZodObject<{
137
137
  }, z.core.$strip>>;
138
138
  }, z.core.$strip>>;
139
139
  }, z.core.$strip>;
140
- type BibleIndex = z.infer<typeof _BibleIndexSchema>;
140
+ type BibleIndex = Readonly<z.infer<typeof _BibleIndexSchema>>;
141
141
 
142
142
  declare const LanguageSchema: z.ZodObject<{
143
143
  id: z.ZodString;
@@ -157,7 +157,7 @@ declare const LanguageSchema: z.ZodObject<{
157
157
  speaking_population: z.ZodOptional<z.ZodNumber>;
158
158
  default_bible_version_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
159
159
  }, z.core.$strip>;
160
- type Language = z.infer<typeof LanguageSchema>;
160
+ type Language = Readonly<z.infer<typeof LanguageSchema>>;
161
161
 
162
162
  declare const _UserSchema: z.ZodObject<{
163
163
  avatar_url: z.ZodString;
@@ -183,11 +183,11 @@ type CreateHighlight = z.infer<typeof _CreateHighlightSchema>;
183
183
  /**
184
184
  * Generic Collection type for paginated responses
185
185
  */
186
- type Collection<T> = {
186
+ type Collection<T> = Readonly<{
187
187
  data: T[];
188
188
  next_page_token: string | null;
189
189
  total_size?: number;
190
- };
190
+ }>;
191
191
 
192
192
  interface ApiConfig {
193
193
  apiHost?: string;
@@ -228,12 +228,12 @@ declare class SignInWithYouVersionResult {
228
228
 
229
229
  type SignInWithYouVersionPermissionValues = (typeof SignInWithYouVersionPermission)[keyof typeof SignInWithYouVersionPermission];
230
230
  interface AuthenticationState {
231
- isAuthenticated: boolean;
232
- isLoading: boolean;
233
- accessToken: string | null;
234
- idToken: string | null;
235
- result: SignInWithYouVersionResult | null;
236
- error: Error | null;
231
+ readonly isAuthenticated: boolean;
232
+ readonly isLoading: boolean;
233
+ readonly accessToken: string | null;
234
+ readonly idToken: string | null;
235
+ readonly result: SignInWithYouVersionResult | null;
236
+ readonly error: Error | null;
237
237
  }
238
238
  type AuthenticationScopes = 'profile' | 'email';
239
239
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/platform-core",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -8,7 +8,7 @@ const BibleIndexVerseSchema = z.object({
8
8
  title: z.string(),
9
9
  });
10
10
 
11
- export type BibleIndexVerse = z.infer<typeof BibleIndexVerseSchema>;
11
+ export type BibleIndexVerse = Readonly<z.infer<typeof BibleIndexVerseSchema>>;
12
12
 
13
13
  const BibleIndexChapterSchema = z.object({
14
14
  /** Chapter identifier */
@@ -19,7 +19,7 @@ const BibleIndexChapterSchema = z.object({
19
19
  verses: z.array(BibleIndexVerseSchema),
20
20
  });
21
21
 
22
- export type BibleIndexChapter = z.infer<typeof BibleIndexChapterSchema>;
22
+ export type BibleIndexChapter = Readonly<z.infer<typeof BibleIndexChapterSchema>>;
23
23
 
24
24
  const BibleIndexBookSchema = z.object({
25
25
  /** Book identifier */
@@ -36,7 +36,7 @@ const BibleIndexBookSchema = z.object({
36
36
  chapters: z.array(BibleIndexChapterSchema),
37
37
  });
38
38
 
39
- export type BibleIndexBook = z.infer<typeof BibleIndexBookSchema>;
39
+ export type BibleIndexBook = Readonly<z.infer<typeof BibleIndexBookSchema>>;
40
40
 
41
41
  const _BibleIndexSchema = z.object({
42
42
  /** Text direction (e.g., "ltr") */
@@ -45,4 +45,4 @@ const _BibleIndexSchema = z.object({
45
45
  books: z.array(BibleIndexBookSchema),
46
46
  });
47
47
 
48
- export type BibleIndex = z.infer<typeof _BibleIndexSchema>;
48
+ export type BibleIndex = Readonly<z.infer<typeof _BibleIndexSchema>>;
@@ -3,7 +3,7 @@ import { BOOK_IDS } from '../utils/constants';
3
3
  import { BibleChapterSchema } from './chapter';
4
4
 
5
5
  export const CanonSchema = z.enum(['old_testament', 'new_testament', 'deuterocanon']);
6
- export type Canon = z.infer<typeof CanonSchema>;
6
+ export type Canon = Readonly<z.infer<typeof CanonSchema>>;
7
7
 
8
8
  // https://github.com/colinhacks/zod/discussions/4934#discussioncomment-13858053
9
9
  export const BookUsfmSchema = z.union([
@@ -27,5 +27,5 @@ export const BibleBookSchema = z.object({
27
27
  chapters: z.array(BibleChapterSchema).optional(),
28
28
  });
29
29
 
30
- export type BibleBook = z.infer<typeof BibleBookSchema>;
31
- export type CANON = z.infer<typeof CanonSchema>;
30
+ export type BibleBook = Readonly<z.infer<typeof BibleBookSchema>>;
31
+ export type CANON = Readonly<z.infer<typeof CanonSchema>>;
@@ -12,4 +12,4 @@ export const BibleChapterSchema = z.object({
12
12
  verses: z.array(BibleVerseSchema).optional(),
13
13
  });
14
14
 
15
- export type BibleChapter = z.infer<typeof BibleChapterSchema>;
15
+ export type BibleChapter = Readonly<z.infer<typeof BibleChapterSchema>>;
@@ -21,8 +21,8 @@ const _CollectionSchema = <T extends z.ZodTypeAny>(
21
21
  /**
22
22
  * Generic Collection type for paginated responses
23
23
  */
24
- export type Collection<T> = {
24
+ export type Collection<T> = Readonly<{
25
25
  data: T[];
26
26
  next_page_token: string | null;
27
27
  total_size?: number;
28
- };
28
+ }>;
@@ -35,4 +35,4 @@ export const LanguageSchema = z.object({
35
35
  default_bible_version_id: z.number().int().nullable().optional(),
36
36
  });
37
37
 
38
- export type Language = z.infer<typeof LanguageSchema>;
38
+ export type Language = Readonly<z.infer<typeof LanguageSchema>>;
@@ -9,4 +9,4 @@ export const BiblePassageSchema = z.object({
9
9
  reference: z.string(),
10
10
  });
11
11
 
12
- export type BiblePassage = z.infer<typeof BiblePassageSchema>;
12
+ export type BiblePassage = Readonly<z.infer<typeof BiblePassageSchema>>;
@@ -9,4 +9,4 @@ export const BibleVerseSchema = z.object({
9
9
  title: z.string(),
10
10
  });
11
11
 
12
- export type BibleVerse = z.infer<typeof BibleVerseSchema>;
12
+ export type BibleVerse = Readonly<z.infer<typeof BibleVerseSchema>>;
@@ -30,4 +30,4 @@ export const BibleVersionSchema = z.object({
30
30
  youversion_deep_link: z.url(),
31
31
  });
32
32
 
33
- export type BibleVersion = z.infer<typeof BibleVersionSchema>;
33
+ export type BibleVersion = Readonly<z.infer<typeof BibleVersionSchema>>;
@@ -7,4 +7,4 @@ export const VOTDSchema = z.object({
7
7
  passage_id: z.string(),
8
8
  });
9
9
 
10
- export type VOTD = z.infer<typeof VOTDSchema>;
10
+ export type VOTD = Readonly<z.infer<typeof VOTDSchema>>;
package/src/types/auth.ts CHANGED
@@ -7,12 +7,12 @@ export type SignInWithYouVersionPermissionValues =
7
7
  (typeof SignInWithYouVersionPermission)[keyof typeof SignInWithYouVersionPermission];
8
8
 
9
9
  export interface AuthenticationState {
10
- isAuthenticated: boolean;
11
- isLoading: boolean;
12
- accessToken: string | null;
13
- idToken: string | null;
14
- result: SignInWithYouVersionResult | null;
15
- error: Error | null;
10
+ readonly isAuthenticated: boolean;
11
+ readonly isLoading: boolean;
12
+ readonly accessToken: string | null;
13
+ readonly idToken: string | null;
14
+ readonly result: SignInWithYouVersionResult | null;
15
+ readonly error: Error | null;
16
16
  }
17
17
 
18
18
  export type AuthenticationScopes = 'profile' | 'email';
package/src/types/book.ts CHANGED
@@ -1,11 +1,11 @@
1
- export type BibleBook = {
1
+ export type BibleBook = Readonly<{
2
2
  id: BOOK_ID; // Book identifier (USFM)
3
3
  title: string;
4
4
  abbreviation?: string; // Book name abbreviation if provided by publisher
5
5
  canon: CANON;
6
6
  // eslint-disable-next-line @typescript-eslint/array-type -- Array<> syntax required for template literal type to represent chapter references
7
7
  chapters?: Array<`${BOOK_ID}.${number | `INTRO${number}`}`>; // Ordered list of chapter ids for given Bible and book (e.g., ["GEN.1", "GEN.2", "3JN.INTRO1", "3JN.1"])
8
- };
8
+ }>;
9
9
 
10
10
  export type BOOK_ID =
11
11
  | 'GEN'
@@ -1,5 +1,5 @@
1
- export type BibleChapter = {
1
+ export type BibleChapter = Readonly<{
2
2
  usfm: string;
3
3
  title: string;
4
4
  content?: string;
5
- };
5
+ }>;