free-use-bible-api 0.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.
- package/LICENSE +21 -0
- package/README.md +139 -0
- package/dist/cjs/index.cjs +27 -0
- package/dist/esm/apis/DefaultApi.js +416 -0
- package/dist/esm/apis/DefaultApi.js.map +7 -0
- package/dist/esm/apis/FreeUseBibleApi.js +61 -0
- package/dist/esm/apis/FreeUseBibleApi.js.map +7 -0
- package/dist/esm/apis/index.js +4 -0
- package/dist/esm/apis/index.js.map +7 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/models/ApiAvailableCommentaries.js +32 -0
- package/dist/esm/models/ApiAvailableCommentaries.js.map +7 -0
- package/dist/esm/models/ApiAvailableDatasets.js +32 -0
- package/dist/esm/models/ApiAvailableDatasets.js.map +7 -0
- package/dist/esm/models/ApiAvailableTranslations.js +32 -0
- package/dist/esm/models/ApiAvailableTranslations.js.map +7 -0
- package/dist/esm/models/ApiCommentary.js +81 -0
- package/dist/esm/models/ApiCommentary.js.map +7 -0
- package/dist/esm/models/ApiCommentaryBook.js +63 -0
- package/dist/esm/models/ApiCommentaryBook.js.map +7 -0
- package/dist/esm/models/ApiCommentaryBookChapter.js +58 -0
- package/dist/esm/models/ApiCommentaryBookChapter.js.map +7 -0
- package/dist/esm/models/ApiCommentaryBookChapterChapter.js +37 -0
- package/dist/esm/models/ApiCommentaryBookChapterChapter.js.map +7 -0
- package/dist/esm/models/ApiCommentaryBooks.js +39 -0
- package/dist/esm/models/ApiCommentaryBooks.js.map +7 -0
- package/dist/esm/models/ApiDataset.js +77 -0
- package/dist/esm/models/ApiDataset.js.map +7 -0
- package/dist/esm/models/ApiDatasetBook.js +56 -0
- package/dist/esm/models/ApiDatasetBook.js.map +7 -0
- package/dist/esm/models/ApiDatasetBookChapter.js +61 -0
- package/dist/esm/models/ApiDatasetBookChapter.js.map +7 -0
- package/dist/esm/models/ApiDatasetBooks.js +39 -0
- package/dist/esm/models/ApiDatasetBooks.js.map +7 -0
- package/dist/esm/models/ApiTranslation.js +87 -0
- package/dist/esm/models/ApiTranslation.js.map +7 -0
- package/dist/esm/models/ApiTranslationBook.js +64 -0
- package/dist/esm/models/ApiTranslationBook.js.map +7 -0
- package/dist/esm/models/ApiTranslationBookChapter.js +67 -0
- package/dist/esm/models/ApiTranslationBookChapter.js.map +7 -0
- package/dist/esm/models/ApiTranslationBookChapterChapter.js +42 -0
- package/dist/esm/models/ApiTranslationBookChapterChapter.js.map +7 -0
- package/dist/esm/models/ApiTranslationBooks.js +39 -0
- package/dist/esm/models/ApiTranslationBooks.js.map +7 -0
- package/dist/esm/models/ApiTranslationComplete.js +39 -0
- package/dist/esm/models/ApiTranslationComplete.js.map +7 -0
- package/dist/esm/models/ApiTranslationCompleteBook.js +59 -0
- package/dist/esm/models/ApiTranslationCompleteBook.js.map +7 -0
- package/dist/esm/models/BookId.js +127 -0
- package/dist/esm/models/BookId.js.map +7 -0
- package/dist/esm/models/ChapterContent.js +58 -0
- package/dist/esm/models/ChapterContent.js.map +7 -0
- package/dist/esm/models/ChapterFootnote.js +44 -0
- package/dist/esm/models/ChapterFootnote.js.map +7 -0
- package/dist/esm/models/ChapterFootnoteCaller.js +17 -0
- package/dist/esm/models/ChapterFootnoteCaller.js.map +7 -0
- package/dist/esm/models/ChapterFootnoteReference.js +31 -0
- package/dist/esm/models/ChapterFootnoteReference.js.map +7 -0
- package/dist/esm/models/ChapterHeading.js +34 -0
- package/dist/esm/models/ChapterHeading.js.map +7 -0
- package/dist/esm/models/ChapterHebrewSubtitle.js +38 -0
- package/dist/esm/models/ChapterHebrewSubtitle.js.map +7 -0
- package/dist/esm/models/ChapterHebrewSubtitleContentInner.js +35 -0
- package/dist/esm/models/ChapterHebrewSubtitleContentInner.js.map +7 -0
- package/dist/esm/models/ChapterLineBreak.js +31 -0
- package/dist/esm/models/ChapterLineBreak.js.map +7 -0
- package/dist/esm/models/ChapterVerse.js +41 -0
- package/dist/esm/models/ChapterVerse.js.map +7 -0
- package/dist/esm/models/ChapterVerseContentInner.js +44 -0
- package/dist/esm/models/ChapterVerseContentInner.js.map +7 -0
- package/dist/esm/models/DatasetChapterData.js +35 -0
- package/dist/esm/models/DatasetChapterData.js.map +7 -0
- package/dist/esm/models/DatasetChapterVerseContent.js +35 -0
- package/dist/esm/models/DatasetChapterVerseContent.js.map +7 -0
- package/dist/esm/models/FormattedText.js +32 -0
- package/dist/esm/models/FormattedText.js.map +7 -0
- package/dist/esm/models/InlineHeading.js +28 -0
- package/dist/esm/models/InlineHeading.js.map +7 -0
- package/dist/esm/models/InlineLineBreak.js +31 -0
- package/dist/esm/models/InlineLineBreak.js.map +7 -0
- package/dist/esm/models/ScoredVerseRef.js +47 -0
- package/dist/esm/models/ScoredVerseRef.js.map +7 -0
- package/dist/esm/models/TranslationBookChapter.js +35 -0
- package/dist/esm/models/TranslationBookChapter.js.map +7 -0
- package/dist/esm/models/VerseFootnoteReference.js +28 -0
- package/dist/esm/models/VerseFootnoteReference.js.map +7 -0
- package/dist/esm/models/index.js +40 -0
- package/dist/esm/models/index.js.map +7 -0
- package/dist/esm/runtime.js +304 -0
- package/dist/esm/runtime.js.map +7 -0
- package/dist/types/apis/DefaultApi.d.ts +176 -0
- package/dist/types/apis/FreeUseBibleApi.d.ts +34 -0
- package/dist/types/apis/index.d.ts +3 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/ApiAvailableCommentaries.d.ts +34 -0
- package/dist/types/models/ApiAvailableDatasets.d.ts +34 -0
- package/dist/types/models/ApiAvailableTranslations.d.ts +34 -0
- package/dist/types/models/ApiCommentary.d.ts +145 -0
- package/dist/types/models/ApiCommentaryBook.d.ts +100 -0
- package/dist/types/models/ApiCommentaryBookChapter.d.ts +72 -0
- package/dist/types/models/ApiCommentaryBookChapterChapter.d.ts +46 -0
- package/dist/types/models/ApiCommentaryBooks.d.ts +41 -0
- package/dist/types/models/ApiDataset.d.ts +138 -0
- package/dist/types/models/ApiDatasetBook.d.ts +82 -0
- package/dist/types/models/ApiDatasetBookChapter.d.ts +78 -0
- package/dist/types/models/ApiDatasetBooks.d.ts +41 -0
- package/dist/types/models/ApiTranslation.d.ts +169 -0
- package/dist/types/models/ApiTranslationBook.d.ts +100 -0
- package/dist/types/models/ApiTranslationBookChapter.d.ts +96 -0
- package/dist/types/models/ApiTranslationBookChapterChapter.d.ts +47 -0
- package/dist/types/models/ApiTranslationBooks.d.ts +41 -0
- package/dist/types/models/ApiTranslationComplete.d.ts +41 -0
- package/dist/types/models/ApiTranslationCompleteBook.d.ts +83 -0
- package/dist/types/models/BookId.d.ts +125 -0
- package/dist/types/models/ChapterContent.d.ts +34 -0
- package/dist/types/models/ChapterFootnote.d.ts +53 -0
- package/dist/types/models/ChapterFootnoteCaller.d.ts +27 -0
- package/dist/types/models/ChapterFootnoteReference.d.ts +39 -0
- package/dist/types/models/ChapterHeading.d.ts +46 -0
- package/dist/types/models/ChapterHebrewSubtitle.d.ts +47 -0
- package/dist/types/models/ChapterHebrewSubtitleContentInner.d.ts +51 -0
- package/dist/types/models/ChapterLineBreak.d.ts +40 -0
- package/dist/types/models/ChapterVerse.d.ts +53 -0
- package/dist/types/models/ChapterVerseContentInner.d.ts +70 -0
- package/dist/types/models/DatasetChapterData.d.ts +40 -0
- package/dist/types/models/DatasetChapterVerseContent.d.ts +40 -0
- package/dist/types/models/FormattedText.d.ts +45 -0
- package/dist/types/models/InlineHeading.d.ts +33 -0
- package/dist/types/models/InlineLineBreak.d.ts +40 -0
- package/dist/types/models/ScoredVerseRef.d.ts +70 -0
- package/dist/types/models/TranslationBookChapter.d.ts +42 -0
- package/dist/types/models/VerseFootnoteReference.d.ts +33 -0
- package/dist/types/models/index.d.ts +39 -0
- package/dist/types/runtime.d.ts +185 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 AO Lab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Free Use Bible API
|
|
2
|
+
|
|
3
|
+
The Free Use Bible API provides access to over 1000 Bible translations in hundreds of languages.
|
|
4
|
+
|
|
5
|
+
This package is an auto-generated TypeScript and JavaScript client for the public API hosted at:
|
|
6
|
+
|
|
7
|
+
- https://bible.helloao.org
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install with your preferred package manager:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install free-use-bible-api
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add free-use-bible-api
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add free-use-bible-api
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
Create a client and point it at the production API:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { Configuration, DefaultApi } from 'free-use-bible-api';
|
|
31
|
+
|
|
32
|
+
const config = new Configuration({
|
|
33
|
+
basePath: 'https://bible.helloao.org',
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const api = new DefaultApi(config);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Translation Usage Guide
|
|
40
|
+
|
|
41
|
+
This section covers the most common translation flow:
|
|
42
|
+
|
|
43
|
+
1. Get available translations.
|
|
44
|
+
2. Pick a translation ID.
|
|
45
|
+
3. Get books for that translation.
|
|
46
|
+
4. Fetch a chapter.
|
|
47
|
+
5. Optionally fetch the full translation payload.
|
|
48
|
+
|
|
49
|
+
### 1. Get Available Translations
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { Configuration, FreeUseBibleApi } from 'free-use-bible-api';
|
|
53
|
+
|
|
54
|
+
const api = new FreeUseBibleApi(
|
|
55
|
+
new Configuration({ basePath: 'https://bible.helloao.org' })
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const result = await api.getAvailableTranslations();
|
|
59
|
+
|
|
60
|
+
console.log('Total translations:', result.translations.length);
|
|
61
|
+
console.log('First translation:', result.translations[0]);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. Get Books For A Translation
|
|
65
|
+
|
|
66
|
+
Use a translation ID from the previous step, for example `BSB`:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const books = await api.getTranslationBooks({
|
|
70
|
+
translation: 'BSB',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
console.log('Books in translation:', books.books.length);
|
|
74
|
+
console.log('First book:', books.books[0]);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3. Get A Translation Chapter
|
|
78
|
+
|
|
79
|
+
Use a USFM book ID and chapter number:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { BookId } from 'free-use-bible-api';
|
|
83
|
+
|
|
84
|
+
const chapter = await api.getTranslationBookChapter({
|
|
85
|
+
translation: 'BSB',
|
|
86
|
+
book: BookId.GEN,
|
|
87
|
+
chapter: 1,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
console.log('Chapter number:', chapter.chapter.number);
|
|
91
|
+
console.log('Verse count:', chapter.numberOfVerses);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 4. Get A Complete Translation
|
|
95
|
+
|
|
96
|
+
Some workflows need the entire translation document in one call:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
const complete = await api.getTranslationComplete({
|
|
100
|
+
translation: 'BSB',
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
console.log('Translation:', complete.translation.id);
|
|
104
|
+
console.log('Book count:', complete.books.length);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Direct HTTP Examples For Translations
|
|
108
|
+
|
|
109
|
+
If you do not want to use the SDK, these translation endpoints are available directly:
|
|
110
|
+
|
|
111
|
+
- GET `/api/available_translations.json`
|
|
112
|
+
- GET `/api/{translation}/books.json`
|
|
113
|
+
- GET `/api/{translation}/{book}/{chapter}.json`
|
|
114
|
+
- GET `/api/{translation}/complete.json`
|
|
115
|
+
|
|
116
|
+
Example requests:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
curl https://bible.helloao.org/api/available_translations.json
|
|
120
|
+
curl https://bible.helloao.org/api/BSB/books.json
|
|
121
|
+
curl https://bible.helloao.org/api/BSB/GEN/1.json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Error Handling
|
|
125
|
+
|
|
126
|
+
A 404 response usually means one of these values is invalid:
|
|
127
|
+
|
|
128
|
+
- translation
|
|
129
|
+
- book
|
|
130
|
+
- chapter
|
|
131
|
+
|
|
132
|
+
Use available translations and books responses to drive your UI selections and reduce bad requests.
|
|
133
|
+
|
|
134
|
+
## Notes
|
|
135
|
+
|
|
136
|
+
- This client uses fetch under the hood.
|
|
137
|
+
- In modern Node.js versions, fetch is available globally.
|
|
138
|
+
- For custom environments, pass a custom fetch implementation in `Configuration`.
|
|
139
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var free_use_bible_api_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(free_use_bible_api_exports);
|
|
18
|
+
__reExport(free_use_bible_api_exports, require("./runtime"), module.exports);
|
|
19
|
+
__reExport(free_use_bible_api_exports, require("./apis/index"), module.exports);
|
|
20
|
+
__reExport(free_use_bible_api_exports, require("./models/index"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./runtime"),
|
|
24
|
+
...require("./apis/index"),
|
|
25
|
+
...require("./models/index")
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as runtime from "../runtime";
|
|
3
|
+
import {
|
|
4
|
+
ApiAvailableCommentariesFromJSON
|
|
5
|
+
} from "../models/ApiAvailableCommentaries";
|
|
6
|
+
import {
|
|
7
|
+
ApiAvailableDatasetsFromJSON
|
|
8
|
+
} from "../models/ApiAvailableDatasets";
|
|
9
|
+
import {
|
|
10
|
+
ApiAvailableTranslationsFromJSON
|
|
11
|
+
} from "../models/ApiAvailableTranslations";
|
|
12
|
+
import {
|
|
13
|
+
ApiCommentaryBookChapterFromJSON
|
|
14
|
+
} from "../models/ApiCommentaryBookChapter";
|
|
15
|
+
import {
|
|
16
|
+
ApiCommentaryBooksFromJSON
|
|
17
|
+
} from "../models/ApiCommentaryBooks";
|
|
18
|
+
import {
|
|
19
|
+
ApiDatasetBookChapterFromJSON
|
|
20
|
+
} from "../models/ApiDatasetBookChapter";
|
|
21
|
+
import {
|
|
22
|
+
ApiDatasetBooksFromJSON
|
|
23
|
+
} from "../models/ApiDatasetBooks";
|
|
24
|
+
import {
|
|
25
|
+
ApiTranslationBookChapterFromJSON
|
|
26
|
+
} from "../models/ApiTranslationBookChapter";
|
|
27
|
+
import {
|
|
28
|
+
ApiTranslationBooksFromJSON
|
|
29
|
+
} from "../models/ApiTranslationBooks";
|
|
30
|
+
import {
|
|
31
|
+
ApiTranslationCompleteFromJSON
|
|
32
|
+
} from "../models/ApiTranslationComplete";
|
|
33
|
+
export class DefaultApi extends runtime.BaseAPI {
|
|
34
|
+
/**
|
|
35
|
+
* Creates request options for getAvailableCommentaries without sending the request
|
|
36
|
+
*/
|
|
37
|
+
async getAvailableCommentariesRequestOpts() {
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
let urlPath = `/api/available_commentaries.json`;
|
|
41
|
+
return {
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: "GET",
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the list of available commentaries.
|
|
50
|
+
*/
|
|
51
|
+
async getAvailableCommentariesRaw(initOverrides) {
|
|
52
|
+
const requestOptions = await this.getAvailableCommentariesRequestOpts();
|
|
53
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
54
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiAvailableCommentariesFromJSON(jsonValue));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the list of available commentaries.
|
|
58
|
+
*/
|
|
59
|
+
async getAvailableCommentaries(initOverrides) {
|
|
60
|
+
const response = await this.getAvailableCommentariesRaw(initOverrides);
|
|
61
|
+
return await response.value();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Creates request options for getAvailableDatasets without sending the request
|
|
65
|
+
*/
|
|
66
|
+
async getAvailableDatasetsRequestOpts() {
|
|
67
|
+
const queryParameters = {};
|
|
68
|
+
const headerParameters = {};
|
|
69
|
+
let urlPath = `/api/available_datasets.json`;
|
|
70
|
+
return {
|
|
71
|
+
path: urlPath,
|
|
72
|
+
method: "GET",
|
|
73
|
+
headers: headerParameters,
|
|
74
|
+
query: queryParameters
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the list of available datasets.
|
|
79
|
+
*/
|
|
80
|
+
async getAvailableDatasetsRaw(initOverrides) {
|
|
81
|
+
const requestOptions = await this.getAvailableDatasetsRequestOpts();
|
|
82
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
83
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiAvailableDatasetsFromJSON(jsonValue));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the list of available datasets.
|
|
87
|
+
*/
|
|
88
|
+
async getAvailableDatasets(initOverrides) {
|
|
89
|
+
const response = await this.getAvailableDatasetsRaw(initOverrides);
|
|
90
|
+
return await response.value();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates request options for getAvailableTranslations without sending the request
|
|
94
|
+
*/
|
|
95
|
+
async getAvailableTranslationsRequestOpts() {
|
|
96
|
+
const queryParameters = {};
|
|
97
|
+
const headerParameters = {};
|
|
98
|
+
let urlPath = `/api/available_translations.json`;
|
|
99
|
+
return {
|
|
100
|
+
path: urlPath,
|
|
101
|
+
method: "GET",
|
|
102
|
+
headers: headerParameters,
|
|
103
|
+
query: queryParameters
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get the list of available Bible translations.
|
|
108
|
+
*/
|
|
109
|
+
async getAvailableTranslationsRaw(initOverrides) {
|
|
110
|
+
const requestOptions = await this.getAvailableTranslationsRequestOpts();
|
|
111
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
112
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiAvailableTranslationsFromJSON(jsonValue));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the list of available Bible translations.
|
|
116
|
+
*/
|
|
117
|
+
async getAvailableTranslations(initOverrides) {
|
|
118
|
+
const response = await this.getAvailableTranslationsRaw(initOverrides);
|
|
119
|
+
return await response.value();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Creates request options for getCommentaryBookChapter without sending the request
|
|
123
|
+
*/
|
|
124
|
+
async getCommentaryBookChapterRequestOpts(requestParameters) {
|
|
125
|
+
if (requestParameters["commentary"] == null) {
|
|
126
|
+
throw new runtime.RequiredError(
|
|
127
|
+
"commentary",
|
|
128
|
+
'Required parameter "commentary" was null or undefined when calling getCommentaryBookChapter().'
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
if (requestParameters["book"] == null) {
|
|
132
|
+
throw new runtime.RequiredError(
|
|
133
|
+
"book",
|
|
134
|
+
'Required parameter "book" was null or undefined when calling getCommentaryBookChapter().'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
if (requestParameters["chapter"] == null) {
|
|
138
|
+
throw new runtime.RequiredError(
|
|
139
|
+
"chapter",
|
|
140
|
+
'Required parameter "chapter" was null or undefined when calling getCommentaryBookChapter().'
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const queryParameters = {};
|
|
144
|
+
const headerParameters = {};
|
|
145
|
+
let urlPath = `/api/c/{commentary}/{book}/{chapter}.json`;
|
|
146
|
+
urlPath = urlPath.replace("{commentary}", encodeURIComponent(String(requestParameters["commentary"])));
|
|
147
|
+
urlPath = urlPath.replace("{book}", encodeURIComponent(String(requestParameters["book"])));
|
|
148
|
+
urlPath = urlPath.replace("{chapter}", encodeURIComponent(String(requestParameters["chapter"])));
|
|
149
|
+
return {
|
|
150
|
+
path: urlPath,
|
|
151
|
+
method: "GET",
|
|
152
|
+
headers: headerParameters,
|
|
153
|
+
query: queryParameters
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get the content of a specific chapter of a specific book for a specific commentary.
|
|
158
|
+
*/
|
|
159
|
+
async getCommentaryBookChapterRaw(requestParameters, initOverrides) {
|
|
160
|
+
const requestOptions = await this.getCommentaryBookChapterRequestOpts(requestParameters);
|
|
161
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
162
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiCommentaryBookChapterFromJSON(jsonValue));
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Get the content of a specific chapter of a specific book for a specific commentary.
|
|
166
|
+
*/
|
|
167
|
+
async getCommentaryBookChapter(requestParameters, initOverrides) {
|
|
168
|
+
const response = await this.getCommentaryBookChapterRaw(requestParameters, initOverrides);
|
|
169
|
+
return await response.value();
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Creates request options for getCommentaryBooks without sending the request
|
|
173
|
+
*/
|
|
174
|
+
async getCommentaryBooksRequestOpts(requestParameters) {
|
|
175
|
+
if (requestParameters["commentary"] == null) {
|
|
176
|
+
throw new runtime.RequiredError(
|
|
177
|
+
"commentary",
|
|
178
|
+
'Required parameter "commentary" was null or undefined when calling getCommentaryBooks().'
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
const queryParameters = {};
|
|
182
|
+
const headerParameters = {};
|
|
183
|
+
let urlPath = `/api/c/{commentary}/books.json`;
|
|
184
|
+
urlPath = urlPath.replace("{commentary}", encodeURIComponent(String(requestParameters["commentary"])));
|
|
185
|
+
return {
|
|
186
|
+
path: urlPath,
|
|
187
|
+
method: "GET",
|
|
188
|
+
headers: headerParameters,
|
|
189
|
+
query: queryParameters
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the list of books available for a specific commentary.
|
|
194
|
+
*/
|
|
195
|
+
async getCommentaryBooksRaw(requestParameters, initOverrides) {
|
|
196
|
+
const requestOptions = await this.getCommentaryBooksRequestOpts(requestParameters);
|
|
197
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
198
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiCommentaryBooksFromJSON(jsonValue));
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Get the list of books available for a specific commentary.
|
|
202
|
+
*/
|
|
203
|
+
async getCommentaryBooks(requestParameters, initOverrides) {
|
|
204
|
+
const response = await this.getCommentaryBooksRaw(requestParameters, initOverrides);
|
|
205
|
+
return await response.value();
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Creates request options for getDatasetBookChapter without sending the request
|
|
209
|
+
*/
|
|
210
|
+
async getDatasetBookChapterRequestOpts(requestParameters) {
|
|
211
|
+
if (requestParameters["dataset"] == null) {
|
|
212
|
+
throw new runtime.RequiredError(
|
|
213
|
+
"dataset",
|
|
214
|
+
'Required parameter "dataset" was null or undefined when calling getDatasetBookChapter().'
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
if (requestParameters["book"] == null) {
|
|
218
|
+
throw new runtime.RequiredError(
|
|
219
|
+
"book",
|
|
220
|
+
'Required parameter "book" was null or undefined when calling getDatasetBookChapter().'
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
if (requestParameters["chapter"] == null) {
|
|
224
|
+
throw new runtime.RequiredError(
|
|
225
|
+
"chapter",
|
|
226
|
+
'Required parameter "chapter" was null or undefined when calling getDatasetBookChapter().'
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
const queryParameters = {};
|
|
230
|
+
const headerParameters = {};
|
|
231
|
+
let urlPath = `/api/d/{dataset}/{book}/{chapter}.json`;
|
|
232
|
+
urlPath = urlPath.replace("{dataset}", encodeURIComponent(String(requestParameters["dataset"])));
|
|
233
|
+
urlPath = urlPath.replace("{book}", encodeURIComponent(String(requestParameters["book"])));
|
|
234
|
+
urlPath = urlPath.replace("{chapter}", encodeURIComponent(String(requestParameters["chapter"])));
|
|
235
|
+
return {
|
|
236
|
+
path: urlPath,
|
|
237
|
+
method: "GET",
|
|
238
|
+
headers: headerParameters,
|
|
239
|
+
query: queryParameters
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get the content of a specific chapter of a specific book for a specific dataset.
|
|
244
|
+
*/
|
|
245
|
+
async getDatasetBookChapterRaw(requestParameters, initOverrides) {
|
|
246
|
+
const requestOptions = await this.getDatasetBookChapterRequestOpts(requestParameters);
|
|
247
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
248
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiDatasetBookChapterFromJSON(jsonValue));
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get the content of a specific chapter of a specific book for a specific dataset.
|
|
252
|
+
*/
|
|
253
|
+
async getDatasetBookChapter(requestParameters, initOverrides) {
|
|
254
|
+
const response = await this.getDatasetBookChapterRaw(requestParameters, initOverrides);
|
|
255
|
+
return await response.value();
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Creates request options for getDatasetBooks without sending the request
|
|
259
|
+
*/
|
|
260
|
+
async getDatasetBooksRequestOpts(requestParameters) {
|
|
261
|
+
if (requestParameters["dataset"] == null) {
|
|
262
|
+
throw new runtime.RequiredError(
|
|
263
|
+
"dataset",
|
|
264
|
+
'Required parameter "dataset" was null or undefined when calling getDatasetBooks().'
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
const queryParameters = {};
|
|
268
|
+
const headerParameters = {};
|
|
269
|
+
let urlPath = `/api/d/{dataset}/books.json`;
|
|
270
|
+
urlPath = urlPath.replace("{dataset}", encodeURIComponent(String(requestParameters["dataset"])));
|
|
271
|
+
return {
|
|
272
|
+
path: urlPath,
|
|
273
|
+
method: "GET",
|
|
274
|
+
headers: headerParameters,
|
|
275
|
+
query: queryParameters
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get the list of books available for a specific dataset.
|
|
280
|
+
*/
|
|
281
|
+
async getDatasetBooksRaw(requestParameters, initOverrides) {
|
|
282
|
+
const requestOptions = await this.getDatasetBooksRequestOpts(requestParameters);
|
|
283
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
284
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiDatasetBooksFromJSON(jsonValue));
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get the list of books available for a specific dataset.
|
|
288
|
+
*/
|
|
289
|
+
async getDatasetBooks(requestParameters, initOverrides) {
|
|
290
|
+
const response = await this.getDatasetBooksRaw(requestParameters, initOverrides);
|
|
291
|
+
return await response.value();
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Creates request options for getTranslationBookChapter without sending the request
|
|
295
|
+
*/
|
|
296
|
+
async getTranslationBookChapterRequestOpts(requestParameters) {
|
|
297
|
+
if (requestParameters["translation"] == null) {
|
|
298
|
+
throw new runtime.RequiredError(
|
|
299
|
+
"translation",
|
|
300
|
+
'Required parameter "translation" was null or undefined when calling getTranslationBookChapter().'
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
if (requestParameters["book"] == null) {
|
|
304
|
+
throw new runtime.RequiredError(
|
|
305
|
+
"book",
|
|
306
|
+
'Required parameter "book" was null or undefined when calling getTranslationBookChapter().'
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
if (requestParameters["chapter"] == null) {
|
|
310
|
+
throw new runtime.RequiredError(
|
|
311
|
+
"chapter",
|
|
312
|
+
'Required parameter "chapter" was null or undefined when calling getTranslationBookChapter().'
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
const queryParameters = {};
|
|
316
|
+
const headerParameters = {};
|
|
317
|
+
let urlPath = `/api/{translation}/{book}/{chapter}.json`;
|
|
318
|
+
urlPath = urlPath.replace("{translation}", encodeURIComponent(String(requestParameters["translation"])));
|
|
319
|
+
urlPath = urlPath.replace("{book}", encodeURIComponent(String(requestParameters["book"])));
|
|
320
|
+
urlPath = urlPath.replace("{chapter}", encodeURIComponent(String(requestParameters["chapter"])));
|
|
321
|
+
return {
|
|
322
|
+
path: urlPath,
|
|
323
|
+
method: "GET",
|
|
324
|
+
headers: headerParameters,
|
|
325
|
+
query: queryParameters
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Get the content of a specific chapter of a specific book for a specific translation.
|
|
330
|
+
*/
|
|
331
|
+
async getTranslationBookChapterRaw(requestParameters, initOverrides) {
|
|
332
|
+
const requestOptions = await this.getTranslationBookChapterRequestOpts(requestParameters);
|
|
333
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
334
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiTranslationBookChapterFromJSON(jsonValue));
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Get the content of a specific chapter of a specific book for a specific translation.
|
|
338
|
+
*/
|
|
339
|
+
async getTranslationBookChapter(requestParameters, initOverrides) {
|
|
340
|
+
const response = await this.getTranslationBookChapterRaw(requestParameters, initOverrides);
|
|
341
|
+
return await response.value();
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Creates request options for getTranslationBooks without sending the request
|
|
345
|
+
*/
|
|
346
|
+
async getTranslationBooksRequestOpts(requestParameters) {
|
|
347
|
+
if (requestParameters["translation"] == null) {
|
|
348
|
+
throw new runtime.RequiredError(
|
|
349
|
+
"translation",
|
|
350
|
+
'Required parameter "translation" was null or undefined when calling getTranslationBooks().'
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
const queryParameters = {};
|
|
354
|
+
const headerParameters = {};
|
|
355
|
+
let urlPath = `/api/{translation}/books.json`;
|
|
356
|
+
urlPath = urlPath.replace("{translation}", encodeURIComponent(String(requestParameters["translation"])));
|
|
357
|
+
return {
|
|
358
|
+
path: urlPath,
|
|
359
|
+
method: "GET",
|
|
360
|
+
headers: headerParameters,
|
|
361
|
+
query: queryParameters
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Get the list of books available for a specific translation.
|
|
366
|
+
*/
|
|
367
|
+
async getTranslationBooksRaw(requestParameters, initOverrides) {
|
|
368
|
+
const requestOptions = await this.getTranslationBooksRequestOpts(requestParameters);
|
|
369
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
370
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiTranslationBooksFromJSON(jsonValue));
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Get the list of books available for a specific translation.
|
|
374
|
+
*/
|
|
375
|
+
async getTranslationBooks(requestParameters, initOverrides) {
|
|
376
|
+
const response = await this.getTranslationBooksRaw(requestParameters, initOverrides);
|
|
377
|
+
return await response.value();
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Creates request options for getTranslationComplete without sending the request
|
|
381
|
+
*/
|
|
382
|
+
async getTranslationCompleteRequestOpts(requestParameters) {
|
|
383
|
+
if (requestParameters["translation"] == null) {
|
|
384
|
+
throw new runtime.RequiredError(
|
|
385
|
+
"translation",
|
|
386
|
+
'Required parameter "translation" was null or undefined when calling getTranslationComplete().'
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
const queryParameters = {};
|
|
390
|
+
const headerParameters = {};
|
|
391
|
+
let urlPath = `/api/{translation}/complete.json`;
|
|
392
|
+
urlPath = urlPath.replace("{translation}", encodeURIComponent(String(requestParameters["translation"])));
|
|
393
|
+
return {
|
|
394
|
+
path: urlPath,
|
|
395
|
+
method: "GET",
|
|
396
|
+
headers: headerParameters,
|
|
397
|
+
query: queryParameters
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Get the complete content of a specific translation.
|
|
402
|
+
*/
|
|
403
|
+
async getTranslationCompleteRaw(requestParameters, initOverrides) {
|
|
404
|
+
const requestOptions = await this.getTranslationCompleteRequestOpts(requestParameters);
|
|
405
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
406
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ApiTranslationCompleteFromJSON(jsonValue));
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get the complete content of a specific translation.
|
|
410
|
+
*/
|
|
411
|
+
async getTranslationComplete(requestParameters, initOverrides) {
|
|
412
|
+
const response = await this.getTranslationCompleteRaw(requestParameters, initOverrides);
|
|
413
|
+
return await response.value();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
//# sourceMappingURL=DefaultApi.js.map
|