fumadocs-openapi 6.3.0 → 7.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/playground/client.d.ts +4 -3
- package/dist/playground/client.d.ts.map +1 -1
- package/dist/playground/client.js +109 -102
- package/dist/playground/fetcher.d.ts +6 -22
- package/dist/playground/fetcher.d.ts.map +1 -1
- package/dist/playground/fetcher.js +25 -85
- package/dist/playground/get-default-values.d.ts +2 -3
- package/dist/playground/get-default-values.d.ts.map +1 -1
- package/dist/playground/get-default-values.js +8 -4
- package/dist/playground/index.d.ts +0 -1
- package/dist/playground/index.d.ts.map +1 -1
- package/dist/playground/index.js +0 -1
- package/dist/playground/inputs.d.ts.map +1 -1
- package/dist/playground/inputs.js +46 -32
- package/dist/render/operation/api-example.d.ts +18 -4
- package/dist/render/operation/api-example.d.ts.map +1 -1
- package/dist/render/operation/api-example.js +68 -72
- package/dist/render/operation/get-request-data.d.ts +5 -0
- package/dist/render/operation/get-request-data.d.ts.map +1 -0
- package/dist/render/operation/get-request-data.js +71 -0
- package/dist/render/{operation.d.ts → operation/index.d.ts} +4 -4
- package/dist/render/operation/index.d.ts.map +1 -0
- package/dist/render/{operation.js → operation/index.js} +14 -15
- package/dist/render/renderer.d.ts +1 -9
- package/dist/render/renderer.d.ts.map +1 -1
- package/dist/render/renderer.js +3 -5
- package/dist/requests/_shared.d.ts +11 -0
- package/dist/requests/_shared.d.ts.map +1 -0
- package/dist/requests/_shared.js +4 -0
- package/dist/requests/curl.d.ts +2 -2
- package/dist/requests/curl.d.ts.map +1 -1
- package/dist/requests/curl.js +17 -18
- package/dist/requests/go.d.ts +2 -2
- package/dist/requests/go.d.ts.map +1 -1
- package/dist/requests/go.js +15 -14
- package/dist/requests/index.d.ts +3 -0
- package/dist/requests/index.d.ts.map +1 -0
- package/dist/requests/index.js +26 -0
- package/dist/requests/javascript.d.ts +2 -2
- package/dist/requests/javascript.d.ts.map +1 -1
- package/dist/requests/javascript.js +20 -27
- package/dist/requests/python.d.ts +2 -2
- package/dist/requests/python.d.ts.map +1 -1
- package/dist/requests/python.js +18 -22
- package/dist/server/api-page.js +1 -1
- package/dist/types.d.ts +5 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/client.d.ts +1 -2
- package/dist/ui/client.d.ts.map +1 -1
- package/dist/ui/client.js +1 -3
- package/dist/ui/components/method-label.d.ts +1 -1
- package/dist/ui/contexts/api.d.ts +3 -5
- package/dist/ui/contexts/api.d.ts.map +1 -1
- package/dist/ui/contexts/api.js +2 -7
- package/dist/ui/contexts/code-example.d.ts +25 -0
- package/dist/ui/contexts/code-example.d.ts.map +1 -0
- package/dist/ui/contexts/code-example.js +104 -0
- package/dist/ui/contexts/code-example.lazy.d.ts +12 -0
- package/dist/ui/contexts/code-example.lazy.d.ts.map +1 -0
- package/dist/ui/contexts/code-example.lazy.js +5 -0
- package/dist/ui/server-select.d.ts +6 -1
- package/dist/ui/server-select.d.ts.map +1 -1
- package/dist/ui/server-select.js +6 -7
- package/dist/utils/get-pathname-from-input.d.ts +2 -0
- package/dist/utils/get-pathname-from-input.d.ts.map +1 -0
- package/dist/utils/get-pathname-from-input.js +15 -0
- package/dist/utils/get-typescript-schema.d.ts +2 -3
- package/dist/utils/get-typescript-schema.d.ts.map +1 -1
- package/dist/utils/get-typescript-schema.js +13 -16
- package/package.json +6 -6
- package/dist/render/operation.d.ts.map +0 -1
- package/dist/ui/sample-select.d.ts +0 -4
- package/dist/ui/sample-select.d.ts.map +0 -1
- package/dist/ui/sample-select.js +0 -19
- package/dist/utils/generate-sample.d.ts +0 -40
- package/dist/utils/generate-sample.d.ts.map +0 -1
- package/dist/utils/generate-sample.js +0 -109
|
@@ -8,9 +8,10 @@ interface FormValues {
|
|
|
8
8
|
username: string;
|
|
9
9
|
password: string;
|
|
10
10
|
};
|
|
11
|
-
path: Record<string,
|
|
12
|
-
query: Record<string,
|
|
13
|
-
header: Record<string,
|
|
11
|
+
path: Record<string, string>;
|
|
12
|
+
query: Record<string, string>;
|
|
13
|
+
header: Record<string, string>;
|
|
14
|
+
cookie: Record<string, string>;
|
|
14
15
|
body: unknown;
|
|
15
16
|
}
|
|
16
17
|
export interface CustomField<TName extends FieldPath<FormValues>, Info> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/playground/client.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EAInB,KAAK,EAAE,EAGP,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/playground/client.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useRef, useEffect, Fragment, createContext, useContext, } from 'react';
|
|
3
|
+
import { useMemo, useRef, useEffect, Fragment, createContext, useContext, useState, } from 'react';
|
|
4
4
|
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
|
5
5
|
import { cn, buttonVariants } from 'fumadocs-ui/components/api';
|
|
6
|
-
import { useApiContext } from '../ui/contexts/api.js';
|
|
7
|
-
import { getDefaultValue, getDefaultValues } from './get-default-values.js';
|
|
6
|
+
import { useApiContext, useServerSelectContext } from '../ui/contexts/api.js';
|
|
8
7
|
import { FieldSet, ObjectInput } from './inputs.js';
|
|
9
8
|
import { getStatusInfo } from './status-info.js';
|
|
10
9
|
import { getUrl } from '../utils/server-url.js';
|
|
@@ -15,6 +14,8 @@ import ServerSelect from '../ui/server-select.js';
|
|
|
15
14
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible';
|
|
16
15
|
import { ChevronDown } from 'lucide-react';
|
|
17
16
|
import { OauthDialog, OauthDialogTrigger, } from '../playground/auth/oauth-dialog.js';
|
|
17
|
+
import { useRequestData } from '../ui/contexts/code-example.js';
|
|
18
|
+
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
18
19
|
const SchemaContext = createContext(undefined);
|
|
19
20
|
export function useSchemaContext() {
|
|
20
21
|
const ctx = useContext(SchemaContext);
|
|
@@ -22,94 +23,56 @@ export function useSchemaContext() {
|
|
|
22
23
|
throw new Error('Missing provider');
|
|
23
24
|
return ctx;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
function toRequestData(method, mediaType, value) {
|
|
27
|
+
return {
|
|
28
|
+
path: value.path,
|
|
29
|
+
method,
|
|
30
|
+
header: value.header,
|
|
31
|
+
body: value.body,
|
|
32
|
+
bodyMediaType: mediaType,
|
|
33
|
+
cookie: value.cookie,
|
|
34
|
+
query: value.query,
|
|
35
|
+
};
|
|
35
36
|
}
|
|
36
37
|
export function Client({ route, method = 'GET', authorization, path = [], header = [], query = [], body, fields = {}, schemas, proxyUrl, components: { ResultDisplay = DefaultResultDisplay } = {}, ...props }) {
|
|
37
|
-
const {
|
|
38
|
+
const { servers } = useApiContext();
|
|
39
|
+
const { server, setServer, setServerVariables } = useServerSelectContext();
|
|
38
40
|
const dynamicRef = useRef(new Map());
|
|
41
|
+
const requestData = useRequestData();
|
|
42
|
+
const authInfo = usePersistentAuthInfo(authorization);
|
|
43
|
+
const defaultValues = useMemo(() => ({
|
|
44
|
+
authorization: authInfo.info,
|
|
45
|
+
path: requestData.data.path,
|
|
46
|
+
query: requestData.data.query,
|
|
47
|
+
header: requestData.data.header,
|
|
48
|
+
body: requestData.data.body,
|
|
49
|
+
cookie: requestData.data.cookie,
|
|
50
|
+
}), [authInfo.info, requestData.data]);
|
|
39
51
|
const form = useForm({
|
|
40
|
-
defaultValues
|
|
41
|
-
authorization: defaultAuthValue(authorization),
|
|
42
|
-
path: getDefaultValues(path, schemas),
|
|
43
|
-
query: getDefaultValues(query, schemas),
|
|
44
|
-
header: getDefaultValues(header, schemas),
|
|
45
|
-
body: body ? getDefaultValue(body, schemas) : undefined,
|
|
46
|
-
},
|
|
52
|
+
defaultValues,
|
|
47
53
|
});
|
|
48
54
|
const testQuery = useQuery(async (input) => {
|
|
49
|
-
const fetcher = await import('./fetcher.js').then((mod) => mod.createBrowserFetcher(
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
if (authorization?.type === 'apiKey') {
|
|
53
|
-
if (authorization.in === 'header') {
|
|
54
|
-
header[authorization.name] = input.authorization;
|
|
55
|
-
}
|
|
56
|
-
else if (authorization.in === 'query') {
|
|
57
|
-
query[authorization.name] = input.authorization;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
if ('cookie' in header) {
|
|
61
|
-
header.Cookie = header.cookie;
|
|
62
|
-
delete header.cookie;
|
|
63
|
-
}
|
|
64
|
-
header.Cookie = [
|
|
65
|
-
header.Cookie,
|
|
66
|
-
`${authorization.name}=${input.authorization}`,
|
|
67
|
-
]
|
|
68
|
-
.filter((s) => s.length > 0)
|
|
69
|
-
.join('; ');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else if (authorization?.type === 'http' &&
|
|
73
|
-
authorization.scheme === 'basic') {
|
|
74
|
-
if (typeof input.authorization === 'object')
|
|
75
|
-
header.Authorization = `Basic ${btoa(`${input.authorization.username}:${input.authorization.password}`)}`;
|
|
76
|
-
}
|
|
77
|
-
else if (authorization) {
|
|
78
|
-
header.Authorization = input.authorization;
|
|
79
|
-
}
|
|
80
|
-
const serverUrl = serverRef.current
|
|
81
|
-
? getUrl(serverRef.current.url, serverRef.current.variables)
|
|
55
|
+
const fetcher = await import('./fetcher.js').then((mod) => mod.createBrowserFetcher());
|
|
56
|
+
const serverUrl = server
|
|
57
|
+
? getUrl(server.url, server.variables)
|
|
82
58
|
: window.location.origin;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
updated.searchParams.append('url', url);
|
|
87
|
-
url = updated.toString();
|
|
88
|
-
}
|
|
89
|
-
return fetcher.fetch({
|
|
90
|
-
url: url.toString(),
|
|
91
|
-
header,
|
|
92
|
-
body: body
|
|
93
|
-
? {
|
|
94
|
-
mediaType: body.mediaType,
|
|
95
|
-
value: input.body,
|
|
96
|
-
}
|
|
97
|
-
: undefined,
|
|
98
|
-
dynamicFields: dynamicRef.current,
|
|
99
|
-
method,
|
|
59
|
+
return fetcher.fetch(`${serverUrl}${route}`, {
|
|
60
|
+
proxyUrl,
|
|
61
|
+
...toRequestData(method, body?.mediaType, input),
|
|
100
62
|
});
|
|
101
63
|
});
|
|
102
64
|
useEffect(() => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
65
|
+
form.reset(defaultValues);
|
|
66
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- update default value
|
|
67
|
+
}, [defaultValues]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const subscription = form.watch((_value) => {
|
|
70
|
+
const value = _value;
|
|
71
|
+
if (authorization && value.authorization) {
|
|
72
|
+
authInfo.saveInfo(value.authorization);
|
|
73
|
+
writeAuthHeader(authorization, value.authorization, value.header, value.query);
|
|
74
|
+
}
|
|
75
|
+
requestData.saveData(toRequestData(method, body?.mediaType, value));
|
|
113
76
|
});
|
|
114
77
|
return () => {
|
|
115
78
|
subscription.unsubscribe();
|
|
@@ -136,12 +99,10 @@ export function Client({ route, method = 'GET', authorization, path = [], header
|
|
|
136
99
|
username: {
|
|
137
100
|
type: 'string',
|
|
138
101
|
isRequired: true,
|
|
139
|
-
defaultValue: '',
|
|
140
102
|
},
|
|
141
103
|
password: {
|
|
142
104
|
type: 'string',
|
|
143
105
|
isRequired: true,
|
|
144
|
-
defaultValue: '',
|
|
145
106
|
},
|
|
146
107
|
},
|
|
147
108
|
}
|
|
@@ -150,12 +111,11 @@ export function Client({ route, method = 'GET', authorization, path = [], header
|
|
|
150
111
|
type: 'string',
|
|
151
112
|
isRequired: true,
|
|
152
113
|
description: 'The Authorization access token',
|
|
153
|
-
defaultValue: '',
|
|
154
114
|
}, fields.auth), authorization?.type === 'oauth2' && (_jsx(OauthDialogTrigger, { type: "button", className: cn(buttonVariants({
|
|
155
115
|
color: 'secondary',
|
|
156
116
|
})), children: "Open" }))] }));
|
|
157
117
|
}
|
|
158
|
-
let children = (_jsxs("form", { ...props, className: cn('not-prose flex flex-col gap-2 rounded-xl border p-3 shadow-md', props.className), onSubmit: onSubmit, children: [_jsx(FormHeader, { method: method, route: route, isLoading: testQuery.isLoading }), servers.length > 1 ? (_jsx(CollapsiblePanel, { title: "Server URL", children: _jsx(ServerSelect, {}) })) : null, header.length > 0 || authorization ? (_jsxs(CollapsiblePanel, { title: "Headers", children: [authField, header.map((field) => renderCustomField(`header.${field.name}`, field, fields.header, field.name))] })) : null, path.length > 0 ? (_jsx(CollapsiblePanel, { title: "Path", children: path.map((field) => renderCustomField(`path.${field.name}`, field, fields.path, field.name)) })) : null, query.length > 0 ? (_jsx(CollapsiblePanel, { title: "Query", children: query.map((field) => renderCustomField(`query.${field.name}`, field, fields.query, field.name)) })) : null, body ? (_jsx(CollapsiblePanel, { title: "Body", children: body.type === 'object' && !fields.body ? (_jsx(ObjectInput, { field: body, fieldName: "body" })) : (renderCustomField('body', body, fields.body)) })) : null, testQuery.data ? _jsx(ResultDisplay, { data: testQuery.data }) : null] }));
|
|
118
|
+
let children = (_jsxs("form", { ...props, className: cn('not-prose flex flex-col gap-2 rounded-xl border p-3 shadow-md', props.className), onSubmit: onSubmit, children: [_jsx(FormHeader, { method: method, route: route, isLoading: testQuery.isLoading }), servers.length > 1 ? (_jsx(CollapsiblePanel, { title: "Server URL", children: _jsx(ServerSelect, { server: server, onServerChanged: setServer, onVariablesChanged: setServerVariables }) })) : null, header.length > 0 || authorization ? (_jsxs(CollapsiblePanel, { title: "Headers", children: [authField, header.map((field) => renderCustomField(`header.${field.name}`, field, fields.header, field.name))] })) : null, path.length > 0 ? (_jsx(CollapsiblePanel, { title: "Path", children: path.map((field) => renderCustomField(`path.${field.name}`, field, fields.path, field.name)) })) : null, query.length > 0 ? (_jsx(CollapsiblePanel, { title: "Query", children: query.map((field) => renderCustomField(`query.${field.name}`, field, fields.query, field.name)) })) : null, body ? (_jsx(CollapsiblePanel, { title: "Body", children: body.type === 'object' && !fields.body ? (_jsx(ObjectInput, { field: body, fieldName: "body" })) : (renderCustomField('body', body, fields.body)) })) : null, testQuery.data ? _jsx(ResultDisplay, { data: testQuery.data }) : null] }));
|
|
159
119
|
if (authorization?.type === 'oauth2') {
|
|
160
120
|
// only the first one, so it looks simpler :)
|
|
161
121
|
const flow = Object.keys(authorization.flows)[0];
|
|
@@ -163,23 +123,6 @@ export function Client({ route, method = 'GET', authorization, path = [], header
|
|
|
163
123
|
}
|
|
164
124
|
return (_jsx(FormProvider, { ...form, children: _jsx(SchemaContext.Provider, { value: useMemo(() => ({ references: schemas, dynamic: dynamicRef }), [schemas]), children: children }) }));
|
|
165
125
|
}
|
|
166
|
-
function createPathnameFromInput(route, path, query) {
|
|
167
|
-
let pathname = route;
|
|
168
|
-
for (const key of Object.keys(path)) {
|
|
169
|
-
const paramValue = path[key];
|
|
170
|
-
if (typeof paramValue === 'string' && paramValue.length > 0)
|
|
171
|
-
pathname = pathname.replace(`{${key}}`, paramValue);
|
|
172
|
-
}
|
|
173
|
-
const searchParams = new URLSearchParams();
|
|
174
|
-
for (const key of Object.keys(query)) {
|
|
175
|
-
const paramValue = query[key];
|
|
176
|
-
if (typeof paramValue === 'string' && paramValue.length > 0)
|
|
177
|
-
searchParams.append(key, paramValue);
|
|
178
|
-
}
|
|
179
|
-
return searchParams.size > 0
|
|
180
|
-
? `${pathname}?${searchParams.toString()}`
|
|
181
|
-
: pathname;
|
|
182
|
-
}
|
|
183
126
|
function Route({ route, ...props }) {
|
|
184
127
|
const segments = route.split('/').filter((part) => part.length > 0);
|
|
185
128
|
return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-0.5 overflow-auto text-nowrap', props.className), children: segments.map((part, index) => (_jsxs(Fragment, { children: [_jsx("span", { className: "text-fd-muted-foreground", children: "/" }), part.startsWith('{') && part.endsWith('}') ? (_jsx("code", { className: "bg-fd-primary/10 text-fd-primary", children: part })) : (_jsx("code", { className: "text-fd-foreground", children: part }))] }, index))) }));
|
|
@@ -196,6 +139,70 @@ function DefaultResultDisplay({ data }) {
|
|
|
196
139
|
? data.data
|
|
197
140
|
: JSON.stringify(data.data, null, 2), ...shikiOptions })) : null] }));
|
|
198
141
|
}
|
|
142
|
+
function usePersistentAuthInfo(authorization) {
|
|
143
|
+
const key = authorization
|
|
144
|
+
? `__fumadocs_auth_${JSON.stringify(authorization)}`
|
|
145
|
+
: null;
|
|
146
|
+
const [info, setInfo] = useState(() => {
|
|
147
|
+
if (!authorization || authorization.type === 'apiKey')
|
|
148
|
+
return '';
|
|
149
|
+
if (authorization.type === 'http' && authorization.scheme === 'basic') {
|
|
150
|
+
return {
|
|
151
|
+
username: '',
|
|
152
|
+
password: '',
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return 'Bearer';
|
|
156
|
+
});
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
if (!key)
|
|
159
|
+
return;
|
|
160
|
+
const item = localStorage.getItem(key);
|
|
161
|
+
if (item) {
|
|
162
|
+
setInfo(JSON.parse(item));
|
|
163
|
+
}
|
|
164
|
+
}, [key]);
|
|
165
|
+
return {
|
|
166
|
+
info,
|
|
167
|
+
saveInfo: useEffectEvent((value) => {
|
|
168
|
+
if (!key)
|
|
169
|
+
return;
|
|
170
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
171
|
+
}),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
199
174
|
function CollapsiblePanel({ title, children, ...props }) {
|
|
200
175
|
return (_jsxs(Collapsible, { ...props, className: "border rounded-xl bg-fd-card text-fd-card-foreground overflow-hidden", children: [_jsxs(CollapsibleTrigger, { className: "group w-full inline-flex items-center gap-2 justify-between p-3 text-sm font-medium hover:bg-fd-accent", children: [title, _jsx(ChevronDown, { className: "size-4 group-data-[state=open]:rotate-180" })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "flex flex-col gap-4 p-3", children: children }) })] }));
|
|
201
176
|
}
|
|
177
|
+
function writeAuthHeader(authorization, input, header, query) {
|
|
178
|
+
if (authorization.type === 'apiKey') {
|
|
179
|
+
if (authorization.in === 'header') {
|
|
180
|
+
header[authorization.name] = input;
|
|
181
|
+
}
|
|
182
|
+
if (authorization.in === 'query') {
|
|
183
|
+
query[authorization.name] = input;
|
|
184
|
+
}
|
|
185
|
+
if (authorization.in === 'cookie') {
|
|
186
|
+
if ('cookie' in header) {
|
|
187
|
+
header.Cookie = header.cookie;
|
|
188
|
+
delete header.cookie;
|
|
189
|
+
}
|
|
190
|
+
header.Cookie = [
|
|
191
|
+
header.Cookie,
|
|
192
|
+
`${authorization.name}=${input}`,
|
|
193
|
+
]
|
|
194
|
+
.filter((s) => s.length > 0)
|
|
195
|
+
.join('; ');
|
|
196
|
+
}
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (authorization.type === 'http' &&
|
|
200
|
+
authorization.scheme === 'basic' &&
|
|
201
|
+
typeof input === 'object') {
|
|
202
|
+
header.Authorization = `Basic ${btoa(`${input.username}:${input.password}`)}`;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (typeof input === 'string') {
|
|
206
|
+
header.Authorization = input;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
url: string;
|
|
5
|
-
method: string;
|
|
6
|
-
header: Record<string, unknown>;
|
|
7
|
-
body?: {
|
|
8
|
-
mediaType: string;
|
|
9
|
-
value: unknown;
|
|
10
|
-
};
|
|
11
|
-
dynamicFields?: Map<string, DynamicField>;
|
|
1
|
+
import { RequestData } from '../requests/_shared.js';
|
|
2
|
+
export interface FetchOptions extends RequestData {
|
|
3
|
+
proxyUrl?: string;
|
|
12
4
|
}
|
|
13
5
|
export interface FetchResult {
|
|
14
6
|
status: number;
|
|
@@ -16,19 +8,11 @@ export interface FetchResult {
|
|
|
16
8
|
data: unknown;
|
|
17
9
|
}
|
|
18
10
|
export interface Fetcher {
|
|
19
|
-
|
|
20
|
-
* @param input - fetch request inputs
|
|
21
|
-
* @param dynamicFields - schema of dynamic fields, given by the playground client
|
|
22
|
-
*/
|
|
23
|
-
fetch: (options: FetchOptions) => Promise<FetchResult>;
|
|
11
|
+
fetch: (route: string, options: FetchOptions) => Promise<FetchResult>;
|
|
24
12
|
}
|
|
25
|
-
|
|
26
|
-
* @param bodySchema - schema of body
|
|
27
|
-
* @param references - defined references of schemas, needed for resolve cyclic references
|
|
28
|
-
*/
|
|
29
|
-
export declare function createBrowserFetcher(bodySchema: RequestSchema | undefined, references: Record<string, RequestSchema>): Fetcher;
|
|
13
|
+
export declare function createBrowserFetcher(): Fetcher;
|
|
30
14
|
/**
|
|
31
15
|
* Create request body from value
|
|
32
16
|
*/
|
|
33
|
-
export declare function createBodyFromValue(mediaType:
|
|
17
|
+
export declare function createBodyFromValue(mediaType: Required<RequestData>['bodyMediaType'], value: unknown): Promise<string | FormData>;
|
|
34
18
|
//# sourceMappingURL=fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/playground/fetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../src/playground/fetcher.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACvE;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CA6D9C;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,EACjD,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,CAqC5B"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @param references - defined references of schemas, needed for resolve cyclic references
|
|
5
|
-
*/
|
|
6
|
-
export function createBrowserFetcher(bodySchema, references) {
|
|
1
|
+
import { getPathnameFromInput } from '../utils/get-pathname-from-input.js';
|
|
2
|
+
import { js2xml } from 'xml-js';
|
|
3
|
+
export function createBrowserFetcher() {
|
|
7
4
|
return {
|
|
8
|
-
async fetch(options) {
|
|
5
|
+
async fetch(route, options) {
|
|
9
6
|
const headers = new Headers();
|
|
10
|
-
if (options.
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (options.bodyMediaType &&
|
|
8
|
+
options.bodyMediaType !== 'multipart/form-data')
|
|
9
|
+
headers.append('Content-Type', options.bodyMediaType);
|
|
10
|
+
for (const key in options.header) {
|
|
13
11
|
const paramValue = options.header[key];
|
|
14
|
-
if (
|
|
12
|
+
if (paramValue.length > 0)
|
|
15
13
|
headers.append(key, paramValue.toString());
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
let url = getPathnameFromInput(route, options.path, options.query);
|
|
16
|
+
if (options.proxyUrl) {
|
|
17
|
+
const updated = new URL(options.proxyUrl, window.location.origin);
|
|
18
|
+
updated.searchParams.append('url', url);
|
|
19
|
+
url = updated.toString();
|
|
20
|
+
}
|
|
21
|
+
return fetch(url, {
|
|
18
22
|
method: options.method,
|
|
19
23
|
cache: 'no-cache',
|
|
20
24
|
headers,
|
|
21
|
-
body:
|
|
22
|
-
? await createBodyFromValue(options.
|
|
25
|
+
body: options.bodyMediaType && options.body
|
|
26
|
+
? await createBodyFromValue(options.bodyMediaType, options.body)
|
|
23
27
|
: undefined,
|
|
24
28
|
signal: AbortSignal.timeout(10 * 1000),
|
|
25
29
|
})
|
|
@@ -51,24 +55,22 @@ export function createBrowserFetcher(bodySchema, references) {
|
|
|
51
55
|
/**
|
|
52
56
|
* Create request body from value
|
|
53
57
|
*/
|
|
54
|
-
export async function createBodyFromValue(mediaType, value
|
|
55
|
-
const result = convertValue('body', value, schema, references, dynamicFields);
|
|
58
|
+
export async function createBodyFromValue(mediaType, value) {
|
|
56
59
|
if (mediaType === 'application/json') {
|
|
57
|
-
return JSON.stringify(
|
|
60
|
+
return JSON.stringify(value);
|
|
58
61
|
}
|
|
59
62
|
if (mediaType === 'application/xml') {
|
|
60
|
-
|
|
61
|
-
return js2xml(result, {
|
|
63
|
+
return js2xml(value, {
|
|
62
64
|
compact: true,
|
|
63
65
|
spaces: 2,
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
const formData = new FormData();
|
|
67
|
-
if (typeof
|
|
68
|
-
throw new Error(`Unsupported body type: ${typeof
|
|
69
|
+
if (typeof value !== 'object' || !value) {
|
|
70
|
+
throw new Error(`Unsupported body type: ${typeof value}, expected: object`);
|
|
69
71
|
}
|
|
70
|
-
for (const key
|
|
71
|
-
const prop =
|
|
72
|
+
for (const key in value) {
|
|
73
|
+
const prop = value[key];
|
|
72
74
|
if (typeof prop === 'object' && prop instanceof File) {
|
|
73
75
|
formData.set(key, prop);
|
|
74
76
|
}
|
|
@@ -83,65 +85,3 @@ export async function createBodyFromValue(mediaType, value, schema, references,
|
|
|
83
85
|
}
|
|
84
86
|
return formData;
|
|
85
87
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Convert a value (object or string) to the corresponding type of schema
|
|
88
|
-
*
|
|
89
|
-
* @param fieldName - field name of value
|
|
90
|
-
* @param value - the original value
|
|
91
|
-
* @param schema - the schema of field
|
|
92
|
-
* @param references - schema references
|
|
93
|
-
* @param dynamicFields - Dynamic references
|
|
94
|
-
*/
|
|
95
|
-
function convertValue(fieldName, value, schema, references, dynamicFields) {
|
|
96
|
-
const isEmpty = value === '' || value === undefined || value === null;
|
|
97
|
-
if (isEmpty && schema.isRequired)
|
|
98
|
-
return schema.type === 'boolean' ? false : '';
|
|
99
|
-
else if (isEmpty)
|
|
100
|
-
return undefined;
|
|
101
|
-
if (Array.isArray(value) && schema.type === 'array') {
|
|
102
|
-
return value.map((item, index) => convertValue(`${fieldName}.${String(index)}`, item, resolve(schema.items, references), references, dynamicFields));
|
|
103
|
-
}
|
|
104
|
-
if (schema.type === 'switcher') {
|
|
105
|
-
return convertValue(fieldName, value, resolve(getDynamicFieldSchema(fieldName, dynamicFields, Object.values(schema.items).at(0)), references), references, dynamicFields);
|
|
106
|
-
}
|
|
107
|
-
if (typeof value === 'object' && schema.type === 'object') {
|
|
108
|
-
const entries = Object.keys(value).map((key) => {
|
|
109
|
-
const prop = value[key];
|
|
110
|
-
const propFieldName = `${fieldName}.${key}`;
|
|
111
|
-
if (key in schema.properties) {
|
|
112
|
-
return [
|
|
113
|
-
key,
|
|
114
|
-
convertValue(propFieldName, prop, resolve(schema.properties[key], references), references, dynamicFields),
|
|
115
|
-
];
|
|
116
|
-
}
|
|
117
|
-
if (schema.additionalProperties) {
|
|
118
|
-
const schema = resolve(getDynamicFieldSchema(propFieldName, dynamicFields), references);
|
|
119
|
-
return [
|
|
120
|
-
key,
|
|
121
|
-
convertValue(propFieldName, prop, schema, references, dynamicFields),
|
|
122
|
-
];
|
|
123
|
-
}
|
|
124
|
-
console.warn('Could not resolve field', propFieldName, dynamicFields);
|
|
125
|
-
return [key, prop];
|
|
126
|
-
});
|
|
127
|
-
return Object.fromEntries(entries);
|
|
128
|
-
}
|
|
129
|
-
switch (schema.type) {
|
|
130
|
-
case 'number':
|
|
131
|
-
return Number(value);
|
|
132
|
-
case 'boolean':
|
|
133
|
-
return value === 'null' ? undefined : value === 'true';
|
|
134
|
-
case 'file':
|
|
135
|
-
return value; // file
|
|
136
|
-
default:
|
|
137
|
-
return String(value);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function getDynamicFieldSchema(name, dynamicFields, defaultValue) {
|
|
141
|
-
const field = dynamicFields.get(name);
|
|
142
|
-
if (field?.type === 'field')
|
|
143
|
-
return field.schema;
|
|
144
|
-
if (defaultValue)
|
|
145
|
-
return defaultValue;
|
|
146
|
-
return { type: 'null', isRequired: false };
|
|
147
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getDefaultValue(item: RequestSchema, references: Record<string, RequestSchema>): unknown;
|
|
3
|
-
export declare function getDefaultValues(field: PrimitiveRequestField[], context: Record<string, RequestSchema>): Record<string, unknown>;
|
|
1
|
+
import type { ReferenceSchema, RequestSchema } from '../playground/index.js';
|
|
2
|
+
export declare function getDefaultValue(item: RequestSchema | ReferenceSchema, references: Record<string, RequestSchema>): unknown;
|
|
4
3
|
//# sourceMappingURL=get-default-values.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-values.d.ts","sourceRoot":"","sources":["../../src/playground/get-default-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"get-default-values.d.ts","sourceRoot":"","sources":["../../src/playground/get-default-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGzE,wBAAgB,eAAe,CAC7B,IAAI,EAAE,aAAa,GAAG,eAAe,EACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GACxC,OAAO,CA2BT"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { resolve } from '../playground/resolve.js';
|
|
2
2
|
export function getDefaultValue(item, references) {
|
|
3
|
+
if (item.type === 'ref')
|
|
4
|
+
return getDefaultValue(resolve(item, references), references);
|
|
3
5
|
if (item.type === 'object')
|
|
4
6
|
return Object.fromEntries(Object.entries(item.properties).map(([key, prop]) => [
|
|
5
7
|
key,
|
|
@@ -17,8 +19,10 @@ export function getDefaultValue(item, references) {
|
|
|
17
19
|
}
|
|
18
20
|
if (item.type === 'file')
|
|
19
21
|
return undefined;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (item.type === 'string')
|
|
23
|
+
return '';
|
|
24
|
+
if (item.type === 'number')
|
|
25
|
+
return 0;
|
|
26
|
+
if (item.type === 'boolean')
|
|
27
|
+
return false;
|
|
24
28
|
}
|
|
@@ -11,7 +11,6 @@ interface BaseSchema {
|
|
|
11
11
|
export type PrimitiveRequestField = BaseRequestField & PrimitiveSchema;
|
|
12
12
|
interface PrimitiveSchema extends BaseSchema {
|
|
13
13
|
type: 'boolean' | 'string' | 'number';
|
|
14
|
-
defaultValue: string;
|
|
15
14
|
}
|
|
16
15
|
export interface ReferenceSchema extends BaseSchema {
|
|
17
16
|
type: 'ref';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/playground/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EACd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,UAAU;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEvE,UAAU,eAAgB,SAAQ,UAAU;IAC1C,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/playground/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EACd,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,UAAU;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAEvE,UAAU,eAAgB,SAAQ,UAAU;IAC1C,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,WAAY,SAAQ,UAAU;IACtC,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC;CAC/B;AAED,UAAU,UAAW,SAAQ,UAAU;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAa,SAAQ,UAAU;IACvC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAAC,CAAC;IAE5D;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACzC;AAED,UAAU,cAAe,SAAQ,UAAU;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,CAAC,CAAC;CACxD;AAED,UAAU,UAAW,SAAQ,UAAU;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GACrB,eAAe,GACf,WAAW,GACX,YAAY,GACZ,cAAc,GACd,UAAU,GACV,UAAU,CAAC;AAUf,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,aAAa,CAAC;IAEnB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD,wBAAsB,aAAa,CAAC,EAClC,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,GACP,EAAE,kBAAkB,oDA+CpB"}
|
package/dist/playground/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/playground/inputs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMxD,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AA6BhE,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IACD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,cAAc,CAAC,cAAc,CAAC,2CAqBjC;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/playground/inputs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMxD,KAAK,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AA6BhE,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IACD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,cAAc,CAAC,cAAc,CAAC,2CAqBjC;AA+ID,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB,kDAmGA;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,kDAgGA"}
|