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"; import Octokit from "@octokit/rest"; // 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 cache = new Map(); const filePathBlockchain = "/contrib/devtools/generated/api_v1.json"; const filePathSdk = "/docs/api.json"; const rawGitHubBase = "https://raw.githubusercontent.com/lbryio/"; const octokit = new Octokit({ auth: `token ${process.env.GITHUB_OAUTH_TOKEN}` }); // E X P O R T export default async(state) => { const { tag } = state; const { wildcard } = state.params; const repository = wildcard === "sdk" ? "lbry-sdk" : "lbrycrd"; state.lbry = { title: tag ? tag + " API Documentation" : "API Documentation", description: "See API documentation, signatures, and sample calls for the LBRY APIs." }; const tags = await getTags(repository); const currentTag = tag && tag.length ? tag : tags[0]; try { const apiResponse = await parseApiFile({ repo: repository, tag: currentTag }); return asyncHtml`
Redirecting you to ${redirectUrl}
${apiDetail.description}
${apiDetail.arguments.length ? `${dedent(apiDetailsReturns)}
` : ""}
// example(s) for ${apiDetail.name} to come later
`}
${sectionDetails.description}
${renderReturns(sectionDetails.returns)}
// example(s) to come later
");
return exampleContent;
}
args.forEach(arg => {
exampleContent.push(`
${arg.title ? `${arg.cli}
` : ""}
${arg.curl ? `${arg.curl}
` : ""}
${arg.lbrynet ? `${arg.lbrynet}
` : ""}
${arg.python ? `${arg.python}
` : ""}
${arg.output ? `
${arg.output}