fumadocs-openapi 12.0.0 → 12.0.2

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("!isDefined *:data-[collapsible=true]:order-last *:min-w-0 --- --accordion-panel-height --anchor-width --available-height --available-width --collapsible-panel-height --fd-docs-row-1 --min-height --spacing --transform-origin -mode -ms-2 -mx-3 -translate-x-1/2 -translate-y-1/2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @fuma-translate/react @fumadocs/json-schema @fumari/stf @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @typescript-eslint/no-explicit-any [&[hidden]:not([hidden='until-found'])]:hidden [&_svg]:size-3.5 a absolute accept access access_token accordion actual adapter adapters additionalProperties again against alias align allFlows allOf allow already alt always an anchor anchorIdStartsWith anchorSegments and animate-spin anyFields anyOf apiExample apiKey apiPlayground applicable application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are aria-label arkdown array as asSchema async at auth auth-specific authCodeQuery authNode authSchemes authorization authorizationCode authorization_code authorize authorizes autoComplete avoid await back backdrop-blur-lg backdrop-blur-sm badgeVariants base baseDir basic be because before behavior belong bg-black/30 bg-fd-background/50 bg-fd-card bg-fd-muted bg-fd-popover bg-fd-popover/60 bg-fd-primary bg-fd-primary/10 bg-fd-secondary binary blob block blocks blue body bodyMediaType bodyNode boolean border border-b border-current border-fd-primary/20 border-s border-t border-y bottom break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles callbacks callbacksNode can cannot case catch center change charset check children class-variance-authority className cleanup client clientAuth clientAuthMethods clientCredentials clientHeight clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned closed cn code codeProps codeUsages codeblock col-span-full collapsible color compiler components configuration const content contentType contentTypes cookie cookies copying core could createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customise 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-[closed]:animate-fd-popover-out data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[open]:animate-fd-popover-in data-[open]:border-b-0 data-[popup-open]:text-fd-accent-foreground data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:h-0 data-ending-style:opacity-0 data-object-search-input data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-starting-style:h-0 data-starting-style:opacity-0 data-type dataEngine decoded default defaultMdxComponents defaultOpen defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults deferredValue define definitions delete deprecated depth dereference dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded drives duplicated duration-200 dynamic dynamicSource e eading ease-out element else empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine ensure entries entry enum error eslint-disable eslint-disable-next-line example exampleId examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetcher field fieldData fieldLabelVariants fieldName fields file filePath files filtered fine first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring focus-within:[&_svg]:text-fd-primary focus-within:ring-2 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-fd-ring folder folderStyle font-medium font-mono font-normal font-semibold for form formData format from fs full fumadocs-core/source fumadocs-core/toc 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 generate generateDefault generateSchemaUI generated get getOpenAPIPageProps getSchema getSchemas getWatchPaths ghost github-dark github-light given go grant_type gray green grid grid-cols-1 grid-cols-[auto_1fr] group group-data-[panel-open]/accordion:rotate-90 group-data-[panel-open]:rotate-180 group/accordion groupId h-(--accordion-panel-height) h-(--collapsible-panel-height) h-10 h-9 h-[240px] h-px h1 hash hast-util-to-jsx-runtime headNode header headers heading headingLevel headless hidden hiddenProperties highlighted highlighter holding hook hover:bg-fd-accent hover:text-fd-accent-foreground hover:underline how html htmlFor http i icon icon-sm icon-xs id idx if ignore img implicit import imports in in-popover index indexItemMatch info infoTags init initial inline-flex input inputs inset-0 inside installed instanceof instead integer interface internal into invalid is isDefined isDuplicated isDynamic isLazy isLoading isNumber isRequired issues it item items items-center items-start its j js json json-schema-typed justify-between justify-center key keyed keyof kind label labelClassName lang last last:border-b-0 last:mb-0 lazy leading-none leave left-1/2 length let light like line-through link links list list-disc list-inside listed load loadDocument loaderPlugin localStorage location lucide-react map mapValues marker:text-fd-muted-foreground matching max-age max-h-(--available-height) max-h-[460px] max-w-(--available-width) max-w-[98vw] max-w-full max-w-lg may mb-1 mb-2 mb-auto md mdxComponents me-auto media mediaType member merge mergeRefs message meta metaData method mime min-h-(--min-height,200px) min-w-0 min-w-[240px] min-w-[calc(var(--anchor-width)+--spacing(2))] modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must mx-1 my-0! my-1 my-1.5 my-2 my-2! my-4 name name! named namespace navigating navigation need needs nested never new no no-cache node node:fs node:path not not-last:pb-0 not-prose note null number oauth2 object objectSearchOverrides objectSet objects of off omit on onChange onClick onCopy onKeyDown onOpenChange onScrollEnd onSubmit onValueChange one oneOf ones only opacity-80 open openApiData openIdConnect openapi openapiMeta opened opens operation options or orange order-last origin origin-(--transform-origin) other out outline outline-none output over overflow-auto overflow-hidden overflow-x-auto overflow-y-auto overflow-y-hidden p-1 p-1.5 p-2 p-3 p-4 packages page pageData pages panelVariants param parameter parameterLabel parameterNode parameters params parent parentPathIndex parents parsed parsedState part parts party pass password path pathIndex pathItem pathName pathnameFromRequest pattern patternProperties payload pb-0 pb-2 pe-2 pe-3 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 persist persisted picked place placeholder placeholder:text-fd-muted-foreground playground playgrounds please plugins popover popoverRef positions pre preloadOpenAPIPage preloaded preventScroll previous primitive processor properties property props prose prose-no-margin prose-sm proxy proxyForwardCookie proxyUrl ps-1 ps-2 ps-3 ps-4.5 ps-6 pt-0 pt-1 pt-2 pt-2.5 px px-1 px-2 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-4 query querySelector quiet raw rawSearch re-triggering react react-hooks/exhaustive-deps react/jsx-runtime read readOnly readonly record red redirect_uri ref reference refs regenerated rehype-react relativePath remark remark-rehype remarkGfm remarkRehype remove removeItem removing render renderBodyField renderCodeblock renderMarkdown renderParameterField renderPopoverTrigger renderTrigger rendered renderers renders replace represents request request-body requestBody requestData requestInit requestTimeout requestUrl requests required requirement requirements res reset resize-none resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returning returns role root rootId roots rotate-90 rounded-2xl rounded-lg rounded-md rounded-sm rounded-xl route s-highlight safeParse same satisfies scalar scan schema schemaId schemaPropKeys schemaUI scheme schemeId schemes scope scopes scroll scroll-m-20 scrollTop scrollTops search secondary seconds secret section sections security segments segs select select-none selected selectedType selections selector sends sep separator server server-to-server serverSchema services set setClientAuth setError setInfo setIsJson setIsMounted setMounted setNextName setObjectUrl setOpen setPath setSearch setSelected setServerVariables setShow setStore setToken setType setValue shadow-lg shadow-md shadow-sm shared shiki shikiOptions show showDescription showExample showResponseSchema showSelect showTitle showing shrink-0 side sideOffset signal single size size-3.5 size-4 skipNonRequired skipReadOnly slot slotType slots sm sm:flex-row sm:gap-2 sm:justify-end sm:text-start smooth so source specify src stable start state staticSource status statusInfo step stf stfSync sticky still storageKey store stored string stringify stringifyFieldKey structuredData styles submit such supported svg switch t tab tabDepth tabValues tabs tag target testQuery text text-[0.8125rem] text-blue-600 text-center text-end text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-500 text-green-600 text-lg text-nowrap text-orange-400 text-orange-600 text-red-400 text-red-400/80 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain that the their them themes they this through throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo tokenUrl token_type toolbar top top-0 top-1/2 top-10 top-2 tracking-tight transform transformPageTree transition-[height,opacity] transition-[height] transition-colors transition-transform translations tree trigger true truncate try ts type typeVariants typeof types unchanged undefined under underline unexpected union unionField unions unknown unlisted unselected up update updateInfo updated updatedSchemeId updating url usageTabs use useAnchorId useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation usePlaygroundAuth useQuery useRef useRenderContext useResponseExamples useServer useState useStatusInfo useStf useTheme useTranslations useTypeScriptDefinitions used username using utf-8 v value valueSchema values variable variables variant variants via view virtual void w-0 w-14 w-[600px] w-fit w-full warn was we webhook webhooks when where whitespace-pre-wrap will with without won wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow you your z-20 z-50");
1
+ @source inline("!isDefined *:data-[collapsible=true]:order-last *:min-w-0 --- --accordion-panel-height --anchor-width --available-height --available-width --collapsible-panel-height --fd-docs-row-1 --min-height --spacing --transform-origin -mode -ms-2 -mx-3 -translate-x-1/2 -translate-y-1/2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @fuma-translate/react @fumadocs/json-schema @fumari/stf @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @typescript-eslint/no-explicit-any [&[hidden]:not([hidden='until-found'])]:hidden [&_svg]:size-3.5 a absolute accept access access_token accordion actual adapter adapters additionalProperties again against alias align allFlows allOf allow already alt always an anchor anchorIdStartsWith anchorSegments and animate-spin anyFields anyOf apiExample apiKey apiPlayground applicable application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are aria-label arkdown array as asSchema async at auth auth-specific authCodeQuery authNode authSchemes authorization authorizationCode authorization_code authorize authorizes autoComplete avoid await back backdrop-blur-lg backdrop-blur-sm badgeVariants base baseDir basic be because before behavior belong bg-black/30 bg-fd-background/50 bg-fd-card bg-fd-muted bg-fd-popover bg-fd-popover/60 bg-fd-primary bg-fd-primary/10 bg-fd-secondary binary blob block blocks blue body bodyMediaType bodyNode boolean border border-b border-current border-fd-primary/20 border-s border-t border-y bottom break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles callbacks callbacksNode can cannot case catch center change charset check children class-variance-authority className cleanup client clientAuth clientAuthMethods clientCredentials clientHeight clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned closed cn code codeProps codeUsages codeblock col-span-full collapsible color compiler components configuration const content contentType contentTypes cookie cookies copying core could createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customise 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-[closed]:animate-fd-popover-out data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[open]:animate-fd-popover-in data-[open]:border-b-0 data-[popup-open]:text-fd-accent-foreground data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:h-0 data-ending-style:opacity-0 data-object-search-input data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-starting-style:h-0 data-starting-style:opacity-0 data-type dataEngine decoded default defaultMdxComponents defaultOpen defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults deferredValue define definitions delete deprecated depth dereference dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded drives duplicated duration-200 during dynamic dynamicSource e eading ease-out element else empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine ensure entries entry enum error eslint-disable eslint-disable-next-line example exampleId examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetcher field fieldData fieldLabelVariants fieldName fields file filePath files filtered fine first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring focus-within:[&_svg]:text-fd-primary focus-within:ring-2 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-fd-ring folder folderStyle font-medium font-mono font-normal font-semibold for form formData format from fs full fumadocs-core/source fumadocs-core/toc 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 generate generateDefault generateSchemaUI generated get getOpenAPIPageProps getSchema getSchemas getWatchPaths ghost github-dark github-light given go grant_type gray green grid grid-cols-1 grid-cols-[auto_1fr] group group-data-[panel-open]/accordion:rotate-90 group-data-[panel-open]:rotate-180 group/accordion groupId h-(--accordion-panel-height) h-(--collapsible-panel-height) h-10 h-9 h-[240px] h-px h1 hash hast-util-to-jsx-runtime headNode header headers heading headingLevel headless hidden hiddenProperties highlighted highlighter holding hook hover:bg-fd-accent hover:text-fd-accent-foreground hover:underline how html htmlFor http hydration i icon icon-sm icon-xs id idx if ignore img implicit import imports in in-popover index indexItemMatch info infoTags init initial inline-flex input inputs inset-0 inside installed instanceof instead integer interface internal into invalid is isDefined isDuplicated isDynamic isLazy isLoading isMounted isNumber isRequired issues it item items items-center items-start its j js json json-schema-typed justify-between justify-center key keyed keyof kind label labelClassName lang last last:border-b-0 last:mb-0 lazy leading-none leave left-1/2 length let light like line-through link links list list-disc list-inside listed load loadDocument loaderPlugin localStorage location lucide-react map mapValues marker:text-fd-muted-foreground matching max-age max-h-(--available-height) max-h-[460px] max-w-(--available-width) max-w-[98vw] max-w-full max-w-lg may mb-1 mb-2 mb-auto md mdxComponents me-auto media mediaType member merge mergeRefs message meta metaData method mime min-h-(--min-height,200px) min-w-0 min-w-[240px] min-w-[calc(var(--anchor-width)+--spacing(2))] modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must mx-1 my-0! my-1 my-1.5 my-2 my-2! my-4 name name! named namespace navigating navigation need needs nested never new no no-cache node node:fs node:path noop not not-last:pb-0 not-prose note null number oauth2 object objectSearchOverrides objectSet objects of off omit on onChange onClick onCopy onKeyDown onOpenChange onScrollEnd onSubmit onValueChange one oneOf ones only opacity-80 open openApiData openIdConnect openapi openapiMeta opened opens operation options or orange order-last origin origin-(--transform-origin) other out outline outline-none output over overflow-auto overflow-hidden overflow-x-auto overflow-y-auto overflow-y-hidden p-1 p-1.5 p-2 p-3 p-4 packages page pageData pages panelVariants param parameter parameterLabel parameterNode parameters params parent parentPathIndex parents parsed parsedState part parts party pass password path pathIndex pathItem pathName pathnameFromRequest pattern patternProperties payload pb-0 pb-2 pe-2 pe-3 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 persist persisted picked place placeholder placeholder:text-fd-muted-foreground playground playgrounds please plugins popover popoverRef positions pre preloadOpenAPIPage preloaded preventScroll previous primitive processor properties property props prose prose-no-margin prose-sm proxy proxyForwardCookie proxyUrl ps-1 ps-2 ps-3 ps-4.5 ps-6 pt-0 pt-1 pt-2 pt-2.5 px px-1 px-2 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-4 query querySelector quiet raw rawSearch re-triggering react react-hooks/exhaustive-deps react/jsx-runtime read readOnly readonly record red redirect_uri ref reference refs regenerated rehype-react relativePath remark remark-rehype remarkGfm remarkRehype remove removeItem removing render renderBodyField renderCodeblock renderMarkdown renderParameterField renderPopoverTrigger renderTrigger rendered renderers renders replace represents request request-body requestBody requestData requestInit requestTimeout requestUrl requests required requirement requirements res reset resize-none resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returning returns role root rootId roots rotate-90 rounded-2xl rounded-lg rounded-md rounded-sm rounded-xl route s-highlight safeParse same satisfies scalar scan schema schemaId schemaPropKeys schemaUI scheme schemeId schemes scope scopes scroll scroll-m-20 scrollTop scrollTops search secondary seconds secret section sections security segments segs select select-none selected selectedType selections selector sends sep separator server server-to-server serverSchema services set setClientAuth setError setInfo setIsJson setNextName setObjectUrl setOpen setPath setSearch setSelected setServerVariables setShow setStore setToken setType setValue shadow-lg shadow-md shadow-sm shared shiki shikiOptions show showDescription showExample showResponseSchema showSelect showTitle showing shrink-0 side sideOffset signal single size size-3.5 size-4 skipNonRequired skipReadOnly slot slotType slots sm sm:flex-row sm:gap-2 sm:justify-end sm:text-start smooth so source specify src stable start state staticSource status statusInfo step stf stfSync sticky still storageKey store stored string stringify stringifyFieldKey structuredData styles submit such supported svg switch t tab tabDepth tabValues tabs tag target testQuery text text-[0.8125rem] text-blue-600 text-center text-end text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-500 text-green-600 text-lg text-nowrap text-orange-400 text-orange-600 text-red-400 text-red-400/80 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain that the their them themes they this through throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo tokenUrl token_type toolbar top top-0 top-1/2 top-10 top-2 tracking-tight transform transformPageTree transition-[height,opacity] transition-[height] transition-colors transition-transform translations tree trigger true truncate try ts type typeVariants typeof types unchanged undefined under underline unexpected union unionField unions unknown unlisted unselected up update updateInfo updated updatedSchemeId updating url usageTabs use useAnchorId useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation usePlaygroundAuth useQuery useRef useRenderContext useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used username using utf-8 v value valueSchema values variable variables variant variants via view virtual void w-0 w-14 w-[600px] w-fit w-full warn was we webhook webhooks when where whitespace-pre-wrap will with without won wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow you your z-20 z-50");
@@ -9,8 +9,8 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useArray, useDataEngine, useFieldValue, useObject } from "@fumari/stf";
10
10
  import { stringifyFieldKey } from "@fumari/stf/lib/utils";
11
11
  import { useTranslations } from "@fuma-translate/react";
12
- import { ChevronRight, Plus, Trash2, X } from "lucide-react";
13
12
  import { cva } from "class-variance-authority";
13
+ import { ChevronRight, Plus, Trash2, X } from "lucide-react";
14
14
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
15
15
  //#region ../shared-api/dist/components/playground/inputs.js
16
16
  const fieldLabelVariants = cva("w-full inline-flex items-center gap-0.5");
@@ -6,8 +6,8 @@ import { mergeRefs } from "../../utils/merge-refs.js";
6
6
  import { Fragment, Suspense, createContext, use, useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { useTranslations } from "@fuma-translate/react";
9
- import { CheckIcon, FilterIcon, LinkIcon } from "lucide-react";
10
9
  import { cva } from "class-variance-authority";
10
+ import { CheckIcon, FilterIcon, LinkIcon } from "lucide-react";
11
11
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
12
12
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
13
13
  //#region ../shared-api/dist/components/schema/client.js
@@ -1,7 +1,26 @@
1
- import { SecuritySchemeObject } from "../types.js";
1
+ import { OAuth2SecurityScheme, OperationObject, SecuritySchemeObject } from "../types.js";
2
2
  import { ReactNode } from "react";
3
- import { FieldKey } from "@fumari/stf";
3
+ import { DataEngine, FieldKey } from "@fumari/stf";
4
4
  //#region src/playground/auth.d.ts
5
+ export type OAuthFlowType = keyof NonNullable<OAuth2SecurityScheme['flows']>;
6
+ export interface OAuthFlowInput {
7
+ /** name of the security scheme */
8
+ schemeId: string;
9
+ scopes: string[];
10
+ clientId: string;
11
+ clientSecret: string;
12
+ username: string;
13
+ password: string;
14
+ /** where the password flow sends the client credentials */
15
+ clientAuth: 'body' | 'header';
16
+ }
17
+ /**
18
+ * Run an OAuth flow and resolve its token.
19
+ *
20
+ * `implicit` and `authorizationCode` leave the page instead: the token is picked up on return,
21
+ * in `usePlaygroundAuth().store`.
22
+ */
23
+ export declare function requestOAuthToken(scheme: OAuth2SecurityScheme, type: OAuthFlowType, { schemeId, scopes, clientId, clientSecret, username, password, clientAuth }: OAuthFlowInput): Promise<string | undefined>;
5
24
  /** scheme name -> token info */
6
25
  type TokenStore = Record<string, TokenInfo | undefined>;
7
26
  type TokenInfo = {
@@ -22,6 +41,12 @@ interface AuthContextType {
22
41
  error?: unknown;
23
42
  }
24
43
  export declare function usePlaygroundAuth(): AuthContextType;
44
+ export interface AuthRequirement {
45
+ /** id of the security scheme */
46
+ id: string;
47
+ scopes: string[];
48
+ scheme: SecuritySchemeObject;
49
+ }
25
50
  export interface AuthField {
26
51
  schemeId: string;
27
52
  scheme: SecuritySchemeObject;
@@ -34,4 +59,27 @@ export interface AuthField {
34
59
  /** encode the value into request data, like the header of Basic auth */
35
60
  mapOutput?: (value: unknown) => unknown;
36
61
  }
62
+ export interface AuthFields {
63
+ /** the security requirements of the operation, one of them authorizes the request */
64
+ requirements: AuthRequirement[][];
65
+ /** index of the selected requirement, `-1` when the operation needs no authorization */
66
+ selected: number;
67
+ select: (index: number) => void;
68
+ /** the fields of the selected requirement */
69
+ fields: AuthField[];
70
+ /** encode the auth fields of form values into request data */
71
+ mapValues: <T>(values: T) => T;
72
+ /** write the persisted values into the form, returns a cleanup removing them */
73
+ init: () => () => void;
74
+ }
75
+ export interface AuthFieldsOptions {
76
+ /** the operation to authorize, defaults to the security of the document */
77
+ operation?: OperationObject;
78
+ /** customise the generated fields, like their default values */
79
+ transform?: (fields: AuthField[]) => AuthField[];
80
+ }
81
+ /**
82
+ * The auth fields of an API playground: the values it persists, and the request data they encode into.
83
+ */
84
+ export declare function useAuthFields(engine: DataEngine, { operation, transform }?: AuthFieldsOptions): AuthFields;
37
85
  //#endregion
@@ -1,3 +1,3 @@
1
1
  import { BrowserFetcherOptions, FetchErrorResult, FetchResponseResult, FetchResult, Fetcher, createBrowserFetcher } from "./fetcher.js";
2
- import { usePlaygroundAuth } from "./auth.js";
3
- export { type BrowserFetcherOptions, type FetchErrorResult, type FetchResponseResult, type FetchResult, type Fetcher, createBrowserFetcher, usePlaygroundAuth };
2
+ import { AuthField, AuthRequirement, OAuthFlowType, requestOAuthToken, useAuthFields, usePlaygroundAuth } from "./auth.js";
3
+ export { type AuthField, type AuthRequirement, type BrowserFetcherOptions, type FetchErrorResult, type FetchResponseResult, type FetchResult, type Fetcher, type OAuthFlowType, createBrowserFetcher, requestOAuthToken, useAuthFields, usePlaygroundAuth };
@@ -1,3 +1,3 @@
1
- import { usePlaygroundAuth } from "./auth.js";
1
+ import { requestOAuthToken, useAuthFields, usePlaygroundAuth } from "./auth.js";
2
2
  import { createBrowserFetcher } from "./fetcher.js";
3
- export { createBrowserFetcher, usePlaygroundAuth };
3
+ export { createBrowserFetcher, requestOAuthToken, useAuthFields, usePlaygroundAuth };
@@ -1,9 +1,9 @@
1
1
  import { fromSchema, getPageProps } from "../utils/pages/builder.js";
2
2
  import { toStaticData } from "../utils/pages/to-static-data.js";
3
3
  import { createAutoPreset } from "../utils/pages/preset-auto.js";
4
- import { MethodLabel } from "../ui/components/method-label.js";
5
4
  import { createProxy } from "./proxy.js";
6
5
  import { loadDocument } from "../utils/document/load.js";
6
+ import { MethodLabel } from "../ui/components/method-label.js";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
8
  import path from "node:path";
9
9
  import { PathUtils } from "fumadocs-core/source";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { useOpenAPI, useRenderContext, useTypeScriptDefinitions } from "../../utils/create-page.js";
3
3
  import { OperationProvider, useOperation } from "../../operation.js";
4
+ import { Badge } from "../../packages/shared-api/dist/components/badge.js";
5
+ import { MethodLabel } from "../components/method-label.js";
4
6
  import { AnchorSection } from "../../packages/shared-api/dist/auto-anchor/client.js";
5
7
  import { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions } from "../../packages/shared-api/dist/components/accordion.js";
6
8
  import { Markdown } from "../components/markdown.js";
7
9
  import { UsageTabs } from "./usage-tabs.js";
8
- import { Badge } from "../../packages/shared-api/dist/components/badge.js";
9
- import { MethodLabel } from "../components/method-label.js";
10
10
  import { SchemaUI } from "../components/schema.js";
11
11
  import { RequestTabs } from "./request-tabs.js";
12
12
  import { cn } from "../../utils/cn.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { useRenderContext } from "../../utils/create-page.js";
3
3
  import { useExampleRequests, useOperation } from "../../operation.js";
4
+ import { MethodLabel } from "../components/method-label.js";
4
5
  import { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions } from "../../packages/shared-api/dist/components/accordion.js";
5
6
  import { Markdown } from "../components/markdown.js";
6
7
  import { ClientCodeBlock } from "../components/codeblock.js";
7
- import { MethodLabel } from "../components/method-label.js";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useTranslations } from "@fuma-translate/react";
10
10
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "fumadocs-ui/components/tabs";
@@ -6,8 +6,8 @@ import { useServer } from "../../utils/use-server.js";
6
6
  import { useOpenAPI } from "../../utils/create-page.js";
7
7
  import { encodeRequestData } from "../../requests/media/encode.js";
8
8
  import { useExampleRequests, useOperation } from "../../operation.js";
9
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../packages/shared-api/dist/components/select.js";
10
9
  import { MethodLabel } from "../components/method-label.js";
10
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../packages/shared-api/dist/components/select.js";
11
11
  import { cn } from "../../utils/cn.js";
12
12
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../packages/shared-api/dist/components/collapsible.js";
13
13
  import { DefaultResultDisplay } from "./components/result-display.js";
@@ -76,7 +76,7 @@ function PlaygroundClient({ writeOnly, readOnly, transformAuthInputs, fetchOptio
76
76
  transform: transformAuthInputs
77
77
  });
78
78
  const testQuery = useQuery(async (input) => {
79
- const fetcher = await import("../../playground/fetcher.js").then((mod) => mod.createBrowserFetcher(mediaAdapters, {
79
+ const fetcher = await import("../../playground/index.js").then((mod) => mod.createBrowserFetcher(mediaAdapters, {
80
80
  proxyUrl,
81
81
  ...fetchOptions
82
82
  }));
@@ -7,8 +7,8 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../pa
7
7
  import { Fragment, useEffect, useMemo, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useTranslations } from "@fuma-translate/react";
10
- import { ChevronDown, CircleX, SignpostIcon } from "lucide-react";
11
10
  import { cva } from "class-variance-authority";
11
+ import { ChevronDown, CircleX, SignpostIcon } from "lucide-react";
12
12
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
13
13
  //#region src/ui/playground/components/result-display.tsx
14
14
  var import_fast_content_type_parse = require_fast_content_type_parse();
@@ -5,20 +5,18 @@ import { cn } from "../../../utils/cn.js";
5
5
  import { Label } from "../../../packages/shared-api/dist/components/label.js";
6
6
  import { Input } from "../../../packages/shared-api/dist/components/input.js";
7
7
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../../packages/shared-api/dist/components/dialog.js";
8
- import { useEffect, useRef, useState } from "react";
8
+ import { useRef, useState, useSyncExternalStore } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { StfProvider, useFieldValue, useListener, useStf } from "@fumari/stf";
11
11
  import { useTranslations } from "@fuma-translate/react";
12
12
  import { EditIcon } from "lucide-react";
13
13
  //#region src/ui/playground/components/server-select.tsx
14
+ const noop = () => () => {};
14
15
  function ServerSelect(props) {
15
16
  const { servers, server, resolveUrl, setServer, setServerVariables } = useServer();
16
17
  const [open, setOpen] = useState(false);
17
- const [isMounted, setIsMounted] = useState(false);
18
+ const isMounted = useSyncExternalStore(noop, () => true, () => false);
18
19
  const t = useTranslations({ note: "playground server select" });
19
- useEffect(() => {
20
- setIsMounted(true);
21
- }, []);
22
20
  if (!servers || servers.length <= 0) return;
23
21
  const serverSchema = server ? servers.find((obj) => obj.url === server.url) : null;
24
22
  return /* @__PURE__ */ jsxs(Dialog, {
@@ -2,7 +2,7 @@
2
2
  import { useOpenAPI } from "../../utils/create-page.js";
3
3
  import { MethodLabel } from "../components/method-label.js";
4
4
  import { cn } from "../../utils/cn.js";
5
- import { useEffect, useState } from "react";
5
+ import { useSyncExternalStore } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useTranslations } from "@fuma-translate/react";
8
8
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
@@ -10,15 +10,13 @@ import { useApiClient } from "@scalar/api-client-react";
10
10
  import { useTheme } from "fumadocs-ui/provider/base";
11
11
  import "@scalar/api-client-react/style.css";
12
12
  //#region src/ui/scalar/client.tsx
13
+ const noop = () => () => {};
13
14
  function ScalarPlayground({ path, method }) {
14
15
  const { resolvedTheme } = useTheme();
15
16
  const { bundled } = useOpenAPI().doc;
16
17
  const t = useTranslations({ note: "scalar API client" });
17
- const [mounted, setMounted] = useState(false);
18
+ const mounted = useSyncExternalStore(noop, () => true, () => false);
18
19
  const client = useApiClient({ configuration: { content: bundled } });
19
- useEffect(() => {
20
- setMounted(true);
21
- }, []);
22
20
  return /* @__PURE__ */ jsxs("div", {
23
21
  className: cn("flex flex-row items-center gap-2.5 p-3 rounded-xl border bg-fd-card text-fd-card-foreground not-prose", mounted ? `${resolvedTheme}-mode` : null),
24
22
  children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "Docs",
@@ -77,9 +77,9 @@
77
77
  "@types/react": "^19.3.0",
78
78
  "@types/react-dom": "^19.3.0",
79
79
  "fast-content-type-parse": "^4.0.0",
80
- "fuma-cli": "^0.1.1",
81
- "fumadocs-core": "16.15.12",
82
- "fumadocs-ui": "npm:@fumadocs/base-ui@16.15.12",
80
+ "fuma-cli": "^0.3.1",
81
+ "fumadocs-core": "16.15.13",
82
+ "fumadocs-ui": "npm:@fumadocs/base-ui@16.15.13",
83
83
  "json-schema-typed": "^8.0.2",
84
84
  "shared-api": "0.2.10",
85
85
  "tsconfig": "0.0.0",