fumadocs-openapi 10.3.4 → 10.3.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/css/generated/shared.css +5 -0
- package/dist/_openapi/types.d.ts +880 -0
- package/dist/index.d.ts +2 -2
- package/dist/playground/client.js +4 -3
- package/dist/playground/components/oauth-dialog.js +19 -7
- package/dist/playground/components/server-select.js +36 -27
- package/dist/requests/media/encode.js +26 -29
- package/dist/server/create.d.ts +2 -2
- package/dist/types.d.ts +18 -14
- package/dist/ui/api-page.d.ts +3 -4
- package/dist/ui/api-page.js +7 -3
- package/dist/ui/base.js +0 -3
- package/dist/ui/contexts/api.js +22 -14
- package/dist/ui/contexts/api.lazy.js +2 -1
- package/dist/ui/operation/index.js +11 -5
- package/dist/ui/operation/request-tabs.js +5 -4
- package/dist/utils/pages/preset-auto.js +2 -2
- package/dist/utils/process-document.d.ts +2 -3
- package/dist/utils/process-document.js +3 -2
- package/dist/utils/schema.d.ts +0 -1
- package/dist/utils/schema.js +4 -1
- package/package.json +14 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { dereference
|
|
1
|
+
import { dereference } from "@scalar/openapi-parser";
|
|
2
2
|
import { bundle } from "@scalar/json-magic/bundle";
|
|
3
|
+
import { upgrade } from "@scalar/openapi-upgrader";
|
|
3
4
|
import { fetchUrls, readFiles } from "@scalar/json-magic/bundle/plugins/node";
|
|
4
5
|
|
|
5
6
|
//#region src/utils/process-document.ts
|
|
@@ -14,7 +15,7 @@ async function processDocument(input) {
|
|
|
14
15
|
hooks: { onResolveError(node) {
|
|
15
16
|
throw new Error(`Failed to resolve ${node.$ref}`);
|
|
16
17
|
} }
|
|
17
|
-
}).then((v) => upgrade(v
|
|
18
|
+
}).then((v) => upgrade(v, "3.2")).catch((e) => {
|
|
18
19
|
throw new Error(`[OpenAPI] Failed to resolve input: ${input}`, { cause: e });
|
|
19
20
|
});
|
|
20
21
|
/**
|
package/dist/utils/schema.d.ts
CHANGED
package/dist/utils/schema.js
CHANGED
|
@@ -14,7 +14,9 @@ function getPreferredType(body) {
|
|
|
14
14
|
return Object.keys(body)[0];
|
|
15
15
|
}
|
|
16
16
|
function getTagDisplayName(tag) {
|
|
17
|
-
|
|
17
|
+
if ("x-displayName" in tag && typeof tag["x-displayName"] === "string") return tag["x-displayName"];
|
|
18
|
+
if (tag.summary) return tag.summary;
|
|
19
|
+
return idToTitle(tag.name);
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Summarize method endpoint information
|
|
@@ -24,6 +26,7 @@ function createMethod(method, path, operation) {
|
|
|
24
26
|
description: path.description,
|
|
25
27
|
summary: path.summary,
|
|
26
28
|
...operation,
|
|
29
|
+
servers: operation.servers ?? path.servers,
|
|
27
30
|
parameters: [...operation.parameters ?? [], ...path.parameters ?? []],
|
|
28
31
|
method: method.toUpperCase()
|
|
29
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.6",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -61,37 +61,37 @@
|
|
|
61
61
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
62
62
|
"@radix-ui/react-select": "^2.2.6",
|
|
63
63
|
"@radix-ui/react-slot": "^1.2.4",
|
|
64
|
-
"@scalar/json-magic": "^0.
|
|
65
|
-
"@scalar/openapi-parser": "0.24.
|
|
66
|
-
"
|
|
64
|
+
"@scalar/json-magic": "^0.11.1",
|
|
65
|
+
"@scalar/openapi-parser": "0.24.10",
|
|
66
|
+
"@scalar/openapi-upgrader": "^0.1.8",
|
|
67
|
+
"ajv": "^8.18.0",
|
|
67
68
|
"class-variance-authority": "^0.7.1",
|
|
68
69
|
"github-slugger": "^2.0.0",
|
|
69
70
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
70
71
|
"js-yaml": "^4.1.1",
|
|
71
|
-
"lucide-react": "^0.
|
|
72
|
+
"lucide-react": "^0.570.0",
|
|
72
73
|
"next-themes": "^0.4.6",
|
|
73
|
-
"openapi-sampler": "^1.
|
|
74
|
+
"openapi-sampler": "^1.7.0",
|
|
74
75
|
"react-hook-form": "^7.71.1",
|
|
75
76
|
"remark": "^15.0.1",
|
|
76
77
|
"remark-rehype": "^11.1.2",
|
|
77
|
-
"tailwind-merge": "^3.4.
|
|
78
|
+
"tailwind-merge": "^3.4.1",
|
|
78
79
|
"xml-js": "^1.6.11",
|
|
79
80
|
"@fumari/stf": "^0.0.3"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@scalar/api-client-react": "^1.3.
|
|
83
|
+
"@scalar/api-client-react": "^1.3.96",
|
|
83
84
|
"@types/js-yaml": "^4.0.9",
|
|
84
|
-
"@types/node": "25.2.
|
|
85
|
+
"@types/node": "25.2.3",
|
|
85
86
|
"@types/openapi-sampler": "^1.0.3",
|
|
86
|
-
"@types/react": "^19.2.
|
|
87
|
+
"@types/react": "^19.2.14",
|
|
87
88
|
"json-schema-typed": "^8.0.2",
|
|
88
|
-
"openapi-types": "^12.1.3",
|
|
89
89
|
"tailwindcss": "^4.1.18",
|
|
90
90
|
"tsdown": "^0.20.3",
|
|
91
91
|
"@fumadocs/tailwind": "0.0.2",
|
|
92
92
|
"eslint-config-custom": "0.0.0",
|
|
93
|
-
"fumadocs-core": "16.
|
|
94
|
-
"fumadocs-ui": "16.
|
|
93
|
+
"fumadocs-core": "16.6.3",
|
|
94
|
+
"fumadocs-ui": "16.6.3",
|
|
95
95
|
"tsconfig": "0.0.0"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
"fumadocs-core": "^16.5.0",
|
|
101
101
|
"fumadocs-ui": "^16.5.0",
|
|
102
102
|
"json-schema-typed": "*",
|
|
103
|
-
"openapi-types": "*",
|
|
104
103
|
"react": "^19.2.0",
|
|
105
104
|
"react-dom": "^19.2.0"
|
|
106
105
|
},
|
|
@@ -108,9 +107,6 @@
|
|
|
108
107
|
"json-schema-typed": {
|
|
109
108
|
"optional": true
|
|
110
109
|
},
|
|
111
|
-
"openapi-types": {
|
|
112
|
-
"optional": true
|
|
113
|
-
},
|
|
114
110
|
"@types/react": {
|
|
115
111
|
"optional": true
|
|
116
112
|
},
|
|
@@ -121,7 +117,7 @@
|
|
|
121
117
|
"scripts": {
|
|
122
118
|
"build": "tsdown --config-loader unrun",
|
|
123
119
|
"clean": "rimraf dist",
|
|
124
|
-
"dev": "tsdown --watch",
|
|
120
|
+
"dev": "tsdown --watch --clean false",
|
|
125
121
|
"lint": "eslint .",
|
|
126
122
|
"types:check": "tsc --noEmit"
|
|
127
123
|
}
|