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,64 @@
|
|
|
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
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import { ErrorMessage } from "@hookform/error-message";
|
|
11
|
+
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
12
|
+
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
13
|
+
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
14
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
15
|
+
|
|
16
|
+
export interface ParamProps {
|
|
17
|
+
param: Param;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function ParamBooleanFormItem({ param }: ParamProps) {
|
|
21
|
+
const dispatch = useTypedDispatch();
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
control,
|
|
25
|
+
formState: { errors },
|
|
26
|
+
} = useFormContext();
|
|
27
|
+
|
|
28
|
+
const showErrorMessage = errors?.paramBoolean;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<Controller
|
|
33
|
+
control={control}
|
|
34
|
+
rules={{ required: param.required ? "This field is required" : false }}
|
|
35
|
+
name="paramBoolean"
|
|
36
|
+
render={({ field: { onChange, name } }) => (
|
|
37
|
+
<FormSelect
|
|
38
|
+
name={name}
|
|
39
|
+
options={["---", "true", "false"]}
|
|
40
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
41
|
+
const val = e.target.value;
|
|
42
|
+
dispatch(
|
|
43
|
+
setParam({
|
|
44
|
+
...param,
|
|
45
|
+
value: val === "---" ? undefined : val,
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
onChange(val);
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
/>
|
|
53
|
+
{showErrorMessage && (
|
|
54
|
+
<ErrorMessage
|
|
55
|
+
errors={errors}
|
|
56
|
+
name="paramBoolean"
|
|
57
|
+
render={({ message }) => (
|
|
58
|
+
<div className="openapi-explorer__input-error">{message}</div>
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import { ErrorMessage } from "@hookform/error-message";
|
|
11
|
+
import FormMultiSelect from "@theme/ApiExplorer/FormMultiSelect";
|
|
12
|
+
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
13
|
+
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
14
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
15
|
+
|
|
16
|
+
export interface ParamProps {
|
|
17
|
+
param: Param;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function ParamMultiSelectFormItem({ param }: ParamProps) {
|
|
21
|
+
const {
|
|
22
|
+
control,
|
|
23
|
+
formState: { errors },
|
|
24
|
+
} = useFormContext();
|
|
25
|
+
|
|
26
|
+
const showErrorMessage = errors?.paramMultiSelect;
|
|
27
|
+
|
|
28
|
+
const dispatch = useTypedDispatch();
|
|
29
|
+
|
|
30
|
+
const options = param.schema?.items?.enum ?? [];
|
|
31
|
+
|
|
32
|
+
const pathParams = useTypedSelector((state: any) => state.params.path);
|
|
33
|
+
const queryParams = useTypedSelector((state: any) => state.params.query);
|
|
34
|
+
const cookieParams = useTypedSelector((state: any) => state.params.cookie);
|
|
35
|
+
const headerParams = useTypedSelector((state: any) => state.params.header);
|
|
36
|
+
|
|
37
|
+
const paramTypeToWatch = pathParams.length
|
|
38
|
+
? pathParams
|
|
39
|
+
: queryParams.length
|
|
40
|
+
? queryParams
|
|
41
|
+
: cookieParams.length
|
|
42
|
+
? cookieParams
|
|
43
|
+
: headerParams;
|
|
44
|
+
|
|
45
|
+
const handleChange = (e: any, onChange: any) => {
|
|
46
|
+
const values = Array.prototype.filter
|
|
47
|
+
.call(e.target.options, (o) => o.selected)
|
|
48
|
+
.map((o) => o.value);
|
|
49
|
+
|
|
50
|
+
dispatch(
|
|
51
|
+
setParam({
|
|
52
|
+
...param,
|
|
53
|
+
value: values.length > 0 ? values : undefined,
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
onChange(paramTypeToWatch);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<Controller
|
|
63
|
+
control={control}
|
|
64
|
+
rules={{ required: param.required ? "This field is required" : false }}
|
|
65
|
+
name="paramMultiSelect"
|
|
66
|
+
render={({ field: { onChange, name } }) => (
|
|
67
|
+
<FormMultiSelect
|
|
68
|
+
options={options as string[]}
|
|
69
|
+
name={name}
|
|
70
|
+
onChange={(e: any) => handleChange(e, onChange)}
|
|
71
|
+
showErrors={showErrorMessage}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
/>
|
|
75
|
+
{showErrorMessage && (
|
|
76
|
+
<ErrorMessage
|
|
77
|
+
errors={errors}
|
|
78
|
+
name="paramMultiSelect"
|
|
79
|
+
render={({ message }) => (
|
|
80
|
+
<div className="openapi-explorer__input-error">{message}</div>
|
|
81
|
+
)}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import { ErrorMessage } from "@hookform/error-message";
|
|
11
|
+
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
12
|
+
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
13
|
+
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
14
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
15
|
+
|
|
16
|
+
export interface ParamProps {
|
|
17
|
+
param: Param;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function ParamSelectFormItem({ param }: ParamProps) {
|
|
21
|
+
const {
|
|
22
|
+
control,
|
|
23
|
+
formState: { errors },
|
|
24
|
+
} = useFormContext();
|
|
25
|
+
|
|
26
|
+
const showErrorMessage = errors?.paramSelect;
|
|
27
|
+
|
|
28
|
+
const dispatch = useTypedDispatch();
|
|
29
|
+
|
|
30
|
+
const options = param.schema?.enum ?? [];
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Controller
|
|
35
|
+
control={control}
|
|
36
|
+
rules={{ required: param.required ? "This field is required" : false }}
|
|
37
|
+
name="paramSelect"
|
|
38
|
+
render={({ field: { onChange, name } }) => (
|
|
39
|
+
<FormSelect
|
|
40
|
+
options={["---", ...(options as string[])]}
|
|
41
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
42
|
+
const val = e.target.value;
|
|
43
|
+
dispatch(
|
|
44
|
+
setParam({
|
|
45
|
+
...param,
|
|
46
|
+
value: val === "---" ? undefined : val,
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
onChange(val);
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
/>
|
|
54
|
+
{showErrorMessage && (
|
|
55
|
+
<ErrorMessage
|
|
56
|
+
errors={errors}
|
|
57
|
+
name="paramSelect"
|
|
58
|
+
render={({ message }) => (
|
|
59
|
+
<div className="openapi-explorer__input-error">{message}</div>
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
11
|
+
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
12
|
+
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
13
|
+
|
|
14
|
+
export interface ParamProps {
|
|
15
|
+
param: Param;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function ParamTextFormItem({ param }: ParamProps) {
|
|
19
|
+
const dispatch = useTypedDispatch();
|
|
20
|
+
return (
|
|
21
|
+
<FormTextInput
|
|
22
|
+
isRequired={param.required}
|
|
23
|
+
paramName={param.name}
|
|
24
|
+
placeholder={param.description || param.name}
|
|
25
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
26
|
+
dispatch(
|
|
27
|
+
setParam({
|
|
28
|
+
...param,
|
|
29
|
+
value:
|
|
30
|
+
param.in === "path" || param.in === "query"
|
|
31
|
+
? e.target.value.replace(/\s/g, "%20")
|
|
32
|
+
: e.target.value,
|
|
33
|
+
})
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
.openapi-explorer__plus-btn--expanded {
|
|
2
|
+
transition: transform 0.2s ease;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
transform: rotate(0deg);
|
|
5
|
+
transform-origin: center;
|
|
6
|
+
margin-right: 6px;
|
|
7
|
+
transform: rotate(45deg);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.openapi-explorer__show-more-btn {
|
|
11
|
+
width: 100%;
|
|
12
|
+
-webkit-appearance: none;
|
|
13
|
+
-moz-appearance: none;
|
|
14
|
+
appearance: none;
|
|
15
|
+
margin-left: 0.25rem;
|
|
16
|
+
margin-bottom: 0.5rem;
|
|
17
|
+
padding: 0;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
font-size: var(--openapi-explorer-font-size-input);
|
|
20
|
+
user-select: none;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
border: 0px solid transparent;
|
|
23
|
+
display: block;
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
color: var(--ifm-color-primary);
|
|
26
|
+
text-align: left;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
color: var(--ifm-color-primary-hover);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:first-child {
|
|
33
|
+
margin-top: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.openapi-explorer__delete-btn {
|
|
38
|
+
-webkit-appearance: none;
|
|
39
|
+
-moz-appearance: none;
|
|
40
|
+
appearance: none;
|
|
41
|
+
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
font-size: calc(0.875rem * var(--ifm-button-size-multiplier));
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
line-height: 1.5;
|
|
46
|
+
|
|
47
|
+
transition-property: color, background, border-color, box-shadow;
|
|
48
|
+
transition-duration:
|
|
49
|
+
100ms, 100ms, 100ms, var(--ifm-button-transition-duration);
|
|
50
|
+
transition-timing-function: cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
51
|
+
|
|
52
|
+
-webkit-user-select: none;
|
|
53
|
+
user-select: none;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
|
|
56
|
+
display: flex;
|
|
57
|
+
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
|
|
61
|
+
padding: 0 12px;
|
|
62
|
+
|
|
63
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
64
|
+
background-color: var(--openapi-input-background);
|
|
65
|
+
border: none;
|
|
66
|
+
outline: none;
|
|
67
|
+
color: var(--ifm-pre-color);
|
|
68
|
+
border-radius: 4px;
|
|
69
|
+
margin-left: 4px;
|
|
70
|
+
|
|
71
|
+
&:focus {
|
|
72
|
+
outline: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:active {
|
|
76
|
+
box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.openapi-explorer__thin-btn {
|
|
81
|
+
-webkit-appearance: none;
|
|
82
|
+
-moz-appearance: none;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
padding: 0.5rem 1rem;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
transition-property: color, background, border-color, box-shadow;
|
|
88
|
+
transition-duration:
|
|
89
|
+
100ms, 100ms, 100ms, var(--ifm-button-transition-duration);
|
|
90
|
+
transition-timing-function: cubic-bezier(0.08, 0.52, 0.52, 1);
|
|
91
|
+
user-select: none;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
color: var(--openapi-input-border);
|
|
95
|
+
border: 1px solid var(--openapi-input-border);
|
|
96
|
+
border-radius: var(--ifm-pre-border-radius);
|
|
97
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
98
|
+
text-transform: uppercase;
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
color: var(--openapi-inverse-color);
|
|
102
|
+
background-color: var(--openapi-input-border);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:focus {
|
|
106
|
+
outline: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:active {
|
|
110
|
+
box-shadow:
|
|
111
|
+
inset 0 0 0 1px var(--openapi-input-border),
|
|
112
|
+
inset 0 0 0 2px var(--openapi-inverse-color);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.openapi-explorer__show-options {
|
|
117
|
+
visibility: visible;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.openapi-explorer__hide-options {
|
|
121
|
+
display: none;
|
|
122
|
+
visibility: hidden;
|
|
123
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
import React, { useState } from "react";
|
|
9
|
+
|
|
10
|
+
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
11
|
+
import ParamArrayFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem";
|
|
12
|
+
import ParamBooleanFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem";
|
|
13
|
+
import ParamMultiSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem";
|
|
14
|
+
import ParamSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem";
|
|
15
|
+
import ParamTextFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem";
|
|
16
|
+
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
17
|
+
|
|
18
|
+
import { Param } from "./slice";
|
|
19
|
+
|
|
20
|
+
export interface ParamProps {
|
|
21
|
+
param: Param;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ParamOption({ param }: ParamProps) {
|
|
25
|
+
if (param.schema?.type === "array" && param.schema.items?.enum) {
|
|
26
|
+
return <ParamMultiSelectFormItem param={param} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (param.schema?.type === "array") {
|
|
30
|
+
return <ParamArrayFormItem param={param} />;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (param.schema?.enum) {
|
|
34
|
+
return <ParamSelectFormItem param={param} />;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (param.schema?.type === "boolean") {
|
|
38
|
+
return <ParamBooleanFormItem param={param} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// integer, number, string, int32, int64, float, double, object, byte, binary,
|
|
42
|
+
// date-time, date, password
|
|
43
|
+
return <ParamTextFormItem param={param} />;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function ParamOptionWrapper({ param }: ParamProps) {
|
|
47
|
+
return (
|
|
48
|
+
<FormItem label={param.name} type={param.in} required={param.required}>
|
|
49
|
+
<ParamOption param={param} />
|
|
50
|
+
</FormItem>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ParamOptions() {
|
|
55
|
+
const [showOptional, setShowOptional] = useState(false);
|
|
56
|
+
|
|
57
|
+
const pathParams = useTypedSelector((state: any) => state.params.path);
|
|
58
|
+
const queryParams = useTypedSelector((state: any) => state.params.query);
|
|
59
|
+
const cookieParams = useTypedSelector((state: any) => state.params.cookie);
|
|
60
|
+
const headerParams = useTypedSelector((state: any) => state.params.header);
|
|
61
|
+
|
|
62
|
+
const allParams = [
|
|
63
|
+
...pathParams,
|
|
64
|
+
...queryParams,
|
|
65
|
+
...cookieParams,
|
|
66
|
+
...headerParams,
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const requiredParams = allParams.filter((p) => p.required);
|
|
70
|
+
const optionalParams = allParams.filter((p) => !p.required);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{/* Required Parameters */}
|
|
75
|
+
{requiredParams.map((param) => (
|
|
76
|
+
<ParamOptionWrapper key={`${param.in}-${param.name}`} param={param} />
|
|
77
|
+
))}
|
|
78
|
+
|
|
79
|
+
{/* Optional Parameters */}
|
|
80
|
+
{optionalParams.length > 0 && (
|
|
81
|
+
<>
|
|
82
|
+
<button
|
|
83
|
+
type="button"
|
|
84
|
+
className="openapi-explorer__show-more-btn"
|
|
85
|
+
onClick={() => setShowOptional((prev) => !prev)}
|
|
86
|
+
>
|
|
87
|
+
<span
|
|
88
|
+
style={{
|
|
89
|
+
width: "1.5em",
|
|
90
|
+
display: "inline-block",
|
|
91
|
+
textAlign: "center",
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<span
|
|
95
|
+
className={
|
|
96
|
+
showOptional
|
|
97
|
+
? "openapi-explorer__plus-btn--expanded"
|
|
98
|
+
: "openapi-explorer__plus-btn"
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
<div>
|
|
102
|
+
<svg
|
|
103
|
+
style={{
|
|
104
|
+
fill: "currentColor",
|
|
105
|
+
width: "10px",
|
|
106
|
+
height: "10px",
|
|
107
|
+
}}
|
|
108
|
+
height="16"
|
|
109
|
+
viewBox="0 0 16 16"
|
|
110
|
+
width="16"
|
|
111
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
112
|
+
>
|
|
113
|
+
<path
|
|
114
|
+
d="M9 7h6a1 1 0 0 1 0 2H9v6a1 1 0 0 1-2 0V9H1a1 1 0 1 1 0-2h6V1a1 1 0 1 1 2 0z"
|
|
115
|
+
fillRule="evenodd"
|
|
116
|
+
></path>
|
|
117
|
+
</svg>
|
|
118
|
+
</div>
|
|
119
|
+
</span>
|
|
120
|
+
</span>
|
|
121
|
+
{showOptional
|
|
122
|
+
? "Hide optional parameters"
|
|
123
|
+
: "Show optional parameters"}
|
|
124
|
+
</button>
|
|
125
|
+
|
|
126
|
+
<div
|
|
127
|
+
className={
|
|
128
|
+
showOptional
|
|
129
|
+
? "openapi-explorer__show-options"
|
|
130
|
+
: "openapi-explorer__hide-options"
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
{optionalParams.map((param) => (
|
|
134
|
+
<ParamOptionWrapper
|
|
135
|
+
key={`${param.in}-${param.name}`}
|
|
136
|
+
param={param}
|
|
137
|
+
/>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
</>
|
|
141
|
+
)}
|
|
142
|
+
</>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export default ParamOptions;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
|
9
|
+
import { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
10
|
+
|
|
11
|
+
export type Param = ParameterObject & { value?: string[] | string };
|
|
12
|
+
|
|
13
|
+
export interface State {
|
|
14
|
+
path: Param[];
|
|
15
|
+
query: Param[];
|
|
16
|
+
header: Param[];
|
|
17
|
+
cookie: Param[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const initialState: State = {} as any;
|
|
21
|
+
|
|
22
|
+
export const slice = createSlice({
|
|
23
|
+
name: "params",
|
|
24
|
+
initialState,
|
|
25
|
+
reducers: {
|
|
26
|
+
setParam: (state, action: PayloadAction<Param>) => {
|
|
27
|
+
const newParam = action.payload;
|
|
28
|
+
const paramGroup = state[action.payload.in];
|
|
29
|
+
const index = paramGroup.findIndex((p) => p.name === newParam.name);
|
|
30
|
+
paramGroup[index] = newParam;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const { setParam } = slice.actions;
|
|
36
|
+
|
|
37
|
+
export default slice.reducer;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
.openapi-explorer__request-form {
|
|
2
|
+
background-color: var(--ifm-pre-background);
|
|
3
|
+
border-radius: var(--openapi-card-border-radius);
|
|
4
|
+
border: 1px solid var(--openapi-explorer-border-color);
|
|
5
|
+
box-shadow:
|
|
6
|
+
0 2px 3px hsla(222, 8%, 43%, 0.1),
|
|
7
|
+
0 8px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
8
|
+
color: var(--ifm-pre-color);
|
|
9
|
+
line-height: var(--ifm-pre-line-height);
|
|
10
|
+
margin-bottom: var(--ifm-spacing-vertical);
|
|
11
|
+
margin-top: 0;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
transition: 300ms;
|
|
14
|
+
|
|
15
|
+
/* hack for view calculation when monaco is hidden */
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
&:empty {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
box-shadow:
|
|
24
|
+
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
25
|
+
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
26
|
+
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.required {
|
|
30
|
+
font-size: var(--ifm-code-font-size);
|
|
31
|
+
color: var(--openapi-required);
|
|
32
|
+
|
|
33
|
+
&.request-body {
|
|
34
|
+
padding-left: 0.25rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.openapi-explorer__request-header-container {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
border-bottom: 1px solid var(--openapi-explorer-border-color);
|
|
43
|
+
margin: 0;
|
|
44
|
+
padding: 0.75rem var(--ifm-pre-padding);
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.openapi-explorer__expand-details-btn {
|
|
51
|
+
&:hover {
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.openapi-explorer__details-outer-container {
|
|
57
|
+
padding: 1rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.openapi-explorer__details-container[open] {
|
|
61
|
+
.openapi-explorer__details-summary::before {
|
|
62
|
+
transform: rotate(180deg);
|
|
63
|
+
margin-top: 0.25rem;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.openapi-explorer__details-summary {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
padding: 0.35rem 0;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
list-style: none;
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&::-webkit-details-marker {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&::before {
|
|
83
|
+
margin-right: 0.25rem;
|
|
84
|
+
margin-bottom: 0.25rem;
|
|
85
|
+
margin-top: 0.25rem;
|
|
86
|
+
background-image: var(--openapi-explorer-caret-bg);
|
|
87
|
+
border: none !important;
|
|
88
|
+
transform: rotate(90deg);
|
|
89
|
+
content: "";
|
|
90
|
+
height: 1rem;
|
|
91
|
+
width: 1rem;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.openapi-explorer__request-btn {
|
|
96
|
+
border: none;
|
|
97
|
+
border-radius: var(--ifm-global-radius);
|
|
98
|
+
padding: 0.5rem 1rem;
|
|
99
|
+
margin-top: 1rem;
|
|
100
|
+
background-color: var(--ifm-color-primary-light);
|
|
101
|
+
text-transform: uppercase;
|
|
102
|
+
font-weight: bold;
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
color: white;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
transition: 300ms;
|
|
107
|
+
|
|
108
|
+
&:hover {
|
|
109
|
+
background-color: var(--ifm-color-primary-lightest);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:active {
|
|
113
|
+
background-color: var(--ifm-color-primary-light);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.openapi-security__summary-container {
|
|
118
|
+
background: var(--ifm-pre-background);
|
|
119
|
+
border-radius: var(--ifm-pre-border-radius);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Prevent auto zoom on mobile iOS devices when focusing on input elmenents
|
|
123
|
+
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-device-width: 1024px) {
|
|
124
|
+
.prism-code,
|
|
125
|
+
select,
|
|
126
|
+
input {
|
|
127
|
+
font-size: 1rem;
|
|
128
|
+
}
|
|
129
|
+
}
|