@farming-labs/next 0.2.104 → 0.2.105
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/api-reference.d.mts +41 -0
- package/dist/api-reference.mjs +755 -0
- package/dist/api.d.mts +30 -0
- package/dist/api.mjs +154 -0
- package/dist/changelog-rail-search.d.mts +46 -0
- package/dist/changelog-rail-search.mjs +443 -0
- package/dist/changelog.d.mts +36 -0
- package/dist/changelog.mjs +417 -0
- package/dist/client-callbacks.d.mts +9 -0
- package/dist/client-callbacks.mjs +62 -0
- package/dist/code-block-themes-CCE5ViGj.mjs +25 -0
- package/dist/config.d.mts +7 -0
- package/dist/config.mjs +2139 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +6 -0
- package/dist/layout.d.mts +12 -0
- package/dist/layout.mjs +94 -0
- package/dist/mdx-plugins/rehype-code.d.mts +2 -0
- package/dist/mdx-plugins/rehype-code.mjs +3 -0
- package/dist/mdx-plugins/rehype-toc.d.mts +2 -0
- package/dist/mdx-plugins/rehype-toc.mjs +3 -0
- package/dist/mdx-plugins/remark-code-group.d.mts +2 -0
- package/dist/mdx-plugins/remark-code-group.mjs +3 -0
- package/dist/mdx-plugins/remark-heading.d.mts +6 -0
- package/dist/mdx-plugins/remark-heading.mjs +28 -0
- package/dist/mdx-plugins/remark-markdown-alternate.d.mts +21 -0
- package/dist/mdx-plugins/remark-markdown-alternate.mjs +78 -0
- package/dist/mdx-plugins/remark-og.d.mts +22 -0
- package/dist/mdx-plugins/remark-og.mjs +30 -0
- package/package.json +3 -3
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
import DocsClientCallbacks from "./client-callbacks.mjs";
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
|
+
import { join, relative } from "node:path";
|
|
4
|
+
import { buildApiReferenceOpenApiDocumentAsync, buildApiReferencePageTitle, buildApiReferenceScalarCss, resolveApiReferenceConfig, resolveApiReferenceRenderer } from "@farming-labs/docs/server";
|
|
5
|
+
import { ApiReference } from "@scalar/nextjs-api-reference";
|
|
6
|
+
import { SidebarTabsDropdown } from "fumadocs-ui/components/sidebar/tabs/dropdown";
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { notFound } from "next/navigation";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/api-reference.tsx
|
|
12
|
+
const ROUTE_FILE_RE = /^route\.(ts|tsx|js|jsx)$/;
|
|
13
|
+
const METHOD_RE = /export\s+(?:async\s+function|function|const)\s+(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\b/g;
|
|
14
|
+
function getNextAppDir(root) {
|
|
15
|
+
if (existsSync(join(root, "src", "app"))) return "src/app";
|
|
16
|
+
return "app";
|
|
17
|
+
}
|
|
18
|
+
function normalizeRouteRoot(value) {
|
|
19
|
+
return value.replace(/^\/+|\/+$/g, "") || "api";
|
|
20
|
+
}
|
|
21
|
+
function normalizeExcludeMatcher(value) {
|
|
22
|
+
return value.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "").replace(/\.(ts|tsx|js|jsx)$/i, "").replace(/\/route$/i, "");
|
|
23
|
+
}
|
|
24
|
+
function getRoutePathBase(config) {
|
|
25
|
+
const routeRoot = normalizeRouteRoot(config.routeRoot);
|
|
26
|
+
if (routeRoot === "app" || routeRoot === "src/app") return "";
|
|
27
|
+
if (routeRoot.startsWith("app/")) return `/${routeRoot.slice(4)}`;
|
|
28
|
+
if (routeRoot.startsWith("src/app/")) return `/${routeRoot.slice(8)}`;
|
|
29
|
+
return `/${routeRoot}`;
|
|
30
|
+
}
|
|
31
|
+
function resolveNextApiRouteRoot(root, config) {
|
|
32
|
+
const routeRoot = normalizeRouteRoot(config.routeRoot);
|
|
33
|
+
if (routeRoot === "app" || routeRoot.startsWith("app/") || routeRoot === "src/app" || routeRoot.startsWith("src/app/")) return join(root, ...routeRoot.split("/"));
|
|
34
|
+
return join(root, getNextAppDir(root), ...routeRoot.split("/"));
|
|
35
|
+
}
|
|
36
|
+
function shouldExcludeRoute(excludes, routePath, relativeFile, relativeDir) {
|
|
37
|
+
if (excludes.length === 0) return false;
|
|
38
|
+
const normalizedRoutePath = normalizeExcludeMatcher(routePath);
|
|
39
|
+
const candidates = new Set([
|
|
40
|
+
normalizedRoutePath,
|
|
41
|
+
normalizeExcludeMatcher(routePath.replace(/^\/+/, "")),
|
|
42
|
+
normalizeExcludeMatcher(relativeFile),
|
|
43
|
+
normalizeExcludeMatcher(relativeDir)
|
|
44
|
+
]);
|
|
45
|
+
return excludes.some((entry) => candidates.has(entry));
|
|
46
|
+
}
|
|
47
|
+
function humanizeSegment(value) {
|
|
48
|
+
return value.replace(/^\[\[?\.{3}/, "").replace(/^\[/, "").replace(/\]\]?$/, "").replace(/^\$/, "").replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
|
|
49
|
+
}
|
|
50
|
+
function slugifyApiReferencePageName(value) {
|
|
51
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
|
|
52
|
+
}
|
|
53
|
+
function endpointSegmentFromFsSegment(value) {
|
|
54
|
+
if (value.startsWith("[[...") && value.endsWith("]]")) return `{${value.slice(5, -2)}}`;
|
|
55
|
+
if (value.startsWith("[...") && value.endsWith("]")) return `{${value.slice(4, -1)}}`;
|
|
56
|
+
if (value.startsWith("[") && value.endsWith("]")) return `{${value.slice(1, -1)}}`;
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
function getPathParamName(value) {
|
|
60
|
+
if (value.startsWith("[[...") && value.endsWith("]]")) return value.slice(5, -2);
|
|
61
|
+
if (value.startsWith("[...") && value.endsWith("]")) return value.slice(4, -1);
|
|
62
|
+
if (value.startsWith("[") && value.endsWith("]")) return value.slice(1, -1);
|
|
63
|
+
}
|
|
64
|
+
function extractDocBlock(source) {
|
|
65
|
+
const match = source.match(/\/\*\*([\s\S]*?)\*\//);
|
|
66
|
+
if (!match) return {};
|
|
67
|
+
const lines = match[1].split("\n").map((line) => line.replace(/^\s*\*\s?/, "").trim()).filter(Boolean).filter((line) => !line.startsWith("@"));
|
|
68
|
+
if (lines.length === 0) return {};
|
|
69
|
+
return {
|
|
70
|
+
summary: lines[0],
|
|
71
|
+
description: lines.slice(1).join(" ")
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function extractMethods(source) {
|
|
75
|
+
const methods = /* @__PURE__ */ new Set();
|
|
76
|
+
for (const match of source.matchAll(METHOD_RE)) methods.add(match[1]);
|
|
77
|
+
return Array.from(methods);
|
|
78
|
+
}
|
|
79
|
+
function scanRouteFiles(dir) {
|
|
80
|
+
if (!existsSync(dir)) return [];
|
|
81
|
+
const results = [];
|
|
82
|
+
for (const name of readdirSync(dir)) {
|
|
83
|
+
const full = join(dir, name);
|
|
84
|
+
if (statSync(full).isDirectory()) {
|
|
85
|
+
results.push(...scanRouteFiles(full));
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (ROUTE_FILE_RE.test(name)) results.push(full);
|
|
89
|
+
}
|
|
90
|
+
return results;
|
|
91
|
+
}
|
|
92
|
+
function getDocsUrl(config) {
|
|
93
|
+
if (typeof config.nav?.url === "string") return config.nav.url;
|
|
94
|
+
return `/${config.entry ?? "docs"}`;
|
|
95
|
+
}
|
|
96
|
+
function getForcedMode(config) {
|
|
97
|
+
const toggle = config.themeToggle;
|
|
98
|
+
if (!toggle || typeof toggle !== "object") return void 0;
|
|
99
|
+
if (toggle.default === "dark") return "dark";
|
|
100
|
+
if (toggle.default === "light") return "light";
|
|
101
|
+
}
|
|
102
|
+
function isThemeToggleHidden(config) {
|
|
103
|
+
if (config.themeToggle === false) return true;
|
|
104
|
+
if (config.themeToggle && typeof config.themeToggle === "object") return config.themeToggle.enabled === false;
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
function getOriginFromRequest(request) {
|
|
108
|
+
if (!request) return void 0;
|
|
109
|
+
try {
|
|
110
|
+
return new URL(request.url).origin;
|
|
111
|
+
} catch {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function getForwardedHeaderValue(value) {
|
|
116
|
+
if (!value) return void 0;
|
|
117
|
+
return value.split(",").map((entry) => entry.trim()).find(Boolean) || void 0;
|
|
118
|
+
}
|
|
119
|
+
function getOriginFromHeaderUrl(value) {
|
|
120
|
+
if (!value) return void 0;
|
|
121
|
+
try {
|
|
122
|
+
return new URL(value).origin;
|
|
123
|
+
} catch {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async function getOriginFromNextHeaders() {
|
|
128
|
+
const { headers } = await import("next/headers");
|
|
129
|
+
const headerList = await headers();
|
|
130
|
+
const hintedOrigin = getOriginFromHeaderUrl(headerList.get("origin")) ?? getOriginFromHeaderUrl(headerList.get("referer"));
|
|
131
|
+
if (hintedOrigin) return hintedOrigin;
|
|
132
|
+
const host = getForwardedHeaderValue(headerList.get("x-forwarded-host")) ?? getForwardedHeaderValue(headerList.get("host"));
|
|
133
|
+
if (!host || host === "loading") return process.env.FARMING_LABS_DOCS_DEV_ORIGIN;
|
|
134
|
+
return `${getForwardedHeaderValue(headerList.get("x-forwarded-proto")) ?? "https"}://${host}`;
|
|
135
|
+
}
|
|
136
|
+
function buildPathParameters(fsSegments) {
|
|
137
|
+
const parameters = [];
|
|
138
|
+
for (const segment of fsSegments) {
|
|
139
|
+
const name = getPathParamName(segment);
|
|
140
|
+
if (!name) continue;
|
|
141
|
+
const optional = segment.startsWith("[[...");
|
|
142
|
+
parameters.push({
|
|
143
|
+
name,
|
|
144
|
+
in: "path",
|
|
145
|
+
required: !optional,
|
|
146
|
+
description: optional ? `${humanizeSegment(name)} catch-all parameter.` : `${humanizeSegment(name)} path parameter.`,
|
|
147
|
+
schema: { type: "string" }
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return parameters;
|
|
151
|
+
}
|
|
152
|
+
function buildApiReferenceRoutes(config) {
|
|
153
|
+
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
154
|
+
if (!apiReference.enabled) return [];
|
|
155
|
+
const root = process.cwd();
|
|
156
|
+
const apiDir = resolveNextApiRouteRoot(root, apiReference);
|
|
157
|
+
const routePathBase = getRoutePathBase(apiReference);
|
|
158
|
+
const files = scanRouteFiles(apiDir);
|
|
159
|
+
const excludes = apiReference.exclude;
|
|
160
|
+
const routes = [];
|
|
161
|
+
for (const file of files) {
|
|
162
|
+
const source = readFileSync(file, "utf-8");
|
|
163
|
+
const methods = extractMethods(source);
|
|
164
|
+
if (methods.length === 0) continue;
|
|
165
|
+
const relativeFile = relative(apiDir, file).replace(/\\/g, "/");
|
|
166
|
+
const fsSegments = relativeFile.split("/").slice(0, -1).filter(Boolean);
|
|
167
|
+
const relativeDir = fsSegments.join("/");
|
|
168
|
+
const routeSegments = fsSegments.map(endpointSegmentFromFsSegment);
|
|
169
|
+
const routePath = `${routePathBase}${routeSegments.length > 0 ? `/${routeSegments.join("/")}` : ""}` || "/";
|
|
170
|
+
if (shouldExcludeRoute(excludes, routePath, relativeFile, relativeDir)) continue;
|
|
171
|
+
const docBlock = extractDocBlock(source);
|
|
172
|
+
const title = fsSegments.length > 0 ? humanizeSegment(fsSegments[fsSegments.length - 1]) : "Overview";
|
|
173
|
+
routes.push({
|
|
174
|
+
title,
|
|
175
|
+
summary: docBlock.summary ?? `${title} endpoint`,
|
|
176
|
+
description: docBlock.description,
|
|
177
|
+
routePath,
|
|
178
|
+
sourceFile: relative(root, file).replace(/\\/g, "/"),
|
|
179
|
+
methods,
|
|
180
|
+
segments: fsSegments,
|
|
181
|
+
tag: fsSegments.length > 0 ? humanizeSegment(fsSegments[0]) : "General",
|
|
182
|
+
parameters: buildPathParameters(fsSegments)
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return routes.sort((a, b) => a.routePath.localeCompare(b.routePath));
|
|
186
|
+
}
|
|
187
|
+
function createOperationId(route, method) {
|
|
188
|
+
return `${method.toLowerCase()}_${route.routePath.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "")}`;
|
|
189
|
+
}
|
|
190
|
+
function buildRequestBody(method) {
|
|
191
|
+
if (![
|
|
192
|
+
"POST",
|
|
193
|
+
"PUT",
|
|
194
|
+
"PATCH"
|
|
195
|
+
].includes(method)) return void 0;
|
|
196
|
+
return {
|
|
197
|
+
required: method === "POST",
|
|
198
|
+
content: { "application/json": {
|
|
199
|
+
schema: {
|
|
200
|
+
type: "object",
|
|
201
|
+
additionalProperties: true
|
|
202
|
+
},
|
|
203
|
+
example: { example: true }
|
|
204
|
+
} }
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function buildResponses(method) {
|
|
208
|
+
return { "200": {
|
|
209
|
+
description: method === "DELETE" ? "Resource removed successfully." : "Request completed successfully.",
|
|
210
|
+
content: { "application/json": {
|
|
211
|
+
schema: {
|
|
212
|
+
type: "object",
|
|
213
|
+
additionalProperties: true
|
|
214
|
+
},
|
|
215
|
+
example: { ok: true }
|
|
216
|
+
} }
|
|
217
|
+
} };
|
|
218
|
+
}
|
|
219
|
+
function buildOpenApiPaths(routes) {
|
|
220
|
+
const paths = {};
|
|
221
|
+
for (const route of routes) {
|
|
222
|
+
const pathItem = {};
|
|
223
|
+
for (const method of route.methods) pathItem[method.toLowerCase()] = {
|
|
224
|
+
tags: [route.tag],
|
|
225
|
+
summary: route.summary,
|
|
226
|
+
description: route.description ?? route.summary,
|
|
227
|
+
operationId: createOperationId(route, method),
|
|
228
|
+
...route.parameters.length > 0 ? { parameters: route.parameters } : {},
|
|
229
|
+
...buildRequestBody(method) ? { requestBody: buildRequestBody(method) } : {},
|
|
230
|
+
responses: buildResponses(method),
|
|
231
|
+
"x-farming-labs-source": route.sourceFile
|
|
232
|
+
};
|
|
233
|
+
paths[route.routePath] = pathItem;
|
|
234
|
+
}
|
|
235
|
+
return paths;
|
|
236
|
+
}
|
|
237
|
+
function buildNextOpenApiDocument(config) {
|
|
238
|
+
if (resolveApiReferenceConfig(config.apiReference).specUrl) return {
|
|
239
|
+
openapi: "3.1.0",
|
|
240
|
+
info: {
|
|
241
|
+
title: "API Reference",
|
|
242
|
+
description: "Remote OpenAPI specs are resolved at request time through the Next.js API reference renderer.",
|
|
243
|
+
version: "0.0.0"
|
|
244
|
+
},
|
|
245
|
+
servers: [{ url: "/" }],
|
|
246
|
+
tags: [],
|
|
247
|
+
paths: {}
|
|
248
|
+
};
|
|
249
|
+
const routes = buildApiReferenceRoutes(config);
|
|
250
|
+
const tags = Array.from(new Set(routes.map((route) => route.tag))).map((name) => ({
|
|
251
|
+
name,
|
|
252
|
+
description: `${name} endpoints`
|
|
253
|
+
}));
|
|
254
|
+
return {
|
|
255
|
+
openapi: "3.1.0",
|
|
256
|
+
info: {
|
|
257
|
+
title: "API Reference",
|
|
258
|
+
description: config.metadata?.description ?? "Generated API reference from Next.js route handlers.",
|
|
259
|
+
version: "0.0.0"
|
|
260
|
+
},
|
|
261
|
+
servers: [{ url: "/" }],
|
|
262
|
+
tags,
|
|
263
|
+
paths: buildOpenApiPaths(routes)
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function SwitcherGlyph({ kind }) {
|
|
267
|
+
const isApi = kind === "api";
|
|
268
|
+
return /* @__PURE__ */ jsx("span", {
|
|
269
|
+
className: "fd-api-reference-switcher-glyph",
|
|
270
|
+
"data-kind": kind,
|
|
271
|
+
"aria-hidden": "true",
|
|
272
|
+
children: isApi ? /* @__PURE__ */ jsx("svg", {
|
|
273
|
+
viewBox: "0 0 24 24",
|
|
274
|
+
fill: "none",
|
|
275
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
276
|
+
d: "M8 8L4 12L8 16M16 8L20 12L16 16M13.5 6L10.5 18",
|
|
277
|
+
stroke: "currentColor",
|
|
278
|
+
strokeWidth: "1.8",
|
|
279
|
+
strokeLinecap: "round",
|
|
280
|
+
strokeLinejoin: "round"
|
|
281
|
+
})
|
|
282
|
+
}) : /* @__PURE__ */ jsx("svg", {
|
|
283
|
+
viewBox: "0 0 24 24",
|
|
284
|
+
fill: "none",
|
|
285
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
286
|
+
d: "M4.75 6.75C4.75 5.64543 5.64543 4.75 6.75 4.75H11.25V19.25H6.75C5.64543 19.25 4.75 18.3546 4.75 17.25V6.75ZM12.75 4.75H17.25C18.3546 4.75 19.25 5.64543 19.25 6.75V17.25C19.25 18.3546 18.3546 19.25 17.25 19.25H12.75V4.75Z",
|
|
287
|
+
stroke: "currentColor",
|
|
288
|
+
strokeWidth: "1.8",
|
|
289
|
+
strokeLinejoin: "round"
|
|
290
|
+
})
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
const API_REFERENCE_COLOR_MAP = {
|
|
295
|
+
primary: "--color-fd-primary",
|
|
296
|
+
primaryForeground: "--color-fd-primary-foreground",
|
|
297
|
+
background: "--color-fd-background",
|
|
298
|
+
foreground: "--color-fd-foreground",
|
|
299
|
+
muted: "--color-fd-muted",
|
|
300
|
+
mutedForeground: "--color-fd-muted-foreground",
|
|
301
|
+
border: "--color-fd-border",
|
|
302
|
+
card: "--color-fd-card",
|
|
303
|
+
cardForeground: "--color-fd-card-foreground",
|
|
304
|
+
accent: "--color-fd-accent",
|
|
305
|
+
accentForeground: "--color-fd-accent-foreground",
|
|
306
|
+
popover: "--color-fd-popover",
|
|
307
|
+
popoverForeground: "--color-fd-popover-foreground",
|
|
308
|
+
secondary: "--color-fd-secondary",
|
|
309
|
+
secondaryForeground: "--color-fd-secondary-foreground",
|
|
310
|
+
ring: "--color-fd-ring"
|
|
311
|
+
};
|
|
312
|
+
function buildApiReferenceColorsCSS(colors) {
|
|
313
|
+
if (!colors) return "";
|
|
314
|
+
const vars = [];
|
|
315
|
+
for (const [key, value] of Object.entries(colors)) {
|
|
316
|
+
if (!value || !API_REFERENCE_COLOR_MAP[key]) continue;
|
|
317
|
+
vars.push(`${API_REFERENCE_COLOR_MAP[key]}: ${value};`);
|
|
318
|
+
}
|
|
319
|
+
if (vars.length === 0) return "";
|
|
320
|
+
const block = vars.join("\n ");
|
|
321
|
+
return `:root {\n ${block}\n}\n.dark {\n ${block}\n}`;
|
|
322
|
+
}
|
|
323
|
+
function ApiReferenceColorStyle({ colors }) {
|
|
324
|
+
const css = buildApiReferenceColorsCSS(colors);
|
|
325
|
+
if (!css) return null;
|
|
326
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: css } });
|
|
327
|
+
}
|
|
328
|
+
function buildApiReferenceFontStyleVars(prefix, style) {
|
|
329
|
+
if (!style) return "";
|
|
330
|
+
const parts = [];
|
|
331
|
+
if (style.size) parts.push(`${prefix}-size: ${style.size};`);
|
|
332
|
+
if (style.weight != null) parts.push(`${prefix}-weight: ${style.weight};`);
|
|
333
|
+
if (style.lineHeight) parts.push(`${prefix}-line-height: ${style.lineHeight};`);
|
|
334
|
+
if (style.letterSpacing) parts.push(`${prefix}-letter-spacing: ${style.letterSpacing};`);
|
|
335
|
+
return parts.join("\n ");
|
|
336
|
+
}
|
|
337
|
+
function buildApiReferenceTypographyCSS(typography) {
|
|
338
|
+
if (!typography?.font) return "";
|
|
339
|
+
const vars = [];
|
|
340
|
+
const fontStyle = typography.font.style;
|
|
341
|
+
if (fontStyle?.sans) vars.push(`--fd-font-sans: ${fontStyle.sans};`);
|
|
342
|
+
if (fontStyle?.mono) vars.push(`--fd-font-mono: ${fontStyle.mono};`);
|
|
343
|
+
for (const element of [
|
|
344
|
+
"h1",
|
|
345
|
+
"h2",
|
|
346
|
+
"h3",
|
|
347
|
+
"h4",
|
|
348
|
+
"body",
|
|
349
|
+
"small"
|
|
350
|
+
]) {
|
|
351
|
+
const style = typography.font[element];
|
|
352
|
+
if (!style) continue;
|
|
353
|
+
const cssVars = buildApiReferenceFontStyleVars(`--fd-${element}`, style);
|
|
354
|
+
if (cssVars) vars.push(cssVars);
|
|
355
|
+
}
|
|
356
|
+
if (vars.length === 0) return "";
|
|
357
|
+
const cssVars = vars.join("\n ");
|
|
358
|
+
return `:root {
|
|
359
|
+
${cssVars}
|
|
360
|
+
}
|
|
361
|
+
body:has(.fd-api-reference-page) {
|
|
362
|
+
${cssVars}
|
|
363
|
+
}
|
|
364
|
+
.fd-api-reference-page {
|
|
365
|
+
${cssVars}
|
|
366
|
+
}`;
|
|
367
|
+
}
|
|
368
|
+
function ApiReferenceTypographyStyle({ typography }) {
|
|
369
|
+
const css = buildApiReferenceTypographyCSS(typography);
|
|
370
|
+
if (!css) return null;
|
|
371
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: css } });
|
|
372
|
+
}
|
|
373
|
+
function ApiReferenceLayoutStyle({ layout }) {
|
|
374
|
+
if (!layout) return null;
|
|
375
|
+
const rootVars = [];
|
|
376
|
+
const desktopRootVars = [];
|
|
377
|
+
const desktopGridVars = [];
|
|
378
|
+
if (layout.sidebarWidth) {
|
|
379
|
+
const value = `--fd-sidebar-width: ${layout.sidebarWidth}px`;
|
|
380
|
+
desktopRootVars.push(`${value};`);
|
|
381
|
+
desktopGridVars.push(`${value} !important;`);
|
|
382
|
+
}
|
|
383
|
+
if (layout.contentWidth) rootVars.push(`--fd-content-width: ${layout.contentWidth}px;`);
|
|
384
|
+
if (layout.tocWidth) {
|
|
385
|
+
const value = `--fd-toc-width: ${layout.tocWidth}px`;
|
|
386
|
+
desktopRootVars.push(`${value};`);
|
|
387
|
+
desktopGridVars.push(`${value} !important;`);
|
|
388
|
+
}
|
|
389
|
+
if (rootVars.length === 0 && desktopRootVars.length === 0) return null;
|
|
390
|
+
const parts = [];
|
|
391
|
+
if (rootVars.length > 0) parts.push(`:root {\n ${rootVars.join("\n ")}\n}`);
|
|
392
|
+
if (desktopRootVars.length > 0) {
|
|
393
|
+
const inner = [`:root {\n ${desktopRootVars.join("\n ")}\n }`];
|
|
394
|
+
if (desktopGridVars.length > 0) inner.push(`[style*="fd-sidebar-col"] {\n ${desktopGridVars.join("\n ")}\n }`);
|
|
395
|
+
parts.push(`@media (min-width: 1024px) {\n ${inner.join("\n ")}\n}`);
|
|
396
|
+
}
|
|
397
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: parts.join("\n") } });
|
|
398
|
+
}
|
|
399
|
+
function resolveApiReferenceThemeSwitch(toggle) {
|
|
400
|
+
if (toggle === void 0 || toggle === true) return { enabled: true };
|
|
401
|
+
if (toggle === false) return { enabled: false };
|
|
402
|
+
return {
|
|
403
|
+
enabled: toggle.enabled !== false,
|
|
404
|
+
mode: toggle.mode
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function ApiReferenceForcedThemeScript({ theme }) {
|
|
408
|
+
return /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.classList.remove('light','dark');document.documentElement.classList.add('${theme}');` } });
|
|
409
|
+
}
|
|
410
|
+
function ApiReferenceThemeBridge({ config }) {
|
|
411
|
+
const colors = config.theme?._userColorOverrides;
|
|
412
|
+
const typography = config.theme?.ui?.typography;
|
|
413
|
+
const layout = config.theme?.ui?.layout;
|
|
414
|
+
const themeSwitch = resolveApiReferenceThemeSwitch(config.themeToggle);
|
|
415
|
+
const toggleConfig = typeof config.themeToggle === "object" ? config.themeToggle : void 0;
|
|
416
|
+
const forcedTheme = themeSwitch.enabled === false && toggleConfig?.default && toggleConfig.default !== "system" ? toggleConfig.default : void 0;
|
|
417
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
418
|
+
/* @__PURE__ */ jsx(ApiReferenceColorStyle, { colors }),
|
|
419
|
+
/* @__PURE__ */ jsx(ApiReferenceTypographyStyle, { typography }),
|
|
420
|
+
/* @__PURE__ */ jsx(ApiReferenceLayoutStyle, { layout }),
|
|
421
|
+
forcedTheme ? /* @__PURE__ */ jsx(ApiReferenceForcedThemeScript, { theme: forcedTheme }) : null
|
|
422
|
+
] });
|
|
423
|
+
}
|
|
424
|
+
function ApiReferenceServerUrlPatchScript({ serverUrl }) {
|
|
425
|
+
if (!serverUrl) return null;
|
|
426
|
+
return /* @__PURE__ */ jsx("script", {
|
|
427
|
+
id: "fd-api-reference-server-url-patch",
|
|
428
|
+
dangerouslySetInnerHTML: { __html: `(function () {
|
|
429
|
+
var raw = ${JSON.stringify(serverUrl)};
|
|
430
|
+
var resolve = function () {
|
|
431
|
+
try {
|
|
432
|
+
return new URL(raw, window.location.origin).toString();
|
|
433
|
+
} catch {
|
|
434
|
+
return window.location.origin;
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
var apply = function () {
|
|
438
|
+
var label = resolve();
|
|
439
|
+
document
|
|
440
|
+
.querySelectorAll('.fd-api-reference-route button[aria-haspopup="dialog"] code.truncate')
|
|
441
|
+
.forEach(function (node) {
|
|
442
|
+
if (node.textContent && node.textContent.trim() === 'loading...') {
|
|
443
|
+
node.textContent = label;
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
apply();
|
|
449
|
+
window.requestAnimationFrame(apply);
|
|
450
|
+
window.setTimeout(apply, 200);
|
|
451
|
+
window.setTimeout(apply, 1200);
|
|
452
|
+
})();` }
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function ApiReferenceSwitcher({ docsUrl, apiUrl }) {
|
|
456
|
+
return /* @__PURE__ */ jsx(SidebarTabsDropdown, {
|
|
457
|
+
className: "fd-api-reference-switcher w-full mb-4",
|
|
458
|
+
options: [{
|
|
459
|
+
url: docsUrl,
|
|
460
|
+
title: "Documentation",
|
|
461
|
+
description: "Guides & concepts",
|
|
462
|
+
icon: /* @__PURE__ */ jsx(SwitcherGlyph, { kind: "docs" })
|
|
463
|
+
}, {
|
|
464
|
+
url: apiUrl,
|
|
465
|
+
title: "API Reference",
|
|
466
|
+
description: "Endpoints & examples",
|
|
467
|
+
icon: /* @__PURE__ */ jsx(SwitcherGlyph, { kind: "api" })
|
|
468
|
+
}]
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
function getExistingSidebarBanner(config) {
|
|
472
|
+
if (!config.sidebar || config.sidebar === true) return void 0;
|
|
473
|
+
return config.sidebar.banner;
|
|
474
|
+
}
|
|
475
|
+
function resolveApiReferenceThemeStyle(config) {
|
|
476
|
+
if ((config.theme?.name?.toLowerCase() ?? "").includes("colorful")) return "colorful";
|
|
477
|
+
}
|
|
478
|
+
function mergeBanner(existing, next) {
|
|
479
|
+
if (!existing) return next;
|
|
480
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
481
|
+
style: {
|
|
482
|
+
display: "flex",
|
|
483
|
+
flexDirection: "column",
|
|
484
|
+
gap: 12
|
|
485
|
+
},
|
|
486
|
+
children: [existing, next]
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
function flattenApiReferencePageTreeForSidebar(tree) {
|
|
490
|
+
if (!tree || typeof tree !== "object") return tree;
|
|
491
|
+
const root = tree;
|
|
492
|
+
if (!Array.isArray(root.children) || root.children.length !== 1) return tree;
|
|
493
|
+
const [onlyChild] = root.children;
|
|
494
|
+
if (!onlyChild || typeof onlyChild !== "object") return tree;
|
|
495
|
+
const folder = onlyChild;
|
|
496
|
+
if (folder.type !== "folder" || !Array.isArray(folder.children)) return tree;
|
|
497
|
+
const nextChildren = [...folder.index ? [folder.index] : [], ...folder.children];
|
|
498
|
+
if (nextChildren.length === 0) return tree;
|
|
499
|
+
return {
|
|
500
|
+
...root,
|
|
501
|
+
children: nextChildren
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function renderApiReferenceOperationLayout(slots) {
|
|
505
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
506
|
+
className: "fd-api-reference-operation",
|
|
507
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
508
|
+
className: "fd-api-reference-operation-main",
|
|
509
|
+
children: [
|
|
510
|
+
slots.header,
|
|
511
|
+
slots.apiPlayground,
|
|
512
|
+
slots.description ? /* @__PURE__ */ jsx("div", {
|
|
513
|
+
className: "fd-api-reference-operation-description",
|
|
514
|
+
children: slots.description
|
|
515
|
+
}) : null,
|
|
516
|
+
slots.authSchemes,
|
|
517
|
+
slots.parameters,
|
|
518
|
+
slots.body,
|
|
519
|
+
slots.responses,
|
|
520
|
+
slots.callbacks
|
|
521
|
+
]
|
|
522
|
+
}), slots.apiExample ? /* @__PURE__ */ jsx("div", {
|
|
523
|
+
className: "fd-api-reference-operation-example",
|
|
524
|
+
children: slots.apiExample
|
|
525
|
+
}) : null]
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
function withNextApiReferenceBanner(config) {
|
|
529
|
+
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
530
|
+
if (!apiReference.enabled) return config;
|
|
531
|
+
if (config.sidebar === false) return config;
|
|
532
|
+
const switcher = /* @__PURE__ */ jsx(ApiReferenceSwitcher, {
|
|
533
|
+
docsUrl: getDocsUrl(config),
|
|
534
|
+
apiUrl: `/${apiReference.path}`,
|
|
535
|
+
current: "docs",
|
|
536
|
+
config
|
|
537
|
+
});
|
|
538
|
+
const banner = mergeBanner(getExistingSidebarBanner(config), switcher);
|
|
539
|
+
if (!config.sidebar || config.sidebar === true) return {
|
|
540
|
+
...config,
|
|
541
|
+
sidebar: { banner }
|
|
542
|
+
};
|
|
543
|
+
return {
|
|
544
|
+
...config,
|
|
545
|
+
sidebar: {
|
|
546
|
+
...config.sidebar,
|
|
547
|
+
banner
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function createNextApiReference(config) {
|
|
552
|
+
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
553
|
+
return async (request) => {
|
|
554
|
+
if (!apiReference.enabled) return new Response("Not Found", { status: 404 });
|
|
555
|
+
const document = await buildApiReferenceOpenApiDocumentAsync(config, {
|
|
556
|
+
framework: "next",
|
|
557
|
+
rootDir: process.cwd(),
|
|
558
|
+
baseUrl: getOriginFromRequest(request)
|
|
559
|
+
});
|
|
560
|
+
return ApiReference({
|
|
561
|
+
pageTitle: buildApiReferencePageTitle(config, "API Reference"),
|
|
562
|
+
title: "API Reference",
|
|
563
|
+
content: document,
|
|
564
|
+
theme: "deepSpace",
|
|
565
|
+
layout: "modern",
|
|
566
|
+
darkMode: getForcedMode(config) === "dark" ? true : void 0,
|
|
567
|
+
forceDarkModeState: getForcedMode(config),
|
|
568
|
+
hideDarkModeToggle: isThemeToggleHidden(config),
|
|
569
|
+
customCss: buildApiReferenceScalarCss(config),
|
|
570
|
+
pathRouting: { basePath: `/${apiReference.path}` },
|
|
571
|
+
showSidebar: true,
|
|
572
|
+
defaultOpenFirstTag: true,
|
|
573
|
+
tagsSorter: "alpha",
|
|
574
|
+
operationsSorter: "alpha",
|
|
575
|
+
operationTitleSource: "summary",
|
|
576
|
+
defaultHttpClient: {
|
|
577
|
+
targetKey: "shell",
|
|
578
|
+
clientKey: "curl"
|
|
579
|
+
},
|
|
580
|
+
documentDownloadType: "json"
|
|
581
|
+
})();
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function getOpenApiInfo(document) {
|
|
585
|
+
const info = document.info && typeof document.info === "object" && !Array.isArray(document.info) ? document.info : {};
|
|
586
|
+
return {
|
|
587
|
+
title: typeof info.title === "string" && info.title.trim() ? info.title : "API Reference",
|
|
588
|
+
description: typeof info.description === "string" && info.description.trim() ? info.description : void 0
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function createNextApiReferencePage(config) {
|
|
592
|
+
return async function NextApiReferencePage(props) {
|
|
593
|
+
const [{ createAPIPage }, { DocsDescription, DocsPage, DocsTitle }] = await Promise.all([import("fumadocs-openapi/ui"), import("fumadocs-ui/layouts/notebook/page")]);
|
|
594
|
+
const { info, pages, server, source } = await getNextApiReferenceSourceState(config);
|
|
595
|
+
const slug = (props?.params ? await props.params : void 0)?.slug ?? [];
|
|
596
|
+
if (pages.length === 0) return /* @__PURE__ */ jsxs(DocsPage, {
|
|
597
|
+
full: true,
|
|
598
|
+
children: [
|
|
599
|
+
/* @__PURE__ */ jsx(DocsTitle, { children: info.title }),
|
|
600
|
+
/* @__PURE__ */ jsx(DocsDescription, { children: info.description }),
|
|
601
|
+
/* @__PURE__ */ jsx("div", {
|
|
602
|
+
className: "fd-api-reference-body",
|
|
603
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
604
|
+
className: "rounded-xl border border-fd-border bg-fd-card p-6 text-sm text-fd-muted-foreground",
|
|
605
|
+
children: "No operations were found in the OpenAPI document."
|
|
606
|
+
})
|
|
607
|
+
})
|
|
608
|
+
]
|
|
609
|
+
});
|
|
610
|
+
const page = slug.length === 0 ? pages[0] : source.getPage(slug);
|
|
611
|
+
if (!page || typeof page.data?.getAPIPageProps !== "function") notFound();
|
|
612
|
+
const APIPage = createAPIPage(server, { content: { renderOperationLayout: renderApiReferenceOperationLayout } });
|
|
613
|
+
const currentPageIndex = slug.length === 0 ? 0 : pages.findIndex((entry) => entry.url === page.url);
|
|
614
|
+
const previousPage = currentPageIndex > 0 ? pages[currentPageIndex - 1] : void 0;
|
|
615
|
+
const nextPage = currentPageIndex >= 0 && currentPageIndex < pages.length - 1 ? pages[currentPageIndex + 1] : void 0;
|
|
616
|
+
return /* @__PURE__ */ jsxs(DocsPage, {
|
|
617
|
+
toc: page.data.toc,
|
|
618
|
+
full: true,
|
|
619
|
+
footer: { enabled: false },
|
|
620
|
+
className: "fd-api-reference-page",
|
|
621
|
+
children: [
|
|
622
|
+
/* @__PURE__ */ jsx(DocsTitle, { children: page.data.title ?? info.title }),
|
|
623
|
+
/* @__PURE__ */ jsx(DocsDescription, { children: typeof page.data.description === "string" && page.data.description.trim() ? page.data.description : info.description }),
|
|
624
|
+
/* @__PURE__ */ jsx("div", {
|
|
625
|
+
className: "fd-api-reference-body",
|
|
626
|
+
children: /* @__PURE__ */ jsx(APIPage, { ...page.data.getAPIPageProps() })
|
|
627
|
+
}),
|
|
628
|
+
previousPage || nextPage ? /* @__PURE__ */ jsxs("nav", {
|
|
629
|
+
className: "fd-api-reference-pagination",
|
|
630
|
+
"aria-label": "API reference pagination",
|
|
631
|
+
children: [previousPage ? /* @__PURE__ */ jsxs(Link, {
|
|
632
|
+
href: previousPage.url,
|
|
633
|
+
prefetch: true,
|
|
634
|
+
className: "fd-api-reference-pagination-item",
|
|
635
|
+
"data-direction": "previous",
|
|
636
|
+
children: [
|
|
637
|
+
/* @__PURE__ */ jsx("span", {
|
|
638
|
+
className: "fd-api-reference-pagination-label",
|
|
639
|
+
children: "Previous"
|
|
640
|
+
}),
|
|
641
|
+
/* @__PURE__ */ jsx("span", {
|
|
642
|
+
className: "fd-api-reference-pagination-title",
|
|
643
|
+
children: previousPage.data?.title ?? previousPage.url
|
|
644
|
+
}),
|
|
645
|
+
/* @__PURE__ */ jsx("span", {
|
|
646
|
+
className: "fd-api-reference-pagination-description",
|
|
647
|
+
children: previousPage.data?.description ?? "Previous API operation"
|
|
648
|
+
})
|
|
649
|
+
]
|
|
650
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
651
|
+
className: "fd-api-reference-pagination-spacer",
|
|
652
|
+
"aria-hidden": "true"
|
|
653
|
+
}), nextPage ? /* @__PURE__ */ jsxs(Link, {
|
|
654
|
+
href: nextPage.url,
|
|
655
|
+
prefetch: true,
|
|
656
|
+
className: "fd-api-reference-pagination-item",
|
|
657
|
+
"data-direction": "next",
|
|
658
|
+
children: [
|
|
659
|
+
/* @__PURE__ */ jsx("span", {
|
|
660
|
+
className: "fd-api-reference-pagination-label",
|
|
661
|
+
children: "Next"
|
|
662
|
+
}),
|
|
663
|
+
/* @__PURE__ */ jsx("span", {
|
|
664
|
+
className: "fd-api-reference-pagination-title",
|
|
665
|
+
children: nextPage.data?.title ?? nextPage.url
|
|
666
|
+
}),
|
|
667
|
+
/* @__PURE__ */ jsx("span", {
|
|
668
|
+
className: "fd-api-reference-pagination-description",
|
|
669
|
+
children: nextPage.data?.description ?? "Next API operation"
|
|
670
|
+
})
|
|
671
|
+
]
|
|
672
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
673
|
+
className: "fd-api-reference-pagination-spacer",
|
|
674
|
+
"aria-hidden": "true"
|
|
675
|
+
})]
|
|
676
|
+
}) : null
|
|
677
|
+
]
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function createNextApiReferenceLayout(config) {
|
|
682
|
+
return async function NextApiReferenceLayout(props) {
|
|
683
|
+
const { DocsLayout } = await import("fumadocs-ui/layouts/notebook");
|
|
684
|
+
const { apiReference, primaryServerUrl, source } = await getNextApiReferenceSourceState(config);
|
|
685
|
+
const sidebarTree = flattenApiReferencePageTreeForSidebar(source.getPageTree());
|
|
686
|
+
const docsUrl = getDocsUrl(config);
|
|
687
|
+
const apiUrl = `/${apiReference.path}`;
|
|
688
|
+
const themeSwitch = resolveApiReferenceThemeSwitch(config.themeToggle);
|
|
689
|
+
const themeStyle = resolveApiReferenceThemeStyle(config);
|
|
690
|
+
const banner = mergeBanner(getExistingSidebarBanner(config), /* @__PURE__ */ jsx(ApiReferenceSwitcher, {
|
|
691
|
+
docsUrl,
|
|
692
|
+
apiUrl,
|
|
693
|
+
current: "api",
|
|
694
|
+
config
|
|
695
|
+
}));
|
|
696
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
697
|
+
className: "fd-api-reference-route",
|
|
698
|
+
"data-api-reference": "",
|
|
699
|
+
"data-theme-style": themeStyle,
|
|
700
|
+
children: [/* @__PURE__ */ jsx(DocsClientCallbacks, { apiReferencePrimaryServerUrl: primaryServerUrl }), /* @__PURE__ */ jsxs(DocsLayout, {
|
|
701
|
+
tree: sidebarTree,
|
|
702
|
+
sidebar: { banner },
|
|
703
|
+
themeSwitch,
|
|
704
|
+
nav: {
|
|
705
|
+
title: config.nav?.title ?? "Docs",
|
|
706
|
+
url: getDocsUrl(config)
|
|
707
|
+
},
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsx(ApiReferenceThemeBridge, { config }),
|
|
710
|
+
/* @__PURE__ */ jsx(ApiReferenceServerUrlPatchScript, { serverUrl: primaryServerUrl }),
|
|
711
|
+
props.children
|
|
712
|
+
]
|
|
713
|
+
})]
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
async function getNextApiReferenceSourceState(config) {
|
|
718
|
+
const apiReference = resolveApiReferenceConfig(config.apiReference);
|
|
719
|
+
const [{ createOpenAPI, openapiPlugin, openapiSource }, { loader }] = await Promise.all([import("fumadocs-openapi/server"), import("fumadocs-core/source")]);
|
|
720
|
+
const baseUrl = await getOriginFromNextHeaders();
|
|
721
|
+
const document = await buildApiReferenceOpenApiDocumentAsync(config, {
|
|
722
|
+
framework: "next",
|
|
723
|
+
rootDir: process.cwd(),
|
|
724
|
+
baseUrl
|
|
725
|
+
});
|
|
726
|
+
const server = createOpenAPI({ input: async () => ({ main: document }) });
|
|
727
|
+
const info = getOpenApiInfo(document);
|
|
728
|
+
const source = loader(await openapiSource(server, {
|
|
729
|
+
per: "operation",
|
|
730
|
+
groupBy: "tag",
|
|
731
|
+
name(output, dereferenced) {
|
|
732
|
+
if (output.type !== "operation") return slugifyApiReferencePageName(output.item.name);
|
|
733
|
+
const operation = (dereferenced.paths?.[output.item.path])?.[output.item.method];
|
|
734
|
+
return slugifyApiReferencePageName(typeof operation?.summary === "string" && operation.summary.trim() ? operation.summary : typeof operation?.operationId === "string" && operation.operationId.trim() ? operation.operationId : `${output.item.method} ${output.item.path}`);
|
|
735
|
+
}
|
|
736
|
+
}), {
|
|
737
|
+
baseUrl: `/${apiReference.path}`,
|
|
738
|
+
plugins: [openapiPlugin()]
|
|
739
|
+
});
|
|
740
|
+
return {
|
|
741
|
+
apiReference,
|
|
742
|
+
document,
|
|
743
|
+
info,
|
|
744
|
+
primaryServerUrl: Array.isArray(document.servers) && typeof document.servers?.[0]?.url === "string" ? document.servers?.[0]?.url ?? void 0 : void 0,
|
|
745
|
+
pages: source.getPages(),
|
|
746
|
+
server,
|
|
747
|
+
source
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
function getNextApiReferenceMode(config) {
|
|
751
|
+
return resolveApiReferenceRenderer(config.apiReference, "next");
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
//#endregion
|
|
755
|
+
export { buildNextOpenApiDocument, createNextApiReference, createNextApiReferenceLayout, createNextApiReferencePage, flattenApiReferencePageTreeForSidebar, getNextApiReferenceMode, getNextApiReferenceSourceState, resolveApiReferenceConfig, withNextApiReferenceBanner };
|