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,168 @@
|
|
|
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 theme_common_1 = require("@docusaurus/theme-common");
|
|
72
|
+
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
73
|
+
const error_message_1 = require("@hookform/error-message");
|
|
74
|
+
const slice_1 = require("@theme/ApiExplorer/Body/slice");
|
|
75
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
76
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
77
|
+
const react_live_1 = require("react-live");
|
|
78
|
+
function Live({ onEdit, showErrors }) {
|
|
79
|
+
const isBrowser = (0, useIsBrowser_1.default)();
|
|
80
|
+
const [editorDisabled, setEditorDisabled] = (0, react_1.useState)(false);
|
|
81
|
+
return react_1.default.createElement(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
onClick: () => setEditorDisabled(false),
|
|
85
|
+
onBlur: () => setEditorDisabled(true),
|
|
86
|
+
},
|
|
87
|
+
react_1.default.createElement(react_live_1.LiveEditor, {
|
|
88
|
+
key: String(isBrowser),
|
|
89
|
+
className: (0, clsx_1.default)({
|
|
90
|
+
"openapi-explorer__playground-editor": true,
|
|
91
|
+
"openapi-explorer__form-item-input": showErrors,
|
|
92
|
+
error: showErrors,
|
|
93
|
+
}),
|
|
94
|
+
onChange: onEdit,
|
|
95
|
+
disabled: editorDisabled,
|
|
96
|
+
tabMode: "focus",
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
const LiveComponent = (0, react_live_1.withLive)(Live);
|
|
101
|
+
function App({
|
|
102
|
+
children,
|
|
103
|
+
transformCode,
|
|
104
|
+
value,
|
|
105
|
+
language,
|
|
106
|
+
action,
|
|
107
|
+
required: isRequired,
|
|
108
|
+
...props
|
|
109
|
+
}) {
|
|
110
|
+
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
111
|
+
const [code, setCode] = react_1.default.useState(children.replace(/\n$/, ""));
|
|
112
|
+
(0, react_1.useEffect)(() => {
|
|
113
|
+
action((0, slice_1.setStringRawBody)(code));
|
|
114
|
+
}, [action, code]);
|
|
115
|
+
const {
|
|
116
|
+
control,
|
|
117
|
+
formState: { errors },
|
|
118
|
+
} = (0, react_hook_form_1.useFormContext)();
|
|
119
|
+
const showErrorMessage = errors?.requestBody;
|
|
120
|
+
const handleChange = (snippet, onChange) => {
|
|
121
|
+
setCode(snippet);
|
|
122
|
+
onChange(snippet);
|
|
123
|
+
};
|
|
124
|
+
return react_1.default.createElement(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: (0, clsx_1.default)({
|
|
128
|
+
"openapi-explorer__playground-container": true,
|
|
129
|
+
}),
|
|
130
|
+
},
|
|
131
|
+
react_1.default.createElement(
|
|
132
|
+
react_live_1.LiveProvider,
|
|
133
|
+
{
|
|
134
|
+
code: code,
|
|
135
|
+
transformCode: transformCode ?? ((code) => `${code};`),
|
|
136
|
+
theme: prismTheme,
|
|
137
|
+
language: language,
|
|
138
|
+
...props,
|
|
139
|
+
},
|
|
140
|
+
react_1.default.createElement(react_hook_form_1.Controller, {
|
|
141
|
+
control: control,
|
|
142
|
+
rules: {
|
|
143
|
+
required: isRequired && !code ? "This field is required" : false,
|
|
144
|
+
},
|
|
145
|
+
name: "requestBody",
|
|
146
|
+
render: ({ field: { onChange, name } }) =>
|
|
147
|
+
react_1.default.createElement(LiveComponent, {
|
|
148
|
+
onEdit: (e) => handleChange(e, onChange),
|
|
149
|
+
name: name,
|
|
150
|
+
showErrors: showErrorMessage,
|
|
151
|
+
}),
|
|
152
|
+
}),
|
|
153
|
+
showErrorMessage &&
|
|
154
|
+
react_1.default.createElement(error_message_1.ErrorMessage, {
|
|
155
|
+
errors: errors,
|
|
156
|
+
name: "requestBody",
|
|
157
|
+
render: ({ message }) =>
|
|
158
|
+
react_1.default.createElement(
|
|
159
|
+
"div",
|
|
160
|
+
{ className: "openapi-explorer__input-error" },
|
|
161
|
+
message
|
|
162
|
+
),
|
|
163
|
+
})
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const LiveApp = (0, react_live_1.withLive)(App);
|
|
168
|
+
exports.default = LiveApp;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.openapi__method-endpoint {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
padding: 0.65rem;
|
|
7
|
+
border: 1px solid var(--ifm-toc-border-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.openapi__method-endpoint-path {
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
margin-left: 0.5rem;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
font-family: var(--ifm-font-family-monospace);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.openapi__divider {
|
|
19
|
+
width: 100%;
|
|
20
|
+
margin: 1.5rem 0;
|
|
21
|
+
border-bottom: 1px solid var(--ifm-toc-border-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
17
|
+
function colorForMethod(method) {
|
|
18
|
+
switch (method.toLowerCase()) {
|
|
19
|
+
case "get":
|
|
20
|
+
return "primary";
|
|
21
|
+
case "post":
|
|
22
|
+
return "success";
|
|
23
|
+
case "delete":
|
|
24
|
+
return "danger";
|
|
25
|
+
case "put":
|
|
26
|
+
return "info";
|
|
27
|
+
case "patch":
|
|
28
|
+
return "warning";
|
|
29
|
+
case "head":
|
|
30
|
+
return "secondary";
|
|
31
|
+
case "event":
|
|
32
|
+
return "secondary";
|
|
33
|
+
default:
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function MethodEndpoint({ method, path, context }) {
|
|
38
|
+
let serverValue = (0, hooks_1.useTypedSelector)(
|
|
39
|
+
(state) => state.server.value
|
|
40
|
+
);
|
|
41
|
+
let serverUrlWithVariables = "";
|
|
42
|
+
const renderServerUrl = () => {
|
|
43
|
+
if (context === "callback") {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
if (serverValue && serverValue.variables) {
|
|
47
|
+
serverUrlWithVariables = serverValue.url.replace(/\/$/, "");
|
|
48
|
+
Object.keys(serverValue.variables).forEach((variable) => {
|
|
49
|
+
serverUrlWithVariables = serverUrlWithVariables.replace(
|
|
50
|
+
`{${variable}}`,
|
|
51
|
+
serverValue.variables?.[variable].default ?? ""
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return react_1.default.createElement(BrowserOnly_1.default, null, () => {
|
|
56
|
+
if (serverUrlWithVariables.length) {
|
|
57
|
+
return serverUrlWithVariables;
|
|
58
|
+
} else if (serverValue && serverValue.url) {
|
|
59
|
+
return serverValue.url;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
return react_1.default.createElement(
|
|
64
|
+
react_1.default.Fragment,
|
|
65
|
+
null,
|
|
66
|
+
react_1.default.createElement(
|
|
67
|
+
"pre",
|
|
68
|
+
{ className: "openapi__method-endpoint" },
|
|
69
|
+
react_1.default.createElement(
|
|
70
|
+
"span",
|
|
71
|
+
{ className: "badge badge--" + colorForMethod(method) },
|
|
72
|
+
method === "event" ? "Webhook" : method.toUpperCase()
|
|
73
|
+
),
|
|
74
|
+
" ",
|
|
75
|
+
method !== "event" &&
|
|
76
|
+
react_1.default.createElement(
|
|
77
|
+
"h2",
|
|
78
|
+
{ className: "openapi__method-endpoint-path" },
|
|
79
|
+
renderServerUrl(),
|
|
80
|
+
`${path.replace(/{([a-z0-9-_]+)}/gi, ":$1")}`
|
|
81
|
+
)
|
|
82
|
+
),
|
|
83
|
+
react_1.default.createElement("div", { className: "openapi__divider" })
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
exports.default = MethodEndpoint;
|
|
@@ -0,0 +1,220 @@
|
|
|
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
|
+
exports.default = ParamArrayFormItem;
|
|
71
|
+
const react_1 = __importStar(require("react"));
|
|
72
|
+
const error_message_1 = require("@hookform/error-message");
|
|
73
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
74
|
+
const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
75
|
+
const FormTextInput_1 = __importDefault(
|
|
76
|
+
require("@theme/ApiExplorer/FormTextInput")
|
|
77
|
+
);
|
|
78
|
+
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
79
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
80
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
81
|
+
function ArrayItem({ param, onChange, initialValue }) {
|
|
82
|
+
const [value, setValue] = (0, react_1.useState)(initialValue || "");
|
|
83
|
+
if (param.schema?.items?.type === "boolean") {
|
|
84
|
+
return react_1.default.createElement(FormSelect_1.default, {
|
|
85
|
+
options: ["---", "true", "false"],
|
|
86
|
+
onChange: (e) => {
|
|
87
|
+
const val = e.target.value;
|
|
88
|
+
onChange(val === "---" ? undefined : val);
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return react_1.default.createElement(FormTextInput_1.default, {
|
|
93
|
+
placeholder: param.description || param.name,
|
|
94
|
+
value: value,
|
|
95
|
+
onChange: (e) => {
|
|
96
|
+
setValue(e.target.value);
|
|
97
|
+
onChange(e.target.value);
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function ParamArrayFormItem({ param }) {
|
|
102
|
+
const [items, setItems] = (0, react_1.useState)([]);
|
|
103
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
104
|
+
const {
|
|
105
|
+
control,
|
|
106
|
+
formState: { errors },
|
|
107
|
+
} = (0, react_hook_form_1.useFormContext)();
|
|
108
|
+
const showErrorMessage = errors?.paramArray?.message;
|
|
109
|
+
function handleAddItem(e) {
|
|
110
|
+
e.preventDefault(); // prevent form from submitting
|
|
111
|
+
setItems((i) => [
|
|
112
|
+
...i,
|
|
113
|
+
{
|
|
114
|
+
id: (0, toolkit_1.nanoid)(),
|
|
115
|
+
},
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
const values = items.map((item) => item.value).filter((item) => !!item);
|
|
120
|
+
dispatch(
|
|
121
|
+
(0, slice_1.setParam)({
|
|
122
|
+
...param,
|
|
123
|
+
value: values.length > 0 ? values : undefined,
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
127
|
+
}, [items]);
|
|
128
|
+
(0, react_1.useEffect)(() => {
|
|
129
|
+
if (param.schema?.example?.length > 0) {
|
|
130
|
+
const examplesWithIds = param.schema.example.map((item) => ({
|
|
131
|
+
id: (0, toolkit_1.nanoid)(),
|
|
132
|
+
value: item.toString(),
|
|
133
|
+
}));
|
|
134
|
+
setItems(examplesWithIds);
|
|
135
|
+
}
|
|
136
|
+
}, [param.schema.example, param.schema.length]);
|
|
137
|
+
function handleDeleteItem(itemToDelete) {
|
|
138
|
+
return () => {
|
|
139
|
+
const newItems = items.filter((i) => i.id !== itemToDelete.id);
|
|
140
|
+
setItems(newItems);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function handleChangeItem(itemToUpdate, onChange) {
|
|
144
|
+
return (value) => {
|
|
145
|
+
const newItems = items.map((i) => {
|
|
146
|
+
if (i.id === itemToUpdate.id) {
|
|
147
|
+
return { ...i, value: value };
|
|
148
|
+
}
|
|
149
|
+
return i;
|
|
150
|
+
});
|
|
151
|
+
setItems(newItems);
|
|
152
|
+
onChange(newItems);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return react_1.default.createElement(
|
|
156
|
+
react_1.default.Fragment,
|
|
157
|
+
null,
|
|
158
|
+
react_1.default.createElement(react_hook_form_1.Controller, {
|
|
159
|
+
control: control,
|
|
160
|
+
rules: { required: param.required ? "This field is required" : false },
|
|
161
|
+
name: "paramArray",
|
|
162
|
+
render: ({ field: { onChange, name } }) =>
|
|
163
|
+
react_1.default.createElement(
|
|
164
|
+
react_1.default.Fragment,
|
|
165
|
+
null,
|
|
166
|
+
items.map((item) =>
|
|
167
|
+
react_1.default.createElement(
|
|
168
|
+
"div",
|
|
169
|
+
{ key: item.id, style: { display: "flex" } },
|
|
170
|
+
react_1.default.createElement(ArrayItem, {
|
|
171
|
+
param: param,
|
|
172
|
+
onChange: handleChangeItem(item, onChange),
|
|
173
|
+
initialValue: item.value,
|
|
174
|
+
}),
|
|
175
|
+
react_1.default.createElement(
|
|
176
|
+
"button",
|
|
177
|
+
{
|
|
178
|
+
className: "openapi-explorer__delete-btn",
|
|
179
|
+
onClick: handleDeleteItem(item),
|
|
180
|
+
},
|
|
181
|
+
react_1.default.createElement(
|
|
182
|
+
"svg",
|
|
183
|
+
{
|
|
184
|
+
focusable: "false",
|
|
185
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
186
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
187
|
+
fill: "currentColor",
|
|
188
|
+
width: "16",
|
|
189
|
+
height: "16",
|
|
190
|
+
viewBox: "0 0 32 32",
|
|
191
|
+
"aria-hidden": "true",
|
|
192
|
+
},
|
|
193
|
+
react_1.default.createElement("path", {
|
|
194
|
+
d: "M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z",
|
|
195
|
+
}),
|
|
196
|
+
react_1.default.createElement("title", null, "Delete")
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
)
|
|
200
|
+
),
|
|
201
|
+
react_1.default.createElement(
|
|
202
|
+
"button",
|
|
203
|
+
{ className: "openapi-explorer__thin-btn", onClick: handleAddItem },
|
|
204
|
+
"Add item"
|
|
205
|
+
)
|
|
206
|
+
),
|
|
207
|
+
}),
|
|
208
|
+
showErrorMessage &&
|
|
209
|
+
react_1.default.createElement(error_message_1.ErrorMessage, {
|
|
210
|
+
errors: errors,
|
|
211
|
+
name: "paramArray",
|
|
212
|
+
render: ({ message }) =>
|
|
213
|
+
react_1.default.createElement(
|
|
214
|
+
"div",
|
|
215
|
+
{ className: "openapi-explorer__input-error" },
|
|
216
|
+
message
|
|
217
|
+
),
|
|
218
|
+
})
|
|
219
|
+
);
|
|
220
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
exports.default = ParamBooleanFormItem;
|
|
15
|
+
const react_1 = __importDefault(require("react"));
|
|
16
|
+
const error_message_1 = require("@hookform/error-message");
|
|
17
|
+
const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
18
|
+
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
19
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
20
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
21
|
+
function ParamBooleanFormItem({ param }) {
|
|
22
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
23
|
+
const {
|
|
24
|
+
control,
|
|
25
|
+
formState: { errors },
|
|
26
|
+
} = (0, react_hook_form_1.useFormContext)();
|
|
27
|
+
const showErrorMessage = errors?.paramBoolean;
|
|
28
|
+
return react_1.default.createElement(
|
|
29
|
+
react_1.default.Fragment,
|
|
30
|
+
null,
|
|
31
|
+
react_1.default.createElement(react_hook_form_1.Controller, {
|
|
32
|
+
control: control,
|
|
33
|
+
rules: { required: param.required ? "This field is required" : false },
|
|
34
|
+
name: "paramBoolean",
|
|
35
|
+
render: ({ field: { onChange, name } }) =>
|
|
36
|
+
react_1.default.createElement(FormSelect_1.default, {
|
|
37
|
+
name: name,
|
|
38
|
+
options: ["---", "true", "false"],
|
|
39
|
+
onChange: (e) => {
|
|
40
|
+
const val = e.target.value;
|
|
41
|
+
dispatch(
|
|
42
|
+
(0, slice_1.setParam)({
|
|
43
|
+
...param,
|
|
44
|
+
value: val === "---" ? undefined : val,
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
onChange(val);
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
}),
|
|
51
|
+
showErrorMessage &&
|
|
52
|
+
react_1.default.createElement(error_message_1.ErrorMessage, {
|
|
53
|
+
errors: errors,
|
|
54
|
+
name: "paramBoolean",
|
|
55
|
+
render: ({ message }) =>
|
|
56
|
+
react_1.default.createElement(
|
|
57
|
+
"div",
|
|
58
|
+
{ className: "openapi-explorer__input-error" },
|
|
59
|
+
message
|
|
60
|
+
),
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
exports.default = ParamMultiSelectFormItem;
|
|
15
|
+
const react_1 = __importDefault(require("react"));
|
|
16
|
+
const error_message_1 = require("@hookform/error-message");
|
|
17
|
+
const FormMultiSelect_1 = __importDefault(
|
|
18
|
+
require("@theme/ApiExplorer/FormMultiSelect")
|
|
19
|
+
);
|
|
20
|
+
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
21
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
22
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
23
|
+
function ParamMultiSelectFormItem({ param }) {
|
|
24
|
+
const {
|
|
25
|
+
control,
|
|
26
|
+
formState: { errors },
|
|
27
|
+
} = (0, react_hook_form_1.useFormContext)();
|
|
28
|
+
const showErrorMessage = errors?.paramMultiSelect;
|
|
29
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
30
|
+
const options = param.schema?.items?.enum ?? [];
|
|
31
|
+
const pathParams = (0, hooks_1.useTypedSelector)(
|
|
32
|
+
(state) => state.params.path
|
|
33
|
+
);
|
|
34
|
+
const queryParams = (0, hooks_1.useTypedSelector)(
|
|
35
|
+
(state) => state.params.query
|
|
36
|
+
);
|
|
37
|
+
const cookieParams = (0, hooks_1.useTypedSelector)(
|
|
38
|
+
(state) => state.params.cookie
|
|
39
|
+
);
|
|
40
|
+
const headerParams = (0, hooks_1.useTypedSelector)(
|
|
41
|
+
(state) => state.params.header
|
|
42
|
+
);
|
|
43
|
+
const paramTypeToWatch = pathParams.length
|
|
44
|
+
? pathParams
|
|
45
|
+
: queryParams.length
|
|
46
|
+
? queryParams
|
|
47
|
+
: cookieParams.length
|
|
48
|
+
? cookieParams
|
|
49
|
+
: headerParams;
|
|
50
|
+
const handleChange = (e, onChange) => {
|
|
51
|
+
const values = Array.prototype.filter
|
|
52
|
+
.call(e.target.options, (o) => o.selected)
|
|
53
|
+
.map((o) => o.value);
|
|
54
|
+
dispatch(
|
|
55
|
+
(0, slice_1.setParam)({
|
|
56
|
+
...param,
|
|
57
|
+
value: values.length > 0 ? values : undefined,
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
onChange(paramTypeToWatch);
|
|
61
|
+
};
|
|
62
|
+
return react_1.default.createElement(
|
|
63
|
+
react_1.default.Fragment,
|
|
64
|
+
null,
|
|
65
|
+
react_1.default.createElement(react_hook_form_1.Controller, {
|
|
66
|
+
control: control,
|
|
67
|
+
rules: { required: param.required ? "This field is required" : false },
|
|
68
|
+
name: "paramMultiSelect",
|
|
69
|
+
render: ({ field: { onChange, name } }) =>
|
|
70
|
+
react_1.default.createElement(FormMultiSelect_1.default, {
|
|
71
|
+
options: options,
|
|
72
|
+
name: name,
|
|
73
|
+
onChange: (e) => handleChange(e, onChange),
|
|
74
|
+
showErrors: showErrorMessage,
|
|
75
|
+
}),
|
|
76
|
+
}),
|
|
77
|
+
showErrorMessage &&
|
|
78
|
+
react_1.default.createElement(error_message_1.ErrorMessage, {
|
|
79
|
+
errors: errors,
|
|
80
|
+
name: "paramMultiSelect",
|
|
81
|
+
render: ({ message }) =>
|
|
82
|
+
react_1.default.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{ className: "openapi-explorer__input-error" },
|
|
85
|
+
message
|
|
86
|
+
),
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
}
|