fumadocs-openapi 9.0.6 → 9.0.8
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.
|
@@ -128,7 +128,7 @@ export default function Client({ route, method = 'GET', securities, parameters,
|
|
|
128
128
|
function SecurityTabs({ securities, setSecurityId, securityId, children, }) {
|
|
129
129
|
const [open, setOpen] = useState(false);
|
|
130
130
|
const form = useFormContext();
|
|
131
|
-
const result = (_jsxs(CollapsiblePanel, { title: "Authorization", children: [_jsxs(Select, { value: securityId.toString(), onValueChange: (v) => setSecurityId(Number(v)), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: securities.map((security, i) => (_jsx(SelectItem, { value: i.toString(), children: security.map((item) => item.id)
|
|
131
|
+
const result = (_jsxs(CollapsiblePanel, { title: "Authorization", children: [_jsxs(Select, { value: securityId.toString(), onValueChange: (v) => setSecurityId(Number(v)), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: securities.map((security, i) => (_jsx(SelectItem, { value: i.toString(), children: security.map((item) => (_jsxs("div", { children: [_jsx("p", { className: "font-mono font-medium", children: item.id }), _jsx("p", { className: "text-fd-muted-foreground", children: item.description })] }, item.id))) }, i))) })] }), children] }));
|
|
132
132
|
for (let i = 0; i < securities.length; i++) {
|
|
133
133
|
const security = securities[i];
|
|
134
134
|
for (const item of security) {
|
|
@@ -176,7 +176,7 @@ function BodyInput({ field: _field }) {
|
|
|
176
176
|
})), onClick: () => setIsJson(false), type: "button", children: "Close JSON Editor" }) })) : (_jsx(FieldSet, { field: field, fieldName: "body", collapsible: false, name: _jsx("button", { className: cn(buttonVariants({
|
|
177
177
|
color: 'secondary',
|
|
178
178
|
size: 'sm',
|
|
179
|
-
className: 'p-2',
|
|
179
|
+
className: 'font-mono p-2',
|
|
180
180
|
})), onClick: () => setIsJson(true), type: "button", children: "Open JSON Editor" }) })) }));
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
@@ -239,6 +239,7 @@ function useAuthInputs(securities) {
|
|
|
239
239
|
type: 'string',
|
|
240
240
|
},
|
|
241
241
|
},
|
|
242
|
+
required: ['username', 'password'],
|
|
242
243
|
}, fieldName: fieldName })),
|
|
243
244
|
});
|
|
244
245
|
}
|
package/dist/playground/index.js
CHANGED
|
@@ -68,11 +68,6 @@ function writeReferences(schema, ctx, stack = new WeakMap()) {
|
|
|
68
68
|
for (const key in output[name]) {
|
|
69
69
|
output[name][key] = writeReferences(output[name][key], ctx, stack);
|
|
70
70
|
}
|
|
71
|
-
continue;
|
|
72
|
-
default:
|
|
73
|
-
if (typeof output[name] === 'object' && !Array.isArray(output[name])) {
|
|
74
|
-
output[name] = { ...output[name] };
|
|
75
|
-
}
|
|
76
71
|
}
|
|
77
72
|
}
|
|
78
73
|
return output;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/server/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,QAAA,MAAM,IAAI,4DAA6D,CAAC;AAExE,KAAK,KAAK,GAAG;KACV,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC;CACtE,CAAC;AAEF,UAAU,kBAAkB;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAE9C;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;QACxC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAC;KAC7C,CAAC;CACH;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/server/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,QAAA,MAAM,IAAI,4DAA6D,CAAC;AAExE,KAAK,KAAK,GAAG;KACV,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC;CACtE,CAAC;AAEF,UAAU,kBAAkB;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAE9C;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;QACxC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAC;KAC7C,CAAC;CACH;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,KAAK,CAoGnE"}
|
package/dist/server/proxy.js
CHANGED
|
@@ -26,9 +26,10 @@ export function createProxy(options = {}) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
let proxied = new Request(parsedUrl, {
|
|
29
|
-
|
|
29
|
+
method: req.method,
|
|
30
30
|
cache: 'no-cache',
|
|
31
|
-
|
|
31
|
+
headers: req.headers,
|
|
32
|
+
body: await req.arrayBuffer(),
|
|
32
33
|
});
|
|
33
34
|
if (overrides?.request) {
|
|
34
35
|
proxied = overrides.request(proxied);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-typescript-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-typescript-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"get-typescript-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-typescript-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAS7B"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { compile } from '@fumari/json-schema-to-typescript';
|
|
2
2
|
export async function getTypescriptSchema(schema, dereferenceMap) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// because it uses `defineProperty` to define internal references
|
|
6
|
-
// we clone the schema to fix this problem
|
|
7
|
-
schema, 'Response', {
|
|
3
|
+
const cloned = structuredClone({ schema, dereferenceMap });
|
|
4
|
+
return compile(cloned.schema, 'Response', {
|
|
8
5
|
$refOptions: false,
|
|
9
|
-
schemaToId: dereferenceMap,
|
|
6
|
+
schemaToId: cloned.dereferenceMap,
|
|
10
7
|
bannerComment: '',
|
|
11
8
|
additionalProperties: false,
|
|
12
|
-
format: true,
|
|
13
9
|
enableConstEnums: false,
|
|
14
10
|
});
|
|
15
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.8",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"openapi-types": "^12.1.3",
|
|
79
79
|
"tailwindcss": "^4.1.8",
|
|
80
80
|
"tsc-alias": "^1.8.16",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
81
|
+
"tsconfig": "0.0.0",
|
|
82
|
+
"eslint-config-custom": "0.0.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@scalar/api-client-react": "*",
|