docusaurus-theme-openapi-docs 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/postman-code-generators.d.ts +9 -0
- package/lib/react-magic-dropzone.d.ts +9 -0
- package/lib/theme/ApiDemoPanel/Curl/index.js +0 -1
- package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +0 -1
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +9 -6
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +27 -4
- package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +5 -2
- package/lib/theme/ApiDemoPanel/index.js +7 -13
- package/lib/theme/ApiItem/index.js +4 -3
- package/lib/theme/ApiItem/styles.module.css +6 -2
- package/lib/theme/{Tabs → ApiTabs}/index.js +3 -3
- package/lib/theme/{Tabs → ApiTabs}/styles.module.css +0 -0
- package/lib-next/postman-code-generators.d.ts +9 -0
- package/lib-next/react-magic-dropzone.d.ts +9 -0
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +2 -4
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +1 -2
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +9 -6
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +31 -4
- package/lib-next/theme/ApiDemoPanel/buildPostmanRequest.js +5 -2
- package/lib-next/theme/ApiDemoPanel/index.js +8 -15
- package/lib-next/theme/ApiItem/index.js +4 -13
- package/lib-next/theme/ApiItem/styles.module.css +6 -2
- package/{src/theme/Tabs → lib-next/theme/ApiTabs}/index.js +3 -3
- package/lib-next/theme/{Tabs → ApiTabs}/styles.module.css +0 -0
- package/package.json +15 -9
- package/src/postman-code-generators.d.ts +9 -0
- package/src/react-magic-dropzone.d.ts +9 -0
- package/src/theme/ApiDemoPanel/Curl/index.tsx +0 -2
- package/src/theme/ApiDemoPanel/FormFileUpload/index.tsx +0 -1
- package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +6 -4
- package/src/theme/ApiDemoPanel/SecuritySchemes/index.tsx +32 -4
- package/src/theme/ApiDemoPanel/buildPostmanRequest.ts +5 -3
- package/src/theme/ApiDemoPanel/index.tsx +17 -17
- package/src/theme/ApiItem/index.tsx +11 -17
- package/src/theme/ApiItem/styles.module.css +6 -2
- package/{lib-next/theme/Tabs → src/theme/ApiTabs}/index.js +3 -3
- package/src/theme/{Tabs → ApiTabs}/styles.module.css +0 -0
- package/src/types.ts +112 -0
- package/lib/theme/ApiDemoPanel/Authorization/index.js +0 -174
- package/lib/theme/ApiDemoPanel/Execute/index.js +0 -85
- package/lib/theme/ApiDemoPanel/Execute/makeRequest.js +0 -202
- package/lib-next/theme/ApiDemoPanel/Authorization/index.js +0 -203
- package/lib-next/theme/ApiDemoPanel/Execute/index.js +0 -74
- package/lib-next/theme/ApiDemoPanel/Execute/makeRequest.js +0 -183
- package/src/theme/ApiDemoPanel/Authorization/index.tsx +0 -211
- package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -88
- package/src/theme/ApiDemoPanel/Execute/makeRequest.ts +0 -184
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"openapi",
|
|
8
|
+
"documentation",
|
|
9
|
+
"docusaurus",
|
|
10
|
+
"websites",
|
|
11
|
+
"theme"
|
|
12
|
+
],
|
|
6
13
|
"publishConfig": {
|
|
7
14
|
"access": "public"
|
|
8
15
|
},
|
|
9
16
|
"repository": {
|
|
10
17
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/PaloAltoNetworks/docusaurus-openapi.git",
|
|
18
|
+
"url": "https://github.com/PaloAltoNetworks/docusaurus-openapi-docs.git",
|
|
12
19
|
"directory": "packages/docusaurus-theme-openapi-docs"
|
|
13
20
|
},
|
|
14
21
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/PaloAltoNetworks/docusaurus-openapi/issues"
|
|
22
|
+
"url": "https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues"
|
|
16
23
|
},
|
|
17
24
|
"types": "src/theme-openapi.d.ts",
|
|
18
25
|
"main": "lib/index.js",
|
|
@@ -24,19 +31,18 @@
|
|
|
24
31
|
"format:lib-next": "prettier --config ../../.prettierrc.json --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
|
|
25
32
|
},
|
|
26
33
|
"devDependencies": {
|
|
27
|
-
"@docusaurus/module-type-aliases": "
|
|
28
|
-
"@docusaurus/types": "
|
|
34
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.21",
|
|
35
|
+
"@docusaurus/types": "2.0.0-beta.21",
|
|
29
36
|
"@types/concurrently": "^6.3.0",
|
|
30
37
|
"@types/crypto-js": "^4.1.0",
|
|
31
38
|
"@types/fs-extra": "^9.0.13",
|
|
32
39
|
"@types/lodash": "^4.14.176",
|
|
33
40
|
"@types/mdx-js__react": "^1.5.4",
|
|
34
|
-
"@types/postman-collection": "^3.5.7",
|
|
35
41
|
"@types/rtlcss": "^3.1.1",
|
|
36
42
|
"concurrently": "^5.2.0"
|
|
37
43
|
},
|
|
38
44
|
"dependencies": {
|
|
39
|
-
"@docusaurus/theme-common": "
|
|
45
|
+
"@docusaurus/theme-common": "2.0.0-beta.21",
|
|
40
46
|
"@mdx-js/react": "^1.6.21",
|
|
41
47
|
"@monaco-editor/react": "^4.3.1",
|
|
42
48
|
"@paloaltonetworks/postman-code-generators": "1.1.5-hotfix.5",
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"buffer": "^6.0.3",
|
|
46
52
|
"clsx": "^1.1.1",
|
|
47
53
|
"crypto-js": "^4.1.1",
|
|
48
|
-
"docusaurus-plugin-openapi-docs": "1.0.
|
|
54
|
+
"docusaurus-plugin-openapi-docs": "^1.0.3",
|
|
49
55
|
"immer": "^9.0.7",
|
|
50
56
|
"lodash": "^4.17.20",
|
|
51
57
|
"monaco-editor": "^0.31.1",
|
|
@@ -64,5 +70,5 @@
|
|
|
64
70
|
"engines": {
|
|
65
71
|
"node": ">=14"
|
|
66
72
|
},
|
|
67
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "618a438ec42148f525fb92cb11d291ce50d2ad06"
|
|
68
74
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
// TODO: Remove this when https://github.com/facebook/docusaurus/issues/6087 is resolved.
|
|
9
|
+
declare module "@paloaltonetworks/postman-code-generators";
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
// TODO: Remove this when https://github.com/facebook/docusaurus/issues/6087 is resolved.
|
|
9
|
+
declare module "react-magic-dropzone";
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
import React, { useRef, useState, useEffect } from "react";
|
|
9
9
|
|
|
10
10
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
|
-
// @ts-ignore
|
|
12
11
|
import codegen from "@paloaltonetworks/postman-code-generators";
|
|
13
|
-
// @ts-ignore
|
|
14
12
|
import sdk from "@paloaltonetworks/postman-collection";
|
|
15
13
|
import clsx from "clsx";
|
|
16
14
|
import Highlight, { defaultProps } from "prism-react-renderer";
|
|
@@ -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
|
|
|
@@ -20,10 +23,17 @@ function SecuritySchemes() {
|
|
|
20
23
|
return (
|
|
21
24
|
<div style={{ marginBottom: "var(--ifm-table-cell-padding)" }}>
|
|
22
25
|
{selectedAuth.map((auth) => {
|
|
23
|
-
|
|
26
|
+
const isApiKey = auth.type === "apiKey";
|
|
27
|
+
const isBearer = auth.type === "http" && auth.key === "Bearer";
|
|
28
|
+
const isClientCredentials =
|
|
29
|
+
auth.type === "oauth2" && auth.key === "ClientCredentials";
|
|
30
|
+
|
|
31
|
+
if (isApiKey || isBearer) {
|
|
24
32
|
return (
|
|
25
|
-
<React.Fragment key={selected
|
|
26
|
-
<b>
|
|
33
|
+
<React.Fragment key={selected}>
|
|
34
|
+
<b>
|
|
35
|
+
Authorization: <Link to={infoAuthPath}>{auth.key}</Link>
|
|
36
|
+
</b>
|
|
27
37
|
<pre
|
|
28
38
|
style={{
|
|
29
39
|
display: "flex",
|
|
@@ -40,6 +50,24 @@ function SecuritySchemes() {
|
|
|
40
50
|
);
|
|
41
51
|
}
|
|
42
52
|
|
|
53
|
+
if (isClientCredentials) {
|
|
54
|
+
return (
|
|
55
|
+
<React.Fragment key={selected}>
|
|
56
|
+
<b>Authorization: {auth.key}</b>
|
|
57
|
+
<pre
|
|
58
|
+
style={{
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column",
|
|
61
|
+
background: "var(--openapi-card-background-color)",
|
|
62
|
+
borderRadius: "var(--openapi-card-border-radius)",
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<span>type: {auth.type}</span>
|
|
66
|
+
</pre>
|
|
67
|
+
</React.Fragment>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
43
71
|
return null;
|
|
44
72
|
})}
|
|
45
73
|
</div>
|
|
@@ -9,9 +9,7 @@ import sdk from "@paloaltonetworks/postman-collection";
|
|
|
9
9
|
import {
|
|
10
10
|
ParameterObject,
|
|
11
11
|
ServerObject,
|
|
12
|
-
// @ts-ignore
|
|
13
12
|
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
14
|
-
// @ts-ignore
|
|
15
13
|
import cloneDeep from "lodash/cloneDeep";
|
|
16
14
|
|
|
17
15
|
import { AuthState, Scheme } from "./Authorization/slice";
|
|
@@ -250,6 +248,10 @@ function buildPostmanRequest(
|
|
|
250
248
|
if (a.type === "http" && a.scheme === "bearer") {
|
|
251
249
|
const { token } = auth.data[a.key];
|
|
252
250
|
if (token === undefined) {
|
|
251
|
+
otherHeaders.push({
|
|
252
|
+
key: "Authorization",
|
|
253
|
+
value: "Bearer <TOKEN>",
|
|
254
|
+
});
|
|
253
255
|
continue;
|
|
254
256
|
}
|
|
255
257
|
otherHeaders.push({
|
|
@@ -278,7 +280,7 @@ function buildPostmanRequest(
|
|
|
278
280
|
if (apikey === undefined) {
|
|
279
281
|
otherHeaders.push({
|
|
280
282
|
key: a.name,
|
|
281
|
-
value: "API_KEY_VALUE",
|
|
283
|
+
value: "<API_KEY_VALUE>",
|
|
282
284
|
});
|
|
283
285
|
continue;
|
|
284
286
|
}
|
|
@@ -8,12 +8,9 @@
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
10
|
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
// @ts-ignore
|
|
13
11
|
import sdk from "@paloaltonetworks/postman-collection";
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
import { Metadata } from "@theme/ApiItem";
|
|
16
12
|
import { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
13
|
+
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
17
14
|
import { Provider } from "react-redux";
|
|
18
15
|
|
|
19
16
|
import { ThemeConfig } from "../../types";
|
|
@@ -30,7 +27,13 @@ import Server from "./Server";
|
|
|
30
27
|
import { createStoreWithState } from "./store";
|
|
31
28
|
import styles from "./styles.module.css";
|
|
32
29
|
|
|
33
|
-
function ApiDemoPanel({
|
|
30
|
+
function ApiDemoPanel({
|
|
31
|
+
item,
|
|
32
|
+
infoPath,
|
|
33
|
+
}: {
|
|
34
|
+
item: NonNullable<ApiItem>;
|
|
35
|
+
infoPath: string;
|
|
36
|
+
}) {
|
|
34
37
|
const { siteConfig } = useDocusaurusContext();
|
|
35
38
|
const themeConfig = siteConfig.themeConfig as ThemeConfig;
|
|
36
39
|
const options = themeConfig.api;
|
|
@@ -39,8 +42,7 @@ function ApiDemoPanel({ item }: { item: NonNullable<Metadata["api"]> }) {
|
|
|
39
42
|
const acceptArray = Array.from(
|
|
40
43
|
new Set(
|
|
41
44
|
Object.values(item.responses ?? {})
|
|
42
|
-
|
|
43
|
-
.map((response) => Object.keys(response.content ?? {}))
|
|
45
|
+
.map((response: any) => Object.keys(response.content ?? {}))
|
|
44
46
|
.flat()
|
|
45
47
|
)
|
|
46
48
|
);
|
|
@@ -58,10 +60,13 @@ function ApiDemoPanel({ item }: { item: NonNullable<Metadata["api"]> }) {
|
|
|
58
60
|
cookie: [] as ParameterObject[],
|
|
59
61
|
};
|
|
60
62
|
|
|
61
|
-
item.parameters?.forEach(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
item.parameters?.forEach(
|
|
64
|
+
(param: { in: "path" | "query" | "header" | "cookie" }) => {
|
|
65
|
+
const paramType = param.in;
|
|
66
|
+
const paramsArray: ParameterObject[] = params[paramType];
|
|
67
|
+
paramsArray.push(param as ParameterObject);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
65
70
|
|
|
66
71
|
const auth = createAuth({
|
|
67
72
|
security: item.security,
|
|
@@ -90,9 +95,7 @@ function ApiDemoPanel({ item }: { item: NonNullable<Metadata["api"]> }) {
|
|
|
90
95
|
<Provider store={store2}>
|
|
91
96
|
<div className={styles.apiDemoPanelContainer}>
|
|
92
97
|
<MethodEndpoint method={method} path={path} />
|
|
93
|
-
|
|
94
|
-
<SecuritySchemes />
|
|
95
|
-
|
|
98
|
+
<SecuritySchemes infoPath={infoPath} />
|
|
96
99
|
<div className={styles.optionsPanel}>
|
|
97
100
|
<ParamOptions />
|
|
98
101
|
<Body
|
|
@@ -101,14 +104,11 @@ function ApiDemoPanel({ item }: { item: NonNullable<Metadata["api"]> }) {
|
|
|
101
104
|
/>
|
|
102
105
|
<Accept />
|
|
103
106
|
</div>
|
|
104
|
-
|
|
105
107
|
<Server />
|
|
106
|
-
|
|
107
108
|
<Curl
|
|
108
109
|
postman={postman}
|
|
109
110
|
codeSamples={(item as any)["x-code-samples"] ?? []}
|
|
110
111
|
/>
|
|
111
|
-
|
|
112
112
|
<Response />
|
|
113
113
|
</div>
|
|
114
114
|
</Provider>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
useWindowSize,
|
|
16
16
|
} from "@docusaurus/theme-common";
|
|
17
17
|
import DocBreadcrumbs from "@theme/DocBreadcrumbs";
|
|
18
|
-
import type { Props
|
|
18
|
+
import type { Props } from "@theme/DocItem";
|
|
19
19
|
import DocItemFooter from "@theme/DocItemFooter";
|
|
20
20
|
import DocPaginator from "@theme/DocPaginator";
|
|
21
21
|
import DocVersionBadge from "@theme/DocVersionBadge";
|
|
@@ -27,14 +27,17 @@ import TOCCollapsible from "@theme/TOCCollapsible";
|
|
|
27
27
|
import clsx from "clsx";
|
|
28
28
|
import type { ApiItem as ApiItemType } from "docusaurus-plugin-openapi-docs/lib/types";
|
|
29
29
|
|
|
30
|
+
import { DocFrontMatter } from "../../types";
|
|
30
31
|
import styles from "./styles.module.css";
|
|
31
32
|
|
|
32
|
-
let ApiDemoPanel = (_: { item: any }) =>
|
|
33
|
+
let ApiDemoPanel = (_: { item: any; infoPath: any }) => (
|
|
34
|
+
<div style={{ marginTop: "3.5em" }} />
|
|
35
|
+
);
|
|
33
36
|
if (ExecutionEnvironment.canUseDOM) {
|
|
34
37
|
ApiDemoPanel = require("@theme/ApiDemoPanel").default;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
interface ApiFrontMatter extends
|
|
40
|
+
interface ApiFrontMatter extends DocFrontMatter {
|
|
38
41
|
readonly api?: ApiItemType;
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -52,11 +55,12 @@ function DocItemContent(props: Props): JSX.Element {
|
|
|
52
55
|
const { content: DocContent } = props;
|
|
53
56
|
const { metadata, frontMatter } = DocContent;
|
|
54
57
|
const {
|
|
58
|
+
info_path: infoPath,
|
|
55
59
|
hide_title: hideTitle,
|
|
56
60
|
hide_table_of_contents: hideTableOfContents,
|
|
57
61
|
toc_min_heading_level: tocMinHeadingLevel,
|
|
58
62
|
toc_max_heading_level: tocMaxHeadingLevel,
|
|
59
|
-
} = frontMatter;
|
|
63
|
+
} = frontMatter as DocFrontMatter;
|
|
60
64
|
const { title } = metadata;
|
|
61
65
|
|
|
62
66
|
const { api } = frontMatter as ApiFrontMatter;
|
|
@@ -121,27 +125,17 @@ function DocItemContent(props: Props): JSX.Element {
|
|
|
121
125
|
</div>
|
|
122
126
|
{api && (
|
|
123
127
|
<div className="col col--5">
|
|
124
|
-
<ApiDemoPanel item={api} />
|
|
128
|
+
<ApiDemoPanel item={api} infoPath={infoPath} />
|
|
125
129
|
</div>
|
|
126
130
|
)}
|
|
127
131
|
</div>
|
|
128
132
|
</MDXContent>
|
|
129
133
|
</div>
|
|
130
|
-
<div
|
|
131
|
-
className={clsx(
|
|
132
|
-
"col",
|
|
133
|
-
api ? "col--7" : !canRenderTOC ? "col--9" : "col--12"
|
|
134
|
-
)}
|
|
135
|
-
>
|
|
134
|
+
<div className={clsx("col", api ? "col--7" : "col--12")}>
|
|
136
135
|
<DocItemFooter {...props} />
|
|
137
136
|
</div>
|
|
138
137
|
</article>
|
|
139
|
-
<div
|
|
140
|
-
className={clsx(
|
|
141
|
-
"col",
|
|
142
|
-
api ? "col--7" : !canRenderTOC ? "col--9" : "col--12"
|
|
143
|
-
)}
|
|
144
|
-
>
|
|
138
|
+
<div className={clsx("col", api ? "col--7" : "col--12")}>
|
|
145
139
|
<DocPaginator previous={metadata.previous} next={metadata.next} />
|
|
146
140
|
</div>
|
|
147
141
|
</div>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--openapi-required: var(--ifm-color-danger);
|
|
3
|
+
--openapi-code-blue: var(--ifm-color-info);
|
|
4
|
+
--openapi-code-red: var(--ifm-color-danger);
|
|
5
|
+
--openapi-code-orange: var(--ifm-color-warning);
|
|
6
|
+
--openapi-code-green: var(--ifm-color-success);
|
|
3
7
|
}
|
|
4
8
|
|
|
5
9
|
.apiItemContainer article > *:first-child,
|
|
@@ -75,9 +79,9 @@
|
|
|
75
79
|
font-size: 14px;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
:global(.theme-api-markdown h2) {
|
|
82
|
+
/* :global(.theme-api-markdown h2) {
|
|
79
83
|
font-size: 2rem;
|
|
80
|
-
}
|
|
84
|
+
} */
|
|
81
85
|
|
|
82
86
|
:global(.schemaItem) {
|
|
83
87
|
list-style: none;
|
|
@@ -29,7 +29,7 @@ function isTabItem(comp) {
|
|
|
29
29
|
return typeof comp.props.value !== "undefined";
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function ApiTabsComponent(props) {
|
|
33
33
|
const {
|
|
34
34
|
lazy,
|
|
35
35
|
block,
|
|
@@ -246,10 +246,10 @@ function ResponseCodeTabs(props) {
|
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
export default function
|
|
249
|
+
export default function ApiTabs(props) {
|
|
250
250
|
const isBrowser = useIsBrowser();
|
|
251
251
|
return (
|
|
252
|
-
<
|
|
252
|
+
<ApiTabsComponent // Remount tabs after hydration
|
|
253
253
|
// Temporary fix for https://github.com/facebook/docusaurus/issues/5653
|
|
254
254
|
key={String(isBrowser)}
|
|
255
255
|
{...props}
|
|
File without changes
|
package/src/types.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
+
import type { FrontMatterTag } from "@docusaurus/utils";
|
|
8
9
|
import type { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
|
|
9
10
|
|
|
10
11
|
export interface ThemeConfig {
|
|
@@ -68,3 +69,114 @@ export interface ExternalDocumentationObject {
|
|
|
68
69
|
description?: string;
|
|
69
70
|
url: string;
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
export type FileChange = {
|
|
74
|
+
author?: string;
|
|
75
|
+
/** Date can be any
|
|
76
|
+
* [parsable date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
|
|
77
|
+
*/
|
|
78
|
+
date?: Date | string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type DocFrontMatter = {
|
|
82
|
+
/**
|
|
83
|
+
* The last part of the doc ID (will be refactored in the future to be the
|
|
84
|
+
* full ID instead)
|
|
85
|
+
* @see {@link DocMetadata.id}
|
|
86
|
+
*/
|
|
87
|
+
id?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Will override the default title collected from h1 heading.
|
|
90
|
+
* @see {@link DocMetadata.title}
|
|
91
|
+
*/
|
|
92
|
+
title?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Front matter tags, unnormalized.
|
|
95
|
+
* @see {@link DocMetadata.tags}
|
|
96
|
+
*/
|
|
97
|
+
tags?: FrontMatterTag[];
|
|
98
|
+
/**
|
|
99
|
+
* If there isn't a Markdown h1 heading (which, if there is, we don't
|
|
100
|
+
* remove), this front matter will cause the front matter title to not be
|
|
101
|
+
* displayed in the doc page.
|
|
102
|
+
*/
|
|
103
|
+
hide_title?: boolean;
|
|
104
|
+
/** Hide the TOC on the right. */
|
|
105
|
+
hide_table_of_contents?: boolean;
|
|
106
|
+
/** Used in the head meta. */
|
|
107
|
+
keywords?: string[];
|
|
108
|
+
/** Used in the head meta. Should use `assets.image` in priority. */
|
|
109
|
+
image?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Will override the default excerpt.
|
|
112
|
+
* @see {@link DocMetadata.description}
|
|
113
|
+
*/
|
|
114
|
+
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Custom slug appended after /<baseUrl>/<routeBasePath>/<versionPath>
|
|
117
|
+
* @see {@link DocMetadata.slug}
|
|
118
|
+
*/
|
|
119
|
+
slug?: string;
|
|
120
|
+
/** Customizes the sidebar label for this doc. Will default to its title. */
|
|
121
|
+
sidebar_label?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Controls the position of a doc inside the generated sidebar slice when
|
|
124
|
+
* using autogenerated sidebar items.
|
|
125
|
+
*
|
|
126
|
+
* @see https://docusaurus.io/docs/sidebar#autogenerated-sidebar-metadata
|
|
127
|
+
*/
|
|
128
|
+
sidebar_position?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Gives the corresponding sidebar label a special class name when using
|
|
131
|
+
* autogenerated sidebars.
|
|
132
|
+
*/
|
|
133
|
+
sidebar_class_name?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Will be propagated to the final sidebars data structure. Useful if you
|
|
136
|
+
* have swizzled sidebar-related code or simply querying doc data through
|
|
137
|
+
* sidebars.
|
|
138
|
+
*/
|
|
139
|
+
sidebar_custom_props?: { [key: string]: unknown };
|
|
140
|
+
/**
|
|
141
|
+
* Changes the sidebar association of the current doc. Use `null` to make
|
|
142
|
+
* the current doc not associated to any sidebar.
|
|
143
|
+
*/
|
|
144
|
+
displayed_sidebar?: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Customizes the pagination label for this doc. Will default to the sidebar
|
|
147
|
+
* label.
|
|
148
|
+
*/
|
|
149
|
+
pagination_label?: string;
|
|
150
|
+
/** Overrides the default URL computed for this doc. */
|
|
151
|
+
custom_edit_url?: string | null;
|
|
152
|
+
/**
|
|
153
|
+
* Whether number prefix parsing is disabled on this doc.
|
|
154
|
+
* @see https://docusaurus.io/docs/sidebar#using-number-prefixes
|
|
155
|
+
*/
|
|
156
|
+
parse_number_prefixes?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Minimum TOC heading level. Must be between 2 and 6 and lower or equal to
|
|
159
|
+
* the max value.
|
|
160
|
+
*/
|
|
161
|
+
toc_min_heading_level?: number;
|
|
162
|
+
/** Maximum TOC heading level. Must be between 2 and 6. */
|
|
163
|
+
toc_max_heading_level?: number;
|
|
164
|
+
/**
|
|
165
|
+
* The ID of the documentation you want the "Next" pagination to link to.
|
|
166
|
+
* Use `null` to disable showing "Next" for this page.
|
|
167
|
+
* @see {@link DocMetadata.next}
|
|
168
|
+
*/
|
|
169
|
+
pagination_next?: string | null;
|
|
170
|
+
/**
|
|
171
|
+
* The ID of the documentation you want the "Previous" pagination to link
|
|
172
|
+
* to. Use `null` to disable showing "Previous" for this page.
|
|
173
|
+
* @see {@link DocMetadata.prev}
|
|
174
|
+
*/
|
|
175
|
+
pagination_prev?: string | null;
|
|
176
|
+
/** Should this doc be excluded from production builds? */
|
|
177
|
+
draft?: boolean;
|
|
178
|
+
/** Allows overriding the last updated author and/or date. */
|
|
179
|
+
last_update?: FileChange;
|
|
180
|
+
/** Provides OpenAPI Docs with a reference path to their respective Info Doc */
|
|
181
|
+
info_path?: string;
|
|
182
|
+
};
|