docusaurus-theme-openapi-docs 4.7.0 → 4.7.1
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/ApiExplorer/Authorization/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Body/FormBodyItem/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/Body/FormBodyItem/index.js +1 -1
- package/lib/theme/ApiExplorer/Body/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/Body/index.js +2 -2
- package/lib/theme/ApiExplorer/Body/resolveSchemaWithSelections.d.ts +1 -1
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/Request/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/Response/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +2 -2
- package/lib/theme/ApiExplorer/Server/slice.d.ts +1 -1
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +1 -1
- package/lib/theme/ApiExplorer/index.d.ts +1 -1
- package/lib/theme/ParamsDetails/index.js +2 -2
- package/lib/theme/RequestSchema/index.d.ts +1 -1
- package/lib/theme/RequestSchema/index.js +2 -2
- package/lib/theme/ResponseSchema/index.d.ts +1 -1
- package/lib/theme/Schema/index.d.ts +1 -1
- package/lib/theme/StatusCodes/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/theme/ApiExplorer/Authorization/slice.ts +1 -1
- package/src/theme/ApiExplorer/Body/FileArrayFormBodyItem/index.tsx +2 -0
- package/src/theme/ApiExplorer/Body/FormBodyItem/index.tsx +4 -2
- package/src/theme/ApiExplorer/Body/index.tsx +3 -4
- package/src/theme/ApiExplorer/Body/resolveSchemaWithSelections.ts +1 -1
- package/src/theme/ApiExplorer/FormItem/index.tsx +0 -1
- package/src/theme/ApiExplorer/ParamOptions/slice.ts +1 -1
- package/src/theme/ApiExplorer/Request/index.tsx +2 -2
- package/src/theme/ApiExplorer/Response/index.tsx +2 -3
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +2 -3
- package/src/theme/ApiExplorer/Server/slice.ts +1 -1
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +1 -1
- package/src/theme/ApiExplorer/index.tsx +1 -1
- package/src/theme/ApiItem/index.tsx +1 -1
- package/src/theme/ParamsDetails/index.tsx +2 -3
- package/src/theme/RequestSchema/index.tsx +3 -4
- package/src/theme/ResponseSchema/index.tsx +1 -1
- package/src/theme/Schema/index.tsx +2 -2
- package/src/theme/StatusCodes/index.tsx +1 -1
- package/src/types.d.ts +8 -52
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
-
import { SecurityRequirementObject, SecuritySchemeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
2
|
+
import type { SecurityRequirementObject, SecuritySchemeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
import { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
|
|
4
4
|
export declare function createAuth({ security, securitySchemes, options: opts, }: {
|
|
5
5
|
security?: SecurityRequirementObject[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
2
|
+
import type { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
interface FormBodyItemProps {
|
|
4
4
|
schemaObject: SchemaObject;
|
|
5
5
|
id: string;
|
|
@@ -22,10 +22,10 @@ const FormTextInput_1 = __importDefault(
|
|
|
22
22
|
);
|
|
23
23
|
const LiveEditor_1 = __importDefault(require("@theme/ApiExplorer/LiveEditor"));
|
|
24
24
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
25
|
-
const slice_1 = require("../slice");
|
|
26
25
|
const FileArrayFormBodyItem_1 = __importDefault(
|
|
27
26
|
require("../FileArrayFormBodyItem")
|
|
28
27
|
);
|
|
28
|
+
const slice_1 = require("../slice");
|
|
29
29
|
function FormBodyItem({ schemaObject, id, schema }) {
|
|
30
30
|
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
31
31
|
if (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { RequestBodyObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
2
|
+
import type { RequestBodyObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
export interface Props {
|
|
4
4
|
jsonRequestBodyExample: string;
|
|
5
5
|
requestBodyMetadata?: RequestBodyObject;
|
|
@@ -80,11 +80,11 @@ const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
|
80
80
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
81
81
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
82
82
|
const translationIds_1 = require("@theme/translationIds");
|
|
83
|
-
const createSchemaExample_1 = require("docusaurus-plugin-openapi-docs/
|
|
83
|
+
const createSchemaExample_1 = require("docusaurus-plugin-openapi-docs/lib/openapi/createSchemaExample");
|
|
84
84
|
const xml_formatter_1 = __importDefault(require("xml-formatter"));
|
|
85
|
-
const slice_1 = require("./slice");
|
|
86
85
|
const FormBodyItem_1 = __importDefault(require("./FormBodyItem"));
|
|
87
86
|
const resolveSchemaWithSelections_1 = require("./resolveSchemaWithSelections");
|
|
87
|
+
const slice_1 = require("./slice");
|
|
88
88
|
function BodyWrap({
|
|
89
89
|
requestBodyMetadata,
|
|
90
90
|
jsonRequestBodyExample,
|
|
@@ -12,10 +12,10 @@ var __importDefault =
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
|
-
const Translate_1 = require("@docusaurus/Translate");
|
|
16
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
17
15
|
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
16
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
18
17
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
18
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
19
19
|
function SecuritySchemes(props) {
|
|
20
20
|
const options = (0, hooks_1.useTypedSelector)((state) => state.auth.options);
|
|
21
21
|
const selected = (0, hooks_1.useTypedSelector)(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
-
import { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
2
|
+
import type { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
export interface State {
|
|
4
4
|
value?: ServerObject;
|
|
5
5
|
options: ServerObject[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthState } from "@theme/ApiExplorer/Authorization/slice";
|
|
2
2
|
import { Body } from "@theme/ApiExplorer/Body/slice";
|
|
3
|
-
import { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
|
+
import type { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
4
4
|
import * as sdk from "postman-collection";
|
|
5
5
|
type Param = {
|
|
6
6
|
value?: string | string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
2
|
+
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
3
3
|
declare function ApiExplorer({ item, infoPath, }: {
|
|
4
4
|
item: NonNullable<ApiItem>;
|
|
5
5
|
infoPath: string;
|
|
@@ -12,12 +12,12 @@ var __importDefault =
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
|
-
const Translate_1 = require("@docusaurus/Translate");
|
|
16
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
17
15
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
18
17
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
19
18
|
const ParamsItem_1 = __importDefault(require("@theme/ParamsItem"));
|
|
20
19
|
const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
|
|
20
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
21
21
|
const ParamsDetailsComponent = ({ parameters }) => {
|
|
22
22
|
const types = ["path", "query", "header", "cookie"];
|
|
23
23
|
return react_1.default.createElement(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/
|
|
2
|
+
import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
interface Props {
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
title: string;
|
|
@@ -12,15 +12,15 @@ var __importDefault =
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
|
-
const Translate_1 = require("@docusaurus/Translate");
|
|
16
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
17
15
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
18
17
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
19
18
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
20
19
|
const MimeTabs_1 = __importDefault(require("@theme/MimeTabs")); // Assume these components exist
|
|
21
20
|
const Schema_1 = __importDefault(require("@theme/Schema"));
|
|
22
21
|
const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
|
|
23
22
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
23
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
24
24
|
const RequestSchemaComponent = ({ title, body, style }) => {
|
|
25
25
|
if (
|
|
26
26
|
body === undefined ||
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/
|
|
2
|
+
import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
interface Props {
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
title: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SchemaObject } from "docusaurus-plugin-openapi-docs/
|
|
2
|
+
import type { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
3
|
interface SchemaProps {
|
|
4
4
|
schema: SchemaObject;
|
|
5
5
|
schemaType: "request" | "response";
|
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": "4.7.
|
|
4
|
+
"version": "4.7.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/postman-collection": "^3.5.11",
|
|
39
39
|
"@types/react-modal": "^3.16.3",
|
|
40
40
|
"concurrently": "^9.2.0",
|
|
41
|
-
"docusaurus-plugin-openapi-docs": "^4.7.
|
|
41
|
+
"docusaurus-plugin-openapi-docs": "^4.7.1",
|
|
42
42
|
"docusaurus-plugin-sass": "^0.2.6",
|
|
43
43
|
"eslint-plugin-prettier": "^5.5.1"
|
|
44
44
|
},
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=14"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0a89b9db05458cff9591eb065160e26c05f64a18"
|
|
85
85
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
9
|
import { createStorage, hashArray } from "@theme/ApiExplorer/storage-utils";
|
|
10
|
-
import {
|
|
10
|
+
import type {
|
|
11
11
|
SecurityRequirementObject,
|
|
12
12
|
SecuritySchemeObject,
|
|
13
13
|
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import React, { useState } from "react";
|
|
9
|
+
|
|
9
10
|
import FormFileUpload from "@theme/ApiExplorer/FormFileUpload";
|
|
10
11
|
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
12
|
+
|
|
11
13
|
import { FileContent, setFileArrayFormBody } from "../slice";
|
|
12
14
|
|
|
13
15
|
interface FileArrayFormItemProps {
|
|
@@ -6,14 +6,16 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
|
+
|
|
9
10
|
import FormFileUpload from "@theme/ApiExplorer/FormFileUpload";
|
|
10
11
|
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
11
12
|
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
12
13
|
import LiveApp from "@theme/ApiExplorer/LiveEditor";
|
|
13
14
|
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
14
|
-
import { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
15
|
-
|
|
15
|
+
import type { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
16
|
+
|
|
16
17
|
import FileArrayFormBodyItem from "../FileArrayFormBodyItem";
|
|
18
|
+
import { clearFormBodyKey, setFileFormBody, setStringFormBody } from "../slice";
|
|
17
19
|
|
|
18
20
|
interface FormBodyItemProps {
|
|
19
21
|
schemaObject: SchemaObject;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import React, { useEffect, useMemo } from "react";
|
|
9
9
|
|
|
10
10
|
import { translate } from "@docusaurus/Translate";
|
|
11
|
-
|
|
12
11
|
import json2xml from "@theme/ApiExplorer/Body/json2xml";
|
|
13
12
|
import FormFileUpload from "@theme/ApiExplorer/FormFileUpload";
|
|
14
13
|
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
@@ -18,13 +17,13 @@ import Markdown from "@theme/Markdown";
|
|
|
18
17
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
19
18
|
import TabItem from "@theme/TabItem";
|
|
20
19
|
import { OPENAPI_BODY, OPENAPI_REQUEST } from "@theme/translationIds";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { sampleFromSchema } from "docusaurus-plugin-openapi-docs/lib/openapi/createSchemaExample";
|
|
21
|
+
import type { RequestBodyObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
23
22
|
import format from "xml-formatter";
|
|
24
23
|
|
|
25
|
-
import { clearRawBody, setFileRawBody, setStringRawBody } from "./slice";
|
|
26
24
|
import FormBodyItem from "./FormBodyItem";
|
|
27
25
|
import { resolveSchemaWithSelections } from "./resolveSchemaWithSelections";
|
|
26
|
+
import { clearRawBody, setFileRawBody, setStringRawBody } from "./slice";
|
|
28
27
|
|
|
29
28
|
export interface Props {
|
|
30
29
|
jsonRequestBodyExample: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
-
import { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
8
|
+
import type { SchemaObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
9
9
|
import merge from "lodash/merge";
|
|
10
10
|
|
|
11
11
|
export interface SchemaSelections {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
|
-
import { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
9
|
+
import type { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
10
10
|
|
|
11
11
|
export type Param = ParameterObject & { value?: string[] | string };
|
|
12
12
|
|
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
import Server from "@theme/ApiExplorer/Server";
|
|
28
28
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
29
29
|
import { OPENAPI_REQUEST } from "@theme/translationIds";
|
|
30
|
-
import { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
31
|
-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
30
|
+
import type { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
31
|
+
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
32
32
|
import type { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
|
|
33
33
|
import * as sdk from "postman-collection";
|
|
34
34
|
import { FormProvider, useForm } from "react-hook-form";
|
|
@@ -17,7 +17,7 @@ import SchemaTabs from "@theme/SchemaTabs";
|
|
|
17
17
|
import TabItem from "@theme/TabItem";
|
|
18
18
|
import { OPENAPI_RESPONSE } from "@theme/translationIds";
|
|
19
19
|
import clsx from "clsx";
|
|
20
|
-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
20
|
+
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
21
21
|
import type { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
|
|
22
22
|
|
|
23
23
|
import { clearResponse, clearCode, clearHeaders } from "./slice";
|
|
@@ -47,8 +47,7 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
47
47
|
const { siteConfig } = useDocusaurusContext();
|
|
48
48
|
const themeConfig = siteConfig.themeConfig as ThemeConfig;
|
|
49
49
|
const hideSendButton = metadata.frontMatter.hide_send_button;
|
|
50
|
-
const proxy =
|
|
51
|
-
metadata.frontMatter.proxy ?? themeConfig.api?.proxy;
|
|
50
|
+
const proxy = metadata.frontMatter.proxy ?? themeConfig.api?.proxy;
|
|
52
51
|
const prismTheme = usePrismTheme();
|
|
53
52
|
const code = useTypedSelector((state: any) => state.response.code);
|
|
54
53
|
const headers = useTypedSelector((state: any) => state.response.headers);
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
-
import { translate } from "@docusaurus/Translate";
|
|
11
|
-
import { OPENAPI_SECURITY_SCHEMES } from "@theme/translationIds";
|
|
12
|
-
|
|
13
10
|
import Link from "@docusaurus/Link";
|
|
11
|
+
import { translate } from "@docusaurus/Translate";
|
|
14
12
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
13
|
+
import { OPENAPI_SECURITY_SCHEMES } from "@theme/translationIds";
|
|
15
14
|
|
|
16
15
|
function SecuritySchemes(props: any) {
|
|
17
16
|
const options = useTypedSelector((state: any) => state.auth.options);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
|
-
import { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
9
|
+
import type { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
10
10
|
// TODO: we might want to export this
|
|
11
11
|
|
|
12
12
|
export interface State {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { AuthState, Scheme } from "@theme/ApiExplorer/Authorization/slice";
|
|
9
9
|
import { Body, Content } from "@theme/ApiExplorer/Body/slice";
|
|
10
|
-
import {
|
|
10
|
+
import type {
|
|
11
11
|
ParameterObject,
|
|
12
12
|
ServerObject,
|
|
13
13
|
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
@@ -12,7 +12,7 @@ import CodeSnippets from "@theme/ApiExplorer/CodeSnippets";
|
|
|
12
12
|
import Request from "@theme/ApiExplorer/Request";
|
|
13
13
|
import Response from "@theme/ApiExplorer/Response";
|
|
14
14
|
import SecuritySchemes from "@theme/ApiExplorer/SecuritySchemes";
|
|
15
|
-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
15
|
+
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
16
16
|
import * as sdk from "postman-collection";
|
|
17
17
|
|
|
18
18
|
function ApiExplorer({
|
|
@@ -22,7 +22,7 @@ import type { Props } from "@theme/DocItem";
|
|
|
22
22
|
import DocItemMetadata from "@theme/DocItem/Metadata";
|
|
23
23
|
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
24
24
|
import clsx from "clsx";
|
|
25
|
-
import {
|
|
25
|
+
import type {
|
|
26
26
|
ParameterObject,
|
|
27
27
|
ServerObject,
|
|
28
28
|
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
-
import { translate } from "@docusaurus/Translate";
|
|
11
|
-
import { OPENAPI_PARAMS_DETAILS } from "@theme/translationIds";
|
|
12
|
-
|
|
13
10
|
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
|
+
import { translate } from "@docusaurus/Translate";
|
|
14
12
|
import Details from "@theme/Details";
|
|
15
13
|
import ParamsItem from "@theme/ParamsItem";
|
|
16
14
|
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
15
|
+
import { OPENAPI_PARAMS_DETAILS } from "@theme/translationIds";
|
|
17
16
|
|
|
18
17
|
interface Props {
|
|
19
18
|
parameters: any[];
|
|
@@ -7,17 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
-
import { translate } from "@docusaurus/Translate";
|
|
11
|
-
import { OPENAPI_REQUEST, OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
|
|
12
|
-
|
|
13
10
|
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
|
+
import { translate } from "@docusaurus/Translate";
|
|
14
12
|
import Details from "@theme/Details";
|
|
15
13
|
import Markdown from "@theme/Markdown";
|
|
16
14
|
import MimeTabs from "@theme/MimeTabs"; // Assume these components exist
|
|
17
15
|
import SchemaNode from "@theme/Schema";
|
|
18
16
|
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
19
17
|
import TabItem from "@theme/TabItem";
|
|
20
|
-
import {
|
|
18
|
+
import { OPENAPI_REQUEST, OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
|
|
19
|
+
import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
21
20
|
|
|
22
21
|
interface Props {
|
|
23
22
|
style?: React.CSSProperties;
|
|
@@ -22,7 +22,7 @@ import SchemaTabs from "@theme/SchemaTabs";
|
|
|
22
22
|
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
23
23
|
import TabItem from "@theme/TabItem";
|
|
24
24
|
import { OPENAPI_SCHEMA, OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
|
|
25
|
-
import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/
|
|
25
|
+
import type { MediaTypeObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
26
26
|
|
|
27
27
|
interface Props {
|
|
28
28
|
style?: React.CSSProperties;
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
getQualifierMessage,
|
|
26
26
|
getSchemaName,
|
|
27
27
|
} from "docusaurus-plugin-openapi-docs/lib/markdown/schema";
|
|
28
|
-
import {
|
|
28
|
+
import type {
|
|
29
29
|
SchemaObject,
|
|
30
30
|
SchemaType,
|
|
31
|
-
} from "docusaurus-plugin-openapi-docs/
|
|
31
|
+
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
32
32
|
import isEmpty from "lodash/isEmpty";
|
|
33
33
|
|
|
34
34
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
@@ -15,7 +15,7 @@ import ResponseHeaders from "@theme/ResponseHeaders";
|
|
|
15
15
|
import ResponseSchema from "@theme/ResponseSchema";
|
|
16
16
|
import TabItem from "@theme/TabItem";
|
|
17
17
|
import { OPENAPI_STATUS_CODES } from "@theme/translationIds";
|
|
18
|
-
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
18
|
+
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
21
21
|
id?: string;
|
package/src/types.d.ts
CHANGED
|
@@ -6,7 +6,14 @@
|
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
8
|
import type { DocFrontMatter as DocusaurusDocFrontMatter } from "@docusaurus/plugin-content-docs";
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
// Re-export types from plugin for consistency
|
|
11
|
+
export type {
|
|
12
|
+
DiscriminatorObject,
|
|
13
|
+
ExternalDocumentationObject,
|
|
14
|
+
SchemaObject,
|
|
15
|
+
XMLObject,
|
|
16
|
+
} from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
10
17
|
|
|
11
18
|
export interface ThemeConfig {
|
|
12
19
|
api?: {
|
|
@@ -23,57 +30,6 @@ export interface ThemeConfig {
|
|
|
23
30
|
};
|
|
24
31
|
}
|
|
25
32
|
|
|
26
|
-
export type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
|
|
27
|
-
export type SchemaObject = Omit<
|
|
28
|
-
JSONSchema,
|
|
29
|
-
| "type"
|
|
30
|
-
| "allOf"
|
|
31
|
-
| "oneOf"
|
|
32
|
-
| "anyOf"
|
|
33
|
-
| "not"
|
|
34
|
-
| "items"
|
|
35
|
-
| "properties"
|
|
36
|
-
| "additionalProperties"
|
|
37
|
-
> & {
|
|
38
|
-
// OpenAPI specific overrides
|
|
39
|
-
type?: "string" | "number" | "integer" | "boolean" | "object" | "array";
|
|
40
|
-
allOf?: SchemaObject[];
|
|
41
|
-
oneOf?: SchemaObject[];
|
|
42
|
-
anyOf?: SchemaObject[];
|
|
43
|
-
not?: SchemaObject;
|
|
44
|
-
items?: SchemaObject;
|
|
45
|
-
properties?: Record<string, SchemaObject>;
|
|
46
|
-
additionalProperties?: boolean | SchemaObject;
|
|
47
|
-
|
|
48
|
-
// OpenAPI additions
|
|
49
|
-
nullable?: boolean;
|
|
50
|
-
discriminator?: DiscriminatorObject;
|
|
51
|
-
readOnly?: boolean;
|
|
52
|
-
writeOnly?: boolean;
|
|
53
|
-
xml?: XMLObject;
|
|
54
|
-
externalDocs?: ExternalDocumentationObject;
|
|
55
|
-
example?: any;
|
|
56
|
-
deprecated?: boolean;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export interface DiscriminatorObject {
|
|
60
|
-
propertyName: string;
|
|
61
|
-
mapping?: Record<string, string>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface XMLObject {
|
|
65
|
-
name?: string;
|
|
66
|
-
namespace?: string;
|
|
67
|
-
prefix?: string;
|
|
68
|
-
attribute?: boolean;
|
|
69
|
-
wrapped?: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ExternalDocumentationObject {
|
|
73
|
-
description?: string;
|
|
74
|
-
url: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
33
|
export interface DocFrontMatter extends DocusaurusDocFrontMatter {
|
|
78
34
|
/** Provides OpenAPI Docs with a reference path to their respective Info Doc */
|
|
79
35
|
info_path?: string;
|