fumadocs-openapi 10.1.2 → 10.1.3
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/server/create.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface OpenAPIOptions {
|
|
|
24
24
|
export interface OpenAPIServer {
|
|
25
25
|
createProxy: typeof createProxy;
|
|
26
26
|
getSchemas: () => Promise<ProcessedSchemaMap>;
|
|
27
|
+
getSchema: (document: string) => Promise<ProcessedDocument>;
|
|
27
28
|
readonly options: OpenAPIOptions;
|
|
28
29
|
}
|
|
29
30
|
export declare function createOpenAPI(options?: OpenAPIOptions): OpenAPIServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,KAAK,SAAS,GAAG,MAAM,CACrB,MAAM,EACN,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CACnD,CAAC;AACF,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1D,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAA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AAG,aAAa,CA2CzE;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GACtC,kBAAkB,CAQpB"}
|
package/dist/server/create.js
CHANGED
|
@@ -20,6 +20,14 @@ export function createOpenAPI(options = {}) {
|
|
|
20
20
|
return {
|
|
21
21
|
options,
|
|
22
22
|
createProxy,
|
|
23
|
+
async getSchema(document) {
|
|
24
|
+
const schemas = await getSchemas();
|
|
25
|
+
if (document in schemas)
|
|
26
|
+
return schemas[document];
|
|
27
|
+
console.warn(`[Fumadocs OpenAPI] the document "${document}" is not listed in the input array, this may not be expected.`);
|
|
28
|
+
// do not cache unlisted documents
|
|
29
|
+
return processDocument(document);
|
|
30
|
+
},
|
|
23
31
|
async getSchemas() {
|
|
24
32
|
if (disableCache)
|
|
25
33
|
return getSchemas();
|
package/dist/ui/api-page.js
CHANGED
|
@@ -40,7 +40,7 @@ export function createAPIPage(server, options = {}) {
|
|
|
40
40
|
return async function APIPageWrapper({ document, ...props }) {
|
|
41
41
|
let processed;
|
|
42
42
|
if (typeof document === 'string') {
|
|
43
|
-
processed =
|
|
43
|
+
processed = await server.getSchema(document);
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
processed = await document;
|
|
@@ -84,7 +84,7 @@ export async function Operation({ type = 'operation', path, method, ctx, showTit
|
|
|
84
84
|
});
|
|
85
85
|
authNode = (_jsxs(SelectTabs, { defaultValue: items[0].value, children: [_jsxs("div", { className: "flex items-start justify-between gap-2 mt-10", children: [ctx.renderHeading(headingLevel, 'Authorization', {
|
|
86
86
|
className: 'my-0!',
|
|
87
|
-
}), items.length > 1 ? (_jsx(SelectTabTrigger, { items: items })) : (_jsx("
|
|
87
|
+
}), items.length > 1 ? (_jsx(SelectTabTrigger, { items: items })) : (_jsx("div", { className: "not-prose", children: items[0].label }))] }), securities.map((security, i) => (_jsx(SelectTab, { value: items[i].value, children: Object.entries(security).map(([key, scopes]) => {
|
|
88
88
|
const scheme = securitySchemes?.[key];
|
|
89
89
|
if (!scheme)
|
|
90
90
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.3",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
55
55
|
"@radix-ui/react-select": "^2.2.6",
|
|
56
56
|
"@radix-ui/react-slot": "^1.2.4",
|
|
57
|
-
"@scalar/json-magic": "^0.8.
|
|
58
|
-
"@scalar/openapi-parser": "0.23.
|
|
57
|
+
"@scalar/json-magic": "^0.8.6",
|
|
58
|
+
"@scalar/openapi-parser": "0.23.7",
|
|
59
59
|
"ajv": "^8.17.1",
|
|
60
60
|
"class-variance-authority": "^0.7.1",
|
|
61
61
|
"github-slugger": "^2.0.0",
|
|
@@ -69,18 +69,18 @@
|
|
|
69
69
|
"xml-js": "^1.6.11"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@scalar/api-client-react": "^1.3.
|
|
72
|
+
"@scalar/api-client-react": "^1.3.55",
|
|
73
73
|
"@types/js-yaml": "^4.0.9",
|
|
74
74
|
"@types/node": "24.10.2",
|
|
75
75
|
"@types/openapi-sampler": "^1.0.3",
|
|
76
76
|
"@types/react": "^19.2.7",
|
|
77
77
|
"json-schema-typed": "^8.0.2",
|
|
78
78
|
"openapi-types": "^12.1.3",
|
|
79
|
-
"tailwindcss": "^4.1.
|
|
79
|
+
"tailwindcss": "^4.1.18",
|
|
80
80
|
"tsc-alias": "^1.8.16",
|
|
81
81
|
"eslint-config-custom": "0.0.0",
|
|
82
|
-
"fumadocs-
|
|
83
|
-
"fumadocs-
|
|
82
|
+
"fumadocs-ui": "16.2.5",
|
|
83
|
+
"fumadocs-core": "16.2.5",
|
|
84
84
|
"tsconfig": "0.0.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|