@blaaiz/docs-core 0.5.0 → 0.7.0
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/{chunk-ZKOOKLZ3.js → chunk-6H6OB7YP.js} +17 -2
- package/dist/chunk-6H6OB7YP.js.map +1 -0
- package/dist/{chunk-ZWDLAW5M.js → chunk-L4PFRXIK.js} +231 -28
- package/dist/chunk-L4PFRXIK.js.map +1 -0
- package/dist/generator.cjs +161 -18
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.d.cts +24 -0
- package/dist/generator.d.ts +24 -0
- package/dist/generator.js +140 -13
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +233 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +258 -7
- package/dist/index.d.ts +258 -7
- package/dist/index.js +1 -1
- package/dist/{navigation-CGqFIPlP.d.cts → navigation-DvgyWSZ4.d.cts} +22 -1
- package/dist/{navigation-CGqFIPlP.d.ts → navigation-DvgyWSZ4.d.ts} +22 -1
- package/dist/ui/api-try-it.cjs +19 -1
- package/dist/ui/api-try-it.cjs.map +1 -1
- package/dist/ui/api-try-it.d.cts +4 -2
- package/dist/ui/api-try-it.d.ts +4 -2
- package/dist/ui/api-try-it.js +5 -2
- package/dist/ui/api-try-it.js.map +1 -1
- package/dist/ui/ask-ai.cjs +26 -6
- package/dist/ui/ask-ai.cjs.map +1 -1
- package/dist/ui/ask-ai.d.cts +6 -1
- package/dist/ui/ask-ai.d.ts +6 -1
- package/dist/ui/ask-ai.js +26 -6
- package/dist/ui/ask-ai.js.map +1 -1
- package/dist/ui/copy-page.cjs +15 -0
- package/dist/ui/copy-page.cjs.map +1 -1
- package/dist/ui/copy-page.js +1 -1
- package/dist/ui.cjs +77 -6
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +99 -8
- package/dist/ui.d.ts +99 -8
- package/dist/ui.js +62 -8
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
- package/skills/SKILL.md +68 -27
- package/styles/api-reference.css +45 -2
- package/styles/ask-ai.css +28 -0
- package/styles/docs.css +96 -1
- package/styles/home.css +34 -1
- package/dist/chunk-ZKOOKLZ3.js.map +0 -1
- package/dist/chunk-ZWDLAW5M.js.map +0 -1
|
@@ -52,6 +52,21 @@ var GLYPHS = {
|
|
|
52
52
|
/* @__PURE__ */ jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
|
|
53
53
|
/* @__PURE__ */ jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
54
54
|
] }),
|
|
55
|
+
users: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "7", r: "4" }),
|
|
57
|
+
/* @__PURE__ */ jsx("path", { d: "M2 21a7 7 0 0 1 14 0" }),
|
|
58
|
+
/* @__PURE__ */ jsx("path", { d: "M16 3.5a4 4 0 0 1 0 7" }),
|
|
59
|
+
/* @__PURE__ */ jsx("path", { d: "M17.5 14.5a7 7 0 0 1 4.5 6.5" })
|
|
60
|
+
] }),
|
|
61
|
+
building: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "2", width: "16", height: "20", rx: "2" }),
|
|
63
|
+
/* @__PURE__ */ jsx("path", { d: "M9 22v-4h6v4" }),
|
|
64
|
+
/* @__PURE__ */ jsx("path", { d: "M8 6h.01M12 6h.01M16 6h.01M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01" })
|
|
65
|
+
] }),
|
|
66
|
+
clock: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
68
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7v5l3 2" })
|
|
69
|
+
] }),
|
|
55
70
|
/** A circled `i` — an informational note, and the generic error state. */
|
|
56
71
|
info: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
72
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
@@ -120,5 +135,5 @@ function filledIcon(path, options = {}) {
|
|
|
120
135
|
var PLAY_PATH = "M8 5v14l11-7z";
|
|
121
136
|
|
|
122
137
|
export { PLAY_PATH, filledIcon, strokeIcon };
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-6H6OB7YP.js.map
|
|
139
|
+
//# sourceMappingURL=chunk-6H6OB7YP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/icons.tsx"],"names":[],"mappings":";;;AAuBA,IAAM,MAAA,GAAS;AAAA,EACb,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,GAAE,gDAAA,EAAiD,CAAA;AAAA,oBACzD,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,eAAA,EAAgB;AAAA,GAAA,EAC1B,CAAA;AAAA,EAEF,IAAA,kBAAM,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,gEAAA,EAAiE,CAAA;AAAA,EAC/E,sBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,GAAE,gBAAA,EAAiB,CAAA;AAAA,oBACzB,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,cAAA,EAAe;AAAA,GAAA,EACzB,CAAA;AAAA,EAEF,wBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,GAAE,yFAAA,EAA0F,CAAA;AAAA,oBAClG,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,iGAAA,EAAkG,CAAA;AAAA,oBAC1G,GAAA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AAQ;AAAA,GAWf;AAEJ;AAUO,SAAS,UAAA,CAAW,IAAA,EAAc,OAAA,GAAuB,EAAC,EAAc;AAC7E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MAEE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,MAC1E,GAAI,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAY,EAAC,GAAI,EAAE,KAAA,EAAO,OAAA,CAAQ,IAAA,EAAM,MAAA,EAAQ,OAAA,CAAQ,IAAA,EAAK;AAAA,MACnF,OAAA,EAAQ,WAAA;AAAA,MACR,IAAA,EAAK,cAAA;AAAA,MACL,aAAA,EAAY,MAAA;AAAA,MAEZ,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAG,IAAA,EAAM;AAAA,KAAA;AAAA,IAPV,OAAA,CAAQ;AAAA,GAQf;AAEJ;AAGO,IAAM,SAAA,GAAY","file":"chunk-6H6OB7YP.js","sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * The framework's inline-SVG glyph set — internal.\n *\n * Five UI modules drew their own icons, and four glyphs were drawn twice: the\n * house on the error screen and in the sidebar icon map, the padlock on the\n * sign-in and the `403` screen, the info circle on both of those, the key in\n * both places again, and the check mark in the copy-page button and the\n * playground. One drawing per glyph now lives here.\n *\n * Nothing is exported from the package: the modules below compose these paths,\n * and `docsIcon` remains the only public icon surface. Zero dependencies — the\n * paths are Lucide-shaped, on the same 24×24 grid, so any glyph works at any\n * size.\n *\n * @packageDocumentation\n */\n\n/**\n * The glyph paths, keyed by name. Each value is the *inside* of an `<svg>`, so\n * a caller decides the size, the stroke, and the class.\n */\nconst GLYPHS = {\n house: (\n <>\n <path d=\"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n <path d=\"M9 22V12h6v10\" />\n </>\n ),\n book: <path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20\" />,\n code: (\n <>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </>\n ),\n rocket: (\n <>\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91 0z\" />\n <path d=\"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0\" />\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n </>\n ),\n terminal: (\n <>\n <path d=\"m4 17 6-6-6-6\" />\n <path d=\"M12 19h8\" />\n </>\n ),\n wallet: (\n <>\n <path d=\"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\" />\n <path d=\"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\" />\n </>\n ),\n key: (\n <>\n <path d=\"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\" />\n <path d=\"m21 2-9.6 9.6\" />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </>\n ),\n webhook: (\n <>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </>\n ),\n globe: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </>\n ),\n mail: (\n <>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n <path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\" />\n </>\n ),\n user: (\n <>\n <circle cx=\"12\" cy=\"8\" r=\"4\" />\n <path d=\"M4 21a8 8 0 0 1 16 0\" />\n </>\n ),\n lock: (\n <>\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </>\n ),\n users: (\n <>\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <path d=\"M2 21a7 7 0 0 1 14 0\" />\n <path d=\"M16 3.5a4 4 0 0 1 0 7\" />\n <path d=\"M17.5 14.5a7 7 0 0 1 4.5 6.5\" />\n </>\n ),\n building: (\n <>\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M9 22v-4h6v4\" />\n <path d=\"M8 6h.01M12 6h.01M16 6h.01M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01\" />\n </>\n ),\n clock: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v5l3 2\" />\n </>\n ),\n /** A circled `i` — an informational note, and the generic error state. */\n info: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 8v4M12 16h.01\" strokeLinecap=\"round\" />\n </>\n ),\n /** A warning triangle — a caution, and the `500` screen. */\n alert: (\n <>\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\" />\n <path d=\"M12 9v4M12 17h.01\" strokeLinecap=\"round\" />\n </>\n ),\n /** A light bulb — a tip. */\n bulb: (\n <path d=\"M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.1V17h6v-.2c0-.8.4-1.6 1-2.1A7 7 0 0 0 12 2Z\" />\n ),\n /** A circle with a cross — the `404` screen. */\n crossCircle: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m14.31 8-1.31 2.4M9.69 8l4.62 8M14.31 16 9.69 8\" strokeLinecap=\"round\" />\n </>\n ),\n /** Struck-through signal bars — the offline screen. */\n offline: (\n <>\n <path d=\"M5 12.55a11 11 0 0 1 14 0M8.5 16.11a6 6 0 0 1 7 0M12 20h.01\" strokeLinecap=\"round\" />\n <path d=\"m2 2 20 20\" strokeLinecap=\"round\" />\n </>\n ),\n copy: (\n <path d=\"M9 9h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2ZM5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n ),\n check: <path d=\"M20 6 9 17l-5-5\" />,\n chevronDown: <path d=\"m6 9 6 6 6-6\" />,\n /** Stacked chevrons — a value this control switches between. */\n chevronUpDown: <path d=\"m7 15 5 5 5-5M7 9l5-5 5 5\" />,\n /** An open arc — one turn of a loading spinner. */\n spinner: <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" strokeLinecap=\"round\" />,\n markdown: (\n <>\n <rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M6 15V9l3 3 3-3v6M17 9v4m0 0 2-2m-2 2-2-2\" />\n </>\n ),\n} satisfies Record<string, ReactNode>;\n\n/** A glyph in {@link GLYPHS}. */\nexport type GlyphName = keyof typeof GLYPHS;\n\n/**\n * How one icon is drawn. Every field is optional, and the defaults match the\n * house style: 24×24 grid, current colour, hidden from assistive technology.\n */\nexport interface IconOptions {\n /**\n * React key for the `<svg>`. Set it when a host may place the icon in an\n * array of children — fumadocs renders a sidebar link as `[icon, text]`, and\n * an unkeyed element there raises React's \"unique key\" warning in the\n * consuming site's console.\n */\n readonly key?: string;\n /** Pixel size for `width` and `height`. Omit to let CSS size the icon. */\n readonly size?: number;\n /** Stroke width. Default 2. */\n readonly strokeWidth?: number;\n /** Round the stroke's ends and joins. Default `false`. */\n readonly rounded?: boolean;\n /** Class for the `<svg>`, e.g. a spin animation. */\n readonly className?: string;\n}\n\n/**\n * Draw a stroked glyph.\n *\n * @param name - the glyph\n * @param options - size, stroke, and class\n * @returns the `<svg>` element\n */\nexport function strokeIcon(name: GlyphName, options: IconOptions = {}): ReactNode {\n return (\n <svg\n key={options.key}\n {...(options.className === undefined ? {} : { className: options.className })}\n {...(options.size === undefined ? {} : { width: options.size, height: options.size })}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={options.strokeWidth ?? 2}\n {...(options.rounded ? { strokeLinecap: 'round', strokeLinejoin: 'round' } : {})}\n aria-hidden=\"true\"\n >\n {GLYPHS[name]}\n </svg>\n );\n}\n\n/**\n * Draw a filled glyph. Used by the solid play triangle, where a stroke would\n * read as an outline.\n *\n * @param path - the path data\n * @param options - size and class\n * @returns the `<svg>` element\n */\nexport function filledIcon(path: string, options: IconOptions = {}): ReactNode {\n return (\n <svg\n key={options.key}\n {...(options.className === undefined ? {} : { className: options.className })}\n {...(options.size === undefined ? {} : { width: options.size, height: options.size })}\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d={path} />\n </svg>\n );\n}\n\n/** A solid right-pointing triangle: run this request. */\nexport const PLAY_PATH = 'M8 5v14l11-7z';\n"]}
|
|
@@ -968,6 +968,15 @@ function createProvider(resolved, apiKey, doFetch) {
|
|
|
968
968
|
return resolved.provider === "anthropic" ? createAnthropicProvider(providerOptions) : createOpenAiProvider(providerOptions);
|
|
969
969
|
}
|
|
970
970
|
function createAskAiRoute(options) {
|
|
971
|
+
if (options.config === void 0) {
|
|
972
|
+
return {
|
|
973
|
+
POST: () => Promise.resolve(
|
|
974
|
+
jsonResponse(404, {
|
|
975
|
+
error: "Ask AI is not enabled: docs.config.ts declares no ai block."
|
|
976
|
+
})
|
|
977
|
+
)
|
|
978
|
+
};
|
|
979
|
+
}
|
|
971
980
|
const resolved = resolveAiConfig(options.config);
|
|
972
981
|
if (typeof options.siteName !== "string" || options.siteName.trim() === "") {
|
|
973
982
|
throw new AiConfigError("siteName must be a non-empty string, e.g. theme.name.");
|
|
@@ -1361,6 +1370,22 @@ function validateFeatures(value) {
|
|
|
1361
1370
|
}
|
|
1362
1371
|
optionalBoolean(features["copyPage"], "features.copyPage");
|
|
1363
1372
|
}
|
|
1373
|
+
function validateNavbarAction(value, field) {
|
|
1374
|
+
const action = optionalObject(value, field);
|
|
1375
|
+
if (action === void 0) {
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
requireString(action["text"], `${field}.text`, "Example: 'Dashboard'.");
|
|
1379
|
+
requireString(action["href"], `${field}.href`, "Example: 'https://app.example.com'.");
|
|
1380
|
+
}
|
|
1381
|
+
function validateNavbar(value) {
|
|
1382
|
+
const navbar = optionalObject(value, "navbar");
|
|
1383
|
+
if (navbar === void 0) {
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
validateNavbarAction(navbar["primary"], "navbar.primary");
|
|
1387
|
+
validateNavbarAction(navbar["secondary"], "navbar.secondary");
|
|
1388
|
+
}
|
|
1364
1389
|
function validateSeo(value) {
|
|
1365
1390
|
const seo = optionalObject(value, "seo");
|
|
1366
1391
|
if (seo === void 0) {
|
|
@@ -1411,6 +1436,7 @@ function validateDocsConfig(config) {
|
|
|
1411
1436
|
validateTheme(config["theme"]);
|
|
1412
1437
|
validateAuth(config["auth"]);
|
|
1413
1438
|
validateProxy(config["proxy"]);
|
|
1439
|
+
validateNavbar(config["navbar"]);
|
|
1414
1440
|
validateFeatures(config["features"]);
|
|
1415
1441
|
validateSeo(config["seo"]);
|
|
1416
1442
|
if (config["ai"] !== void 0) {
|
|
@@ -1458,6 +1484,90 @@ function buildThemeCss(theme) {
|
|
|
1458
1484
|
return blocks.join("\n");
|
|
1459
1485
|
}
|
|
1460
1486
|
|
|
1487
|
+
// src/core/redirects.ts
|
|
1488
|
+
function redirectTarget(url, redirects) {
|
|
1489
|
+
const { pathname } = url;
|
|
1490
|
+
const markdown = pathname.endsWith(".md");
|
|
1491
|
+
const page = markdown ? pathname.slice(0, -3) : pathname;
|
|
1492
|
+
const destination = redirects[page];
|
|
1493
|
+
if (destination === void 0) {
|
|
1494
|
+
return null;
|
|
1495
|
+
}
|
|
1496
|
+
const target = new URL(url);
|
|
1497
|
+
target.pathname = markdown ? `${destination}.md` : destination;
|
|
1498
|
+
return target;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
// src/core/llms-txt.ts
|
|
1502
|
+
function buildLlmsTxt(pages, options) {
|
|
1503
|
+
const origin = options.origin?.replace(/\/$/, "") ?? "";
|
|
1504
|
+
const lines = [`# ${options.name}`];
|
|
1505
|
+
if (options.description !== void 0 && options.description !== "") {
|
|
1506
|
+
lines.push("", `> ${options.description}`);
|
|
1507
|
+
}
|
|
1508
|
+
lines.push("", "## Docs", "");
|
|
1509
|
+
for (const page of pages) {
|
|
1510
|
+
const link = `[${page.title}](${origin}${page.url}.md)`;
|
|
1511
|
+
lines.push(
|
|
1512
|
+
page.description === void 0 || page.description === "" ? `- ${link}` : `- ${link}: ${page.description}`
|
|
1513
|
+
);
|
|
1514
|
+
}
|
|
1515
|
+
lines.push("");
|
|
1516
|
+
return lines.join("\n");
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
// src/core/code-samples.ts
|
|
1520
|
+
function singleQuote(value) {
|
|
1521
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
1522
|
+
}
|
|
1523
|
+
function isRecord(value) {
|
|
1524
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1525
|
+
}
|
|
1526
|
+
function bodyToString(body, mediaType) {
|
|
1527
|
+
if (typeof body === "string") {
|
|
1528
|
+
return body;
|
|
1529
|
+
}
|
|
1530
|
+
if (mediaType === "application/x-www-form-urlencoded" && isRecord(body)) {
|
|
1531
|
+
const params = new URLSearchParams();
|
|
1532
|
+
for (const [key, value] of Object.entries(body)) {
|
|
1533
|
+
if (value === void 0 || value === null) {
|
|
1534
|
+
continue;
|
|
1535
|
+
}
|
|
1536
|
+
const encoded = typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
1537
|
+
params.set(key, encoded);
|
|
1538
|
+
}
|
|
1539
|
+
return params.toString();
|
|
1540
|
+
}
|
|
1541
|
+
if (mediaType === "application/x-ndjson" && Array.isArray(body)) {
|
|
1542
|
+
return body.map((entry) => JSON.stringify(entry)).join("\n");
|
|
1543
|
+
}
|
|
1544
|
+
return JSON.stringify(body, null, 2);
|
|
1545
|
+
}
|
|
1546
|
+
var curlCodeUsage = {
|
|
1547
|
+
label: "cURL",
|
|
1548
|
+
lang: "bash",
|
|
1549
|
+
generate(data) {
|
|
1550
|
+
const lines = [`curl --request ${data.method.toUpperCase()}`, `--url ${singleQuote(data.url)}`];
|
|
1551
|
+
for (const [name, param] of Object.entries(data.header ?? {})) {
|
|
1552
|
+
lines.push(`--header ${singleQuote(`${name}: ${param.value}`)}`);
|
|
1553
|
+
}
|
|
1554
|
+
for (const [name, param] of Object.entries(data.cookie ?? {})) {
|
|
1555
|
+
lines.push(`--cookie ${singleQuote(`${name}=${param.value}`)}`);
|
|
1556
|
+
}
|
|
1557
|
+
if (isRecord(data.body) && data.bodyMediaType === "multipart/form-data") {
|
|
1558
|
+
for (const [key, value] of Object.entries(data.body)) {
|
|
1559
|
+
lines.push(
|
|
1560
|
+
`--form ${singleQuote(`${key}=${typeof value === "string" ? value : JSON.stringify(value)}`)}`
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
} else if (data.body !== void 0 && data.body !== null && data.bodyMediaType !== void 0) {
|
|
1564
|
+
lines.push(`--header ${singleQuote(`Content-Type: ${data.bodyMediaType}`)}`);
|
|
1565
|
+
lines.push(`--data ${singleQuote(bodyToString(data.body, data.bodyMediaType))}`);
|
|
1566
|
+
}
|
|
1567
|
+
return lines.map((line, i) => i === 0 ? line : ` ${line}`).join(" \\\n");
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1461
1571
|
// src/core/seo.ts
|
|
1462
1572
|
function trimTrailingSlash(value) {
|
|
1463
1573
|
return value.replace(/\/+$/, "");
|
|
@@ -1560,6 +1670,7 @@ function firstDocFile(items) {
|
|
|
1560
1670
|
}
|
|
1561
1671
|
function planDocsTree(navigation, options = {}) {
|
|
1562
1672
|
const apiDir = options.apiDir ?? "api";
|
|
1673
|
+
const headings = (options.sidebar ?? "collapsible") === "headings";
|
|
1563
1674
|
const specs = [];
|
|
1564
1675
|
const apiPages = [];
|
|
1565
1676
|
const apiGroups = [];
|
|
@@ -1607,7 +1718,7 @@ function planDocsTree(navigation, options = {}) {
|
|
|
1607
1718
|
const at = apiGroups.length;
|
|
1608
1719
|
const sub = planApiItems(item.items, childDir);
|
|
1609
1720
|
apiGroups.splice(at, 0, { dir: childDir, title: item.title, children: sub });
|
|
1610
|
-
children.push({ order, folder });
|
|
1721
|
+
children.push({ order, folder, title: item.title });
|
|
1611
1722
|
order += 1;
|
|
1612
1723
|
continue;
|
|
1613
1724
|
}
|
|
@@ -1645,11 +1756,11 @@ function planDocsTree(navigation, options = {}) {
|
|
|
1645
1756
|
title: tab.title,
|
|
1646
1757
|
root: true,
|
|
1647
1758
|
...tab.icon ? { icon: tab.icon } : {},
|
|
1648
|
-
pages: planDocItems(tab.items, tabDir)
|
|
1759
|
+
pages: planDocItems(tab.items, tabDir, true)
|
|
1649
1760
|
}
|
|
1650
1761
|
});
|
|
1651
1762
|
}
|
|
1652
|
-
function planDocItems(items, dir) {
|
|
1763
|
+
function planDocItems(items, dir, tabLevel) {
|
|
1653
1764
|
const entries = [];
|
|
1654
1765
|
for (const item of items) {
|
|
1655
1766
|
if (item.kind === "doc") {
|
|
@@ -1664,10 +1775,18 @@ function planDocsTree(navigation, options = {}) {
|
|
|
1664
1775
|
continue;
|
|
1665
1776
|
}
|
|
1666
1777
|
if (groupDir === dir) {
|
|
1667
|
-
|
|
1778
|
+
if (headings) {
|
|
1779
|
+
entries.push(`---${item.title}---`);
|
|
1780
|
+
}
|
|
1781
|
+
entries.push(...planDocItems(item.items, dir, false));
|
|
1668
1782
|
continue;
|
|
1669
1783
|
}
|
|
1670
|
-
|
|
1784
|
+
const folder = groupDir.slice(dir.length + 1);
|
|
1785
|
+
if (headings && tabLevel) {
|
|
1786
|
+
entries.push(`---${item.title}---`, `...${folder}`);
|
|
1787
|
+
continue;
|
|
1788
|
+
}
|
|
1789
|
+
entries.push(folder);
|
|
1671
1790
|
}
|
|
1672
1791
|
return entries;
|
|
1673
1792
|
}
|
|
@@ -1682,7 +1801,14 @@ function planDocsTree(navigation, options = {}) {
|
|
|
1682
1801
|
}
|
|
1683
1802
|
metas.push({
|
|
1684
1803
|
path: `${groupDir}/meta.json`,
|
|
1685
|
-
content: {
|
|
1804
|
+
content: {
|
|
1805
|
+
title: group.title,
|
|
1806
|
+
// A nested group starts closed in the headings style, whatever the
|
|
1807
|
+
// site's defaultOpenLevel. On a tab-level group the flag is inert:
|
|
1808
|
+
// that folder is extracted, so no folder node renders it.
|
|
1809
|
+
...headings ? { defaultOpen: false } : {},
|
|
1810
|
+
pages: planDocItems(group.items, groupDir, false)
|
|
1811
|
+
}
|
|
1686
1812
|
});
|
|
1687
1813
|
return groupDir;
|
|
1688
1814
|
}
|
|
@@ -2115,10 +2241,67 @@ ${description ? `${description}
|
|
|
2115
2241
|
` : ""}${cleanBody(trimmedBody)}
|
|
2116
2242
|
`;
|
|
2117
2243
|
}
|
|
2244
|
+
function operationHead(operation) {
|
|
2245
|
+
let title;
|
|
2246
|
+
let description;
|
|
2247
|
+
try {
|
|
2248
|
+
const parsed = JSON.parse(operation.source);
|
|
2249
|
+
const exact = parsed.paths?.[operation.route]?.[operation.method.toLowerCase()];
|
|
2250
|
+
const first = Object.values(parsed.paths ?? {}).flatMap((item) => Object.values(item))[0];
|
|
2251
|
+
const named = exact ?? first;
|
|
2252
|
+
title = named?.summary ?? parsed.info?.title;
|
|
2253
|
+
description = named?.description ?? parsed.info?.description;
|
|
2254
|
+
} catch {
|
|
2255
|
+
}
|
|
2256
|
+
const head = [`# ${title ?? "API operation"}`];
|
|
2257
|
+
if (description !== void 0 && description !== "") {
|
|
2258
|
+
head.push("", `> ${description.replace(/\n/g, "\n> ")}`);
|
|
2259
|
+
}
|
|
2260
|
+
return head.join("\n");
|
|
2261
|
+
}
|
|
2262
|
+
function fenceFor(source) {
|
|
2263
|
+
const longest = source.match(/`+/g)?.reduce((max, run) => Math.max(max, run.length), 0) ?? 0;
|
|
2264
|
+
return "`".repeat(Math.max(4, longest + 1));
|
|
2265
|
+
}
|
|
2118
2266
|
function createMarkdownRoute(options) {
|
|
2267
|
+
const requestOrigin = (request) => {
|
|
2268
|
+
const url = new URL(request.url);
|
|
2269
|
+
const proto = request.headers.get("x-forwarded-proto") ?? url.protocol.replace(/:$/, "");
|
|
2270
|
+
const host = request.headers.get("x-forwarded-host") ?? request.headers.get("host") ?? url.host;
|
|
2271
|
+
return `${proto}://${host}`;
|
|
2272
|
+
};
|
|
2273
|
+
const respond = (request, markdown) => {
|
|
2274
|
+
const preamble = options.llmsTxtPath === void 0 ? "" : [
|
|
2275
|
+
"> ## Documentation Index",
|
|
2276
|
+
`> Fetch the complete documentation index at: ${requestOrigin(request)}${options.llmsTxtPath}`,
|
|
2277
|
+
"> Use this file to discover all available pages before exploring further.",
|
|
2278
|
+
"",
|
|
2279
|
+
""
|
|
2280
|
+
].join("\n");
|
|
2281
|
+
return new Response(`${preamble}${markdown}`, {
|
|
2282
|
+
headers: { "content-type": "text/plain; charset=utf-8" }
|
|
2283
|
+
});
|
|
2284
|
+
};
|
|
2119
2285
|
return {
|
|
2120
|
-
async GET(
|
|
2286
|
+
async GET(request, context) {
|
|
2121
2287
|
const { slug } = await context.params;
|
|
2288
|
+
const operation = await options.loadOperationSource?.(slug);
|
|
2289
|
+
if (operation) {
|
|
2290
|
+
const fence = fenceFor(operation.source);
|
|
2291
|
+
return respond(
|
|
2292
|
+
request,
|
|
2293
|
+
[
|
|
2294
|
+
operationHead(operation),
|
|
2295
|
+
"",
|
|
2296
|
+
"## OpenAPI",
|
|
2297
|
+
"",
|
|
2298
|
+
`${fence}json ${operation.file} ${operation.method.toLowerCase()} ${operation.route}`,
|
|
2299
|
+
operation.source.trimEnd(),
|
|
2300
|
+
fence,
|
|
2301
|
+
""
|
|
2302
|
+
].join("\n")
|
|
2303
|
+
);
|
|
2304
|
+
}
|
|
2122
2305
|
const raw = await options.read(slug);
|
|
2123
2306
|
if (raw === null) {
|
|
2124
2307
|
return new Response("Not found", { status: 404 });
|
|
@@ -2132,12 +2315,32 @@ function createMarkdownRoute(options) {
|
|
|
2132
2315
|
if (markdown === null) {
|
|
2133
2316
|
return new Response("Not found", { status: 404 });
|
|
2134
2317
|
}
|
|
2135
|
-
return
|
|
2136
|
-
headers: { "content-type": "text/plain; charset=utf-8" }
|
|
2137
|
-
});
|
|
2318
|
+
return respond(request, markdown);
|
|
2138
2319
|
}
|
|
2139
2320
|
};
|
|
2140
2321
|
}
|
|
2322
|
+
function markdownRewriteTarget(url, options = {}) {
|
|
2323
|
+
const baseUrl = (options.baseUrl ?? "/docs").replace(/\/+$/, "");
|
|
2324
|
+
const markdownBase = (options.markdownBase ?? "/md").replace(/\/+$/, "");
|
|
2325
|
+
const { pathname } = url;
|
|
2326
|
+
if (!pathname.endsWith(".md") || pathname.includes("%")) {
|
|
2327
|
+
return null;
|
|
2328
|
+
}
|
|
2329
|
+
const page = pathname.slice(0, -3);
|
|
2330
|
+
if (page !== baseUrl && !page.startsWith(`${baseUrl}/`)) {
|
|
2331
|
+
return null;
|
|
2332
|
+
}
|
|
2333
|
+
if (page.endsWith("/") || page.includes("//")) {
|
|
2334
|
+
return null;
|
|
2335
|
+
}
|
|
2336
|
+
const target = new URL(url);
|
|
2337
|
+
target.pathname = `${markdownBase}${page.slice(baseUrl.length)}`;
|
|
2338
|
+
return target;
|
|
2339
|
+
}
|
|
2340
|
+
function isMarkdownRouteRequest(url, options = {}) {
|
|
2341
|
+
const markdownBase = options.markdownBase ?? "/md";
|
|
2342
|
+
return url.pathname === markdownBase || url.pathname.startsWith(`${markdownBase}/`);
|
|
2343
|
+
}
|
|
2141
2344
|
|
|
2142
2345
|
// src/core/auth/domains.ts
|
|
2143
2346
|
function isAllowedEmail(email, allowedDomains) {
|
|
@@ -2921,7 +3124,7 @@ var InvalidNavigationError = class extends Error {
|
|
|
2921
3124
|
this.name = "InvalidNavigationError";
|
|
2922
3125
|
}
|
|
2923
3126
|
};
|
|
2924
|
-
function
|
|
3127
|
+
function isRecord2(value) {
|
|
2925
3128
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2926
3129
|
}
|
|
2927
3130
|
function parsePageString(entry) {
|
|
@@ -2944,7 +3147,7 @@ function parseItem(entry, path) {
|
|
|
2944
3147
|
if (typeof entry === "string") {
|
|
2945
3148
|
return parsePageString(entry);
|
|
2946
3149
|
}
|
|
2947
|
-
if (
|
|
3150
|
+
if (isRecord2(entry) && typeof entry["group"] === "string") {
|
|
2948
3151
|
return parseGroup(entry, path);
|
|
2949
3152
|
}
|
|
2950
3153
|
throw new InvalidNavigationError(
|
|
@@ -2969,7 +3172,7 @@ function parseGroup(group, path) {
|
|
|
2969
3172
|
};
|
|
2970
3173
|
}
|
|
2971
3174
|
function parseTab(tab, path) {
|
|
2972
|
-
if (!
|
|
3175
|
+
if (!isRecord2(tab) || typeof tab["tab"] !== "string") {
|
|
2973
3176
|
throw new InvalidNavigationError(`Tab at ${path} is missing a string "tab" title.`);
|
|
2974
3177
|
}
|
|
2975
3178
|
const items = tab["groups"] !== void 0 ? parseGroups(tab["groups"], `${path}.groups`) : parseItems(tab["pages"], `${path}.pages`);
|
|
@@ -2987,18 +3190,18 @@ function parseGroups(groups, path) {
|
|
|
2987
3190
|
}
|
|
2988
3191
|
return groups.map((group, index) => {
|
|
2989
3192
|
const groupPath = `${path}[${String(index)}]`;
|
|
2990
|
-
if (!
|
|
3193
|
+
if (!isRecord2(group)) {
|
|
2991
3194
|
throw new InvalidNavigationError(`Group at ${groupPath} must be an object.`);
|
|
2992
3195
|
}
|
|
2993
3196
|
return parseGroup(group, groupPath);
|
|
2994
3197
|
});
|
|
2995
3198
|
}
|
|
2996
3199
|
function parseNavigation(docsJson) {
|
|
2997
|
-
if (!
|
|
3200
|
+
if (!isRecord2(docsJson)) {
|
|
2998
3201
|
throw new InvalidNavigationError("docs.json must be an object.");
|
|
2999
3202
|
}
|
|
3000
3203
|
const navigation = docsJson["navigation"];
|
|
3001
|
-
if (!
|
|
3204
|
+
if (!isRecord2(navigation)) {
|
|
3002
3205
|
throw new InvalidNavigationError('docs.json must have a "navigation" object.');
|
|
3003
3206
|
}
|
|
3004
3207
|
const tabs = navigation["tabs"];
|
|
@@ -3015,7 +3218,7 @@ var OpenApiMergeError = class extends Error {
|
|
|
3015
3218
|
this.name = "OpenApiMergeError";
|
|
3016
3219
|
}
|
|
3017
3220
|
};
|
|
3018
|
-
function
|
|
3221
|
+
function isRecord3(value) {
|
|
3019
3222
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3020
3223
|
}
|
|
3021
3224
|
function collectServers(inputs, override) {
|
|
@@ -3029,7 +3232,7 @@ function collectServers(inputs, override) {
|
|
|
3029
3232
|
continue;
|
|
3030
3233
|
}
|
|
3031
3234
|
for (const server of servers) {
|
|
3032
|
-
if (
|
|
3235
|
+
if (isRecord3(server) && typeof server["url"] === "string" && !byUrl.has(server["url"])) {
|
|
3033
3236
|
byUrl.set(server["url"], server);
|
|
3034
3237
|
}
|
|
3035
3238
|
}
|
|
@@ -3044,7 +3247,7 @@ function collectTags(inputs) {
|
|
|
3044
3247
|
continue;
|
|
3045
3248
|
}
|
|
3046
3249
|
for (const tag of tags) {
|
|
3047
|
-
if (
|
|
3250
|
+
if (isRecord3(tag) && typeof tag["name"] === "string" && !byName.has(tag["name"])) {
|
|
3048
3251
|
byName.set(tag["name"], tag);
|
|
3049
3252
|
}
|
|
3050
3253
|
}
|
|
@@ -3055,11 +3258,11 @@ function mergeComponents(inputs) {
|
|
|
3055
3258
|
const merged = {};
|
|
3056
3259
|
for (const doc of inputs) {
|
|
3057
3260
|
const components = doc["components"];
|
|
3058
|
-
if (!
|
|
3261
|
+
if (!isRecord3(components)) {
|
|
3059
3262
|
continue;
|
|
3060
3263
|
}
|
|
3061
3264
|
for (const [section, value] of Object.entries(components)) {
|
|
3062
|
-
if (!
|
|
3265
|
+
if (!isRecord3(value)) {
|
|
3063
3266
|
continue;
|
|
3064
3267
|
}
|
|
3065
3268
|
const target = merged[section] ?? (merged[section] = {});
|
|
@@ -3077,12 +3280,12 @@ function assemblePaths(inputs) {
|
|
|
3077
3280
|
const paths = {};
|
|
3078
3281
|
for (const doc of inputs) {
|
|
3079
3282
|
const docPaths = doc["paths"];
|
|
3080
|
-
if (!
|
|
3283
|
+
if (!isRecord3(docPaths)) {
|
|
3081
3284
|
throw new OpenApiMergeError('Each OpenAPI input must have a "paths" object.');
|
|
3082
3285
|
}
|
|
3083
3286
|
const docSecurity = doc["security"];
|
|
3084
3287
|
for (const [route, pathItem] of Object.entries(docPaths)) {
|
|
3085
|
-
if (!
|
|
3288
|
+
if (!isRecord3(pathItem)) {
|
|
3086
3289
|
throw new OpenApiMergeError(`Path item for "${route}" must be an object.`);
|
|
3087
3290
|
}
|
|
3088
3291
|
const target = paths[route] ?? (paths[route] = {});
|
|
@@ -3093,7 +3296,7 @@ function assemblePaths(inputs) {
|
|
|
3093
3296
|
);
|
|
3094
3297
|
}
|
|
3095
3298
|
let resolved = operation;
|
|
3096
|
-
if (HTTP_METHODS2.has(method.toLowerCase()) &&
|
|
3299
|
+
if (HTTP_METHODS2.has(method.toLowerCase()) && isRecord3(operation) && !("security" in operation) && Array.isArray(docSecurity)) {
|
|
3097
3300
|
resolved = { ...operation, security: docSecurity };
|
|
3098
3301
|
}
|
|
3099
3302
|
target[method] = resolved;
|
|
@@ -3104,7 +3307,7 @@ function assemblePaths(inputs) {
|
|
|
3104
3307
|
}
|
|
3105
3308
|
function mergeOpenApiDocuments(inputs, options) {
|
|
3106
3309
|
const records = inputs.map((input, index) => {
|
|
3107
|
-
if (!
|
|
3310
|
+
if (!isRecord3(input)) {
|
|
3108
3311
|
throw new OpenApiMergeError(`OpenAPI input at index ${String(index)} must be an object.`);
|
|
3109
3312
|
}
|
|
3110
3313
|
return input;
|
|
@@ -3119,6 +3322,6 @@ function mergeOpenApiDocuments(inputs, options) {
|
|
|
3119
3322
|
};
|
|
3120
3323
|
}
|
|
3121
3324
|
|
|
3122
|
-
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, defineDocsConfig, isAllowedEmail, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession };
|
|
3123
|
-
//# sourceMappingURL=chunk-
|
|
3124
|
-
//# sourceMappingURL=chunk-
|
|
3325
|
+
export { AI_PROVIDER_MODELS, AI_PROVIDER_NAMES, AiConfigError, DocsConfigError, InvalidNavigationError, OpenApiMergeError, ProxyTargetError, SESSION_COOKIE, assertAllowedTarget, buildLlmsTxt, buildMetadata, buildRobots, buildSearchIndex, buildSessionCookie, buildSitemap, buildThemeCss, clearSessionCookie, createAskAiRoute, createAuthGate, createEmailSignIn, createGoogleAuth, createMarkdownRoute, createSecretSignIn, createSignOut, createSiteAuth, createTryItProxy, createTryItProxyRoute, curlCodeUsage, defineDocsConfig, hasOpenApi, isAllowedEmail, isMarkdownRouteRequest, markdownRewriteTarget, mdxToMarkdown, mergeOpenApiDocuments, openApiOperationToMarkdown, parseNavigation, planDocsTree, readCookie, redirectTarget, resolveAiConfig, searchIndex, signSession, unwrapProxyTarget, validateDocsConfig, verifySession };
|
|
3326
|
+
//# sourceMappingURL=chunk-L4PFRXIK.js.map
|
|
3327
|
+
//# sourceMappingURL=chunk-L4PFRXIK.js.map
|