Redirecting you to ${redirectUrl}
${apiDetail.name}
${apiDetail.description}
${apiDetail.arguments.length ? `Arguments
- ${renderArguments(apiDetail.arguments).join("")}
Returns
${dedent(apiDetailsReturns)}
"use strict"; // I M P O R T S import asyncHtml from "choo-async/html"; import dedent from "dedent"; import got from "got"; // U T I L S import headerBlockchain from "@component/api/header-blockchain"; import headerSdk from "@component/api/header-sdk"; import redirects from "@data/redirects.json"; const blockchainApi = "https://cdn.jsdelivr.net/gh/lbryio/lbrycrd@master/contrib/devtools/generated/api_v1.json"; const cache = new Map(); const sdkApi = "https://cdn.jsdelivr.net/gh/lbryio/lbry@api_doc_categories/docs/api.json"; // E X P O R T export default async(state) => { // below is evil, I just inherited it -- Jeremy const apilabel = state.params.wildcard === "sdk" ? "SDK" : state.params.wildcard.charAt(0).toLocaleUpperCase() + state.params.wildcard.substring(1); state.lbry = { title: apilabel + " API Documentation", description: "See API documentation, signatures, and sample calls for the LBRY " + apilabel + " APIs." }; try { const apiResponse = await parseApiFile(state.params.wildcard); return asyncHtml`
Redirecting you to ${redirectUrl}
${apiDetail.description}
${apiDetail.arguments.length ? `${dedent(apiDetailsReturns)}
// example(s) for ${apiDetail.name} to come later
`}
${sectionDescription}
${sectionDetails.description}
${renderReturns(sectionDetails.returns)}
// example(s) to come later
");
return exampleContent;
}
for (const arg of args) {
exampleContent.push(`
${arg.curl}
${arg.lbrynet}
${arg.python}
${arg.output}