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.
Files changed (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +139 -0
  3. package/dist/cjs/index.cjs +27 -0
  4. package/dist/esm/apis/DefaultApi.js +416 -0
  5. package/dist/esm/apis/DefaultApi.js.map +7 -0
  6. package/dist/esm/apis/FreeUseBibleApi.js +61 -0
  7. package/dist/esm/apis/FreeUseBibleApi.js.map +7 -0
  8. package/dist/esm/apis/index.js +4 -0
  9. package/dist/esm/apis/index.js.map +7 -0
  10. package/dist/esm/index.js +5 -0
  11. package/dist/esm/index.js.map +7 -0
  12. package/dist/esm/models/ApiAvailableCommentaries.js +32 -0
  13. package/dist/esm/models/ApiAvailableCommentaries.js.map +7 -0
  14. package/dist/esm/models/ApiAvailableDatasets.js +32 -0
  15. package/dist/esm/models/ApiAvailableDatasets.js.map +7 -0
  16. package/dist/esm/models/ApiAvailableTranslations.js +32 -0
  17. package/dist/esm/models/ApiAvailableTranslations.js.map +7 -0
  18. package/dist/esm/models/ApiCommentary.js +81 -0
  19. package/dist/esm/models/ApiCommentary.js.map +7 -0
  20. package/dist/esm/models/ApiCommentaryBook.js +63 -0
  21. package/dist/esm/models/ApiCommentaryBook.js.map +7 -0
  22. package/dist/esm/models/ApiCommentaryBookChapter.js +58 -0
  23. package/dist/esm/models/ApiCommentaryBookChapter.js.map +7 -0
  24. package/dist/esm/models/ApiCommentaryBookChapterChapter.js +37 -0
  25. package/dist/esm/models/ApiCommentaryBookChapterChapter.js.map +7 -0
  26. package/dist/esm/models/ApiCommentaryBooks.js +39 -0
  27. package/dist/esm/models/ApiCommentaryBooks.js.map +7 -0
  28. package/dist/esm/models/ApiDataset.js +77 -0
  29. package/dist/esm/models/ApiDataset.js.map +7 -0
  30. package/dist/esm/models/ApiDatasetBook.js +56 -0
  31. package/dist/esm/models/ApiDatasetBook.js.map +7 -0
  32. package/dist/esm/models/ApiDatasetBookChapter.js +61 -0
  33. package/dist/esm/models/ApiDatasetBookChapter.js.map +7 -0
  34. package/dist/esm/models/ApiDatasetBooks.js +39 -0
  35. package/dist/esm/models/ApiDatasetBooks.js.map +7 -0
  36. package/dist/esm/models/ApiTranslation.js +87 -0
  37. package/dist/esm/models/ApiTranslation.js.map +7 -0
  38. package/dist/esm/models/ApiTranslationBook.js +64 -0
  39. package/dist/esm/models/ApiTranslationBook.js.map +7 -0
  40. package/dist/esm/models/ApiTranslationBookChapter.js +67 -0
  41. package/dist/esm/models/ApiTranslationBookChapter.js.map +7 -0
  42. package/dist/esm/models/ApiTranslationBookChapterChapter.js +42 -0
  43. package/dist/esm/models/ApiTranslationBookChapterChapter.js.map +7 -0
  44. package/dist/esm/models/ApiTranslationBooks.js +39 -0
  45. package/dist/esm/models/ApiTranslationBooks.js.map +7 -0
  46. package/dist/esm/models/ApiTranslationComplete.js +39 -0
  47. package/dist/esm/models/ApiTranslationComplete.js.map +7 -0
  48. package/dist/esm/models/ApiTranslationCompleteBook.js +59 -0
  49. package/dist/esm/models/ApiTranslationCompleteBook.js.map +7 -0
  50. package/dist/esm/models/BookId.js +127 -0
  51. package/dist/esm/models/BookId.js.map +7 -0
  52. package/dist/esm/models/ChapterContent.js +58 -0
  53. package/dist/esm/models/ChapterContent.js.map +7 -0
  54. package/dist/esm/models/ChapterFootnote.js +44 -0
  55. package/dist/esm/models/ChapterFootnote.js.map +7 -0
  56. package/dist/esm/models/ChapterFootnoteCaller.js +17 -0
  57. package/dist/esm/models/ChapterFootnoteCaller.js.map +7 -0
  58. package/dist/esm/models/ChapterFootnoteReference.js +31 -0
  59. package/dist/esm/models/ChapterFootnoteReference.js.map +7 -0
  60. package/dist/esm/models/ChapterHeading.js +34 -0
  61. package/dist/esm/models/ChapterHeading.js.map +7 -0
  62. package/dist/esm/models/ChapterHebrewSubtitle.js +38 -0
  63. package/dist/esm/models/ChapterHebrewSubtitle.js.map +7 -0
  64. package/dist/esm/models/ChapterHebrewSubtitleContentInner.js +35 -0
  65. package/dist/esm/models/ChapterHebrewSubtitleContentInner.js.map +7 -0
  66. package/dist/esm/models/ChapterLineBreak.js +31 -0
  67. package/dist/esm/models/ChapterLineBreak.js.map +7 -0
  68. package/dist/esm/models/ChapterVerse.js +41 -0
  69. package/dist/esm/models/ChapterVerse.js.map +7 -0
  70. package/dist/esm/models/ChapterVerseContentInner.js +44 -0
  71. package/dist/esm/models/ChapterVerseContentInner.js.map +7 -0
  72. package/dist/esm/models/DatasetChapterData.js +35 -0
  73. package/dist/esm/models/DatasetChapterData.js.map +7 -0
  74. package/dist/esm/models/DatasetChapterVerseContent.js +35 -0
  75. package/dist/esm/models/DatasetChapterVerseContent.js.map +7 -0
  76. package/dist/esm/models/FormattedText.js +32 -0
  77. package/dist/esm/models/FormattedText.js.map +7 -0
  78. package/dist/esm/models/InlineHeading.js +28 -0
  79. package/dist/esm/models/InlineHeading.js.map +7 -0
  80. package/dist/esm/models/InlineLineBreak.js +31 -0
  81. package/dist/esm/models/InlineLineBreak.js.map +7 -0
  82. package/dist/esm/models/ScoredVerseRef.js +47 -0
  83. package/dist/esm/models/ScoredVerseRef.js.map +7 -0
  84. package/dist/esm/models/TranslationBookChapter.js +35 -0
  85. package/dist/esm/models/TranslationBookChapter.js.map +7 -0
  86. package/dist/esm/models/VerseFootnoteReference.js +28 -0
  87. package/dist/esm/models/VerseFootnoteReference.js.map +7 -0
  88. package/dist/esm/models/index.js +40 -0
  89. package/dist/esm/models/index.js.map +7 -0
  90. package/dist/esm/runtime.js +304 -0
  91. package/dist/esm/runtime.js.map +7 -0
  92. package/dist/types/apis/DefaultApi.d.ts +176 -0
  93. package/dist/types/apis/FreeUseBibleApi.d.ts +34 -0
  94. package/dist/types/apis/index.d.ts +3 -0
  95. package/dist/types/index.d.ts +4 -0
  96. package/dist/types/models/ApiAvailableCommentaries.d.ts +34 -0
  97. package/dist/types/models/ApiAvailableDatasets.d.ts +34 -0
  98. package/dist/types/models/ApiAvailableTranslations.d.ts +34 -0
  99. package/dist/types/models/ApiCommentary.d.ts +145 -0
  100. package/dist/types/models/ApiCommentaryBook.d.ts +100 -0
  101. package/dist/types/models/ApiCommentaryBookChapter.d.ts +72 -0
  102. package/dist/types/models/ApiCommentaryBookChapterChapter.d.ts +46 -0
  103. package/dist/types/models/ApiCommentaryBooks.d.ts +41 -0
  104. package/dist/types/models/ApiDataset.d.ts +138 -0
  105. package/dist/types/models/ApiDatasetBook.d.ts +82 -0
  106. package/dist/types/models/ApiDatasetBookChapter.d.ts +78 -0
  107. package/dist/types/models/ApiDatasetBooks.d.ts +41 -0
  108. package/dist/types/models/ApiTranslation.d.ts +169 -0
  109. package/dist/types/models/ApiTranslationBook.d.ts +100 -0
  110. package/dist/types/models/ApiTranslationBookChapter.d.ts +96 -0
  111. package/dist/types/models/ApiTranslationBookChapterChapter.d.ts +47 -0
  112. package/dist/types/models/ApiTranslationBooks.d.ts +41 -0
  113. package/dist/types/models/ApiTranslationComplete.d.ts +41 -0
  114. package/dist/types/models/ApiTranslationCompleteBook.d.ts +83 -0
  115. package/dist/types/models/BookId.d.ts +125 -0
  116. package/dist/types/models/ChapterContent.d.ts +34 -0
  117. package/dist/types/models/ChapterFootnote.d.ts +53 -0
  118. package/dist/types/models/ChapterFootnoteCaller.d.ts +27 -0
  119. package/dist/types/models/ChapterFootnoteReference.d.ts +39 -0
  120. package/dist/types/models/ChapterHeading.d.ts +46 -0
  121. package/dist/types/models/ChapterHebrewSubtitle.d.ts +47 -0
  122. package/dist/types/models/ChapterHebrewSubtitleContentInner.d.ts +51 -0
  123. package/dist/types/models/ChapterLineBreak.d.ts +40 -0
  124. package/dist/types/models/ChapterVerse.d.ts +53 -0
  125. package/dist/types/models/ChapterVerseContentInner.d.ts +70 -0
  126. package/dist/types/models/DatasetChapterData.d.ts +40 -0
  127. package/dist/types/models/DatasetChapterVerseContent.d.ts +40 -0
  128. package/dist/types/models/FormattedText.d.ts +45 -0
  129. package/dist/types/models/InlineHeading.d.ts +33 -0
  130. package/dist/types/models/InlineLineBreak.d.ts +40 -0
  131. package/dist/types/models/ScoredVerseRef.d.ts +70 -0
  132. package/dist/types/models/TranslationBookChapter.d.ts +42 -0
  133. package/dist/types/models/VerseFootnoteReference.d.ts +33 -0
  134. package/dist/types/models/index.d.ts +39 -0
  135. package/dist/types/runtime.d.ts +185 -0
  136. package/package.json +31 -0
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ export function instanceOfInlineHeading(value) {
3
+ if (!("heading" in value) || value["heading"] === void 0) return false;
4
+ return true;
5
+ }
6
+ export function InlineHeadingFromJSON(json) {
7
+ return InlineHeadingFromJSONTyped(json, false);
8
+ }
9
+ export function InlineHeadingFromJSONTyped(json, ignoreDiscriminator) {
10
+ if (json == null) {
11
+ return json;
12
+ }
13
+ return {
14
+ "heading": json["heading"]
15
+ };
16
+ }
17
+ export function InlineHeadingToJSON(json) {
18
+ return InlineHeadingToJSONTyped(json, false);
19
+ }
20
+ export function InlineHeadingToJSONTyped(value, ignoreDiscriminator = false) {
21
+ if (value == null) {
22
+ return value;
23
+ }
24
+ return {
25
+ "heading": value["heading"]
26
+ };
27
+ }
28
+ //# sourceMappingURL=InlineHeading.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/InlineHeading.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\n/**\r\n * Free Use Bible API\r\n * An API for accessing over 1000 different Bible translations.\r\n *\r\n * The version of the OpenAPI document: 1.0.0\r\n * Contact: hello@helloao.org\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\n\r\nimport { mapValues } from '../runtime';\r\n/**\r\n * Defines the schema for a heading that is embedded in a verse.\r\n * @export\r\n * @interface InlineHeading\r\n */\r\nexport interface InlineHeading {\r\n /**\r\n * The text of the heading.\r\n * @type {string}\r\n * @memberof InlineHeading\r\n */\r\n heading: string;\r\n}\r\n\r\n/**\r\n * Check if a given object implements the InlineHeading interface.\r\n */\r\nexport function instanceOfInlineHeading(value: object): value is InlineHeading {\r\n if (!('heading' in value) || value['heading'] === undefined) return false;\r\n return true;\r\n}\r\n\r\nexport function InlineHeadingFromJSON(json: any): InlineHeading {\r\n return InlineHeadingFromJSONTyped(json, false);\r\n}\r\n\r\nexport function InlineHeadingFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineHeading {\r\n if (json == null) {\r\n return json;\r\n }\r\n return {\r\n \r\n 'heading': json['heading'],\r\n };\r\n}\r\n\r\nexport function InlineHeadingToJSON(json: any): InlineHeading {\r\n return InlineHeadingToJSONTyped(json, false);\r\n}\r\n\r\nexport function InlineHeadingToJSONTyped(value?: InlineHeading | null, ignoreDiscriminator: boolean = false): any {\r\n if (value == null) {\r\n return value;\r\n }\r\n\r\n return {\r\n \r\n 'heading': value['heading'],\r\n };\r\n}\r\n\r\n"],
5
+ "mappings": ";AAgCO,gBAAS,wBAAwB,OAAuC;AAC3E,MAAI,EAAE,aAAa,UAAU,MAAM,SAAS,MAAM,OAAW,QAAO;AACpE,SAAO;AACX;AAEO,gBAAS,sBAAsB,MAA0B;AAC5D,SAAO,2BAA2B,MAAM,KAAK;AACjD;AAEO,gBAAS,2BAA2B,MAAW,qBAA6C;AAC/F,MAAI,QAAQ,MAAM;AACd,WAAO;AAAA,EACX;AACA,SAAO;AAAA,IAEH,WAAW,KAAK,SAAS;AAAA,EAC7B;AACJ;AAEO,gBAAS,oBAAoB,MAA0B;AAC1D,SAAO,yBAAyB,MAAM,KAAK;AAC/C;AAEO,gBAAS,yBAAyB,OAA8B,sBAA+B,OAAY;AAC9G,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IAEH,WAAW,MAAM,SAAS;AAAA,EAC9B;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ export const InlineLineBreakLineBreakEnum = {
3
+ True: true
4
+ };
5
+ export function instanceOfInlineLineBreak(value) {
6
+ if (!("lineBreak" in value) || value["lineBreak"] === void 0) return false;
7
+ return true;
8
+ }
9
+ export function InlineLineBreakFromJSON(json) {
10
+ return InlineLineBreakFromJSONTyped(json, false);
11
+ }
12
+ export function InlineLineBreakFromJSONTyped(json, ignoreDiscriminator) {
13
+ if (json == null) {
14
+ return json;
15
+ }
16
+ return {
17
+ "lineBreak": json["lineBreak"]
18
+ };
19
+ }
20
+ export function InlineLineBreakToJSON(json) {
21
+ return InlineLineBreakToJSONTyped(json, false);
22
+ }
23
+ export function InlineLineBreakToJSONTyped(value, ignoreDiscriminator = false) {
24
+ if (value == null) {
25
+ return value;
26
+ }
27
+ return {
28
+ "lineBreak": value["lineBreak"]
29
+ };
30
+ }
31
+ //# sourceMappingURL=InlineLineBreak.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/InlineLineBreak.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\n/**\r\n * Free Use Bible API\r\n * An API for accessing over 1000 different Bible translations.\r\n *\r\n * The version of the OpenAPI document: 1.0.0\r\n * Contact: hello@helloao.org\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\n\r\nimport { mapValues } from '../runtime';\r\n/**\r\n * Defines the schema for a line break that is embedded in a verse.\r\n * @export\r\n * @interface InlineLineBreak\r\n */\r\nexport interface InlineLineBreak {\r\n /**\r\n * \r\n * @type {InlineLineBreakLineBreakEnum}\r\n * @memberof InlineLineBreak\r\n */\r\n lineBreak: InlineLineBreakLineBreakEnum;\r\n}\r\n\r\n\r\n/**\r\n * @export\r\n */\r\nexport const InlineLineBreakLineBreakEnum = {\r\n True: true\r\n} as const;\r\nexport type InlineLineBreakLineBreakEnum = typeof InlineLineBreakLineBreakEnum[keyof typeof InlineLineBreakLineBreakEnum];\r\n\r\n\r\n/**\r\n * Check if a given object implements the InlineLineBreak interface.\r\n */\r\nexport function instanceOfInlineLineBreak(value: object): value is InlineLineBreak {\r\n if (!('lineBreak' in value) || value['lineBreak'] === undefined) return false;\r\n return true;\r\n}\r\n\r\nexport function InlineLineBreakFromJSON(json: any): InlineLineBreak {\r\n return InlineLineBreakFromJSONTyped(json, false);\r\n}\r\n\r\nexport function InlineLineBreakFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineLineBreak {\r\n if (json == null) {\r\n return json;\r\n }\r\n return {\r\n \r\n 'lineBreak': json['lineBreak'],\r\n };\r\n}\r\n\r\nexport function InlineLineBreakToJSON(json: any): InlineLineBreak {\r\n return InlineLineBreakToJSONTyped(json, false);\r\n}\r\n\r\nexport function InlineLineBreakToJSONTyped(value?: InlineLineBreak | null, ignoreDiscriminator: boolean = false): any {\r\n if (value == null) {\r\n return value;\r\n }\r\n\r\n return {\r\n \r\n 'lineBreak': value['lineBreak'],\r\n };\r\n}\r\n\r\n"],
5
+ "mappings": ";AAiCO,aAAM,+BAA+B;AAAA,EACxC,MAAM;AACV;AAOO,gBAAS,0BAA0B,OAAyC;AAC/E,MAAI,EAAE,eAAe,UAAU,MAAM,WAAW,MAAM,OAAW,QAAO;AACxE,SAAO;AACX;AAEO,gBAAS,wBAAwB,MAA4B;AAChE,SAAO,6BAA6B,MAAM,KAAK;AACnD;AAEO,gBAAS,6BAA6B,MAAW,qBAA+C;AACnG,MAAI,QAAQ,MAAM;AACd,WAAO;AAAA,EACX;AACA,SAAO;AAAA,IAEH,aAAa,KAAK,WAAW;AAAA,EACjC;AACJ;AAEO,gBAAS,sBAAsB,MAA4B;AAC9D,SAAO,2BAA2B,MAAM,KAAK;AACjD;AAEO,gBAAS,2BAA2B,OAAgC,sBAA+B,OAAY;AAClH,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IAEH,aAAa,MAAM,WAAW;AAAA,EAClC;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ import {
3
+ BookIdFromJSON,
4
+ BookIdToJSON
5
+ } from "./BookId";
6
+ export function instanceOfScoredVerseRef(value) {
7
+ if (!("book" in value) || value["book"] === void 0) return false;
8
+ if (!("chapter" in value) || value["chapter"] === void 0) return false;
9
+ if (!("verse" in value) || value["verse"] === void 0) return false;
10
+ if (!("score" in value) || value["score"] === void 0) return false;
11
+ return true;
12
+ }
13
+ export function ScoredVerseRefFromJSON(json) {
14
+ return ScoredVerseRefFromJSONTyped(json, false);
15
+ }
16
+ export function ScoredVerseRefFromJSONTyped(json, ignoreDiscriminator) {
17
+ if (json == null) {
18
+ return json;
19
+ }
20
+ return {
21
+ "book": BookIdFromJSON(json["book"]),
22
+ "chapter": json["chapter"],
23
+ "verse": json["verse"],
24
+ "content": json["content"] == null ? void 0 : json["content"],
25
+ "endChapter": json["endChapter"] == null ? void 0 : json["endChapter"],
26
+ "endVerse": json["endVerse"] == null ? void 0 : json["endVerse"],
27
+ "score": json["score"]
28
+ };
29
+ }
30
+ export function ScoredVerseRefToJSON(json) {
31
+ return ScoredVerseRefToJSONTyped(json, false);
32
+ }
33
+ export function ScoredVerseRefToJSONTyped(value, ignoreDiscriminator = false) {
34
+ if (value == null) {
35
+ return value;
36
+ }
37
+ return {
38
+ "book": BookIdToJSON(value["book"]),
39
+ "chapter": value["chapter"],
40
+ "verse": value["verse"],
41
+ "content": value["content"],
42
+ "endChapter": value["endChapter"],
43
+ "endVerse": value["endVerse"],
44
+ "score": value["score"]
45
+ };
46
+ }
47
+ //# sourceMappingURL=ScoredVerseRef.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/ScoredVerseRef.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\n/**\r\n * Free Use Bible API\r\n * An API for accessing over 1000 different Bible translations.\r\n *\r\n * The version of the OpenAPI document: 1.0.0\r\n * Contact: hello@helloao.org\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\n\r\nimport { mapValues } from '../runtime';\r\nimport type { BookId } from './BookId';\r\nimport {\r\n BookIdFromJSON,\r\n BookIdFromJSONTyped,\r\n BookIdToJSON,\r\n BookIdToJSONTyped,\r\n} from './BookId';\r\n\r\n/**\r\n * Defines the schema for information about a verse reference that has an arbitrary score attached to it.\r\n * @export\r\n * @interface ScoredVerseRef\r\n */\r\nexport interface ScoredVerseRef {\r\n /**\r\n * \r\n * @type {BookId}\r\n * @memberof ScoredVerseRef\r\n */\r\n book: BookId;\r\n /**\r\n * The chapter number that the reference starts at.\r\n * @type {number}\r\n * @memberof ScoredVerseRef\r\n */\r\n chapter: number;\r\n /**\r\n * The verse number that the reference starts at.\r\n * @type {number}\r\n * @memberof ScoredVerseRef\r\n */\r\n verse: number;\r\n /**\r\n * The rest of the content of the verse reference. This is the part of the string that comes after the verse reference. For example, in \"GEN 1:1 In the beginning, God created the Heavens and the Earth.\", the content would be \"In the beginning, God created the Heavens and the Earth.\"\r\n * @type {string}\r\n * @memberof ScoredVerseRef\r\n */\r\n content?: string;\r\n /**\r\n * The chapter that the verse reference ends at. This is used for references that span multiple chapters, such as \"GEN 1:1-2:3\". In this case, the endChapter would be 2.\r\n * @type {number}\r\n * @memberof ScoredVerseRef\r\n */\r\n endChapter?: number;\r\n /**\r\n * The verse that the verse reference ends at. This is used for references that span multiple verses, such as \"GEN 1:1-1:3\". In this case, the endVerse would be 3.\r\n * @type {number}\r\n * @memberof ScoredVerseRef\r\n */\r\n endVerse?: number;\r\n /**\r\n * The score for the verse reference. The meaning of the score is arbitrary and is determined by the dataset.\r\n * @type {number}\r\n * @memberof ScoredVerseRef\r\n */\r\n score: number;\r\n}\r\n\r\n\r\n\r\n/**\r\n * Check if a given object implements the ScoredVerseRef interface.\r\n */\r\nexport function instanceOfScoredVerseRef(value: object): value is ScoredVerseRef {\r\n if (!('book' in value) || value['book'] === undefined) return false;\r\n if (!('chapter' in value) || value['chapter'] === undefined) return false;\r\n if (!('verse' in value) || value['verse'] === undefined) return false;\r\n if (!('score' in value) || value['score'] === undefined) return false;\r\n return true;\r\n}\r\n\r\nexport function ScoredVerseRefFromJSON(json: any): ScoredVerseRef {\r\n return ScoredVerseRefFromJSONTyped(json, false);\r\n}\r\n\r\nexport function ScoredVerseRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScoredVerseRef {\r\n if (json == null) {\r\n return json;\r\n }\r\n return {\r\n \r\n 'book': BookIdFromJSON(json['book']),\r\n 'chapter': json['chapter'],\r\n 'verse': json['verse'],\r\n 'content': json['content'] == null ? undefined : json['content'],\r\n 'endChapter': json['endChapter'] == null ? undefined : json['endChapter'],\r\n 'endVerse': json['endVerse'] == null ? undefined : json['endVerse'],\r\n 'score': json['score'],\r\n };\r\n}\r\n\r\nexport function ScoredVerseRefToJSON(json: any): ScoredVerseRef {\r\n return ScoredVerseRefToJSONTyped(json, false);\r\n}\r\n\r\nexport function ScoredVerseRefToJSONTyped(value?: ScoredVerseRef | null, ignoreDiscriminator: boolean = false): any {\r\n if (value == null) {\r\n return value;\r\n }\r\n\r\n return {\r\n \r\n 'book': BookIdToJSON(value['book']),\r\n 'chapter': value['chapter'],\r\n 'verse': value['verse'],\r\n 'content': value['content'],\r\n 'endChapter': value['endChapter'],\r\n 'endVerse': value['endVerse'],\r\n 'score': value['score'],\r\n };\r\n}\r\n\r\n"],
5
+ "mappings": ";AAgBA;AAAA,EACI;AAAA,EAEA;AAAA,OAEG;AAyDA,gBAAS,yBAAyB,OAAwC;AAC7E,MAAI,EAAE,UAAU,UAAU,MAAM,MAAM,MAAM,OAAW,QAAO;AAC9D,MAAI,EAAE,aAAa,UAAU,MAAM,SAAS,MAAM,OAAW,QAAO;AACpE,MAAI,EAAE,WAAW,UAAU,MAAM,OAAO,MAAM,OAAW,QAAO;AAChE,MAAI,EAAE,WAAW,UAAU,MAAM,OAAO,MAAM,OAAW,QAAO;AAChE,SAAO;AACX;AAEO,gBAAS,uBAAuB,MAA2B;AAC9D,SAAO,4BAA4B,MAAM,KAAK;AAClD;AAEO,gBAAS,4BAA4B,MAAW,qBAA8C;AACjG,MAAI,QAAQ,MAAM;AACd,WAAO;AAAA,EACX;AACA,SAAO;AAAA,IAEH,QAAQ,eAAe,KAAK,MAAM,CAAC;AAAA,IACnC,WAAW,KAAK,SAAS;AAAA,IACzB,SAAS,KAAK,OAAO;AAAA,IACrB,WAAW,KAAK,SAAS,KAAK,OAAO,SAAY,KAAK,SAAS;AAAA,IAC/D,cAAc,KAAK,YAAY,KAAK,OAAO,SAAY,KAAK,YAAY;AAAA,IACxE,YAAY,KAAK,UAAU,KAAK,OAAO,SAAY,KAAK,UAAU;AAAA,IAClE,SAAS,KAAK,OAAO;AAAA,EACzB;AACJ;AAEO,gBAAS,qBAAqB,MAA2B;AAC5D,SAAO,0BAA0B,MAAM,KAAK;AAChD;AAEO,gBAAS,0BAA0B,OAA+B,sBAA+B,OAAY;AAChH,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IAEH,QAAQ,aAAa,MAAM,MAAM,CAAC;AAAA,IAClC,WAAW,MAAM,SAAS;AAAA,IAC1B,SAAS,MAAM,OAAO;AAAA,IACtB,WAAW,MAAM,SAAS;AAAA,IAC1B,cAAc,MAAM,YAAY;AAAA,IAChC,YAAY,MAAM,UAAU;AAAA,IAC5B,SAAS,MAAM,OAAO;AAAA,EAC1B;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ import {
3
+ ApiTranslationBookChapterChapterFromJSON,
4
+ ApiTranslationBookChapterChapterToJSON
5
+ } from "./ApiTranslationBookChapterChapter";
6
+ export function instanceOfTranslationBookChapter(value) {
7
+ if (!("chapter" in value) || value["chapter"] === void 0) return false;
8
+ if (!("thisChapterAudioLinks" in value) || value["thisChapterAudioLinks"] === void 0) return false;
9
+ return true;
10
+ }
11
+ export function TranslationBookChapterFromJSON(json) {
12
+ return TranslationBookChapterFromJSONTyped(json, false);
13
+ }
14
+ export function TranslationBookChapterFromJSONTyped(json, ignoreDiscriminator) {
15
+ if (json == null) {
16
+ return json;
17
+ }
18
+ return {
19
+ "chapter": ApiTranslationBookChapterChapterFromJSON(json["chapter"]),
20
+ "thisChapterAudioLinks": json["thisChapterAudioLinks"]
21
+ };
22
+ }
23
+ export function TranslationBookChapterToJSON(json) {
24
+ return TranslationBookChapterToJSONTyped(json, false);
25
+ }
26
+ export function TranslationBookChapterToJSONTyped(value, ignoreDiscriminator = false) {
27
+ if (value == null) {
28
+ return value;
29
+ }
30
+ return {
31
+ "chapter": ApiTranslationBookChapterChapterToJSON(value["chapter"]),
32
+ "thisChapterAudioLinks": value["thisChapterAudioLinks"]
33
+ };
34
+ }
35
+ //# sourceMappingURL=TranslationBookChapter.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/TranslationBookChapter.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\n/**\r\n * Free Use Bible API\r\n * An API for accessing over 1000 different Bible translations.\r\n *\r\n * The version of the OpenAPI document: 1.0.0\r\n * Contact: hello@helloao.org\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\n\r\nimport { mapValues } from '../runtime';\r\nimport type { ApiTranslationBookChapterChapter } from './ApiTranslationBookChapterChapter';\r\nimport {\r\n ApiTranslationBookChapterChapterFromJSON,\r\n ApiTranslationBookChapterChapterFromJSONTyped,\r\n ApiTranslationBookChapterChapterToJSON,\r\n ApiTranslationBookChapterChapterToJSONTyped,\r\n} from './ApiTranslationBookChapterChapter';\r\n\r\n/**\r\n * Defines the schema for information about a book chapter.\r\n * @export\r\n * @interface TranslationBookChapter\r\n */\r\nexport interface TranslationBookChapter {\r\n /**\r\n * \r\n * @type {ApiTranslationBookChapterChapter}\r\n * @memberof TranslationBookChapter\r\n */\r\n chapter: ApiTranslationBookChapterChapter;\r\n /**\r\n * The links to different audio versions for the chapter.\r\n * @type {{ [key: string]: string; }}\r\n * @memberof TranslationBookChapter\r\n */\r\n thisChapterAudioLinks: { [key: string]: string; };\r\n}\r\n\r\n/**\r\n * Check if a given object implements the TranslationBookChapter interface.\r\n */\r\nexport function instanceOfTranslationBookChapter(value: object): value is TranslationBookChapter {\r\n if (!('chapter' in value) || value['chapter'] === undefined) return false;\r\n if (!('thisChapterAudioLinks' in value) || value['thisChapterAudioLinks'] === undefined) return false;\r\n return true;\r\n}\r\n\r\nexport function TranslationBookChapterFromJSON(json: any): TranslationBookChapter {\r\n return TranslationBookChapterFromJSONTyped(json, false);\r\n}\r\n\r\nexport function TranslationBookChapterFromJSONTyped(json: any, ignoreDiscriminator: boolean): TranslationBookChapter {\r\n if (json == null) {\r\n return json;\r\n }\r\n return {\r\n \r\n 'chapter': ApiTranslationBookChapterChapterFromJSON(json['chapter']),\r\n 'thisChapterAudioLinks': json['thisChapterAudioLinks'],\r\n };\r\n}\r\n\r\nexport function TranslationBookChapterToJSON(json: any): TranslationBookChapter {\r\n return TranslationBookChapterToJSONTyped(json, false);\r\n}\r\n\r\nexport function TranslationBookChapterToJSONTyped(value?: TranslationBookChapter | null, ignoreDiscriminator: boolean = false): any {\r\n if (value == null) {\r\n return value;\r\n }\r\n\r\n return {\r\n \r\n 'chapter': ApiTranslationBookChapterChapterToJSON(value['chapter']),\r\n 'thisChapterAudioLinks': value['thisChapterAudioLinks'],\r\n };\r\n}\r\n\r\n"],
5
+ "mappings": ";AAgBA;AAAA,EACI;AAAA,EAEA;AAAA,OAEG;AAyBA,gBAAS,iCAAiC,OAAgD;AAC7F,MAAI,EAAE,aAAa,UAAU,MAAM,SAAS,MAAM,OAAW,QAAO;AACpE,MAAI,EAAE,2BAA2B,UAAU,MAAM,uBAAuB,MAAM,OAAW,QAAO;AAChG,SAAO;AACX;AAEO,gBAAS,+BAA+B,MAAmC;AAC9E,SAAO,oCAAoC,MAAM,KAAK;AAC1D;AAEO,gBAAS,oCAAoC,MAAW,qBAAsD;AACjH,MAAI,QAAQ,MAAM;AACd,WAAO;AAAA,EACX;AACA,SAAO;AAAA,IAEH,WAAW,yCAAyC,KAAK,SAAS,CAAC;AAAA,IACnE,yBAAyB,KAAK,uBAAuB;AAAA,EACzD;AACJ;AAEO,gBAAS,6BAA6B,MAAmC;AAC5E,SAAO,kCAAkC,MAAM,KAAK;AACxD;AAEO,gBAAS,kCAAkC,OAAuC,sBAA+B,OAAY;AAChI,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IAEH,WAAW,uCAAuC,MAAM,SAAS,CAAC;AAAA,IAClE,yBAAyB,MAAM,uBAAuB;AAAA,EAC1D;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ export function instanceOfVerseFootnoteReference(value) {
3
+ if (!("noteId" in value) || value["noteId"] === void 0) return false;
4
+ return true;
5
+ }
6
+ export function VerseFootnoteReferenceFromJSON(json) {
7
+ return VerseFootnoteReferenceFromJSONTyped(json, false);
8
+ }
9
+ export function VerseFootnoteReferenceFromJSONTyped(json, ignoreDiscriminator) {
10
+ if (json == null) {
11
+ return json;
12
+ }
13
+ return {
14
+ "noteId": json["noteId"]
15
+ };
16
+ }
17
+ export function VerseFootnoteReferenceToJSON(json) {
18
+ return VerseFootnoteReferenceToJSONTyped(json, false);
19
+ }
20
+ export function VerseFootnoteReferenceToJSONTyped(value, ignoreDiscriminator = false) {
21
+ if (value == null) {
22
+ return value;
23
+ }
24
+ return {
25
+ "noteId": value["noteId"]
26
+ };
27
+ }
28
+ //# sourceMappingURL=VerseFootnoteReference.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/VerseFootnoteReference.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\n/**\r\n * Free Use Bible API\r\n * An API for accessing over 1000 different Bible translations.\r\n *\r\n * The version of the OpenAPI document: 1.0.0\r\n * Contact: hello@helloao.org\r\n *\r\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\r\n * https://openapi-generator.tech\r\n * Do not edit the class manually.\r\n */\r\n\r\nimport { mapValues } from '../runtime';\r\n/**\r\n * Defines the schema for a footnote reference in a verse or a Hebrew Subtitle.\r\n * @export\r\n * @interface VerseFootnoteReference\r\n */\r\nexport interface VerseFootnoteReference {\r\n /**\r\n * The ID of the note.\r\n * @type {number}\r\n * @memberof VerseFootnoteReference\r\n */\r\n noteId: number;\r\n}\r\n\r\n/**\r\n * Check if a given object implements the VerseFootnoteReference interface.\r\n */\r\nexport function instanceOfVerseFootnoteReference(value: object): value is VerseFootnoteReference {\r\n if (!('noteId' in value) || value['noteId'] === undefined) return false;\r\n return true;\r\n}\r\n\r\nexport function VerseFootnoteReferenceFromJSON(json: any): VerseFootnoteReference {\r\n return VerseFootnoteReferenceFromJSONTyped(json, false);\r\n}\r\n\r\nexport function VerseFootnoteReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerseFootnoteReference {\r\n if (json == null) {\r\n return json;\r\n }\r\n return {\r\n \r\n 'noteId': json['noteId'],\r\n };\r\n}\r\n\r\nexport function VerseFootnoteReferenceToJSON(json: any): VerseFootnoteReference {\r\n return VerseFootnoteReferenceToJSONTyped(json, false);\r\n}\r\n\r\nexport function VerseFootnoteReferenceToJSONTyped(value?: VerseFootnoteReference | null, ignoreDiscriminator: boolean = false): any {\r\n if (value == null) {\r\n return value;\r\n }\r\n\r\n return {\r\n \r\n 'noteId': value['noteId'],\r\n };\r\n}\r\n\r\n"],
5
+ "mappings": ";AAgCO,gBAAS,iCAAiC,OAAgD;AAC7F,MAAI,EAAE,YAAY,UAAU,MAAM,QAAQ,MAAM,OAAW,QAAO;AAClE,SAAO;AACX;AAEO,gBAAS,+BAA+B,MAAmC;AAC9E,SAAO,oCAAoC,MAAM,KAAK;AAC1D;AAEO,gBAAS,oCAAoC,MAAW,qBAAsD;AACjH,MAAI,QAAQ,MAAM;AACd,WAAO;AAAA,EACX;AACA,SAAO;AAAA,IAEH,UAAU,KAAK,QAAQ;AAAA,EAC3B;AACJ;AAEO,gBAAS,6BAA6B,MAAmC;AAC5E,SAAO,kCAAkC,MAAM,KAAK;AACxD;AAEO,gBAAS,kCAAkC,OAAuC,sBAA+B,OAAY;AAChI,MAAI,SAAS,MAAM;AACf,WAAO;AAAA,EACX;AAEA,SAAO;AAAA,IAEH,UAAU,MAAM,QAAQ;AAAA,EAC5B;AACJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ export * from "./ApiAvailableCommentaries";
3
+ export * from "./ApiAvailableDatasets";
4
+ export * from "./ApiAvailableTranslations";
5
+ export * from "./ApiCommentary";
6
+ export * from "./ApiCommentaryBook";
7
+ export * from "./ApiCommentaryBookChapter";
8
+ export * from "./ApiCommentaryBookChapterChapter";
9
+ export * from "./ApiCommentaryBooks";
10
+ export * from "./ApiDataset";
11
+ export * from "./ApiDatasetBook";
12
+ export * from "./ApiDatasetBookChapter";
13
+ export * from "./ApiDatasetBooks";
14
+ export * from "./ApiTranslation";
15
+ export * from "./ApiTranslationBook";
16
+ export * from "./ApiTranslationBookChapter";
17
+ export * from "./ApiTranslationBookChapterChapter";
18
+ export * from "./ApiTranslationBooks";
19
+ export * from "./ApiTranslationComplete";
20
+ export * from "./ApiTranslationCompleteBook";
21
+ export * from "./BookId";
22
+ export * from "./ChapterContent";
23
+ export * from "./ChapterFootnote";
24
+ export * from "./ChapterFootnoteCaller";
25
+ export * from "./ChapterFootnoteReference";
26
+ export * from "./ChapterHeading";
27
+ export * from "./ChapterHebrewSubtitle";
28
+ export * from "./ChapterHebrewSubtitleContentInner";
29
+ export * from "./ChapterLineBreak";
30
+ export * from "./ChapterVerse";
31
+ export * from "./ChapterVerseContentInner";
32
+ export * from "./DatasetChapterData";
33
+ export * from "./DatasetChapterVerseContent";
34
+ export * from "./FormattedText";
35
+ export * from "./InlineHeading";
36
+ export * from "./InlineLineBreak";
37
+ export * from "./ScoredVerseRef";
38
+ export * from "./TranslationBookChapter";
39
+ export * from "./VerseFootnoteReference";
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../models/index.ts"],
4
+ "sourcesContent": ["/* tslint:disable */\r\n/* eslint-disable */\r\nexport * from './ApiAvailableCommentaries';\r\nexport * from './ApiAvailableDatasets';\r\nexport * from './ApiAvailableTranslations';\r\nexport * from './ApiCommentary';\r\nexport * from './ApiCommentaryBook';\r\nexport * from './ApiCommentaryBookChapter';\r\nexport * from './ApiCommentaryBookChapterChapter';\r\nexport * from './ApiCommentaryBooks';\r\nexport * from './ApiDataset';\r\nexport * from './ApiDatasetBook';\r\nexport * from './ApiDatasetBookChapter';\r\nexport * from './ApiDatasetBooks';\r\nexport * from './ApiTranslation';\r\nexport * from './ApiTranslationBook';\r\nexport * from './ApiTranslationBookChapter';\r\nexport * from './ApiTranslationBookChapterChapter';\r\nexport * from './ApiTranslationBooks';\r\nexport * from './ApiTranslationComplete';\r\nexport * from './ApiTranslationCompleteBook';\r\nexport * from './BookId';\r\nexport * from './ChapterContent';\r\nexport * from './ChapterFootnote';\r\nexport * from './ChapterFootnoteCaller';\r\nexport * from './ChapterFootnoteReference';\r\nexport * from './ChapterHeading';\r\nexport * from './ChapterHebrewSubtitle';\r\nexport * from './ChapterHebrewSubtitleContentInner';\r\nexport * from './ChapterLineBreak';\r\nexport * from './ChapterVerse';\r\nexport * from './ChapterVerseContentInner';\r\nexport * from './DatasetChapterData';\r\nexport * from './DatasetChapterVerseContent';\r\nexport * from './FormattedText';\r\nexport * from './InlineHeading';\r\nexport * from './InlineLineBreak';\r\nexport * from './ScoredVerseRef';\r\nexport * from './TranslationBookChapter';\r\nexport * from './VerseFootnoteReference';\r\n"],
5
+ "mappings": ";AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
3
+ export class Configuration {
4
+ constructor(configuration = {}) {
5
+ this.configuration = configuration;
6
+ }
7
+ set config(configuration) {
8
+ this.configuration = configuration;
9
+ }
10
+ get basePath() {
11
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
12
+ }
13
+ get fetchApi() {
14
+ return this.configuration.fetchApi;
15
+ }
16
+ get middleware() {
17
+ return this.configuration.middleware || [];
18
+ }
19
+ get queryParamsStringify() {
20
+ return this.configuration.queryParamsStringify || querystring;
21
+ }
22
+ get username() {
23
+ return this.configuration.username;
24
+ }
25
+ get password() {
26
+ return this.configuration.password;
27
+ }
28
+ get apiKey() {
29
+ const apiKey = this.configuration.apiKey;
30
+ if (apiKey) {
31
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
32
+ }
33
+ return void 0;
34
+ }
35
+ get accessToken() {
36
+ const accessToken = this.configuration.accessToken;
37
+ if (accessToken) {
38
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
39
+ }
40
+ return void 0;
41
+ }
42
+ get headers() {
43
+ return this.configuration.headers;
44
+ }
45
+ get credentials() {
46
+ return this.configuration.credentials;
47
+ }
48
+ }
49
+ export const DefaultConfig = new Configuration();
50
+ export class BaseAPI {
51
+ constructor(configuration = DefaultConfig) {
52
+ this.configuration = configuration;
53
+ this.middleware = configuration.middleware;
54
+ }
55
+ static jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
56
+ middleware;
57
+ withMiddleware(...middlewares) {
58
+ const next = this.clone();
59
+ next.middleware = next.middleware.concat(...middlewares);
60
+ return next;
61
+ }
62
+ withPreMiddleware(...preMiddlewares) {
63
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
64
+ return this.withMiddleware(...middlewares);
65
+ }
66
+ withPostMiddleware(...postMiddlewares) {
67
+ const middlewares = postMiddlewares.map((post) => ({ post }));
68
+ return this.withMiddleware(...middlewares);
69
+ }
70
+ /**
71
+ * Check if the given MIME is a JSON MIME.
72
+ * JSON MIME examples:
73
+ * application/json
74
+ * application/json; charset=UTF8
75
+ * APPLICATION/JSON
76
+ * application/vnd.company+json
77
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
78
+ * @return True if the given MIME is JSON, false otherwise.
79
+ */
80
+ isJsonMime(mime) {
81
+ if (!mime) {
82
+ return false;
83
+ }
84
+ return BaseAPI.jsonRegex.test(mime);
85
+ }
86
+ async request(context, initOverrides) {
87
+ const { url, init } = await this.createFetchParams(context, initOverrides);
88
+ const response = await this.fetchApi(url, init);
89
+ if (response && (response.status >= 200 && response.status < 300)) {
90
+ return response;
91
+ }
92
+ throw new ResponseError(response, "Response returned an error code");
93
+ }
94
+ async createFetchParams(context, initOverrides) {
95
+ let url = this.configuration.basePath + context.path;
96
+ if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
97
+ url += "?" + this.configuration.queryParamsStringify(context.query);
98
+ }
99
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
100
+ Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
101
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
102
+ const initParams = {
103
+ method: context.method,
104
+ headers,
105
+ body: context.body,
106
+ credentials: this.configuration.credentials
107
+ };
108
+ const overriddenInit = {
109
+ ...initParams,
110
+ ...await initOverrideFn({
111
+ init: initParams,
112
+ context
113
+ })
114
+ };
115
+ let body;
116
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
117
+ body = overriddenInit.body;
118
+ } else if (this.isJsonMime(headers["Content-Type"])) {
119
+ body = JSON.stringify(overriddenInit.body);
120
+ } else {
121
+ body = overriddenInit.body;
122
+ }
123
+ const init = {
124
+ ...overriddenInit,
125
+ body
126
+ };
127
+ return { url, init };
128
+ }
129
+ fetchApi = async (url, init) => {
130
+ let fetchParams = { url, init };
131
+ for (const middleware of this.middleware) {
132
+ if (middleware.pre) {
133
+ fetchParams = await middleware.pre({
134
+ fetch: this.fetchApi,
135
+ ...fetchParams
136
+ }) || fetchParams;
137
+ }
138
+ }
139
+ let response = void 0;
140
+ try {
141
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
142
+ } catch (e) {
143
+ for (const middleware of this.middleware) {
144
+ if (middleware.onError) {
145
+ response = await middleware.onError({
146
+ fetch: this.fetchApi,
147
+ url: fetchParams.url,
148
+ init: fetchParams.init,
149
+ error: e,
150
+ response: response ? response.clone() : void 0
151
+ }) || response;
152
+ }
153
+ }
154
+ if (response === void 0) {
155
+ if (e instanceof Error) {
156
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
157
+ } else {
158
+ throw e;
159
+ }
160
+ }
161
+ }
162
+ for (const middleware of this.middleware) {
163
+ if (middleware.post) {
164
+ response = await middleware.post({
165
+ fetch: this.fetchApi,
166
+ url: fetchParams.url,
167
+ init: fetchParams.init,
168
+ response: response.clone()
169
+ }) || response;
170
+ }
171
+ }
172
+ return response;
173
+ };
174
+ /**
175
+ * Create a shallow clone of `this` by constructing a new instance
176
+ * and then shallow cloning data members.
177
+ */
178
+ clone() {
179
+ const constructor = this.constructor;
180
+ const next = new constructor(this.configuration);
181
+ next.middleware = this.middleware.slice();
182
+ return next;
183
+ }
184
+ }
185
+ ;
186
+ function isBlob(value) {
187
+ return typeof Blob !== "undefined" && value instanceof Blob;
188
+ }
189
+ function isFormData(value) {
190
+ return typeof FormData !== "undefined" && value instanceof FormData;
191
+ }
192
+ export class ResponseError extends Error {
193
+ constructor(response, msg) {
194
+ super(msg);
195
+ this.response = response;
196
+ const actualProto = new.target.prototype;
197
+ if (Object.setPrototypeOf) {
198
+ Object.setPrototypeOf(this, actualProto);
199
+ }
200
+ }
201
+ name = "ResponseError";
202
+ }
203
+ export class FetchError extends Error {
204
+ constructor(cause, msg) {
205
+ super(msg);
206
+ this.cause = cause;
207
+ const actualProto = new.target.prototype;
208
+ if (Object.setPrototypeOf) {
209
+ Object.setPrototypeOf(this, actualProto);
210
+ }
211
+ }
212
+ name = "FetchError";
213
+ }
214
+ export class RequiredError extends Error {
215
+ constructor(field, msg) {
216
+ super(msg);
217
+ this.field = field;
218
+ const actualProto = new.target.prototype;
219
+ if (Object.setPrototypeOf) {
220
+ Object.setPrototypeOf(this, actualProto);
221
+ }
222
+ }
223
+ name = "RequiredError";
224
+ }
225
+ export const COLLECTION_FORMATS = {
226
+ csv: ",",
227
+ ssv: " ",
228
+ tsv: " ",
229
+ pipes: "|"
230
+ };
231
+ export function querystring(params, prefix = "") {
232
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
233
+ }
234
+ function querystringSingleKey(key, value, keyPrefix = "") {
235
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
236
+ if (value instanceof Array) {
237
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
238
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
239
+ }
240
+ if (value instanceof Set) {
241
+ const valueAsArray = Array.from(value);
242
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
243
+ }
244
+ if (value instanceof Date) {
245
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
246
+ }
247
+ if (value instanceof Object) {
248
+ return querystring(value, fullKey);
249
+ }
250
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
251
+ }
252
+ export function exists(json, key) {
253
+ const value = json[key];
254
+ return value !== null && value !== void 0;
255
+ }
256
+ export function mapValues(data, fn) {
257
+ const result = {};
258
+ for (const key of Object.keys(data)) {
259
+ result[key] = fn(data[key]);
260
+ }
261
+ return result;
262
+ }
263
+ export function canConsumeForm(consumes) {
264
+ for (const consume of consumes) {
265
+ if ("multipart/form-data" === consume.contentType) {
266
+ return true;
267
+ }
268
+ }
269
+ return false;
270
+ }
271
+ export class JSONApiResponse {
272
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
273
+ this.raw = raw;
274
+ this.transformer = transformer;
275
+ }
276
+ async value() {
277
+ return this.transformer(await this.raw.json());
278
+ }
279
+ }
280
+ export class VoidApiResponse {
281
+ constructor(raw) {
282
+ this.raw = raw;
283
+ }
284
+ async value() {
285
+ return void 0;
286
+ }
287
+ }
288
+ export class BlobApiResponse {
289
+ constructor(raw) {
290
+ this.raw = raw;
291
+ }
292
+ async value() {
293
+ return await this.raw.blob();
294
+ }
295
+ }
296
+ export class TextApiResponse {
297
+ constructor(raw) {
298
+ this.raw = raw;
299
+ }
300
+ async value() {
301
+ return await this.raw.text();
302
+ }
303
+ }
304
+ //# sourceMappingURL=runtime.js.map