docusaurus-theme-openapi-docs 1.0.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/theme/ApiDemoPanel/Body/index.js +11 -9
- package/lib/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/lib/theme/ApiDemoPanel/CodeTabs/index.js +188 -0
- package/lib/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/lib/theme/ApiDemoPanel/Curl/index.js +41 -110
- package/lib/theme/ApiDemoPanel/LiveEditor/index.js +61 -0
- package/lib/theme/ApiDemoPanel/LiveEditor/styles.module.css +34 -0
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +9 -6
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +7 -2
- package/lib/theme/ApiDemoPanel/index.js +3 -7
- package/lib/theme/ApiItem/icons/bash-original.svg +1 -0
- package/lib/theme/ApiItem/icons/go-original-wordmark.svg +1 -0
- package/lib/theme/ApiItem/icons/javascript-original.svg +1 -0
- package/lib/theme/ApiItem/icons/linux-original.svg +1 -0
- package/lib/theme/ApiItem/icons/python-original.svg +1 -0
- package/lib/theme/ApiItem/index.js +2 -1
- package/lib/theme/ApiItem/styles.module.css +89 -0
- package/lib-next/theme/ApiDemoPanel/Body/index.js +11 -15
- package/lib-next/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/lib-next/theme/ApiDemoPanel/CodeTabs/index.js +214 -0
- package/lib-next/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +46 -135
- package/lib-next/theme/ApiDemoPanel/LiveEditor/index.js +49 -0
- package/lib-next/theme/ApiDemoPanel/LiveEditor/styles.module.css +34 -0
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +9 -6
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +6 -2
- package/lib-next/theme/ApiDemoPanel/index.js +2 -7
- package/lib-next/theme/ApiItem/icons/bash-original.svg +1 -0
- package/lib-next/theme/ApiItem/icons/go-original-wordmark.svg +1 -0
- package/lib-next/theme/ApiItem/icons/javascript-original.svg +1 -0
- package/lib-next/theme/ApiItem/icons/linux-original.svg +1 -0
- package/lib-next/theme/ApiItem/icons/python-original.svg +1 -0
- package/lib-next/theme/ApiItem/index.js +2 -1
- package/lib-next/theme/ApiItem/styles.module.css +89 -0
- package/package.json +7 -9
- package/src/theme/ApiDemoPanel/Body/index.tsx +9 -13
- package/src/theme/ApiDemoPanel/Body/json2xml.js +43 -0
- package/src/theme/ApiDemoPanel/CodeTabs/index.tsx +237 -0
- package/src/theme/ApiDemoPanel/CodeTabs/styles.module.css +11 -0
- package/src/theme/ApiDemoPanel/Curl/index.tsx +45 -124
- package/src/theme/ApiDemoPanel/LiveEditor/index.tsx +59 -0
- package/src/theme/ApiDemoPanel/LiveEditor/styles.module.css +34 -0
- package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +6 -4
- package/src/theme/ApiDemoPanel/SecuritySchemes/index.tsx +7 -2
- package/src/theme/ApiDemoPanel/index.tsx +8 -7
- package/src/theme/ApiItem/icons/bash-original.svg +1 -0
- package/src/theme/ApiItem/icons/go-original-wordmark.svg +1 -0
- package/src/theme/ApiItem/icons/javascript-original.svg +1 -0
- package/src/theme/ApiItem/icons/linux-original.svg +1 -0
- package/src/theme/ApiItem/icons/python-original.svg +1 -0
- package/src/theme/ApiItem/index.tsx +9 -5
- package/src/theme/ApiItem/styles.module.css +89 -0
- package/src/types.ts +112 -0
- package/lib/theme/ApiDemoPanel/VSCode/index.js +0 -252
- package/lib/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
- package/lib-next/theme/ApiDemoPanel/VSCode/index.js +0 -265
- package/lib-next/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
- package/src/theme/ApiDemoPanel/VSCode/index.tsx +0 -205
- package/src/theme/ApiDemoPanel/VSCode/styles.module.css +0 -19
|
@@ -5,32 +5,35 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { useState, useEffect } from "react";
|
|
9
9
|
|
|
10
10
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
11
|
import codegen from "@paloaltonetworks/postman-code-generators";
|
|
12
12
|
import sdk from "@paloaltonetworks/postman-collection";
|
|
13
|
+
import CodeBlock from "@theme/CodeBlock";
|
|
13
14
|
import clsx from "clsx";
|
|
14
|
-
import Highlight, { defaultProps } from "prism-react-renderer";
|
|
15
15
|
|
|
16
|
+
import CodeTabs from "../CodeTabs";
|
|
16
17
|
import { useTypedSelector } from "../hooks";
|
|
17
18
|
import buildPostmanRequest from "./../buildPostmanRequest";
|
|
18
|
-
import FloatingButton from "./../FloatingButton";
|
|
19
19
|
import styles from "./styles.module.css";
|
|
20
20
|
|
|
21
21
|
interface Language {
|
|
22
22
|
tabName: string;
|
|
23
23
|
highlight: string;
|
|
24
24
|
language: string;
|
|
25
|
+
codeLanguage?: string;
|
|
25
26
|
variant: string;
|
|
26
27
|
options: { [key: string]: boolean };
|
|
28
|
+
source?: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
const languageSet: Language[] = [
|
|
31
|
+
export const languageSet: Language[] = [
|
|
30
32
|
{
|
|
31
33
|
tabName: "cURL",
|
|
32
34
|
highlight: "bash",
|
|
33
35
|
language: "curl",
|
|
36
|
+
codeLanguage: "bash",
|
|
34
37
|
variant: "curl",
|
|
35
38
|
options: {
|
|
36
39
|
longFormat: false,
|
|
@@ -39,12 +42,12 @@ const languageSet: Language[] = [
|
|
|
39
42
|
},
|
|
40
43
|
},
|
|
41
44
|
{
|
|
42
|
-
tabName: "
|
|
43
|
-
highlight: "
|
|
44
|
-
language: "
|
|
45
|
-
|
|
45
|
+
tabName: "Python",
|
|
46
|
+
highlight: "python",
|
|
47
|
+
language: "python",
|
|
48
|
+
codeLanguage: "python",
|
|
49
|
+
variant: "requests",
|
|
46
50
|
options: {
|
|
47
|
-
ES6_enabled: true,
|
|
48
51
|
followRedirect: true,
|
|
49
52
|
trimRequestBody: true,
|
|
50
53
|
},
|
|
@@ -53,6 +56,7 @@ const languageSet: Language[] = [
|
|
|
53
56
|
tabName: "Go",
|
|
54
57
|
highlight: "go",
|
|
55
58
|
language: "go",
|
|
59
|
+
codeLanguage: "go",
|
|
56
60
|
variant: "native",
|
|
57
61
|
options: {
|
|
58
62
|
followRedirect: true,
|
|
@@ -60,79 +64,41 @@ const languageSet: Language[] = [
|
|
|
60
64
|
},
|
|
61
65
|
},
|
|
62
66
|
{
|
|
63
|
-
tabName: "
|
|
64
|
-
highlight: "
|
|
65
|
-
language: "
|
|
66
|
-
|
|
67
|
+
tabName: "Node",
|
|
68
|
+
highlight: "javascript",
|
|
69
|
+
language: "nodejs",
|
|
70
|
+
codeLanguage: "javascript",
|
|
71
|
+
variant: "axios",
|
|
67
72
|
options: {
|
|
73
|
+
ES6_enabled: true,
|
|
68
74
|
followRedirect: true,
|
|
69
75
|
trimRequestBody: true,
|
|
70
76
|
},
|
|
71
77
|
},
|
|
72
78
|
];
|
|
73
79
|
|
|
74
|
-
const languageTheme = {
|
|
75
|
-
plain: {
|
|
76
|
-
color: "var(--ifm-code-color)",
|
|
77
|
-
},
|
|
78
|
-
styles: [
|
|
79
|
-
{
|
|
80
|
-
types: ["inserted", "attr-name"],
|
|
81
|
-
style: {
|
|
82
|
-
color: "var(--openapi-code-green)",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
types: ["string", "url"],
|
|
87
|
-
style: {
|
|
88
|
-
color: "var(--openapi-code-green)",
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
types: ["builtin", "char", "constant", "function"],
|
|
93
|
-
style: {
|
|
94
|
-
color: "var(--openapi-code-blue)",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
types: ["punctuation", "operator"],
|
|
99
|
-
style: {
|
|
100
|
-
color: "var(--openapi-code-dim)",
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
types: ["class-name"],
|
|
105
|
-
style: {
|
|
106
|
-
color: "var(--openapi-code-orange)",
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
types: ["tag", "arrow", "keyword"],
|
|
111
|
-
style: {
|
|
112
|
-
color: "var(--openapi-code-purple)",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
types: ["boolean"],
|
|
117
|
-
style: {
|
|
118
|
-
color: "var(--openapi-code-red)",
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
};
|
|
123
|
-
|
|
124
80
|
interface Props {
|
|
125
81
|
postman: sdk.Request;
|
|
126
82
|
codeSamples: any; // TODO: Type this...
|
|
127
83
|
}
|
|
128
84
|
|
|
85
|
+
function CodeTab({ children, hidden, className, onClick }: any): JSX.Element {
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
role="tabpanel"
|
|
89
|
+
className={clsx(styles.tabItem, className)}
|
|
90
|
+
{...{ hidden }}
|
|
91
|
+
>
|
|
92
|
+
{children}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
129
97
|
function Curl({ postman, codeSamples }: Props) {
|
|
130
98
|
// TODO: match theme for vscode.
|
|
131
99
|
|
|
132
100
|
const { siteConfig } = useDocusaurusContext();
|
|
133
101
|
|
|
134
|
-
const [copyText, setCopyText] = useState("Copy");
|
|
135
|
-
|
|
136
102
|
const contentType = useTypedSelector((state) => state.contentType.value);
|
|
137
103
|
const accept = useTypedSelector((state) => state.accept.value);
|
|
138
104
|
const server = useTypedSelector((state) => state.server.value);
|
|
@@ -152,7 +118,12 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
152
118
|
...codeSamples,
|
|
153
119
|
];
|
|
154
120
|
|
|
155
|
-
const [
|
|
121
|
+
const defaultLang: Language[] = languageSet.filter(
|
|
122
|
+
(lang) =>
|
|
123
|
+
lang.codeLanguage === localStorage.getItem("docusaurus.tab.code-samples")
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const [language, setLanguage] = useState(defaultLang[0] ?? langs[0]);
|
|
156
127
|
|
|
157
128
|
const [codeText, setCodeText] = useState("");
|
|
158
129
|
|
|
@@ -201,76 +172,26 @@ function Curl({ postman, codeSamples }: Props) {
|
|
|
201
172
|
auth,
|
|
202
173
|
]);
|
|
203
174
|
|
|
204
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
205
|
-
|
|
206
|
-
const handleCurlCopy = () => {
|
|
207
|
-
setCopyText("Copied");
|
|
208
|
-
setTimeout(() => {
|
|
209
|
-
setCopyText("Copy");
|
|
210
|
-
}, 2000);
|
|
211
|
-
if (ref.current?.innerText) {
|
|
212
|
-
navigator.clipboard.writeText(ref.current.innerText);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
175
|
if (language === undefined) {
|
|
217
176
|
return null;
|
|
218
177
|
}
|
|
219
178
|
|
|
220
179
|
return (
|
|
221
180
|
<>
|
|
222
|
-
<
|
|
181
|
+
<CodeTabs groupId="code-samples" action={setLanguage}>
|
|
223
182
|
{langs.map((lang) => {
|
|
224
183
|
return (
|
|
225
|
-
<
|
|
184
|
+
<CodeTab
|
|
185
|
+
value={lang.language}
|
|
186
|
+
label={""}
|
|
226
187
|
key={lang.tabName || lang.label}
|
|
227
|
-
|
|
228
|
-
language === lang ? styles.selected : undefined,
|
|
229
|
-
language === lang ? "api-code-tab--active" : undefined,
|
|
230
|
-
"api-code-tab"
|
|
231
|
-
)}
|
|
232
|
-
onClick={() => setLanguage(lang)}
|
|
188
|
+
attributes={{ className: `code__tab--${lang.codeLanguage}` }}
|
|
233
189
|
>
|
|
234
|
-
{lang.
|
|
235
|
-
</
|
|
190
|
+
<CodeBlock language={lang.codeLanguage}>{codeText}</CodeBlock>
|
|
191
|
+
</CodeTab>
|
|
236
192
|
);
|
|
237
193
|
})}
|
|
238
|
-
</
|
|
239
|
-
|
|
240
|
-
<Highlight
|
|
241
|
-
{...defaultProps}
|
|
242
|
-
theme={languageTheme}
|
|
243
|
-
code={codeText}
|
|
244
|
-
language={language.highlight || language.lang}
|
|
245
|
-
>
|
|
246
|
-
{({ className, tokens, getLineProps, getTokenProps }) => (
|
|
247
|
-
<FloatingButton onClick={handleCurlCopy} label={copyText}>
|
|
248
|
-
<pre
|
|
249
|
-
className={className}
|
|
250
|
-
style={{
|
|
251
|
-
background: "var(--openapi-card-background-color)",
|
|
252
|
-
paddingRight: "60px",
|
|
253
|
-
borderRadius:
|
|
254
|
-
"2px 2px var(--openapi-card-border-radius) var(--openapi-card-border-radius)",
|
|
255
|
-
}}
|
|
256
|
-
>
|
|
257
|
-
<code ref={ref}>
|
|
258
|
-
{tokens.map((line, i) => (
|
|
259
|
-
<span {...getLineProps({ line, key: i })}>
|
|
260
|
-
{line.map((token, key) => {
|
|
261
|
-
if (token.types.includes("arrow")) {
|
|
262
|
-
token.types = ["arrow"];
|
|
263
|
-
}
|
|
264
|
-
return <span {...getTokenProps({ token, key })} />;
|
|
265
|
-
})}
|
|
266
|
-
{"\n"}
|
|
267
|
-
</span>
|
|
268
|
-
))}
|
|
269
|
-
</code>
|
|
270
|
-
</pre>
|
|
271
|
-
</FloatingButton>
|
|
272
|
-
)}
|
|
273
|
-
</Highlight>
|
|
194
|
+
</CodeTabs>
|
|
274
195
|
</>
|
|
275
196
|
);
|
|
276
197
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
11
|
+
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
12
|
+
import { LiveProvider, LiveEditor, withLive } from "react-live";
|
|
13
|
+
|
|
14
|
+
import { setStringRawBody } from "../Body/slice";
|
|
15
|
+
import styles from "./styles.module.css";
|
|
16
|
+
|
|
17
|
+
function Live({ onEdit }: any) {
|
|
18
|
+
const isBrowser = useIsBrowser();
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<LiveEditor
|
|
22
|
+
key={String(isBrowser)}
|
|
23
|
+
className={styles.playgroundEditor}
|
|
24
|
+
onChange={onEdit}
|
|
25
|
+
/>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const LiveComponent = withLive(Live);
|
|
31
|
+
|
|
32
|
+
function App({
|
|
33
|
+
children,
|
|
34
|
+
transformCode,
|
|
35
|
+
value,
|
|
36
|
+
language,
|
|
37
|
+
action,
|
|
38
|
+
...props
|
|
39
|
+
}: any): JSX.Element {
|
|
40
|
+
const prismTheme = usePrismTheme();
|
|
41
|
+
const [code, setCode] = React.useState(children);
|
|
42
|
+
action(setStringRawBody(code));
|
|
43
|
+
return (
|
|
44
|
+
<div className={styles.playgroundContainer}>
|
|
45
|
+
<LiveProvider
|
|
46
|
+
code={children.replace(/\n$/, "")}
|
|
47
|
+
transformCode={transformCode ?? ((code) => `${code};`)}
|
|
48
|
+
theme={prismTheme}
|
|
49
|
+
language={language}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<LiveComponent onEdit={setCode} />
|
|
53
|
+
</LiveProvider>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const LiveApp = withLive(App);
|
|
59
|
+
export default LiveApp;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.playgroundContainer {
|
|
2
|
+
margin-top: 1rem;
|
|
3
|
+
margin-bottom: var(--ifm-leading);
|
|
4
|
+
border-radius: var(--ifm-global-radius);
|
|
5
|
+
box-shadow: var(--ifm-global-shadow-lw);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.playgroundHeader {
|
|
10
|
+
letter-spacing: 0.08rem;
|
|
11
|
+
padding: 0.75rem;
|
|
12
|
+
text-transform: uppercase;
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
background: var(--ifm-color-emphasis-200);
|
|
15
|
+
color: var(--ifm-color-content);
|
|
16
|
+
font-size: var(--ifm-code-font-size);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.playgroundHeader:first-of-type {
|
|
20
|
+
background: var(--ifm-color-emphasis-600);
|
|
21
|
+
color: var(--ifm-color-content-inverse);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.playgroundEditor {
|
|
25
|
+
font: var(--ifm-code-font-size) / var(--ifm-pre-line-height)
|
|
26
|
+
var(--ifm-font-family-monospace) !important;
|
|
27
|
+
/* rtl:ignore */
|
|
28
|
+
direction: ltr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.playgroundPreview {
|
|
32
|
+
padding: 1rem;
|
|
33
|
+
background-color: var(--ifm-pre-background);
|
|
34
|
+
}
|
|
@@ -15,14 +15,16 @@ function colorForMethod(method: string) {
|
|
|
15
15
|
switch (method.toLowerCase()) {
|
|
16
16
|
case "get":
|
|
17
17
|
return "primary";
|
|
18
|
-
case "put":
|
|
19
|
-
return "warning";
|
|
20
|
-
case "patch":
|
|
21
|
-
return "warning";
|
|
22
18
|
case "post":
|
|
23
19
|
return "success";
|
|
24
20
|
case "delete":
|
|
25
21
|
return "danger";
|
|
22
|
+
case "put":
|
|
23
|
+
return "info";
|
|
24
|
+
case "patch":
|
|
25
|
+
return "warning";
|
|
26
|
+
case "head":
|
|
27
|
+
return "secondary";
|
|
26
28
|
default:
|
|
27
29
|
return undefined;
|
|
28
30
|
}
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import Link from "@docusaurus/Link";
|
|
11
|
+
|
|
10
12
|
import { useTypedSelector } from "../hooks";
|
|
11
13
|
|
|
12
|
-
function SecuritySchemes() {
|
|
14
|
+
function SecuritySchemes(props: any) {
|
|
13
15
|
const options = useTypedSelector((state) => state.auth.options);
|
|
14
16
|
const selected = useTypedSelector((state) => state.auth.selected);
|
|
17
|
+
const infoAuthPath = `/${props.infoPath}#authentication`;
|
|
15
18
|
|
|
16
19
|
if (selected === undefined) return null;
|
|
17
20
|
|
|
@@ -28,7 +31,9 @@ function SecuritySchemes() {
|
|
|
28
31
|
if (isApiKey || isBearer) {
|
|
29
32
|
return (
|
|
30
33
|
<React.Fragment key={selected}>
|
|
31
|
-
<b>
|
|
34
|
+
<b>
|
|
35
|
+
Authorization: <Link to={infoAuthPath}>{auth.key}</Link>
|
|
36
|
+
</b>
|
|
32
37
|
<pre
|
|
33
38
|
style={{
|
|
34
39
|
display: "flex",
|
|
@@ -27,7 +27,13 @@ import Server from "./Server";
|
|
|
27
27
|
import { createStoreWithState } from "./store";
|
|
28
28
|
import styles from "./styles.module.css";
|
|
29
29
|
|
|
30
|
-
function ApiDemoPanel({
|
|
30
|
+
function ApiDemoPanel({
|
|
31
|
+
item,
|
|
32
|
+
infoPath,
|
|
33
|
+
}: {
|
|
34
|
+
item: NonNullable<ApiItem>;
|
|
35
|
+
infoPath: string;
|
|
36
|
+
}) {
|
|
31
37
|
const { siteConfig } = useDocusaurusContext();
|
|
32
38
|
const themeConfig = siteConfig.themeConfig as ThemeConfig;
|
|
33
39
|
const options = themeConfig.api;
|
|
@@ -89,9 +95,7 @@ function ApiDemoPanel({ item }: { item: NonNullable<ApiItem> }) {
|
|
|
89
95
|
<Provider store={store2}>
|
|
90
96
|
<div className={styles.apiDemoPanelContainer}>
|
|
91
97
|
<MethodEndpoint method={method} path={path} />
|
|
92
|
-
|
|
93
|
-
<SecuritySchemes />
|
|
94
|
-
|
|
98
|
+
<SecuritySchemes infoPath={infoPath} />
|
|
95
99
|
<div className={styles.optionsPanel}>
|
|
96
100
|
<ParamOptions />
|
|
97
101
|
<Body
|
|
@@ -100,14 +104,11 @@ function ApiDemoPanel({ item }: { item: NonNullable<ApiItem> }) {
|
|
|
100
104
|
/>
|
|
101
105
|
<Accept />
|
|
102
106
|
</div>
|
|
103
|
-
|
|
104
107
|
<Server />
|
|
105
|
-
|
|
106
108
|
<Curl
|
|
107
109
|
postman={postman}
|
|
108
110
|
codeSamples={(item as any)["x-code-samples"] ?? []}
|
|
109
111
|
/>
|
|
110
|
-
|
|
111
112
|
<Response />
|
|
112
113
|
</div>
|
|
113
114
|
</Provider>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="none" d="M4.24 4.24h119.53v119.53H4.24z"/><path fill="#293138" d="M109.01 28.64L71.28 6.24c-2.25-1.33-4.77-2-7.28-2s-5.03.67-7.28 2.01l-37.74 22.4c-4.5 2.67-7.28 7.61-7.28 12.96v44.8c0 5.35 2.77 10.29 7.28 12.96l37.73 22.4c2.25 1.34 4.76 2 7.28 2 2.51 0 5.03-.67 7.28-2l37.74-22.4c4.5-2.67 7.28-7.62 7.28-12.96V41.6c0-5.34-2.77-10.29-7.28-12.96zM79.79 98.59l.06 3.22c0 .39-.25.83-.55.99l-1.91 1.1c-.3.15-.56-.03-.56-.42l-.03-3.17c-1.63.68-3.29.84-4.34.42-.2-.08-.29-.37-.21-.71l.69-2.91c.06-.23.18-.46.34-.6.06-.06.12-.1.18-.13.11-.06.22-.07.31-.03 1.14.38 2.59.2 3.99-.5 1.78-.9 2.97-2.72 2.95-4.52-.02-1.64-.9-2.31-3.05-2.33-2.74.01-5.3-.53-5.34-4.57-.03-3.32 1.69-6.78 4.43-8.96l-.03-3.25c0-.4.24-.84.55-1l1.85-1.18c.3-.15.56.04.56.43l.03 3.25c1.36-.54 2.54-.69 3.61-.44.23.06.34.38.24.75l-.72 2.88c-.06.22-.18.44-.33.58a.77.77 0 01-.19.14c-.1.05-.19.06-.28.05-.49-.11-1.65-.36-3.48.56-1.92.97-2.59 2.64-2.58 3.88.02 1.48.77 1.93 3.39 1.97 3.49.06 4.99 1.58 5.03 5.09.05 3.44-1.79 7.15-4.61 9.41zm26.34-60.5l-35.7 22.05c-4.45 2.6-7.73 5.52-7.74 10.89v43.99c0 3.21 1.3 5.29 3.29 5.9-.65.11-1.32.19-1.98.19-2.09 0-4.15-.57-5.96-1.64l-37.73-22.4c-3.69-2.19-5.98-6.28-5.98-10.67V41.6c0-4.39 2.29-8.48 5.98-10.67l37.74-22.4c1.81-1.07 3.87-1.64 5.96-1.64s4.15.57 5.96 1.64l37.74 22.4c3.11 1.85 5.21 5.04 5.8 8.63-1.27-2.67-4.09-3.39-7.38-1.47z"/><path fill="#4FA847" d="M99.12 90.73l-9.4 5.62c-.25.15-.43.31-.43.61v2.46c0 .3.2.43.45.28l9.54-5.8c.25-.15.29-.42.29-.72v-2.17c0-.3-.2-.42-.45-.28z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><g fill="#00acd7" fill-rule="evenodd"><path d="M11.156 54.829c-.243 0-.303-.122-.182-.303l1.273-1.637c.12-.182.424-.303.666-.303H34.55c.243 0 .303.182.182.364l-1.03 1.576c-.121.181-.424.363-.606.363zM2.004 60.404c-.242 0-.303-.12-.182-.303l1.273-1.636c.121-.182.424-.303.667-.303h27.636c.242 0 .364.182.303.364l-.485 1.454c-.06.243-.303.364-.545.364zM16.67 65.98c-.242 0-.302-.182-.181-.364l.848-1.515c.122-.182.364-.363.607-.363h12.12c.243 0 .364.181.364.424l-.12 1.454c0 .243-.243.425-.425.425zM79.58 53.738c-3.819.97-6.425 1.697-10.182 2.666-.91.243-.97.303-1.758-.606-.909-1.03-1.576-1.697-2.848-2.303-3.819-1.878-7.516-1.333-10.97.91-4.121 2.666-6.242 6.605-6.182 11.514.06 4.849 3.394 8.849 8.182 9.516 4.121.545 7.576-.91 10.303-4 .545-.667 1.03-1.394 1.636-2.243H56.064c-1.272 0-1.575-.788-1.151-1.818.788-1.879 2.242-5.03 3.09-6.606.183-.364.607-.97 1.516-.97h22.06c-.12 1.637-.12 3.273-.363 4.91-.667 4.363-2.303 8.363-4.97 11.878-4.364 5.758-10.06 9.333-17.273 10.303-5.939.788-11.454-.364-16.302-4-4.485-3.394-7.03-7.879-7.697-13.454-.788-6.606 1.151-12.546 5.151-17.758 4.303-5.636 10-9.212 16.97-10.485 5.697-1.03 11.151-.363 16.06 2.97 3.212 2.121 5.515 5.03 7.03 8.545.364.546.122.849-.606 1.03z"/><path d="M99.64 87.253c-5.515-.122-10.546-1.697-14.788-5.334-3.576-3.09-5.818-7.03-6.545-11.697-1.091-6.848.787-12.909 4.909-18.302 4.424-5.819 9.757-8.849 16.97-10.122 6.181-1.09 12-.484 17.272 3.091 4.788 3.273 7.757 7.697 8.545 13.515 1.03 8.182-1.333 14.849-6.97 20.546-4 4.06-8.909 6.606-14.545 7.757-1.636.303-3.273.364-4.848.546zm14.424-24.485c-.06-.788-.06-1.394-.182-2-1.09-6-6.606-9.394-12.363-8.06-5.637 1.272-9.273 4.848-10.606 10.545-1.091 4.727 1.212 9.515 5.575 11.454 3.334 1.455 6.667 1.273 9.879-.363 4.788-2.485 7.394-6.364 7.697-11.576z" fill-rule="nonzero"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill="#F0DB4F" d="M1.408 1.408h125.184v125.185H1.408z"/><path fill="#323330" d="M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"/></svg>
|