fumadocs-openapi 9.3.12 → 9.3.13
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.
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { PageTree } from 'fumadocs-core/server';
|
|
2
|
-
import type { PageFile, PageTreeTransformer } from 'fumadocs-core/source';
|
|
2
|
+
import type { LoaderPlugin, PageFile, PageTreeTransformer } from 'fumadocs-core/source';
|
|
3
3
|
/**
|
|
4
|
-
* Source API
|
|
4
|
+
* Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function openapiPlugin(): LoaderPlugin;
|
|
7
|
+
/**
|
|
8
|
+
* Source API Integration, add this to page tree builder options.
|
|
5
9
|
*
|
|
6
|
-
*
|
|
10
|
+
* @deprecated use `openapiPlugin()`
|
|
7
11
|
*/
|
|
8
12
|
export declare const attachFile: (node: PageTree.Item, file: PageFile | undefined) => PageTree.Item;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated use `openapiPlugin()`
|
|
15
|
+
*/
|
|
9
16
|
export declare function transformerOpenAPI(): PageTreeTransformer;
|
|
10
17
|
//# sourceMappingURL=source-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,CAkC5C;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,CAAC,IAAI,EACnB,MAAM,QAAQ,GAAG,SAAS,KACzB,QAAQ,CAAC,IA4BX,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,mBAAmB,CAExD"}
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MethodLabel } from '../ui/components/method-label.js';
|
|
3
3
|
/**
|
|
4
|
-
* Source API
|
|
4
|
+
* Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
|
|
5
|
+
*/
|
|
6
|
+
export function openapiPlugin() {
|
|
7
|
+
return {
|
|
8
|
+
transformPageTree: {
|
|
9
|
+
file(node, filePath) {
|
|
10
|
+
if (!filePath)
|
|
11
|
+
return node;
|
|
12
|
+
const file = this.storage.read(filePath);
|
|
13
|
+
if (!file || file.format !== 'page')
|
|
14
|
+
return node;
|
|
15
|
+
const data = file.data;
|
|
16
|
+
let method;
|
|
17
|
+
if ('_openapi' in data && typeof data._openapi === 'object') {
|
|
18
|
+
const meta = data._openapi;
|
|
19
|
+
method = meta.method;
|
|
20
|
+
}
|
|
21
|
+
if (method) {
|
|
22
|
+
node.name = (_jsxs(_Fragment, { children: [node.name, ' ', _jsx(MethodLabel, { className: "ms-auto text-xs text-nowrap", children: method })] }));
|
|
23
|
+
}
|
|
24
|
+
return node;
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Source API Integration, add this to page tree builder options.
|
|
5
31
|
*
|
|
6
|
-
*
|
|
32
|
+
* @deprecated use `openapiPlugin()`
|
|
7
33
|
*/
|
|
8
34
|
export const attachFile = (node, file) => {
|
|
9
35
|
if (!file)
|
|
@@ -22,13 +48,9 @@ export const attachFile = (node, file) => {
|
|
|
22
48
|
}
|
|
23
49
|
return node;
|
|
24
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated use `openapiPlugin()`
|
|
53
|
+
*/
|
|
25
54
|
export function transformerOpenAPI() {
|
|
26
|
-
return
|
|
27
|
-
file(node, file) {
|
|
28
|
-
if (!file)
|
|
29
|
-
return node;
|
|
30
|
-
const content = this.storage.read(file);
|
|
31
|
-
return attachFile(node, content?.format === 'page' ? content : undefined);
|
|
32
|
-
},
|
|
33
|
-
};
|
|
55
|
+
return openapiPlugin().transformPageTree;
|
|
34
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.13",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
51
51
|
"@radix-ui/react-select": "^2.2.6",
|
|
52
52
|
"@radix-ui/react-slot": "^1.2.3",
|
|
53
|
-
"@scalar/json-magic": "^0.5.
|
|
54
|
-
"@scalar/openapi-parser": "0.21.
|
|
53
|
+
"@scalar/json-magic": "^0.5.2",
|
|
54
|
+
"@scalar/openapi-parser": "0.21.2",
|
|
55
55
|
"ajv": "^8.17.1",
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
57
|
"github-slugger": "^2.0.0",
|
|
@@ -65,15 +65,15 @@
|
|
|
65
65
|
"remark-rehype": "^11.1.2",
|
|
66
66
|
"tinyglobby": "^0.2.15",
|
|
67
67
|
"xml-js": "^1.6.11",
|
|
68
|
-
"fumadocs-core": "15.8.
|
|
69
|
-
"fumadocs-ui": "15.8.
|
|
68
|
+
"fumadocs-core": "15.8.1",
|
|
69
|
+
"fumadocs-ui": "15.8.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@scalar/api-client-react": "^1.3.
|
|
72
|
+
"@scalar/api-client-react": "^1.3.41",
|
|
73
73
|
"@types/js-yaml": "^4.0.9",
|
|
74
74
|
"@types/node": "24.5.2",
|
|
75
75
|
"@types/openapi-sampler": "^1.0.3",
|
|
76
|
-
"@types/react": "^19.1.
|
|
76
|
+
"@types/react": "^19.1.14",
|
|
77
77
|
"json-schema-typed": "^8.0.1",
|
|
78
78
|
"openapi-types": "^12.1.3",
|
|
79
79
|
"tailwindcss": "^4.1.13",
|