fumadocs-openapi 10.3.7 → 10.3.9
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.js +5 -5
- package/dist/playground/components/inputs.js +2 -2
- package/dist/playground/components/oauth-dialog.js +1 -1
- package/dist/playground/components/server-select.js +1 -1
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/schema.js +1 -1
- package/dist/ui/components/accordion.js +1 -1
- package/dist/ui/operation/client.js +1 -1
- package/dist/ui/operation/index.js +4 -4
- package/dist/ui/operation/request-tabs.js +1 -1
- package/dist/ui/operation/usage-tabs/client.js +1 -1
- package/dist/ui/schema/client.js +3 -3
- package/dist/ui/schema/index.js +3 -3
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { joinURL, resolveRequestData, resolveServerUrl, withBase } from "../utils/url.js";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
5
|
+
import { MethodLabel } from "../ui/components/method-label.js";
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/components/select.js";
|
|
7
|
+
import { encodeRequestData } from "../requests/media/encode.js";
|
|
4
8
|
import { useStorageKey } from "../ui/client/storage-key.js";
|
|
5
9
|
import { useApiContext, useServerContext } from "../ui/contexts/api.js";
|
|
6
10
|
import { getStatusInfo } from "./status-info.js";
|
|
7
|
-
import { cn } from "../utils/cn.js";
|
|
8
|
-
import { MethodLabel } from "../ui/components/method-label.js";
|
|
9
11
|
import { useQuery } from "../utils/use-query.js";
|
|
10
|
-
import { encodeRequestData } from "../requests/media/encode.js";
|
|
11
12
|
import { SchemaProvider, useResolvedSchema } from "./schema.js";
|
|
12
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/components/select.js";
|
|
13
13
|
import { labelVariants } from "../ui/components/input.js";
|
|
14
14
|
import ServerSelect from "./components/server-select.js";
|
|
15
15
|
import { useExampleRequests } from "../ui/operation/usage-tabs/client.js";
|
|
@@ -17,9 +17,9 @@ import { FieldInput, FieldSet, JsonInput, ObjectInput } from "./components/input
|
|
|
17
17
|
import { Fragment, lazy, useEffect, useMemo, useRef, useState } from "react";
|
|
18
18
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { ChevronDown, LoaderCircle, X } from "lucide-react";
|
|
20
|
+
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
20
21
|
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock.core";
|
|
21
22
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "fumadocs-ui/components/ui/collapsible";
|
|
22
|
-
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
23
23
|
import { StfProvider, useDataEngine, useFieldValue, useListener, useStf } from "@fumari/stf";
|
|
24
24
|
import { objectGet, objectSet, stringifyFieldKey } from "@fumari/stf/lib/utils";
|
|
25
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { FormatFlags, schemaToString } from "../../utils/schema-to-string.js";
|
|
5
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/components/select.js";
|
|
4
6
|
import { getDefaultValue } from "../get-default-values.js";
|
|
5
7
|
import { anyFields, useFieldInfo, useResolvedSchema, useSchemaScope } from "../schema.js";
|
|
6
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/components/select.js";
|
|
7
8
|
import { Input, labelVariants } from "../../ui/components/input.js";
|
|
8
|
-
import { FormatFlags, schemaToString } from "../../utils/schema-to-string.js";
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { ChevronRight, Plus, Trash2, X } from "lucide-react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
|
-
import { useQuery } from "../../utils/use-query.js";
|
|
3
2
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/components/select.js";
|
|
3
|
+
import { useQuery } from "../../utils/use-query.js";
|
|
4
4
|
import { Input, labelVariants } from "../../ui/components/input.js";
|
|
5
5
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../ui/components/dialog.js";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { resolveServerUrl, withBase } from "../../utils/url.js";
|
|
4
|
-
import { useServerContext, useServerSelectContext } from "../../ui/contexts/api.js";
|
|
5
4
|
import { cn } from "../../utils/cn.js";
|
|
6
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/components/select.js";
|
|
6
|
+
import { useServerContext, useServerSelectContext } from "../../ui/contexts/api.js";
|
|
7
7
|
import { Input, labelVariants } from "../../ui/components/input.js";
|
|
8
8
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../ui/components/dialog.js";
|
|
9
9
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -21,6 +21,6 @@ declare function APIPlayground({
|
|
|
21
21
|
path,
|
|
22
22
|
method,
|
|
23
23
|
ctx
|
|
24
|
-
}: APIPlaygroundProps): Promise<string | number | bigint | boolean |
|
|
24
|
+
}: APIPlaygroundProps): Promise<string | number | bigint | boolean | Iterable<react.ReactNode> | react_jsx_runtime0.JSX.Element | null | undefined>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { APIPlayground, APIPlaygroundProps, ParameterField, SecurityEntry };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getDefaultValue } from "./get-default-values.js";
|
|
2
1
|
import { mergeAllOf } from "../utils/merge-schema.js";
|
|
2
|
+
import { getDefaultValue } from "./get-default-values.js";
|
|
3
3
|
import { createContext, use, useMemo, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Ajv2020 } from "ajv/dist/2020";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { ChevronRight } from "lucide-react";
|
|
6
5
|
import * as Primitive from "@radix-ui/react-accordion";
|
|
6
|
+
import { ChevronRight } from "lucide-react";
|
|
7
7
|
|
|
8
8
|
//#region src/ui/components/accordion.tsx
|
|
9
9
|
function Accordions(props) {
|
|
@@ -5,8 +5,8 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
|
|
|
5
5
|
import { createContext, use, useMemo, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Check, Copy } from "lucide-react";
|
|
8
|
-
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
9
8
|
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
|
|
9
|
+
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
10
10
|
|
|
11
11
|
//#region src/ui/operation/client.tsx
|
|
12
12
|
function CopyResponseTypeScript({ code }) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { idToTitle } from "../../utils/id-to-title.js";
|
|
2
2
|
import { createMethod, methodKeys } from "../../utils/schema.js";
|
|
3
|
-
import { isMediaTypeSupported } from "../../requests/media/resolve-adapter.js";
|
|
4
|
-
import "../../requests/media/adapter.js";
|
|
5
3
|
import { cn } from "../../utils/cn.js";
|
|
6
4
|
import { Badge, MethodLabel } from "../components/method-label.js";
|
|
7
|
-
import {
|
|
5
|
+
import { isMediaTypeSupported } from "../../requests/media/resolve-adapter.js";
|
|
6
|
+
import "../../requests/media/adapter.js";
|
|
8
7
|
import { Schema } from "../schema/index.js";
|
|
9
8
|
import { UsageTabsProviderLazy } from "./usage-tabs/lazy.js";
|
|
10
9
|
import { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions } from "../components/accordion.js";
|
|
11
10
|
import { UsageTabs } from "./usage-tabs/index.js";
|
|
12
11
|
import { CopyResponseTypeScript, SelectTab, SelectTabTrigger, SelectTabs } from "./client.js";
|
|
12
|
+
import { APIPlayground } from "../../playground/index.js";
|
|
13
13
|
import { RequestTabs, getExampleRequests } from "./request-tabs.js";
|
|
14
14
|
import { ServerProviderLazy } from "../contexts/api.lazy.js";
|
|
15
15
|
import { Fragment } from "react";
|
|
@@ -95,7 +95,7 @@ async function Operation({ type = "operation", path, method, ctx, showTitle, sho
|
|
|
95
95
|
if (!params || params.length === 0) return;
|
|
96
96
|
return /* @__PURE__ */ jsxs(Fragment, { children: [ctx.renderHeading(headingLevel, title), /* @__PURE__ */ jsx("div", {
|
|
97
97
|
className: "flex flex-col",
|
|
98
|
-
children: params.map((param) => /* @__PURE__ */ jsx(Schema, {
|
|
98
|
+
children: params.map((param) => param.schema != null && /* @__PURE__ */ jsx(Schema, {
|
|
99
99
|
client: {
|
|
100
100
|
name: param.name,
|
|
101
101
|
required: param.required
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveRequestData } from "../../utils/url.js";
|
|
2
2
|
import { getPreferredType, pickExample } from "../../utils/schema.js";
|
|
3
3
|
import { MethodLabel } from "../components/method-label.js";
|
|
4
|
-
import { encodeRequestData } from "../../requests/media/encode.js";
|
|
5
4
|
import { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions } from "../components/accordion.js";
|
|
5
|
+
import { encodeRequestData } from "../../requests/media/encode.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "fumadocs-ui/components/tabs";
|
|
8
8
|
import { sample } from "openapi-sampler";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { joinURL, resolveRequestData, resolveServerUrl, withBase } from "../../../utils/url.js";
|
|
4
|
-
import { useApiContext, useServerSelectContext } from "../../contexts/api.js";
|
|
5
4
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../components/select.js";
|
|
5
|
+
import { useApiContext, useServerSelectContext } from "../../contexts/api.js";
|
|
6
6
|
import { createContext, use, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock.core";
|
package/dist/ui/schema/client.js
CHANGED
|
@@ -4,11 +4,11 @@ import { cn } from "../../utils/cn.js";
|
|
|
4
4
|
import { Badge } from "../components/method-label.js";
|
|
5
5
|
import { Fragment, createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { ChevronDown } from "lucide-react";
|
|
8
7
|
import { cva } from "class-variance-authority";
|
|
9
|
-
import {
|
|
10
|
-
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
8
|
+
import { ChevronDown } from "lucide-react";
|
|
11
9
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "fumadocs-ui/components/tabs";
|
|
10
|
+
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
11
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "fumadocs-ui/components/ui/collapsible";
|
|
12
12
|
import { Popover, PopoverContent, PopoverTrigger } from "fumadocs-ui/components/ui/popover";
|
|
13
13
|
|
|
14
14
|
//#region src/ui/schema/client.tsx
|
package/dist/ui/schema/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mergeAllOf } from "../../utils/merge-schema.js";
|
|
2
1
|
import { FormatFlags, schemaToString } from "../../utils/schema-to-string.js";
|
|
2
|
+
import { mergeAllOf } from "../../utils/merge-schema.js";
|
|
3
3
|
import { SchemaUILazy } from "./lazy.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -154,7 +154,7 @@ function generateSchemaUI({ root, readOnly, writeOnly }, ctx) {
|
|
|
154
154
|
};
|
|
155
155
|
refs[id] = out;
|
|
156
156
|
for (const item of union) {
|
|
157
|
-
if (typeof item !== "object" || !isVisible(item)) continue;
|
|
157
|
+
if (!item || typeof item !== "object" || !isVisible(item)) continue;
|
|
158
158
|
const itemId = getSchemaId(item);
|
|
159
159
|
const key = `${id}_extends:${itemId}`;
|
|
160
160
|
scanRefs(key, {
|
|
@@ -189,7 +189,7 @@ function generateSchemaUI({ root, readOnly, writeOnly }, ctx) {
|
|
|
189
189
|
const props = Object.entries(properties);
|
|
190
190
|
if (patternProperties) props.push(...Object.entries(patternProperties));
|
|
191
191
|
for (const [key, prop] of props) {
|
|
192
|
-
if (!isVisible(prop)) continue;
|
|
192
|
+
if (!prop || !isVisible(prop)) continue;
|
|
193
193
|
const $type = getSchemaId(prop);
|
|
194
194
|
scanRefs($type, prop);
|
|
195
195
|
out.props.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.9",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"tsdown": "^0.20.3",
|
|
91
91
|
"@fumadocs/tailwind": "0.0.2",
|
|
92
92
|
"eslint-config-custom": "0.0.0",
|
|
93
|
-
"fumadocs-core": "16.6.
|
|
94
|
-
"fumadocs-ui": "16.6.
|
|
93
|
+
"fumadocs-core": "16.6.5",
|
|
94
|
+
"fumadocs-ui": "16.6.5",
|
|
95
95
|
"tsconfig": "0.0.0"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|