@amanda-mitchell/biblia-api
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -1,10 +0,23 @@ | ||
import type fetchMethod from 'node-fetch'; | ||
export declare const usageAcknowledgment = "<a href=\"https://biblia.com/\"><img src=\"https://api.biblia.com/v1/PoweredByBiblia_small.png\" alt=\"Powered by Biblia\" /></a>\nThis site uses the <a href=\"https://biblia.com/\">Biblia</a> web services from <a href=\"https://www.logos.com/\">Logos Bible Software</a>."; | ||
declare type ClientOptions = { | ||
declare type FetchMethod<TBlob> = (input: string, init?: RequestInit) => Promise<Response<TBlob>>; | ||
declare type RequestInit = { | ||
method: string; | ||
headers: Record<string, string>; | ||
}; | ||
declare type Response<TBlob> = { | ||
status: number; | ||
headers: { | ||
get: (header: string) => string | null; | ||
}; | ||
json: <T>() => Promise<T>; | ||
text: () => Promise<string>; | ||
blob: () => Promise<TBlob>; | ||
}; | ||
declare type ClientOptions<TBlob> = { | ||
apiKey: string; | ||
fetch: typeof fetchMethod; | ||
fetch: FetchMethod<TBlob>; | ||
}; | ||
declare type BibleBook = string; | ||
declare type FullBibleReference = string; | ||
export declare function createBibliaApiClient({ apiKey, fetch }: ClientOptions): { | ||
export declare function createBibliaApiClient<TBlob>({ apiKey, fetch, }: ClientOptions<TBlob>): { | ||
content: (options: { | ||
@@ -93,3 +106,3 @@ style?: "fullyFormatted" | "oneVersePerLine" | "oneVersePerLineFullReference" | "quotation" | "simpleParagraphs" | "bibleTextOnly" | "orationOneParagraph" | "orationOneVersePerLine" | "orationBibleParagraphs" | "fullyFormattedWithFootnotes" | undefined; | ||
bible: "asv" | "arvandyke" | "kjv" | "lsg" | "byz" | "darby" | "elzevir" | "itdiodati1649" | "emphbbl" | "kjv1900" | "kjvapoc" | "leb" | "scrmorph" | "fi-raamattu" | "rvr60" | "rva" | "bb-sbb-rusbt" | "eo-zamenbib" | "tr1881" | "tr1894mr" | "svv" | "stephens" | "tanakh" | "wbtc-ptbrnt" | "wh1881mr" | "ylt"; | ||
}) => Promise<import("node-fetch").Blob>; | ||
}) => Promise<TBlob>; | ||
parse: (options: { | ||
@@ -96,0 +109,0 @@ style?: "short" | "medium" | "long" | undefined; |
@@ -15,3 +15,3 @@ "use strict"; | ||
expectContentType(response, 'application/json'); | ||
return (await response.json()); | ||
return await response.json(); | ||
} | ||
@@ -198,3 +198,3 @@ function createJsonResultParser() { | ||
}); | ||
function createBibliaApiClient({ apiKey, fetch }) { | ||
function createBibliaApiClient({ apiKey, fetch, }) { | ||
function createUrlTemplate(urlParts, ...names) { | ||
@@ -201,0 +201,0 @@ for (const name of names) { |
{ | ||
"name": "@amanda-mitchell/biblia-api", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A Javascript wrapper for the Biblia API.", | ||
@@ -21,14 +21,7 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@amanda-mitchell/node-project-scripts": "^2.4.2", | ||
"@tsconfig/node12": "^1.0.7", | ||
"@types/jest": "^26.0.20", | ||
"@amanda-mitchell/node-project-scripts": "^2.37.2", | ||
"@types/node-fetch": "^2.5.8", | ||
"@typescript-eslint/eslint-plugin": "^4.14.0", | ||
"@typescript-eslint/parser": "^4.14.0", | ||
"dotenv": "^8.2.0", | ||
"jest": "^26.6.3", | ||
"node-fetch": "^2.6.1", | ||
"ts-jest": "^26.4.4", | ||
"typescript": "^4.1.3" | ||
"node-fetch": "^2.6.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
45800
4
420
11