blodemd 0.0.4 → 0.0.6
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/README.md +12 -1
- package/dev-server/app/[[...slug]]/page.tsx +139 -0
- package/dev-server/app/blodemd-dev/invalidate/route.ts +12 -0
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +32 -0
- package/dev-server/app/blodemd-dev/version/route.ts +14 -0
- package/dev-server/app/blodemd-internal/proxy/route.ts +86 -0
- package/dev-server/app/error.tsx +24 -0
- package/dev-server/app/globals.css +4 -0
- package/dev-server/app/layout.tsx +38 -0
- package/dev-server/app/not-found.tsx +18 -0
- package/dev-server/app/search/route.ts +17 -0
- package/dev-server/components/dev-reload-script.tsx +86 -0
- package/dev-server/components/providers.tsx +15 -0
- package/dev-server/lib/dev-state.ts +8 -0
- package/dev-server/lib/local-content-source.ts +103 -0
- package/dev-server/lib/local-runtime.tsx +558 -0
- package/dev-server/next.config.js +46 -0
- package/dev-server/package.json +57 -0
- package/dev-server/postcss.config.mjs +7 -0
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +49 -0
- package/dist/cli.mjs +299 -26
- package/dist/cli.mjs.map +1 -1
- package/docs/app/globals.css +455 -0
- package/docs/components/api/api-playground.tsx +295 -0
- package/docs/components/api/api-reference.tsx +121 -0
- package/docs/components/content/collection-index.tsx +114 -0
- package/docs/components/docs/contextual-menu.tsx +406 -0
- package/docs/components/docs/copy-page-menu.tsx +255 -0
- package/docs/components/docs/doc-header.tsx +192 -0
- package/docs/components/docs/doc-shell.tsx +289 -0
- package/docs/components/docs/doc-sidebar.tsx +206 -0
- package/docs/components/docs/doc-toc.tsx +45 -0
- package/docs/components/docs/mobile-nav.tsx +207 -0
- package/docs/components/mdx/accordion.tsx +83 -0
- package/docs/components/mdx/badge.tsx +79 -0
- package/docs/components/mdx/callout.tsx +88 -0
- package/docs/components/mdx/card.tsx +104 -0
- package/docs/components/mdx/code-block.tsx +75 -0
- package/docs/components/mdx/code-group.tsx +94 -0
- package/docs/components/mdx/color.tsx +87 -0
- package/docs/components/mdx/columns.tsx +25 -0
- package/docs/components/mdx/expandable.tsx +45 -0
- package/docs/components/mdx/field-layout.tsx +77 -0
- package/docs/components/mdx/frame.tsx +23 -0
- package/docs/components/mdx/get-text-content.ts +18 -0
- package/docs/components/mdx/icon.tsx +56 -0
- package/docs/components/mdx/index.tsx +96 -0
- package/docs/components/mdx/installer.tsx +20 -0
- package/docs/components/mdx/panel.tsx +11 -0
- package/docs/components/mdx/param-field.tsx +56 -0
- package/docs/components/mdx/preview.tsx +36 -0
- package/docs/components/mdx/prompt.tsx +63 -0
- package/docs/components/mdx/request-example.tsx +27 -0
- package/docs/components/mdx/response-field.tsx +42 -0
- package/docs/components/mdx/steps.tsx +92 -0
- package/docs/components/mdx/tabs.tsx +88 -0
- package/docs/components/mdx/tile.tsx +43 -0
- package/docs/components/mdx/tooltip.tsx +71 -0
- package/docs/components/mdx/tree.tsx +120 -0
- package/docs/components/mdx/type-table.tsx +71 -0
- package/docs/components/mdx/update.tsx +44 -0
- package/docs/components/mdx/video.tsx +12 -0
- package/docs/components/mdx/view.tsx +66 -0
- package/docs/components/providers.tsx +15 -0
- package/docs/components/ui/breadcrumb.tsx +92 -0
- package/docs/components/ui/button.tsx +90 -0
- package/docs/components/ui/card.tsx +92 -0
- package/docs/components/ui/command.tsx +139 -0
- package/docs/components/ui/dialog.tsx +97 -0
- package/docs/components/ui/field.tsx +237 -0
- package/docs/components/ui/input.tsx +105 -0
- package/docs/components/ui/label.tsx +22 -0
- package/docs/components/ui/popover.tsx +72 -0
- package/docs/components/ui/search.tsx +380 -0
- package/docs/components/ui/separator.tsx +26 -0
- package/docs/components/ui/sheet.tsx +104 -0
- package/docs/components/ui/sidebar.tsx +433 -0
- package/docs/components/ui/theme-toggle.tsx +62 -0
- package/docs/components/ui/tooltip.tsx +53 -0
- package/docs/lib/contextual-options.ts +193 -0
- package/docs/lib/docs-collection.ts +22 -0
- package/docs/lib/mdx.ts +90 -0
- package/docs/lib/navigation.ts +288 -0
- package/docs/lib/openapi.ts +158 -0
- package/docs/lib/routes.ts +10 -0
- package/docs/lib/server-cache.ts +83 -0
- package/docs/lib/shiki.ts +35 -0
- package/docs/lib/theme.ts +29 -0
- package/docs/lib/toc.ts +2 -0
- package/docs/lib/utils.ts +5 -0
- package/package.json +34 -3
- package/packages/@repo/common/dist/index.d.ts +9 -0
- package/packages/@repo/common/dist/index.d.ts.map +1 -0
- package/packages/@repo/common/dist/index.js +42 -0
- package/packages/@repo/common/package.json +34 -0
- package/packages/@repo/common/src/common.unit.test.ts +55 -0
- package/packages/@repo/common/src/index.ts +51 -0
- package/packages/@repo/contracts/dist/api-key.d.ts +30 -0
- package/packages/@repo/contracts/dist/api-key.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/api-key.js +20 -0
- package/packages/@repo/contracts/dist/dates.d.ts +4 -0
- package/packages/@repo/contracts/dist/dates.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/dates.js +2 -0
- package/packages/@repo/contracts/dist/deployment.d.ts +71 -0
- package/packages/@repo/contracts/dist/deployment.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/deployment.js +46 -0
- package/packages/@repo/contracts/dist/domain.d.ts +94 -0
- package/packages/@repo/contracts/dist/domain.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/domain.js +36 -0
- package/packages/@repo/contracts/dist/ids.d.ts +14 -0
- package/packages/@repo/contracts/dist/ids.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/ids.js +10 -0
- package/packages/@repo/contracts/dist/index.d.ts +10 -0
- package/packages/@repo/contracts/dist/index.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/index.js +11 -0
- package/packages/@repo/contracts/dist/pagination.d.ts +23 -0
- package/packages/@repo/contracts/dist/pagination.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/pagination.js +15 -0
- package/packages/@repo/contracts/dist/project.d.ts +25 -0
- package/packages/@repo/contracts/dist/project.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/project.js +23 -0
- package/packages/@repo/contracts/dist/tenant.d.ts +99 -0
- package/packages/@repo/contracts/dist/tenant.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/tenant.js +36 -0
- package/packages/@repo/contracts/dist/user.d.ts +9 -0
- package/packages/@repo/contracts/dist/user.d.ts.map +1 -0
- package/packages/@repo/contracts/dist/user.js +9 -0
- package/packages/@repo/contracts/package.json +37 -0
- package/packages/@repo/contracts/src/api-key.ts +27 -0
- package/packages/@repo/contracts/src/dates.ts +4 -0
- package/packages/@repo/contracts/src/deployment.ts +73 -0
- package/packages/@repo/contracts/src/domain.ts +51 -0
- package/packages/@repo/contracts/src/ids.ts +22 -0
- package/packages/@repo/contracts/src/index.ts +11 -0
- package/packages/@repo/contracts/src/pagination.ts +21 -0
- package/packages/@repo/contracts/src/project.ts +30 -0
- package/packages/@repo/contracts/src/tenant.ts +54 -0
- package/packages/@repo/contracts/src/user.ts +12 -0
- package/packages/@repo/models/dist/docs-config.d.ts +985 -0
- package/packages/@repo/models/dist/docs-config.d.ts.map +1 -0
- package/packages/@repo/models/dist/docs-config.js +548 -0
- package/packages/@repo/models/dist/index.d.ts +3 -0
- package/packages/@repo/models/dist/index.d.ts.map +1 -0
- package/packages/@repo/models/dist/index.js +3 -0
- package/packages/@repo/models/dist/tenant.d.ts +25 -0
- package/packages/@repo/models/dist/tenant.d.ts.map +1 -0
- package/packages/@repo/models/dist/tenant.js +1 -0
- package/packages/@repo/models/package.json +37 -0
- package/packages/@repo/models/src/docs-config.ts +648 -0
- package/packages/@repo/models/src/index.ts +3 -0
- package/packages/@repo/models/src/tenant.ts +29 -0
- package/packages/@repo/prebuild/dist/index.d.ts +2 -0
- package/packages/@repo/prebuild/dist/index.d.ts.map +1 -0
- package/packages/@repo/prebuild/dist/index.js +2 -0
- package/packages/@repo/prebuild/dist/openapi.d.ts +43 -0
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +1 -0
- package/packages/@repo/prebuild/dist/openapi.js +58 -0
- package/packages/@repo/prebuild/package.json +39 -0
- package/packages/@repo/prebuild/src/index.ts +2 -0
- package/packages/@repo/prebuild/src/openapi.ts +116 -0
- package/packages/@repo/previewing/dist/blob-source.d.ts +16 -0
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +1 -0
- package/packages/@repo/previewing/dist/blob-source.js +110 -0
- package/packages/@repo/previewing/dist/content-source.d.ts +12 -0
- package/packages/@repo/previewing/dist/content-source.d.ts.map +1 -0
- package/packages/@repo/previewing/dist/content-source.js +1 -0
- package/packages/@repo/previewing/dist/fs-source.d.ts +11 -0
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +1 -0
- package/packages/@repo/previewing/dist/fs-source.js +79 -0
- package/packages/@repo/previewing/dist/index.d.ts +120 -0
- package/packages/@repo/previewing/dist/index.d.ts.map +1 -0
- package/packages/@repo/previewing/dist/index.js +984 -0
- package/packages/@repo/previewing/package.json +41 -0
- package/packages/@repo/previewing/src/blob-source.ts +167 -0
- package/packages/@repo/previewing/src/content-source.ts +12 -0
- package/packages/@repo/previewing/src/fs-source.ts +111 -0
- package/packages/@repo/previewing/src/index.ts +1490 -0
- package/packages/@repo/previewing/src/index.unit.test.ts +290 -0
- package/packages/@repo/validation/dist/index.d.ts +12 -0
- package/packages/@repo/validation/dist/index.d.ts.map +1 -0
- package/packages/@repo/validation/dist/index.js +30 -0
- package/packages/@repo/validation/package.json +37 -0
- package/packages/@repo/validation/src/index.ts +59 -0
- package/packages/@repo/validation/src/mintlify-docs-schema.json +5016 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface OpenApiServer {
|
|
2
|
+
url: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OpenApiSpec {
|
|
6
|
+
openapi?: string;
|
|
7
|
+
info?: {
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
servers?: OpenApiServer[];
|
|
12
|
+
paths?: Record<string, Record<string, OpenApiOperationSpec>>;
|
|
13
|
+
components?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface OpenApiOperationSpec {
|
|
16
|
+
operationId?: string;
|
|
17
|
+
summary?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
parameters?: Record<string, unknown>[];
|
|
21
|
+
requestBody?: Record<string, unknown>;
|
|
22
|
+
responses?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface OpenApiOperation {
|
|
25
|
+
id: string;
|
|
26
|
+
method: string;
|
|
27
|
+
path: string;
|
|
28
|
+
summary?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
tags: string[];
|
|
31
|
+
parameters: Record<string, unknown>[];
|
|
32
|
+
requestBody?: Record<string, unknown>;
|
|
33
|
+
responses?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export declare const parseOpenApiSpec: (raw: string, sourcePath?: string) => OpenApiSpec;
|
|
36
|
+
export declare const loadOpenApiSpec: (absolutePath: string) => Promise<OpenApiSpec>;
|
|
37
|
+
export declare const openApiIdentifier: (method: string, routePath: string) => string;
|
|
38
|
+
export declare const openApiSlug: (method: string, routePath: string, directory?: string) => string;
|
|
39
|
+
export declare const extractOpenApiOperations: (spec: OpenApiSpec, directory?: string) => {
|
|
40
|
+
bySlug: Map<string, OpenApiOperation>;
|
|
41
|
+
operations: OpenApiOperation[];
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI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cAAc,MAAM,KACnB,OAAO,CAAC,WAAW,CACmD,CAAC;AAE1E,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,WAC3B,CAAC;AAEzC,eAAO,MAAM,WAAW,GACtB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,kBAAiB,WAUlB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,MAAM,WAAW,EACjB,YAAY,MAAM;;;CA+BnB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { normalizePath, slugify } from "@repo/common";
|
|
4
|
+
import YAML from "yaml";
|
|
5
|
+
export const parseOpenApiSpec = (raw, sourcePath = "") => {
|
|
6
|
+
const ext = path.extname(sourcePath).toLowerCase();
|
|
7
|
+
if (ext === ".json") {
|
|
8
|
+
return JSON.parse(raw);
|
|
9
|
+
}
|
|
10
|
+
if (ext === ".yaml" || ext === ".yml") {
|
|
11
|
+
return YAML.parse(raw);
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(raw);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return YAML.parse(raw);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const loadOpenApiSpec = async (absolutePath) => parseOpenApiSpec(await fs.readFile(absolutePath, "utf8"), absolutePath);
|
|
21
|
+
export const openApiIdentifier = (method, routePath) => `${method.toUpperCase()} ${routePath}`;
|
|
22
|
+
export const openApiSlug = (method, routePath, directory = "api") => {
|
|
23
|
+
const normalized = normalizePath(routePath)
|
|
24
|
+
.split("/")
|
|
25
|
+
.map((segment) => segment.replaceAll(/[{}]/g, ""))
|
|
26
|
+
.filter(Boolean)
|
|
27
|
+
.join("-");
|
|
28
|
+
const base = normalized.length ? normalized : "root";
|
|
29
|
+
const slug = slugify(`${method.toLowerCase()}-${base}`);
|
|
30
|
+
return normalizePath(path.join(directory, slug));
|
|
31
|
+
};
|
|
32
|
+
export const extractOpenApiOperations = (spec, directory) => {
|
|
33
|
+
const ops = [];
|
|
34
|
+
const paths = spec.paths ?? {};
|
|
35
|
+
for (const [routePath, methods] of Object.entries(paths)) {
|
|
36
|
+
for (const [method, operation] of Object.entries(methods)) {
|
|
37
|
+
const upper = method.toUpperCase();
|
|
38
|
+
const id = operation.operationId ?? openApiIdentifier(upper, routePath);
|
|
39
|
+
ops.push({
|
|
40
|
+
description: operation.description,
|
|
41
|
+
id,
|
|
42
|
+
method: upper,
|
|
43
|
+
parameters: operation.parameters ?? [],
|
|
44
|
+
path: routePath,
|
|
45
|
+
requestBody: operation.requestBody,
|
|
46
|
+
responses: operation.responses,
|
|
47
|
+
summary: operation.summary,
|
|
48
|
+
tags: operation.tags ?? [],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const map = new Map();
|
|
53
|
+
for (const op of ops) {
|
|
54
|
+
const slug = openApiSlug(op.method, op.path, directory);
|
|
55
|
+
map.set(slug, op);
|
|
56
|
+
}
|
|
57
|
+
return { bySlug: map, operations: ops };
|
|
58
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@repo/prebuild",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./openapi": {
|
|
14
|
+
"types": "./dist/openapi.d.ts",
|
|
15
|
+
"import": "./dist/openapi.js",
|
|
16
|
+
"default": "./dist/openapi.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "rm -rf dist && tsc",
|
|
21
|
+
"check-types": "tsc --noEmit",
|
|
22
|
+
"lint": "oxlint .",
|
|
23
|
+
"lint:fix": "oxlint --fix .",
|
|
24
|
+
"format": "oxfmt --write .",
|
|
25
|
+
"format:check": "oxfmt ."
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@repo/common": "*",
|
|
29
|
+
"yaml": "^2.8.3"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@repo/typescript-config": "*",
|
|
33
|
+
"@types/node": "^22.19.15",
|
|
34
|
+
"oxfmt": "^0.42.0",
|
|
35
|
+
"oxlint": "^1.57.0",
|
|
36
|
+
"typescript": "6.0.2",
|
|
37
|
+
"ultracite": "^7.3.2"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { normalizePath, slugify } from "@repo/common";
|
|
5
|
+
import YAML from "yaml";
|
|
6
|
+
|
|
7
|
+
export interface OpenApiServer {
|
|
8
|
+
url: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface OpenApiSpec {
|
|
13
|
+
openapi?: string;
|
|
14
|
+
info?: { title?: string; description?: string };
|
|
15
|
+
servers?: OpenApiServer[];
|
|
16
|
+
paths?: Record<string, Record<string, OpenApiOperationSpec>>;
|
|
17
|
+
components?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface OpenApiOperationSpec {
|
|
21
|
+
operationId?: string;
|
|
22
|
+
summary?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
tags?: string[];
|
|
25
|
+
parameters?: Record<string, unknown>[];
|
|
26
|
+
requestBody?: Record<string, unknown>;
|
|
27
|
+
responses?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface OpenApiOperation {
|
|
31
|
+
id: string;
|
|
32
|
+
method: string;
|
|
33
|
+
path: string;
|
|
34
|
+
summary?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
tags: string[];
|
|
37
|
+
parameters: Record<string, unknown>[];
|
|
38
|
+
requestBody?: Record<string, unknown>;
|
|
39
|
+
responses?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const parseOpenApiSpec = (raw: string, sourcePath = ""): OpenApiSpec => {
|
|
43
|
+
const ext = path.extname(sourcePath).toLowerCase();
|
|
44
|
+
|
|
45
|
+
if (ext === ".json") {
|
|
46
|
+
return JSON.parse(raw) as OpenApiSpec;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (ext === ".yaml" || ext === ".yml") {
|
|
50
|
+
return YAML.parse(raw) as OpenApiSpec;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(raw) as OpenApiSpec;
|
|
55
|
+
} catch {
|
|
56
|
+
return YAML.parse(raw) as OpenApiSpec;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const loadOpenApiSpec = async (
|
|
61
|
+
absolutePath: string
|
|
62
|
+
): Promise<OpenApiSpec> =>
|
|
63
|
+
parseOpenApiSpec(await fs.readFile(absolutePath, "utf8"), absolutePath);
|
|
64
|
+
|
|
65
|
+
export const openApiIdentifier = (method: string, routePath: string) =>
|
|
66
|
+
`${method.toUpperCase()} ${routePath}`;
|
|
67
|
+
|
|
68
|
+
export const openApiSlug = (
|
|
69
|
+
method: string,
|
|
70
|
+
routePath: string,
|
|
71
|
+
directory = "api"
|
|
72
|
+
) => {
|
|
73
|
+
const normalized = normalizePath(routePath)
|
|
74
|
+
.split("/")
|
|
75
|
+
.map((segment) => segment.replaceAll(/[{}]/g, ""))
|
|
76
|
+
.filter(Boolean)
|
|
77
|
+
.join("-");
|
|
78
|
+
const base = normalized.length ? normalized : "root";
|
|
79
|
+
const slug = slugify(`${method.toLowerCase()}-${base}`);
|
|
80
|
+
return normalizePath(path.join(directory, slug));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const extractOpenApiOperations = (
|
|
84
|
+
spec: OpenApiSpec,
|
|
85
|
+
directory?: string
|
|
86
|
+
) => {
|
|
87
|
+
const ops: OpenApiOperation[] = [];
|
|
88
|
+
const paths = spec.paths ?? {};
|
|
89
|
+
|
|
90
|
+
for (const [routePath, methods] of Object.entries(paths)) {
|
|
91
|
+
for (const [method, operation] of Object.entries(methods)) {
|
|
92
|
+
const upper = method.toUpperCase();
|
|
93
|
+
const id = operation.operationId ?? openApiIdentifier(upper, routePath);
|
|
94
|
+
|
|
95
|
+
ops.push({
|
|
96
|
+
description: operation.description,
|
|
97
|
+
id,
|
|
98
|
+
method: upper,
|
|
99
|
+
parameters: operation.parameters ?? [],
|
|
100
|
+
path: routePath,
|
|
101
|
+
requestBody: operation.requestBody,
|
|
102
|
+
responses: operation.responses,
|
|
103
|
+
summary: operation.summary,
|
|
104
|
+
tags: operation.tags ?? [],
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const map = new Map<string, OpenApiOperation>();
|
|
110
|
+
for (const op of ops) {
|
|
111
|
+
const slug = openApiSlug(op.method, op.path, directory);
|
|
112
|
+
map.set(slug, op);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return { bySlug: map, operations: ops };
|
|
116
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CompiledMdxResult, ContentSource } from "./content-source.js";
|
|
2
|
+
export declare class BlobContentSource implements ContentSource {
|
|
3
|
+
private readonly manifestUrl;
|
|
4
|
+
private readonly cacheTag?;
|
|
5
|
+
private manifestPromise?;
|
|
6
|
+
constructor(manifestUrl: string, cacheTag?: string);
|
|
7
|
+
private getFetchOptions;
|
|
8
|
+
private loadManifest;
|
|
9
|
+
readFile(relativePath: string): Promise<string>;
|
|
10
|
+
listFiles(directory: string): Promise<string[]>;
|
|
11
|
+
exists(relativePath: string): Promise<boolean>;
|
|
12
|
+
resolveUrl(relativePath: string): Promise<string | null>;
|
|
13
|
+
readCompiledMdx(relativePath: string): Promise<CompiledMdxResult | null>;
|
|
14
|
+
}
|
|
15
|
+
export declare const createBlobSource: (manifestUrl: string, cacheTag?: string) => ContentSource;
|
|
16
|
+
//# sourceMappingURL=blob-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob-source.d.ts","sourceRoot":"","sources":["../src/blob-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA8C5E,qBAAa,iBAAkB,YAAW,aAAa;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IACnC,OAAO,CAAC,eAAe,CAAC,CAA+B;gBAE3C,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAKlD,OAAO,CAAC,eAAe;YAaT,YAAY;IA2BpB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAc/C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAY/C,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK9C,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAKxD,eAAe,CACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAuBrC;AAED,eAAO,MAAM,gBAAgB,GAC3B,aAAa,MAAM,EACnB,WAAW,MAAM,KAChB,aAA6D,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { normalizePath } from "@repo/common";
|
|
3
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
4
|
+
const isBlobManifest = (value) => {
|
|
5
|
+
if (!isRecord(value) || !Array.isArray(value.files)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return value.files.every((file) => {
|
|
9
|
+
if (!isRecord(file)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return typeof file.path === "string" && typeof file.url === "string";
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const normalizeDirectory = (directory) => {
|
|
16
|
+
const normalized = normalizePath(path.posix.normalize(directory));
|
|
17
|
+
if (!normalized || normalized === ".") {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
return normalized ? `${normalized}/` : "";
|
|
21
|
+
};
|
|
22
|
+
const normalizeRelativePath = (value) => normalizePath(path.posix.normalize(value));
|
|
23
|
+
export class BlobContentSource {
|
|
24
|
+
manifestUrl;
|
|
25
|
+
cacheTag;
|
|
26
|
+
manifestPromise;
|
|
27
|
+
constructor(manifestUrl, cacheTag) {
|
|
28
|
+
this.manifestUrl = manifestUrl;
|
|
29
|
+
this.cacheTag = cacheTag;
|
|
30
|
+
}
|
|
31
|
+
getFetchOptions() {
|
|
32
|
+
if (!this.cacheTag) {
|
|
33
|
+
return { cache: "no-store" };
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
next: {
|
|
37
|
+
revalidate: 3600,
|
|
38
|
+
tags: [this.cacheTag],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async loadManifest() {
|
|
43
|
+
if (!this.manifestPromise) {
|
|
44
|
+
this.manifestPromise = (async () => {
|
|
45
|
+
const response = await fetch(this.manifestUrl, this.getFetchOptions());
|
|
46
|
+
if (!response.ok) {
|
|
47
|
+
throw new Error(`Failed to load deployment manifest: ${response.status}`);
|
|
48
|
+
}
|
|
49
|
+
const manifest = (await response.json());
|
|
50
|
+
if (!isBlobManifest(manifest)) {
|
|
51
|
+
throw new Error("Deployment manifest is invalid.");
|
|
52
|
+
}
|
|
53
|
+
return new Map(manifest.files.map((file) => [
|
|
54
|
+
normalizeRelativePath(file.path),
|
|
55
|
+
file.url,
|
|
56
|
+
]));
|
|
57
|
+
})();
|
|
58
|
+
}
|
|
59
|
+
return await this.manifestPromise;
|
|
60
|
+
}
|
|
61
|
+
async readFile(relativePath) {
|
|
62
|
+
const url = await this.resolveUrl(relativePath);
|
|
63
|
+
if (!url) {
|
|
64
|
+
throw new Error(`Content file "${relativePath}" not found.`);
|
|
65
|
+
}
|
|
66
|
+
const response = await fetch(url, this.getFetchOptions());
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
throw new Error(`Failed to load content file: ${response.status}`);
|
|
69
|
+
}
|
|
70
|
+
return await response.text();
|
|
71
|
+
}
|
|
72
|
+
async listFiles(directory) {
|
|
73
|
+
const manifest = await this.loadManifest();
|
|
74
|
+
const prefix = normalizeDirectory(directory);
|
|
75
|
+
const files = [...manifest.keys()].filter((file) => prefix ? file.startsWith(prefix) : true);
|
|
76
|
+
// oxlint-disable-next-line eslint-plugin-unicorn/no-array-sort
|
|
77
|
+
files.sort();
|
|
78
|
+
return files;
|
|
79
|
+
}
|
|
80
|
+
async exists(relativePath) {
|
|
81
|
+
const manifest = await this.loadManifest();
|
|
82
|
+
return manifest.has(normalizeRelativePath(relativePath));
|
|
83
|
+
}
|
|
84
|
+
async resolveUrl(relativePath) {
|
|
85
|
+
const manifest = await this.loadManifest();
|
|
86
|
+
return manifest.get(normalizeRelativePath(relativePath)) ?? null;
|
|
87
|
+
}
|
|
88
|
+
async readCompiledMdx(relativePath) {
|
|
89
|
+
const compiledPath = `_compiled/${normalizeRelativePath(relativePath)}.json`;
|
|
90
|
+
const url = await this.resolveUrl(compiledPath);
|
|
91
|
+
if (!url) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const response = await fetch(url, this.getFetchOptions());
|
|
96
|
+
if (!response.ok) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
const data = (await response.json());
|
|
100
|
+
if (!data.compiledSource || data.version !== 1) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
return data;
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export const createBlobSource = (manifestUrl, cacheTag) => new BlobContentSource(manifestUrl, cacheTag);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CompiledMdxResult {
|
|
2
|
+
compiledSource: string;
|
|
3
|
+
version: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ContentSource {
|
|
6
|
+
readFile(relativePath: string): Promise<string>;
|
|
7
|
+
listFiles(directory: string): Promise<string[]>;
|
|
8
|
+
exists(relativePath: string): Promise<boolean>;
|
|
9
|
+
resolveUrl?(relativePath: string): Promise<string | null> | string | null;
|
|
10
|
+
readCompiledMdx?(relativePath: string): Promise<CompiledMdxResult | null>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=content-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-source.d.ts","sourceRoot":"","sources":["../src/content-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,UAAU,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1E,eAAe,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ContentSource } from "./content-source.js";
|
|
2
|
+
export declare class FsContentSource implements ContentSource {
|
|
3
|
+
private readonly root;
|
|
4
|
+
constructor(root: string);
|
|
5
|
+
readFile(relativePath: string): Promise<string>;
|
|
6
|
+
listFiles(directory: string): Promise<string[]>;
|
|
7
|
+
exists(relativePath: string): Promise<boolean>;
|
|
8
|
+
resolveUrl(): string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const createFsSource: (root: string) => ContentSource;
|
|
11
|
+
//# sourceMappingURL=fs-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-source.d.ts","sourceRoot":"","sources":["../src/fs-source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoEzD,qBAAa,eAAgB,YAAW,aAAa;IACnD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,IAAI,EAAE,MAAM;IAIlB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO/C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/C,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAapD,UAAU,IAAI,MAAM,GAAG,IAAI;CAG5B;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,aACnB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { normalizePath } from "@repo/common";
|
|
4
|
+
const IGNORED_DIRECTORIES = new Set([
|
|
5
|
+
"app",
|
|
6
|
+
"components",
|
|
7
|
+
"content",
|
|
8
|
+
"lib",
|
|
9
|
+
"node_modules",
|
|
10
|
+
"public",
|
|
11
|
+
]);
|
|
12
|
+
const IGNORED_ROOT_FILES = new Set(["AGENTS.md", "README.md"]);
|
|
13
|
+
const isNotFoundError = (error) => Boolean(error &&
|
|
14
|
+
typeof error === "object" &&
|
|
15
|
+
"code" in error &&
|
|
16
|
+
error.code === "ENOENT");
|
|
17
|
+
const isWithinRoot = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path.sep}`);
|
|
18
|
+
const resolveWithinRoot = (root, relativePath) => {
|
|
19
|
+
const normalized = normalizePath(relativePath);
|
|
20
|
+
const absolutePath = path.resolve(root, normalized);
|
|
21
|
+
if (!isWithinRoot(root, absolutePath)) {
|
|
22
|
+
throw new Error(`Path "${relativePath}" escapes the content source root.`);
|
|
23
|
+
}
|
|
24
|
+
return absolutePath;
|
|
25
|
+
};
|
|
26
|
+
const walkFiles = async (directory, prefix) => {
|
|
27
|
+
const entries = await fs.readdir(directory, { withFileTypes: true });
|
|
28
|
+
const files = [];
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
if (entry.name.startsWith(".")) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const absolutePath = path.join(directory, entry.name);
|
|
34
|
+
const relativePath = prefix ? path.join(prefix, entry.name) : entry.name;
|
|
35
|
+
if (entry.isDirectory()) {
|
|
36
|
+
if (IGNORED_DIRECTORIES.has(entry.name)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
files.push(...(await walkFiles(absolutePath, relativePath)));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (entry.isFile()) {
|
|
43
|
+
if (!prefix && IGNORED_ROOT_FILES.has(entry.name)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
files.push(normalizePath(relativePath));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return files;
|
|
50
|
+
};
|
|
51
|
+
export class FsContentSource {
|
|
52
|
+
root;
|
|
53
|
+
constructor(root) {
|
|
54
|
+
this.root = path.resolve(root);
|
|
55
|
+
}
|
|
56
|
+
async readFile(relativePath) {
|
|
57
|
+
return await fs.readFile(resolveWithinRoot(this.root, relativePath), "utf8");
|
|
58
|
+
}
|
|
59
|
+
async listFiles(directory) {
|
|
60
|
+
return await walkFiles(resolveWithinRoot(this.root, directory), "");
|
|
61
|
+
}
|
|
62
|
+
async exists(relativePath) {
|
|
63
|
+
try {
|
|
64
|
+
await fs.access(resolveWithinRoot(this.root, relativePath));
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (isNotFoundError(error)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// oxlint-disable-next-line eslint/class-methods-use-this
|
|
75
|
+
resolveUrl() {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export const createFsSource = (root) => new FsContentSource(root);
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { ContentType, DocsOpenApiSource, FrontmatterByType, PageMode, SiteConfig } from "@repo/models";
|
|
2
|
+
import type { OpenApiOperation, OpenApiSpec } from "@repo/prebuild";
|
|
3
|
+
import type { ContentSource } from "./content-source.js";
|
|
4
|
+
export { BlobContentSource, createBlobSource } from "./blob-source.js";
|
|
5
|
+
export { createFsSource, FsContentSource } from "./fs-source.js";
|
|
6
|
+
export type { CompiledMdxResult, ContentSource } from "./content-source.js";
|
|
7
|
+
export declare const PREBUILT_INDEX_PATH = "_content-index.json";
|
|
8
|
+
export declare const PREBUILT_OPENAPI_INDEX_PATH = "_openapi-index.json";
|
|
9
|
+
export declare const PREBUILT_SEARCH_INDEX_PATH = "_search-index.json";
|
|
10
|
+
export declare const PREBUILT_TOC_INDEX_PATH = "_toc-index.json";
|
|
11
|
+
export declare const PREBUILT_UTILITY_INDEX_PATH = "_utility-index.json";
|
|
12
|
+
export declare const PREBUILT_UTILITY_SITEMAP_PATH = "_utility/sitemap.xml";
|
|
13
|
+
export declare const PREBUILT_UTILITY_LLMS_PATH = "_utility/llms.txt";
|
|
14
|
+
export declare const PREBUILT_UTILITY_LLMS_FULL_PATH = "_utility/llms-full.txt";
|
|
15
|
+
export declare const UTILITY_DOCS_ROOT_TOKEN = "__BLODEMD_DOCS_ROOT__";
|
|
16
|
+
export type SiteConfigResult = {
|
|
17
|
+
ok: true;
|
|
18
|
+
config: SiteConfig;
|
|
19
|
+
warnings: string[];
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
errors: string[];
|
|
23
|
+
};
|
|
24
|
+
export type ContentEntry = {
|
|
25
|
+
kind: "entry";
|
|
26
|
+
slug: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
type: ContentType;
|
|
31
|
+
collectionId: string;
|
|
32
|
+
sourcePath: string;
|
|
33
|
+
relativePath: string;
|
|
34
|
+
frontmatter: FrontmatterByType[ContentType];
|
|
35
|
+
} | {
|
|
36
|
+
kind: "index";
|
|
37
|
+
slug: string;
|
|
38
|
+
title: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
type: ContentType;
|
|
41
|
+
collectionId: string;
|
|
42
|
+
};
|
|
43
|
+
export interface ContentIndex {
|
|
44
|
+
entries: ContentEntry[];
|
|
45
|
+
bySlug: Map<string, ContentEntry>;
|
|
46
|
+
byCollection: Map<string, ContentEntry[]>;
|
|
47
|
+
errors: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface PageMetadata {
|
|
50
|
+
title?: string;
|
|
51
|
+
sidebarTitle?: string;
|
|
52
|
+
icon?: string;
|
|
53
|
+
iconType?: string;
|
|
54
|
+
tag?: string;
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
deprecated?: boolean;
|
|
57
|
+
url?: string;
|
|
58
|
+
mode?: PageMode;
|
|
59
|
+
noindex?: boolean;
|
|
60
|
+
hideFooterPagination?: boolean;
|
|
61
|
+
hideApiMarker?: boolean;
|
|
62
|
+
keywords?: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface SearchIndexItem {
|
|
65
|
+
href?: string;
|
|
66
|
+
title: string;
|
|
67
|
+
path: string;
|
|
68
|
+
}
|
|
69
|
+
export interface TocItem {
|
|
70
|
+
id: string;
|
|
71
|
+
level: number;
|
|
72
|
+
title: string;
|
|
73
|
+
}
|
|
74
|
+
export interface UtilityPage {
|
|
75
|
+
content: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
slug: string;
|
|
78
|
+
title: string;
|
|
79
|
+
}
|
|
80
|
+
export interface UtilityIndex {
|
|
81
|
+
description?: string;
|
|
82
|
+
name: string;
|
|
83
|
+
pages: UtilityPage[];
|
|
84
|
+
}
|
|
85
|
+
export interface UtilityArtifact {
|
|
86
|
+
content: string;
|
|
87
|
+
contentType: string;
|
|
88
|
+
path: string;
|
|
89
|
+
}
|
|
90
|
+
export interface PrebuiltOpenApiEntry {
|
|
91
|
+
identifier: string;
|
|
92
|
+
operation: OpenApiOperation;
|
|
93
|
+
slug: string;
|
|
94
|
+
source: DocsOpenApiSource;
|
|
95
|
+
sourceKey: string;
|
|
96
|
+
spec: OpenApiSpec;
|
|
97
|
+
}
|
|
98
|
+
export declare const buildPageMetadataMap: (index: ContentIndex) => Map<string, PageMetadata>;
|
|
99
|
+
export declare const loadSiteConfig: (source: ContentSource) => Promise<SiteConfigResult>;
|
|
100
|
+
export declare const loadContentSource: (source: ContentSource, relativePath: string) => Promise<string>;
|
|
101
|
+
export declare const buildContentIndex: (source: ContentSource, config: SiteConfig) => Promise<ContentIndex>;
|
|
102
|
+
export declare const extractToc: (source: string) => TocItem[];
|
|
103
|
+
export declare const formatMarkdownPage: (title: string, source: string) => string;
|
|
104
|
+
export declare const formatMarkdownPageSection: (title: string, url: string, source: string) => string;
|
|
105
|
+
export declare const buildSearchIndex: (index: ContentIndex, config: SiteConfig, utilityIndex?: UtilityIndex) => SearchIndexItem[];
|
|
106
|
+
export declare const buildUtilityIndex: (index: ContentIndex, source: ContentSource, config: SiteConfig) => Promise<UtilityIndex>;
|
|
107
|
+
export declare const getPrebuiltUtilityLlmPagePath: (slug: string) => string;
|
|
108
|
+
export declare const buildUtilityArtifacts: (index: UtilityIndex) => UtilityArtifact[];
|
|
109
|
+
export declare const buildTocIndex: (index: ContentIndex, source: ContentSource) => Promise<Map<string, TocItem[]>>;
|
|
110
|
+
export declare const serializeContentIndex: (index: ContentIndex) => string;
|
|
111
|
+
export declare const serializeOpenApiIndex: (entries: PrebuiltOpenApiEntry[]) => string;
|
|
112
|
+
export declare const loadPrebuiltContentIndex: (source: ContentSource) => Promise<ContentIndex | null>;
|
|
113
|
+
export declare const loadPrebuiltOpenApiIndex: (source: ContentSource) => Promise<PrebuiltOpenApiEntry[] | null>;
|
|
114
|
+
export declare const serializeSearchIndex: (items: SearchIndexItem[]) => string;
|
|
115
|
+
export declare const loadPrebuiltSearchIndex: (source: ContentSource) => Promise<SearchIndexItem[] | null>;
|
|
116
|
+
export declare const serializeTocIndex: (itemsBySlug: Map<string, TocItem[]>) => string;
|
|
117
|
+
export declare const loadPrebuiltTocIndex: (source: ContentSource) => Promise<Map<string, TocItem[]> | null>;
|
|
118
|
+
export declare const serializeUtilityIndex: (index: UtilityIndex) => string;
|
|
119
|
+
export declare const loadPrebuiltUtilityIndex: (source: ContentSource) => Promise<UtilityIndex | null>;
|
|
120
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EAEjB,QAAQ,EACR,UAAU,EACX,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,WA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