fumadocs-openapi 11.2.1 → 11.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- @source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-fd-border border-s border-t border-y buffer builderOptions built-in bundled but button buttonVariants by byteLength bytes cache cached call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientCredentials clientId clientSecret client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentTypes context cookie cookies core could createAutoPreset createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fall fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-semibold for form formData format found from fromSchema fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-6 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into invalid is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaMap schemaUI schemaUIShared schemas scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this through throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
1
+ @source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-fd-border border-s border-t border-y buffer builderOptions built-in bundled but button buttonVariants by byteLength bytes cache cached call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientCredentials clientId clientSecret client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentTypes context cookie cookies core could createAutoPreset createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-semibold for form formData format found from fromSchema fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-6 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaMap schemaUI schemaUIShared schemas scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
3
3
  const DEFAULT_MEDIA_TYPE = "application/json";
4
4
  /** Extracts and removes x-example and x-examples extensions from an object */
5
5
  function extractXExampleExtensions(obj) {
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
3
3
  const SCHEMA_SEGMENTS = /* @__PURE__ */ new Set([
4
4
  "properties",
5
5
  "items",
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
2
2
  /**
3
3
  * Recursively migrate XML object properties from 3.1 to 3.2 format
4
4
  */
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
2
2
  /**
3
3
  * Recursively traverses the content and applies the transform function to each node.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  import { upgradeFromThreeOneToThreeTwo } from "./3.1-to-3.2/upgrade-from-three-one-to-three-two.js";
2
2
  import { upgradeFromTwoToThree } from "./2.0-to-3.0/upgrade-from-two-to-three.js";
3
3
  import { upgradeFromThreeToThreeOne } from "./3.0-to-3.1/upgrade-from-three-to-three-one.js";
4
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
4
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
5
5
  function upgrade(value, targetVersion) {
6
6
  const openapi30 = upgradeFromTwoToThree(value);
7
7
  if (targetVersion === "3.0") return openapi30;
@@ -113,11 +113,20 @@ function ResponseResult({ data, reset, ...rest }) {
113
113
  }
114
114
  function TextResult({ lang, charset, data }) {
115
115
  const code = useMemo(() => {
116
+ let out;
116
117
  if (charset) try {
117
- return new TextDecoder(charset).decode(data.body);
118
+ out = new TextDecoder(charset).decode(data.body);
118
119
  } catch {}
119
- return new TextDecoder("utf-8").decode(data.body);
120
- }, [charset, data.body]);
120
+ out ??= new TextDecoder("utf-8").decode(data.body);
121
+ if (lang === "json") try {
122
+ out = JSON.stringify(JSON.parse(out), null, 2);
123
+ } catch {}
124
+ return out;
125
+ }, [
126
+ lang,
127
+ charset,
128
+ data.body
129
+ ]);
121
130
  return /* @__PURE__ */ jsx(ClientCodeBlock, {
122
131
  lang: code.length > 5e3 ? "text" : lang,
123
132
  code
@@ -1,14 +1,19 @@
1
1
  //#region src/server/proxy.d.ts
2
2
  declare const methods: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"];
3
3
  type Handler = (req: Request) => Promise<Response>;
4
+ type OriginMatcher = string | RegExp;
4
5
  interface Proxy extends Record<(typeof methods)[number], Handler> {
5
6
  handle: Handler;
6
7
  }
7
8
  interface CreateProxyOptions {
8
9
  /**
9
- * List of allowed origins to proxy to.
10
+ * List of allowed origins to proxy to, also enforced on redirects.
11
+ *
12
+ * @defaultValue the proxy route's own origin (i.e. same-origin only). This
13
+ * prevents the proxy from being abused as an open proxy (SSRF) when no
14
+ * allowlist is configured; a warning is logged in that case.
10
15
  */
11
- allowedOrigins?: string[];
16
+ allowedOrigins?: OriginMatcher[];
12
17
  /**
13
18
  * Determine if the proxied request is allowed.
14
19
  *
@@ -13,24 +13,78 @@ const methodsWithBody = /* @__PURE__ */ new Set([
13
13
  "PATCH",
14
14
  "DELETE"
15
15
  ]);
16
+ const redirectStatus = /* @__PURE__ */ new Set([
17
+ 301,
18
+ 302,
19
+ 303,
20
+ 307,
21
+ 308
22
+ ]);
23
+ const maxRedirects = 20;
24
+ var ProxyError = class extends Error {
25
+ constructor(message, status = 400) {
26
+ super(message);
27
+ this.status = status;
28
+ }
29
+ };
30
+ function matchOrigin(origin, matcher) {
31
+ if (typeof matcher === "string") return matcher === origin;
32
+ matcher.lastIndex = 0;
33
+ return matcher.test(origin);
34
+ }
16
35
  function createProxy(options = {}) {
17
36
  const { allowedOrigins, filterRequest, overrides } = options;
18
37
  const handlers = { handle: handler };
38
+ if (!allowedOrigins && !filterRequest) console.warn("[Proxy] `createProxy()` was called without `allowedOrigins` or `filterRequest`. Requests will be restricted to the proxy route's own origin. Set `allowedOrigins` to allow proxying to your API endpoints.");
19
39
  async function handler(req) {
20
- const searchParams = new URL(req.url).searchParams;
40
+ const reqUrl = new URL(req.url);
41
+ const searchParams = reqUrl.searchParams;
21
42
  const rawUrl = searchParams.get("url");
22
43
  if (!rawUrl) return Response.json("[Proxy] A `url` query parameter is required for proxy url", { status: 400 });
23
44
  const targetUrl = URL.parse(rawUrl);
24
45
  if (!targetUrl) return Response.json("[Proxy] Invalid `url` parameter value.", { status: 400 });
25
- if (allowedOrigins && !allowedOrigins.includes(targetUrl.origin)) return Response.json(`[Proxy] The origin "${targetUrl.origin}" is not allowed.`, { status: 400 });
46
+ const allowed = allowedOrigins ?? [reqUrl.origin];
47
+ if (allowed.every((matcher) => !matchOrigin(targetUrl.origin, matcher))) return Response.json(`[Proxy] The origin "${targetUrl.origin}" is not allowed.`, { status: 400 });
26
48
  const proxied = await rewriteRequest(req, targetUrl, searchParams.get("cookie"));
27
49
  if (filterRequest && !filterRequest(proxied)) return Response.json("[Proxy] The proxied request is not allowed", { status: 403 });
28
50
  try {
29
- return rewriteResponse(await fetch(proxied));
51
+ return rewriteResponse(await proxyFetch(proxied, allowed));
30
52
  } catch (err) {
53
+ if (err instanceof ProxyError) return Response.json(`[Proxy] ${err.message}`, { status: err.status });
31
54
  return Response.json(`[Proxy] Failed to proxy request: ${err instanceof Error ? err.message : "unknown reason"}`, { status: 500 });
32
55
  }
33
56
  }
57
+ async function proxyFetch(initial, allowed) {
58
+ let method = initial.method;
59
+ let url = initial.url;
60
+ const headers = new Headers(initial.headers);
61
+ let body = initial.body && methodsWithBody.has(method.toUpperCase()) ? await initial.arrayBuffer() : void 0;
62
+ for (let redirects = 0; redirects <= maxRedirects; redirects++) {
63
+ const response = await fetch(new Request(url, {
64
+ method,
65
+ headers,
66
+ body,
67
+ cache: "no-cache",
68
+ redirect: "manual"
69
+ }));
70
+ const location = response.headers.get("location");
71
+ if (!redirectStatus.has(response.status) || !location) return response;
72
+ const next = new URL(location, url);
73
+ if (allowed.every((matcher) => !matchOrigin(next.origin, matcher))) throw new ProxyError(`The redirect origin "${next.origin}" is not allowed.`);
74
+ switch (response.status) {
75
+ case 301:
76
+ case 302: if (method === "GET" || method === "HEAD") break;
77
+ case 303:
78
+ method = "GET";
79
+ body = void 0;
80
+ headers.delete("content-length");
81
+ headers.delete("content-type");
82
+ break;
83
+ }
84
+ url = next.href;
85
+ }
86
+ throw new ProxyError("Too many redirects.", 508);
87
+ }
34
88
  async function rewriteRequest(request, url, cookie) {
35
89
  const headers = new Headers(request.headers);
36
90
  headers.delete("origin");
@@ -48,6 +102,8 @@ function createProxy(options = {}) {
48
102
  async function rewriteResponse(response) {
49
103
  if (overrides?.response) response = overrides.response(response);
50
104
  const headers = new Headers(response.headers);
105
+ headers.delete("content-encoding");
106
+ headers.delete("content-length");
51
107
  headers.forEach((_value, originalKey) => {
52
108
  if (originalKey.toLowerCase().startsWith("access-control-")) headers.delete(originalKey);
53
109
  });
package/dist/ui/base.js CHANGED
@@ -4,10 +4,10 @@ import { ClientCodeBlock } from "./components/codeblock.js";
4
4
  import { createCodeUsageGeneratorRegistry } from "../requests/generators/index.js";
5
5
  import { defaultAdapters } from "../requests/media/adapter.js";
6
6
  import { AuthProvider } from "../playground/auth.js";
7
+ import { registerDefault } from "../requests/generators/all.js";
7
8
  import { Markdown } from "./components/markdown.js";
8
9
  import { Operation } from "./operation/index.js";
9
10
  import { dereferenceBundledDocument } from "../utils/document/dereference.js";
10
- import { registerDefault } from "../requests/generators/all.js";
11
11
  import { getRaw } from "@scalar/json-magic/magic-proxy";
12
12
  import { Children, useMemo } from "react";
13
13
  import * as JsxRuntime from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
1
+ import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.11/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
2
2
  import { bundle } from "@fumadocs/api-docs/schema/bundle";
3
3
  //#region src/utils/document/load.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "11.2.1",
3
+ "version": "11.2.3",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "Docs",
@@ -45,33 +45,33 @@
45
45
  "dependencies": {
46
46
  "@fuma-translate/react": "^1.0.2",
47
47
  "@fumari/json-schema-ts": "^1.0.2",
48
- "@scalar/json-magic": "^0.12.17",
48
+ "@scalar/json-magic": "^0.12.19",
49
49
  "chokidar": "^5.0.0",
50
50
  "class-variance-authority": "^0.7.1",
51
- "cnfast": "^0.0.8",
51
+ "cnfast": "^0.1.0",
52
52
  "github-slugger": "^2.0.0",
53
53
  "hast-util-to-jsx-runtime": "^2.3.6",
54
- "lucide-react": "^1.24.0",
54
+ "lucide-react": "^1.27.0",
55
55
  "remark": "^15.0.1",
56
56
  "remark-rehype": "^11.1.2",
57
57
  "shiki": "^4.3.1",
58
58
  "yaml": "^2.9.0",
59
- "@fumadocs/api-docs": "0.2.0",
59
+ "@fumadocs/api-docs": "0.2.2",
60
60
  "@fumari/stf": "1.1.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@scalar/api-client-react": "^2.0.32",
64
- "@scalar/openapi-upgrader": "^0.2.9",
65
- "@tailwindcss/oxide": "^4.3.2",
66
- "@types/node": "26.1.1",
63
+ "@scalar/api-client-react": "^2.0.36",
64
+ "@scalar/openapi-upgrader": "^0.2.11",
65
+ "@tailwindcss/oxide": "^4.3.3",
66
+ "@types/node": "26.1.2",
67
67
  "@types/react": "^19.2.17",
68
68
  "fast-content-type-parse": "^3.0.0",
69
69
  "json-schema-typed": "^8.0.2",
70
- "tsdown": "0.22.5",
70
+ "tsdown": "0.22.14",
71
71
  "xml-js": "^1.6.11",
72
- "tsconfig": "0.0.0",
73
- "fumadocs-core": "16.11.5",
74
- "fumadocs-ui": "npm:@fumadocs/base-ui@16.11.5"
72
+ "fumadocs-ui": "npm:@fumadocs/base-ui@16.14.0",
73
+ "fumadocs-core": "16.14.0",
74
+ "tsconfig": "0.0.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@scalar/api-client-react": "^2.0.20",
@@ -94,7 +94,7 @@
94
94
  }
95
95
  },
96
96
  "inlinedDependencies": {
97
- "@scalar/openapi-upgrader": "0.2.9",
97
+ "@scalar/openapi-upgrader": "0.2.11",
98
98
  "fast-content-type-parse": "3.0.0",
99
99
  "xml-js": "1.6.11"
100
100
  },