mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
refactor(app): regenerate docs nav + update routes/tests for new subfolder layout
- src/app/docs/lib/docs-auto-generated.ts is regenerated from docs/<sub>/ with
fileName values like "architecture/ARCHITECTURE.md". The dynamic slug page
joins these against process.cwd()/docs so resolution still works.
- src/app/api/openapi/spec/route.ts now looks for the spec at
docs/reference/openapi.yaml first, with the flat-path fallback retained for
older bundles.
- tests updated: integration-wiring expects docs/reference/{API_REFERENCE.md,
openapi.yaml}; docs-site-overhaul reflects the new 8-section nav titles
(Architecture, Guides, Reference, Frameworks, Routing, Security, Compression,
Ops) and the new section for setup-guide ("Guides").
- open-sse/mcp-server/README.md picks up the rewritten docs/ reference.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
> **Model Context Protocol server** that exposes OmniRoute's gateway intelligence as **37 tools** for AI agents.
|
||||
>
|
||||
> **Source of truth for the full tool catalog and REST surface:** [`docs/MCP-SERVER.md`](../../docs/MCP-SERVER.md). This README focuses on architecture, configuration, and integration examples; the catalog below is a summary subset.
|
||||
> **Source of truth for the full tool catalog and REST surface:** [`docs/frameworks/MCP-SERVER.md`](../../docs/MCP-SERVER.md). This README focuses on architecture, configuration, and integration examples; the catalog below is a summary subset.
|
||||
|
||||
The MCP Server allows any AI agent (Claude Desktop, Cursor, VS Code Copilot, custom agents) to **monitor, control, and optimize** the OmniRoute AI gateway programmatically.
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ import yaml from "js-yaml";
|
||||
|
||||
let cachedSpec: { data: any; mtime: number } | null = null;
|
||||
const OPENAPI_SPEC_CANDIDATES = [
|
||||
path.join(/* turbopackIgnore: true */ process.cwd(), "docs", "reference", "openapi.yaml"),
|
||||
path.join(/* turbopackIgnore: true */ process.cwd(), "app", "docs", "reference", "openapi.yaml"),
|
||||
// Legacy locations kept as fallback for old standalone bundles.
|
||||
path.join(/* turbopackIgnore: true */ process.cwd(), "docs", "openapi.yaml"),
|
||||
path.join(/* turbopackIgnore: true */ process.cwd(), "app", "docs", "openapi.yaml"),
|
||||
];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -294,8 +294,8 @@ describe("API Routes — dashboard and tool consumers", () => {
|
||||
|
||||
it("keeps legacy usage history and raw request-log APIs explicitly classified", () => {
|
||||
const usageStats = readProjectFile("src/shared/components/UsageStats.tsx");
|
||||
const apiReference = readProjectFile("docs/API_REFERENCE.md");
|
||||
const openApi = readProjectFile("docs/openapi.yaml");
|
||||
const apiReference = readProjectFile("docs/reference/API_REFERENCE.md");
|
||||
const openApi = readProjectFile("docs/reference/openapi.yaml");
|
||||
|
||||
assert.ok(usageStats, "UsageStats compatibility component should exist");
|
||||
assert.ok(apiReference, "API reference should exist");
|
||||
@@ -343,7 +343,7 @@ describe("Dashboard Wiring — T05 payload rules", () => {
|
||||
const payloadRulesTabSrc = readProjectFile(
|
||||
"src/app/(dashboard)/dashboard/settings/components/PayloadRulesTab.tsx"
|
||||
);
|
||||
const openapiSrc = readProjectFile("docs/openapi.yaml");
|
||||
const openapiSrc = readProjectFile("docs/reference/openapi.yaml");
|
||||
|
||||
it("settings page should surface payload rules inside advanced settings", () => {
|
||||
assert.ok(settingsPageSrc, "settings page source should exist");
|
||||
@@ -361,7 +361,7 @@ describe("Dashboard Wiring — T05 payload rules", () => {
|
||||
});
|
||||
|
||||
it("openapi should document the payload rules management surface", () => {
|
||||
assert.ok(openapiSrc, "docs/openapi.yaml should exist");
|
||||
assert.ok(openapiSrc, "docs/reference/openapi.yaml should exist");
|
||||
assert.match(openapiSrc, /\/api\/settings\/payload-rules:/);
|
||||
assert.match(openapiSrc, /summary:\s+Get payload rules configuration/);
|
||||
assert.match(openapiSrc, /ManagementSessionAuth:/);
|
||||
|
||||
@@ -18,13 +18,14 @@ test("docsNavigation has expected sections", () => {
|
||||
assert.deepEqual(
|
||||
docsNavigation.map((section) => section.title),
|
||||
[
|
||||
"Getting Started",
|
||||
"Features",
|
||||
"API & Protocols",
|
||||
"Deployment",
|
||||
"Operations",
|
||||
"Development",
|
||||
"Other",
|
||||
"Architecture",
|
||||
"Guides",
|
||||
"Reference",
|
||||
"Frameworks",
|
||||
"Routing",
|
||||
"Security",
|
||||
"Compression",
|
||||
"Ops",
|
||||
]
|
||||
);
|
||||
});
|
||||
@@ -55,7 +56,7 @@ test("getDocItemBySlug returns section title and item for known slug", () => {
|
||||
const result = getDocItemBySlug("setup-guide");
|
||||
assert.ok(result, "setup-guide should be found");
|
||||
assert.equal(result.item.slug, "setup-guide");
|
||||
assert.equal(result.sectionTitle, "Getting Started");
|
||||
assert.equal(result.sectionTitle, "Guides");
|
||||
});
|
||||
|
||||
test("getDocItemBySlug returns null for unknown slug", () => {
|
||||
|
||||
Reference in New Issue
Block a user