fumadocs-openapi 11.3.5 → 11.4.1
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/index.d.ts +2 -2
- package/dist/node_modules/.pnpm/fast-content-type-parse@4.0.0/node_modules/fast-content-type-parse/index.js +226 -0
- package/dist/playground/client.d.ts +1 -1
- package/dist/playground/components/result-display.js +1 -1
- package/dist/playground/fetcher.js +0 -1
- package/dist/requests/media/encode.js +0 -1
- package/dist/server/proxy.d.ts +1 -1
- package/dist/types.d.ts +12 -3
- package/dist/ui/base.js +5 -4
- package/dist/ui/contexts/api.d.ts +18 -0
- package/dist/ui/index.d.ts +5 -6
- package/dist/ui/index.js +3 -1
- package/dist/ui/operation/context.d.ts +16 -0
- package/dist/ui/operation/index.js +1 -1
- package/dist/utils/cn.js +1 -1
- package/package.json +12 -11
- package/dist/node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js +0 -115
package/css/generated/shared.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-s border-t border-y break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientAuth clientAuthMethods clientCredentials clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codeblock codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentType contentTypes context cookie cookies core could createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-normal font-semibold for form formData format found from fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-4 gap-x-6 gap-y-1 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green grid grid-cols-[auto_1fr] group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-1 p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaUI schemaUIShared scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setClientAuth setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
|
|
1
|
+
@source inline("--- --fd-docs-row-1 -mode -ms-2 @4xl:flex-row @4xl:items-start @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-1,2rem)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumari/json-schema-ts @fumari/stf @param @private @scalar/api-client-react @see @typescript-eslint/no-explicit-any a access access_token active adapter adapters addListener against all allFlows allow already alt an anchorSegments and animate-spin apiExample apiKey apiPlayground application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml apply are array as assume async at auth-specific authCodeQuery authCtx authNode authSchemes authorization authorizationCode authorization_code authorize autoComplete avoid await backward badgeVariants base baseDir basic be because before between bg-fd-card bg-fd-muted bg-fd-primary/10 bg-fd-secondary binary blob blue body bodyMediaType bodyNode boolean border border-b border-current border-s border-t border-y break-all buffer built-in bundled but button buttonVariants by byteLength bytes cache cached cachedDocFiles call callback callbacks callbacksNode can cannot case catch changes charset check children class-variance-authority className client clientAuth clientAuthMethods clientCredentials clientId clientSecret client_auth client_credentials client_error client_id client_secret cloned cn code codeProps codeUsages codeblock codegen codegens collapsible color com compatibility compiler component components conditions configuration const content contentType contentTypes context cookie cookies core could createClientAPIPage createCodeUsageGeneratorRegistry createContext createOpenAPIPageBase createProxy credentials css csv ctx current currentValue custom customization cva dark dark:text-blue-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[open]:border-b-0 data-type default defaultAdapters defaultExampleId defaultItem defaultMdxComponents defaultOpen defaultShikiFactory defaultValue defaultValues default_processMarkdown definitions deprecated depth dereferenceBundledDocument dereferenceShallow dereferenced description descriptionNode development deviceAuthorization dialog didn disable disableCache disabled display displayNames div do doc docCache docFilesCache docRoot docs document documents domain downloaded dynamicSource e each else empty:hidden enabled encodeRequestData encoded endpoint enforce engine ensure entire entries entry error eslint-disable eslint-disable-next-line example exampleId exampleRequests examples export exported extends fallback false fast-content-type-parse fd-page-tree-item-name fetch fetcher field fieldName fields file filePath files fine first first:border-t-0 flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flows folder folderStyle font-medium font-mono font-normal font-semibold for form formData format found from fs full fumadocs-core/source fumadocs-core/toc fumadocs-openapi/ui fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests fumadocs_openapi_responses function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-6 gap-x-4 gap-x-6 gap-y-1 gap-y-4 gen generate generateTypeScriptDefinitions generated generated/defined generators get getAPIPageProps getClientAPIPageProps getExampleRequests getOpenAPIPageProps getPreferredType getRaw getSchema getSchemas getWatchPaths github-dark github-light given grant_type green grid grid-cols-[auto_1fr] group group-data-[panel-open]:rotate-180 groupId h1 handling hasHead hash hast-util-to-jsx-runtime headNode header headers headingLevel highlighter hook hover:bg-fd-accent hover:text-fd-accent-foreground href html htmlFor http icon id idToTitle idx if ignore img implicit import imports in in-document info initAuthInputs initial inline-flex input inputs instanceof instances instead insteawd interface internal into is isLoading isMediaTypeSupported isRequired issues it item items items-center items-start js json json-schema-typed justify-between kept key keyof label labelVariants lang last:border-b-0 last:mb-0 latest layout lazy length let light line-through list list-disc list-inside listed listener listeners load loadDocument loaderPlugin localStorage lucide-react make map max-age may mb-1 mb-2 md mdxComponents me-auto media mediaAdapters mediaType merged message meta metaData method methodKeys mime min-w-0 modify mounted ms-auto mt-0! mt-10 mt-2 mt-3 multipart/form-data multiple must my-0! my-1.5 my-4 name name! named necessary need never new newKey no-cache node:fs node:path not not-last:pb-0 not-prose note null number oauth2 obj object of off omit on onChange onClick onCopy onOpenChange onSubmit onValueChange one only open openApiData openIdConnect openapi openapiMeta openid operation operationDescription operationId operations options or orange origin other out outline output overflow-auto overflow-hidden p p-1 p-2 p-3 packages page page-level pageData pages panelVariants param paramTypeKeys parameter parameterLabel parameterNode parameters params parent parsed parsedState parts party pass password path pathItem pathnameFromRequest payload pb-2 pe-3 persist persisted persistent place placeholder playground playgrounds please plugins pre prefix preloadOpenAPIPage preloaded prevent primary processed processor prop properties props prose-no-margin provider proxy proxyForwardCookie proxyUrl ps-2 ps-4.5 pt-1 pt-2 pt-2.5 px-1 px-2 px-3 py-0.5 py-1 py-1.5 py-2 query race raw react react-hooks/exhaustive-deps react/jsx-runtime readOnly readonly record red redirect_uri reference refs registerDefault registry rehype-react relativePath remark remark-rehype remarkGfm remarkRehype removeListener render renderAPIExampleLayout renderAPIExampleUsageTabs renderOperationLayout renderPageLayout renderParameterField renderRequestTabs renderRequestTabsDefault renderResponseTabs renderResponseTabsDefault renderWebhookLayout renderer replace request request-body requestData requestInit requestTimeout requestUrl requests required requirement requirementId requirements res reset resolvable resolve resolveMediaAdapter resolveServerUrl resolvedInput resolvedTheme resolves response response-body responseNode responseOfType responseTabs response_type responses rest result return returned returning root rounded-2xl rounded-lg rounded-md rounded-xl route s safeParse same sample satisfies scalar scan schema schemaId schemaUI schemaUIShared scheme schemeId schemes scope scopes search secondary seconds secret securities security securityEntries securityId securitySchemes segments segs select selector separator server server-to-server server-url serverSchema servers services set setClientAuth setData setExample setExampleData setIsJson setIsMounted setMounted setObjectUrl setOpen setRequirementId setSecurityId setServer setServerVariables setStore setToken setType setValue shadow-md shadow-sm shiki shikiOptions showDescription showExample showResponseSchema showTitle shrink-0 side signal single size size-3.5 size-4 slot slots sm so source spec specify spread src state staticSource status statusInfo statuses stf stfSync still storageKey storageKeys store stored string stringifyFieldKey structuredData styles submit summary supported sure switch t tab tabs testQuery text text-[0.8125rem] text-blue-600 text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-primary text-fd-secondary-foreground text-green-500 text-green-600 text-nowrap text-orange-600 text-red-400 text-red-500 text-red-600 text-sm text-start text-xs text-yellow-600 text/css text/csv text/html text/plain the their them themes this throw timeout timerRef tips title to toJsxRuntime toStaticData toc token tokenInfo token_type transform transformAuthInputs transformPageTree transition-colors tree true truncate try ts type typeof types typescript unchanged under unexpected unknown unlisted update updated updatedSchemeId updating url usage usageTabs usages use useAnchorId useApiClient useAuth useCopyButton useMemo useOnChange useOperationContext useQuery useRef useRenderContext useServerContext useState useStatusInfo useStf useStorageKey useTheme useTranslations used username using utf-8 v value values variable variables variant variants via virtual void w-14 w-fit w-full warn we webhook webhookCallbacks webhooks when whitespace-pre-wrap will with without won wrapping writeOnly x-codeSamples x-exclusiveCodeSample x-selectedCodeSample xml yellow you your");
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, OpenAPIV3_2 } from "./types
|
|
|
2
2
|
import { MediaAdapter } from "./requests/media/adapter.js";
|
|
3
3
|
import { GeneratedPageProps, OperationItem, OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookItem, WebhookOutput } from "./utils/pages/builder.js";
|
|
4
4
|
import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
|
|
5
|
-
import { RenderContext } from "./types.js";
|
|
5
|
+
import { Awaitable, CallbackObject, DistributiveOmit, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RenderContext, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
|
|
6
6
|
import { Config, OutputFile, generateFiles, generateFilesOnly } from "./generate-file.js";
|
|
7
|
-
export { Config, type GeneratedPageProps, type MediaAdapter, type OpenAPI, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationOutput, type OutputEntry, OutputFile, type OutputGroup, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type RenderContext, type SchemaToPagesOptions, type WebhookItem, type WebhookOutput, generateFiles, generateFilesOnly };
|
|
7
|
+
export { type Awaitable, type CallbackObject, Config, type DistributiveOmit, type Document, type ExampleObject, type GeneratedPageProps, type HttpMethods, type MediaAdapter, type MediaTypeObject, type OAuth2SecurityScheme, type OpenAPI, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationObject, type OperationOutput, type OutputEntry, OutputFile, type OutputGroup, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type ParameterObject, type PathItemObject, type ReferenceObject, type RenderContext, type RequestBodyObject, type ResponseObject, type SchemaToPagesOptions, type SecuritySchemeObject, type ServerObject, type ServerVariableObject, type TagObject, type WebhookItem, type WebhookOutput, generateFiles, generateFilesOnly };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/fast-content-type-parse@4.0.0/node_modules/fast-content-type-parse/index.js
|
|
3
|
+
var require_fast_content_type_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
const NullObject = function NullObject() {};
|
|
5
|
+
NullObject.prototype = Object.create(null);
|
|
6
|
+
const HTAB = 9;
|
|
7
|
+
const SP = 32;
|
|
8
|
+
const SEMI = 59;
|
|
9
|
+
const EQ = 61;
|
|
10
|
+
const SLASH = 47;
|
|
11
|
+
const DQUOTE = 34;
|
|
12
|
+
const BSLASH = 92;
|
|
13
|
+
/**
|
|
14
|
+
* Character class lookup table, indexed by UTF-16 code unit. It covers the
|
|
15
|
+
* whole code unit range so that lookups are never out of bounds and always
|
|
16
|
+
* yield a small integer, which keeps the scanning loops on V8's fast path.
|
|
17
|
+
* Code units above 0xff have no class: header field values are octets.
|
|
18
|
+
*
|
|
19
|
+
* RFC 9110 Section 5.6.2:
|
|
20
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
21
|
+
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
22
|
+
* / DIGIT / ALPHA
|
|
23
|
+
* ; any VCHAR, except delimiters
|
|
24
|
+
*
|
|
25
|
+
* RFC 9110 Section 5.6.4:
|
|
26
|
+
* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
|
|
27
|
+
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
28
|
+
* obs-text = %x80-FF
|
|
29
|
+
*/
|
|
30
|
+
const TCHAR = 1;
|
|
31
|
+
const QDTEXT = 2;
|
|
32
|
+
const QUOTED_PAIR = 4;
|
|
33
|
+
const UPPER = 8;
|
|
34
|
+
const CHAR_CLASS = /* @__PURE__ */ new Uint8Array(65536);
|
|
35
|
+
for (const ch of "!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyz") CHAR_CLASS[ch.charCodeAt(0)] = TCHAR;
|
|
36
|
+
for (const ch of "ABCDEFGHIJKLMNOPQRSTUVWXYZ") CHAR_CLASS[ch.charCodeAt(0)] = 9;
|
|
37
|
+
CHAR_CLASS[HTAB] |= 6;
|
|
38
|
+
CHAR_CLASS[SP] |= 6;
|
|
39
|
+
CHAR_CLASS[33] |= 6;
|
|
40
|
+
CHAR_CLASS[DQUOTE] |= QUOTED_PAIR;
|
|
41
|
+
for (let i = 35; i <= 91; i++) CHAR_CLASS[i] |= 6;
|
|
42
|
+
CHAR_CLASS[BSLASH] |= QUOTED_PAIR;
|
|
43
|
+
for (let i = 93; i <= 126; i++) CHAR_CLASS[i] |= 6;
|
|
44
|
+
for (let i = 128; i <= 255; i++) CHAR_CLASS[i] |= 6;
|
|
45
|
+
/**
|
|
46
|
+
* Remove the backslashes of the quoted-pairs in header[start, end).
|
|
47
|
+
* The range is known to be a valid quoted-string body.
|
|
48
|
+
*/
|
|
49
|
+
function unescapeQuotedPairs(header, start, end) {
|
|
50
|
+
let value = "";
|
|
51
|
+
let index = start;
|
|
52
|
+
while (index < end) {
|
|
53
|
+
if (header.charCodeAt(index) === BSLASH) {
|
|
54
|
+
value += header.slice(start, index);
|
|
55
|
+
start = ++index;
|
|
56
|
+
}
|
|
57
|
+
index++;
|
|
58
|
+
}
|
|
59
|
+
return value + header.slice(start, end);
|
|
60
|
+
}
|
|
61
|
+
const defaultContentType = {
|
|
62
|
+
type: "",
|
|
63
|
+
parameters: new NullObject()
|
|
64
|
+
};
|
|
65
|
+
Object.freeze(defaultContentType.parameters);
|
|
66
|
+
Object.freeze(defaultContentType);
|
|
67
|
+
const invalidParameterFormat = {
|
|
68
|
+
type: "",
|
|
69
|
+
parameters: defaultContentType.parameters
|
|
70
|
+
};
|
|
71
|
+
Object.freeze(invalidParameterFormat);
|
|
72
|
+
/**
|
|
73
|
+
* Parse media type to object, following RFC 9110 Section 8.3.1:
|
|
74
|
+
*
|
|
75
|
+
* media-type = type "/" subtype parameters
|
|
76
|
+
* type = token
|
|
77
|
+
* subtype = token
|
|
78
|
+
* parameters = *( OWS ";" OWS [ parameter ] )
|
|
79
|
+
* parameter = parameter-name "=" parameter-value
|
|
80
|
+
* parameter-name = token
|
|
81
|
+
* parameter-value = ( token / quoted-string )
|
|
82
|
+
* OWS = *( SP / HTAB )
|
|
83
|
+
*
|
|
84
|
+
* Leading and trailing OWS is tolerated, as a field parser is required to
|
|
85
|
+
* strip it before evaluating the field value (RFC 9110 Section 5.5).
|
|
86
|
+
*
|
|
87
|
+
* Returns `defaultContentType` when the media type is invalid and
|
|
88
|
+
* `invalidParameterFormat` when the parameters are malformed.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} header
|
|
91
|
+
* @return {Object}
|
|
92
|
+
*/
|
|
93
|
+
function parseHeader(header) {
|
|
94
|
+
const len = header.length;
|
|
95
|
+
let index = 0;
|
|
96
|
+
let code = 0;
|
|
97
|
+
let flags = 0;
|
|
98
|
+
while (index < len) {
|
|
99
|
+
code = header.charCodeAt(index);
|
|
100
|
+
if (code !== SP && code !== HTAB) break;
|
|
101
|
+
index++;
|
|
102
|
+
}
|
|
103
|
+
const typeStart = index;
|
|
104
|
+
let upper = 0;
|
|
105
|
+
while (index < len) {
|
|
106
|
+
code = header.charCodeAt(index);
|
|
107
|
+
flags = CHAR_CLASS[code];
|
|
108
|
+
if ((flags & TCHAR) === 0) break;
|
|
109
|
+
upper |= flags;
|
|
110
|
+
index++;
|
|
111
|
+
}
|
|
112
|
+
if (index === typeStart || index === len || code !== SLASH) return defaultContentType;
|
|
113
|
+
index++;
|
|
114
|
+
const subtypeStart = index;
|
|
115
|
+
while (index < len) {
|
|
116
|
+
code = header.charCodeAt(index);
|
|
117
|
+
flags = CHAR_CLASS[code];
|
|
118
|
+
if ((flags & TCHAR) === 0) break;
|
|
119
|
+
upper |= flags;
|
|
120
|
+
index++;
|
|
121
|
+
}
|
|
122
|
+
if (index === subtypeStart) return defaultContentType;
|
|
123
|
+
const typeEnd = index;
|
|
124
|
+
while (index < len) {
|
|
125
|
+
code = header.charCodeAt(index);
|
|
126
|
+
if (code !== SP && code !== HTAB) break;
|
|
127
|
+
index++;
|
|
128
|
+
}
|
|
129
|
+
if (index !== len && code !== SEMI) return defaultContentType;
|
|
130
|
+
const type = header.slice(typeStart, typeEnd);
|
|
131
|
+
const result = {
|
|
132
|
+
type: (upper & UPPER) !== 0 ? type.toLowerCase() : type,
|
|
133
|
+
parameters: new NullObject()
|
|
134
|
+
};
|
|
135
|
+
if (index === len) return result;
|
|
136
|
+
const parameters = result.parameters;
|
|
137
|
+
while (index < len) {
|
|
138
|
+
index++;
|
|
139
|
+
while (index < len) {
|
|
140
|
+
code = header.charCodeAt(index);
|
|
141
|
+
if (code !== SP && code !== HTAB) break;
|
|
142
|
+
index++;
|
|
143
|
+
}
|
|
144
|
+
if (index === len) return result;
|
|
145
|
+
if (code === SEMI) continue;
|
|
146
|
+
const keyStart = index;
|
|
147
|
+
upper = 0;
|
|
148
|
+
while (index < len) {
|
|
149
|
+
code = header.charCodeAt(index);
|
|
150
|
+
flags = CHAR_CLASS[code];
|
|
151
|
+
if ((flags & TCHAR) === 0) break;
|
|
152
|
+
upper |= flags;
|
|
153
|
+
index++;
|
|
154
|
+
}
|
|
155
|
+
if (index === keyStart || index === len || code !== EQ) return invalidParameterFormat;
|
|
156
|
+
const key = header.slice(keyStart, index);
|
|
157
|
+
index++;
|
|
158
|
+
let value;
|
|
159
|
+
if (index < len && header.charCodeAt(index) === DQUOTE) {
|
|
160
|
+
index++;
|
|
161
|
+
const valueStart = index;
|
|
162
|
+
let escaped = false;
|
|
163
|
+
while (index < len) {
|
|
164
|
+
code = header.charCodeAt(index);
|
|
165
|
+
if (code === DQUOTE) break;
|
|
166
|
+
if ((CHAR_CLASS[code] & QDTEXT) !== 0) {
|
|
167
|
+
index++;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (code !== BSLASH) return invalidParameterFormat;
|
|
171
|
+
index++;
|
|
172
|
+
if (index === len || (CHAR_CLASS[header.charCodeAt(index)] & QUOTED_PAIR) === 0) return invalidParameterFormat;
|
|
173
|
+
escaped = true;
|
|
174
|
+
index++;
|
|
175
|
+
}
|
|
176
|
+
if (index === len) return invalidParameterFormat;
|
|
177
|
+
value = escaped ? unescapeQuotedPairs(header, valueStart, index) : header.slice(valueStart, index);
|
|
178
|
+
index++;
|
|
179
|
+
} else {
|
|
180
|
+
const valueStart = index;
|
|
181
|
+
while (index < len && (CHAR_CLASS[header.charCodeAt(index)] & TCHAR) !== 0) index++;
|
|
182
|
+
if (index === valueStart) return invalidParameterFormat;
|
|
183
|
+
value = header.slice(valueStart, index);
|
|
184
|
+
}
|
|
185
|
+
while (index < len) {
|
|
186
|
+
code = header.charCodeAt(index);
|
|
187
|
+
if (code !== SP && code !== HTAB) break;
|
|
188
|
+
index++;
|
|
189
|
+
}
|
|
190
|
+
if (index !== len && code !== SEMI) return invalidParameterFormat;
|
|
191
|
+
const name = (upper & UPPER) !== 0 ? key.toLowerCase() : key;
|
|
192
|
+
if (parameters[name] === void 0) parameters[name] = value;
|
|
193
|
+
}
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Parse media type to object.
|
|
198
|
+
*
|
|
199
|
+
* @param {string|object} header
|
|
200
|
+
* @return {Object}
|
|
201
|
+
* @public
|
|
202
|
+
*/
|
|
203
|
+
function parse(header) {
|
|
204
|
+
if (typeof header !== "string") throw new TypeError("argument header is required and must be a string");
|
|
205
|
+
const result = parseHeader(header);
|
|
206
|
+
if (result === defaultContentType) throw new TypeError("invalid media type");
|
|
207
|
+
if (result === invalidParameterFormat) throw new TypeError("invalid parameter format");
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
210
|
+
function safeParse(header) {
|
|
211
|
+
if (typeof header !== "string") return defaultContentType;
|
|
212
|
+
const result = parseHeader(header);
|
|
213
|
+
if (result === invalidParameterFormat) return defaultContentType;
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
module.exports.default = {
|
|
217
|
+
parse,
|
|
218
|
+
safeParse
|
|
219
|
+
};
|
|
220
|
+
module.exports.parse = parse;
|
|
221
|
+
module.exports.safeParse = safeParse;
|
|
222
|
+
module.exports.defaultContentType = defaultContentType;
|
|
223
|
+
}));
|
|
224
|
+
//#endregion
|
|
225
|
+
export default require_fast_content_type_parse();
|
|
226
|
+
export { require_fast_content_type_parse };
|
|
@@ -56,7 +56,7 @@ interface RequestBodyInfo {
|
|
|
56
56
|
mediaType: string;
|
|
57
57
|
}
|
|
58
58
|
declare function PlaygroundClient({ route, method, operation, pathItem, writeOnly, readOnly, ...rest }: PlaygroundClientProps): import("react").JSX.Element;
|
|
59
|
-
declare const ParamTypes: readonly [
|
|
59
|
+
declare const ParamTypes: readonly ['path', 'header', 'cookie', 'query'];
|
|
60
60
|
type ParamType = (typeof ParamTypes)[number];
|
|
61
61
|
interface AuthField {
|
|
62
62
|
fieldName: FieldKey;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useStatusInfo } from "../status-info.js";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { ClientCodeBlock } from "../../ui/components/codeblock.js";
|
|
5
|
-
import { require_fast_content_type_parse } from "../../node_modules/.pnpm/fast-content-type-parse@
|
|
5
|
+
import { require_fast_content_type_parse } from "../../node_modules/.pnpm/fast-content-type-parse@4.0.0/node_modules/fast-content-type-parse/index.js";
|
|
6
6
|
import { Fragment, useEffect, useMemo, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { ChevronDown, CircleX, SignpostIcon } from "lucide-react";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { resolveMediaAdapter } from "../requests/media/resolve-adapter.js";
|
|
2
|
-
import "../requests/media/adapter.js";
|
|
3
2
|
//#region src/playground/fetcher.ts
|
|
4
3
|
function createBrowserFetcher(adapters, { proxyUrl, proxyForwardCookie = true, requestTimeout = 10, onRequestInit } = {}) {
|
|
5
4
|
return { async fetch(url, data) {
|
package/dist/server/proxy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/server/proxy.d.ts
|
|
2
|
-
declare const methods: readonly [
|
|
2
|
+
declare const methods: readonly ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'];
|
|
3
3
|
type Handler = (req: Request) => Promise<Response>;
|
|
4
4
|
type OriginMatcher = string | RegExp;
|
|
5
5
|
interface Proxy extends Record<(typeof methods)[number], Handler> {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAPIV3_2 } from "./types/openapi.js";
|
|
1
|
+
import { OpenAPIV3, OpenAPIV3_2 } from "./types/openapi.js";
|
|
2
2
|
import { DereferencedDocument } from "./utils/document/dereference.js";
|
|
3
3
|
import { InlineCodeUsageGenerator } from "./requests/generators/index.js";
|
|
4
4
|
import { CreateOpenAPIPageOptions } from "./ui/index.js";
|
|
@@ -13,10 +13,19 @@ type OperationObject = OpenAPIV3_2.OperationObject & {
|
|
|
13
13
|
'x-exclusiveCodeSample'?: string;
|
|
14
14
|
};
|
|
15
15
|
type ParameterObject = OpenAPIV3_2.ParameterObject;
|
|
16
|
+
type SecuritySchemeObject = OpenAPIV3_2.SecuritySchemeObject;
|
|
17
|
+
type ReferenceObject = OpenAPIV3_2.ReferenceObject;
|
|
16
18
|
type PathItemObject = OpenAPIV3_2.PathItemObject;
|
|
17
19
|
type TagObject = OpenAPIV3_2.TagObject;
|
|
20
|
+
type ServerObject = OpenAPIV3_2.ServerObject;
|
|
21
|
+
type CallbackObject = OpenAPIV3_2.CallbackObject;
|
|
22
|
+
type ServerVariableObject = OpenAPIV3.ServerVariableObject;
|
|
18
23
|
type ResponseObject = OpenAPIV3_2.ResponseObject;
|
|
24
|
+
type OAuth2SecurityScheme = OpenAPIV3_2.OAuth2SecurityScheme;
|
|
19
25
|
type HttpMethods = OpenAPIV3_2.HttpMethods;
|
|
26
|
+
type ExampleObject = OpenAPIV3_2.ExampleObject;
|
|
27
|
+
type MediaTypeObject = OpenAPIV3_2.MediaTypeObject;
|
|
28
|
+
type RequestBodyObject = OpenAPIV3_2.RequestBodyObject;
|
|
20
29
|
type RequireKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
21
30
|
interface RenderContext extends Pick<OpenAPIOptions, 'proxyUrl'>, Omit<RequireKeys<CreateOpenAPIPageOptions, 'generateTypeScriptDefinitions' | 'mediaAdapters' | 'codeUsages' | 'shikiOptions' | 'shiki'>, 'schemaUI'> {
|
|
22
31
|
/**
|
|
@@ -24,9 +33,9 @@ interface RenderContext extends Pick<OpenAPIOptions, 'proxyUrl'>, Omit<RequireKe
|
|
|
24
33
|
*/
|
|
25
34
|
schema: DereferencedDocument;
|
|
26
35
|
_default_processMarkdown: (md: string) => ReactNode;
|
|
27
|
-
SchemaUI: FC<Omit<SchemaUIOptions, '
|
|
36
|
+
SchemaUI: FC<Omit<SchemaUIOptions, 'renderMarkdown' | 'renderCodeblock'>>;
|
|
28
37
|
}
|
|
29
38
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
30
39
|
type Awaitable<T> = T | Promise<T>;
|
|
31
40
|
//#endregion
|
|
32
|
-
export { Awaitable, DistributiveOmit, Document, HttpMethods, OperationObject, ParameterObject, PathItemObject, RenderContext, ResponseObject, TagObject };
|
|
41
|
+
export { Awaitable, CallbackObject, DistributiveOmit, Document, ExampleObject, HttpMethods, MediaTypeObject, OAuth2SecurityScheme, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RenderContext, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject };
|
package/dist/ui/base.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { RenderContextProvider, ServerProvider, useRenderContext } from "./contexts/api.js";
|
|
3
3
|
import { ClientCodeBlock } from "./components/codeblock.js";
|
|
4
4
|
import { createCodeUsageGeneratorRegistry } from "../requests/generators/index.js";
|
|
5
|
-
import { defaultAdapters } from "../requests/media/adapter.js";
|
|
6
5
|
import { AuthProvider } from "../playground/auth.js";
|
|
6
|
+
import { defaultAdapters } from "../requests/media/adapter.js";
|
|
7
7
|
import { Markdown } from "./components/markdown.js";
|
|
8
8
|
import { Operation } from "./operation/index.js";
|
|
9
9
|
import { dereferenceBundledDocument } from "../utils/document/dereference.js";
|
|
@@ -89,12 +89,13 @@ function createOpenAPIPageBase({ shiki, shikiOptions = { themes: {
|
|
|
89
89
|
generateTypeScriptDefinitions,
|
|
90
90
|
codeUsages,
|
|
91
91
|
SchemaUI(props) {
|
|
92
|
-
|
|
93
|
-
return /* @__PURE__ */ jsx(Schema, {
|
|
92
|
+
const merged = {
|
|
94
93
|
...schemaUIShared,
|
|
95
94
|
...props,
|
|
96
95
|
showExample: props.showExample ?? schemaUIOptions?.showExample
|
|
97
|
-
}
|
|
96
|
+
};
|
|
97
|
+
if (schemaUIOptions?.render) return schemaUIOptions.render(merged, ctx);
|
|
98
|
+
return /* @__PURE__ */ jsx(Schema, { ...merged });
|
|
98
99
|
},
|
|
99
100
|
...options,
|
|
100
101
|
_default_processMarkdown(md) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RenderContext, ServerObject } from "../../types.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/ui/contexts/api.d.ts
|
|
4
|
+
interface ServerContextType {
|
|
5
|
+
servers?: ServerObject[];
|
|
6
|
+
server: SelectedServer | null;
|
|
7
|
+
setServer: (value: string) => void;
|
|
8
|
+
setServerVariables: (value: Record<string, string>) => void;
|
|
9
|
+
}
|
|
10
|
+
interface SelectedServer {
|
|
11
|
+
url: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
variables: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
declare function useRenderContext(): RenderContext;
|
|
16
|
+
declare function useServerContext(): ServerContextType;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { SelectedServer, useRenderContext, useServerContext };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -6,8 +6,11 @@ import { ResponseTabsRenderOptions } from "./operation/response-tabs.js";
|
|
|
6
6
|
import { ParsedSchema } from "../utils/schema.js";
|
|
7
7
|
import { PlaygroundClientOptions } from "../playground/client.js";
|
|
8
8
|
import { GeneratedPageProps, OperationItem, WebhookItem } from "../utils/pages/builder.js";
|
|
9
|
+
import { useRenderContext, useServerContext } from "./contexts/api.js";
|
|
10
|
+
import { useOperationContext } from "./operation/context.js";
|
|
9
11
|
import { Awaitable, Document, HttpMethods, OperationObject, PathItemObject, RenderContext } from "../types.js";
|
|
10
12
|
import { ComponentProps, FC, HTMLAttributes, ReactNode } from "react";
|
|
13
|
+
import { SchemaUIOptions } from "@fumadocs/api-docs/components/schema";
|
|
11
14
|
import { ShikiFactory } from "fumadocs-core/highlight/shiki";
|
|
12
15
|
import { BundledTheme, CodeOptionsThemes, CodeToHastOptionsCommon } from "shiki";
|
|
13
16
|
//#region src/ui/index.d.ts
|
|
@@ -114,11 +117,7 @@ interface CreateOpenAPIPageOptions {
|
|
|
114
117
|
* Info UI for JSON schemas.
|
|
115
118
|
*/
|
|
116
119
|
schemaUI?: {
|
|
117
|
-
render?: (options:
|
|
118
|
-
root: ParsedSchema;
|
|
119
|
-
readOnly?: boolean;
|
|
120
|
-
writeOnly?: boolean;
|
|
121
|
-
}, ctx: RenderContext) => ReactNode;
|
|
120
|
+
render?: (options: SchemaUIOptions, ctx: RenderContext) => ReactNode;
|
|
122
121
|
/**
|
|
123
122
|
* Show examples under the generated content of JSON schemas.
|
|
124
123
|
*
|
|
@@ -203,4 +202,4 @@ declare function createOpenAPIPage(options?: CreateOpenAPIPageOptions): FC<OpenA
|
|
|
203
202
|
/** @deprecated Use `OpenAPIPageProps` instead */
|
|
204
203
|
type ApiPageProps = OpenAPIPageProps;
|
|
205
204
|
//#endregion
|
|
206
|
-
export { APIPlaygroundProps, ApiPageProps, CreateOpenAPIPageOptions, GenerateTypeScriptDefinitionsContext, OpenAPIPageProps, OpenAPIPageProps_Preloaded, OpenAPIPageProps_Spec, type OperationItem, type WebhookItem, createOpenAPIPage };
|
|
205
|
+
export { APIPlaygroundProps, ApiPageProps, CreateOpenAPIPageOptions, GenerateTypeScriptDefinitionsContext, OpenAPIPageProps, OpenAPIPageProps_Preloaded, OpenAPIPageProps_Spec, type OperationItem, type WebhookItem, createOpenAPIPage, useOperationContext, useRenderContext, useServerContext };
|
package/dist/ui/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useRenderContext, useServerContext } from "./contexts/api.js";
|
|
3
|
+
import { useOperationContext } from "./operation/context.js";
|
|
2
4
|
import { createOpenAPIPageBase } from "./base.js";
|
|
3
5
|
import { defaultShikiFactory } from "fumadocs-core/highlight/shiki/full";
|
|
4
6
|
//#region src/ui/index.tsx
|
|
@@ -12,4 +14,4 @@ function createOpenAPIPage(options = {}) {
|
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
//#endregion
|
|
15
|
-
export { createOpenAPIPage };
|
|
17
|
+
export { createOpenAPIPage, useOperationContext, useRenderContext, useServerContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RawRequestData, RequestData } from "../../requests/types.js";
|
|
2
|
+
import { ExampleRequestItem } from "../../utils/get-example-requests.js";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
//#region src/ui/operation/context.d.ts
|
|
5
|
+
type ExampleUpdateListener = (data: RawRequestData, encoded: RequestData) => void;
|
|
6
|
+
declare function useOperationContext(): {
|
|
7
|
+
route: string;
|
|
8
|
+
examples: ExampleRequestItem[];
|
|
9
|
+
example: string | undefined;
|
|
10
|
+
setExample: (id: string) => void;
|
|
11
|
+
setExampleData: (data: RawRequestData, encoded: RequestData) => void;
|
|
12
|
+
addListener: (listener: ExampleUpdateListener) => void;
|
|
13
|
+
removeListener: (listener: ExampleUpdateListener) => void;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ExampleUpdateListener, useOperationContext };
|
|
@@ -4,9 +4,9 @@ import { ServerProvider, useRenderContext } from "../contexts/api.js";
|
|
|
4
4
|
import { cn } from "../../utils/cn.js";
|
|
5
5
|
import { Badge, MethodLabel } from "../components/method-label.js";
|
|
6
6
|
import { isMediaTypeSupported } from "../../requests/media/resolve-adapter.js";
|
|
7
|
-
import "../../requests/media/adapter.js";
|
|
8
7
|
import { OperationProvider } from "./context.js";
|
|
9
8
|
import PlaygroundClient from "../../playground/client.js";
|
|
9
|
+
import "../../requests/media/adapter.js";
|
|
10
10
|
import { Markdown } from "../components/markdown.js";
|
|
11
11
|
import { UsageTabs } from "./usage-tabs.js";
|
|
12
12
|
import { RequestTabs } from "./request-tabs.js";
|
package/dist/utils/cn.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "cn";
|
|
2
2
|
export { cn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.1",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -45,32 +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.13.
|
|
48
|
+
"@scalar/json-magic": "^0.13.3",
|
|
49
49
|
"chokidar": "^5.0.0",
|
|
50
50
|
"class-variance-authority": "^0.7.1",
|
|
51
|
-
"
|
|
51
|
+
"cn": "^0.2.4",
|
|
52
52
|
"github-slugger": "^2.0.0",
|
|
53
53
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
54
|
-
"lucide-react": "^1.
|
|
54
|
+
"lucide-react": "^1.39.0",
|
|
55
55
|
"remark": "^15.0.1",
|
|
56
56
|
"remark-rehype": "^11.1.2",
|
|
57
57
|
"shiki": "^4.4.3",
|
|
58
58
|
"yaml": "^2.9.0",
|
|
59
|
-
"@fumadocs/api-docs": "0.2.
|
|
59
|
+
"@fumadocs/api-docs": "0.2.8",
|
|
60
60
|
"@fumari/stf": "1.1.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@scalar/api-client-react": "^2.0.
|
|
63
|
+
"@scalar/api-client-react": "^2.0.43",
|
|
64
64
|
"@scalar/openapi-upgrader": "^0.2.15",
|
|
65
65
|
"@tailwindcss/oxide": "^4.3.3",
|
|
66
|
-
"@types/node": "26.
|
|
66
|
+
"@types/node": "26.4.1",
|
|
67
67
|
"@types/react": "^19.2.18",
|
|
68
|
-
"fast-content-type-parse": "^
|
|
68
|
+
"fast-content-type-parse": "^4.0.0",
|
|
69
|
+
"fuma-cli": "^0.1.1",
|
|
69
70
|
"json-schema-typed": "^8.0.2",
|
|
70
71
|
"tsdown": "0.22.14",
|
|
71
72
|
"xml-js": "^1.6.11",
|
|
72
|
-
"fumadocs-
|
|
73
|
-
"fumadocs-
|
|
73
|
+
"fumadocs-core": "16.15.6",
|
|
74
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@16.15.6",
|
|
74
75
|
"tsconfig": "0.0.0"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
},
|
|
96
97
|
"inlinedDependencies": {
|
|
97
98
|
"@scalar/openapi-upgrader": "0.2.15",
|
|
98
|
-
"fast-content-type-parse": "
|
|
99
|
+
"fast-content-type-parse": "4.0.0",
|
|
99
100
|
"xml-js": "1.6.11"
|
|
100
101
|
},
|
|
101
102
|
"scripts": {
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js
|
|
3
|
-
var require_fast_content_type_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
-
const NullObject = function NullObject() {};
|
|
5
|
-
NullObject.prototype = Object.create(null);
|
|
6
|
-
/**
|
|
7
|
-
* RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
|
|
8
|
-
*
|
|
9
|
-
* parameter = token "=" ( token / quoted-string )
|
|
10
|
-
* token = 1*tchar
|
|
11
|
-
* tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
|
|
12
|
-
* / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
|
|
13
|
-
* / DIGIT / ALPHA
|
|
14
|
-
* ; any VCHAR, except delimiters
|
|
15
|
-
* quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
|
|
16
|
-
* qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
|
|
17
|
-
* obs-text = %x80-FF
|
|
18
|
-
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
19
|
-
*/
|
|
20
|
-
const paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
21
|
-
/**
|
|
22
|
-
* RegExp to match quoted-pair in RFC 7230 sec 3.2.6
|
|
23
|
-
*
|
|
24
|
-
* quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
|
|
25
|
-
* obs-text = %x80-FF
|
|
26
|
-
*/
|
|
27
|
-
const quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
28
|
-
/**
|
|
29
|
-
* RegExp to match type in RFC 7231 sec 3.1.1.1
|
|
30
|
-
*
|
|
31
|
-
* media-type = type "/" subtype
|
|
32
|
-
* type = token
|
|
33
|
-
* subtype = token
|
|
34
|
-
*/
|
|
35
|
-
const mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
|
|
36
|
-
const defaultContentType = {
|
|
37
|
-
type: "",
|
|
38
|
-
parameters: new NullObject()
|
|
39
|
-
};
|
|
40
|
-
Object.freeze(defaultContentType.parameters);
|
|
41
|
-
Object.freeze(defaultContentType);
|
|
42
|
-
/**
|
|
43
|
-
* Parse media type to object.
|
|
44
|
-
*
|
|
45
|
-
* @param {string|object} header
|
|
46
|
-
* @return {Object}
|
|
47
|
-
* @public
|
|
48
|
-
*/
|
|
49
|
-
function parse(header) {
|
|
50
|
-
if (typeof header !== "string") throw new TypeError("argument header is required and must be a string");
|
|
51
|
-
let index = header.indexOf(";");
|
|
52
|
-
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
53
|
-
if (mediaTypeRE.test(type) === false) throw new TypeError("invalid media type");
|
|
54
|
-
const result = {
|
|
55
|
-
type: type.toLowerCase(),
|
|
56
|
-
parameters: new NullObject()
|
|
57
|
-
};
|
|
58
|
-
if (index === -1) return result;
|
|
59
|
-
let key;
|
|
60
|
-
let match;
|
|
61
|
-
let value;
|
|
62
|
-
paramRE.lastIndex = index;
|
|
63
|
-
while (match = paramRE.exec(header)) {
|
|
64
|
-
if (match.index !== index) throw new TypeError("invalid parameter format");
|
|
65
|
-
index += match[0].length;
|
|
66
|
-
key = match[1].toLowerCase();
|
|
67
|
-
value = match[2];
|
|
68
|
-
if (value[0] === "\"") {
|
|
69
|
-
value = value.slice(1, value.length - 1);
|
|
70
|
-
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
|
|
71
|
-
}
|
|
72
|
-
result.parameters[key] = value;
|
|
73
|
-
}
|
|
74
|
-
if (index !== header.length) throw new TypeError("invalid parameter format");
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
function safeParse(header) {
|
|
78
|
-
if (typeof header !== "string") return defaultContentType;
|
|
79
|
-
let index = header.indexOf(";");
|
|
80
|
-
const type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
81
|
-
if (mediaTypeRE.test(type) === false) return defaultContentType;
|
|
82
|
-
const result = {
|
|
83
|
-
type: type.toLowerCase(),
|
|
84
|
-
parameters: new NullObject()
|
|
85
|
-
};
|
|
86
|
-
if (index === -1) return result;
|
|
87
|
-
let key;
|
|
88
|
-
let match;
|
|
89
|
-
let value;
|
|
90
|
-
paramRE.lastIndex = index;
|
|
91
|
-
while (match = paramRE.exec(header)) {
|
|
92
|
-
if (match.index !== index) return defaultContentType;
|
|
93
|
-
index += match[0].length;
|
|
94
|
-
key = match[1].toLowerCase();
|
|
95
|
-
value = match[2];
|
|
96
|
-
if (value[0] === "\"") {
|
|
97
|
-
value = value.slice(1, value.length - 1);
|
|
98
|
-
quotedPairRE.test(value) && (value = value.replace(quotedPairRE, "$1"));
|
|
99
|
-
}
|
|
100
|
-
result.parameters[key] = value;
|
|
101
|
-
}
|
|
102
|
-
if (index !== header.length) return defaultContentType;
|
|
103
|
-
return result;
|
|
104
|
-
}
|
|
105
|
-
module.exports.default = {
|
|
106
|
-
parse,
|
|
107
|
-
safeParse
|
|
108
|
-
};
|
|
109
|
-
module.exports.parse = parse;
|
|
110
|
-
module.exports.safeParse = safeParse;
|
|
111
|
-
module.exports.defaultContentType = defaultContentType;
|
|
112
|
-
}));
|
|
113
|
-
//#endregion
|
|
114
|
-
export default require_fast_content_type_parse();
|
|
115
|
-
export { require_fast_content_type_parse };
|