fumadocs-openapi 11.3.3 → 11.3.4

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.
@@ -1 +1 @@
1
- @source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-s border-t border-y break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientCredentials clientId clientSecret client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codeblock codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentType contentTypes context cookie cookies core could createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-normal font-semibold for form formData format found from fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-4 gap-x-6 gap-y-1 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green grid grid-cols-[auto_1fr] group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-1 p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaUI schemaUIShared scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
1
+ @source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-s border-t border-y break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientAuth clientAuthMethods clientCredentials clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codeblock codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentType contentTypes context cookie cookies core could createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-normal font-semibold for form formData format found from fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-4 gap-x-6 gap-y-1 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green grid grid-cols-[auto_1fr] group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-1 p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaUI schemaUIShared scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setClientAuth setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
@@ -16,6 +16,7 @@ type Translations = {
16
16
  "Binary response body, {length} bytes(playground result display)": string;
17
17
  "Body(playground)": string;
18
18
  "Callbacks(operation page)": string;
19
+ "Client Authentication(OAuth dialog)": string;
19
20
  "Client Credentials(OAuth dialog)": string;
20
21
  "Client Error(playground result display)": string;
21
22
  "Client ID(OAuth dialog)": string;
@@ -44,6 +45,7 @@ type Translations = {
44
45
  "Headers(playground result display)": string;
45
46
  "Implicit(OAuth dialog)": string;
46
47
  "In(security scheme)": string;
48
+ "Include the client ID and secret in the token request body.(OAuth dialog)": string;
47
49
  "Intended for the server-to-server authentication.(OAuth dialog)": string;
48
50
  "Internal Server Error(playground status info)": string;
49
51
  "Not Found(playground status info)": string;
@@ -62,6 +64,9 @@ type Translations = {
62
64
  "Retrieve the access token directly.(OAuth dialog)": string;
63
65
  "Scope(security scheme)": string;
64
66
  "Select a flow(OAuth dialog)": string;
67
+ "Send as Basic Auth header(OAuth dialog)": string;
68
+ "Send client credentials in body(OAuth dialog)": string;
69
+ "Send the client ID and secret in the Authorization header.(OAuth dialog)": string;
65
70
  "Send(playground)": string;
66
71
  "Server URL(playground server select)": string;
67
72
  "Submit(OAuth dialog)": string;
@@ -16,6 +16,7 @@ var keys_default = [
16
16
  "Binary response body, {length} bytes(playground result display)",
17
17
  "Body(playground)",
18
18
  "Callbacks(operation page)",
19
+ "Client Authentication(OAuth dialog)",
19
20
  "Client Credentials(OAuth dialog)",
20
21
  "Client Error(playground result display)",
21
22
  "Client ID(OAuth dialog)",
@@ -44,6 +45,7 @@ var keys_default = [
44
45
  "Headers(playground result display)",
45
46
  "Implicit(OAuth dialog)",
46
47
  "In(security scheme)",
48
+ "Include the client ID and secret in the token request body.(OAuth dialog)",
47
49
  "Intended for the server-to-server authentication.(OAuth dialog)",
48
50
  "Internal Server Error(playground status info)",
49
51
  "Not Found(playground status info)",
@@ -62,6 +64,9 @@ var keys_default = [
62
64
  "Retrieve the access token directly.(OAuth dialog)",
63
65
  "Scope(security scheme)",
64
66
  "Select a flow(OAuth dialog)",
67
+ "Send as Basic Auth header(OAuth dialog)",
68
+ "Send client credentials in body(OAuth dialog)",
69
+ "Send the client ID and secret in the Authorization header.(OAuth dialog)",
65
70
  "Send(playground)",
66
71
  "Server URL(playground server select)",
67
72
  "Submit(OAuth dialog)",
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
3
3
  const DEFAULT_MEDIA_TYPE = "application/json";
4
4
  /** Extracts and removes x-example and x-examples extensions from an object */
5
5
  function extractXExampleExtensions(obj) {
@@ -417,6 +417,19 @@ function getParameterSerializationStyle(parameter) {
417
417
  if (parameter.in in serializationStyles && collectionFormat in serializationStyles[parameter.in]) return serializationStyles[parameter.in][collectionFormat];
418
418
  return {};
419
419
  }
420
+ /**
421
+ * Translate the Swagger 2.0 `collectionFormat` of a formData array parameter into an OpenAPI 3.0
422
+ * encoding entry. Form bodies serialize arrays with the same styles as query parameters, so the
423
+ * query serialization mapping is reused. Returns undefined when there is nothing to preserve, for
424
+ * example a non-array parameter, one without a `collectionFormat`, or `tsv` which has no OpenAPI
425
+ * 3.0 equivalent.
426
+ */
427
+ function getFormDataEncoding(parameter) {
428
+ if (parameter.type !== "array" || typeof parameter.collectionFormat !== "string") return;
429
+ const encoding = querySerialization[parameter.collectionFormat];
430
+ if (!encoding || Object.keys(encoding).length === 0) return;
431
+ return encoding;
432
+ }
420
433
  function migrateBodyParameter(bodyParameter, consumes) {
421
434
  const { xExample, xExamples } = extractXExampleExtensions(bodyParameter);
422
435
  delete bodyParameter.name;
@@ -458,10 +471,14 @@ function migrateFormDataParameter(parameters, consumes = ["multipart/form-data"]
458
471
  if (formContent?.schema && typeof formContent.schema === "object" && "properties" in formContent.schema) {
459
472
  for (const param of parameters) if (param.name && formContent.schema.properties) {
460
473
  formContent.schema.properties[param.name] = {
461
- type: param.type,
462
- description: param.description,
463
- ...param.format ? { format: param.format } : {}
474
+ ...transformItemsObject(structuredClone(param)),
475
+ ...param.description !== void 0 ? { description: param.description } : {}
464
476
  };
477
+ const encoding = getFormDataEncoding(param);
478
+ if (encoding) {
479
+ formContent.encoding ??= {};
480
+ formContent.encoding[param.name] = encoding;
481
+ }
465
482
  if (param.required && Array.isArray(formContent.schema.required)) formContent.schema.required.push(param.name);
466
483
  }
467
484
  }
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
3
3
  const SCHEMA_SEGMENTS = /* @__PURE__ */ new Set([
4
4
  "properties",
5
5
  "items",
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
2
2
  /**
3
3
  * Recursively migrate XML object properties from 3.1 to 3.2 format
4
4
  */
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
2
2
  /**
3
3
  * Recursively traverses the content and applies the transform function to each node.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  import { upgradeFromThreeOneToThreeTwo } from "./3.1-to-3.2/upgrade-from-three-one-to-three-two.js";
2
2
  import { upgradeFromTwoToThree } from "./2.0-to-3.0/upgrade-from-two-to-three.js";
3
3
  import { upgradeFromThreeToThreeOne } from "./3.0-to-3.1/upgrade-from-three-to-three-one.js";
4
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
4
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
5
5
  function upgrade(value, targetVersion) {
6
6
  const openapi30 = upgradeFromTwoToThree(value);
7
7
  if (targetVersion === "3.0") return openapi30;
@@ -24,7 +24,18 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
24
24
  const [type, setType] = useState(() => {
25
25
  return Object.keys(scheme.flows)[0];
26
26
  });
27
+ const [clientAuth, setClientAuth] = useState("body");
27
28
  const t = useTranslations({ note: "OAuth dialog" });
29
+ const clientAuthMethods = {
30
+ body: {
31
+ name: t("Send client credentials in body"),
32
+ description: t("Include the client ID and secret in the token request body.")
33
+ },
34
+ header: {
35
+ name: t("Send as Basic Auth header"),
36
+ description: t("Send the client ID and secret in the Authorization header.")
37
+ }
38
+ };
28
39
  const allFlows = useMemo(() => ({
29
40
  password: {
30
41
  name: t("Resource Owner Password Flow"),
@@ -101,11 +112,15 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
101
112
  password: values.password,
102
113
  scope: scopes.join("+")
103
114
  });
104
- if (values.clientId) body.set("client_id", values.clientId);
105
- if (values.clientSecret) body.set("client_secret", values.clientSecret);
115
+ const headers = { "Content-Type": "application/x-www-form-urlencoded" };
116
+ if (clientAuth === "header") headers.Authorization = `Basic ${btoa(`${values.clientId}:${values.clientSecret}`)}`;
117
+ else {
118
+ if (values.clientId) body.set("client_id", values.clientId);
119
+ if (values.clientSecret) body.set("client_secret", values.clientSecret);
120
+ }
106
121
  res = await fetch(value.tokenUrl, {
107
122
  method: "POST",
108
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
123
+ headers,
109
124
  body
110
125
  });
111
126
  }
@@ -140,7 +155,19 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
140
155
  },
141
156
  children: [
142
157
  /* @__PURE__ */ jsxs(Select, {
143
- items: Object.fromEntries(Object.keys(scheme.flows).map((key) => [key, allFlows[key].name])),
158
+ items: Object.keys(scheme.flows).map((key) => {
159
+ const { name, description } = allFlows[key];
160
+ return {
161
+ value: key,
162
+ label: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
163
+ className: "font-medium",
164
+ children: name
165
+ }), /* @__PURE__ */ jsx("p", {
166
+ className: "text-fd-muted-foreground",
167
+ children: description
168
+ })] })
169
+ };
170
+ }),
144
171
  value: type,
145
172
  onValueChange: setType,
146
173
  children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("Select a flow") }) }), /* @__PURE__ */ jsx(SelectContent, { children: Object.keys(scheme.flows).map((key) => {
@@ -177,7 +204,7 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
177
204
  autoComplete: "off",
178
205
  disabled: isLoading,
179
206
  defaultValue: defaultValues.clientId,
180
- required: type !== "password"
207
+ required: type !== "password" || clientAuth === "header"
181
208
  })
182
209
  ]
183
210
  }),
@@ -201,43 +228,81 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
201
228
  autoComplete: "off",
202
229
  disabled: isLoading,
203
230
  defaultValue: defaultValues.clientSecret,
204
- required: type !== "password"
231
+ required: type !== "password" || clientAuth === "header"
205
232
  })
206
233
  ]
207
234
  }),
208
- type === "password" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("fieldset", {
209
- className: "flex flex-col gap-1.5",
210
- children: [/* @__PURE__ */ jsx("label", {
211
- htmlFor: "username",
212
- className: cn(labelVariants()),
213
- children: t("Username")
214
- }), /* @__PURE__ */ jsx(Input, {
215
- id: "username",
216
- name: "username",
217
- placeholder: t("Enter value"),
218
- type: "text",
219
- autoComplete: "off",
220
- disabled: isLoading,
221
- defaultValue: defaultValues.username,
222
- required: true
223
- })]
224
- }), /* @__PURE__ */ jsxs("fieldset", {
225
- className: "flex flex-col gap-1.5",
226
- children: [/* @__PURE__ */ jsx("label", {
227
- htmlFor: "password",
228
- className: cn(labelVariants()),
229
- children: t("Password")
230
- }), /* @__PURE__ */ jsx(Input, {
231
- id: "password",
232
- name: "password",
233
- placeholder: t("Enter value"),
234
- type: "password",
235
- autoComplete: "off",
236
- disabled: isLoading,
237
- defaultValue: defaultValues.password,
238
- required: true
239
- })]
240
- })] }),
235
+ type === "password" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
236
+ /* @__PURE__ */ jsxs("fieldset", {
237
+ className: "flex flex-col gap-1.5",
238
+ children: [/* @__PURE__ */ jsx("label", {
239
+ htmlFor: "client_auth",
240
+ className: cn(labelVariants()),
241
+ children: t("Client Authentication")
242
+ }), /* @__PURE__ */ jsxs(Select, {
243
+ items: Object.entries(clientAuthMethods).map(([key, method]) => ({
244
+ label: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
245
+ className: "font-medium",
246
+ children: method.name
247
+ }), /* @__PURE__ */ jsx("p", {
248
+ className: "text-fd-muted-foreground",
249
+ children: method.description
250
+ })] }),
251
+ value: key
252
+ })),
253
+ value: clientAuth,
254
+ onValueChange: (v) => v !== null && setClientAuth(v),
255
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
256
+ id: "client_auth",
257
+ disabled: isLoading,
258
+ children: /* @__PURE__ */ jsx(SelectValue, {})
259
+ }), /* @__PURE__ */ jsx(SelectContent, { children: Object.entries(clientAuthMethods).map(([key, method]) => /* @__PURE__ */ jsxs(SelectItem, {
260
+ value: key,
261
+ children: [/* @__PURE__ */ jsx("p", {
262
+ className: "font-medium",
263
+ children: method.name
264
+ }), /* @__PURE__ */ jsx("p", {
265
+ className: "text-fd-muted-foreground",
266
+ children: method.description
267
+ })]
268
+ }, key)) })]
269
+ })]
270
+ }),
271
+ /* @__PURE__ */ jsxs("fieldset", {
272
+ className: "flex flex-col gap-1.5",
273
+ children: [/* @__PURE__ */ jsx("label", {
274
+ htmlFor: "username",
275
+ className: cn(labelVariants()),
276
+ children: t("Username")
277
+ }), /* @__PURE__ */ jsx(Input, {
278
+ id: "username",
279
+ name: "username",
280
+ placeholder: t("Enter value"),
281
+ type: "text",
282
+ autoComplete: "off",
283
+ disabled: isLoading,
284
+ defaultValue: defaultValues.username,
285
+ required: true
286
+ })]
287
+ }),
288
+ /* @__PURE__ */ jsxs("fieldset", {
289
+ className: "flex flex-col gap-1.5",
290
+ children: [/* @__PURE__ */ jsx("label", {
291
+ htmlFor: "password",
292
+ className: cn(labelVariants()),
293
+ children: t("Password")
294
+ }), /* @__PURE__ */ jsx(Input, {
295
+ id: "password",
296
+ name: "password",
297
+ placeholder: t("Enter value"),
298
+ type: "password",
299
+ autoComplete: "off",
300
+ disabled: isLoading,
301
+ defaultValue: defaultValues.password,
302
+ required: true
303
+ })]
304
+ })
305
+ ] }),
241
306
  type && allFlows[type].supported ? /* @__PURE__ */ jsxs(Fragment$1, { children: [authorize.error ? /* @__PURE__ */ jsx("p", {
242
307
  className: "text-red-400 font-medium text-sm",
243
308
  children: String(authorize.error)
@@ -1,4 +1,4 @@
1
- import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.13/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
1
+ import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.15/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
2
2
  import { bundle } from "@fumadocs/api-docs/schema/bundle";
3
3
  //#region src/utils/document/load.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "11.3.3",
3
+ "version": "11.3.4",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "Docs",
@@ -45,32 +45,32 @@
45
45
  "dependencies": {
46
46
  "@fuma-translate/react": "^1.0.2",
47
47
  "@fumari/json-schema-ts": "^1.0.2",
48
- "@scalar/json-magic": "^0.12.20",
48
+ "@scalar/json-magic": "^0.13.2",
49
49
  "chokidar": "^5.0.0",
50
50
  "class-variance-authority": "^0.7.1",
51
51
  "cnfast": "^0.1.0",
52
52
  "github-slugger": "^2.0.0",
53
53
  "hast-util-to-jsx-runtime": "^2.3.6",
54
- "lucide-react": "^1.31.0",
54
+ "lucide-react": "^1.34.0",
55
55
  "remark": "^15.0.1",
56
56
  "remark-rehype": "^11.1.2",
57
57
  "shiki": "^4.4.3",
58
58
  "yaml": "^2.9.0",
59
- "@fumadocs/api-docs": "0.2.4",
60
- "@fumari/stf": "1.1.0"
59
+ "@fumari/stf": "1.1.0",
60
+ "@fumadocs/api-docs": "0.2.5"
61
61
  },
62
62
  "devDependencies": {
63
- "@scalar/api-client-react": "^2.0.38",
64
- "@scalar/openapi-upgrader": "^0.2.13",
63
+ "@scalar/api-client-react": "^2.0.42",
64
+ "@scalar/openapi-upgrader": "^0.2.15",
65
65
  "@tailwindcss/oxide": "^4.3.3",
66
- "@types/node": "26.2.0",
66
+ "@types/node": "26.3.0",
67
67
  "@types/react": "^19.2.18",
68
68
  "fast-content-type-parse": "^3.0.0",
69
69
  "json-schema-typed": "^8.0.2",
70
70
  "tsdown": "0.22.14",
71
71
  "xml-js": "^1.6.11",
72
- "fumadocs-core": "16.15.1",
73
- "fumadocs-ui": "npm:@fumadocs/base-ui@16.15.1",
72
+ "fumadocs-core": "16.15.2",
73
+ "fumadocs-ui": "npm:@fumadocs/base-ui@16.15.2",
74
74
  "tsconfig": "0.0.0"
75
75
  },
76
76
  "peerDependencies": {
@@ -94,7 +94,7 @@
94
94
  }
95
95
  },
96
96
  "inlinedDependencies": {
97
- "@scalar/openapi-upgrader": "0.2.13",
97
+ "@scalar/openapi-upgrader": "0.2.15",
98
98
  "fast-content-type-parse": "3.0.0",
99
99
  "xml-js": "1.6.11"
100
100
  },