fumadocs-openapi 11.2.3 → 11.2.4
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/_virtual/_rolldown/runtime.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.11 → @scalar_openapi-upgrader@0.2.13}/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +38 -34
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.11 → @scalar_openapi-upgrader@0.2.13}/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +61 -4
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.11 → @scalar_openapi-upgrader@0.2.13}/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +7 -5
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.11 → @scalar_openapi-upgrader@0.2.13}/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.11 → @scalar_openapi-upgrader@0.2.13}/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +1 -1
- package/dist/node_modules/.pnpm/xml-js@1.6.11/node_modules/xml-js/lib/js2xml.js +8 -4
- package/dist/requests/media/adapter.js +4 -1
- package/dist/requests/media/encode.js +1 -3
- package/dist/server/proxy.js +0 -1
- package/dist/ui/base.js +3 -2
- package/dist/utils/document/load.js +1 -1
- package/dist/utils/pages/to-static-data.js +6 -1
- package/package.json +12 -12
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traverse } from "../helpers/traverse.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
|
|
3
3
|
const DEFAULT_MEDIA_TYPE = "application/json";
|
|
4
4
|
/** Extracts and removes x-example and x-examples extensions from an object */
|
|
5
5
|
function extractXExampleExtensions(obj) {
|
|
@@ -179,9 +179,11 @@ function upgradeFromTwoToThree(originalSpecification) {
|
|
|
179
179
|
const parameters = document.parameters && typeof document.parameters === "object" ? document.parameters : {};
|
|
180
180
|
for (const [name, param] of Object.entries(parameters)) if (param && typeof param === "object") {
|
|
181
181
|
if ("$ref" in param) params[name] = transformParameterObject(param);
|
|
182
|
-
else if ("in" in param)
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
else if ("in" in param) {
|
|
183
|
+
if (param.in === "body") bodyParams[name] = migrateBodyParameter(param, document.consumes ?? [DEFAULT_MEDIA_TYPE]);
|
|
184
|
+
else if (param.in === "formData") bodyParams[name] = migrateFormDataParameter([param], document.consumes);
|
|
185
|
+
else params[name] = transformParameterObject(param);
|
|
186
|
+
}
|
|
185
187
|
}
|
|
186
188
|
if (Object.keys(params).length > 0) document.components.parameters = params;
|
|
187
189
|
if (Object.keys(bodyParams).length > 0) document.components.requestBodies = bodyParams;
|
|
@@ -195,38 +197,40 @@ function upgradeFromTwoToThree(originalSpecification) {
|
|
|
195
197
|
document.components ??= {};
|
|
196
198
|
const migratedResponses = {};
|
|
197
199
|
const responses = document.responses;
|
|
198
|
-
for (const [name, response] of Object.entries(responses)) if (response && typeof response === "object")
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
if (typeof responseObj.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
200
|
+
for (const [name, response] of Object.entries(responses)) if (response && typeof response === "object") {
|
|
201
|
+
if ("$ref" in response) migratedResponses[name] = response;
|
|
202
|
+
else {
|
|
203
|
+
const responseObj = response;
|
|
204
|
+
const produces = document.produces ?? [DEFAULT_MEDIA_TYPE];
|
|
205
|
+
if (responseObj.schema) {
|
|
206
|
+
if (typeof responseObj.content !== "object") responseObj.content = {};
|
|
207
|
+
for (const type of produces) responseObj.content[type] = { schema: responseObj.schema };
|
|
208
|
+
delete responseObj.schema;
|
|
209
|
+
}
|
|
210
|
+
if (responseObj.examples && typeof responseObj.examples === "object") {
|
|
211
|
+
if (typeof responseObj.content !== "object") responseObj.content = {};
|
|
212
|
+
const defaultMediaType = produces[0] ?? DEFAULT_MEDIA_TYPE;
|
|
213
|
+
for (const [key, exampleValue] of Object.entries(responseObj.examples)) if (isMediaTypeKey(key)) {
|
|
214
|
+
if (typeof responseObj.content[key] !== "object") responseObj.content[key] = {};
|
|
215
|
+
responseObj.content[key].example = exampleValue;
|
|
216
|
+
} else {
|
|
217
|
+
if (typeof responseObj.content[defaultMediaType] !== "object") responseObj.content[defaultMediaType] = {};
|
|
218
|
+
const mediaEntry = responseObj.content[defaultMediaType];
|
|
219
|
+
if (typeof mediaEntry.examples !== "object") mediaEntry.examples = {};
|
|
220
|
+
mediaEntry.examples[key] = wrapAsExampleObject(exampleValue);
|
|
221
|
+
}
|
|
222
|
+
delete responseObj.examples;
|
|
218
223
|
}
|
|
219
|
-
|
|
224
|
+
if (responseObj.content && typeof responseObj.content === "object") removeEmptySchemaOnlyContentEntries(responseObj.content);
|
|
225
|
+
if (responseObj.headers && typeof responseObj.headers === "object") responseObj.headers = Object.entries(responseObj.headers).reduce((acc, [headerName, header]) => {
|
|
226
|
+
if (header && typeof header === "object") return {
|
|
227
|
+
[headerName]: transformResponseHeader(header),
|
|
228
|
+
...acc
|
|
229
|
+
};
|
|
230
|
+
return acc;
|
|
231
|
+
}, {});
|
|
232
|
+
migratedResponses[name] = responseObj;
|
|
220
233
|
}
|
|
221
|
-
if (responseObj.content && typeof responseObj.content === "object") removeEmptySchemaOnlyContentEntries(responseObj.content);
|
|
222
|
-
if (responseObj.headers && typeof responseObj.headers === "object") responseObj.headers = Object.entries(responseObj.headers).reduce((acc, [headerName, header]) => {
|
|
223
|
-
if (header && typeof header === "object") return {
|
|
224
|
-
[headerName]: transformResponseHeader(header),
|
|
225
|
-
...acc
|
|
226
|
-
};
|
|
227
|
-
return acc;
|
|
228
|
-
}, {});
|
|
229
|
-
migratedResponses[name] = responseObj;
|
|
230
234
|
}
|
|
231
235
|
if (Object.keys(migratedResponses).length > 0) document.components.responses = migratedResponses;
|
|
232
236
|
delete document.responses;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traverse } from "../helpers/traverse.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
|
|
3
3
|
const SCHEMA_SEGMENTS = /* @__PURE__ */ new Set([
|
|
4
4
|
"properties",
|
|
5
5
|
"items",
|
|
@@ -18,6 +18,46 @@ function isSchemaPath(path) {
|
|
|
18
18
|
if (path.length >= 2 && path[0] === "components" && path[1] === "schemas") return true;
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
+
const NAMED_SCHEMA_MAP_SEGMENTS = /* @__PURE__ */ new Set([
|
|
22
|
+
"properties",
|
|
23
|
+
"patternProperties",
|
|
24
|
+
"$defs",
|
|
25
|
+
"definitions"
|
|
26
|
+
]);
|
|
27
|
+
/**
|
|
28
|
+
* Determine if the node at `path` is a map of named subschemas rather than a schema object.
|
|
29
|
+
*
|
|
30
|
+
* This matters because the 3.0 to 3.1 upgrade rewrites the `example` keyword into `examples`.
|
|
31
|
+
* A key called `example` (or `examples`) inside one of these maps is a member *name*, not the
|
|
32
|
+
* schema keyword, so it must be left untouched.
|
|
33
|
+
*/
|
|
34
|
+
function isNamedSchemaMap(path) {
|
|
35
|
+
const last = path?.[path.length - 1];
|
|
36
|
+
if (last === void 0) return false;
|
|
37
|
+
if (last === "schemas" && path?.[path.length - 2] === "components") return true;
|
|
38
|
+
return NAMED_SCHEMA_MAP_SEGMENTS.has(last);
|
|
39
|
+
}
|
|
40
|
+
const DATA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
41
|
+
"example",
|
|
42
|
+
"default",
|
|
43
|
+
"const",
|
|
44
|
+
"enum"
|
|
45
|
+
]);
|
|
46
|
+
/**
|
|
47
|
+
* Determine if the node at `path` lives inside a data value rather than a schema.
|
|
48
|
+
*
|
|
49
|
+
* The traversal visits every object node, but a value held by keywords like `example` or
|
|
50
|
+
* `default` is user data, not a schema. Applying the schema transforms to it would mangle it
|
|
51
|
+
* (turning `nullable: true` into a type array, renaming a nested `x-webhooks`, and so on).
|
|
52
|
+
*/
|
|
53
|
+
function isInsideDataValue(path) {
|
|
54
|
+
if (!path) return false;
|
|
55
|
+
for (const [index, segment] of path.entries()) {
|
|
56
|
+
if (DATA_KEYWORDS.has(segment) && !isNamedSchemaMap(path.slice(0, index))) return true;
|
|
57
|
+
if (segment === "value" && path[index - 2] === "examples" && !isNamedSchemaMap(path.slice(0, index - 2))) return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
21
61
|
/**
|
|
22
62
|
* Upgrade from OpenAPI 3.0.x to 3.1.1
|
|
23
63
|
*
|
|
@@ -31,9 +71,26 @@ function upgradeFromThreeToThreeOne(originalContent) {
|
|
|
31
71
|
return content;
|
|
32
72
|
}
|
|
33
73
|
const applyChangesToDocument = (schema, path) => {
|
|
74
|
+
if (isInsideDataValue(path)) return schema;
|
|
34
75
|
if (schema.type !== void 0 && schema.nullable === true) {
|
|
35
76
|
schema.type = [schema.type, "null"];
|
|
36
77
|
delete schema.nullable;
|
|
78
|
+
} else if (schema.nullable === true && schema.type === void 0) {
|
|
79
|
+
if (typeof schema.$ref === "string") {
|
|
80
|
+
const { nullable: _nullable, $ref, ...rest } = schema;
|
|
81
|
+
return {
|
|
82
|
+
...rest,
|
|
83
|
+
anyOf: [{ $ref }, { type: "null" }]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (Array.isArray(schema.allOf)) {
|
|
87
|
+
const { nullable: _nullable, allOf, ...rest } = schema;
|
|
88
|
+
const base = allOf.length === 1 ? allOf[0] : { allOf };
|
|
89
|
+
return {
|
|
90
|
+
...rest,
|
|
91
|
+
anyOf: [base, { type: "null" }]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
37
94
|
}
|
|
38
95
|
if (schema.exclusiveMinimum === true) {
|
|
39
96
|
schema.exclusiveMinimum = schema.minimum;
|
|
@@ -44,10 +101,10 @@ const applyChangesToDocument = (schema, path) => {
|
|
|
44
101
|
delete schema.maximum;
|
|
45
102
|
} else if (schema.exclusiveMaximum === false) delete schema.exclusiveMaximum;
|
|
46
103
|
const isInsideExamplesMap = path?.some((segment, index) => {
|
|
47
|
-
if (segment === "examples" && index > 0) return path
|
|
104
|
+
if (segment === "examples" && index > 0) return !isNamedSchemaMap(path.slice(0, index));
|
|
48
105
|
return false;
|
|
49
106
|
});
|
|
50
|
-
if (schema.example !== void 0 && !isInsideExamplesMap) {
|
|
107
|
+
if (schema.example !== void 0 && !isInsideExamplesMap && !isNamedSchemaMap(path)) {
|
|
51
108
|
if (isSchemaPath(path)) schema.examples = [schema.example];
|
|
52
109
|
else schema.examples = { default: { value: schema.example } };
|
|
53
110
|
delete schema.example;
|
|
@@ -85,7 +142,7 @@ const applyChangesToDocument = (schema, path) => {
|
|
|
85
142
|
};
|
|
86
143
|
}
|
|
87
144
|
}
|
|
88
|
-
if (schema["x-webhooks"] !== void 0) {
|
|
145
|
+
if (schema["x-webhooks"] !== void 0 && (path === void 0 || path.length === 0)) {
|
|
89
146
|
schema.webhooks = schema["x-webhooks"];
|
|
90
147
|
delete schema["x-webhooks"];
|
|
91
148
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
|
|
2
2
|
/**
|
|
3
3
|
* Recursively migrate XML object properties from 3.1 to 3.2 format
|
|
4
4
|
*/
|
|
@@ -33,10 +33,12 @@ function migrateTagGroups(document) {
|
|
|
33
33
|
if (Array.isArray(document.tags)) {
|
|
34
34
|
for (const tag of document.tags) if (typeof tag === "object" && tag !== null && "name" in tag) {
|
|
35
35
|
const groupName = tagGroupMap.get(tag.name);
|
|
36
|
-
if (groupName)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
if (groupName) {
|
|
37
|
+
if (groupName.toLowerCase().includes("nav") || groupName.toLowerCase().includes("navigation")) tag.kind = "nav";
|
|
38
|
+
else if (groupName.toLowerCase().includes("audience")) tag.kind = "audience";
|
|
39
|
+
else if (groupName.toLowerCase().includes("badge")) tag.kind = "badge";
|
|
40
|
+
else tag.kind = "nav";
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
delete document["x-tagGroups"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
|
|
2
2
|
/**
|
|
3
3
|
* Recursively traverses the content and applies the transform function to each node.
|
|
4
4
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { upgradeFromThreeOneToThreeTwo } from "./3.1-to-3.2/upgrade-from-three-one-to-three-two.js";
|
|
2
2
|
import { upgradeFromTwoToThree } from "./2.0-to-3.0/upgrade-from-two-to-three.js";
|
|
3
3
|
import { upgradeFromThreeToThreeOne } from "./3.0-to-3.1/upgrade-from-three-to-three-one.js";
|
|
4
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
4
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
|
|
5
5
|
function upgrade(value, targetVersion) {
|
|
6
6
|
const openapi30 = upgradeFromTwoToThree(value);
|
|
7
7
|
if (targetVersion === "3.0") return openapi30;
|
|
@@ -128,8 +128,10 @@ var require_js2xml = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
128
128
|
xml.push("<" + elementName);
|
|
129
129
|
if (element[options.attributesKey]) xml.push(writeAttributes(element[options.attributesKey], options, depth));
|
|
130
130
|
var withClosingTag = element[options.elementsKey] && element[options.elementsKey].length || element[options.attributesKey] && element[options.attributesKey]["xml:space"] === "preserve";
|
|
131
|
-
if (!withClosingTag)
|
|
132
|
-
|
|
131
|
+
if (!withClosingTag) {
|
|
132
|
+
if ("fullTagEmptyElementFn" in options) withClosingTag = options.fullTagEmptyElementFn(element.name, element);
|
|
133
|
+
else withClosingTag = options.fullTagEmptyElement;
|
|
134
|
+
}
|
|
133
135
|
if (withClosingTag) {
|
|
134
136
|
xml.push(">");
|
|
135
137
|
if (element[options.elementsKey] && element[options.elementsKey].length) {
|
|
@@ -192,8 +194,10 @@ var require_js2xml = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
192
194
|
}
|
|
193
195
|
if (element[options.attributesKey]) xml.push(writeAttributes(element[options.attributesKey], options, depth));
|
|
194
196
|
var withClosingTag = hasContentCompact(element, options, true) || element[options.attributesKey] && element[options.attributesKey]["xml:space"] === "preserve";
|
|
195
|
-
if (!withClosingTag)
|
|
196
|
-
|
|
197
|
+
if (!withClosingTag) {
|
|
198
|
+
if ("fullTagEmptyElementFn" in options) withClosingTag = options.fullTagEmptyElementFn(name, element);
|
|
199
|
+
else withClosingTag = options.fullTagEmptyElement;
|
|
200
|
+
}
|
|
197
201
|
if (withClosingTag) xml.push(">");
|
|
198
202
|
else {
|
|
199
203
|
xml.push("/>");
|
|
@@ -118,7 +118,10 @@ function str(init, mediaType, ctx) {
|
|
|
118
118
|
addImport("java.net.http.HttpRequest.BodyPublishers");
|
|
119
119
|
return `var body = BodyPublishers.ofString(${tripleDoubleQuote(inputToString(init, mediaType))});`;
|
|
120
120
|
}
|
|
121
|
-
if (ctx.lang === "csharp")
|
|
121
|
+
if (ctx.lang === "csharp") {
|
|
122
|
+
const input = `\n${inputToString(init, mediaType)}\n`;
|
|
123
|
+
return `var body = new StringContent(${tripleDoubleQuote(input)}, Encoding.UTF8, "${mediaType}");`;
|
|
124
|
+
}
|
|
122
125
|
if (ctx.lang === "rust") return `let body = ${rustRawStringLiteral(inputToString(init, mediaType))};`;
|
|
123
126
|
}
|
|
124
127
|
//#endregion
|
|
@@ -42,9 +42,7 @@ function encodeRequestData(from, adapters, parameters = []) {
|
|
|
42
42
|
case "header":
|
|
43
43
|
result.header[key] = { value: serializeSimple(value, field.explode ?? false) };
|
|
44
44
|
break;
|
|
45
|
-
case "cookie":
|
|
46
|
-
serializeCookieParameter(field, value, result.cookie);
|
|
47
|
-
break;
|
|
45
|
+
case "cookie": serializeCookieParameter(field, value, result.cookie);
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
return result;
|
package/dist/server/proxy.js
CHANGED
package/dist/ui/base.js
CHANGED
|
@@ -4,10 +4,10 @@ import { ClientCodeBlock } from "./components/codeblock.js";
|
|
|
4
4
|
import { createCodeUsageGeneratorRegistry } from "../requests/generators/index.js";
|
|
5
5
|
import { defaultAdapters } from "../requests/media/adapter.js";
|
|
6
6
|
import { AuthProvider } from "../playground/auth.js";
|
|
7
|
-
import { registerDefault } from "../requests/generators/all.js";
|
|
8
7
|
import { Markdown } from "./components/markdown.js";
|
|
9
8
|
import { Operation } from "./operation/index.js";
|
|
10
9
|
import { dereferenceBundledDocument } from "../utils/document/dereference.js";
|
|
10
|
+
import { registerDefault } from "../requests/generators/all.js";
|
|
11
11
|
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
12
12
|
import { Children, useMemo } from "react";
|
|
13
13
|
import * as JsxRuntime from "react/jsx-runtime";
|
|
@@ -168,8 +168,9 @@ function MarkdownPre(props) {
|
|
|
168
168
|
const codeProps = Children.only(props.children).props;
|
|
169
169
|
const content = codeProps.children;
|
|
170
170
|
if (typeof content !== "string") return null;
|
|
171
|
+
const lang = codeProps.className?.split(" ").find((v) => v.startsWith("language-"))?.slice(9) ?? "text";
|
|
171
172
|
return /* @__PURE__ */ jsx(ClientCodeBlock, {
|
|
172
|
-
lang
|
|
173
|
+
lang,
|
|
173
174
|
code: content.trimEnd()
|
|
174
175
|
});
|
|
175
176
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.
|
|
1
|
+
import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
|
|
2
2
|
import { bundle } from "@fumadocs/api-docs/schema/bundle";
|
|
3
3
|
//#region src/utils/document/load.ts
|
|
4
4
|
/**
|
|
@@ -3,8 +3,13 @@ import { dereferenceShallow } from "@fumadocs/api-docs/schema/dereference";
|
|
|
3
3
|
import { createMagicProxy } from "@scalar/json-magic/magic-proxy";
|
|
4
4
|
import Slugger from "github-slugger";
|
|
5
5
|
//#region src/utils/pages/to-static-data.ts
|
|
6
|
+
const proxyCache = /* @__PURE__ */ new WeakMap();
|
|
6
7
|
function toStaticData(page, doc) {
|
|
7
|
-
|
|
8
|
+
let proxied = proxyCache.get(doc);
|
|
9
|
+
if (!proxied) {
|
|
10
|
+
proxied = createMagicProxy(doc);
|
|
11
|
+
proxyCache.set(doc, proxied);
|
|
12
|
+
}
|
|
8
13
|
const slugger = new Slugger();
|
|
9
14
|
const toc = [];
|
|
10
15
|
const structuredData = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.4",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -45,33 +45,33 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@fuma-translate/react": "^1.0.2",
|
|
47
47
|
"@fumari/json-schema-ts": "^1.0.2",
|
|
48
|
-
"@scalar/json-magic": "^0.12.
|
|
48
|
+
"@scalar/json-magic": "^0.12.20",
|
|
49
49
|
"chokidar": "^5.0.0",
|
|
50
50
|
"class-variance-authority": "^0.7.1",
|
|
51
51
|
"cnfast": "^0.1.0",
|
|
52
52
|
"github-slugger": "^2.0.0",
|
|
53
53
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
54
|
-
"lucide-react": "^1.
|
|
54
|
+
"lucide-react": "^1.31.0",
|
|
55
55
|
"remark": "^15.0.1",
|
|
56
56
|
"remark-rehype": "^11.1.2",
|
|
57
|
-
"shiki": "^4.3
|
|
57
|
+
"shiki": "^4.4.3",
|
|
58
58
|
"yaml": "^2.9.0",
|
|
59
59
|
"@fumadocs/api-docs": "0.2.2",
|
|
60
60
|
"@fumari/stf": "1.1.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@scalar/api-client-react": "^2.0.
|
|
64
|
-
"@scalar/openapi-upgrader": "^0.2.
|
|
63
|
+
"@scalar/api-client-react": "^2.0.38",
|
|
64
|
+
"@scalar/openapi-upgrader": "^0.2.13",
|
|
65
65
|
"@tailwindcss/oxide": "^4.3.3",
|
|
66
|
-
"@types/node": "26.
|
|
67
|
-
"@types/react": "^19.2.
|
|
66
|
+
"@types/node": "26.2.0",
|
|
67
|
+
"@types/react": "^19.2.18",
|
|
68
68
|
"fast-content-type-parse": "^3.0.0",
|
|
69
69
|
"json-schema-typed": "^8.0.2",
|
|
70
70
|
"tsdown": "0.22.14",
|
|
71
71
|
"xml-js": "^1.6.11",
|
|
72
|
-
"fumadocs-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
72
|
+
"fumadocs-core": "16.14.4",
|
|
73
|
+
"tsconfig": "0.0.0",
|
|
74
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.14.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"@scalar/api-client-react": "^2.0.20",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"inlinedDependencies": {
|
|
97
|
-
"@scalar/openapi-upgrader": "0.2.
|
|
97
|
+
"@scalar/openapi-upgrader": "0.2.13",
|
|
98
98
|
"fast-content-type-parse": "3.0.0",
|
|
99
99
|
"xml-js": "1.6.11"
|
|
100
100
|
},
|