docusaurus-theme-openapi-docs 0.0.0-beta.661 → 0.0.0-beta.663
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.
|
@@ -11,6 +11,7 @@ var __importDefault =
|
|
|
11
11
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const zlib_1 = __importDefault(require("zlib"));
|
|
14
15
|
const react_1 = __importDefault(require("react"));
|
|
15
16
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
17
|
const ExecutionEnvironment_1 = __importDefault(
|
|
@@ -38,7 +39,13 @@ function ApiItem(props) {
|
|
|
38
39
|
const MDXComponent = props.content;
|
|
39
40
|
const { frontMatter } = MDXComponent;
|
|
40
41
|
const { info_path: infoPath } = frontMatter;
|
|
41
|
-
|
|
42
|
+
let { api } = frontMatter;
|
|
43
|
+
// decompress and parse
|
|
44
|
+
if (api) {
|
|
45
|
+
api = JSON.parse(
|
|
46
|
+
zlib_1.default.inflateSync(Buffer.from(api, "base64")).toString()
|
|
47
|
+
);
|
|
48
|
+
}
|
|
42
49
|
const { siteConfig } = (0, useDocusaurusContext_1.default)();
|
|
43
50
|
const themeConfig = siteConfig.themeConfig;
|
|
44
51
|
const options = themeConfig.api;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-beta.
|
|
4
|
+
"version": "0.0.0-beta.663",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"clsx": "^1.1.1",
|
|
45
45
|
"copy-text-to-clipboard": "^3.1.0",
|
|
46
46
|
"crypto-js": "^4.1.1",
|
|
47
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-beta.
|
|
47
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-beta.663",
|
|
48
48
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
49
49
|
"file-saver": "^2.0.5",
|
|
50
50
|
"lodash": "^4.17.20",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "9d365f30300fca49108165dcee8d640e7753b951"
|
|
72
72
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
+
import zlib from "zlib";
|
|
9
|
+
|
|
8
10
|
import React from "react";
|
|
9
11
|
|
|
10
12
|
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
@@ -47,7 +49,14 @@ export default function ApiItem(props: Props): JSX.Element {
|
|
|
47
49
|
const MDXComponent = props.content;
|
|
48
50
|
const { frontMatter } = MDXComponent;
|
|
49
51
|
const { info_path: infoPath } = frontMatter as DocFrontMatter;
|
|
50
|
-
|
|
52
|
+
let { api } = frontMatter as ApiFrontMatter;
|
|
53
|
+
// decompress and parse
|
|
54
|
+
if (api) {
|
|
55
|
+
api = JSON.parse(
|
|
56
|
+
zlib.inflateSync(Buffer.from(api as any, "base64")).toString()
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
51
60
|
const { siteConfig } = useDocusaurusContext();
|
|
52
61
|
const themeConfig = siteConfig.themeConfig as ThemeConfig;
|
|
53
62
|
const options = themeConfig.api;
|