fumadocs-openapi 12.6.10 → 12.6.11
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/css/generated/shared.css +1 -1
- package/dist/_virtual/_rolldown/runtime.js +8 -6
- package/dist/generate-file.js +9 -25
- package/dist/i18n.d.ts +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/operation.d.ts +1 -1
- package/dist/operation.js +4 -4
- package/dist/packages/shared-api/dist/auto-anchor/index.js +1 -1
- package/dist/packages/shared-api/dist/components/badge.js +1 -1
- package/dist/packages/shared-api/dist/components/collapsible.js +1 -1
- package/dist/packages/shared-api/dist/components/copy-typescript.js +3 -3
- package/dist/packages/shared-api/dist/components/defaults.d.ts +1 -1
- package/dist/packages/shared-api/dist/components/defaults.js +1 -1
- package/dist/packages/shared-api/dist/components/dialog.js +4 -4
- package/dist/packages/shared-api/dist/components/example.js +4 -4
- package/dist/packages/shared-api/dist/components/playground/fields.js +11 -11
- package/dist/packages/shared-api/dist/components/playground/json-editor.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/panels.js +6 -6
- package/dist/packages/shared-api/dist/components/playground/param-input.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/result.js +3 -3
- package/dist/packages/shared-api/dist/components/playground/schema.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/server-select.js +5 -5
- package/dist/packages/shared-api/dist/components/schema/client.js +6 -6
- package/dist/packages/shared-api/dist/components/schema/index.js +2 -2
- package/dist/packages/shared-api/dist/components/segmented.js +1 -1
- package/dist/packages/shared-api/dist/components/select-tab.js +1 -1
- package/dist/packages/shared-api/dist/components/select.js +3 -3
- package/dist/packages/shared-api/dist/components/spinner.js +1 -1
- package/dist/packages/shared-api/dist/source.js +40 -24
- package/dist/packages/shared-api/dist/utils/use-server-store.js +1 -1
- package/dist/playground/auth.d.ts +3 -3
- package/dist/playground/auth.js +3 -3
- package/dist/playground/use-playground.d.ts +2 -2
- package/dist/playground/use-playground.js +2 -2
- package/dist/press.d.ts +2 -2
- package/dist/requests/generators/csharp.js +2 -1
- package/dist/requests/generators/curl.js +2 -1
- package/dist/requests/media/adapter.d.ts +2 -0
- package/dist/requests/media/adapter.js +5 -3
- package/dist/requests/media/encode.js +4 -11
- package/dist/requests/string-utils.js +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +37 -32
- package/dist/ui/base.d.ts +1 -1
- package/dist/ui/components/schema.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/operation/index.js +6 -6
- package/dist/ui/operation/usage-tabs.js +4 -4
- package/dist/ui/playground/client.d.ts +2 -2
- package/dist/ui/playground/client.js +7 -7
- package/dist/ui/playground/components/auth.js +6 -6
- package/dist/ui/playground/components/request-panel.d.ts +2 -2
- package/dist/ui/playground/components/request-panel.js +4 -4
- package/dist/ui/playground/components/response-panel.js +3 -3
- package/dist/ui/playground/components/result-display.d.ts +1 -1
- package/dist/ui/playground/components/result-display.js +3 -3
- package/dist/ui/playground/components/server-select.js +1 -1
- package/dist/ui/scalar/client.js +5 -5
- package/dist/utils/create-page.d.ts +3 -3
- package/dist/utils/create-page.js +3 -3
- package/dist/utils/get-example-requests.js +1 -1
- package/dist/utils/pages/builder.js +1 -1
- package/dist/utils/pages/preset-auto.js +2 -2
- package/dist/utils/pages/to-static-data.d.ts +1 -1
- package/dist/utils/pages/to-static-data.js +2 -2
- package/dist/utils/pages/to-text.js +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/use-server.d.ts +1 -1
- package/dist/utils/use-server.js +1 -1
- package/package.json +13 -13
package/dist/ui/scalar/client.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import { MethodLabel } from "../components/method-label.js";
|
|
4
|
-
import { useOpenAPI } from "../../utils/create-page.js";
|
|
5
|
-
import { useEffect } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { useTranslations } from "@fuma-translate/react";
|
|
8
3
|
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
9
4
|
import { useApiClient } from "@scalar/api-client-react";
|
|
5
|
+
import { MethodLabel } from "../components/method-label.js";
|
|
10
6
|
import { useTheme } from "fumadocs-ui/provider/base";
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
9
|
+
import { useOpenAPI } from "../../utils/create-page.js";
|
|
11
10
|
import "@scalar/api-client-react/style.css";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
// src/ui/scalar/client.tsx
|
|
13
13
|
function ScalarPlayground({ path, method }) {
|
|
14
14
|
const { resolvedTheme } = useTheme();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ExampleRequest, PageOperationProps, ResponseTab } from "../operation.js";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
2
3
|
import { Awaitable, Document, HttpMethods, OperationObject, PathItemObject } from "../types.js";
|
|
3
4
|
import { OpenAPIPageProps, OperationItem, WebhookItem } from "./pages/builder.js";
|
|
4
5
|
import { DereferencedDocument } from "./document/dereference.js";
|
|
5
6
|
import { MediaAdapter } from "../requests/media/adapter.js";
|
|
6
7
|
import { CodeUsageGeneratorRegistry, InlineCodeUsageGenerator } from "../requests/generators/index.js";
|
|
8
|
+
import { JsonSchema } from "@fumadocs/json-schema";
|
|
7
9
|
import { SchemaUIOptions } from "../packages/shared-api/dist/components/schema/index.js";
|
|
8
10
|
import { PlaygroundClientOptions } from "../ui/playground/client.js";
|
|
9
|
-
import { PageComponents, ShikiOptions } from "../packages/shared-api/dist/components/defaults.js";
|
|
10
|
-
import { FC, ReactNode } from "react";
|
|
11
|
-
import { JsonSchema } from "@fumadocs/json-schema";
|
|
12
11
|
import { ShikiFactory } from "fumadocs-core/highlight/shiki";
|
|
13
12
|
import { Highlighter } from "fumadocs-core/highlight";
|
|
13
|
+
import { PageComponents, ShikiOptions } from "../packages/shared-api/dist/components/defaults.js";
|
|
14
14
|
/** components the UI renders through, so a page can replace them */
|
|
15
15
|
export interface OpenAPIComponents extends PageComponents {
|
|
16
16
|
SchemaUI: FC<SchemaUIOptions>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createContext, use, useMemo } from "react";
|
|
2
3
|
import { dereferenceBundledDocument } from "./document/dereference.js";
|
|
3
4
|
import { defaultAdapters } from "../requests/media/adapter.js";
|
|
4
5
|
import { createCodeUsageGeneratorRegistry } from "../requests/generators/index.js";
|
|
5
6
|
import { registerDefault } from "../requests/generators/all.js";
|
|
7
|
+
import { generate } from "@fumari/json-schema-ts";
|
|
8
|
+
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
6
9
|
import { createDocumentCache } from "../packages/shared-api/dist/utils/document-cache.js";
|
|
7
10
|
import { createPageComponents, defaultShikiOptions, resolveHighlighter } from "../packages/shared-api/dist/components/defaults.js";
|
|
8
11
|
import { ServerProvider } from "./use-server.js";
|
|
9
|
-
import { createContext, use, useMemo } from "react";
|
|
10
|
-
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
11
|
-
import { generate } from "@fumari/json-schema-ts";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
// src/utils/create-page.tsx
|
|
14
14
|
const OpenAPIContext = createContext(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { encodeRequestData } from "../requests/media/encode.js";
|
|
2
2
|
import { getExampleValue, getPreferredType, pickExample } from "./schema.js";
|
|
3
|
-
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
4
3
|
import { dereference, sample } from "@fumadocs/json-schema";
|
|
4
|
+
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
5
5
|
// src/utils/get-example-requests.ts
|
|
6
6
|
function getExampleRequests({ path, method, mediaAdapters, requestBody, parameters, auth = (data) => data }) {
|
|
7
7
|
const media = requestBody?.content ? getPreferredType(requestBody.content) : null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTagDisplayName, methodKeys } from "../schema.js";
|
|
2
2
|
import { idToTitle } from "../../packages/shared-api/dist/utils/id-to-title.js";
|
|
3
|
-
import { dereferenceBundledDocument } from "../document/dereference.js";
|
|
4
3
|
import { dereference } from "@fumadocs/json-schema";
|
|
4
|
+
import { dereferenceBundledDocument } from "../document/dereference.js";
|
|
5
5
|
// src/utils/pages/builder.ts
|
|
6
6
|
function fromSchema(schemaId, bundled, config) {
|
|
7
7
|
const files = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getTagDisplayName } from "../schema.js";
|
|
2
|
-
import { dereference } from "@fumadocs/json-schema";
|
|
3
1
|
import * as path from "node:path";
|
|
2
|
+
import { dereference } from "@fumadocs/json-schema";
|
|
3
|
+
import { getTagDisplayName } from "../schema.js";
|
|
4
4
|
// src/utils/pages/preset-auto.ts
|
|
5
5
|
function createAutoPreset(options) {
|
|
6
6
|
if (options.per === "custom") return options;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import Slugger from "github-slugger";
|
|
2
|
+
import { dereference } from "@fumadocs/json-schema";
|
|
1
3
|
import { dereferenceBundledDocument } from "../document/dereference.js";
|
|
2
4
|
import { getOperationTitle } from "../schema.js";
|
|
3
|
-
import { dereference } from "@fumadocs/json-schema";
|
|
4
|
-
import Slugger from "github-slugger";
|
|
5
5
|
// src/utils/pages/to-static-data.ts
|
|
6
6
|
function toStaticData(page, doc) {
|
|
7
7
|
const proxied = dereferenceBundledDocument(doc).dereferenced;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { stringify } from "yaml";
|
|
1
2
|
import { getPageProps } from "./builder.js";
|
|
2
3
|
import { toStaticData } from "./to-static-data.js";
|
|
3
4
|
import { doubleQuote, jsxString } from "../../requests/string-utils.js";
|
|
4
|
-
import { stringify } from "yaml";
|
|
5
5
|
// src/utils/pages/to-text.ts
|
|
6
6
|
function toText(entry, doc, options = {}) {
|
|
7
7
|
const { frontmatter, includeDescription = false } = options;
|
package/dist/utils/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { idToTitle } from "../packages/shared-api/dist/utils/id-to-title.js";
|
|
2
|
-
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
3
2
|
import { dereference } from "@fumadocs/json-schema";
|
|
3
|
+
import { getRaw } from "@scalar/json-magic/magic-proxy";
|
|
4
4
|
// src/utils/schema.ts
|
|
5
5
|
/** the operation fields of a Path Item, in the order of pages */
|
|
6
6
|
const methodKeys = [
|
package/dist/utils/use-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createContext, use, useCallback, useMemo, useSyncExternalStore } from "react";
|
|
2
3
|
import { useServerStore } from "../packages/shared-api/dist/utils/use-server-store.js";
|
|
3
4
|
import { joinURL, resolveServerUrl } from "../packages/shared-api/dist/utils/url.js";
|
|
4
|
-
import { createContext, use, useCallback, useMemo, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
// src/utils/use-server.tsx
|
|
7
7
|
const ServerContext = createContext(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.11",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -56,36 +56,36 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@base-ui/react": "^1.9.0",
|
|
58
58
|
"@fuma-translate/react": "^1.0.2",
|
|
59
|
-
"@fumadocs/json-schema": "^0.3.
|
|
59
|
+
"@fumadocs/json-schema": "^0.3.8",
|
|
60
60
|
"@fumari/json-schema-ts": "^1.0.2",
|
|
61
61
|
"@fumari/stf": "^1.1.2",
|
|
62
|
-
"@scalar/json-magic": "^0.
|
|
63
|
-
"@scalar/openapi-upgrader": "^0.
|
|
62
|
+
"@scalar/json-magic": "^0.24.1",
|
|
63
|
+
"@scalar/openapi-upgrader": "^0.5.5",
|
|
64
64
|
"chokidar": "^6.0.0",
|
|
65
65
|
"class-variance-authority": "^0.7.1",
|
|
66
66
|
"cn": "^0.5.2",
|
|
67
67
|
"github-slugger": "^2.0.0",
|
|
68
|
-
"lucide-react": "^1.
|
|
68
|
+
"lucide-react": "^1.87.0",
|
|
69
69
|
"remark": "^15.0.1",
|
|
70
70
|
"remark-rehype": "^11.1.2",
|
|
71
71
|
"shiki": "^4.6.0",
|
|
72
|
-
"undici": "^8.
|
|
72
|
+
"undici": "^8.14.0",
|
|
73
73
|
"yaml": "^2.9.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@scalar/api-client-react": "^2.0.
|
|
76
|
+
"@scalar/api-client-react": "^2.0.77",
|
|
77
77
|
"@tailwindcss/oxide": "^4.3.5",
|
|
78
|
-
"@types/node": "26.6.
|
|
79
|
-
"@types/react": "^19.3.
|
|
78
|
+
"@types/node": "26.6.11",
|
|
79
|
+
"@types/react": "^19.3.3",
|
|
80
80
|
"@types/react-dom": "^19.3.0",
|
|
81
81
|
"fast-content-type-parse": "^4.0.1",
|
|
82
82
|
"fuma-cli": "^0.3.4",
|
|
83
|
-
"fumadocs-core": "16.19.
|
|
84
|
-
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.
|
|
83
|
+
"fumadocs-core": "16.19.11",
|
|
84
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.11",
|
|
85
85
|
"json-schema-typed": "^9.0.0",
|
|
86
|
-
"shared-api": "0.2.
|
|
86
|
+
"shared-api": "0.2.19",
|
|
87
87
|
"tsconfig": "0.0.0",
|
|
88
|
-
"tsdown": "0.23.
|
|
88
|
+
"tsdown": "0.23.8",
|
|
89
89
|
"xml-js": "^1.6.11"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|