free-use-bible-api 0.1.2 → 0.2.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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +101 -70
  3. package/dist/cjs/FreeUseBibleApi.cjs +296 -0
  4. package/dist/cjs/FreeUseBibleApi.cjs.map +7 -0
  5. package/dist/cjs/index.cjs +25 -0
  6. package/dist/cjs/index.cjs.map +7 -0
  7. package/dist/cjs/types.gen.cjs +17 -0
  8. package/dist/cjs/types.gen.cjs.map +7 -0
  9. package/dist/esm/FreeUseBibleApi.js +270 -0
  10. package/dist/esm/FreeUseBibleApi.js.map +7 -0
  11. package/dist/esm/index.js +2 -3
  12. package/dist/esm/index.js.map +2 -2
  13. package/dist/esm/types.gen.js +2 -0
  14. package/dist/esm/types.gen.js.map +7 -0
  15. package/dist/types/FreeUseBibleApi.d.ts +247 -0
  16. package/dist/types/index.d.ts +2 -3
  17. package/dist/types/types.gen.d.ts +1147 -0
  18. package/package.json +33 -31
  19. package/dist/esm/apis/DefaultApi.js +0 -416
  20. package/dist/esm/apis/DefaultApi.js.map +0 -7
  21. package/dist/esm/apis/FreeUseBibleApi.js +0 -61
  22. package/dist/esm/apis/FreeUseBibleApi.js.map +0 -7
  23. package/dist/esm/apis/index.js +0 -4
  24. package/dist/esm/apis/index.js.map +0 -7
  25. package/dist/esm/models/ApiAvailableCommentaries.js +0 -32
  26. package/dist/esm/models/ApiAvailableCommentaries.js.map +0 -7
  27. package/dist/esm/models/ApiAvailableDatasets.js +0 -32
  28. package/dist/esm/models/ApiAvailableDatasets.js.map +0 -7
  29. package/dist/esm/models/ApiAvailableTranslations.js +0 -32
  30. package/dist/esm/models/ApiAvailableTranslations.js.map +0 -7
  31. package/dist/esm/models/ApiCommentary.js +0 -81
  32. package/dist/esm/models/ApiCommentary.js.map +0 -7
  33. package/dist/esm/models/ApiCommentaryBook.js +0 -63
  34. package/dist/esm/models/ApiCommentaryBook.js.map +0 -7
  35. package/dist/esm/models/ApiCommentaryBookChapter.js +0 -58
  36. package/dist/esm/models/ApiCommentaryBookChapter.js.map +0 -7
  37. package/dist/esm/models/ApiCommentaryBookChapterChapter.js +0 -37
  38. package/dist/esm/models/ApiCommentaryBookChapterChapter.js.map +0 -7
  39. package/dist/esm/models/ApiCommentaryBooks.js +0 -39
  40. package/dist/esm/models/ApiCommentaryBooks.js.map +0 -7
  41. package/dist/esm/models/ApiDataset.js +0 -77
  42. package/dist/esm/models/ApiDataset.js.map +0 -7
  43. package/dist/esm/models/ApiDatasetBook.js +0 -56
  44. package/dist/esm/models/ApiDatasetBook.js.map +0 -7
  45. package/dist/esm/models/ApiDatasetBookChapter.js +0 -61
  46. package/dist/esm/models/ApiDatasetBookChapter.js.map +0 -7
  47. package/dist/esm/models/ApiDatasetBooks.js +0 -39
  48. package/dist/esm/models/ApiDatasetBooks.js.map +0 -7
  49. package/dist/esm/models/ApiTranslation.js +0 -87
  50. package/dist/esm/models/ApiTranslation.js.map +0 -7
  51. package/dist/esm/models/ApiTranslationBook.js +0 -64
  52. package/dist/esm/models/ApiTranslationBook.js.map +0 -7
  53. package/dist/esm/models/ApiTranslationBookChapter.js +0 -67
  54. package/dist/esm/models/ApiTranslationBookChapter.js.map +0 -7
  55. package/dist/esm/models/ApiTranslationBookChapterChapter.js +0 -42
  56. package/dist/esm/models/ApiTranslationBookChapterChapter.js.map +0 -7
  57. package/dist/esm/models/ApiTranslationBooks.js +0 -39
  58. package/dist/esm/models/ApiTranslationBooks.js.map +0 -7
  59. package/dist/esm/models/ApiTranslationComplete.js +0 -39
  60. package/dist/esm/models/ApiTranslationComplete.js.map +0 -7
  61. package/dist/esm/models/ApiTranslationCompleteBook.js +0 -59
  62. package/dist/esm/models/ApiTranslationCompleteBook.js.map +0 -7
  63. package/dist/esm/models/BookId.js +0 -127
  64. package/dist/esm/models/BookId.js.map +0 -7
  65. package/dist/esm/models/ChapterContent.js +0 -58
  66. package/dist/esm/models/ChapterContent.js.map +0 -7
  67. package/dist/esm/models/ChapterFootnote.js +0 -44
  68. package/dist/esm/models/ChapterFootnote.js.map +0 -7
  69. package/dist/esm/models/ChapterFootnoteCaller.js +0 -17
  70. package/dist/esm/models/ChapterFootnoteCaller.js.map +0 -7
  71. package/dist/esm/models/ChapterFootnoteReference.js +0 -31
  72. package/dist/esm/models/ChapterFootnoteReference.js.map +0 -7
  73. package/dist/esm/models/ChapterHeading.js +0 -34
  74. package/dist/esm/models/ChapterHeading.js.map +0 -7
  75. package/dist/esm/models/ChapterHebrewSubtitle.js +0 -38
  76. package/dist/esm/models/ChapterHebrewSubtitle.js.map +0 -7
  77. package/dist/esm/models/ChapterHebrewSubtitleContentInner.js +0 -35
  78. package/dist/esm/models/ChapterHebrewSubtitleContentInner.js.map +0 -7
  79. package/dist/esm/models/ChapterLineBreak.js +0 -31
  80. package/dist/esm/models/ChapterLineBreak.js.map +0 -7
  81. package/dist/esm/models/ChapterVerse.js +0 -41
  82. package/dist/esm/models/ChapterVerse.js.map +0 -7
  83. package/dist/esm/models/ChapterVerseContentInner.js +0 -44
  84. package/dist/esm/models/ChapterVerseContentInner.js.map +0 -7
  85. package/dist/esm/models/DatasetChapterData.js +0 -35
  86. package/dist/esm/models/DatasetChapterData.js.map +0 -7
  87. package/dist/esm/models/DatasetChapterVerseContent.js +0 -35
  88. package/dist/esm/models/DatasetChapterVerseContent.js.map +0 -7
  89. package/dist/esm/models/FormattedText.js +0 -32
  90. package/dist/esm/models/FormattedText.js.map +0 -7
  91. package/dist/esm/models/InlineHeading.js +0 -28
  92. package/dist/esm/models/InlineHeading.js.map +0 -7
  93. package/dist/esm/models/InlineLineBreak.js +0 -31
  94. package/dist/esm/models/InlineLineBreak.js.map +0 -7
  95. package/dist/esm/models/ScoredVerseRef.js +0 -47
  96. package/dist/esm/models/ScoredVerseRef.js.map +0 -7
  97. package/dist/esm/models/TranslationBookChapter.js +0 -35
  98. package/dist/esm/models/TranslationBookChapter.js.map +0 -7
  99. package/dist/esm/models/VerseFootnoteReference.js +0 -28
  100. package/dist/esm/models/VerseFootnoteReference.js.map +0 -7
  101. package/dist/esm/models/index.js +0 -40
  102. package/dist/esm/models/index.js.map +0 -7
  103. package/dist/esm/runtime.js +0 -304
  104. package/dist/esm/runtime.js.map +0 -7
  105. package/dist/types/apis/DefaultApi.d.ts +0 -176
  106. package/dist/types/apis/FreeUseBibleApi.d.ts +0 -34
  107. package/dist/types/apis/index.d.ts +0 -3
  108. package/dist/types/models/ApiAvailableCommentaries.d.ts +0 -34
  109. package/dist/types/models/ApiAvailableDatasets.d.ts +0 -34
  110. package/dist/types/models/ApiAvailableTranslations.d.ts +0 -34
  111. package/dist/types/models/ApiCommentary.d.ts +0 -145
  112. package/dist/types/models/ApiCommentaryBook.d.ts +0 -100
  113. package/dist/types/models/ApiCommentaryBookChapter.d.ts +0 -72
  114. package/dist/types/models/ApiCommentaryBookChapterChapter.d.ts +0 -46
  115. package/dist/types/models/ApiCommentaryBooks.d.ts +0 -41
  116. package/dist/types/models/ApiDataset.d.ts +0 -138
  117. package/dist/types/models/ApiDatasetBook.d.ts +0 -82
  118. package/dist/types/models/ApiDatasetBookChapter.d.ts +0 -78
  119. package/dist/types/models/ApiDatasetBooks.d.ts +0 -41
  120. package/dist/types/models/ApiTranslation.d.ts +0 -169
  121. package/dist/types/models/ApiTranslationBook.d.ts +0 -100
  122. package/dist/types/models/ApiTranslationBookChapter.d.ts +0 -96
  123. package/dist/types/models/ApiTranslationBookChapterChapter.d.ts +0 -47
  124. package/dist/types/models/ApiTranslationBooks.d.ts +0 -41
  125. package/dist/types/models/ApiTranslationComplete.d.ts +0 -41
  126. package/dist/types/models/ApiTranslationCompleteBook.d.ts +0 -83
  127. package/dist/types/models/BookId.d.ts +0 -125
  128. package/dist/types/models/ChapterContent.d.ts +0 -34
  129. package/dist/types/models/ChapterFootnote.d.ts +0 -53
  130. package/dist/types/models/ChapterFootnoteCaller.d.ts +0 -27
  131. package/dist/types/models/ChapterFootnoteReference.d.ts +0 -39
  132. package/dist/types/models/ChapterHeading.d.ts +0 -46
  133. package/dist/types/models/ChapterHebrewSubtitle.d.ts +0 -47
  134. package/dist/types/models/ChapterHebrewSubtitleContentInner.d.ts +0 -51
  135. package/dist/types/models/ChapterLineBreak.d.ts +0 -40
  136. package/dist/types/models/ChapterVerse.d.ts +0 -53
  137. package/dist/types/models/ChapterVerseContentInner.d.ts +0 -70
  138. package/dist/types/models/DatasetChapterData.d.ts +0 -40
  139. package/dist/types/models/DatasetChapterVerseContent.d.ts +0 -40
  140. package/dist/types/models/FormattedText.d.ts +0 -45
  141. package/dist/types/models/InlineHeading.d.ts +0 -33
  142. package/dist/types/models/InlineLineBreak.d.ts +0 -40
  143. package/dist/types/models/ScoredVerseRef.d.ts +0 -70
  144. package/dist/types/models/TranslationBookChapter.d.ts +0 -42
  145. package/dist/types/models/VerseFootnoteReference.d.ts +0 -33
  146. package/dist/types/models/index.d.ts +0 -39
  147. package/dist/types/runtime.d.ts +0 -185
@@ -0,0 +1,247 @@
1
+ import type { ApiAvailableDatasets, ApiAvailableTranslations, ApiCommentaryBook, ApiCommentaryBookChapter, ApiDatasetBook, ApiDatasetBookChapter, ApiDatasetBooks, ApiTranslationBook, ApiTranslationBookChapter, ApiTranslationBooks, ApiTranslationComplete, ChapterVerse } from './types.gen.js';
2
+ /**
3
+ * Options for the FreeUseBibleApi class.
4
+ */
5
+ export interface FreeUseBibleApiOptions {
6
+ /**
7
+ * The API endpoint to use for the requests. If not provided, the default endpoint will be used.
8
+ */
9
+ endpoint?: string;
10
+ /**
11
+ * Whether to cache responses in memory.
12
+ *
13
+ * Defaults to `true`.
14
+ */
15
+ useCache?: boolean;
16
+ }
17
+ /**
18
+ * Options for the `getChapterText` method.
19
+ */
20
+ export interface GetChapterTextOptions {
21
+ /**
22
+ * Whether to omit verse numbers from the returned text.
23
+ * Defaults to `false`.
24
+ */
25
+ omitVerseNumbers?: boolean;
26
+ /**
27
+ * Whether to omit the chapter reference from the returned text.
28
+ */
29
+ omitReference?: boolean;
30
+ }
31
+ /**
32
+ * Options for the `getVerseText` method.
33
+ */
34
+ export interface GetVerseTextOptions {
35
+ /**
36
+ * Whether to omit the chapter reference from the returned text.
37
+ */
38
+ omitReference?: boolean;
39
+ }
40
+ /**
41
+ * A reference to a specific verse in a Bible translation, commentary, or dataset.
42
+ */
43
+ export interface VerseReference {
44
+ /**
45
+ * The chapter number of the reference. This should be a positive integer.
46
+ */
47
+ chapter: number;
48
+ /**
49
+ * The verse number of the reference.
50
+ *
51
+ * If omitted, then the reference refers to the entire chapter rather than a specific verse.
52
+ */
53
+ verse?: number;
54
+ /**
55
+ * The ending verse number of the reference, for references that span multiple verses. This should be greater than or equal to the `verse` property if it is provided.
56
+ */
57
+ endVerse?: number;
58
+ /**
59
+ * The ending chapter number of the reference, for references that span multiple chapters. This should be greater than or equal to the `chapter` property if it is provided.
60
+ */
61
+ endChapter?: number;
62
+ }
63
+ /**
64
+ * A client for interacting with the [Free Use Bible API](https://bible.helloao.org/).
65
+ *
66
+ * This API provides access to a large collection of Bible translations, commentaries, and datasets that are free to use.
67
+ */
68
+ export declare class FreeUseBibleApi {
69
+ endpoint: string;
70
+ private _responseCache;
71
+ private _useCache;
72
+ constructor(options?: FreeUseBibleApiOptions);
73
+ /**
74
+ * Gets the list of available Bible translations from the API.
75
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
76
+ */
77
+ getAvailableTranslations(endpoint?: string): Promise<ApiAvailableTranslations>;
78
+ /**
79
+ * Gets the complete content of a specific Bible translation.
80
+ *
81
+ * The results of this endpoint are very large, so the response is not cached.
82
+ * @param translation The ID of the translation to get the complete content for.
83
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
84
+ */
85
+ getCompleteTranslation(translation: string, endpoint?: string): Promise<ApiTranslationComplete>;
86
+ /**
87
+ * Gets the list of available Bible commentaries from the API.
88
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
89
+ */
90
+ getAvailableCommentaries(endpoint?: string): Promise<ApiAvailableTranslations>;
91
+ /**
92
+ * Gets the list of available datasets from the API.
93
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
94
+ */
95
+ getAvailableDatasets(endpoint?: string): Promise<ApiAvailableDatasets>;
96
+ /**
97
+ * Gets the list of books for a given Bible translation.
98
+ * @param translation The ID of the translation to get the books for.
99
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
100
+ */
101
+ getTranslationBooks(translation: string, endpoint?: string): Promise<ApiTranslationBooks>;
102
+ /**
103
+ * Gets the list of books for a given Bible commentary.
104
+ * @param commentary The ID of the commentary to get the books for.
105
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
106
+ */
107
+ getCommentaryBooks(commentary: string, endpoint?: string): Promise<ApiTranslationBooks>;
108
+ /**
109
+ * Gets the list of books for a given dataset.
110
+ * @param dataset The ID of the dataset to get the books for.
111
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
112
+ */
113
+ getDatasetBooks(dataset: string, endpoint?: string): Promise<ApiDatasetBooks>;
114
+ /**
115
+ * Gets the content of a specific chapter of a specific book for a specific Bible translation.
116
+ * @param translation The ID of the translation to get the chapter for.
117
+ * @param book The ID of the book to get the chapter for.
118
+ * @param chapter The chapter number to get.
119
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
120
+ */
121
+ getTranslationBookChapter(translation: string, book: string, chapter: number | string, endpoint?: string): Promise<ApiTranslationBookChapter>;
122
+ /**
123
+ * Gets the content of a specific chapter of a specific book for a specific Bible commentary.
124
+ * @param commentary The ID of the commentary to get the chapter for.
125
+ * @param book The ID of the book to get the chapter for.
126
+ * @param chapter The chapter number to get.
127
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
128
+ */
129
+ getCommentaryBookChapter(commentary: string, book: string, chapter: number | string, endpoint?: string): Promise<ApiTranslationBookChapter>;
130
+ /**
131
+ * Gets the content of a specific chapter of a specific book for a specific dataset.
132
+ * @param dataset The ID of the dataset to get the chapter for.
133
+ * @param book The ID of the book to get the chapter for.
134
+ * @param chapter The chapter number to get.
135
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
136
+ */
137
+ getDatasetBookChapter(dataset: string, book: string, chapter: number | string, endpoint?: string): Promise<ApiDatasetBookChapter>;
138
+ /**
139
+ * Gets the next chapter for a given chapter, if available.
140
+ * @param chapter The chapter to get the next chapter for.
141
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
142
+ * @returns The next chapter, or null if there is no next chapter.
143
+ */
144
+ getNextChapter(chapter: ApiCommentaryBookChapter, endpoint?: string): Promise<ApiCommentaryBookChapter | null>;
145
+ /**
146
+ * Gets the next chapter for a given chapter, if available.
147
+ * @param chapter The chapter to get the next chapter for.
148
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
149
+ * @returns The next chapter, or null if there is no next chapter.
150
+ */
151
+ getNextChapter(chapter: ApiTranslationBookChapter, endpoint?: string): Promise<ApiTranslationBookChapter | null>;
152
+ /**
153
+ * Gets the next chapter for a given chapter, if available.
154
+ * @param chapter The chapter to get the next chapter for.
155
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
156
+ * @returns The next chapter, or null if there is no next chapter.
157
+ */
158
+ getNextChapter(chapter: ApiDatasetBookChapter, endpoint?: string): Promise<ApiDatasetBookChapter | null>;
159
+ /**
160
+ * Gets the previous chapter for a given chapter, if available.
161
+ * @param chapter The chapter to get the previous chapter for.
162
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
163
+ * @returns The previous chapter, or null if there is no previous chapter.
164
+ */
165
+ getPreviousChapter(chapter: ApiCommentaryBookChapter, endpoint?: string): Promise<ApiCommentaryBookChapter | null>;
166
+ /**
167
+ * Gets the previous chapter for a given chapter, if available.
168
+ * @param chapter The chapter to get the previous chapter for.
169
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
170
+ * @returns The previous chapter, or null if there is no previous chapter.
171
+ */
172
+ getPreviousChapter(chapter: ApiTranslationBookChapter, endpoint?: string): Promise<ApiTranslationBookChapter | null>;
173
+ /**
174
+ * Gets the previous chapter for a given chapter, if available.
175
+ * @param chapter The chapter to get the previous chapter for.
176
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
177
+ * @returns The previous chapter, or null if there is no previous chapter.
178
+ */
179
+ getPreviousChapter(chapter: ApiDatasetBookChapter, endpoint?: string): Promise<ApiDatasetBookChapter | null>;
180
+ /**
181
+ * Gets the first chapter for a given book, if available.
182
+ * @param book The book to get the first chapter for.
183
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
184
+ * @returns The first chapter, or null if there is no first chapter.
185
+ */
186
+ getFirstChapter(book: ApiCommentaryBook, endpoint?: string): Promise<ApiCommentaryBookChapter | null>;
187
+ /**
188
+ * Gets the first chapter for a given book, if available.
189
+ * @param book The book to get the first chapter for.
190
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
191
+ * @returns The first chapter, or null if there is no first chapter.
192
+ */
193
+ getFirstChapter(book: ApiTranslationBook, endpoint?: string): Promise<ApiTranslationBookChapter>;
194
+ /**
195
+ * Gets the first chapter for a given book, if available.
196
+ * @param book The book to get the first chapter for.
197
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
198
+ * @returns The first chapter, or null if there is no first chapter.
199
+ */
200
+ getFirstChapter(book: ApiDatasetBook, endpoint?: string): Promise<ApiDatasetBookChapter>;
201
+ /**
202
+ * Gets the last chapter for a given book, if available.
203
+ * @param book The book to get the last chapter for.
204
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
205
+ * @returns The last chapter, or null if there is no last chapter.
206
+ */
207
+ getLastChapter(book: ApiCommentaryBook, endpoint?: string): Promise<ApiCommentaryBookChapter | null>;
208
+ /**
209
+ * Gets the last chapter for a given book, if available.
210
+ * @param book The book to get the last chapter for.
211
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
212
+ * @returns The last chapter, or null if there is no last chapter.
213
+ */
214
+ getLastChapter(book: ApiTranslationBook, endpoint?: string): Promise<ApiTranslationBookChapter>;
215
+ /**
216
+ * Gets the last chapter for a given book, if available.
217
+ * @param book The book to get the last chapter for.
218
+ * @param endpoint The API endpoint to use for the request. If not provided, the default endpoint will be used.
219
+ * @returns The last chapter, or null if there is no last chapter.
220
+ */
221
+ getLastChapter(book: ApiDatasetBook, endpoint?: string): Promise<ApiDatasetBookChapter>;
222
+ /**
223
+ * Formats a verse reference as a human-readable string.
224
+ *
225
+ * e.g. Genesis 1:1-2, John 3:16, Exodus 20-22, etc.
226
+ *
227
+ * @param book The book that the reference is for.
228
+ * @param reference The reference to format.
229
+ */
230
+ formatReference(book: ApiTranslationBook, reference: VerseReference): string;
231
+ /**
232
+ * Gets the text for a verse.
233
+ * @param verse The verse to get the text for.
234
+ * @param options Options for getting the verse text.
235
+ */
236
+ getVerseText(verse: ChapterVerse): string;
237
+ /**
238
+ * Gets the verse text for the given chapter.
239
+ * By default, the returned text includes markers for verse numbers and a reference to the chapter, but these can be omitted by passing options to the `options` parameter.
240
+ * @param chapter The chapter to get the text for.
241
+ * @param options Options for getting the chapter text.
242
+ */
243
+ getChapterVerseText(chapter: ApiTranslationBookChapter, options?: GetChapterTextOptions): string;
244
+ private _getJson;
245
+ private _buildUrl;
246
+ }
247
+ //# sourceMappingURL=FreeUseBibleApi.d.ts.map
@@ -1,4 +1,3 @@
1
- export * from './runtime';
2
- export * from './apis/index';
3
- export * from './models/index';
1
+ export * from './FreeUseBibleApi.js';
2
+ export * from './types.gen.js';
4
3
  //# sourceMappingURL=index.d.ts.map