mirror of
https://github.com/Dokploy/website.git
synced 2026-06-19 06:05:27 +02:00
- Refactored API documentation generation to utilize the new `fumadocs-openapi` features, including improved error handling and output structure. - Replaced the Authorization security scheme with x-api-key for enhanced API key authentication. - Added new MDX files for various API endpoints, ensuring comprehensive documentation coverage. - Updated the OpenAPI specification to reflect the latest changes in security definitions and response schemas. - Enhanced the documentation generation script to streamline the process and ensure consistency.
36 lines
997 B
TypeScript
36 lines
997 B
TypeScript
import { docs } from 'fumadocs-mdx:collections/server';
|
|
import { type InferPageType, loader } from 'fumadocs-core/source';
|
|
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
|
|
import { createOpenAPI } from 'fumadocs-openapi/server';
|
|
import { createAPIPage } from 'fumadocs-openapi/ui';
|
|
|
|
// See https://fumadocs.dev/docs/headless/source-api for more info
|
|
export const source = loader({
|
|
baseUrl: '/docs',
|
|
source: docs.toFumadocsSource(),
|
|
plugins: [lucideIconsPlugin()],
|
|
});
|
|
|
|
export const openapi = createOpenAPI({
|
|
input: ['./public/openapi.json'],
|
|
});
|
|
|
|
export const APIPage = createAPIPage(openapi);
|
|
|
|
export function getPageImage(page: InferPageType<typeof source>) {
|
|
const segments = [...page.slugs, 'image.png'];
|
|
|
|
return {
|
|
segments,
|
|
url: `/og/docs/${segments.join('/')}`,
|
|
};
|
|
}
|
|
|
|
export async function getLLMText(page: InferPageType<typeof source>) {
|
|
const processed = await page.data.getText('processed');
|
|
|
|
return `# ${page.data.title}
|
|
|
|
${processed}`;
|
|
}
|