docusaurus-theme-openapi-docs 0.0.0-780 → 0.0.0-783
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.
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
export interface Props {
|
|
3
3
|
method: string;
|
|
4
4
|
path: string;
|
|
5
|
+
context?: "endpoint" | "callback";
|
|
5
6
|
}
|
|
6
|
-
declare function MethodEndpoint({ method, path }: Props): React.JSX.Element;
|
|
7
|
+
declare function MethodEndpoint({ method, path, context }: Props): React.JSX.Element;
|
|
7
8
|
export default MethodEndpoint;
|
|
@@ -34,12 +34,15 @@ function colorForMethod(method) {
|
|
|
34
34
|
return undefined;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function MethodEndpoint({ method, path }) {
|
|
37
|
+
function MethodEndpoint({ method, path, context }) {
|
|
38
38
|
let serverValue = (0, hooks_1.useTypedSelector)(
|
|
39
39
|
(state) => state.server.value
|
|
40
40
|
);
|
|
41
41
|
let serverUrlWithVariables = "";
|
|
42
42
|
const renderServerUrl = () => {
|
|
43
|
+
if (context === "callback") {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
43
46
|
if (serverValue && serverValue.variables) {
|
|
44
47
|
serverUrlWithVariables = serverValue.url.replace(/\/$/, "");
|
|
45
48
|
Object.keys(serverValue.variables).forEach((variable) => {
|
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-
|
|
4
|
+
"version": "0.0.0-783",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"clsx": "^1.1.1",
|
|
43
43
|
"copy-text-to-clipboard": "^3.1.0",
|
|
44
44
|
"crypto-js": "^4.1.1",
|
|
45
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-
|
|
45
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-783",
|
|
46
46
|
"docusaurus-plugin-sass": "^0.2.3",
|
|
47
47
|
"file-saver": "^2.0.5",
|
|
48
48
|
"lodash": "^4.17.20",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=14"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "fde0fbcb9f5e91b02506de828ad39cc295f68608"
|
|
73
73
|
}
|
|
@@ -35,13 +35,18 @@ function colorForMethod(method: string) {
|
|
|
35
35
|
export interface Props {
|
|
36
36
|
method: string;
|
|
37
37
|
path: string;
|
|
38
|
+
context?: "endpoint" | "callback";
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
function MethodEndpoint({ method, path }: Props) {
|
|
41
|
+
function MethodEndpoint({ method, path, context }: Props) {
|
|
41
42
|
let serverValue = useTypedSelector((state: any) => state.server.value);
|
|
42
43
|
let serverUrlWithVariables = "";
|
|
43
44
|
|
|
44
45
|
const renderServerUrl = () => {
|
|
46
|
+
if (context === "callback") {
|
|
47
|
+
return "";
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
if (serverValue && serverValue.variables) {
|
|
46
51
|
serverUrlWithVariables = serverValue.url.replace(/\/$/, "");
|
|
47
52
|
|