fumadocs-openapi 11.4.0 → 11.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.translations/index.d.ts +2 -3
- package/dist/generate-file.d.ts +5 -6
- package/dist/i18n.d.ts +3 -3
- 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 +10 -10
- package/dist/playground/components/result-display.d.ts +3 -4
- package/dist/playground/components/result-display.js +1 -1
- package/dist/playground/fetcher.d.ts +5 -6
- package/dist/requests/generators/all.d.ts +2 -3
- package/dist/requests/generators/csharp.d.ts +2 -3
- package/dist/requests/generators/curl.d.ts +2 -3
- package/dist/requests/generators/go.d.ts +2 -3
- package/dist/requests/generators/index.d.ts +7 -8
- package/dist/requests/generators/java.d.ts +2 -3
- package/dist/requests/generators/javascript.d.ts +2 -3
- package/dist/requests/generators/python.d.ts +3 -4
- package/dist/requests/generators/rust.d.ts +2 -3
- package/dist/requests/media/adapter.d.ts +3 -4
- package/dist/requests/media/encode.d.ts +3 -4
- package/dist/requests/types.d.ts +3 -4
- package/dist/scalar/index.d.ts +2 -3
- package/dist/server/index.d.ts +9 -9
- package/dist/server/proxy.d.ts +5 -6
- package/dist/types/openapi.d.ts +7 -8
- package/dist/types.d.ts +20 -21
- package/dist/ui/base.d.ts +2 -3
- package/dist/ui/contexts/api.d.ts +4 -5
- package/dist/ui/create-client.d.ts +4 -5
- package/dist/ui/index.d.ts +11 -9
- package/dist/ui/operation/context.d.ts +3 -4
- package/dist/ui/operation/index.js +2 -0
- package/dist/ui/operation/request-tabs.d.ts +2 -3
- package/dist/ui/operation/response-tabs.d.ts +3 -4
- package/dist/ui/operation/usage-tabs.js +4 -6
- package/dist/utils/cn.js +1 -1
- package/dist/utils/document/dereference.d.ts +2 -3
- package/dist/utils/get-example-requests.d.ts +2 -3
- package/dist/utils/pages/builder.d.ts +11 -12
- package/dist/utils/pages/preset-auto.d.ts +2 -3
- package/dist/utils/pages/to-text.d.ts +3 -4
- package/package.json +13 -13
- package/dist/node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.js +0 -115
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/.translations/index.d.ts
|
|
2
|
-
type Translations = {
|
|
2
|
+
export type Translations = {
|
|
3
3
|
"Access Token(playground)": string;
|
|
4
4
|
"Authenticate using username and password.(OAuth dialog)": string;
|
|
5
5
|
"Authenticate with 3rd party services(OAuth dialog)": string;
|
|
@@ -82,5 +82,4 @@ type Translations = {
|
|
|
82
82
|
"Username(OAuth dialog)": string;
|
|
83
83
|
"loading...(playground server select)": string;
|
|
84
84
|
};
|
|
85
|
-
//#endregion
|
|
86
|
-
export { Translations };
|
|
85
|
+
//#endregion
|
package/dist/generate-file.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { OpenAPIServer } from "./server/index.js";
|
|
|
4
4
|
import { DistributiveOmit } from "./types.js";
|
|
5
5
|
import { PagesToTextOptions } from "./utils/pages/to-text.js";
|
|
6
6
|
//#region src/generate-file.d.ts
|
|
7
|
-
interface OutputFile {
|
|
7
|
+
export interface OutputFile {
|
|
8
8
|
path: string;
|
|
9
9
|
content: string;
|
|
10
10
|
}
|
|
@@ -60,7 +60,7 @@ interface GenerateFilesConfig extends PagesToTextOptions {
|
|
|
60
60
|
interface MetaOptions {
|
|
61
61
|
folderStyle?: 'folder' | 'separator';
|
|
62
62
|
}
|
|
63
|
-
type Config = SchemaToPagesOptions & GenerateFilesConfig & {
|
|
63
|
+
export type Config = SchemaToPagesOptions & GenerateFilesConfig & {
|
|
64
64
|
/**
|
|
65
65
|
* Re-generate when **schema files are changed**, ignores custom input functions & URLs.
|
|
66
66
|
*
|
|
@@ -72,7 +72,6 @@ interface BeforeWriteContext {
|
|
|
72
72
|
readonly generated: Record<string, OutputFile[]>;
|
|
73
73
|
readonly generatedEntries: Record<string, OutputEntry[]>;
|
|
74
74
|
}
|
|
75
|
-
declare function generateFiles(options: Config): Promise<void>;
|
|
76
|
-
declare function generateFilesOnly(options: DistributiveOmit<Config, 'output'>): Promise<OutputFile[]>;
|
|
77
|
-
//#endregion
|
|
78
|
-
export { Config, OutputFile, generateFiles, generateFilesOnly };
|
|
75
|
+
export declare function generateFiles(options: Config): Promise<void>;
|
|
76
|
+
export declare function generateFilesOnly(options: DistributiveOmit<Config, 'output'>): Promise<OutputFile[]>;
|
|
77
|
+
//#endregion
|
package/dist/i18n.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Translations as Translations$1 } from "@fumadocs/api-docs/i18n";
|
|
|
3
3
|
import { TranslationExtension } from "fumadocs-core/i18n";
|
|
4
4
|
import { I18nUIConfig } from "fumadocs-ui/i18n";
|
|
5
5
|
//#region src/i18n.d.ts
|
|
6
|
-
declare function openapiTranslations(): TranslationExtension<keyof Translations | keyof Translations$1>;
|
|
6
|
+
export declare function openapiTranslations(): TranslationExtension<keyof Translations | keyof Translations$1>;
|
|
7
7
|
/** @deprecated use `i18n.translations()` & `openapiTranslations()` instead */
|
|
8
|
-
declare function defineI18nOpenAPI<Languages extends string>(config: I18nUIConfig<Languages>, translations: Partial<Record<NoInfer<Languages>, Partial<Translations>>>): I18nUIConfig<Languages>;
|
|
8
|
+
export declare function defineI18nOpenAPI<Languages extends string>(config: I18nUIConfig<Languages>, translations: Partial<Record<NoInfer<Languages>, Partial<Translations>>>): I18nUIConfig<Languages>;
|
|
9
9
|
//#endregion
|
|
10
|
-
export {
|
|
10
|
+
export type { Translations };
|
|
@@ -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 };
|
|
@@ -6,14 +6,14 @@ import { ComponentProps, FC, ReactNode } from "react";
|
|
|
6
6
|
import { Collapsible } from "@fumadocs/api-docs/components/collapsible";
|
|
7
7
|
import { FieldKey } from "@fumari/stf";
|
|
8
8
|
//#region src/playground/client.d.ts
|
|
9
|
-
interface FormValues extends Record<string, unknown> {
|
|
9
|
+
export interface FormValues extends Record<string, unknown> {
|
|
10
10
|
path: Record<string, unknown>;
|
|
11
11
|
query: Record<string, unknown>;
|
|
12
12
|
header: Record<string, unknown>;
|
|
13
13
|
cookie: Record<string, unknown>;
|
|
14
14
|
body: unknown;
|
|
15
15
|
}
|
|
16
|
-
interface PlaygroundClientProps extends Omit<ComponentProps<'form'>, 'method'> {
|
|
16
|
+
export interface PlaygroundClientProps extends Omit<ComponentProps<'form'>, 'method'> {
|
|
17
17
|
route: string;
|
|
18
18
|
method: HttpMethods;
|
|
19
19
|
operation: OperationObject;
|
|
@@ -21,11 +21,11 @@ interface PlaygroundClientProps extends Omit<ComponentProps<'form'>, 'method'> {
|
|
|
21
21
|
writeOnly: boolean;
|
|
22
22
|
readOnly: boolean;
|
|
23
23
|
}
|
|
24
|
-
interface CollapsiblePanelProps extends Omit<ComponentProps<typeof Collapsible>, 'title'> {
|
|
24
|
+
export interface CollapsiblePanelProps extends Omit<ComponentProps<typeof Collapsible>, 'title'> {
|
|
25
25
|
'data-type': 'authorization' | 'body' | ParamType;
|
|
26
26
|
title: ReactNode;
|
|
27
27
|
}
|
|
28
|
-
interface PlaygroundClientOptions {
|
|
28
|
+
export interface PlaygroundClientOptions {
|
|
29
29
|
/**
|
|
30
30
|
* transform fields for auth-specific parameters (e.g. header)
|
|
31
31
|
*/
|
|
@@ -55,10 +55,10 @@ interface RequestBodyInfo {
|
|
|
55
55
|
schema: ParsedSchema;
|
|
56
56
|
mediaType: string;
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
declare const ParamTypes: readonly [
|
|
58
|
+
export default function PlaygroundClient({ route, method, operation, pathItem, writeOnly, readOnly, ...rest }: PlaygroundClientProps): import("react").JSX.Element;
|
|
59
|
+
declare const ParamTypes: readonly ['path', 'header', 'cookie', 'query'];
|
|
60
60
|
type ParamType = (typeof ParamTypes)[number];
|
|
61
|
-
interface AuthField {
|
|
61
|
+
export interface AuthField {
|
|
62
62
|
fieldName: FieldKey;
|
|
63
63
|
schemeId: string;
|
|
64
64
|
storageKey: string;
|
|
@@ -66,8 +66,8 @@ interface AuthField {
|
|
|
66
66
|
children: ReactNode;
|
|
67
67
|
mapOutput?: (values: unknown) => unknown;
|
|
68
68
|
}
|
|
69
|
-
declare function DefaultCollapsiblePanel({ title, children, ...props }: CollapsiblePanelProps): import("react").JSX.Element;
|
|
70
|
-
declare const Custom: {
|
|
69
|
+
export declare function DefaultCollapsiblePanel({ title, children, ...props }: CollapsiblePanelProps): import("react").JSX.Element;
|
|
70
|
+
export declare const Custom: {
|
|
71
71
|
useController(fieldName: FieldKey, options?: {
|
|
72
72
|
defaultValue?: unknown;
|
|
73
73
|
}): {
|
|
@@ -76,4 +76,4 @@ declare const Custom: {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
//#endregion
|
|
79
|
-
export {
|
|
79
|
+
export { DefaultResultDisplay, type ResultDisplayProps };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FetchResult } from "../fetcher.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/playground/components/result-display.d.ts
|
|
4
|
-
interface ResultDisplayProps extends ComponentProps<'div'> {
|
|
4
|
+
export interface ResultDisplayProps extends ComponentProps<'div'> {
|
|
5
5
|
data: FetchResult;
|
|
6
6
|
reset: () => void;
|
|
7
7
|
}
|
|
8
|
-
declare function DefaultResultDisplay({ data, reset, ...rest }: ResultDisplayProps): import("react").JSX.Element;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { DefaultResultDisplay, ResultDisplayProps };
|
|
8
|
+
export declare function DefaultResultDisplay({ data, reset, ...rest }: ResultDisplayProps): import("react").JSX.Element;
|
|
9
|
+
//#endregion
|
|
@@ -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,20 +1,20 @@
|
|
|
1
1
|
import "../requests/types.js";
|
|
2
2
|
import { Awaitable } from "../types.js";
|
|
3
3
|
//#region src/playground/fetcher.d.ts
|
|
4
|
-
type FetchResult = FetchResponseResult | FetchErrorResult;
|
|
5
|
-
interface FetchErrorResult {
|
|
4
|
+
export type FetchResult = FetchResponseResult | FetchErrorResult;
|
|
5
|
+
export interface FetchErrorResult {
|
|
6
6
|
type: 'client_error';
|
|
7
7
|
url: string;
|
|
8
8
|
message: string;
|
|
9
9
|
}
|
|
10
|
-
interface FetchResponseResult {
|
|
10
|
+
export interface FetchResponseResult {
|
|
11
11
|
type: 'response';
|
|
12
12
|
url: string;
|
|
13
13
|
status: number;
|
|
14
14
|
headers: Headers;
|
|
15
15
|
body: ArrayBuffer;
|
|
16
16
|
}
|
|
17
|
-
interface BrowserFetcherOptions {
|
|
17
|
+
export interface BrowserFetcherOptions {
|
|
18
18
|
/**
|
|
19
19
|
* Request timeout in seconds (default: 10s)
|
|
20
20
|
*/
|
|
@@ -31,5 +31,4 @@ interface BrowserFetcherOptions {
|
|
|
31
31
|
*/
|
|
32
32
|
onRequestInit?: (requestInit: RequestInit) => Awaitable<RequestInit>;
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { BrowserFetcherOptions, FetchErrorResult, FetchResponseResult, FetchResult };
|
|
34
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CodeUsageGeneratorRegistry } from "./index.js";
|
|
2
2
|
//#region src/requests/generators/all.d.ts
|
|
3
|
-
declare function registerDefault(registry: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { registerDefault };
|
|
3
|
+
export declare function registerDefault(registry: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
|
|
4
|
+
//#endregion
|
|
@@ -2,8 +2,8 @@ import { MediaAdapter } from "../media/adapter.js";
|
|
|
2
2
|
import { RequestData } from "../types.js";
|
|
3
3
|
import * as Shared from "@fumadocs/api-docs/codegen";
|
|
4
4
|
//#region src/requests/generators/index.d.ts
|
|
5
|
-
declare function pathnameFromRequest(pathname: string, { path, query }: RequestData): string;
|
|
6
|
-
type CodeUsageGeneratorRegistry = Shared.CodeUsageGeneratorRegistry<RequestData & {
|
|
5
|
+
export declare function pathnameFromRequest(pathname: string, { path, query }: RequestData): string;
|
|
6
|
+
export type CodeUsageGeneratorRegistry = Shared.CodeUsageGeneratorRegistry<RequestData & {
|
|
7
7
|
url: string;
|
|
8
8
|
}, {
|
|
9
9
|
mediaAdapters: Record<string, MediaAdapter>;
|
|
@@ -12,7 +12,7 @@ type CodeUsageGeneratorRegistry = Shared.CodeUsageGeneratorRegistry<RequestData
|
|
|
12
12
|
/**
|
|
13
13
|
* Generate code example for given programming language
|
|
14
14
|
*/
|
|
15
|
-
type CodeUsageGenerator = Shared.CodeUsageGenerator<RequestData & {
|
|
15
|
+
export type CodeUsageGenerator = Shared.CodeUsageGenerator<RequestData & {
|
|
16
16
|
url: string;
|
|
17
17
|
}, {
|
|
18
18
|
mediaAdapters: Record<string, MediaAdapter>;
|
|
@@ -21,18 +21,17 @@ type CodeUsageGenerator = Shared.CodeUsageGenerator<RequestData & {
|
|
|
21
21
|
/**
|
|
22
22
|
* Generate code example for given programming language
|
|
23
23
|
*/
|
|
24
|
-
type InlineCodeUsageGenerator<T = unknown> = Shared.InlineCodeUsageGenerator<RequestData & {
|
|
24
|
+
export type InlineCodeUsageGenerator<T = unknown> = Shared.InlineCodeUsageGenerator<RequestData & {
|
|
25
25
|
url: string;
|
|
26
26
|
}, {
|
|
27
27
|
mediaAdapters: Record<string, MediaAdapter>;
|
|
28
28
|
custom: T;
|
|
29
29
|
}>;
|
|
30
|
-
declare function createCodeUsageGeneratorRegistry(inherit?: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
|
|
31
|
-
type CodeUsageGeneratorFn<T = unknown> = (data: RequestData & {
|
|
30
|
+
export declare function createCodeUsageGeneratorRegistry(inherit?: CodeUsageGeneratorRegistry): CodeUsageGeneratorRegistry;
|
|
31
|
+
export type CodeUsageGeneratorFn<T = unknown> = (data: RequestData & {
|
|
32
32
|
url: string;
|
|
33
33
|
}, context: {
|
|
34
34
|
mediaAdapters: Record<string, MediaAdapter>;
|
|
35
35
|
custom: T;
|
|
36
36
|
}) => string;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { CodeUsageGenerator, CodeUsageGeneratorFn, CodeUsageGeneratorRegistry, InlineCodeUsageGenerator, createCodeUsageGeneratorRegistry, pathnameFromRequest };
|
|
37
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CodeUsageGenerator } from "./index.js";
|
|
2
2
|
//#region src/requests/generators/python.d.ts
|
|
3
|
-
declare const python: CodeUsageGenerator;
|
|
4
|
-
declare function generatePythonObject(v: unknown, imports: Set<string>): string;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { generatePythonObject, python };
|
|
3
|
+
export declare const python: CodeUsageGenerator;
|
|
4
|
+
export declare function generatePythonObject(v: unknown, imports: Set<string>): string;
|
|
5
|
+
//#endregion
|
|
@@ -21,10 +21,10 @@ interface CSharpContext extends BaseContext {
|
|
|
21
21
|
lang: 'csharp';
|
|
22
22
|
addImport: (specifier: string) => void;
|
|
23
23
|
}
|
|
24
|
-
type MediaContext = JavaContext | GoContext | JavaScriptContext | CSharpContext | (BaseContext & {
|
|
24
|
+
export type MediaContext = JavaContext | GoContext | JavaScriptContext | CSharpContext | (BaseContext & {
|
|
25
25
|
lang: string;
|
|
26
26
|
});
|
|
27
|
-
interface MediaAdapter {
|
|
27
|
+
export interface MediaAdapter {
|
|
28
28
|
/**
|
|
29
29
|
* encode data into specified media type for `fetch()`.
|
|
30
30
|
*
|
|
@@ -46,5 +46,4 @@ interface MediaAdapter {
|
|
|
46
46
|
body: unknown;
|
|
47
47
|
}, ctx: MediaContext) => string | undefined;
|
|
48
48
|
}
|
|
49
|
-
//#endregion
|
|
50
|
-
export { MediaAdapter, MediaContext };
|
|
49
|
+
//#endregion
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "../types.js";
|
|
2
2
|
import "../../types.js";
|
|
3
3
|
//#region src/requests/media/encode.d.ts
|
|
4
|
-
interface EncodedParameter {
|
|
4
|
+
export interface EncodedParameter {
|
|
5
5
|
readonly value: string;
|
|
6
6
|
}
|
|
7
|
-
interface EncodedParameterMultiple {
|
|
7
|
+
export interface EncodedParameterMultiple {
|
|
8
8
|
readonly values: string[];
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { EncodedParameter, EncodedParameterMultiple };
|
|
10
|
+
//#endregion
|
package/dist/requests/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EncodedParameter, EncodedParameterMultiple } from "./media/encode.js";
|
|
2
2
|
import { HttpMethods } from "../types.js";
|
|
3
3
|
//#region src/requests/types.d.ts
|
|
4
|
-
interface RawRequestData {
|
|
4
|
+
export interface RawRequestData {
|
|
5
5
|
method: HttpMethods;
|
|
6
6
|
path: Record<string, unknown>;
|
|
7
7
|
query: Record<string, unknown>;
|
|
@@ -10,7 +10,7 @@ interface RawRequestData {
|
|
|
10
10
|
body?: unknown;
|
|
11
11
|
bodyMediaType?: string;
|
|
12
12
|
}
|
|
13
|
-
interface RequestData {
|
|
13
|
+
export interface RequestData {
|
|
14
14
|
method: HttpMethods;
|
|
15
15
|
path: Record<string, EncodedParameter>;
|
|
16
16
|
query: Record<string, EncodedParameterMultiple>;
|
|
@@ -19,5 +19,4 @@ interface RequestData {
|
|
|
19
19
|
body?: unknown;
|
|
20
20
|
bodyMediaType?: string;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { RawRequestData, RequestData };
|
|
22
|
+
//#endregion
|
package/dist/scalar/index.d.ts
CHANGED
|
@@ -5,6 +5,5 @@ import { CreateOpenAPIPageOptions } from "../ui/index.js";
|
|
|
5
5
|
*
|
|
6
6
|
* Requires `@scalar/api-client-react` to be installed, it imports the styles automatically.
|
|
7
7
|
*/
|
|
8
|
-
declare function withScalar(options?: CreateOpenAPIPageOptions): CreateOpenAPIPageOptions;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { withScalar };
|
|
8
|
+
export declare function withScalar(options?: CreateOpenAPIPageOptions): CreateOpenAPIPageOptions;
|
|
9
|
+
//#endregion
|
package/dist/server/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type SchemaRecord = Record<string, string | Document | (() => Awaitable<string |
|
|
|
13
13
|
interface LoadedDocument {
|
|
14
14
|
bundled: Document;
|
|
15
15
|
}
|
|
16
|
-
interface OpenAPIOptions {
|
|
16
|
+
export interface OpenAPIOptions {
|
|
17
17
|
/**
|
|
18
18
|
* Schema files, can be:
|
|
19
19
|
* - URL
|
|
@@ -27,7 +27,7 @@ interface OpenAPIOptions {
|
|
|
27
27
|
*/
|
|
28
28
|
proxyUrl?: string;
|
|
29
29
|
}
|
|
30
|
-
interface OpenAPIServer {
|
|
30
|
+
export interface OpenAPIServer {
|
|
31
31
|
createProxy: typeof createProxy;
|
|
32
32
|
getSchemas: () => Promise<Record<string, LoadedDocument>>;
|
|
33
33
|
getSchema: (document: string) => Promise<LoadedDocument>;
|
|
@@ -54,7 +54,7 @@ interface OpenAPIServer {
|
|
|
54
54
|
/** @private internal API */
|
|
55
55
|
_getWatchPaths: () => string[];
|
|
56
56
|
}
|
|
57
|
-
interface OpenAPIPageData extends PageData {
|
|
57
|
+
export interface OpenAPIPageData extends PageData {
|
|
58
58
|
getOpenAPIPageProps: () => OpenAPIPageProps_Spec;
|
|
59
59
|
getSchema: () => {
|
|
60
60
|
id: string;
|
|
@@ -68,15 +68,15 @@ interface OpenAPIPageData extends PageData {
|
|
|
68
68
|
/** @deprecated use `getOpenAPIPageProps()` instead */
|
|
69
69
|
getClientAPIPageProps: () => OpenAPIPageProps_Spec;
|
|
70
70
|
}
|
|
71
|
-
type OpenAPISourceOptions = SchemaToPagesOptions & {
|
|
71
|
+
export type OpenAPISourceOptions = SchemaToPagesOptions & {
|
|
72
72
|
baseDir?: string;
|
|
73
73
|
/** Generate `meta.json` files */
|
|
74
74
|
meta?: boolean | {
|
|
75
75
|
folderStyle?: 'folder' | 'separator';
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
-
declare function createOpenAPI(options?: OpenAPIOptions): OpenAPIServer;
|
|
79
|
-
interface InternalOpenAPIMeta {
|
|
78
|
+
export declare function createOpenAPI(options?: OpenAPIOptions): OpenAPIServer;
|
|
79
|
+
export interface InternalOpenAPIMeta {
|
|
80
80
|
method?: string;
|
|
81
81
|
webhook?: boolean;
|
|
82
82
|
deprecated?: boolean;
|
|
@@ -85,13 +85,13 @@ interface InternalOpenAPIMeta {
|
|
|
85
85
|
/**
|
|
86
86
|
* Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
|
|
87
87
|
*/
|
|
88
|
-
declare function openapiPlugin(): LoaderPlugin;
|
|
88
|
+
export declare function openapiPlugin(): LoaderPlugin;
|
|
89
89
|
/**
|
|
90
90
|
* Generate virtual pages for Fumadocs Source API
|
|
91
91
|
*/
|
|
92
|
-
declare function openapiSource(server: OpenAPIServer, options?: OpenAPISourceOptions): Promise<Source<{
|
|
92
|
+
export declare function openapiSource(server: OpenAPIServer, options?: OpenAPISourceOptions): Promise<Source<{
|
|
93
93
|
metaData: MetaData;
|
|
94
94
|
pageData: OpenAPIPageData;
|
|
95
95
|
}>>;
|
|
96
96
|
//#endregion
|
|
97
|
-
export {
|
|
97
|
+
export type { CreateProxyOptions, OpenAPIPageProps_Preloaded, OpenAPIPageProps_Spec, Proxy };
|