vocs 2.0.17 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/globals.d.ts +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/config.d.ts +28 -0
- package/dist/internal/config.d.ts.map +1 -1
- package/dist/internal/config.js +10 -2
- package/dist/internal/config.js.map +1 -1
- package/dist/internal/llms.d.ts +21 -2
- package/dist/internal/llms.d.ts.map +1 -1
- package/dist/internal/llms.js +41 -1
- package/dist/internal/llms.js.map +1 -1
- package/dist/internal/markdown-negotiation.d.ts +36 -0
- package/dist/internal/markdown-negotiation.d.ts.map +1 -0
- package/dist/internal/markdown-negotiation.js +81 -0
- package/dist/internal/markdown-negotiation.js.map +1 -0
- package/dist/internal/markdown.d.ts.map +1 -1
- package/dist/internal/markdown.js +5 -0
- package/dist/internal/markdown.js.map +1 -1
- package/dist/internal/openapi/anchors.d.ts +25 -0
- package/dist/internal/openapi/anchors.d.ts.map +1 -0
- package/dist/internal/openapi/anchors.js +37 -0
- package/dist/internal/openapi/anchors.js.map +1 -0
- package/dist/internal/openapi/app.d.ts +89 -0
- package/dist/internal/openapi/app.d.ts.map +1 -0
- package/dist/internal/openapi/app.js +62 -0
- package/dist/internal/openapi/app.js.map +1 -0
- package/dist/internal/openapi/index.d.ts +8 -0
- package/dist/internal/openapi/index.d.ts.map +1 -0
- package/dist/internal/openapi/index.js +5 -0
- package/dist/internal/openapi/index.js.map +1 -0
- package/dist/internal/openapi/markdown.d.ts +42 -0
- package/dist/internal/openapi/markdown.d.ts.map +1 -0
- package/dist/internal/openapi/markdown.js +235 -0
- package/dist/internal/openapi/markdown.js.map +1 -0
- package/dist/internal/openapi/openapi.d.ts +187 -0
- package/dist/internal/openapi/openapi.d.ts.map +1 -0
- package/dist/internal/openapi/openapi.js +44 -0
- package/dist/internal/openapi/openapi.js.map +1 -0
- package/dist/internal/openapi/openrpc.d.ts +90 -0
- package/dist/internal/openapi/openrpc.d.ts.map +1 -0
- package/dist/internal/openapi/openrpc.js +213 -0
- package/dist/internal/openapi/openrpc.js.map +1 -0
- package/dist/internal/openapi/parser.d.ts +181 -0
- package/dist/internal/openapi/parser.d.ts.map +1 -0
- package/dist/internal/openapi/parser.js +329 -0
- package/dist/internal/openapi/parser.js.map +1 -0
- package/dist/internal/openapi/registry.d.ts +36 -0
- package/dist/internal/openapi/registry.d.ts.map +1 -0
- package/dist/internal/openapi/registry.js +79 -0
- package/dist/internal/openapi/registry.js.map +1 -0
- package/dist/internal/openapi/sample.d.ts +115 -0
- package/dist/internal/openapi/sample.d.ts.map +1 -0
- package/dist/internal/openapi/sample.js +434 -0
- package/dist/internal/openapi/sample.js.map +1 -0
- package/dist/internal/openapi/search.d.ts +19 -0
- package/dist/internal/openapi/search.d.ts.map +1 -0
- package/dist/internal/openapi/search.js +98 -0
- package/dist/internal/openapi/search.js.map +1 -0
- package/dist/internal/openapi/sidebar.d.ts +30 -0
- package/dist/internal/openapi/sidebar.d.ts.map +1 -0
- package/dist/internal/openapi/sidebar.js +67 -0
- package/dist/internal/openapi/sidebar.js.map +1 -0
- package/dist/internal/openapi/union.d.ts +36 -0
- package/dist/internal/openapi/union.d.ts.map +1 -0
- package/dist/internal/openapi/union.js +69 -0
- package/dist/internal/openapi/union.js.map +1 -0
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +20 -0
- package/dist/internal/search.js.map +1 -1
- package/dist/internal/vite-plugins.d.ts +12 -0
- package/dist/internal/vite-plugins.d.ts.map +1 -1
- package/dist/internal/vite-plugins.js +102 -11
- package/dist/internal/vite-plugins.js.map +1 -1
- package/dist/react/Badge.d.ts +2 -3
- package/dist/react/Badge.d.ts.map +1 -1
- package/dist/react/Layout.client.d.ts.map +1 -1
- package/dist/react/Layout.client.js +2 -2
- package/dist/react/Layout.client.js.map +1 -1
- package/dist/react/OpenApi.d.ts +6 -0
- package/dist/react/OpenApi.d.ts.map +1 -0
- package/dist/react/OpenApi.js +6 -0
- package/dist/react/OpenApi.js.map +1 -0
- package/dist/react/internal/CodeToHtml.client.d.ts +53 -2
- package/dist/react/internal/CodeToHtml.client.d.ts.map +1 -1
- package/dist/react/internal/CodeToHtml.client.js +154 -21
- package/dist/react/internal/CodeToHtml.client.js.map +1 -1
- package/dist/react/internal/Sidebar.d.ts.map +1 -1
- package/dist/react/internal/Sidebar.js +99 -2
- package/dist/react/internal/Sidebar.js.map +1 -1
- package/dist/react/internal/openapi/CodeSample.client.d.ts +21 -0
- package/dist/react/internal/openapi/CodeSample.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/CodeSample.client.js +134 -0
- package/dist/react/internal/openapi/CodeSample.client.js.map +1 -0
- package/dist/react/internal/openapi/CollapsibleChildren.client.d.ts +17 -0
- package/dist/react/internal/openapi/CollapsibleChildren.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/CollapsibleChildren.client.js +18 -0
- package/dist/react/internal/openapi/CollapsibleChildren.client.js.map +1 -0
- package/dist/react/internal/openapi/Disclosure.client.d.ts +28 -0
- package/dist/react/internal/openapi/Disclosure.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/Disclosure.client.js +38 -0
- package/dist/react/internal/openapi/Disclosure.client.js.map +1 -0
- package/dist/react/internal/openapi/Endpoints.d.ts +26 -0
- package/dist/react/internal/openapi/Endpoints.d.ts.map +1 -0
- package/dist/react/internal/openapi/Endpoints.js +33 -0
- package/dist/react/internal/openapi/Endpoints.js.map +1 -0
- package/dist/react/internal/openapi/EndpointsView.d.ts +24 -0
- package/dist/react/internal/openapi/EndpointsView.d.ts.map +1 -0
- package/dist/react/internal/openapi/EndpointsView.js +26 -0
- package/dist/react/internal/openapi/EndpointsView.js.map +1 -0
- package/dist/react/internal/openapi/EnumValues.client.d.ts +14 -0
- package/dist/react/internal/openapi/EnumValues.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/EnumValues.client.js +20 -0
- package/dist/react/internal/openapi/EnumValues.client.js.map +1 -0
- package/dist/react/internal/openapi/HeadingAnchor.d.ts +15 -0
- package/dist/react/internal/openapi/HeadingAnchor.d.ts.map +1 -0
- package/dist/react/internal/openapi/HeadingAnchor.js +12 -0
- package/dist/react/internal/openapi/HeadingAnchor.js.map +1 -0
- package/dist/react/internal/openapi/OpenApiPage.d.ts +79 -0
- package/dist/react/internal/openapi/OpenApiPage.d.ts.map +1 -0
- package/dist/react/internal/openapi/OpenApiPage.js +72 -0
- package/dist/react/internal/openapi/OpenApiPage.js.map +1 -0
- package/dist/react/internal/openapi/Operation.d.ts +25 -0
- package/dist/react/internal/openapi/Operation.d.ts.map +1 -0
- package/dist/react/internal/openapi/Operation.js +101 -0
- package/dist/react/internal/openapi/Operation.js.map +1 -0
- package/dist/react/internal/openapi/Playground.client.d.ts +33 -0
- package/dist/react/internal/openapi/Playground.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/Playground.client.js +170 -0
- package/dist/react/internal/openapi/Playground.client.js.map +1 -0
- package/dist/react/internal/openapi/PropertyExample.client.d.ts +17 -0
- package/dist/react/internal/openapi/PropertyExample.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/PropertyExample.client.js +21 -0
- package/dist/react/internal/openapi/PropertyExample.client.js.map +1 -0
- package/dist/react/internal/openapi/Reference.d.ts +55 -0
- package/dist/react/internal/openapi/Reference.d.ts.map +1 -0
- package/dist/react/internal/openapi/Reference.js +42 -0
- package/dist/react/internal/openapi/Reference.js.map +1 -0
- package/dist/react/internal/openapi/Schema.d.ts +110 -0
- package/dist/react/internal/openapi/Schema.d.ts.map +1 -0
- package/dist/react/internal/openapi/Schema.js +239 -0
- package/dist/react/internal/openapi/Schema.js.map +1 -0
- package/dist/react/internal/openapi/SchemaUnion.client.d.ts +25 -0
- package/dist/react/internal/openapi/SchemaUnion.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/SchemaUnion.client.js +48 -0
- package/dist/react/internal/openapi/SchemaUnion.client.js.map +1 -0
- package/dist/react/internal/openapi/anchor-navigation.client.d.ts +47 -0
- package/dist/react/internal/openapi/anchor-navigation.client.d.ts.map +1 -0
- package/dist/react/internal/openapi/anchor-navigation.client.js +120 -0
- package/dist/react/internal/openapi/anchor-navigation.client.js.map +1 -0
- package/dist/react/internal/openapi/auth.d.ts +28 -0
- package/dist/react/internal/openapi/auth.d.ts.map +1 -0
- package/dist/react/internal/openapi/auth.js +75 -0
- package/dist/react/internal/openapi/auth.js.map +1 -0
- package/dist/react/useLayout.d.ts +2 -0
- package/dist/react/useLayout.d.ts.map +1 -1
- package/dist/react/useLayout.js +2 -0
- package/dist/react/useLayout.js.map +1 -1
- package/dist/server/handlers.d.ts +1 -1
- package/dist/server/handlers.d.ts.map +1 -1
- package/dist/server/handlers.js +26 -5
- package/dist/server/handlers.js.map +1 -1
- package/dist/server/og-assets.d.ts +5 -0
- package/dist/server/og-assets.d.ts.map +1 -0
- package/dist/server/og-assets.js +11 -0
- package/dist/server/og-assets.js.map +1 -0
- package/dist/server/openapi/assets.d.ts +33 -0
- package/dist/server/openapi/assets.d.ts.map +1 -0
- package/dist/server/openapi/assets.generated.d.ts +9 -0
- package/dist/server/openapi/assets.generated.d.ts.map +1 -0
- package/dist/server/openapi/assets.generated.js +1091 -0
- package/dist/server/openapi/assets.generated.js.map +1 -0
- package/dist/server/openapi/assets.js +32 -0
- package/dist/server/openapi/assets.js.map +1 -0
- package/dist/server/openapi/handler.d.ts +103 -0
- package/dist/server/openapi/handler.d.ts.map +1 -0
- package/dist/server/openapi/handler.js +198 -0
- package/dist/server/openapi/handler.js.map +1 -0
- package/dist/server/openapi/handler.test.d.ts +2 -0
- package/dist/server/openapi/handler.test.d.ts.map +1 -0
- package/dist/server/openapi/handler.test.js +203 -0
- package/dist/server/openapi/handler.test.js.map +1 -0
- package/dist/server/openapi/html.d.ts +16 -0
- package/dist/server/openapi/html.d.ts.map +1 -0
- package/dist/server/openapi/html.js +75 -0
- package/dist/server/openapi/html.js.map +1 -0
- package/dist/server/openapi/pages.d.ts +33 -0
- package/dist/server/openapi/pages.d.ts.map +1 -0
- package/dist/server/openapi/pages.js +130 -0
- package/dist/server/openapi/pages.js.map +1 -0
- package/dist/server/openapi/pages.test.d.ts +2 -0
- package/dist/server/openapi/pages.test.d.ts.map +1 -0
- package/dist/server/openapi/pages.test.js +94 -0
- package/dist/server/openapi/pages.test.js.map +1 -0
- package/dist/server/openapi/state.d.ts +42 -0
- package/dist/server/openapi/state.d.ts.map +1 -0
- package/dist/server/openapi/state.js +101 -0
- package/dist/server/openapi/state.js.map +1 -0
- package/dist/styles/index.css +16 -0
- package/dist/styles/markdown.css +9 -7
- package/dist/styles/openapi-playground.css +80 -0
- package/dist/styles/openapi.css +660 -0
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +1 -0
- package/dist/vite.js.map +1 -1
- package/dist/waku/internal/middleware/md-router.d.ts +0 -4
- package/dist/waku/internal/middleware/md-router.d.ts.map +1 -1
- package/dist/waku/internal/middleware/md-router.js +3 -48
- package/dist/waku/internal/middleware/md-router.js.map +1 -1
- package/dist/waku/internal/patches/adapters/vercel-build-enhancer.js +1 -1
- package/dist/waku/internal/patches/adapters/vercel-build-enhancer.js.map +1 -1
- package/dist/waku/internal/patches/router.d.ts.map +1 -1
- package/dist/waku/internal/patches/router.js +110 -1
- package/dist/waku/internal/patches/router.js.map +1 -1
- package/package.json +5 -1
- package/src/config.ts +1 -0
- package/src/globals.d.ts +16 -0
- package/src/index.ts +1 -0
- package/src/internal/config.ts +40 -1
- package/src/internal/llms.ts +51 -1
- package/src/internal/markdown-negotiation.test.ts +42 -0
- package/src/internal/markdown-negotiation.ts +95 -0
- package/src/internal/markdown.ts +5 -0
- package/src/internal/openapi/anchors.ts +44 -0
- package/src/internal/openapi/app.ts +127 -0
- package/src/internal/openapi/index.ts +24 -0
- package/src/internal/openapi/markdown.test.ts +115 -0
- package/src/internal/openapi/markdown.ts +275 -0
- package/src/internal/openapi/openapi.ts +212 -0
- package/src/internal/openapi/openrpc.test.ts +239 -0
- package/src/internal/openapi/openrpc.ts +295 -0
- package/src/internal/openapi/parser.test.ts +203 -0
- package/src/internal/openapi/parser.ts +613 -0
- package/src/internal/openapi/registry.test.ts +89 -0
- package/src/internal/openapi/registry.ts +89 -0
- package/src/internal/openapi/sample.test.ts +283 -0
- package/src/internal/openapi/sample.ts +562 -0
- package/src/internal/openapi/search.test.ts +62 -0
- package/src/internal/openapi/search.ts +108 -0
- package/src/internal/openapi/sidebar.test.ts +131 -0
- package/src/internal/openapi/sidebar.ts +94 -0
- package/src/internal/openapi/union.test.ts +51 -0
- package/src/internal/openapi/union.ts +74 -0
- package/src/internal/search.ts +20 -0
- package/src/internal/test/virtual-config.stub.ts +14 -0
- package/src/internal/vite-plugins.ts +106 -11
- package/src/openapi-app/App.tsx +64 -0
- package/src/openapi-app/blocks.tsx +33 -0
- package/src/openapi-app/client.tsx +25 -0
- package/src/openapi-app/links.test.ts +84 -0
- package/src/openapi-app/links.ts +66 -0
- package/src/openapi-app/payload.ts +20 -0
- package/src/openapi-app/virtual/config.ts +7 -0
- package/src/openapi-app/virtual/group-icons.ts +2 -0
- package/src/openapi-app/virtual/langs.ts +6 -0
- package/src/openapi-app/virtual/openapi.ts +10 -0
- package/src/openapi-app/virtual/search-index.ts +21 -0
- package/src/openapi-app/virtual/slots.ts +4 -0
- package/src/openapi-app/virtual/user-styles.ts +2 -0
- package/src/openapi-app/waku.tsx +154 -0
- package/src/react/Badge.tsx +2 -3
- package/src/react/Layout.client.tsx +17 -4
- package/src/react/OpenApi.tsx +5 -0
- package/src/react/internal/CodeToHtml.client.tsx +283 -22
- package/src/react/internal/Sidebar.tsx +126 -22
- package/src/react/internal/openapi/CodeSample.client.tsx +294 -0
- package/src/react/internal/openapi/CollapsibleChildren.client.tsx +41 -0
- package/src/react/internal/openapi/Disclosure.client.tsx +67 -0
- package/src/react/internal/openapi/Endpoints.tsx +58 -0
- package/src/react/internal/openapi/EndpointsView.tsx +76 -0
- package/src/react/internal/openapi/EnumValues.client.tsx +49 -0
- package/src/react/internal/openapi/HeadingAnchor.tsx +28 -0
- package/src/react/internal/openapi/OpenApiPage.tsx +173 -0
- package/src/react/internal/openapi/Operation.test.tsx +101 -0
- package/src/react/internal/openapi/Operation.tsx +335 -0
- package/src/react/internal/openapi/Playground.client.tsx +234 -0
- package/src/react/internal/openapi/PropertyExample.client.tsx +55 -0
- package/src/react/internal/openapi/Reference.tsx +120 -0
- package/src/react/internal/openapi/Schema.tsx +467 -0
- package/src/react/internal/openapi/SchemaUnion.client.tsx +123 -0
- package/src/react/internal/openapi/anchor-navigation.client.ts +154 -0
- package/src/react/internal/openapi/auth.ts +69 -0
- package/src/react/useLayout.ts +4 -0
- package/src/server/handlers.ts +31 -6
- package/src/server/og-assets.ts +14 -0
- package/src/server/openapi/assets.generated.ts +1093 -0
- package/src/server/openapi/assets.ts +57 -0
- package/src/server/openapi/handler.test.ts +244 -0
- package/src/server/openapi/handler.ts +277 -0
- package/src/server/openapi/html.ts +84 -0
- package/src/server/openapi/pages.test.ts +111 -0
- package/src/server/openapi/pages.ts +153 -0
- package/src/server/openapi/state.ts +136 -0
- package/src/styles/index.css +16 -0
- package/src/styles/markdown.css +9 -7
- package/src/styles/openapi-playground.css +80 -0
- package/src/styles/openapi.css +660 -0
- package/src/vite.ts +1 -0
- package/src/waku/internal/middleware/md-router.ts +8 -52
- package/src/waku/internal/patches/adapters/vercel-build-enhancer.ts +1 -1
- package/src/waku/internal/patches/router.ts +126 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the prebuilt OpenAPI app (the `Handler.openApi` server
|
|
3
|
+
* handler and the static browser bundle it serves).
|
|
4
|
+
*
|
|
5
|
+
* This module is intentionally free of Node and DOM dependencies so it can be
|
|
6
|
+
* imported by both the server handler and the client entry.
|
|
7
|
+
*/
|
|
8
|
+
import type { Config } from '../config.js';
|
|
9
|
+
import type { SidebarItem } from '../sidebar.js';
|
|
10
|
+
import type { Ir } from './parser.js';
|
|
11
|
+
/**
|
|
12
|
+
* A block of rendered page content. Guide/override pages are compiled on the
|
|
13
|
+
* server into an ordered list of blocks so embedded `<OpenApi.Endpoints />`
|
|
14
|
+
* components can be re-hydrated as real React on the client (rather than
|
|
15
|
+
* inlined as static HTML).
|
|
16
|
+
*/
|
|
17
|
+
export type PageBlock = {
|
|
18
|
+
type: 'html';
|
|
19
|
+
html: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'endpoints';
|
|
22
|
+
path?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A compiled consumer-authored page, keyed by its section-relative route.
|
|
26
|
+
*
|
|
27
|
+
* - `path === '/'` overrides the landing/intro content.
|
|
28
|
+
* - `path === '/<group>'` overrides a category header.
|
|
29
|
+
* - any other `path` is a standalone guide page.
|
|
30
|
+
*/
|
|
31
|
+
export type CompiledPage = {
|
|
32
|
+
/** Section-relative route (normalized, leading slash, no trailing slash). */
|
|
33
|
+
path: string;
|
|
34
|
+
/** Document title (frontmatter `title` or first `# heading`). */
|
|
35
|
+
title?: string | undefined;
|
|
36
|
+
/** Subtitle Markdown rendered below the title on guide pages. */
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Render `title`/`description` as an on-page header above the content. Set for
|
|
40
|
+
* trait pages (`x-traitTag`), whose title comes from the tag name and subtitle
|
|
41
|
+
* from `x-subtitle` (their Markdown body has no heading). Authored guide pages
|
|
42
|
+
* leave this unset because their MDX owns its own headings.
|
|
43
|
+
*/
|
|
44
|
+
header?: boolean | undefined;
|
|
45
|
+
/** Ordered content blocks. */
|
|
46
|
+
blocks: PageBlock[];
|
|
47
|
+
/**
|
|
48
|
+
* Raw authored Markdown (frontmatter + ESM import/export lines stripped), used
|
|
49
|
+
* to serve the page's `.md` / agent-facing version. Absent for trait pages
|
|
50
|
+
* compiled from a description that is already the body.
|
|
51
|
+
*/
|
|
52
|
+
markdown?: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The JSON payload embedded in the standalone HTML shell and consumed by the
|
|
56
|
+
* browser bundle to render the reference entirely client-side.
|
|
57
|
+
*/
|
|
58
|
+
export type Payload = {
|
|
59
|
+
/** Parsed OpenAPI IR. */
|
|
60
|
+
ir: Ir;
|
|
61
|
+
/** Document title (spec `info.title`). */
|
|
62
|
+
title: string;
|
|
63
|
+
/** Computed sidebar (extras + generated items). */
|
|
64
|
+
sidebar: SidebarItem<true>[];
|
|
65
|
+
/** Compiled override/guide pages. */
|
|
66
|
+
pages: CompiledPage[];
|
|
67
|
+
/**
|
|
68
|
+
* Serialized Vocs config that backs `virtual:vocs/config` in the browser
|
|
69
|
+
* bundle, so the prebuilt app renders the real Vocs layout/chrome. Functions
|
|
70
|
+
* are serialized via {@link file://../config-serializer.ts config-serializer};
|
|
71
|
+
* the client deserializes them on load.
|
|
72
|
+
*/
|
|
73
|
+
config: Config;
|
|
74
|
+
};
|
|
75
|
+
/** Joins a section base path with a section-relative sub-path. */
|
|
76
|
+
export declare function join(base: string, sub: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* The set of known section routes for a payload: the intro (the spec `path`),
|
|
79
|
+
* one per category, and one per compiled page.
|
|
80
|
+
*/
|
|
81
|
+
export declare function knownRoutes(payload: Payload): string[];
|
|
82
|
+
/**
|
|
83
|
+
* Infers the host mount prefix from a request pathname: the longest known
|
|
84
|
+
* section route that is a path-suffix of `pathname` is stripped; whatever
|
|
85
|
+
* precedes it is the mount (e.g. `/docs/pets` with route `/pets` → `/docs`).
|
|
86
|
+
* Falls back to treating the whole pathname as the mount (the intro page).
|
|
87
|
+
*/
|
|
88
|
+
export declare function inferMount(pathname: string, routes: string[]): string;
|
|
89
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|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AAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAItD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAOtD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAoBrE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the prebuilt OpenAPI app (the `Handler.openApi` server
|
|
3
|
+
* handler and the static browser bundle it serves).
|
|
4
|
+
*
|
|
5
|
+
* This module is intentionally free of Node and DOM dependencies so it can be
|
|
6
|
+
* imported by both the server handler and the client entry.
|
|
7
|
+
*/
|
|
8
|
+
import { normalizePath } from './openapi.js';
|
|
9
|
+
/** Joins a section base path with a section-relative sub-path. */
|
|
10
|
+
export function join(base, sub) {
|
|
11
|
+
const b = base === '/' ? '' : base;
|
|
12
|
+
if (!sub || sub === '/')
|
|
13
|
+
return b || '/';
|
|
14
|
+
return `${b}${sub.startsWith('/') ? sub : `/${sub}`}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The set of known section routes for a payload: the intro (the spec `path`),
|
|
18
|
+
* one per category, and one per compiled page.
|
|
19
|
+
*/
|
|
20
|
+
export function knownRoutes(payload) {
|
|
21
|
+
const base = payload.ir.path || '/';
|
|
22
|
+
const routes = new Set();
|
|
23
|
+
routes.add(base === '/' ? '/' : normalizePath(base));
|
|
24
|
+
for (const group of payload.ir.groups)
|
|
25
|
+
routes.add(join(base, `/${group.id}`));
|
|
26
|
+
for (const page of payload.pages)
|
|
27
|
+
routes.add(join(base, page.path));
|
|
28
|
+
return [...routes];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Infers the host mount prefix from a request pathname: the longest known
|
|
32
|
+
* section route that is a path-suffix of `pathname` is stripped; whatever
|
|
33
|
+
* precedes it is the mount (e.g. `/docs/pets` with route `/pets` → `/docs`).
|
|
34
|
+
* Falls back to treating the whole pathname as the mount (the intro page).
|
|
35
|
+
*/
|
|
36
|
+
export function inferMount(pathname, routes) {
|
|
37
|
+
const path = stripTrailingSlash(pathname);
|
|
38
|
+
let mount = '';
|
|
39
|
+
let best = -1;
|
|
40
|
+
for (const route of routes) {
|
|
41
|
+
if (route === '/')
|
|
42
|
+
continue;
|
|
43
|
+
if (path === route || path.endsWith(route)) {
|
|
44
|
+
const prefix = path.slice(0, path.length - route.length);
|
|
45
|
+
if (route.length > best && (prefix === '' || prefix.startsWith('/'))) {
|
|
46
|
+
best = route.length;
|
|
47
|
+
mount = prefix;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// No group/page route matched: we're on the intro/landing page, so the whole
|
|
52
|
+
// pathname is the mount. A root mount (`/`) has no prefix, though — return ''
|
|
53
|
+
// so callers build `/group` rather than `//group` (a protocol-relative URL the
|
|
54
|
+
// browser reads as `http://group/`).
|
|
55
|
+
if (best === -1)
|
|
56
|
+
return path === '/' ? '' : path;
|
|
57
|
+
return mount;
|
|
58
|
+
}
|
|
59
|
+
function stripTrailingSlash(value) {
|
|
60
|
+
return value.length > 1 && value.endsWith('/') ? value.slice(0, -1) : value;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/internal/openapi/app.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAkE5C,kEAAkE;AAClE,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,GAAW;IAC5C,MAAM,CAAC,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IAClC,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG;QAAE,OAA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G,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;YACxD,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBACrE,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;gBACnB,KAAK,GAAG,MAAM,CAAA;YAChB,CAAC;QACH,CAAC;IACH,CAAC;IACD,6EAA6E;IAC7E,8EAA8E;IAC9E,+EAA+E;IAC/E,qCAAqC;IACrC,IAAI,IAAI,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IAChD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7E,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { SchemaPath } from './anchors.js';
|
|
2
|
+
export { mediaIdBase, requestBodyIdBase, responseIdBase, schemaPropertyId, slug, } from './anchors.js';
|
|
3
|
+
export * from './openapi.js';
|
|
4
|
+
export type { Ir, IrBody, IrGroup, IrMediaType, IrOperation, IrParameter, IrResponse, IrSecurityScheme, IrServer, Method, } from './parser.js';
|
|
5
|
+
export { methods, parse } from './parser.js';
|
|
6
|
+
export type { CodeSample, ResponseSample } from './sample.js';
|
|
7
|
+
export { codeSamples, harRequest, responseSamples } from './sample.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/openapi/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,IAAI,GACL,MAAM,cAAc,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,YAAY,EACV,EAAE,EACF,MAAM,EACN,OAAO,EACP,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,MAAM,GACP,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { mediaIdBase, requestBodyIdBase, responseIdBase, schemaPropertyId, slug, } from './anchors.js';
|
|
2
|
+
export * from './openapi.js';
|
|
3
|
+
export { methods, parse } from './parser.js';
|
|
4
|
+
export { codeSamples, harRequest, responseSamples } from './sample.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/openapi/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,IAAI,GACL,MAAM,cAAc,CAAA;AACrB,cAAc,cAAc,CAAA;AAa5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Config } from '../config.js';
|
|
2
|
+
import type { Ir, IrGroup } from './parser.js';
|
|
3
|
+
/**
|
|
4
|
+
* A generated Markdown page for an OpenAPI route, ready to be served verbatim by
|
|
5
|
+
* the `.md` router / written as an `/assets/md` asset.
|
|
6
|
+
*/
|
|
7
|
+
export type Page = {
|
|
8
|
+
path: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
/** Final Markdown, used verbatim (no MDX reprocessing). */
|
|
12
|
+
content: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Builds Markdown pages for every configured OpenAPI section.
|
|
16
|
+
*
|
|
17
|
+
* Produces one page per mount (the section overview, listing every category and
|
|
18
|
+
* its endpoints) plus one page per category (`${mount}/${group.id}`), rendering
|
|
19
|
+
* each operation's parameters, request body, responses, and an example request.
|
|
20
|
+
*
|
|
21
|
+
* These mirror the routes created in the Waku router so `/<mount>.md` and
|
|
22
|
+
* `/<mount>/<group>.md` resolve to a readable, agent-friendly version of the
|
|
23
|
+
* same reference shown in the browser.
|
|
24
|
+
*/
|
|
25
|
+
export declare function toPages(config: Config): Promise<Page[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Builds the Markdown pages for a single parsed spec: the section overview plus
|
|
28
|
+
* one page per category. Pure (no registry/network), so it's the unit-testable
|
|
29
|
+
* seam under {@link toPages}.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fromIr(ir: Ir): Page[];
|
|
32
|
+
/**
|
|
33
|
+
* Markdown for the section overview: API metadata + every category's endpoints.
|
|
34
|
+
*
|
|
35
|
+
* `linkBase` is prepended to operation anchors so the endpoint links resolve to
|
|
36
|
+
* wherever the section is mounted (the site uses the configured spec path; the
|
|
37
|
+
* standalone handler passes the live host mount).
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderOverview(ir: Ir, linkBase: string): string;
|
|
40
|
+
/** Markdown for a single category: full detail for each of its operations. */
|
|
41
|
+
export declare function renderGroup(ir: Ir, group: IrGroup): string;
|
|
42
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/internal/openapi/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,EAAE,EAAE,OAAO,EAAwC,MAAM,aAAa,CAAA;AAKpF;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAK7D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,CAErC;AAYD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA4B/D;AAYD,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAQ1D"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as Registry from './registry.js';
|
|
2
|
+
import { codeSamples } from './sample.js';
|
|
3
|
+
import { unwrapSingleVariant } from './union.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds Markdown pages for every configured OpenAPI section.
|
|
6
|
+
*
|
|
7
|
+
* Produces one page per mount (the section overview, listing every category and
|
|
8
|
+
* its endpoints) plus one page per category (`${mount}/${group.id}`), rendering
|
|
9
|
+
* each operation's parameters, request body, responses, and an example request.
|
|
10
|
+
*
|
|
11
|
+
* These mirror the routes created in the Waku router so `/<mount>.md` and
|
|
12
|
+
* `/<mount>/<group>.md` resolve to a readable, agent-friendly version of the
|
|
13
|
+
* same reference shown in the browser.
|
|
14
|
+
*/
|
|
15
|
+
export async function toPages(config) {
|
|
16
|
+
if (!config.openapi?.length)
|
|
17
|
+
return [];
|
|
18
|
+
const specs = await Registry.build(config);
|
|
19
|
+
return Object.values(specs).flatMap(fromIr);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Builds the Markdown pages for a single parsed spec: the section overview plus
|
|
23
|
+
* one page per category. Pure (no registry/network), so it's the unit-testable
|
|
24
|
+
* seam under {@link toPages}.
|
|
25
|
+
*/
|
|
26
|
+
export function fromIr(ir) {
|
|
27
|
+
return [overviewPage(ir), ...ir.groups.map((group) => groupPage(ir, group))];
|
|
28
|
+
}
|
|
29
|
+
/** Section overview page: API metadata + every category's endpoints. */
|
|
30
|
+
function overviewPage(ir) {
|
|
31
|
+
return {
|
|
32
|
+
path: ir.path,
|
|
33
|
+
title: ir.info.title,
|
|
34
|
+
description: ir.info.description ? oneLine(ir.info.description) : undefined,
|
|
35
|
+
content: renderOverview(ir, normalizeMount(ir.path)),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Markdown for the section overview: API metadata + every category's endpoints.
|
|
40
|
+
*
|
|
41
|
+
* `linkBase` is prepended to operation anchors so the endpoint links resolve to
|
|
42
|
+
* wherever the section is mounted (the site uses the configured spec path; the
|
|
43
|
+
* standalone handler passes the live host mount).
|
|
44
|
+
*/
|
|
45
|
+
export function renderOverview(ir, linkBase) {
|
|
46
|
+
const base = normalizeMount(linkBase);
|
|
47
|
+
const lines = [`# ${ir.info.title}`, ''];
|
|
48
|
+
if (ir.info.version)
|
|
49
|
+
lines.push(`Version: \`${ir.info.version}\``, '');
|
|
50
|
+
if (ir.info.description)
|
|
51
|
+
lines.push(ir.info.description.trim(), '');
|
|
52
|
+
if (ir.servers.length > 0) {
|
|
53
|
+
lines.push('## Servers', '');
|
|
54
|
+
for (const server of ir.servers)
|
|
55
|
+
lines.push(`- \`${server.url}\`${server.description ? `: ${oneLine(server.description)}` : ''}`);
|
|
56
|
+
lines.push('');
|
|
57
|
+
}
|
|
58
|
+
lines.push('## Endpoints', '');
|
|
59
|
+
for (const group of ir.groups) {
|
|
60
|
+
lines.push(`### ${group.name}`, '');
|
|
61
|
+
if (group.description)
|
|
62
|
+
lines.push(oneLine(group.description), '');
|
|
63
|
+
for (const operation of group.operations) {
|
|
64
|
+
const href = `${base}/${group.id}#${operation.id}`;
|
|
65
|
+
const label = operation.summary ? `: ${oneLine(operation.summary)}` : '';
|
|
66
|
+
lines.push(`- [\`${operation.method} ${operation.path}\`](${href})${label}`);
|
|
67
|
+
}
|
|
68
|
+
lines.push('');
|
|
69
|
+
}
|
|
70
|
+
return `${lines.join('\n').trimEnd()}\n`;
|
|
71
|
+
}
|
|
72
|
+
/** Category page: full detail for each operation in the group. */
|
|
73
|
+
function groupPage(ir, group) {
|
|
74
|
+
return {
|
|
75
|
+
path: `${normalizeMount(ir.path)}/${group.id}`,
|
|
76
|
+
title: group.name,
|
|
77
|
+
description: group.description ? oneLine(group.description) : undefined,
|
|
78
|
+
content: renderGroup(ir, group),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** Markdown for a single category: full detail for each of its operations. */
|
|
82
|
+
export function renderGroup(ir, group) {
|
|
83
|
+
const lines = [`# ${group.name}`, ''];
|
|
84
|
+
if (group.description)
|
|
85
|
+
lines.push(group.description.trim(), '');
|
|
86
|
+
const server = ir.servers[0]?.url;
|
|
87
|
+
for (const operation of group.operations)
|
|
88
|
+
lines.push(...operationLines(operation, server));
|
|
89
|
+
return `${lines.join('\n').trimEnd()}\n`;
|
|
90
|
+
}
|
|
91
|
+
function operationLines(operation, server) {
|
|
92
|
+
const lines = [];
|
|
93
|
+
const title = operation.summary ?? `${operation.method} ${operation.path}`;
|
|
94
|
+
lines.push(`## ${title}`, '');
|
|
95
|
+
lines.push(`\`${operation.method} ${operation.path}\``, '');
|
|
96
|
+
if (operation.deprecated)
|
|
97
|
+
lines.push('> **Deprecated**', '');
|
|
98
|
+
if (operation.description)
|
|
99
|
+
lines.push(operation.description.trim(), '');
|
|
100
|
+
const byLocation = (location) => operation.parameters.filter((parameter) => parameter.in === location && !parameter.deprecated);
|
|
101
|
+
for (const [location, heading] of [
|
|
102
|
+
['path', 'Path parameters'],
|
|
103
|
+
['query', 'Query parameters'],
|
|
104
|
+
['header', 'Header parameters'],
|
|
105
|
+
['rpc', 'Parameters'],
|
|
106
|
+
]) {
|
|
107
|
+
const params = byLocation(location);
|
|
108
|
+
if (params.length === 0)
|
|
109
|
+
continue;
|
|
110
|
+
lines.push(`### ${heading}`, '');
|
|
111
|
+
for (const parameter of params)
|
|
112
|
+
lines.push(...parameterLines(parameter));
|
|
113
|
+
lines.push('');
|
|
114
|
+
}
|
|
115
|
+
if (operation.requestBody && !operation.requestBody.hidden) {
|
|
116
|
+
const body = operation.requestBody;
|
|
117
|
+
const media = body.content[0];
|
|
118
|
+
const mediaType = media ? ` (\`${media.mediaType}\`)` : '';
|
|
119
|
+
lines.push(`### Request body${body.required ? ' (required)' : ''}${mediaType}`, '');
|
|
120
|
+
if (body.description)
|
|
121
|
+
lines.push(oneLine(body.description), '');
|
|
122
|
+
if (media?.schema) {
|
|
123
|
+
const props = schemaLines(media.schema, 0);
|
|
124
|
+
if (props.length > 0)
|
|
125
|
+
lines.push(...props, '');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (operation.responses.length > 0) {
|
|
129
|
+
lines.push('### Responses', '');
|
|
130
|
+
for (const response of operation.responses)
|
|
131
|
+
lines.push(...responseLines(response));
|
|
132
|
+
}
|
|
133
|
+
const samples = codeSamples(operation, server);
|
|
134
|
+
if (samples.length > 0) {
|
|
135
|
+
lines.push('### Example request', '');
|
|
136
|
+
for (const sample of samples) {
|
|
137
|
+
lines.push(`\`\`\`${sample.lang}`, sample.code.trim(), '```', '');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return lines;
|
|
141
|
+
}
|
|
142
|
+
function parameterLines(parameter) {
|
|
143
|
+
// Unwrap a nullable single-variant union so an object param's member type and
|
|
144
|
+
// nested properties surface (e.g. an RPC `Transaction` object's fields).
|
|
145
|
+
const schema = parameter.schema
|
|
146
|
+
? (unwrapSingleVariant(parameter.schema) ?? parameter.schema)
|
|
147
|
+
: parameter.schema;
|
|
148
|
+
const required = parameter.required ? ' _(required)_' : '';
|
|
149
|
+
const type = `\`${typeLabel(schema)}\``;
|
|
150
|
+
const description = parameter.description ? `: ${oneLine(parameter.description)}` : '';
|
|
151
|
+
return [`- \`${parameter.name}\` ${type}${required}${description}`, ...schemaLines(schema, 1)];
|
|
152
|
+
}
|
|
153
|
+
function responseLines(response) {
|
|
154
|
+
const lines = [];
|
|
155
|
+
const description = response.description ? `: ${oneLine(response.description)}` : '';
|
|
156
|
+
lines.push(`#### \`${response.status}\`${description}`, '');
|
|
157
|
+
if (response.headers.length > 0) {
|
|
158
|
+
lines.push('Headers:', '');
|
|
159
|
+
for (const header of response.headers)
|
|
160
|
+
lines.push(`- \`${header.name}\` \`${typeLabel(header.schema)}\`${header.description ? `: ${oneLine(header.description)}` : ''}`);
|
|
161
|
+
lines.push('');
|
|
162
|
+
}
|
|
163
|
+
const media = response.content[0];
|
|
164
|
+
if (media?.schema) {
|
|
165
|
+
const props = schemaLines(media.schema, 0);
|
|
166
|
+
if (props.length > 0) {
|
|
167
|
+
if (media.mediaType)
|
|
168
|
+
lines.push(`Body (\`${media.mediaType}\`):`, '');
|
|
169
|
+
lines.push(...props, '');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return lines;
|
|
173
|
+
}
|
|
174
|
+
const maxDepth = 4;
|
|
175
|
+
/**
|
|
176
|
+
* Renders an object schema's properties as an indented Markdown bullet list,
|
|
177
|
+
* recursing into nested objects (and array-of-object items) up to {@link
|
|
178
|
+
* maxDepth}. Returns an empty array for non-object schemas.
|
|
179
|
+
*/
|
|
180
|
+
function schemaLines(rawSchema, depth) {
|
|
181
|
+
if (!rawSchema || depth > maxDepth)
|
|
182
|
+
return [];
|
|
183
|
+
// Unwrap a nullable single-variant union (e.g. `oneOf: [null, X]`) so the
|
|
184
|
+
// member's properties are listed instead of nothing.
|
|
185
|
+
const schema = unwrapSingleVariant(rawSchema) ?? rawSchema;
|
|
186
|
+
const target = schema['type'] === 'array' ? schema['items'] : schema;
|
|
187
|
+
const properties = target?.['properties'];
|
|
188
|
+
if (!properties)
|
|
189
|
+
return [];
|
|
190
|
+
const required = new Set(target?.['required'] ?? []);
|
|
191
|
+
const indent = ' '.repeat(depth);
|
|
192
|
+
const lines = [];
|
|
193
|
+
for (const [name, rawProperty] of Object.entries(properties)) {
|
|
194
|
+
const property = unwrapSingleVariant(rawProperty) ?? rawProperty;
|
|
195
|
+
const requiredFlag = required.has(name) ? ' _(required)_' : '';
|
|
196
|
+
const description = property['description']
|
|
197
|
+
? `: ${oneLine(String(property['description']))}`
|
|
198
|
+
: '';
|
|
199
|
+
lines.push(`${indent}- \`${name}\` \`${typeLabel(property)}\`${requiredFlag}${description}`);
|
|
200
|
+
lines.push(...schemaLines(property, depth + 1));
|
|
201
|
+
}
|
|
202
|
+
return lines;
|
|
203
|
+
}
|
|
204
|
+
/** Compact, human-readable type label for a JSON Schema (post-dereference). */
|
|
205
|
+
function typeLabel(schema) {
|
|
206
|
+
if (!schema)
|
|
207
|
+
return 'unknown';
|
|
208
|
+
if (Array.isArray(schema['type']))
|
|
209
|
+
return schema['type'].join(' | ');
|
|
210
|
+
const composite = (schema['oneOf'] ?? schema['anyOf']);
|
|
211
|
+
if (composite)
|
|
212
|
+
return [...new Set(composite.map(typeLabel))].join(' | ');
|
|
213
|
+
if (Array.isArray(schema['allOf']))
|
|
214
|
+
return schema['allOf'].map(typeLabel).join(' & ');
|
|
215
|
+
if (schema['type'] === 'array')
|
|
216
|
+
return `${typeLabel(schema['items'])}[]`;
|
|
217
|
+
if (typeof schema['type'] === 'string') {
|
|
218
|
+
const format = schema['format'] ? ` <${schema['format']}>` : '';
|
|
219
|
+
return `${schema['type']}${format}`;
|
|
220
|
+
}
|
|
221
|
+
if (Array.isArray(schema['enum']))
|
|
222
|
+
return 'enum';
|
|
223
|
+
if (schema['properties'])
|
|
224
|
+
return 'object';
|
|
225
|
+
return 'unknown';
|
|
226
|
+
}
|
|
227
|
+
/** Collapse Markdown/whitespace to a single readable line (for summaries). */
|
|
228
|
+
function oneLine(value) {
|
|
229
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
230
|
+
}
|
|
231
|
+
/** Mount path without a trailing slash (e.g. `/` -> ``, `/api/` -> `/api`). */
|
|
232
|
+
function normalizeMount(path) {
|
|
233
|
+
return path === '/' ? '' : path.replace(/\/$/, '');
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/internal/openapi/markdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAchD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,MAAc;IAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,EAAE,CAAA;IAEtC,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,EAAM;IAC3B,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,C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