fumadocs-openapi 9.1.6 → 9.1.7
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/media/adapter.js +1 -1
- package/dist/scalar/index.js +2 -2
- package/dist/server/proxy.d.ts +1 -2
- package/dist/server/proxy.d.ts.map +1 -1
- package/dist/server/proxy.js +5 -9
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/lazy.d.ts +6 -6
- package/dist/ui/lazy.d.ts.map +1 -1
- package/dist/ui/lazy.js +21 -6
- package/dist/ui/select-tabs.js +4 -4
- package/dist/ui/server-select.d.ts.map +1 -1
- package/dist/ui/server-select.js +10 -14
- package/dist/utils/schema.d.ts +2 -2
- package/dist/utils/schema.d.ts.map +1 -1
- package/package.json +8 -10
package/dist/media/adapter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { escapeString, inputToString } from '../utils/input-to-string.js';
|
|
2
2
|
// @ts-expect-error -- untyped
|
|
3
|
-
import
|
|
3
|
+
import js2xml from 'xml-js/lib/js2xml';
|
|
4
4
|
export const defaultAdapters = {
|
|
5
5
|
'application/json': {
|
|
6
6
|
encode(data) {
|
package/dist/scalar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
const Client =
|
|
2
|
+
import { lazy } from 'react';
|
|
3
|
+
const Client = lazy(() => import('./client.js'));
|
|
4
4
|
export function APIPlayground({ path, method, ctx, }) {
|
|
5
5
|
return (_jsx(Client, { method: method.method, path: path, spec: ctx.schema.downloaded }));
|
|
6
6
|
}
|
package/dist/server/proxy.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { NextRequest } from 'next/server';
|
|
2
1
|
declare const keys: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"];
|
|
3
2
|
type Proxy = {
|
|
4
|
-
[K in (typeof keys)[number]]: (req:
|
|
3
|
+
[K in (typeof keys)[number]]: (req: Request) => Promise<Response>;
|
|
5
4
|
};
|
|
6
5
|
interface CreateProxyOptions {
|
|
7
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/server/proxy.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/server/proxy.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,IAAI,4DAA6D,CAAC;AAExE,KAAK,KAAK,GAAG;KACV,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC;CAClE,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,CAwGnE"}
|
package/dist/server/proxy.js
CHANGED
|
@@ -5,21 +5,17 @@ export function createProxy(options = {}) {
|
|
|
5
5
|
}, overrides, } = options;
|
|
6
6
|
const handlers = {};
|
|
7
7
|
async function handler(req) {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const searchParams = new URL(req.url).searchParams;
|
|
9
|
+
const url = searchParams.get('url');
|
|
10
|
+
if (!url)
|
|
10
11
|
return Response.json('[Proxy] A `url` query parameter is required for proxy url', {
|
|
11
12
|
status: 400,
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
parsedUrl = new URL(url);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
14
|
+
const parsedUrl = URL.parse(url);
|
|
15
|
+
if (!parsedUrl)
|
|
19
16
|
return Response.json('[Proxy] Invalid `url` parameter value.', {
|
|
20
17
|
status: 400,
|
|
21
18
|
});
|
|
22
|
-
}
|
|
23
19
|
if (allowedOrigins && !allowedOrigins.includes(parsedUrl.origin)) {
|
|
24
20
|
return Response.json(`[Proxy] The origin "${parsedUrl.origin}" is not allowed.`, {
|
|
25
21
|
status: 400,
|
package/dist/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type PathItemObject = V3_1.PathItemObject;
|
|
|
16
16
|
export type TagObject = V3_1.TagObject;
|
|
17
17
|
export type ServerObject = NoReference<V3_1.ServerObject>;
|
|
18
18
|
export type CallbackObject = NoReference<V3_1.CallbackObject>;
|
|
19
|
+
export type ServerVariableObject = NoReference<V3_1.ServerVariableObject>;
|
|
19
20
|
export type MethodInformation = NoReference<OperationObject> & {
|
|
20
21
|
method: string;
|
|
21
22
|
};
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,OAAO,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,YAAY,EAAE,CAAC;IAExB,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;;;;;;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,uBAAuB,EAAE,MAAM,CAAC,GAClD,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAElC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC7C"}
|
package/dist/ui/lazy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CodeExampleProvider:
|
|
1
|
+
export declare const CodeExampleProvider: (props: {
|
|
2
2
|
route: string;
|
|
3
3
|
examples: {
|
|
4
4
|
key: string;
|
|
@@ -7,9 +7,9 @@ export declare const CodeExampleProvider: import("react").ComponentType<{
|
|
|
7
7
|
}[];
|
|
8
8
|
initialKey?: string;
|
|
9
9
|
children: import("react").ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare const CodeExample:
|
|
12
|
-
export declare const CodeExampleSelector:
|
|
13
|
-
export declare const ClientLazy:
|
|
14
|
-
export declare const ApiProvider:
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const CodeExample: (props: import("../render/operation/index.js").CodeSample) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const CodeExampleSelector: (props: import("../render/renderer.js").SamplesProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const ClientLazy: (props: import("../playground/client.js").ClientProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const ApiProvider: (props: import("./contexts/api.js").ApiProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
//# sourceMappingURL=lazy.d.ts.map
|
package/dist/ui/lazy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/ui/lazy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/ui/lazy.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB;;;;;;;;;6CAM/B,CAAC;AAEF,eAAO,MAAM,WAAW,8FAMvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+FAM/B,CAAC;AAEF,eAAO,MAAM,UAAU,+FAAkD,CAAC;AAE1E,eAAO,MAAM,WAAW,+FAIvB,CAAC"}
|
package/dist/ui/lazy.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { lazy, } from 'react';
|
|
4
|
+
// Waku wraps all export functions of a "use client" file in `React.lazy`, but `lazy(lazy(() => ...))` causes error.
|
|
5
|
+
// we wrap another layer of component such that it is valid
|
|
6
|
+
// TODO: perhaps we can remove it once Waku migrated to vite-rsc
|
|
7
|
+
function wrap(V) {
|
|
8
|
+
return function wrapper(props) {
|
|
9
|
+
return _jsx(V, { ...props });
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export const CodeExampleProvider = wrap(lazy(() => import('./contexts/code-example.js').then((mod) => ({
|
|
13
|
+
default: mod.CodeExampleProvider,
|
|
14
|
+
}))));
|
|
15
|
+
export const CodeExample = wrap(lazy(() => import('./contexts/code-example.js').then((mod) => ({
|
|
16
|
+
default: mod.CodeExample,
|
|
17
|
+
}))));
|
|
18
|
+
export const CodeExampleSelector = wrap(lazy(() => import('./contexts/code-example.js').then((mod) => ({
|
|
19
|
+
default: mod.CodeExampleSelector,
|
|
20
|
+
}))));
|
|
21
|
+
export const ClientLazy = wrap(lazy(() => import('../playground/client.js')));
|
|
22
|
+
export const ApiProvider = wrap(lazy(() => import('./contexts/api.js').then((mod) => ({ default: mod.ApiProvider }))));
|
package/dist/ui/select-tabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext,
|
|
3
|
+
import { createContext, useContext, useMemo, useState, } from 'react';
|
|
4
4
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../ui/components/select.js';
|
|
5
5
|
import { cn } from 'fumadocs-ui/utils/cn';
|
|
6
6
|
const Context = createContext(null);
|
|
@@ -9,12 +9,12 @@ export function SelectTabs({ defaultValue, children, }) {
|
|
|
9
9
|
return (_jsx(Context, { value: useMemo(() => ({ type, setType }), [type]), children: children }));
|
|
10
10
|
}
|
|
11
11
|
export function SelectTab({ value, ...props }) {
|
|
12
|
-
const
|
|
13
|
-
if (value !== type)
|
|
12
|
+
const ctx = useContext(Context);
|
|
13
|
+
if (value !== ctx?.type)
|
|
14
14
|
return;
|
|
15
15
|
return _jsx("div", { ...props, children: props.children });
|
|
16
16
|
}
|
|
17
17
|
export function SelectTabTrigger({ items, ...props }) {
|
|
18
|
-
const { type, setType } =
|
|
18
|
+
const { type, setType } = useContext(Context);
|
|
19
19
|
return (_jsxs(Select, { value: type ?? '', onValueChange: setType, children: [_jsx(SelectTrigger, { ...props, className: cn('not-prose w-fit', props.className), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: items.map((type) => (_jsx(SelectItem, { value: type, children: type }, type))) })] }));
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-select.d.ts","sourceRoot":"","sources":["../../src/ui/server-select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server-select.d.ts","sourceRoot":"","sources":["../../src/ui/server-select.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAejE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,uDAwDzE"}
|
package/dist/ui/server-select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useApiContext, useServerSelectContext
|
|
3
|
+
import { useApiContext, useServerSelectContext } from '../ui/contexts/api.js';
|
|
4
4
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../ui/components/select.js';
|
|
5
5
|
import { Input, labelVariants } from '../ui/components/input.js';
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
@@ -11,7 +11,7 @@ import { FormProvider, useController, useForm } from 'react-hook-form';
|
|
|
11
11
|
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
12
12
|
export default function ServerSelect(props) {
|
|
13
13
|
const { servers } = useApiContext();
|
|
14
|
-
const { server, setServer } = useServerSelectContext();
|
|
14
|
+
const { server, setServer, setServerVariables } = useServerSelectContext();
|
|
15
15
|
const [open, setOpen] = useState(false);
|
|
16
16
|
const [isMounted, setIsMounted] = useState(false);
|
|
17
17
|
useEffect(() => {
|
|
@@ -19,20 +19,18 @@ export default function ServerSelect(props) {
|
|
|
19
19
|
}, []);
|
|
20
20
|
if (servers.length <= 0)
|
|
21
21
|
return;
|
|
22
|
+
const serverSchema = server
|
|
23
|
+
? servers.find((obj) => obj.url === server.url)
|
|
24
|
+
: null;
|
|
22
25
|
return (_jsxs(Dialog, { open: open, onOpenChange: setOpen, children: [_jsx(DialogTrigger, { className: "text-xs p-3 py-2 bg-fd-muted text-fd-muted-foreground transition-colors truncate hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-none", children: isMounted
|
|
23
26
|
? withBase(server ? resolveServerUrl(server.url, server.variables) : '/', window.location.origin)
|
|
24
|
-
: 'loading...' }), _jsxs(DialogContent, { ...props, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Server URL" }), _jsx(DialogDescription, { children: "The base URL of your API endpoint." })] }), _jsxs(Select, { value: server?.url, onValueChange: setServer, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: servers.map((item) => (_jsxs(SelectItem, { value: item.url, children: [_jsx("code", { className: "text-[13px]", children: item.url }), _jsx("p", { className: "text-fd-muted-foreground", children: item.description })] }, item.url))) })] }), server &&
|
|
27
|
+
: 'loading...' }), _jsxs(DialogContent, { ...props, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Server URL" }), _jsx(DialogDescription, { children: "The base URL of your API endpoint." })] }), _jsxs(Select, { value: server?.url, onValueChange: setServer, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: servers.map((item) => (_jsxs(SelectItem, { value: item.url, children: [_jsx("code", { className: "text-[13px]", children: item.url }), _jsx("p", { className: "text-fd-muted-foreground", children: item.description })] }, item.url))) })] }), server?.variables && serverSchema?.variables && (_jsx(ServerSelectContent, { defaultValues: server.variables, schema: serverSchema.variables, onChange: setServerVariables }, server.url))] })] }));
|
|
25
28
|
}
|
|
26
|
-
function ServerSelectContent({
|
|
27
|
-
const { servers } = useApiContext();
|
|
28
|
-
const { setServerVariables } = useServerSelectContext();
|
|
29
|
-
const schema = servers.find((item) => item.url === server.url);
|
|
29
|
+
function ServerSelectContent({ defaultValues, onChange, schema, }) {
|
|
30
30
|
const form = useForm({
|
|
31
|
-
defaultValues
|
|
32
|
-
});
|
|
33
|
-
const onChangeDebounced = useEffectEvent((values) => {
|
|
34
|
-
setServerVariables(values);
|
|
31
|
+
defaultValues,
|
|
35
32
|
});
|
|
33
|
+
const onChangeDebounced = useEffectEvent(onChange);
|
|
36
34
|
useEffect(() => {
|
|
37
35
|
let timer = null;
|
|
38
36
|
return form.subscribe({
|
|
@@ -47,9 +45,7 @@ function ServerSelectContent({ server }) {
|
|
|
47
45
|
});
|
|
48
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `form` shouldn't be included
|
|
49
47
|
}, []);
|
|
50
|
-
|
|
51
|
-
return;
|
|
52
|
-
return (_jsx(FormProvider, { ...form, children: _jsx("div", { className: "flex flex-col gap-4", children: Object.entries(schema.variables).map(([key, variable]) => {
|
|
48
|
+
return (_jsx(FormProvider, { ...form, children: _jsx("div", { className: "flex flex-col gap-4", children: Object.entries(schema).map(([key, variable]) => {
|
|
53
49
|
return (_jsxs("fieldset", { className: "flex flex-col gap-1", children: [_jsx("label", { className: cn(labelVariants()), htmlFor: key, children: key }), _jsx("p", { className: "text-xs text-fd-muted-foreground empty:hidden", children: variable.description }), _jsx(Field, { fieldName: key, variable: variable })] }, key));
|
|
54
50
|
}) }) }));
|
|
55
51
|
}
|
package/dist/utils/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReferenceObject } from '../types.js';
|
|
1
|
+
import type { JSONSchema } from 'json-schema-typed/draft-2020-12';
|
|
2
|
+
import type { ReferenceObject } from '../types.js';
|
|
3
3
|
export type NoReference<T> = T extends (infer I)[] ? NoReference<I>[] : T extends ReferenceObject ? Exclude<T, ReferenceObject> : T extends object ? {
|
|
4
4
|
[K in keyof T]: NoReference<T[K]>;
|
|
5
5
|
} : T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC9C,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,SAAS,eAAe,GACvB,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,GAC3B,CAAC,SAAS,MAAM,GACd;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,GACD,CAAC,CAAC;AAEV,KAAK,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACjD,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GACf,CAAC,CAAC;AAER,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AACtC,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;AAEjE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,IAAI,EAAE,CAAC,GACN,MAAM,CAAC,GAAG,SAAS,CAIrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.7",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
51
51
|
"@radix-ui/react-select": "^2.2.5",
|
|
52
52
|
"@radix-ui/react-slot": "^1.2.3",
|
|
53
|
-
"@scalar/openapi-parser": "0.18.
|
|
53
|
+
"@scalar/openapi-parser": "0.18.3",
|
|
54
54
|
"ajv": "^8.17.1",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"github-slugger": "^2.0.0",
|
|
@@ -58,23 +58,22 @@
|
|
|
58
58
|
"js-yaml": "^4.1.0",
|
|
59
59
|
"next-themes": "^0.4.6",
|
|
60
60
|
"openapi-sampler": "^1.6.1",
|
|
61
|
-
"react-hook-form": "^7.
|
|
61
|
+
"react-hook-form": "^7.62.0",
|
|
62
62
|
"remark": "^15.0.1",
|
|
63
63
|
"remark-rehype": "^11.1.2",
|
|
64
|
-
"shiki": "^3.
|
|
64
|
+
"shiki": "^3.9.1",
|
|
65
65
|
"tinyglobby": "^0.2.14",
|
|
66
66
|
"xml-js": "^1.6.11",
|
|
67
|
-
"fumadocs-core": "15.6.
|
|
68
|
-
"fumadocs-ui": "15.6.
|
|
67
|
+
"fumadocs-core": "15.6.8",
|
|
68
|
+
"fumadocs-ui": "15.6.8"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@scalar/api-client-react": "^1.3.
|
|
71
|
+
"@scalar/api-client-react": "^1.3.26",
|
|
72
72
|
"@types/js-yaml": "^4.0.9",
|
|
73
73
|
"@types/node": "24.1.0",
|
|
74
74
|
"@types/openapi-sampler": "^1.0.3",
|
|
75
|
-
"@types/react": "^19.1.
|
|
75
|
+
"@types/react": "^19.1.9",
|
|
76
76
|
"json-schema-typed": "^8.0.1",
|
|
77
|
-
"next": "15.4.4",
|
|
78
77
|
"openapi-types": "^12.1.3",
|
|
79
78
|
"tailwindcss": "^4.1.11",
|
|
80
79
|
"tsc-alias": "^1.8.16",
|
|
@@ -84,7 +83,6 @@
|
|
|
84
83
|
"peerDependencies": {
|
|
85
84
|
"@scalar/api-client-react": "*",
|
|
86
85
|
"@types/react": "*",
|
|
87
|
-
"next": "14.x.x || 15.x.x",
|
|
88
86
|
"react": "18.x.x || 19.x.x",
|
|
89
87
|
"react-dom": "18.x.x || 19.x.x"
|
|
90
88
|
},
|