Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
482 changes: 68 additions & 414 deletions scripts/generate-api-v2.mjs

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions scripts/generate-hosted-api-v1.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env node
/**
* Generates per-tag Markdown pages for the Hosted v1 API from the OpenAPI spec.
*
* Usage:
* node scripts/generate-hosted-api-v1.mjs
*
* Output: site/dolt/src/content/products/hosted/api/v1/
* user.md — User-tagged endpoints
* deployment.md — Deployment-tagged endpoints
* models.md — all component schemas
*
* authentication.md and README.md are hand-written; this script does not touch
* them.
*
* The rendering lives in scripts/lib/openapi-docs.mjs, shared with the DoltHub
* v2 generator.
*/

import { dirname, join } from "path";
import { fileURLToPath } from "url";
import { generateApiDocs } from "./lib/openapi-docs.mjs";

const __dirname = dirname(fileURLToPath(import.meta.url));

generateApiDocs({
specPath: join(__dirname, "../specs/hosted-v1.yaml"),
outDir: join(__dirname, "../site/dolt/src/content/products/hosted/api/v1"),
tagPages: [
{
tag: "User",
file: "user.md",
frontmatter:
'---\ntitle: "User"\ndescription: The authenticated user resource in the Hosted v1 API.\n---\n\n# User',
},
{
tag: "Deployment",
file: "deployment.md",
frontmatter:
'---\ntitle: "Deployment"\ndescription: Creating, listing, and reading Hosted Dolt deployments and their instances.\n---\n\n# Deployment',
},
],
models: {
file: "models.md",
href: "/products/hosted/api/v1/models",
frontmatter:
'---\ntitle: "Models"\ndescription: Request and response schemas for the Hosted v1 API.\n---\n\n# Models',
intro:
"Shared request and response types used across the v1 API. See the [error model](#model-problem) for how failures are reported.",
},
});
Loading
Loading