docusaurus-theme-openapi-docs 0.0.0-1000
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/LICENSE +21 -0
- package/babel.config.js +35 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +81 -0
- package/lib/markdown/createDescription.d.ts +1 -0
- package/lib/markdown/createDescription.js +15 -0
- package/lib/markdown/schema.d.ts +3 -0
- package/lib/markdown/schema.js +149 -0
- package/lib/markdown/utils.d.ts +10 -0
- package/lib/markdown/utils.js +49 -0
- package/lib/markdown/utils.test.d.ts +1 -0
- package/lib/markdown/utils.test.js +43 -0
- package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Accept/index.js +38 -0
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +160 -0
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
- package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
- package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/Body/index.js +381 -0
- package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
- package/lib/theme/ApiExplorer/Body/slice.js +97 -0
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -0
- package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
- package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Export/index.js +57 -0
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +173 -0
- package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
- package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
- package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
- package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.js +168 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +220 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.js +223 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
- package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Request/index.js +396 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -0
- package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +193 -0
- package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/Response/slice.js +51 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
- package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Server/index.js +199 -0
- package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
- package/lib/theme/ApiExplorer/Server/slice.js +33 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.js +465 -0
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +41 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
- package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
- package/lib/theme/ApiExplorer/storage-utils.js +41 -0
- package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
- package/lib/theme/ApiItem/Layout/index.js +121 -0
- package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
- package/lib/theme/ApiItem/hooks.d.ts +12 -0
- package/lib/theme/ApiItem/hooks.js +13 -0
- package/lib/theme/ApiItem/index.d.ts +2 -0
- package/lib/theme/ApiItem/index.js +238 -0
- package/lib/theme/ApiItem/store.d.ts +46 -0
- package/lib/theme/ApiItem/store.js +53 -0
- package/lib/theme/ApiLogo/index.d.ts +2 -0
- package/lib/theme/ApiLogo/index.js +51 -0
- package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/lib/theme/ApiTabs/index.d.ts +7 -0
- package/lib/theme/ApiTabs/index.js +270 -0
- package/lib/theme/ArrayBrackets/index.d.ts +3 -0
- package/lib/theme/ArrayBrackets/index.js +50 -0
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
- package/lib/theme/DiscriminatorTabs/index.js +258 -0
- package/lib/theme/Markdown/Details/_Details.scss +122 -0
- package/lib/theme/Markdown/index.js +179 -0
- package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/lib/theme/MimeTabs/index.d.ts +6 -0
- package/lib/theme/MimeTabs/index.js +286 -0
- package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/lib/theme/OperationTabs/index.d.ts +3 -0
- package/lib/theme/OperationTabs/index.js +248 -0
- package/lib/theme/ParamsDetails/index.d.ts +6 -0
- package/lib/theme/ParamsDetails/index.js +85 -0
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.d.ts +25 -0
- package/lib/theme/ParamsItem/index.js +218 -0
- package/lib/theme/RequestSchema/index.d.ts +15 -0
- package/lib/theme/RequestSchema/index.js +194 -0
- package/lib/theme/ResponseExamples/index.d.ts +18 -0
- package/lib/theme/ResponseExamples/index.js +193 -0
- package/lib/theme/ResponseHeaders/index.d.ts +13 -0
- package/lib/theme/ResponseHeaders/index.js +39 -0
- package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/lib/theme/ResponseSamples/index.d.ts +8 -0
- package/lib/theme/ResponseSamples/index.js +27 -0
- package/lib/theme/ResponseSchema/index.d.ts +15 -0
- package/lib/theme/ResponseSchema/index.js +159 -0
- package/lib/theme/Schema/index.d.ts +8 -0
- package/lib/theme/Schema/index.js +885 -0
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +213 -0
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/lib/theme/SchemaTabs/index.d.ts +3 -0
- package/lib/theme/SchemaTabs/index.js +255 -0
- package/lib/theme/SkeletonLoader/index.d.ts +6 -0
- package/lib/theme/SkeletonLoader/index.js +20 -0
- package/lib/theme/StatusCodes/index.d.ts +9 -0
- package/lib/theme/StatusCodes/index.js +81 -0
- package/lib/theme/styles.scss +212 -0
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -0
- package/package.json +83 -0
- package/src/index.ts +85 -0
- package/src/markdown/createDescription.ts +13 -0
- package/src/markdown/schema.ts +181 -0
- package/src/markdown/utils.test.ts +49 -0
- package/src/markdown/utils.ts +59 -0
- package/src/plugin-content-docs.d.ts +20 -0
- package/src/postman-code-generators.d.ts +9 -0
- package/src/react-magic-dropzone.d.ts +9 -0
- package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
- package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +79 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
- package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
- package/src/theme/ApiExplorer/Authorization/index.tsx +158 -0
- package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
- package/src/theme/ApiExplorer/Body/index.tsx +376 -0
- package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/src/theme/ApiExplorer/Body/slice.ts +133 -0
- package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +338 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -0
- package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
- package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
- package/src/theme/ApiExplorer/Export/index.tsx +47 -0
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
- package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +119 -0
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/ApiExplorer/FormItem/index.tsx +33 -0
- package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
- package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
- package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +175 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +146 -0
- package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
- package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/src/theme/ApiExplorer/Request/index.tsx +309 -0
- package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
- package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/src/theme/ApiExplorer/Response/index.tsx +157 -0
- package/src/theme/ApiExplorer/Response/slice.ts +52 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
- package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/src/theme/ApiExplorer/Server/index.tsx +130 -0
- package/src/theme/ApiExplorer/Server/slice.ts +39 -0
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
- package/src/theme/ApiExplorer/index.tsx +41 -0
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
- package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
- package/src/theme/ApiExplorer/react-modal.d.ts +8 -0
- package/src/theme/ApiExplorer/storage-utils.ts +39 -0
- package/src/theme/ApiItem/Layout/index.tsx +85 -0
- package/src/theme/ApiItem/Layout/styles.module.css +17 -0
- package/src/theme/ApiItem/hooks.ts +13 -0
- package/src/theme/ApiItem/index.tsx +222 -0
- package/src/theme/ApiItem/store.ts +51 -0
- package/src/theme/ApiLogo/index.tsx +52 -0
- package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/src/theme/ApiTabs/index.tsx +238 -0
- package/src/theme/ArrayBrackets/index.tsx +37 -0
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/src/theme/DiscriminatorTabs/index.tsx +229 -0
- package/src/theme/Markdown/Details/_Details.scss +122 -0
- package/src/theme/Markdown/index.js +179 -0
- package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/src/theme/MimeTabs/index.tsx +257 -0
- package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/src/theme/OperationTabs/index.tsx +220 -0
- package/src/theme/ParamsDetails/index.tsx +81 -0
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.tsx +205 -0
- package/src/theme/RequestSchema/index.tsx +157 -0
- package/src/theme/ResponseExamples/index.tsx +192 -0
- package/src/theme/ResponseHeaders/index.tsx +49 -0
- package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/src/theme/ResponseSamples/index.tsx +31 -0
- package/src/theme/ResponseSchema/index.tsx +144 -0
- package/src/theme/Schema/index.tsx +939 -0
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.tsx +198 -0
- package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/src/theme/SchemaTabs/index.tsx +224 -0
- package/src/theme/SkeletonLoader/index.tsx +18 -0
- package/src/theme/StatusCodes/index.tsx +72 -0
- package/src/theme/styles.scss +212 -0
- package/src/theme-classic.d.ts +80 -0
- package/src/theme-openapi.d.ts +288 -0
- package/src/theme-translations.d.ts +9 -0
- package/src/types.ts +182 -0
- package/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __importDefault =
|
|
9
|
+
(this && this.__importDefault) ||
|
|
10
|
+
function (mod) {
|
|
11
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
16
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
17
|
+
function SecuritySchemes(props) {
|
|
18
|
+
const options = (0, hooks_1.useTypedSelector)((state) => state.auth.options);
|
|
19
|
+
const selected = (0, hooks_1.useTypedSelector)(
|
|
20
|
+
(state) => state.auth.selected
|
|
21
|
+
);
|
|
22
|
+
const infoAuthPath = `/${props.infoPath}#authentication`;
|
|
23
|
+
if (selected === undefined) return null;
|
|
24
|
+
if (options[selected]?.[0]?.type === undefined) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const selectedAuth = options[selected];
|
|
28
|
+
return react_1.default.createElement(
|
|
29
|
+
"details",
|
|
30
|
+
{ className: "openapi-security__details", open: false },
|
|
31
|
+
react_1.default.createElement(
|
|
32
|
+
"summary",
|
|
33
|
+
{ className: "openapi-security__summary-container" },
|
|
34
|
+
react_1.default.createElement(
|
|
35
|
+
"h4",
|
|
36
|
+
{ className: "openapi-security__summary-header" },
|
|
37
|
+
"Authorization: ",
|
|
38
|
+
selectedAuth[0].name ?? selectedAuth[0].type
|
|
39
|
+
)
|
|
40
|
+
),
|
|
41
|
+
selectedAuth.map((auth) => {
|
|
42
|
+
const isHttp = auth.type === "http";
|
|
43
|
+
const isApiKey = auth.type === "apiKey";
|
|
44
|
+
const isOauth2 = auth.type === "oauth2";
|
|
45
|
+
const isOpenId = auth.type === "openIdConnect";
|
|
46
|
+
if (isHttp) {
|
|
47
|
+
if (auth.scheme === "bearer") {
|
|
48
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
49
|
+
return react_1.default.createElement(
|
|
50
|
+
react_1.default.Fragment,
|
|
51
|
+
{ key: auth.key },
|
|
52
|
+
react_1.default.createElement(
|
|
53
|
+
"pre",
|
|
54
|
+
{
|
|
55
|
+
style: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
flexDirection: "column",
|
|
58
|
+
background: "var(--openapi-card-background-color)",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
react_1.default.createElement(
|
|
62
|
+
"span",
|
|
63
|
+
null,
|
|
64
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
65
|
+
" ",
|
|
66
|
+
react_1.default.createElement(
|
|
67
|
+
Link_1.default,
|
|
68
|
+
{ to: infoAuthPath },
|
|
69
|
+
name ?? key
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
react_1.default.createElement(
|
|
73
|
+
"span",
|
|
74
|
+
null,
|
|
75
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
76
|
+
type
|
|
77
|
+
),
|
|
78
|
+
scopes &&
|
|
79
|
+
scopes.length > 0 &&
|
|
80
|
+
react_1.default.createElement(
|
|
81
|
+
"span",
|
|
82
|
+
null,
|
|
83
|
+
react_1.default.createElement("strong", null, "scopes: "),
|
|
84
|
+
react_1.default.createElement(
|
|
85
|
+
"code",
|
|
86
|
+
null,
|
|
87
|
+
auth.scopes.length > 0 ? auth.scopes.toString() : "[]"
|
|
88
|
+
)
|
|
89
|
+
),
|
|
90
|
+
Object.keys(rest).map((k, i) => {
|
|
91
|
+
return react_1.default.createElement(
|
|
92
|
+
"span",
|
|
93
|
+
{ key: k },
|
|
94
|
+
react_1.default.createElement("strong", null, k, ": "),
|
|
95
|
+
typeof rest[k] === "object"
|
|
96
|
+
? JSON.stringify(rest[k], null, 2)
|
|
97
|
+
: String(rest[k])
|
|
98
|
+
);
|
|
99
|
+
})
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
if (auth.scheme === "basic") {
|
|
104
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
105
|
+
return react_1.default.createElement(
|
|
106
|
+
react_1.default.Fragment,
|
|
107
|
+
{ key: auth.key },
|
|
108
|
+
react_1.default.createElement(
|
|
109
|
+
"pre",
|
|
110
|
+
{
|
|
111
|
+
style: {
|
|
112
|
+
display: "flex",
|
|
113
|
+
flexDirection: "column",
|
|
114
|
+
background: "var(--openapi-card-background-color)",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
react_1.default.createElement(
|
|
118
|
+
"span",
|
|
119
|
+
null,
|
|
120
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
121
|
+
" ",
|
|
122
|
+
react_1.default.createElement(
|
|
123
|
+
Link_1.default,
|
|
124
|
+
{ to: infoAuthPath },
|
|
125
|
+
name ?? key
|
|
126
|
+
)
|
|
127
|
+
),
|
|
128
|
+
react_1.default.createElement(
|
|
129
|
+
"span",
|
|
130
|
+
null,
|
|
131
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
132
|
+
type
|
|
133
|
+
),
|
|
134
|
+
scopes &&
|
|
135
|
+
scopes.length > 0 &&
|
|
136
|
+
react_1.default.createElement(
|
|
137
|
+
"span",
|
|
138
|
+
null,
|
|
139
|
+
react_1.default.createElement("strong", null, "scopes: "),
|
|
140
|
+
react_1.default.createElement(
|
|
141
|
+
"code",
|
|
142
|
+
null,
|
|
143
|
+
auth.scopes.length > 0 ? auth.scopes.toString() : "[]"
|
|
144
|
+
)
|
|
145
|
+
),
|
|
146
|
+
Object.keys(rest).map((k, i) => {
|
|
147
|
+
return react_1.default.createElement(
|
|
148
|
+
"span",
|
|
149
|
+
{ key: k },
|
|
150
|
+
react_1.default.createElement("strong", null, k, ": "),
|
|
151
|
+
typeof rest[k] === "object"
|
|
152
|
+
? JSON.stringify(rest[k], null, 2)
|
|
153
|
+
: String(rest[k])
|
|
154
|
+
);
|
|
155
|
+
})
|
|
156
|
+
)
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
return react_1.default.createElement(
|
|
160
|
+
react_1.default.Fragment,
|
|
161
|
+
{ key: auth.key },
|
|
162
|
+
react_1.default.createElement(
|
|
163
|
+
"pre",
|
|
164
|
+
{
|
|
165
|
+
style: {
|
|
166
|
+
display: "flex",
|
|
167
|
+
flexDirection: "column",
|
|
168
|
+
background: "var(--openapi-card-background-color)",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
react_1.default.createElement(
|
|
172
|
+
"span",
|
|
173
|
+
null,
|
|
174
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
175
|
+
" ",
|
|
176
|
+
react_1.default.createElement(
|
|
177
|
+
Link_1.default,
|
|
178
|
+
{ to: infoAuthPath },
|
|
179
|
+
auth.name ?? auth.key
|
|
180
|
+
)
|
|
181
|
+
),
|
|
182
|
+
react_1.default.createElement(
|
|
183
|
+
"span",
|
|
184
|
+
null,
|
|
185
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
186
|
+
auth.type
|
|
187
|
+
),
|
|
188
|
+
react_1.default.createElement(
|
|
189
|
+
"span",
|
|
190
|
+
null,
|
|
191
|
+
react_1.default.createElement("strong", null, "in: "),
|
|
192
|
+
auth.in
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
if (isApiKey) {
|
|
198
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
199
|
+
return react_1.default.createElement(
|
|
200
|
+
react_1.default.Fragment,
|
|
201
|
+
{ key: auth.key },
|
|
202
|
+
react_1.default.createElement(
|
|
203
|
+
"pre",
|
|
204
|
+
{
|
|
205
|
+
style: {
|
|
206
|
+
display: "flex",
|
|
207
|
+
flexDirection: "column",
|
|
208
|
+
background: "var(--openapi-card-background-color)",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
react_1.default.createElement(
|
|
212
|
+
"span",
|
|
213
|
+
null,
|
|
214
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
215
|
+
" ",
|
|
216
|
+
react_1.default.createElement(
|
|
217
|
+
Link_1.default,
|
|
218
|
+
{ to: infoAuthPath },
|
|
219
|
+
name ?? key
|
|
220
|
+
)
|
|
221
|
+
),
|
|
222
|
+
react_1.default.createElement(
|
|
223
|
+
"span",
|
|
224
|
+
null,
|
|
225
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
226
|
+
type
|
|
227
|
+
),
|
|
228
|
+
scopes &&
|
|
229
|
+
scopes.length > 0 &&
|
|
230
|
+
react_1.default.createElement(
|
|
231
|
+
"span",
|
|
232
|
+
null,
|
|
233
|
+
react_1.default.createElement("strong", null, "scopes: "),
|
|
234
|
+
react_1.default.createElement(
|
|
235
|
+
"code",
|
|
236
|
+
null,
|
|
237
|
+
auth.scopes.length > 0 ? auth.scopes.toString() : "[]"
|
|
238
|
+
)
|
|
239
|
+
),
|
|
240
|
+
Object.keys(rest).map((k, i) => {
|
|
241
|
+
return react_1.default.createElement(
|
|
242
|
+
"span",
|
|
243
|
+
{ key: k },
|
|
244
|
+
react_1.default.createElement("strong", null, k, ": "),
|
|
245
|
+
typeof rest[k] === "object"
|
|
246
|
+
? JSON.stringify(rest[k], null, 2)
|
|
247
|
+
: String(rest[k])
|
|
248
|
+
);
|
|
249
|
+
})
|
|
250
|
+
)
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
if (isOauth2) {
|
|
254
|
+
const { name, key, type, scopes, flows, ...rest } = auth;
|
|
255
|
+
return react_1.default.createElement(
|
|
256
|
+
react_1.default.Fragment,
|
|
257
|
+
{ key: selected },
|
|
258
|
+
react_1.default.createElement(
|
|
259
|
+
"pre",
|
|
260
|
+
{
|
|
261
|
+
style: {
|
|
262
|
+
display: "flex",
|
|
263
|
+
flexDirection: "column",
|
|
264
|
+
background: "var(--openapi-card-background-color)",
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
react_1.default.createElement(
|
|
268
|
+
"span",
|
|
269
|
+
null,
|
|
270
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
271
|
+
" ",
|
|
272
|
+
react_1.default.createElement(
|
|
273
|
+
Link_1.default,
|
|
274
|
+
{ to: infoAuthPath },
|
|
275
|
+
name ?? key
|
|
276
|
+
)
|
|
277
|
+
),
|
|
278
|
+
react_1.default.createElement(
|
|
279
|
+
"span",
|
|
280
|
+
null,
|
|
281
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
282
|
+
type
|
|
283
|
+
),
|
|
284
|
+
scopes &&
|
|
285
|
+
scopes.length > 0 &&
|
|
286
|
+
react_1.default.createElement(
|
|
287
|
+
"span",
|
|
288
|
+
null,
|
|
289
|
+
react_1.default.createElement("strong", null, "scopes: "),
|
|
290
|
+
react_1.default.createElement(
|
|
291
|
+
"code",
|
|
292
|
+
null,
|
|
293
|
+
auth.scopes.length > 0 ? auth.scopes.toString() : "[]"
|
|
294
|
+
)
|
|
295
|
+
),
|
|
296
|
+
Object.keys(rest).map((k, i) => {
|
|
297
|
+
return react_1.default.createElement(
|
|
298
|
+
"span",
|
|
299
|
+
{ key: k },
|
|
300
|
+
react_1.default.createElement("strong", null, k, ": "),
|
|
301
|
+
typeof rest[k] === "object"
|
|
302
|
+
? JSON.stringify(rest[k], null, 2)
|
|
303
|
+
: String(rest[k])
|
|
304
|
+
);
|
|
305
|
+
}),
|
|
306
|
+
flows &&
|
|
307
|
+
react_1.default.createElement(
|
|
308
|
+
"span",
|
|
309
|
+
null,
|
|
310
|
+
react_1.default.createElement(
|
|
311
|
+
"code",
|
|
312
|
+
null,
|
|
313
|
+
react_1.default.createElement("strong", null, "flows: "),
|
|
314
|
+
JSON.stringify(flows, null, 2)
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
)
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
if (isOpenId) {
|
|
321
|
+
const { name, key, scopes, type, ...rest } = auth;
|
|
322
|
+
return react_1.default.createElement(
|
|
323
|
+
react_1.default.Fragment,
|
|
324
|
+
{ key: auth.key },
|
|
325
|
+
react_1.default.createElement(
|
|
326
|
+
"pre",
|
|
327
|
+
{
|
|
328
|
+
style: {
|
|
329
|
+
display: "flex",
|
|
330
|
+
flexDirection: "column",
|
|
331
|
+
background: "var(--openapi-card-background-color)",
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
react_1.default.createElement(
|
|
335
|
+
"span",
|
|
336
|
+
null,
|
|
337
|
+
react_1.default.createElement("strong", null, "name:"),
|
|
338
|
+
" ",
|
|
339
|
+
react_1.default.createElement(
|
|
340
|
+
Link_1.default,
|
|
341
|
+
{ to: infoAuthPath },
|
|
342
|
+
name ?? key
|
|
343
|
+
)
|
|
344
|
+
),
|
|
345
|
+
react_1.default.createElement(
|
|
346
|
+
"span",
|
|
347
|
+
null,
|
|
348
|
+
react_1.default.createElement("strong", null, "type: "),
|
|
349
|
+
type
|
|
350
|
+
),
|
|
351
|
+
scopes &&
|
|
352
|
+
scopes.length > 0 &&
|
|
353
|
+
react_1.default.createElement(
|
|
354
|
+
"span",
|
|
355
|
+
null,
|
|
356
|
+
react_1.default.createElement("strong", null, "scopes: "),
|
|
357
|
+
react_1.default.createElement(
|
|
358
|
+
"code",
|
|
359
|
+
null,
|
|
360
|
+
auth.scopes.length > 0 ? auth.scopes.toString() : "[]"
|
|
361
|
+
)
|
|
362
|
+
),
|
|
363
|
+
Object.keys(rest).map((k, i) => {
|
|
364
|
+
return react_1.default.createElement(
|
|
365
|
+
"span",
|
|
366
|
+
{ key: k },
|
|
367
|
+
react_1.default.createElement("strong", null, k, ": "),
|
|
368
|
+
typeof rest[k] === "object"
|
|
369
|
+
? JSON.stringify(rest[k], null, 2)
|
|
370
|
+
: String(rest[k])
|
|
371
|
+
);
|
|
372
|
+
})
|
|
373
|
+
)
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
return undefined;
|
|
377
|
+
})
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
exports.default = SecuritySchemes;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.openapi-explorer__server-container {
|
|
2
|
+
background: var(--openapi-card-background-color);
|
|
3
|
+
border-radius: var(--openapi-card-border-radius);
|
|
4
|
+
color: var(--ifm-pre-color);
|
|
5
|
+
line-height: var(--ifm-pre-line-height);
|
|
6
|
+
margin-bottom: var(--ifm-spacing-vertical);
|
|
7
|
+
margin-top: 0;
|
|
8
|
+
overflow: auto;
|
|
9
|
+
|
|
10
|
+
/* hack for view calculation when monaco is hidden */
|
|
11
|
+
position: relative;
|
|
12
|
+
|
|
13
|
+
&:empty {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.openapi-explorer__server-url {
|
|
19
|
+
font-size: var(--openapi-explorer-font-size-input);
|
|
20
|
+
font-family: var(--ifm-font-family-monospace);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.openapi-explorer__server-description {
|
|
24
|
+
padding-left: 0.5rem;
|
|
25
|
+
font-weight: var(--ifm-font-weight-bold);
|
|
26
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var __createBinding =
|
|
9
|
+
(this && this.__createBinding) ||
|
|
10
|
+
(Object.create
|
|
11
|
+
? function (o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (
|
|
15
|
+
!desc ||
|
|
16
|
+
("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
17
|
+
) {
|
|
18
|
+
desc = {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return m[k];
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}
|
|
27
|
+
: function (o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
});
|
|
31
|
+
var __setModuleDefault =
|
|
32
|
+
(this && this.__setModuleDefault) ||
|
|
33
|
+
(Object.create
|
|
34
|
+
? function (o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}
|
|
37
|
+
: function (o, v) {
|
|
38
|
+
o["default"] = v;
|
|
39
|
+
});
|
|
40
|
+
var __importStar =
|
|
41
|
+
(this && this.__importStar) ||
|
|
42
|
+
(function () {
|
|
43
|
+
var ownKeys = function (o) {
|
|
44
|
+
ownKeys =
|
|
45
|
+
Object.getOwnPropertyNames ||
|
|
46
|
+
function (o) {
|
|
47
|
+
var ar = [];
|
|
48
|
+
for (var k in o)
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null)
|
|
58
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
59
|
+
if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
60
|
+
__setModuleDefault(result, mod);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
})();
|
|
64
|
+
var __importDefault =
|
|
65
|
+
(this && this.__importDefault) ||
|
|
66
|
+
function (mod) {
|
|
67
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
68
|
+
};
|
|
69
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
+
const react_1 = __importStar(require("react"));
|
|
71
|
+
const FloatingButton_1 = __importDefault(
|
|
72
|
+
require("@theme/ApiExplorer/FloatingButton")
|
|
73
|
+
);
|
|
74
|
+
const FormItem_1 = __importDefault(require("@theme/ApiExplorer/FormItem"));
|
|
75
|
+
const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
76
|
+
const FormTextInput_1 = __importDefault(
|
|
77
|
+
require("@theme/ApiExplorer/FormTextInput")
|
|
78
|
+
);
|
|
79
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
80
|
+
const slice_1 = require("./slice");
|
|
81
|
+
function Server() {
|
|
82
|
+
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
83
|
+
const value = (0, hooks_1.useTypedSelector)((state) => state.server.value);
|
|
84
|
+
const options = (0, hooks_1.useTypedSelector)(
|
|
85
|
+
(state) => state.server.options
|
|
86
|
+
);
|
|
87
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
88
|
+
if (options.length <= 0) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
if (options.length < 1 && value?.variables === undefined) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (!value) {
|
|
95
|
+
const defaultOption = options[0];
|
|
96
|
+
dispatch((0, slice_1.setServer)(JSON.stringify(defaultOption)));
|
|
97
|
+
}
|
|
98
|
+
// Default to first option when existing server state is mismatched
|
|
99
|
+
if (value) {
|
|
100
|
+
const urlExists = options.find((s) => s.url === value.url);
|
|
101
|
+
if (!urlExists) {
|
|
102
|
+
const defaultOption = options[0];
|
|
103
|
+
dispatch((0, slice_1.setServer)(JSON.stringify(defaultOption)));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (!isEditing) {
|
|
107
|
+
let url = "";
|
|
108
|
+
if (value) {
|
|
109
|
+
url = value.url.replace(/\/$/, "");
|
|
110
|
+
if (value.variables) {
|
|
111
|
+
Object.keys(value.variables).forEach((variable) => {
|
|
112
|
+
url = url.replace(
|
|
113
|
+
`{${variable}}`,
|
|
114
|
+
value.variables?.[variable].default ?? ""
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return react_1.default.createElement(
|
|
120
|
+
FloatingButton_1.default,
|
|
121
|
+
{ onClick: () => setIsEditing(true), label: "Edit" },
|
|
122
|
+
react_1.default.createElement(
|
|
123
|
+
FormItem_1.default,
|
|
124
|
+
null,
|
|
125
|
+
react_1.default.createElement(
|
|
126
|
+
"span",
|
|
127
|
+
{ className: "openapi-explorer__server-url", title: url },
|
|
128
|
+
url
|
|
129
|
+
)
|
|
130
|
+
)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return react_1.default.createElement(
|
|
134
|
+
"div",
|
|
135
|
+
{ className: "openapi-explorer__server-container" },
|
|
136
|
+
react_1.default.createElement(
|
|
137
|
+
FloatingButton_1.default,
|
|
138
|
+
{ onClick: () => setIsEditing(false), label: "Hide" },
|
|
139
|
+
react_1.default.createElement(
|
|
140
|
+
FormItem_1.default,
|
|
141
|
+
null,
|
|
142
|
+
react_1.default.createElement(FormSelect_1.default, {
|
|
143
|
+
options: options.map((s) => s.url),
|
|
144
|
+
onChange: (e) => {
|
|
145
|
+
dispatch(
|
|
146
|
+
(0, slice_1.setServer)(
|
|
147
|
+
JSON.stringify(
|
|
148
|
+
options.filter((s) => s.url === e.target.value)[0]
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
value: value?.url,
|
|
154
|
+
}),
|
|
155
|
+
react_1.default.createElement(
|
|
156
|
+
"small",
|
|
157
|
+
{ className: "openapi-explorer__server-description" },
|
|
158
|
+
value?.description
|
|
159
|
+
)
|
|
160
|
+
),
|
|
161
|
+
value?.variables &&
|
|
162
|
+
Object.keys(value.variables).map((key) => {
|
|
163
|
+
if (value.variables?.[key].enum !== undefined) {
|
|
164
|
+
return react_1.default.createElement(
|
|
165
|
+
FormItem_1.default,
|
|
166
|
+
{ label: key },
|
|
167
|
+
react_1.default.createElement(FormSelect_1.default, {
|
|
168
|
+
options: value.variables[key].enum,
|
|
169
|
+
onChange: (e) => {
|
|
170
|
+
dispatch(
|
|
171
|
+
(0, slice_1.setServerVariable)(
|
|
172
|
+
JSON.stringify({ key, value: e.target.value })
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
value: value?.variables[key].default,
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return react_1.default.createElement(
|
|
181
|
+
FormItem_1.default,
|
|
182
|
+
{ label: key },
|
|
183
|
+
react_1.default.createElement(FormTextInput_1.default, {
|
|
184
|
+
placeholder: value.variables?.[key].default,
|
|
185
|
+
onChange: (e) => {
|
|
186
|
+
dispatch(
|
|
187
|
+
(0, slice_1.setServerVariable)(
|
|
188
|
+
JSON.stringify({ key, value: e.target.value })
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
},
|
|
192
|
+
value: value?.variables?.[key].default,
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
})
|
|
196
|
+
)
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
exports.default = Server;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
3
|
+
export interface State {
|
|
4
|
+
value?: ServerObject;
|
|
5
|
+
options: ServerObject[];
|
|
6
|
+
}
|
|
7
|
+
export declare const slice: import("@reduxjs/toolkit").Slice<State, {
|
|
8
|
+
setServer: (state: import("immer/dist/internal").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
9
|
+
setServerVariable: (state: import("immer/dist/internal").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
10
|
+
}, "server">;
|
|
11
|
+
export declare const setServer: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "server/setServer">, setServerVariable: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "server/setServerVariable">;
|
|
12
|
+
declare const _default: import("redux").Reducer<State>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* ============================================================================
|
|
3
|
+
* Copyright (c) Palo Alto Networks
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
* ========================================================================== */
|
|
8
|
+
var _a;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.setServerVariable = exports.setServer = exports.slice = void 0;
|
|
11
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
12
|
+
const initialState = {};
|
|
13
|
+
exports.slice = (0, toolkit_1.createSlice)({
|
|
14
|
+
name: "server",
|
|
15
|
+
initialState,
|
|
16
|
+
reducers: {
|
|
17
|
+
setServer: (state, action) => {
|
|
18
|
+
state.value = state.options.find(
|
|
19
|
+
(s) => s.url === JSON.parse(action.payload).url
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
setServerVariable: (state, action) => {
|
|
23
|
+
if (state.value?.variables) {
|
|
24
|
+
const parsedPayload = JSON.parse(action.payload);
|
|
25
|
+
state.value.variables[parsedPayload.key].default = parsedPayload.value;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
(_a = exports.slice.actions),
|
|
31
|
+
(exports.setServer = _a.setServer),
|
|
32
|
+
(exports.setServerVariable = _a.setServerVariable);
|
|
33
|
+
exports.default = exports.slice.reducer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AuthState } from "@theme/ApiExplorer/Authorization/slice";
|
|
2
|
+
import { Body } from "@theme/ApiExplorer/Body/slice";
|
|
3
|
+
import { ParameterObject, ServerObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
4
|
+
import sdk from "postman-collection";
|
|
5
|
+
type Param = {
|
|
6
|
+
value?: string | string[];
|
|
7
|
+
} & ParameterObject;
|
|
8
|
+
interface Options {
|
|
9
|
+
server?: ServerObject;
|
|
10
|
+
queryParams: Param[];
|
|
11
|
+
pathParams: Param[];
|
|
12
|
+
cookieParams: Param[];
|
|
13
|
+
headerParams: Param[];
|
|
14
|
+
contentType: string;
|
|
15
|
+
accept: string;
|
|
16
|
+
body: Body;
|
|
17
|
+
auth: AuthState;
|
|
18
|
+
}
|
|
19
|
+
declare function buildPostmanRequest(postman: sdk.Request, { queryParams, pathParams, cookieParams, contentType, accept, headerParams, body, server, auth, }: Options): sdk.Request;
|
|
20
|
+
export default buildPostmanRequest;
|