fumadocs-openapi 9.5.1 → 9.6.0
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/playground/client.d.ts.map +1 -1
- package/dist/playground/client.js +36 -64
- package/dist/playground/inputs.d.ts.map +1 -1
- package/dist/playground/inputs.js +24 -17
- package/dist/playground/schema.d.ts.map +1 -1
- package/dist/playground/schema.js +27 -27
- package/dist/render/operation/index.js +6 -8
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/renderer.d.ts.map +1 -1
- package/dist/render/schema/client.d.ts +18 -0
- package/dist/render/schema/client.d.ts.map +1 -0
- package/dist/render/schema/client.js +139 -0
- package/dist/render/schema/index.d.ts +7 -0
- package/dist/render/schema/index.d.ts.map +1 -0
- package/dist/render/schema/index.js +11 -0
- package/dist/render/schema/server.d.ts +43 -0
- package/dist/render/schema/server.d.ts.map +1 -0
- package/dist/render/schema/server.js +206 -0
- package/dist/render/schema/ui.d.ts +16 -0
- package/dist/render/schema/ui.d.ts.map +1 -0
- package/dist/render/schema/ui.js +14 -0
- package/dist/server/create.d.ts +11 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/ui/components/method-label.d.ts +1 -1
- package/dist/ui/contexts/code-example.d.ts +4 -1
- package/dist/ui/contexts/code-example.d.ts.map +1 -1
- package/dist/ui/contexts/code-example.js +1 -1
- package/dist/ui/index.d.ts +3 -7
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -13
- package/dist/utils/schema-to-string.d.ts +5 -1
- package/dist/utils/schema-to-string.d.ts.map +1 -1
- package/dist/utils/schema-to-string.js +25 -24
- package/package.json +11 -11
- package/dist/render/schema.d.ts +0 -13
- package/dist/render/schema.d.ts.map +0 -1
- package/dist/render/schema.js +0 -239
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ResolvedSchema } from '../../utils/schema.js';
|
|
3
|
+
import type { RenderContext } from '../../types.js';
|
|
4
|
+
export interface FieldBase {
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
infoTags?: ReactNode[];
|
|
7
|
+
typeName: string;
|
|
8
|
+
aliasName: string;
|
|
9
|
+
deprecated?: boolean;
|
|
10
|
+
writeOnly?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type SchemaData = FieldBase & ({
|
|
14
|
+
type: 'primitive';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'object';
|
|
17
|
+
props: {
|
|
18
|
+
name: string;
|
|
19
|
+
$type: string;
|
|
20
|
+
required: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
} | {
|
|
23
|
+
type: 'array';
|
|
24
|
+
item: {
|
|
25
|
+
$type: string;
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
type: 'or';
|
|
29
|
+
items: {
|
|
30
|
+
name: string;
|
|
31
|
+
$type: string;
|
|
32
|
+
}[];
|
|
33
|
+
});
|
|
34
|
+
export interface SchemaUIOptions {
|
|
35
|
+
root: ResolvedSchema;
|
|
36
|
+
ctx: RenderContext;
|
|
37
|
+
}
|
|
38
|
+
export interface SchemaUIData {
|
|
39
|
+
$root: string;
|
|
40
|
+
refs: Record<string, SchemaData>;
|
|
41
|
+
}
|
|
42
|
+
export declare function generateSchemaUI({ ctx, root }: SchemaUIOptions): SchemaUIData;
|
|
43
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/render/schema/server.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IAEvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAChC,CACI;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,OAAO,CAAC;KACnB,EAAE,CAAC;CACL,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL,CACJ,CAAC;AAEJ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAClC;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,YAAY,CAoP7E"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormatFlags, schemaToString } from '../../utils/schema-to-string.js';
|
|
3
|
+
import { Markdown } from '../../render/markdown.js';
|
|
4
|
+
import { combineSchema } from '../../utils/combine-schema.js';
|
|
5
|
+
export function generateSchemaUI({ ctx, root }) {
|
|
6
|
+
const refs = {};
|
|
7
|
+
const { content: { showExampleInFields = false } = {} } = ctx;
|
|
8
|
+
function generateInfoTags(schema) {
|
|
9
|
+
const fields = [];
|
|
10
|
+
function field(key, value) {
|
|
11
|
+
return (_jsxs("div", { className: "bg-fd-secondary border rounded-lg text-xs p-1.5 shadow-md", children: [_jsx("span", { className: "font-medium me-2", children: key }), _jsx("code", { className: "text-fd-muted-foreground", children: value })] }));
|
|
12
|
+
}
|
|
13
|
+
if (schema.default !== undefined) {
|
|
14
|
+
fields.push(field('Default', JSON.stringify(schema.default)));
|
|
15
|
+
}
|
|
16
|
+
if (schema.pattern) {
|
|
17
|
+
fields.push(field('Match', schema.pattern));
|
|
18
|
+
}
|
|
19
|
+
if (schema.format) {
|
|
20
|
+
fields.push(field('Format', schema.format));
|
|
21
|
+
}
|
|
22
|
+
if (schema.multipleOf) {
|
|
23
|
+
fields.push(field('Multiple Of', schema.multipleOf));
|
|
24
|
+
}
|
|
25
|
+
let range = getRange('value', schema.minimum, schema.exclusiveMinimum, schema.maximum, schema.exclusiveMaximum);
|
|
26
|
+
if (range)
|
|
27
|
+
fields.push(field('Range', range));
|
|
28
|
+
range = getRange('length', schema.minLength, undefined, schema.maxLength, undefined);
|
|
29
|
+
if (range)
|
|
30
|
+
fields.push(field('Length', range));
|
|
31
|
+
range = getRange('properties', schema.minProperties, undefined, schema.maxProperties, undefined);
|
|
32
|
+
if (range)
|
|
33
|
+
fields.push(field('Properties', range));
|
|
34
|
+
range = getRange('items', schema.minItems, undefined, schema.maxItems, undefined);
|
|
35
|
+
if (range)
|
|
36
|
+
fields.push(field('Items', range));
|
|
37
|
+
if (schema.enum) {
|
|
38
|
+
fields.push(field('Value in', schema.enum.map((value) => JSON.stringify(value)).join(' | ')));
|
|
39
|
+
}
|
|
40
|
+
if (showExampleInFields && schema.examples) {
|
|
41
|
+
for (const example of schema.examples) {
|
|
42
|
+
fields.push(field('Example', JSON.stringify(example, null, 2)));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return fields;
|
|
46
|
+
}
|
|
47
|
+
let _counter = 0;
|
|
48
|
+
const autoIds = new WeakMap();
|
|
49
|
+
function getSchemaId(schema) {
|
|
50
|
+
if (typeof schema === 'boolean')
|
|
51
|
+
return String(schema);
|
|
52
|
+
const raw = ctx.schema.getRawRef(schema);
|
|
53
|
+
if (raw)
|
|
54
|
+
return raw;
|
|
55
|
+
const prev = autoIds.get(schema);
|
|
56
|
+
if (prev)
|
|
57
|
+
return prev;
|
|
58
|
+
const generated = `__${_counter++}`;
|
|
59
|
+
autoIds.set(schema, generated);
|
|
60
|
+
return generated;
|
|
61
|
+
}
|
|
62
|
+
function base(schema) {
|
|
63
|
+
if (typeof schema === 'boolean') {
|
|
64
|
+
const name = schema ? 'any' : 'never';
|
|
65
|
+
return {
|
|
66
|
+
typeName: name,
|
|
67
|
+
aliasName: name,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
description: schema.description && _jsx(Markdown, { text: schema.description }),
|
|
72
|
+
infoTags: generateInfoTags(schema),
|
|
73
|
+
typeName: schemaToString(schema, ctx.schema),
|
|
74
|
+
aliasName: schemaToString(schema, ctx.schema, FormatFlags.UseAlias),
|
|
75
|
+
deprecated: schema.deprecated,
|
|
76
|
+
readOnly: schema.readOnly,
|
|
77
|
+
writeOnly: schema.writeOnly,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function scanRefs(id, schema) {
|
|
81
|
+
if (id in refs)
|
|
82
|
+
return;
|
|
83
|
+
if (typeof schema === 'boolean') {
|
|
84
|
+
refs[id] = {
|
|
85
|
+
type: 'primitive',
|
|
86
|
+
...base(schema),
|
|
87
|
+
};
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (Array.isArray(schema.type)) {
|
|
91
|
+
const out = {
|
|
92
|
+
type: 'or',
|
|
93
|
+
items: [],
|
|
94
|
+
...base(schema),
|
|
95
|
+
};
|
|
96
|
+
refs[id] = out;
|
|
97
|
+
for (const type of schema.type) {
|
|
98
|
+
const item = {
|
|
99
|
+
...schema,
|
|
100
|
+
type,
|
|
101
|
+
};
|
|
102
|
+
const key = `${id}_type:${type}`;
|
|
103
|
+
scanRefs(key, item);
|
|
104
|
+
out.items.push({
|
|
105
|
+
name: type,
|
|
106
|
+
$type: key,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (schema.oneOf) {
|
|
112
|
+
const out = {
|
|
113
|
+
type: 'or',
|
|
114
|
+
items: [],
|
|
115
|
+
...base(schema),
|
|
116
|
+
};
|
|
117
|
+
refs[id] = out;
|
|
118
|
+
for (const item of schema.oneOf) {
|
|
119
|
+
const $type = getSchemaId(item);
|
|
120
|
+
scanRefs($type, item);
|
|
121
|
+
out.items.push({
|
|
122
|
+
name: schemaToString(item, ctx.schema, FormatFlags.UseAlias),
|
|
123
|
+
$type,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const of = schema.allOf ?? schema.anyOf;
|
|
129
|
+
if (of) {
|
|
130
|
+
const combined = combineSchema(of);
|
|
131
|
+
scanRefs(id, combined);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (schema.type === 'object') {
|
|
135
|
+
const out = {
|
|
136
|
+
type: 'object',
|
|
137
|
+
props: [],
|
|
138
|
+
...base(schema),
|
|
139
|
+
};
|
|
140
|
+
refs[id] = out;
|
|
141
|
+
const props = Object.entries(schema.properties ?? {});
|
|
142
|
+
if (schema.patternProperties)
|
|
143
|
+
props.push(...Object.entries(schema.patternProperties));
|
|
144
|
+
for (const [key, prop] of props) {
|
|
145
|
+
const $type = getSchemaId(prop);
|
|
146
|
+
scanRefs($type, prop);
|
|
147
|
+
out.props.push({
|
|
148
|
+
$type,
|
|
149
|
+
name: key,
|
|
150
|
+
required: schema.required?.includes(key) ?? false,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (schema.additionalProperties) {
|
|
154
|
+
const $type = getSchemaId(schema.additionalProperties);
|
|
155
|
+
scanRefs($type, schema.additionalProperties);
|
|
156
|
+
out.props.push({
|
|
157
|
+
$type,
|
|
158
|
+
name: '[key: string]',
|
|
159
|
+
required: false,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (schema.type === 'array') {
|
|
165
|
+
const items = schema.items ?? true;
|
|
166
|
+
const $type = getSchemaId(items);
|
|
167
|
+
refs[id] = {
|
|
168
|
+
type: 'array',
|
|
169
|
+
item: {
|
|
170
|
+
$type,
|
|
171
|
+
},
|
|
172
|
+
...base(schema),
|
|
173
|
+
};
|
|
174
|
+
scanRefs($type, items);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
refs[id] = {
|
|
178
|
+
type: 'primitive',
|
|
179
|
+
...base(schema),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const $root = getSchemaId(root);
|
|
183
|
+
scanRefs($root, root);
|
|
184
|
+
return {
|
|
185
|
+
refs,
|
|
186
|
+
$root,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function getRange(value, min, exclusiveMin, max, exclusiveMax) {
|
|
190
|
+
const out = [];
|
|
191
|
+
if (min !== undefined) {
|
|
192
|
+
out.push(`${min} <=`);
|
|
193
|
+
}
|
|
194
|
+
else if (exclusiveMin !== undefined) {
|
|
195
|
+
out.push(`${exclusiveMin} <`);
|
|
196
|
+
}
|
|
197
|
+
out.push(value);
|
|
198
|
+
if (max !== undefined) {
|
|
199
|
+
out.push(`<= ${max}`);
|
|
200
|
+
}
|
|
201
|
+
else if (exclusiveMax !== undefined) {
|
|
202
|
+
out.push(`< ${exclusiveMax}`);
|
|
203
|
+
}
|
|
204
|
+
if (out.length > 1)
|
|
205
|
+
return out.join(' ');
|
|
206
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function ObjectCollapsible(props: {
|
|
3
|
+
name: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface PropertyProps {
|
|
7
|
+
name: ReactNode;
|
|
8
|
+
type: ReactNode;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
deprecated?: boolean;
|
|
11
|
+
nested?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Property({ name, type, required, deprecated, nested, ...props }: PropertyProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/render/schema/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAiBA;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,MAAc,EACd,GAAG,KAAK,EACT,EAAE,aAAa,2CAoCf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible';
|
|
3
|
+
import { cn } from 'fumadocs-ui/utils/cn';
|
|
4
|
+
import { buttonVariants } from 'fumadocs-ui/components/ui/button';
|
|
5
|
+
import { ChevronDown } from 'fumadocs-ui/internal/icons';
|
|
6
|
+
import { Badge } from '../../ui/components/method-label.js';
|
|
7
|
+
export function ObjectCollapsible(props) {
|
|
8
|
+
return (_jsxs(Collapsible, { className: "my-2", ...props, children: [_jsxs(CollapsibleTrigger, { className: cn(buttonVariants({ color: 'secondary', size: 'sm' }), 'group px-3 py-2 data-[state=open]:rounded-b-none'), children: [props.name, _jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground group-data-[state=open]:rotate-180" })] }), _jsx(CollapsibleContent, { className: "-mt-px *:bg-fd-card", children: props.children })] }));
|
|
9
|
+
}
|
|
10
|
+
export function Property({ name, type, required, deprecated, nested = false, ...props }) {
|
|
11
|
+
return (_jsxs("div", { className: cn('text-sm border-t', nested
|
|
12
|
+
? 'p-3 border-x bg-fd-card last:rounded-b-xl first:rounded-tr-xl last:border-b'
|
|
13
|
+
: 'py-4 first:border-t-0', props.className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-3 not-prose", children: [_jsxs("span", { className: "font-medium font-mono text-fd-primary", children: [name, required === false && (_jsx("span", { className: "text-fd-muted-foreground", children: "?" }))] }), typeof type === 'string' ? (_jsx("span", { className: "text-sm font-mono text-fd-muted-foreground", children: type })) : (type), deprecated && (_jsx(Badge, { color: "yellow", className: "ms-auto text-xs", children: "Deprecated" }))] }), _jsx("div", { className: "prose-no-margin pt-2.5 empty:hidden", children: props.children })] }));
|
|
14
|
+
}
|
package/dist/server/create.d.ts
CHANGED
|
@@ -47,6 +47,17 @@ export interface SharedOpenAPIOptions {
|
|
|
47
47
|
*/
|
|
48
48
|
showResponseSchema?: boolean;
|
|
49
49
|
mediaAdapters?: Record<string, MediaAdapter>;
|
|
50
|
+
/**
|
|
51
|
+
* Customise page content
|
|
52
|
+
*/
|
|
53
|
+
content?: {
|
|
54
|
+
/**
|
|
55
|
+
* Show examples under the generated content of JSON schemas.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue false
|
|
58
|
+
*/
|
|
59
|
+
showExampleInFields?: boolean;
|
|
60
|
+
};
|
|
50
61
|
}
|
|
51
62
|
export interface OpenAPIOptions extends SharedOpenAPIOptions {
|
|
52
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACnC;;GAEG;AACH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC3E,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,wBAAwB,CAAC,EACrB,CAAC,CACC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,EACtC,UAAU,EAAE,MAAM,KACf,SAAS,CAAC,MAAM,CAAC,CAAC,GACvB,KAAK,CAAC;IAEV;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;IAE7E,YAAY,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,YAAY,CAAC,GAChE,sBAAsB,CAAC;IAEzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAElC,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACnC;;GAEG;AACH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC3E,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,wBAAwB,CAAC,EACrB,CAAC,CACC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,EACtC,UAAU,EAAE,MAAM,KACf,SAAS,CAAC,MAAM,CAAC,CAAC,GACvB,KAAK,CAAC;IAEV;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;IAE7E,YAAY,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,YAAY,CAAC,GAChE,sBAAsB,CAAC;IAEzB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAE7C;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;;;WAIG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAE9C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CA4CzE;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAEtE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
3
|
export declare const badgeVariants: (props?: ({
|
|
4
|
-
color?: "
|
|
4
|
+
color?: "red" | "green" | "yellow" | "blue" | "orange" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare function Badge({ className, color, ...props }: Omit<HTMLAttributes<HTMLSpanElement>, 'color'> & VariantProps<typeof badgeVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function MethodLabel({ children, ...props }: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
@@ -14,7 +14,10 @@ export declare function CodeExampleProvider({ route, examples, initialKey, child
|
|
|
14
14
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare function CodeExample(sample: CodeSample): import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
export declare function CodeExampleSelector({ items }: SamplesProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function useRequestInitialData():
|
|
17
|
+
export declare function useRequestInitialData(): {
|
|
18
|
+
key: string;
|
|
19
|
+
data: RawRequestData;
|
|
20
|
+
};
|
|
18
21
|
export declare function useRequestDataUpdater(): {
|
|
19
22
|
setData: (data: RawRequestData, encoded: RequestData) => void;
|
|
20
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-example.d.ts","sourceRoot":"","sources":["../../../src/ui/contexts/code-example.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AActD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAmBtE,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,OAAO,EAAE,WAAW,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CA6DA;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,kDA2C7C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,2CAoB1D;AAgBD,wBAAgB,qBAAqB
|
|
1
|
+
{"version":3,"file":"code-example.d.ts","sourceRoot":"","sources":["../../../src/ui/contexts/code-example.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AActD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAmBtE,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,OAAO,EAAE,WAAW,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CA6DA;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,kDA2C7C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,2CAoB1D;AAgBD,wBAAgB,qBAAqB;;;EAIpC;AAED,wBAAgB,qBAAqB;oBA1KnB,cAAc,WAAW,WAAW,KAAK,IAAI;EA6K9D"}
|
|
@@ -89,7 +89,7 @@ function SelectDisplay({ item, ...props }) {
|
|
|
89
89
|
}
|
|
90
90
|
export function useRequestInitialData() {
|
|
91
91
|
const { getExample, key } = useContext(CodeExampleContext);
|
|
92
|
-
return getExample(key).data;
|
|
92
|
+
return { key, data: getExample(key).data };
|
|
93
93
|
}
|
|
94
94
|
export function useRequestDataUpdater() {
|
|
95
95
|
const { setData } = useContext(CodeExampleContext);
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { RootProps } from '../render/renderer.js';
|
|
3
3
|
export declare function Root({ children, className, ctx, ...props }: RootProps & HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function APIInfo({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function API({ children, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function Property({ name, type, required, deprecated, nested, ...props }: PropertyProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export declare function APIExample(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export
|
|
9
|
-
name: string;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Property, ObjectCollapsible } from '../render/schema/ui.js';
|
|
12
8
|
export { APIPage, type ApiPageProps } from '../render/api-page.js';
|
|
13
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,GAAG,cAAc,CAAC,cAAc,CAAC,2CAmB5C;AAED,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,2CAMhC;AAED,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,cAAc,CAAC,2CAmBzE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAY/D;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/ui/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { Badge } from '../ui/components/method-label.js';
|
|
3
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible';
|
|
4
|
-
import { ChevronDown } from '../icons.js';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
2
|
import { ApiProvider } from '../ui/lazy.js';
|
|
6
3
|
import { cn } from 'fumadocs-ui/utils/cn';
|
|
7
|
-
import { buttonVariants } from 'fumadocs-ui/components/ui/button';
|
|
8
4
|
export function Root({ children, className, ctx, ...props }) {
|
|
9
5
|
const mediaAdapters = {};
|
|
10
6
|
for (const k in ctx.mediaAdapters) {
|
|
@@ -23,15 +19,8 @@ export function API({ children, ...props }) {
|
|
|
23
19
|
...props.style,
|
|
24
20
|
}, children: children }));
|
|
25
21
|
}
|
|
26
|
-
export function Property({ name, type, required, deprecated, nested, ...props }) {
|
|
27
|
-
return (_jsxs("div", { className: cn('text-sm border-t', nested
|
|
28
|
-
? 'p-3 border-x bg-fd-card last:rounded-b-xl first:rounded-tr-xl last:border-b'
|
|
29
|
-
: 'py-4 first:border-t-0'), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 not-prose", children: [_jsxs("span", { className: "font-medium font-mono text-fd-primary", children: [name, required === false && (_jsx("span", { className: "text-fd-muted-foreground", children: "?" }))] }), _jsx("span", { className: "me-auto text-xs font-mono text-fd-muted-foreground", children: type }), deprecated && (_jsx(Badge, { color: "yellow", className: "text-xs", children: "Deprecated" }))] }), _jsx("div", { className: "prose-no-margin pt-2.5 empty:hidden", children: props.children })] }));
|
|
30
|
-
}
|
|
31
22
|
export function APIExample(props) {
|
|
32
23
|
return (_jsx("div", { ...props, className: cn('prose-no-margin md:sticky md:top-(--fd-api-info-top) xl:w-[400px]', props.className), children: props.children }));
|
|
33
24
|
}
|
|
34
|
-
export
|
|
35
|
-
return (_jsxs(Collapsible, { className: "my-2", ...props, children: [_jsxs(CollapsibleTrigger, { className: cn(buttonVariants({ color: 'secondary', size: 'sm' }), 'group px-3 py-2 data-[state=open]:rounded-b-none'), children: [props.name, _jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground group-data-[state=open]:rotate-180" })] }), _jsx(CollapsibleContent, { className: "-mt-px *:bg-fd-card", children: props.children })] }));
|
|
36
|
-
}
|
|
25
|
+
export { Property, ObjectCollapsible } from '../render/schema/ui.js';
|
|
37
26
|
export { APIPage } from '../render/api-page.js';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type ResolvedSchema } from '../utils/schema.js';
|
|
2
2
|
import type { ProcessedDocument } from '../utils/process-document.js';
|
|
3
|
-
export declare
|
|
3
|
+
export declare enum FormatFlags {
|
|
4
|
+
None = 0,
|
|
5
|
+
UseAlias = 1
|
|
6
|
+
}
|
|
7
|
+
export declare function schemaToString(value: ResolvedSchema, ctx?: ProcessedDocument, flags?: FormatFlags): string;
|
|
4
8
|
//# sourceMappingURL=schema-to-string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-to-string.d.ts","sourceRoot":"","sources":["../../src/utils/schema-to-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,GAAG,CAAC,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"schema-to-string.d.ts","sourceRoot":"","sources":["../../src/utils/schema-to-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,oBAAY,WAAW;IACrB,IAAI,IAAI;IACR,QAAQ,IAAS;CAClB;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,cAAc,EACrB,GAAG,CAAC,EAAE,iBAAiB,EACvB,KAAK,GAAE,WAA8B,GACpC,MAAM,CAwER"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export var FormatFlags;
|
|
2
|
+
(function (FormatFlags) {
|
|
3
|
+
FormatFlags[FormatFlags["None"] = 0] = "None";
|
|
4
|
+
FormatFlags[FormatFlags["UseAlias"] = 1] = "UseAlias";
|
|
5
|
+
})(FormatFlags || (FormatFlags = {}));
|
|
6
|
+
export function schemaToString(value, ctx, flags = FormatFlags.None) {
|
|
7
|
+
function union(union, sep, flags) {
|
|
3
8
|
const members = new Set();
|
|
4
9
|
let nullable = false;
|
|
5
10
|
for (const item of union) {
|
|
6
|
-
const result = run(item);
|
|
11
|
+
const result = run(item, flags | FormatFlags.UseAlias);
|
|
7
12
|
if (result === 'null') {
|
|
8
13
|
nullable = true;
|
|
9
14
|
}
|
|
@@ -14,39 +19,35 @@ export function schemaToString(value, ctx) {
|
|
|
14
19
|
const result = Array.from(members).join(sep);
|
|
15
20
|
return nullable ? `${result} | null` : result;
|
|
16
21
|
}
|
|
17
|
-
function run(schema) {
|
|
22
|
+
function run(schema, flags) {
|
|
18
23
|
if (schema === true)
|
|
19
24
|
return 'any';
|
|
20
25
|
else if (schema === false)
|
|
21
26
|
return 'never';
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
if ((flags & FormatFlags.UseAlias) === FormatFlags.UseAlias) {
|
|
28
|
+
if (schema.title)
|
|
29
|
+
return schema.title;
|
|
30
|
+
const ref = ctx?.getRawRef(schema);
|
|
31
|
+
if (ref)
|
|
32
|
+
return ref.split('/').at(-1);
|
|
33
|
+
}
|
|
27
34
|
if (Array.isArray(schema.type)) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const str = run(schema);
|
|
33
|
-
schema.type = types;
|
|
34
|
-
if (str !== 'unknown')
|
|
35
|
-
members.add(str);
|
|
36
|
-
}
|
|
37
|
-
return Array.from(members).join(' | ');
|
|
35
|
+
return union(schema.type.map((type) => ({
|
|
36
|
+
...schema,
|
|
37
|
+
type,
|
|
38
|
+
})), ' | ', flags);
|
|
38
39
|
}
|
|
39
40
|
if (schema.type === 'array')
|
|
40
|
-
return `array<${schema.items ? run(schema.items) : 'unknown'}>`;
|
|
41
|
+
return `array<${schema.items ? run(schema.items, flags | FormatFlags.UseAlias) : 'unknown'}>`;
|
|
41
42
|
if (schema.oneOf) {
|
|
42
|
-
return union(schema.oneOf, ' | ');
|
|
43
|
+
return union(schema.oneOf, ' | ', flags);
|
|
43
44
|
}
|
|
44
45
|
const combinedOf = schema.anyOf ?? schema.allOf;
|
|
45
46
|
if (combinedOf) {
|
|
46
|
-
return union(combinedOf, ' & ');
|
|
47
|
+
return union(combinedOf, ' & ', flags);
|
|
47
48
|
}
|
|
48
49
|
if (schema.not)
|
|
49
|
-
return `not ${run(schema.not)}`;
|
|
50
|
+
return `not ${run(schema.not, flags)}`;
|
|
50
51
|
if (schema.type === 'string' && schema.format === 'binary')
|
|
51
52
|
return 'file';
|
|
52
53
|
if (schema.type && Array.isArray(schema.type)) {
|
|
@@ -57,5 +58,5 @@ export function schemaToString(value, ctx) {
|
|
|
57
58
|
}
|
|
58
59
|
return 'unknown';
|
|
59
60
|
}
|
|
60
|
-
return run(value);
|
|
61
|
+
return run(value, flags);
|
|
61
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
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.6.
|
|
54
|
-
"@scalar/openapi-parser": "0.22.
|
|
53
|
+
"@scalar/json-magic": "^0.6.1",
|
|
54
|
+
"@scalar/openapi-parser": "0.22.3",
|
|
55
55
|
"ajv": "^8.17.1",
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
57
|
"github-slugger": "^2.0.0",
|
|
@@ -59,24 +59,24 @@
|
|
|
59
59
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
60
60
|
"js-yaml": "^4.1.0",
|
|
61
61
|
"next-themes": "^0.4.6",
|
|
62
|
-
"openapi-sampler": "^1.6.
|
|
63
|
-
"react-hook-form": "^7.
|
|
62
|
+
"openapi-sampler": "^1.6.2",
|
|
63
|
+
"react-hook-form": "^7.65.0",
|
|
64
64
|
"remark": "^15.0.1",
|
|
65
65
|
"remark-rehype": "^11.1.2",
|
|
66
66
|
"tinyglobby": "^0.2.15",
|
|
67
67
|
"xml-js": "^1.6.11",
|
|
68
|
-
"fumadocs-
|
|
69
|
-
"fumadocs-
|
|
68
|
+
"fumadocs-core": "16.0.0",
|
|
69
|
+
"fumadocs-ui": "16.0.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@scalar/api-client-react": "^1.3.
|
|
72
|
+
"@scalar/api-client-react": "^1.3.46",
|
|
73
73
|
"@types/js-yaml": "^4.0.9",
|
|
74
|
-
"@types/node": "24.
|
|
74
|
+
"@types/node": "24.9.1",
|
|
75
75
|
"@types/openapi-sampler": "^1.0.3",
|
|
76
|
-
"@types/react": "^19.2.
|
|
76
|
+
"@types/react": "^19.2.2",
|
|
77
77
|
"json-schema-typed": "^8.0.1",
|
|
78
78
|
"openapi-types": "^12.1.3",
|
|
79
|
-
"tailwindcss": "^4.1.
|
|
79
|
+
"tailwindcss": "^4.1.15",
|
|
80
80
|
"tsc-alias": "^1.8.16",
|
|
81
81
|
"eslint-config-custom": "0.0.0",
|
|
82
82
|
"tsconfig": "0.0.0"
|
package/dist/render/schema.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { ResolvedSchema } from '../utils/schema.js';
|
|
3
|
-
import type { RenderContext } from '../types.js';
|
|
4
|
-
export declare function Schema({ name, schema, required, readOnly, writeOnly, as, ctx: renderContext, }: {
|
|
5
|
-
name: string;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
schema: ResolvedSchema;
|
|
8
|
-
as?: 'property' | 'body';
|
|
9
|
-
readOnly?: boolean;
|
|
10
|
-
writeOnly?: boolean;
|
|
11
|
-
ctx: RenderContext;
|
|
12
|
-
}): ReactNode;
|
|
13
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/render/schema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,MAAM,EACN,QAAgB,EAChB,QAAgB,EAChB,SAAiB,EACjB,EAAe,EACf,GAAG,EAAE,aAAa,GACnB,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,aAAa,CAAC;CACpB,GAAG,SAAS,CA4UZ"}
|