fumadocs-openapi 12.6.3 → 12.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/generated/shared.css +1 -1
- package/dist/operation.js +7 -4
- package/dist/packages/shared-api/dist/codegen.js +15 -1
- package/dist/packages/shared-api/dist/components/playground/fields.js +1 -1
- package/dist/packages/shared-api/dist/components/playground/panels.js +1 -1
- package/dist/packages/shared-api/dist/components/schema/client.js +2 -2
- package/dist/playground/fetcher.js +3 -4
- package/dist/requests/generators/all.js +2 -0
- package/dist/requests/generators/curl.js +3 -5
- package/dist/requests/generators/java.js +2 -5
- package/dist/requests/generators/ruby.d.ts +2 -0
- package/dist/requests/generators/ruby.js +37 -0
- package/dist/requests/media/adapter.js +9 -13
- package/dist/requests/media/encode.js +20 -6
- package/dist/requests/string-utils.js +18 -7
- package/dist/ui/operation/index.js +1 -1
- package/package.json +4 -3
package/css/generated/shared.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *: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 -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -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:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_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 accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside 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-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 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 blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookies copies copy copyable copying core count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization dark 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 data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden 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-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline 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 defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details 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 doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 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 edit edited editing editor edits element elements else empty enabled encode encodeRequestData encoded end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands 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 fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened 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-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring 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 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/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned 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 generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open: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/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument 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 isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lucide-react make many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages 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))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 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:scale-150 motion-safe:starting:translate-x-2 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 move moves 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 multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noop noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own 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 panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password paste 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 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers 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 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 q query quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res 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 returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies scalar scan schema schemaId schemaKeys 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 scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto 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:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-fd-accent-foreground 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-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 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 there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 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 trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning was we webhook webhooks what when where while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
|
|
1
|
+
@source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *: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 -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -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:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_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 accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside 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-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 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 blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookieString cookies copies copy copyable copying core count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization dark 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 data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden 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-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline 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 defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details 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 doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 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 edit edited editing editor edits element elements else empty enabled encode encodeRequestData end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands 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 fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened 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-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring 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 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/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned 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 generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open: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/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http hydration i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument 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 isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lucide-react make many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages 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))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 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:scale-150 motion-safe:starting:translate-x-2 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 move moves 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 multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noop noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-none output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own 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 panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password paste 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 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers 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 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 q query quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res 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 returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies scalar scan schema schemaId schemaKeys 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 scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto 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:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-fd-accent-foreground 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-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 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 there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 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 trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning was we webhook webhooks what when where while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
|
package/dist/operation.js
CHANGED
|
@@ -275,10 +275,13 @@ function useResponseExamples() {
|
|
|
275
275
|
label: t("Example"),
|
|
276
276
|
sample: getRaw(responseOfType.example)
|
|
277
277
|
}];
|
|
278
|
-
else if (responseOfType?.schema)
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
else if (responseOfType?.schema) {
|
|
279
|
+
const value = sample(responseOfType.schema, { skipWriteOnly: true });
|
|
280
|
+
tab.examples = [{
|
|
281
|
+
label: t("Example"),
|
|
282
|
+
sample: value
|
|
283
|
+
}];
|
|
284
|
+
}
|
|
282
285
|
tabs.push(tab);
|
|
283
286
|
}
|
|
284
287
|
return tabs;
|
|
@@ -87,8 +87,22 @@ function csharpRawString(str) {
|
|
|
87
87
|
while (str.includes(quotes)) quotes += "\"";
|
|
88
88
|
return `${quotes}\n${str}\n${quotes}`;
|
|
89
89
|
}
|
|
90
|
+
const rubyEscapes = {
|
|
91
|
+
"\\": "\\\\",
|
|
92
|
+
"\"": "\\\"",
|
|
93
|
+
"#": "\\#",
|
|
94
|
+
"\n": "\\n",
|
|
95
|
+
"\r": "\\r",
|
|
96
|
+
" ": "\\t",
|
|
97
|
+
"\0": "\\u{0}"
|
|
98
|
+
};
|
|
99
|
+
/** a Ruby single-quoted string, double-quoted with escapes for the CRs and NULs it can't show */
|
|
100
|
+
function rubyString(str) {
|
|
101
|
+
if (/[\r\0]/.test(str)) return `"${str.replace(/[\\"#\n\r\t\0]/g, (c) => rubyEscapes[c])}"`;
|
|
102
|
+
return `'${str.replace(/[\\']/g, "\\$&")}'`;
|
|
103
|
+
}
|
|
90
104
|
/** single quotes keep the string literal, each `'` closes them to add an escaped quote */
|
|
91
105
|
function shellQuote(str) {
|
|
92
106
|
return `'${str.replaceAll("'", `'\\''`)}'`;
|
|
93
107
|
}
|
|
94
|
-
export { createCodeUsageGeneratorRegistry, csharpRawString, goString, javaTextBlock, jsTemplateLiteral, pythonString, rustEscapedString, rustString, shellQuote };
|
|
108
|
+
export { createCodeUsageGeneratorRegistry, csharpRawString, goString, javaTextBlock, jsTemplateLiteral, pythonString, rubyString, rustEscapedString, rustString, shellQuote };
|
|
@@ -199,7 +199,7 @@ function Row({ name, required = false, info, htmlFor, readOnly = false, quiet =
|
|
|
199
199
|
sideOffset: 6,
|
|
200
200
|
className: "z-50",
|
|
201
201
|
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
202
|
-
className: "w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) rounded-xl border bg-fd-popover p-3 text-fd-popover-foreground shadow-lg outline-none transition-[opacity,scale] duration-150 ease-out data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none",
|
|
202
|
+
className: "w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) wrap-break-word rounded-xl border bg-fd-popover p-3 text-fd-popover-foreground shadow-lg outline-none transition-[opacity,scale] duration-150 ease-out data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none",
|
|
203
203
|
children: info
|
|
204
204
|
})
|
|
205
205
|
}) })
|
|
@@ -102,7 +102,7 @@ function FieldPanel({ fields: { stack, motion, navigate, openNested }, root, dis
|
|
|
102
102
|
/** a panel over the overview, its content animates in when `id` changes */
|
|
103
103
|
function Panel({ id, motion, nav, children }) {
|
|
104
104
|
return /* @__PURE__ */ jsxs("div", {
|
|
105
|
-
className: "flex min-h-0 flex-col [grid-area:1/1]",
|
|
105
|
+
className: "flex min-h-0 min-w-0 flex-col wrap-break-word [grid-area:1/1]",
|
|
106
106
|
children: [nav, /* @__PURE__ */ jsx("div", {
|
|
107
107
|
className: cn("fd-scroll-container min-h-0 flex-1 overflow-y-auto starting:opacity-0", transitionClassName, motionClassNames[motion]),
|
|
108
108
|
children
|
|
@@ -427,7 +427,7 @@ function TypeInfo({ name, $ref, children }) {
|
|
|
427
427
|
function SchemaDescription({ schema: { description, infoTags = [] }, className }) {
|
|
428
428
|
if (!description && infoTags.length === 0) return null;
|
|
429
429
|
return /* @__PURE__ */ jsxs("div", {
|
|
430
|
-
className: cn("flex flex-col gap-2 text-fd-muted-foreground", className),
|
|
430
|
+
className: cn("flex flex-col gap-2 wrap-break-word text-fd-muted-foreground", className),
|
|
431
431
|
children: [description && /* @__PURE__ */ jsx("div", {
|
|
432
432
|
className: "prose-no-margin",
|
|
433
433
|
children: description
|
|
@@ -456,7 +456,7 @@ function SchemaDescription({ schema: { description, infoTags = [] }, className }
|
|
|
456
456
|
className: "prose-xs prose-no-margin min-w-0 flex-1",
|
|
457
457
|
children: tag.value
|
|
458
458
|
}) : /* @__PURE__ */ jsx("code", {
|
|
459
|
-
className: "not-prose min-w-0
|
|
459
|
+
className: "not-prose min-w-0",
|
|
460
460
|
children: tag.value
|
|
461
461
|
})]
|
|
462
462
|
}, i);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { require_fast_content_type_parse } from "../node_modules/.pnpm/fast-content-type-parse@4.0.1/node_modules/fast-content-type-parse/index.js";
|
|
2
|
+
import { cookieString } from "../requests/string-utils.js";
|
|
2
3
|
import { resolveMediaAdapter } from "../requests/media/resolve-adapter.js";
|
|
3
4
|
// src/playground/fetcher.ts
|
|
4
5
|
var import_fast_content_type_parse = require_fast_content_type_parse();
|
|
@@ -35,12 +36,10 @@ function createBrowserFetcher(adapters, { proxyUrl, proxyForwardCookie = true, r
|
|
|
35
36
|
requestInit.body = adapter.encode(data);
|
|
36
37
|
}
|
|
37
38
|
if (proxyUrl && proxyForwardCookie) {
|
|
38
|
-
|
|
39
|
-
requestUrl.searchParams.set("cookie", encoded);
|
|
39
|
+
requestUrl.searchParams.set("cookie", cookieString(data.cookie));
|
|
40
40
|
requestInit.credentials = "omit";
|
|
41
41
|
} else for (const key in data.cookie) {
|
|
42
|
-
const
|
|
43
|
-
const segs = [`${key}=${encodeURIComponent(param.value)}`];
|
|
42
|
+
const segs = [`${key}=${data.cookie[key].value}`];
|
|
44
43
|
if (proxyUrl && requestUrl.origin !== window.location.origin) segs.push(`domain=${requestUrl.host}`);
|
|
45
44
|
segs.push("path=/", "max-age=30");
|
|
46
45
|
document.cookie = segs.join("; ");
|
|
@@ -4,6 +4,7 @@ import { go } from "./go.js";
|
|
|
4
4
|
import { java } from "./java.js";
|
|
5
5
|
import { javascript } from "./javascript.js";
|
|
6
6
|
import { python } from "./python.js";
|
|
7
|
+
import { ruby } from "./ruby.js";
|
|
7
8
|
import { rust } from "./rust.js";
|
|
8
9
|
// src/requests/generators/all.ts
|
|
9
10
|
function registerDefault(registry) {
|
|
@@ -14,6 +15,7 @@ function registerDefault(registry) {
|
|
|
14
15
|
registry.add("java", java);
|
|
15
16
|
registry.add("csharp", csharp);
|
|
16
17
|
registry.add("rust", rust);
|
|
18
|
+
registry.add("ruby", ruby);
|
|
17
19
|
return registry;
|
|
18
20
|
}
|
|
19
21
|
export { registerDefault };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { shellQuote } from "../../packages/shared-api/dist/codegen.js";
|
|
2
|
-
import { inputToString } from "../string-utils.js";
|
|
2
|
+
import { formFields, inputToString } from "../string-utils.js";
|
|
3
3
|
import { resolveMediaType } from "../media/resolve-adapter.js";
|
|
4
4
|
// src/requests/generators/curl.ts
|
|
5
5
|
const curl = {
|
|
@@ -11,10 +11,8 @@ const curl = {
|
|
|
11
11
|
for (const header in data.header) s.push(`-H ${shellQuote(`${header}: ${data.header[header].value}`)}`);
|
|
12
12
|
for (const k in data.cookie) s.push(`--cookie ${shellQuote(`${k}=${data.cookie[k].value}`)}`);
|
|
13
13
|
const type = data.bodyMediaType && resolveMediaType(data.bodyMediaType, mediaAdapters);
|
|
14
|
-
if (data.body && type === "multipart/form-data") {
|
|
15
|
-
|
|
16
|
-
for (const [key, value] of Object.entries(data.body)) s.push(`-F ${shellQuote(`${key}=${inputToString(value)}`)}`);
|
|
17
|
-
} else if (data.body && type) {
|
|
14
|
+
if (data.body && type === "multipart/form-data") for (const [key, value] of formFields(data.body)) s.push(`-F ${shellQuote(`${key}=${value}`)}`);
|
|
15
|
+
else if (data.body && type) {
|
|
18
16
|
s.push(`-H 'Content-Type: ${data.bodyMediaType}'`);
|
|
19
17
|
s.push(`-d ${shellQuote(inputToString(data.body, type))}`);
|
|
20
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cookieString, doubleQuote,
|
|
1
|
+
import { cookieString, doubleQuote, formFields, indent } from "../string-utils.js";
|
|
2
2
|
import { generateBodyExample } from "../media/adapter.js";
|
|
3
3
|
// src/requests/generators/java.ts
|
|
4
4
|
const boundary = "form-data-boundary";
|
|
@@ -42,10 +42,7 @@ const java = {
|
|
|
42
42
|
function multipartBody(body) {
|
|
43
43
|
if (!body) return;
|
|
44
44
|
let text = "";
|
|
45
|
-
for (const [key, value] of
|
|
46
|
-
if (value == null) continue;
|
|
47
|
-
text += `--${boundary}\r\nContent-Disposition: form-data; name=${JSON.stringify(key)}\r\n\r\n${inputToString(value)}\r\n`;
|
|
48
|
-
}
|
|
45
|
+
for (const [key, value] of formFields(body)) text += `--${boundary}\r\nContent-Disposition: form-data; name=${JSON.stringify(key)}\r\n\r\n${value}\r\n`;
|
|
49
46
|
return `var body = HttpRequest.BodyPublishers.ofString(${JSON.stringify(`${text}--${boundary}--\r\n`)});`;
|
|
50
47
|
}
|
|
51
48
|
export { java };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { rubyString } from "../../packages/shared-api/dist/codegen.js";
|
|
2
|
+
import { generateBodyExample } from "../media/adapter.js";
|
|
3
|
+
import { cookieString, toSearchParams } from "../string-utils.js";
|
|
4
|
+
// src/requests/generators/ruby.ts
|
|
5
|
+
const ruby = {
|
|
6
|
+
label: "Ruby",
|
|
7
|
+
lang: "ruby",
|
|
8
|
+
generate(data, { mediaAdapters }) {
|
|
9
|
+
const method = data.method[0].toUpperCase() + data.method.slice(1).toLowerCase();
|
|
10
|
+
const s = [`uri = URI(${rubyString(data.url)})`];
|
|
11
|
+
const request = [`request = Net::HTTP::${method}.new(uri)`];
|
|
12
|
+
for (const k in data.header) request.push(`request[${rubyString(k)}] = ${rubyString(data.header[k].value)}`);
|
|
13
|
+
const cookie = cookieString(data.cookie);
|
|
14
|
+
if (cookie) request.push(`request['Cookie'] = ${rubyString(cookie)}`);
|
|
15
|
+
if (data.body && data.bodyMediaType === "multipart/form-data") {
|
|
16
|
+
const fields = Array.from(toSearchParams(data.body), ([key, value]) => ` [${rubyString(key)}, ${rubyString(value)}],`);
|
|
17
|
+
request.push(`request.set_form([\n${fields.join("\n")}\n], 'multipart/form-data')`);
|
|
18
|
+
} else {
|
|
19
|
+
const body = generateBodyExample(data, mediaAdapters, { lang: "ruby" });
|
|
20
|
+
if (body) {
|
|
21
|
+
s.push(body);
|
|
22
|
+
request.push(`request['Content-Type'] = ${rubyString(data.bodyMediaType)}`, "request.body = body");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return `require 'net/http'
|
|
26
|
+
|
|
27
|
+
${s.join("\n")}
|
|
28
|
+
${request.join("\n")}
|
|
29
|
+
|
|
30
|
+
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
|
31
|
+
http.request(request)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
puts response.body`;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export { ruby };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __toESM } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { csharpRawString, goString, javaTextBlock, jsTemplateLiteral, pythonString, rustString } from "../../packages/shared-api/dist/codegen.js";
|
|
3
|
-
import { inputToString } from "../string-utils.js";
|
|
2
|
+
import { csharpRawString, goString, javaTextBlock, jsTemplateLiteral, pythonString, rubyString, rustString } from "../../packages/shared-api/dist/codegen.js";
|
|
3
|
+
import { formFields, inputToString, toSearchParams } from "../string-utils.js";
|
|
4
4
|
import { resolveMediaAdapter } from "./resolve-adapter.js";
|
|
5
5
|
import { require_js2xml } from "../../node_modules/.pnpm/xml-js@1.6.11/node_modules/xml-js/lib/js2xml.js";
|
|
6
6
|
// src/requests/media/adapter.ts
|
|
@@ -44,13 +44,9 @@ const defaultAdapters = {
|
|
|
44
44
|
},
|
|
45
45
|
"application/x-www-form-urlencoded": {
|
|
46
46
|
encode(data) {
|
|
47
|
-
|
|
48
|
-
const params = new URLSearchParams();
|
|
49
|
-
for (const key in data.body) params.set(key, String(data.body[key]));
|
|
50
|
-
return params;
|
|
47
|
+
return toSearchParams(data.body);
|
|
51
48
|
},
|
|
52
49
|
generateExample(data, ctx) {
|
|
53
|
-
if (ctx.lang === "js") return `const body = new URLSearchParams(${JSON.stringify(data.body, null, 2)})`;
|
|
54
50
|
return str(data.body, "application/x-www-form-urlencoded", ctx);
|
|
55
51
|
}
|
|
56
52
|
},
|
|
@@ -78,17 +74,16 @@ const defaultAdapters = {
|
|
|
78
74
|
},
|
|
79
75
|
generateExample(data, ctx) {
|
|
80
76
|
const s = [];
|
|
81
|
-
const fields = [];
|
|
82
|
-
for (const [key, value] of Object.entries(data.body)) if (value != null) fields.push([JSON.stringify(key), inputToString(value)]);
|
|
77
|
+
const fields = formFields(data.body).map(([key, value]) => [JSON.stringify(key), value]);
|
|
83
78
|
switch (ctx.lang) {
|
|
84
79
|
case "js":
|
|
85
80
|
s.push("const body = new FormData();");
|
|
86
|
-
for (const [key, value] of fields) s.push(`body.
|
|
81
|
+
for (const [key, value] of fields) s.push(`body.append(${key}, ${JSON.stringify(value)})`);
|
|
87
82
|
break;
|
|
88
83
|
case "python":
|
|
89
|
-
s.push("body =
|
|
90
|
-
for (const [key, value] of fields) s.push(` ${key}
|
|
91
|
-
s.push("
|
|
84
|
+
s.push("body = [");
|
|
85
|
+
for (const [key, value] of fields) s.push(` (${key}, (None, ${JSON.stringify(value)})),`);
|
|
86
|
+
s.push("]");
|
|
92
87
|
break;
|
|
93
88
|
case "go": {
|
|
94
89
|
const { addImport } = ctx;
|
|
@@ -139,6 +134,7 @@ function str(init, mediaType, ctx) {
|
|
|
139
134
|
return `var body = BodyPublishers.ofString(${javaTextBlock(text)});`;
|
|
140
135
|
case "csharp": return `var body = new StringContent(${csharpRawString(text)}, Encoding.UTF8, "${mediaType}");`;
|
|
141
136
|
case "rust": return `let body = ${rustString(text)};`;
|
|
137
|
+
case "ruby": return `body = ${rubyString(text)}`;
|
|
142
138
|
}
|
|
143
139
|
}
|
|
144
140
|
export { defaultAdapters, generateBodyExample };
|
|
@@ -28,12 +28,13 @@ function encodeRequestData(from, adapters, parameters = []) {
|
|
|
28
28
|
const encoder = getMediaEncoder(field, adapters);
|
|
29
29
|
if (encoder) {
|
|
30
30
|
if (type === "query") result[type][key] = { values: [encoder(value)] };
|
|
31
|
+
else if (type === "path") result[type][key] = { value: encodeURIComponent(encoder(value)) };
|
|
31
32
|
else result[type][key] = { value: encoder(value) };
|
|
32
33
|
continue;
|
|
33
34
|
}
|
|
34
35
|
switch (type) {
|
|
35
36
|
case "path":
|
|
36
|
-
serializePathParameter(field, value, result.path);
|
|
37
|
+
serializePathParameter(field, encodePathMembers(value), result.path);
|
|
37
38
|
break;
|
|
38
39
|
case "query":
|
|
39
40
|
serializeQueryParameter(field, value, result.query);
|
|
@@ -58,6 +59,12 @@ function serializeSimple(value, explode) {
|
|
|
58
59
|
if (typeof value === "object") return explode ? Object.entries(value).map(([k, v]) => `${k}=${v}`).join(",") : Object.entries(value).flat().join(",");
|
|
59
60
|
return String(value);
|
|
60
61
|
}
|
|
62
|
+
/** the delimiters a style adds stay literal, so only the members are encoded (RFC 6570) */
|
|
63
|
+
function encodePathMembers(value) {
|
|
64
|
+
if (Array.isArray(value)) return value.map((item) => encodeURIComponent(String(item)));
|
|
65
|
+
if (typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [encodeURIComponent(k), encodeURIComponent(String(v))]));
|
|
66
|
+
return encodeURIComponent(String(value));
|
|
67
|
+
}
|
|
61
68
|
function serializePathParameter(field, value, output) {
|
|
62
69
|
const { explode = false, name } = field;
|
|
63
70
|
switch (field.style) {
|
|
@@ -117,10 +124,17 @@ function serializeQueryParameter(field, value, output) {
|
|
|
117
124
|
output[field.name] = { values: [String(value)] };
|
|
118
125
|
}
|
|
119
126
|
function serializeCookieParameter(field, value, output) {
|
|
120
|
-
const { explode = true } = field;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
else if (
|
|
124
|
-
else output[
|
|
127
|
+
const { name, style, explode = true } = field;
|
|
128
|
+
const encode = style === "cookie" ? String : (v) => encodeURIComponent(String(v));
|
|
129
|
+
if (typeof value !== "object") output[name] = { value: encode(value) };
|
|
130
|
+
else if (!explode) output[name] = { value: Array.isArray(value) ? value.map(encode).join(",") : Object.entries(value).map(([k, v]) => `${encode(k)},${encode(v)}`).join(",") };
|
|
131
|
+
else if (style === "cookie" && !Array.isArray(value)) for (const [k, v] of Object.entries(value)) output[k] = { value: encode(v) };
|
|
132
|
+
else {
|
|
133
|
+
const [first, ...rest] = Array.isArray(value) ? value.map((v) => [name, v]) : Object.entries(value).map(([k, v]) => [encode(k), v]);
|
|
134
|
+
if (!first) return;
|
|
135
|
+
let out = encode(first[1]);
|
|
136
|
+
for (const [k, v] of rest) out += `${style === "cookie" ? "; " : "&"}${k}=${encode(v)}`;
|
|
137
|
+
output[first[0]] = { value: out };
|
|
138
|
+
}
|
|
125
139
|
}
|
|
126
140
|
export { encodeRequestData };
|
|
@@ -8,12 +8,7 @@ var import_js2xml = /* @__PURE__ */ __toESM(require_js2xml(), 1);
|
|
|
8
8
|
function inputToString(value, format = "application/json") {
|
|
9
9
|
if (typeof value === "string") return value;
|
|
10
10
|
if (format === "application/x-ndjson") return Array.isArray(value) ? value.map((v) => JSON.stringify(v)).join("\n") : JSON.stringify(value, null, 2);
|
|
11
|
-
if (format === "application/x-www-form-urlencoded")
|
|
12
|
-
const params = new URLSearchParams();
|
|
13
|
-
if (typeof value !== "object") throw new Error(`For url encoded data, \`value\` must be an object, but received: ${typeof value}`);
|
|
14
|
-
for (const key in value) if (value[key]) params.set(key, String(value[key]));
|
|
15
|
-
return params.toString();
|
|
16
|
-
}
|
|
11
|
+
if (format === "application/x-www-form-urlencoded") return toSearchParams(value).toString();
|
|
17
12
|
if (format === "application/xml") return (0, import_js2xml.default)(value, {
|
|
18
13
|
compact: true,
|
|
19
14
|
spaces: 2
|
|
@@ -21,6 +16,22 @@ function inputToString(value, format = "application/json") {
|
|
|
21
16
|
return JSON.stringify(value, null, 2);
|
|
22
17
|
}
|
|
23
18
|
/**
|
|
19
|
+
* The fields of a form body, by the rules `multipart/form-data` encodes them with: unset fields are left out, array
|
|
20
|
+
* items repeat the key and objects are JSON.
|
|
21
|
+
*/
|
|
22
|
+
function formFields(value) {
|
|
23
|
+
if (typeof value !== "object" || !value) throw new Error(`A form body must be an object, but received: ${typeof value}`);
|
|
24
|
+
const fields = [];
|
|
25
|
+
for (const [key, field] of Object.entries(value)) for (const item of Array.isArray(field) ? field : [field]) {
|
|
26
|
+
if (item == null || Number.isNaN(item)) continue;
|
|
27
|
+
fields.push([key, typeof item === "object" ? JSON.stringify(item) : String(item)]);
|
|
28
|
+
}
|
|
29
|
+
return fields;
|
|
30
|
+
}
|
|
31
|
+
function toSearchParams(value) {
|
|
32
|
+
return new URLSearchParams(formFields(value));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
24
35
|
* Returns the value of a `Cookie` header with the given cookies.
|
|
25
36
|
*/
|
|
26
37
|
function cookieString(cookies) {
|
|
@@ -44,4 +55,4 @@ function indent(code, tab = 1) {
|
|
|
44
55
|
const p = " ".repeat(tab);
|
|
45
56
|
return code.split("\n").map((v) => v.length === 0 ? v : p + v).join("\n");
|
|
46
57
|
}
|
|
47
|
-
export { cookieString, doubleQuote, indent, inputToString, jsxString };
|
|
58
|
+
export { cookieString, doubleQuote, formFields, indent, inputToString, jsxString, toSearchParams };
|
|
@@ -421,7 +421,7 @@ function AuthScheme({ scheme, scopes }) {
|
|
|
421
421
|
})
|
|
422
422
|
]
|
|
423
423
|
}), (scheme.description || scopes.length > 0 || configUrl) && /* @__PURE__ */ jsxs("div", {
|
|
424
|
-
className: "mt-1 prose-no-margin text-fd-muted-foreground",
|
|
424
|
+
className: "mt-1 wrap-break-word prose-no-margin text-fd-muted-foreground",
|
|
425
425
|
children: [
|
|
426
426
|
scheme.description && /* @__PURE__ */ jsx(Markdown, { md: scheme.description }),
|
|
427
427
|
configUrl && /* @__PURE__ */ jsxs("p", { children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.5",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"./requests/generators/java": "./dist/requests/generators/java.js",
|
|
41
41
|
"./requests/generators/javascript": "./dist/requests/generators/javascript.js",
|
|
42
42
|
"./requests/generators/python": "./dist/requests/generators/python.js",
|
|
43
|
+
"./requests/generators/ruby": "./dist/requests/generators/ruby.js",
|
|
43
44
|
"./requests/generators/rust": "./dist/requests/generators/rust.js",
|
|
44
45
|
"./server": "./dist/server/index.js",
|
|
45
46
|
"./ui": "./dist/ui/index.js",
|
|
@@ -79,8 +80,8 @@
|
|
|
79
80
|
"@types/react-dom": "^19.3.0",
|
|
80
81
|
"fast-content-type-parse": "^4.0.1",
|
|
81
82
|
"fuma-cli": "^0.3.4",
|
|
82
|
-
"fumadocs-core": "16.19.
|
|
83
|
-
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.
|
|
83
|
+
"fumadocs-core": "16.19.3",
|
|
84
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.19.3",
|
|
84
85
|
"json-schema-typed": "^9.0.0",
|
|
85
86
|
"shared-api": "0.2.16",
|
|
86
87
|
"tsconfig": "0.0.0",
|