fumadocs-openapi 12.4.1 → 12.5.0

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.
Files changed (38) hide show
  1. package/css/generated/shared.css +1 -1
  2. package/dist/.translations/index.d.ts +12 -1
  3. package/dist/.translations/keys.js +12 -1
  4. package/dist/generate-file.js +3 -1
  5. package/dist/index.browser.d.ts +2 -2
  6. package/dist/index.d.ts +3 -2
  7. package/dist/operation.js +2 -2
  8. package/dist/packages/shared-api/dist/codegen.js +1 -3
  9. package/dist/packages/shared-api/dist/components/schema/client.js +1 -1
  10. package/dist/playground/auth.d.ts +84 -30
  11. package/dist/playground/auth.js +250 -150
  12. package/dist/playground/fetcher.js +11 -6
  13. package/dist/playground/index.d.ts +2 -2
  14. package/dist/playground/index.js +2 -2
  15. package/dist/playground/use-playground.d.ts +3 -3
  16. package/dist/playground/use-playground.js +46 -31
  17. package/dist/requests/generators/python.d.ts +0 -1
  18. package/dist/requests/generators/python.js +1 -1
  19. package/dist/server/index.d.ts +2 -9
  20. package/dist/server/index.js +0 -4
  21. package/dist/server/proxy.d.ts +5 -4
  22. package/dist/server/proxy.js +105 -25
  23. package/dist/types/openapi.d.ts +7 -2
  24. package/dist/types.d.ts +1 -0
  25. package/dist/ui/operation/index.js +48 -27
  26. package/dist/ui/operation/usage-tabs.js +251 -34
  27. package/dist/ui/playground/client.js +8 -4
  28. package/dist/ui/playground/components/fields.js +2 -2
  29. package/dist/ui/playground/components/oauth-panel.js +150 -39
  30. package/dist/ui/playground/components/request-panel.js +18 -3
  31. package/dist/ui/playground/components/response-panel.js +53 -90
  32. package/dist/utils/create-page.d.ts +1 -1
  33. package/dist/utils/pages/to-static-data.d.ts +12 -0
  34. package/dist/utils/use-server.js +1 -1
  35. package/package.json +7 -6
  36. package/dist/packages/shared-api/dist/components/accordion.js +0 -63
  37. package/dist/ui/operation/request-tabs.js +0 -92
  38. package/dist/ui/operation/response-tabs.js +0 -53
@@ -1 +1 @@
1
- @source inline("!collapsed !isDefined !readOnly !renderBodyField !required !supported *:data-[collapsible=true]:order-last *:flex-1 *:justify-center *:min-w-0 --- --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-row-1 --fd-docs-row-3 --spacing --transform-origin -mode -ms-0.5 -my-1 -translate-x-1/2 -translate-y-1/2 -z-1 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:empty:w-2 @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pe-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @md:grid-cols-2 @param @private @returns @scalar/api-client-react @see @sm:-me-2 @sm:-me-2.5 @sm:border-s @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:pe-7.5 @sm:pe-8 @typescript-eslint/no-explicit-any @xl:w-40 [&[hidden]:not([hidden='until-found'])]:hidden [&_*]:inline [&_a]:underline [&_code]:font-mono [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-1:0px] [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a above absolute accept access access_token accordion actions active:scale-[0.97] actual adapter adapters add added additional additionalProperties after again against alias align all allOf allow allowJson allowed already alt among an anchor anchorSegments and animate-spin animates any anyFields anyOf anyway apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applies apply are aria-checked aria-current aria-expanded aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed aria-pressed:bg-fd-background aria-pressed:ring-1 aria-pressed:ring-fd-border aria-pressed:shadow-sm aria-pressed:text-fd-foreground arkdown array arrow as async at audience auth authNode authProviders authSchemes authorization authorizationCode authorizationUrl authorization_code authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await back backdrop-blur-[1px] backdrop-blur-sm backdrop-blur-xs background badgeVariants bar base baseDir basic basis-full be before behavior below between bg-amber-500 bg-amber-500/10 bg-black/30 bg-black/40 bg-blue-500 bg-current/10 bg-fd-background bg-fd-background/50 bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-current border-dashed border-fd-muted-foreground/50 border-fd-primary border-fd-primary/20 border-s border-t bottom bottom-0 box box-content breadcrumbs break-all built-in builtinProviders bundled but button buttonVariants by bytes cache cached cachedDocFiles callbacks callbacksNode can candidates cannot card case catch cell center ch change changes charset check checkbox checked chevron chevronClassName children class class-variance-authority className cleanup clearResponse click client clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret cloned close closeDelay closest cn code codeProps codeUsages codeblock col-span-2 col-span-full collapse collapses collapsible color come compiler component components compute configuration const constraints container content contentTypes contents control cookie cookies copy copyable copying core count createContext createOAuthHandler createOpenAPIPageBase createProxy credentials cross-origin crumbClassName crumbs css csv ctx current currentValue cursor-pointer cursor-text custom customise customization cva dark dark:aria-pressed:bg-fd-accent dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:text-fd-foreground data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] dataEngine decimal declare decode decoration-dotted default defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions development deviceAuthorization dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 display displayNames disposition div do doc docCache docFilesCache docRoot docs document documented documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 during dynamic dynamicSource e each eading ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edited editing editor edits element elements else emit empty empty:hidden enabled encode encodeRequestData encoded end end-2 endpoint enforce engine entries entry enum err error eslint-disable eslint-disable-next-line even example examples exclusiveMax exclusiveMin expand export exported expressions extended extends fades fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldLabelVariants fieldName fields file fileName filePath files fill-current filling fills filter filterable finishes first first:border-t-0 first:mt-0 fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-fd-ring/50 focus-visible:ring-fd-ring/60 focus-visible:ring-inset focus-within:ring-1 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring folder folderStyle follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment from from-fd-popover fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth 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-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generated get getLink getOpenAPIPageProps getPreferredType getSchema getSchemas getWatchPaths gets ghost github-dark github-light given go goes going grant_type gray green grid grid-cols-1 grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/property group/row groupId h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-5 h-6 h-7 h-8 h-9 h-[240px] h-auto h-full h-px h1 handle handles has has-focus-visible:bg-fd-secondary has-focus-visible:ring-1 has-focus-visible:ring-fd-ring/60 has-focus-visible:ring-inset hasSecret hash hast-util-to-jsx-runtime have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys hiddenProperties highlighted highlighter hint holding holds hook hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-primary/15 hover:bg-transparent hover:text-fd-accent-foreground hover:text-fd-foreground how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface internal into invalid invisible is isDefined isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isRequired isSending isn issues it item itemSchema items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end kB keep keeping keeps kept key keyed keyof keys kind label labelClassName labelled lang larger last last:border-b-0 last:shrink-0 layout layouts lazy leading-5 leading-none leading-relaxed leave leaving left left-0 left-1/2 length let light like line-through link links list listed listen listener listeners loadDocument loaderPlugin loading loads localStorage location long longer lucide-react map mapValues margin margins marked match matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-[calc(100vw-2rem)] max-w-full max-w-lg may mb-2 mb-3 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden mdxComponents me-1 me-auto measure measured media mediaAdapters mediaType member members menu menuItems merge message meta metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] mode motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounted ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2 mt-2.5 multipart/form-data multiple must mx-1 mx-3 mx-px my-0 my-0! my-1 my-3 name name! named names namespace narrow nav navigator nearest needs nested never new next next/previous no no-cache noValidate node node:fs node:path noop normalizes not not-prose note null number oauth2 oauthOrigin oauthPanelProvider oauthRedirectUrl object objectGet objects observer obtain of off omit omitted on onAppend onAuthorize onBack onChange onCheckedChange onClick onCopy onKeyDown onLink onMount onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onToken onValueChange one oneOf ones only opacity-0 opacity-80 open openApiData openIdConnect openOnHover openapi openapiMeta opened opening opens operation options or orange order-last origin origin-(--transform-origin) other otherwise out outline outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto overview own p-0 p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 pending pendingFlowKey pendingOAuthKey persisted pill placed placeholder placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 playground playgrounds please plugins pointer-coarse:opacity-100 polite popup pre preferred prefers prefixed preloadOpenAPIPage preloaded prev preventDefault preview previous primary primitive processor prop properties property props prose prose-no-margin prose-sm provider providers proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 query quiet random range raw react react-dom react-hooks/exhaustive-deps react/jsx-runtime read read-only readOnly readonly record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rehype-react relative relativePath remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed removing render renderBodyField renderCodeblock renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requests required requirement requirements res reserved reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme response response-body responseNode responseTabs response_type responses rest restored result return returnQuery returned returnedScheme returning returns revoked right ring-1 ring-fd-border role room root rootId rotate-90 rounded rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 rowButtonClassName rows runtime s safeParse same satisfies scalar scan schema schemaId schemaKeys schemaPropKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName search secondary seconds secret section sectionIcons sectionNames sections security see segments segs select select-none selected selectedType selector selectors selects self-center send sending sends separator server server-to-server serverSchema serverUrl services sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setError setFilter setInfo setMode setMotion setName setNextName setOpen setOrigin setResponse setScopes setSelected setSending setServerVariables setShow setStack setStore setType setValue setView shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shiki shikiOptions shorten show showDescription showExample showResponseSchema showSelect showTitle shown shrink shrink-0 sibling siblings side sideOffset signal signing single size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slot slotClassName slotType slots sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:flex-row sm:gap-2 sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:justify-end sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:text-start sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] smaller smooth so some something space spellCheck sr-only src stable stack stacked start started starting starting:opacity-0 starts state staticSource status statusInfo stays step stf sticky stops storageKey store stored string stringSchema stringify stringifyFieldKey structuredData style styles submit subscribe subscribeNever such supported svg switch switches sync syncExample synced t tPlayground tab tables tabs tabular-nums tagClassName takes target tell text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-end text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-primary-foreground/60 text-fd-secondary-foreground text-green-600 text-lg text-nowrap text-orange-600 text-red-400 text-red-400/80 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then they this through throw timeout timer timerRef tips title to to-transparent toJsxRuntime toStaticData toc toggle toggled token tokenUrl token_type token_url tokens toolbar top top-(--active-tab-top) top-0 top-1/2 top-2 total tracking-tight transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations tree true truncate try ts type typeClassName typeof types unchanged undefined under underline underline-offset-4 unexpected union unionField unions unique unit unknown unlisted unset update updateInfo updated updating url usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useFieldValue useListener useMemo useNamespace useObject useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used username users using v value valueSchema values variable variables variant variants via view viewportProps virtual void w-(--active-tab-width) w-0 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn we webhook webhooks when where while whitespace-pre width widths will window with without won would wrap-anywhere wrap-break-word wrapping write writeOnly x-exclusiveCodeSample x-playground-lazy xml yellow your z-0 z-10 z-50");
1
+ @source inline("!collapsed !isDefined !readOnly !renderBodyField !required !returned *:data-[collapsible=true]:order-last *:flex-1 *:justify-center *:min-w-0 --- --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-height --fd-docs-row-3 --spacing --transform-origin -mode -ms-0.5 -ms-2 -mt-1 -my-1 -translate-x-1/2 -translate-y-1/2 -z-1 @4xl:flex @4xl:flex-col @4xl:flex-row @4xl:items-start @4xl:max-h-[calc(var(--fd-docs-height,100dvh)-var(--fd-docs-row-3,0px)-2rem)] @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-3,0px)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:empty:w-2 @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pe-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @md:grid-cols-2 @param @returns @scalar/api-client-react @see @sm:-me-2 @sm:-me-2.5 @sm:border-s @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:pe-7.5 @sm:pe-8 @typescript-eslint/no-explicit-any @xl:w-40 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a abort above absolute accept access access_token accordion actions active:scale-[0.97] actual adapter adapters add added additional additionalProperties after again against alias align all allOf allow allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applies apply are aria-checked aria-current aria-expanded aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed aria-pressed:bg-fd-background aria-pressed:ring-1 aria-pressed:ring-fd-border aria-pressed:shadow-sm aria-pressed:text-fd-foreground arkdown array arrow as async at audience auth authNode authProviders authSchemes authenticate authorization authorizationCode authorizationUrl authorization_code authorization_pending authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await away back backdrop-blur-[1px] backdrop-blur-sm backdrop-blur-xs background badgeVariants bar base baseDir basic basis-full be bearer before behavior below between bg-amber-500 bg-amber-500/10 bg-black/30 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-background/50 bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-muted-foreground/50 border-fd-primary border-fd-primary/20 border-s border-t bottom bottom-0 box box-content breadcrumbs break-all browser built-in builtinProviders bundled but button buttonVariants by bytes cache cached cachedDocFiles callbacks callbacksNode can cancel cancelled candidates cannot caption captioned captionedCodeBlock card cardCodeBlock case catch cause cell center certificate ch challenge change changes charset check checkbox checked chevron chevronClassName children class class-variance-authority className cleanup clearResponse click client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full collapse collapses collapsible color come compiler component components compute confidential config configUrl configuration configurations const constraints container content contentTypes contents control controller controllerRef cookie cookies copy copyable copying core count createContext createOAuthHandler createOpenAPIPageBase createProxy credentials cross-origin crumbClassName crumbs css csv ctx current currentValue cursor-pointer cursor-text custom customise customization cva dark dark:aria-pressed:bg-fd-accent dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:translate-x-3 data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:text-fd-foreground data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] dataEngine decimal declare decode decoration-dotted default defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions development device deviceAuthorization deviceAuthorizationUrl device_authorization_url device_code devices dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 discovered discovering display displayNames disposition div do doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 during dynamic dynamicSource e each eading early ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edited editing editor edits element elements else empty empty:hidden enabled encode encodeRequestData encoded end end-2 ending endpoint endpoints ends enforce engine enter entries entry enum err error error_description errors eslint-disable eslint-disable-next-line even every example examples exclusiveMax exclusiveMin expand expected expiresAt expires_in export exported expressions extended extends fades failed fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldLabelVariants fieldName fields file fileName filePath files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-fd-ring/50 focus-visible:ring-inset focus-visible:text-fd-accent-foreground focus-within:ring-1 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-0 focus:ring-fd-ring folder folderStyle follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment from from-fd-popover full fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generated generators get getLink getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas gets ghost github-dark github-light given go goes going grant_type grant_types_supported grants gray green grid grid-cols-1 grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-5 h-6 h-7 h-8 h-9 h-[240px] h-auto h-full h-px h1 handle handled handles has has-focus-visible:bg-fd-secondary has-focus-visible:border-fd-ring hash hast-util-to-jsx-runtime have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys hiddenProperties highlighted highlighter hint holding holds hook hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-primary/15 hover:bg-transparent hover:text-fd-accent-foreground hover:text-fd-foreground how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface interval into invalid invisible is isCopied isDefined isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isRequired isSending isn issues it item itemSchema items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end kB keep keeping keeps kept key keyed keyof keys kind label labelClassName labelled lang languages larger last last:border-b-0 last:shrink-0 layout layouts lazy leading-5 leading-none leading-relaxed leave leaving left left-0 left-1/2 length let light like line-through link links list listed listener listeners load loadDocument loaderPlugin loading loads location long longer lucide-react make map mapValues margin margins marked match matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-[calc(100vw-2rem)] max-w-full max-w-lg may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden mdxComponents me-1 me-2 me-auto measure measured media mediaAdapters mediaType member members menu menuItems merge message meta metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] mode motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounted ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2.5 mt-px multipart/form-data multiple must mutual mutualTLS mutualTLSProvider mx-1 mx-3 mx-px my-0! my-1 my-3 name name! named names namespace narrow nav navigator nearest needs nested never new next next/previous no no-cache noValidate node node:path noop noreferrer normalizes not not-prose note null number oauth oauth2 oauthPanelProvider oauthRedirectUrl object objectGet objects observer obtain of off ok omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-80 open openApiData openIdConnect openIdConnectUrl openOnHover openapi openapiMeta opened opening opens operation options or orange order-last origin origin-(--transform-origin) other otherwise out outline outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own p-0 p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-2.5 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 pendingFlowKey persisted pill placed placeholder placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popup postForm pre preferred prefers prefixed preloadOpenAPIPage preloaded presents prev preventDefault preview previous primary primitive private processor prop properties property props prose prose-no-margin prose-sm prose-xs provider providers proxied proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 pt-3 public px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 py-8 query quiet random range raw react react-dom react-hooks/exhaustive-deps react/jsx-runtime read read-only readOnly readonly record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rehype-react rejects rel relative relativePath remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res reserved reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme resolves respond response response-body responseNode responseTabs response_type responses rest restore restored result return returned returnedFlow returnedScheme returning returns revoked right ring-1 ring-fd-border role room root rootId rotate-90 rounded rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 rowButtonClassName rows run runtime s safeParse same satisfies scalar scan schema schemaId schemaKeys schemaPropKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes scopes_supported screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName search secondary seconds secret secrets section sectionIcons sectionNames sections security see segments segs select select-all select-none selected selectedType selector selectors selects self-center send sending sends separator server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setError setFilter setIndex setInfo setMode setMotion setName setNextName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShow setShowSchema setStack setType setUserCode setValue setView shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shiki shikiOptions shorten show showDescription showExample showResponseSchema showSelect showTitle shown shrink shrink-0 sibling siblings side sideOffset signal signing single size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slot slotClassName slotType slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:flex-row sm:gap-2 sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:justify-end sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:text-start sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] smaller smooth so some something space spellCheck sr-only src stable stack stacked start started starting starting:opacity-0 starts state staticSource status statusInfo stays step stf sticky stops storageKey storageKeyPrefix store stored string stringSchema stringify stringifyFieldKey structuredData style styles submit subscribeNever such suspends svg switch switches sync syncExample synced t tPlayground tab tables tabs tabular-nums tagClassName taken takes target tell text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-end text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-primary-foreground/60 text-fd-secondary-foreground text-green-600 text-lg text-nowrap text-orange-600 text-red-400 text-red-400/80 text-red-600 text-sm text-start text-xl text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then they this through throw timeout timer timerRef tips title tls to to-transparent toJsxRuntime toStaticData toc toggle toggled token tokenUrl token_type token_url toolbar top top-(--active-tab-top) top-0 top-1/2 top-2 total tracking-tight tracking-widest transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,background-color] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations tree true truncate try ts type typeClassName typeof types undefined under underline underline-offset-4 unexpected union unionField unions unique unit unknown unlisted unset until update updateInfo updated updating url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useFieldValue useMemo useNamespace useObject useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useServer useState useStatusInfo useStf useSyncExternalStore useTheme useTranslations useTypeScriptDefinitions used userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps virtual void w-(--active-tab-width) w-0 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn was we webhook webhooks when where while whitespace-pre why width widths will window with without won would wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow your z-0 z-10 z-50");
@@ -24,10 +24,12 @@ export type Translations = {
24
24
  "Body(playground)": string;
25
25
  "Breadcrumb(playground)": string;
26
26
  "Callbacks(operation page)": string;
27
+ "Cancel(OAuth dialog)": string;
27
28
  "Check the server URL. If the API does not allow cross-origin requests from this site, a proxy is needed.(playground result display)": string;
28
29
  "Choose a file(playground)": string;
29
30
  "Clear(playground result display)": string;
30
31
  "Client Credentials(OAuth dialog)": string;
32
+ "Client certificate(security scheme)": string;
31
33
  "Close(operation page)": string;
32
34
  "Close(playground)": string;
33
35
  "Conflict(playground status info)": string;
@@ -48,14 +50,18 @@ export type Translations = {
48
50
  "Empty(operation page)": string;
49
51
  "Enter Property Name(playground)": string;
50
52
  "Enter Value(playground server select)": string;
53
+ "Enter this code on the verification page.(OAuth dialog)": string;
51
54
  "Enter value(playground)": string;
52
55
  "Error(playground status info)": string;
56
+ "Example Request(operation page)": string;
53
57
  "Example Requests(operation page)": string;
58
+ "Example Response(operation page)": string;
54
59
  "Example {key}(operation page)": string;
55
60
  "Example(operation page)": string;
56
61
  "Example(playground)": string;
57
62
  "Example(schema UI)": string;
58
63
  "Failed to fetch token(playground)": string;
64
+ "Failed to load the OpenID Connect configuration(OAuth dialog)": string;
59
65
  "Fetching token...(playground)": string;
60
66
  "Field Info(playground)": string;
61
67
  "Forbidden(playground status info)": string;
@@ -71,6 +77,7 @@ export type Translations = {
71
77
  "Internal Server Error(playground status info)": string;
72
78
  "Items(schema UI)": string;
73
79
  "Length(schema UI)": string;
80
+ "Loading the OpenID Connect configuration...(OAuth dialog)": string;
74
81
  "Match(schema UI)": string;
75
82
  "Method Not Allowed(playground status info)": string;
76
83
  "Moved Permanently(playground status info)": string;
@@ -80,6 +87,7 @@ export type Translations = {
80
87
  "Not Modified(playground status info)": string;
81
88
  "Not set(playground)": string;
82
89
  "OK(playground status info)": string;
90
+ "Open verification page(OAuth dialog)": string;
83
91
  "OpenID Connect(security scheme)": string;
84
92
  "Path Parameters(operation page)": string;
85
93
  "Path(playground)": string;
@@ -93,10 +101,12 @@ export type Translations = {
93
101
  "Request Body(operation page)": string;
94
102
  "Request Failed(playground result display)": string;
95
103
  "Request(playground)": string;
104
+ "Requires a client certificate installed in your browser.(playground)": string;
96
105
  "Resource Owner Password Flow(OAuth dialog)": string;
97
106
  "Response Body(operation page)": string;
98
107
  "Response(playground)": string;
99
108
  "Retrieve the access token directly.(OAuth dialog)": string;
109
+ "Schema(operation page)": string;
100
110
  "Schema(playground)": string;
101
111
  "Scope(security scheme)": string;
102
112
  "Scopes(OAuth dialog)": string;
@@ -122,10 +132,11 @@ export type Translations = {
122
132
  "Unauthorized(playground status info)": string;
123
133
  "Unprocessable Content(playground status info)": string;
124
134
  "Unset(playground)": string;
125
- "Unsupported(OAuth dialog)": string;
126
135
  "Use the {name} type in TypeScript.(TypeScript definitions)": string;
127
136
  "Variables(playground server select)": string;
137
+ "Waiting for authorization...(OAuth dialog)": string;
128
138
  "You will be redirected to authorize, then back to this page.(OAuth dialog)": string;
139
+ "You will get a code to enter on the verification page.(OAuth dialog)": string;
129
140
  "{count} items(playground)": string;
130
141
  };
131
142
  //#endregion
@@ -24,10 +24,12 @@ var keys_default = [
24
24
  "Body(playground)",
25
25
  "Breadcrumb(playground)",
26
26
  "Callbacks(operation page)",
27
+ "Cancel(OAuth dialog)",
27
28
  "Check the server URL. If the API does not allow cross-origin requests from this site, a proxy is needed.(playground result display)",
28
29
  "Choose a file(playground)",
29
30
  "Clear(playground result display)",
30
31
  "Client Credentials(OAuth dialog)",
32
+ "Client certificate(security scheme)",
31
33
  "Close(operation page)",
32
34
  "Close(playground)",
33
35
  "Conflict(playground status info)",
@@ -48,14 +50,18 @@ var keys_default = [
48
50
  "Empty(operation page)",
49
51
  "Enter Property Name(playground)",
50
52
  "Enter Value(playground server select)",
53
+ "Enter this code on the verification page.(OAuth dialog)",
51
54
  "Enter value(playground)",
52
55
  "Error(playground status info)",
56
+ "Example Request(operation page)",
53
57
  "Example Requests(operation page)",
58
+ "Example Response(operation page)",
54
59
  "Example {key}(operation page)",
55
60
  "Example(operation page)",
56
61
  "Example(playground)",
57
62
  "Example(schema UI)",
58
63
  "Failed to fetch token(playground)",
64
+ "Failed to load the OpenID Connect configuration(OAuth dialog)",
59
65
  "Fetching token...(playground)",
60
66
  "Field Info(playground)",
61
67
  "Forbidden(playground status info)",
@@ -71,6 +77,7 @@ var keys_default = [
71
77
  "Internal Server Error(playground status info)",
72
78
  "Items(schema UI)",
73
79
  "Length(schema UI)",
80
+ "Loading the OpenID Connect configuration...(OAuth dialog)",
74
81
  "Match(schema UI)",
75
82
  "Method Not Allowed(playground status info)",
76
83
  "Moved Permanently(playground status info)",
@@ -80,6 +87,7 @@ var keys_default = [
80
87
  "Not Modified(playground status info)",
81
88
  "Not set(playground)",
82
89
  "OK(playground status info)",
90
+ "Open verification page(OAuth dialog)",
83
91
  "OpenID Connect(security scheme)",
84
92
  "Path Parameters(operation page)",
85
93
  "Path(playground)",
@@ -93,10 +101,12 @@ var keys_default = [
93
101
  "Request Body(operation page)",
94
102
  "Request Failed(playground result display)",
95
103
  "Request(playground)",
104
+ "Requires a client certificate installed in your browser.(playground)",
96
105
  "Resource Owner Password Flow(OAuth dialog)",
97
106
  "Response Body(operation page)",
98
107
  "Response(playground)",
99
108
  "Retrieve the access token directly.(OAuth dialog)",
109
+ "Schema(operation page)",
100
110
  "Schema(playground)",
101
111
  "Scope(security scheme)",
102
112
  "Scopes(OAuth dialog)",
@@ -122,10 +132,11 @@ var keys_default = [
122
132
  "Unauthorized(playground status info)",
123
133
  "Unprocessable Content(playground status info)",
124
134
  "Unset(playground)",
125
- "Unsupported(OAuth dialog)",
126
135
  "Use the {name} type in TypeScript.(TypeScript definitions)",
127
136
  "Variables(playground server select)",
137
+ "Waiting for authorization...(OAuth dialog)",
128
138
  "You will be redirected to authorize, then back to this page.(OAuth dialog)",
139
+ "You will get a code to enter on the verification page.(OAuth dialog)",
129
140
  "{count} items(playground)"
130
141
  ];
131
142
  //#endregion
@@ -2,6 +2,7 @@ import { doubleQuote } from "./requests/string-utils.js";
2
2
  import { fromSchema } from "./utils/pages/builder.js";
3
3
  import { generateDocument, toText } from "./utils/pages/to-text.js";
4
4
  import { createAutoPreset } from "./utils/pages/preset-auto.js";
5
+ import { existsSync } from "node:fs";
5
6
  import { mkdir, writeFile } from "node:fs/promises";
6
7
  import * as path$1 from "node:path";
7
8
  import { PathUtils, createGetUrl, getSlugs } from "fumadocs-core/source";
@@ -14,7 +15,8 @@ async function generateFiles(options) {
14
15
  watch: false
15
16
  };
16
17
  await generateFiles(subOptions);
17
- const targets = options.input._getWatchPaths();
18
+ const { input = [] } = options.input.options;
19
+ const targets = (Array.isArray(input) ? input : Object.keys(input)).filter((key) => !URL.canParse(key) && existsSync(key));
18
20
  console.log(`[Fumadocs OpenAPI] watching ${targets.join(", ")}`);
19
21
  watch(targets, { ignoreInitial: true }).on("all", () => generateFiles(subOptions));
20
22
  return;
@@ -1,6 +1,6 @@
1
1
  import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, OpenAPIV3_2 } from "./types/openapi.js";
2
2
  import { MediaAdapter } from "./requests/media/adapter.js";
3
- import { Awaitable, CallbackObject, DistributiveOmit, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
3
+ import { CallbackObject, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OAuthFlows, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
4
4
  import { GeneratedPageProps, OperationItem, OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookItem, WebhookOutput } from "./utils/pages/builder.js";
5
5
  import { CodeBlockProps } from "./packages/shared-api/dist/components/defaults.js";
6
6
  import { APIPlaygroundProps, CreateOpenAPIRendererOptions, GenerateTypeScriptDefinitionsContext, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, OperationPlaygroundOptions, PageLayoutProps, RenderContext, createOpenAPIBaseRenderer, createOpenAPIRenderer, useComponents, useOpenAPI, useRenderContext, useTypeScriptDefinitions } from "./utils/create-page.js";
@@ -10,4 +10,4 @@ import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
10
10
  export declare function generateFiles(): Promise<void>;
11
11
  export declare function generateFilesOnly(): Promise<never>;
12
12
  //#endregion
13
- export { APIPlaygroundProps, type Awaitable, type CallbackObject, type CodeBlockProps, CreateOpenAPIRendererOptions, type DistributiveOmit, type Document, type ExampleObject, GenerateTypeScriptDefinitionsContext, type GeneratedPageProps, type HttpMethods, type MediaAdapter, type MediaTypeObject, type OAuth2SecurityScheme, type OpenAPI, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationObject, type OperationOutput, OperationPlaygroundOptions, type OutputEntry, type OutputGroup, PageLayoutProps, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type ParameterObject, type PathItemObject, type ReferenceObject, RenderContext, type RequestBodyObject, type ResponseObject, type SchemaToPagesOptions, type SecuritySchemeObject, type SelectedServer, type ServerObject, type ServerVariableObject, type TagObject, type WebhookItem, type WebhookOutput, createOpenAPIBaseRenderer, createOpenAPIRenderer, useComponents, useOpenAPI, useRenderContext, useServer, useTypeScriptDefinitions };
13
+ export { APIPlaygroundProps, type CallbackObject, type CodeBlockProps, CreateOpenAPIRendererOptions, type Document, type ExampleObject, GenerateTypeScriptDefinitionsContext, type GeneratedPageProps, type HttpMethods, type MediaAdapter, type MediaTypeObject, type OAuth2SecurityScheme, type OAuthFlows, type OpenAPI, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationObject, type OperationOutput, OperationPlaygroundOptions, type OutputEntry, type OutputGroup, PageLayoutProps, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type ParameterObject, type PathItemObject, type ReferenceObject, RenderContext, type RequestBodyObject, type ResponseObject, type SchemaToPagesOptions, type SecuritySchemeObject, type SelectedServer, type ServerObject, type ServerVariableObject, type TagObject, type WebhookItem, type WebhookOutput, createOpenAPIBaseRenderer, createOpenAPIRenderer, useComponents, useOpenAPI, useRenderContext, useServer, useTypeScriptDefinitions };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, OpenAPIV3_2 } from "./types/openapi.js";
2
2
  import { MediaAdapter } from "./requests/media/adapter.js";
3
- import { Awaitable, CallbackObject, DistributiveOmit, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
3
+ import { CallbackObject, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OAuthFlows, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
4
4
  import { GeneratedPageProps, OperationItem, OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookItem, WebhookOutput } from "./utils/pages/builder.js";
5
5
  import { CodeBlockProps } from "./packages/shared-api/dist/components/defaults.js";
6
6
  import { APIPlaygroundProps, CreateOpenAPIRendererOptions, GenerateTypeScriptDefinitionsContext, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, OperationPlaygroundOptions, PageLayoutProps, RenderContext, createOpenAPIBaseRenderer, createOpenAPIRenderer, useComponents, useOpenAPI, useRenderContext, useTypeScriptDefinitions } from "./utils/create-page.js";
7
7
  import { SelectedServer, useServer } from "./utils/use-server.js";
8
8
  import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
9
+ import "./index.browser.js";
9
10
  import { Config, OutputFile, generateFiles, generateFilesOnly } from "./generate-file.js";
10
- export { APIPlaygroundProps, type Awaitable, type CallbackObject, type CodeBlockProps, Config, CreateOpenAPIRendererOptions, type DistributiveOmit, type Document, type ExampleObject, GenerateTypeScriptDefinitionsContext, type GeneratedPageProps, type HttpMethods, type MediaAdapter, type MediaTypeObject, type OAuth2SecurityScheme, type OpenAPI, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationObject, type OperationOutput, OperationPlaygroundOptions, type OutputEntry, OutputFile, type OutputGroup, PageLayoutProps, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type ParameterObject, type PathItemObject, type ReferenceObject, RenderContext, type RequestBodyObject, type ResponseObject, type SchemaToPagesOptions, type SecuritySchemeObject, type SelectedServer, type ServerObject, type ServerVariableObject, type TagObject, type WebhookItem, type WebhookOutput, createOpenAPIBaseRenderer, createOpenAPIRenderer, generateFiles, generateFilesOnly, useComponents, useOpenAPI, useRenderContext, useServer, useTypeScriptDefinitions };
11
+ export { APIPlaygroundProps, type CallbackObject, type CodeBlockProps, type Config, CreateOpenAPIRendererOptions, type Document, type ExampleObject, GenerateTypeScriptDefinitionsContext, type GeneratedPageProps, type HttpMethods, type MediaAdapter, type MediaTypeObject, type OAuth2SecurityScheme, type OAuthFlows, type OpenAPI, OpenAPIComponents, OpenAPIRenderOptions, OpenAPIRuntime, OpenAPIRuntimeOptions, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationObject, type OperationOutput, OperationPlaygroundOptions, type OutputEntry, type OutputFile, type OutputGroup, PageLayoutProps, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type ParameterObject, type PathItemObject, type ReferenceObject, RenderContext, type RequestBodyObject, type ResponseObject, type SchemaToPagesOptions, type SecuritySchemeObject, type SelectedServer, type ServerObject, type ServerVariableObject, type TagObject, type WebhookItem, type WebhookOutput, createOpenAPIBaseRenderer, createOpenAPIRenderer, generateFiles, generateFilesOnly, useComponents, useOpenAPI, useRenderContext, useServer, useTypeScriptDefinitions };
package/dist/operation.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { createCodeUsageGeneratorRegistry, pathnameFromRequest } from "./requests/generators/index.js";
3
- import { idToTitle } from "./packages/shared-api/dist/utils/id-to-title.js";
4
3
  import { joinURL } from "./packages/shared-api/dist/utils/url.js";
4
+ import { ServerProvider, useServer } from "./utils/use-server.js";
5
+ import { idToTitle } from "./packages/shared-api/dist/utils/id-to-title.js";
5
6
  import { encodeRequestData } from "./requests/media/encode.js";
6
7
  import { getExampleValue, getPreferredType, methodKeys } from "./utils/schema.js";
7
8
  import { getExampleRequests } from "./utils/get-example-requests.js";
8
- import { ServerProvider, useServer } from "./utils/use-server.js";
9
9
  import { useOpenAPI } from "./utils/create-page.js";
10
10
  import { createContext, use, useMemo, useSyncExternalStore } from "react";
11
11
  import { getRaw } from "@scalar/json-magic/magic-proxy";
@@ -18,9 +18,7 @@ function createCodeUsageGeneratorRegistry(inherit) {
18
18
  registry.set(id, {
19
19
  lang: generator.lang,
20
20
  label: generator.label,
21
- generate() {
22
- return typeof source === "string" ? source : "";
23
- }
21
+ generate: typeof source === "string" ? () => source : source
24
22
  });
25
23
  },
26
24
  remove(id) {
@@ -450,7 +450,7 @@ function SchemaDescription({ schema: { description, infoTags = [] }, className }
450
450
  className: "not-prose shrink-0 text-fd-muted-foreground",
451
451
  children: tag.label
452
452
  }), tag.prose ? /* @__PURE__ */ jsx("div", {
453
- className: "prose-sm prose-no-margin min-w-0 flex-1",
453
+ className: "prose-xs prose-no-margin min-w-0 flex-1",
454
454
  children: tag.value
455
455
  }) : /* @__PURE__ */ jsx("code", {
456
456
  className: "not-prose min-w-0 wrap-break-word",
@@ -1,78 +1,132 @@
1
1
  import { RawRequestData } from "../requests/types.js";
2
- import { OAuth2SecurityScheme, OperationObject, SecuritySchemeObject } from "../types.js";
2
+ import { OAuthFlows, OperationObject, SecuritySchemeObject } from "../types.js";
3
3
  import { FC, ReactNode } from "react";
4
4
  import { JsonSchema } from "@fumadocs/json-schema";
5
- import { DataEngine, FieldKey } from "@fumari/stf";
5
+ import { DataEngine, FieldKey, Stf } from "@fumari/stf";
6
6
  //#region src/playground/auth.d.ts
7
- export type OAuthFlowType = keyof NonNullable<OAuth2SecurityScheme['flows']>;
7
+ /** how token requests authenticate the client */
8
+ interface OAuthClient {
9
+ client_id: string;
10
+ client_secret: string;
11
+ client_auth: NonNullable<OAuthFlowInput['clientAuth']>;
12
+ }
13
+ /** a flow that left the page, in `sessionStorage` */
14
+ interface PendingFlow {
15
+ /** name of the security scheme */
16
+ scheme: string;
17
+ /** where the flow started, like an operation */
18
+ origin?: string;
19
+ /** the data it left the page with */
20
+ data: unknown;
21
+ /** an OAuth flow started without `redirect`, the page finishes it */
22
+ oauth?: true;
23
+ }
24
+ export type OAuthFlowType = keyof OAuthFlows;
8
25
  export interface OAuthFlowInput {
9
26
  /** name of the security scheme */
10
27
  schemeId: string;
11
28
  scopes: string[];
12
- clientId: string;
13
- clientSecret: string;
14
- username: string;
15
- password: string;
29
+ clientId?: string;
30
+ clientSecret?: string;
31
+ username?: string;
32
+ password?: string;
16
33
  /**
17
34
  * where token requests send the client credentials,
18
35
  * `header` (HTTP Basic) applies only with a client secret, otherwise the `client_id` goes in the body
36
+ *
37
+ * @defaultValue 'header'
19
38
  */
20
- clientAuth: 'body' | 'header';
39
+ clientAuth?: 'body' | 'header';
21
40
  /** URL of the selected server, relative URLs of the flow resolve against it */
22
41
  serverUrl: string;
23
42
  /** URL of the `createOAuthHandler()` route, defaults to the page */
24
43
  redirectUrl?: string;
44
+ /** URL of the `createProxy()` route, requests of confidential clients (with a client secret) and devices go through it */
45
+ proxyUrl?: string;
25
46
  /** where the flow started, like an operation, restored when it returns to the page */
26
47
  origin?: string;
27
48
  /**
28
49
  * leave the page for `implicit` and `authorizationCode`, like the one of `useAuthRedirect()`, `finishOAuthFlow()` takes `data` when it returns.
29
50
  *
30
- * By default, `usePlaygroundAuth()` finishes them.
51
+ * By default, the page finishes them, see `usePlaygroundAuth()`.
31
52
  */
32
53
  redirect?: (url: URL, data: unknown) => void;
54
+ /** show the code of `deviceAuthorization`, the token resolves once users enter it on the verification page */
55
+ onUserCode?: (code: DeviceUserCode) => void;
56
+ /** cancel the flow, like the polling of `deviceAuthorization` */
57
+ signal?: AbortSignal;
58
+ }
59
+ export interface DeviceUserCode {
60
+ /** the code users enter on the verification page */
61
+ userCode: string;
62
+ verificationUri: string;
63
+ /** the verification page with the code filled in */
64
+ verificationUriComplete?: string;
33
65
  }
34
66
  /**
35
- * Run an OAuth flow and resolve its token.
67
+ * Run an OAuth flow and resolve its token, `openIdConnect` schemes run the flows of their OpenID Connect configuration.
36
68
  *
37
69
  * `implicit` and `authorizationCode` leave the page instead, see `redirect`.
38
70
  */
39
- export declare function requestOAuthToken(scheme: OAuth2SecurityScheme, type: OAuthFlowType, { schemeId, scopes, clientId, clientSecret, username, password, clientAuth, serverUrl, redirectUrl, origin, redirect }: OAuthFlowInput): Promise<string | undefined>;
71
+ export declare function requestOAuthToken(scheme: SecuritySchemeObject, type: OAuthFlowType, { schemeId, scopes, clientId, clientSecret, username, password, clientAuth, serverUrl, redirectUrl, proxyUrl, origin, redirect, onUserCode, signal }: OAuthFlowInput): Promise<string | undefined>;
40
72
  /**
41
73
  * Finish an `implicit` or `authorizationCode` flow of `requestOAuthToken()` from the URL it returned to.
42
74
  *
43
75
  * @returns the token, `undefined` when the URL isn't returning from it
44
76
  */
45
77
  export declare function finishOAuthFlow(url: URL, data: unknown): Promise<string> | string | undefined;
46
- /** scheme name -> token info */
47
- type TokenStore = Record<string, TokenInfo | undefined>;
78
+ /** the OAuth 2.0 flows of an OpenID Connect configuration, or why discovering them failed */
79
+ type OpenIdConnectFlows = {
80
+ flows: OAuthFlows;
81
+ error?: never;
82
+ } | {
83
+ flows?: never;
84
+ error: unknown;
85
+ };
86
+ /**
87
+ * The OAuth 2.0 flows of an OpenID Connect configuration, or the error of discovering them, a relative URL resolves against the selected server.
88
+ *
89
+ * It suspends while discovering them.
90
+ */
91
+ export declare function useOpenIdConnectFlows(configUrl: string): OpenIdConnectFlows;
92
+ /**
93
+ * Leave the page for a flow of field, like signing in, with the returned function.
94
+ *
95
+ * When the page loads again, the playground reopens, and `onReturn` gets the URL and `data` of flow.
96
+ */
97
+ export declare function useAuthRedirect(field: AuthField, onReturn?: (url: URL, data: unknown) => void): (url: string | URL, data?: unknown) => void;
48
98
  type TokenInfo = {
49
99
  type: 'authorization_code';
50
100
  client_id: string;
51
101
  client_secret: string;
52
- client_auth: OAuthFlowInput['clientAuth'];
102
+ client_auth: OAuthClient['client_auth'];
53
103
  token: string;
54
104
  } | {
55
105
  type: 'implicit';
56
106
  client_id: string;
57
107
  token: string;
58
108
  };
59
- type TokenListener = (schemeId: string, token: string) => void;
60
- interface AuthContextType {
61
- store: TokenStore;
62
- isLoading: boolean;
63
- error?: unknown;
109
+ interface ReturnedFlow extends PendingFlow {
110
+ /** the URL it returned to */
111
+ url: URL;
112
+ }
113
+ interface PlaygroundAuthState {
114
+ /** the values of security schemes, shared by the playgrounds of page */
115
+ stf: Stf;
116
+ /** the flow that returned to the page, until it is handled */
117
+ returned?: ReturnedFlow;
64
118
  /** `origin` of the flow that returned to the page */
65
119
  origin?: string;
66
- /** listen to the tokens of flows returning to the page, returns a cleanup */
67
- subscribe: (listener: TokenListener) => () => void;
120
+ /** the page is finishing the returned OAuth flow */
121
+ isLoading: boolean;
122
+ error?: unknown;
123
+ /** token info of the OAuth flow the page finished, by scheme */
124
+ store: Record<string, TokenInfo | undefined>;
68
125
  }
69
- export declare function usePlaygroundAuth(): AuthContextType;
70
126
  /**
71
- * Leave the page for a flow of field, like signing in, with the returned function.
72
- *
73
- * When the page loads again, the playground reopens, and `onReturn` gets the URL and `data` of flow.
127
+ * The auth of page: the values of security schemes, and the flow that returned to it.
74
128
  */
75
- export declare function useAuthRedirect(field: AuthField, onReturn?: (url: URL, data: unknown) => void): (url: string | URL, data?: unknown) => void;
129
+ export declare function usePlaygroundAuth(): PlaygroundAuthState;
76
130
  export interface AuthRequirement {
77
131
  /** id of the security scheme */
78
132
  id: string;
@@ -117,9 +171,9 @@ export interface AuthField {
117
171
  schemeId: string;
118
172
  scheme: SecuritySchemeObject;
119
173
  scopes: string[];
120
- /** the form field holding its value */
174
+ /** the field holding its value, in the auth values of page */
121
175
  fieldName: FieldKey;
122
- /** `localStorage` key of its persisted value */
176
+ /** `sessionStorage` key of its value, kept while the tab is open */
123
177
  storageKey: string;
124
178
  defaultValue: unknown;
125
179
  provider: AuthProvider;
@@ -132,9 +186,9 @@ export interface AuthFields {
132
186
  select: (index: number) => void;
133
187
  /** the fields of the selected requirement */
134
188
  fields: AuthField[];
135
- /** encode the auth fields of form values into request data */
189
+ /** encode the auth values of page into request data, like the form values */
136
190
  mapValues: <T>(values: T) => T;
137
- /** write the persisted values into the form, returns a cleanup removing them */
191
+ /** restore the persisted values, returns a cleanup */
138
192
  init: () => () => void;
139
193
  }
140
194
  export interface AuthFieldsOptions {