@camunda8/docusaurus-theme-openapi-docs 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +154 -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 +7 -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 +201 -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 +394 -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 +11 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +435 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +133 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +283 -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 +178 -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 +49 -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 +11 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +80 -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 +176 -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 +230 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +71 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +97 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +72 -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 +233 -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 +443 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.js +223 -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 +207 -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 +519 -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 +213 -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 +511 -0
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +107 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +19 -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 +58 -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 +275 -0
- package/lib/theme/ArrayBrackets/index.d.ts +3 -0
- package/lib/theme/ArrayBrackets/index.js +50 -0
- package/lib/theme/CodeSamples/_CodeSamples.scss +3 -0
- package/lib/theme/CodeSamples/index.d.ts +8 -0
- package/lib/theme/CodeSamples/index.js +27 -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 +93 -0
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.d.ts +22 -0
- package/lib/theme/ParamsItem/index.js +281 -0
- package/lib/theme/RequestSchema/index.d.ts +15 -0
- package/lib/theme/RequestSchema/index.js +208 -0
- package/lib/theme/ResponseExamples/index.d.ts +18 -0
- package/lib/theme/ResponseExamples/index.js +213 -0
- package/lib/theme/ResponseHeaders/index.d.ts +13 -0
- package/lib/theme/ResponseHeaders/index.js +39 -0
- package/lib/theme/ResponseSchema/index.d.ts +15 -0
- package/lib/theme/ResponseSchema/index.js +165 -0
- package/lib/theme/Schema/index.d.ts +8 -0
- package/lib/theme/Schema/index.js +853 -0
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +314 -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 +90 -0
- package/lib/theme/styles.scss +215 -0
- package/lib/theme/translationIds.d.ts +83 -0
- package/lib/theme/translationIds.js +106 -0
- package/lib/types.d.ts +46 -0
- package/lib/types.js +8 -0
- package/package.json +85 -0
- package/src/index.ts +85 -0
- package/src/markdown/createDescription.ts +13 -0
- package/src/markdown/schema.ts +186 -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 +83 -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 +199 -0
- package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
- package/src/theme/ApiExplorer/Body/index.tsx +388 -0
- package/src/theme/ApiExplorer/Body/json2xml.d.ts +8 -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 +383 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +139 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +505 -0
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +261 -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 +124 -0
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/ApiExplorer/FormItem/index.tsx +40 -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 +89 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +122 -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 +185 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +72 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +94 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +74 -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 +154 -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 +352 -0
- package/src/theme/ApiExplorer/Request/makeRequest.ts +255 -0
- package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/src/theme/ApiExplorer/Response/index.tsx +173 -0
- package/src/theme/ApiExplorer/Response/slice.ts +52 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +375 -0
- package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/src/theme/ApiExplorer/Server/index.tsx +138 -0
- package/src/theme/ApiExplorer/Server/slice.ts +39 -0
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +524 -0
- package/src/theme/ApiExplorer/index.tsx +52 -0
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +73 -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 +243 -0
- package/src/theme/ArrayBrackets/index.tsx +37 -0
- package/src/theme/CodeSamples/_CodeSamples.scss +3 -0
- package/src/theme/CodeSamples/index.tsx +26 -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.d.ts +8 -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 +90 -0
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.tsx +246 -0
- package/src/theme/RequestSchema/index.tsx +172 -0
- package/src/theme/ResponseExamples/index.tsx +209 -0
- package/src/theme/ResponseHeaders/index.tsx +49 -0
- package/src/theme/ResponseSchema/index.tsx +150 -0
- package/src/theme/Schema/index.tsx +938 -0
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.tsx +273 -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 +83 -0
- package/src/theme/styles.scss +215 -0
- package/src/theme/translationIds.ts +103 -0
- package/src/theme-classic.d.ts +80 -0
- package/src/theme-openapi.d.ts +20 -0
- package/src/types.ts +72 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,223 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
function fetchWithtimeout(url, options, timeout = 5000) {
|
|
10
|
+
return Promise.race([
|
|
11
|
+
fetch(url, options),
|
|
12
|
+
new Promise((_, reject) =>
|
|
13
|
+
setTimeout(() => reject(new Error("Request timed out")), timeout)
|
|
14
|
+
),
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
async function loadImage(content) {
|
|
18
|
+
return new Promise((accept, reject) => {
|
|
19
|
+
const reader = new FileReader();
|
|
20
|
+
reader.onabort = () => {
|
|
21
|
+
console.log("file reading was aborted");
|
|
22
|
+
reject();
|
|
23
|
+
};
|
|
24
|
+
reader.onerror = () => {
|
|
25
|
+
console.log("file reading has failed");
|
|
26
|
+
reject();
|
|
27
|
+
};
|
|
28
|
+
reader.onload = () => {
|
|
29
|
+
// Do whatever you want with the file contents
|
|
30
|
+
const binaryStr = reader.result;
|
|
31
|
+
accept(binaryStr);
|
|
32
|
+
};
|
|
33
|
+
reader.readAsArrayBuffer(content);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function makeRequest(request, proxy, _body) {
|
|
37
|
+
const headers = request.toJSON().header;
|
|
38
|
+
let myHeaders = new Headers();
|
|
39
|
+
if (headers) {
|
|
40
|
+
headers.forEach((header) => {
|
|
41
|
+
if (header.key && header.value) {
|
|
42
|
+
myHeaders.append(header.key, header.value);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// The following code handles multiple files in the same formdata param.
|
|
47
|
+
// It removes the form data params where the src property is an array of filepath strings
|
|
48
|
+
// Splits that array into different form data params with src set as a single filepath string
|
|
49
|
+
// TODO:
|
|
50
|
+
// if (request.body && request.body.mode === 'formdata') {
|
|
51
|
+
// let formdata = request.body.formdata,
|
|
52
|
+
// formdataArray = [];
|
|
53
|
+
// formdata.members.forEach((param) => {
|
|
54
|
+
// let key = param.key,
|
|
55
|
+
// type = param.type,
|
|
56
|
+
// disabled = param.disabled,
|
|
57
|
+
// contentType = param.contentType;
|
|
58
|
+
// // check if type is file or text
|
|
59
|
+
// if (type === 'file') {
|
|
60
|
+
// // if src is not of type string we check for array(multiple files)
|
|
61
|
+
// if (typeof param.src !== 'string') {
|
|
62
|
+
// // if src is an array(not empty), iterate over it and add files as separate form fields
|
|
63
|
+
// if (Array.isArray(param.src) && param.src.length) {
|
|
64
|
+
// param.src.forEach((filePath) => {
|
|
65
|
+
// addFormParam(
|
|
66
|
+
// formdataArray,
|
|
67
|
+
// key,
|
|
68
|
+
// param.type,
|
|
69
|
+
// filePath,
|
|
70
|
+
// disabled,
|
|
71
|
+
// contentType
|
|
72
|
+
// );
|
|
73
|
+
// });
|
|
74
|
+
// }
|
|
75
|
+
// // if src is not an array or string, or is an empty array, add a placeholder for file path(no files case)
|
|
76
|
+
// else {
|
|
77
|
+
// addFormParam(
|
|
78
|
+
// formdataArray,
|
|
79
|
+
// key,
|
|
80
|
+
// param.type,
|
|
81
|
+
// '/path/to/file',
|
|
82
|
+
// disabled,
|
|
83
|
+
// contentType
|
|
84
|
+
// );
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
87
|
+
// // if src is string, directly add the param with src as filepath
|
|
88
|
+
// else {
|
|
89
|
+
// addFormParam(
|
|
90
|
+
// formdataArray,
|
|
91
|
+
// key,
|
|
92
|
+
// param.type,
|
|
93
|
+
// param.src,
|
|
94
|
+
// disabled,
|
|
95
|
+
// contentType
|
|
96
|
+
// );
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
99
|
+
// // if type is text, directly add it to formdata array
|
|
100
|
+
// else {
|
|
101
|
+
// addFormParam(
|
|
102
|
+
// formdataArray,
|
|
103
|
+
// key,
|
|
104
|
+
// param.type,
|
|
105
|
+
// param.value,
|
|
106
|
+
// disabled,
|
|
107
|
+
// contentType
|
|
108
|
+
// );
|
|
109
|
+
// }
|
|
110
|
+
// });
|
|
111
|
+
// request.body.update({
|
|
112
|
+
// mode: 'formdata',
|
|
113
|
+
// formdata: formdataArray,
|
|
114
|
+
// });
|
|
115
|
+
// }
|
|
116
|
+
const body = request.body?.toJSON();
|
|
117
|
+
let myBody = undefined;
|
|
118
|
+
if (body !== undefined && Object.keys(body).length > 0) {
|
|
119
|
+
switch (body.mode) {
|
|
120
|
+
case "urlencoded": {
|
|
121
|
+
myBody = new URLSearchParams();
|
|
122
|
+
if (Array.isArray(body.urlencoded)) {
|
|
123
|
+
for (const data of body.urlencoded) {
|
|
124
|
+
if (data.key && data.value) {
|
|
125
|
+
myBody.append(data.key, data.value);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
case "raw": {
|
|
132
|
+
myBody = (body.raw ?? "").toString();
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
case "formdata": {
|
|
136
|
+
// The Content-Type header will be set automatically based on the type of body.
|
|
137
|
+
myHeaders.delete("Content-Type");
|
|
138
|
+
myBody = new FormData();
|
|
139
|
+
const members = request.body?.formdata?.members;
|
|
140
|
+
if (Array.isArray(members)) {
|
|
141
|
+
for (const data of members) {
|
|
142
|
+
if (data.key && data.value.content) {
|
|
143
|
+
myBody.append(data.key, data.value.content);
|
|
144
|
+
}
|
|
145
|
+
// handle generic key-value payload
|
|
146
|
+
if (data.key && typeof data.value === "string") {
|
|
147
|
+
myBody.append(data.key, data.value);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "file": {
|
|
154
|
+
if (_body.type === "raw" && _body.content?.type === "file") {
|
|
155
|
+
myBody = await loadImage(_body.content.value.content);
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
default:
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const requestOptions = {
|
|
164
|
+
method: request.method,
|
|
165
|
+
headers: myHeaders,
|
|
166
|
+
body: myBody,
|
|
167
|
+
};
|
|
168
|
+
let finalUrl = request.url.toString();
|
|
169
|
+
if (proxy) {
|
|
170
|
+
// Ensure the proxy ends with a slash.
|
|
171
|
+
let normalizedProxy = proxy.replace(/\/$/, "") + "/";
|
|
172
|
+
finalUrl = normalizedProxy + request.url.toString();
|
|
173
|
+
}
|
|
174
|
+
return fetchWithtimeout(finalUrl, requestOptions).then((response) => {
|
|
175
|
+
const contentType = response.headers.get("content-type");
|
|
176
|
+
let fileExtension = "";
|
|
177
|
+
if (contentType) {
|
|
178
|
+
if (contentType.includes("application/pdf")) {
|
|
179
|
+
fileExtension = ".pdf";
|
|
180
|
+
} else if (contentType.includes("image/jpeg")) {
|
|
181
|
+
fileExtension = ".jpg";
|
|
182
|
+
} else if (contentType.includes("image/png")) {
|
|
183
|
+
fileExtension = ".png";
|
|
184
|
+
} else if (contentType.includes("image/gif")) {
|
|
185
|
+
fileExtension = ".gif";
|
|
186
|
+
} else if (contentType.includes("image/webp")) {
|
|
187
|
+
fileExtension = ".webp";
|
|
188
|
+
} else if (contentType.includes("video/mpeg")) {
|
|
189
|
+
fileExtension = ".mpeg";
|
|
190
|
+
} else if (contentType.includes("video/mp4")) {
|
|
191
|
+
fileExtension = ".mp4";
|
|
192
|
+
} else if (contentType.includes("audio/mpeg")) {
|
|
193
|
+
fileExtension = ".mp3";
|
|
194
|
+
} else if (contentType.includes("audio/ogg")) {
|
|
195
|
+
fileExtension = ".ogg";
|
|
196
|
+
} else if (contentType.includes("application/octet-stream")) {
|
|
197
|
+
fileExtension = ".bin";
|
|
198
|
+
} else if (contentType.includes("application/zip")) {
|
|
199
|
+
fileExtension = ".zip";
|
|
200
|
+
}
|
|
201
|
+
if (fileExtension) {
|
|
202
|
+
return response.blob().then((blob) => {
|
|
203
|
+
const url = window.URL.createObjectURL(blob);
|
|
204
|
+
const link = document.createElement("a");
|
|
205
|
+
link.href = url;
|
|
206
|
+
// Now the file name includes the extension
|
|
207
|
+
link.setAttribute("download", `file${fileExtension}`);
|
|
208
|
+
// These two lines are necessary to make the link click in Firefox
|
|
209
|
+
link.style.display = "none";
|
|
210
|
+
document.body.appendChild(link);
|
|
211
|
+
link.click();
|
|
212
|
+
// After link is clicked, it's safe to remove it.
|
|
213
|
+
setTimeout(() => document.body.removeChild(link), 0);
|
|
214
|
+
return response;
|
|
215
|
+
});
|
|
216
|
+
} else {
|
|
217
|
+
return response;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return response;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
exports.default = makeRequest;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
.openapi-explorer__response-container {
|
|
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
|
+
&:hover {
|
|
16
|
+
box-shadow:
|
|
17
|
+
0 0 0 2px rgba(38, 53, 61, 0.15),
|
|
18
|
+
0 2px 3px hsla(222, 8%, 43%, 0.15),
|
|
19
|
+
0 16px 16px -10px hsla(222, 8%, 43%, 0.2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.openapi-explorer__code-block code {
|
|
23
|
+
padding-top: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.openapi-explorer__response-title-container {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
border-bottom: 1px solid var(--openapi-explorer-border-color);
|
|
31
|
+
margin: 0;
|
|
32
|
+
padding: 0.75rem var(--ifm-pre-padding);
|
|
33
|
+
text-transform: uppercase;
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.openapi-explorer__response-placeholder-message {
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
padding: 1.25rem;
|
|
41
|
+
margin-bottom: 0;
|
|
42
|
+
text-align: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.openapi-explorer__response-clear-btn {
|
|
46
|
+
&:hover {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.openapi-explorer__loading-container {
|
|
52
|
+
width: 100%;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.openapi-response__dot::before {
|
|
58
|
+
margin-right: 0.2rem;
|
|
59
|
+
margin-bottom: 0.15rem;
|
|
60
|
+
content: "⬤";
|
|
61
|
+
color: var(--ifm-color-primary);
|
|
62
|
+
font-size: 8px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.openapi-response__dot--danger::before {
|
|
66
|
+
color: var(--ifm-color-danger);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.openapi-response__dot--success::before {
|
|
70
|
+
color: var(--ifm-color-success);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.openapi-response__dot--info::before {
|
|
74
|
+
color: var(--ifm-color-info);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.openapi-response__status-code {
|
|
78
|
+
margin-left: -1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.openapi-response__status-headers {
|
|
82
|
+
margin-left: -1rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* loading spinner */
|
|
86
|
+
.openapi-response__lds-ring {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
position: relative;
|
|
89
|
+
width: 80px;
|
|
90
|
+
height: 80px;
|
|
91
|
+
}
|
|
92
|
+
.openapi-response__lds-ring div {
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
display: block;
|
|
95
|
+
position: absolute;
|
|
96
|
+
width: 64px;
|
|
97
|
+
height: 64px;
|
|
98
|
+
margin: 8px;
|
|
99
|
+
border: 5px solid #dfc;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
animation: openapi-response__lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1)
|
|
102
|
+
infinite;
|
|
103
|
+
border-color: var(--ifm-color-primary) transparent transparent transparent;
|
|
104
|
+
}
|
|
105
|
+
.openapi-response__lds-ring div:nth-child(1) {
|
|
106
|
+
animation-delay: -0.45s;
|
|
107
|
+
}
|
|
108
|
+
.openapi-response__lds-ring div:nth-child(2) {
|
|
109
|
+
animation-delay: -0.3s;
|
|
110
|
+
}
|
|
111
|
+
.openapi-response__lds-ring div:nth-child(3) {
|
|
112
|
+
animation-delay: -0.15s;
|
|
113
|
+
}
|
|
114
|
+
@keyframes openapi-response__lds-ring {
|
|
115
|
+
0% {
|
|
116
|
+
transform: rotate(0deg);
|
|
117
|
+
}
|
|
118
|
+
100% {
|
|
119
|
+
transform: rotate(360deg);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
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 client_1 = require("@docusaurus/plugin-content-docs/client");
|
|
16
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
17
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
18
|
+
const ApiCodeBlock_1 = __importDefault(
|
|
19
|
+
require("@theme/ApiExplorer/ApiCodeBlock")
|
|
20
|
+
);
|
|
21
|
+
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
22
|
+
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
23
|
+
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
24
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
25
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
26
|
+
const slice_1 = require("./slice");
|
|
27
|
+
// TODO: We probably shouldn't attempt to format XML...
|
|
28
|
+
function formatXml(xml) {
|
|
29
|
+
const tab = " ";
|
|
30
|
+
let formatted = "";
|
|
31
|
+
let indent = "";
|
|
32
|
+
xml.split(/>\s*</).forEach((node) => {
|
|
33
|
+
if (node.match(/^\/\w/)) {
|
|
34
|
+
// decrease indent by one 'tab'
|
|
35
|
+
indent = indent.substring(tab.length);
|
|
36
|
+
}
|
|
37
|
+
formatted += indent + "<" + node + ">\r\n";
|
|
38
|
+
if (node.match(/^<?\w[^>]*[^/]$/)) {
|
|
39
|
+
// increase indent
|
|
40
|
+
indent += tab;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return formatted.substring(1, formatted.length - 3);
|
|
44
|
+
}
|
|
45
|
+
function Response({ item }) {
|
|
46
|
+
const metadata = (0, client_1.useDoc)();
|
|
47
|
+
const hideSendButton = metadata.frontMatter.hide_send_button;
|
|
48
|
+
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
49
|
+
const code = (0, hooks_1.useTypedSelector)((state) => state.response.code);
|
|
50
|
+
const headers = (0, hooks_1.useTypedSelector)(
|
|
51
|
+
(state) => state.response.headers
|
|
52
|
+
);
|
|
53
|
+
const response = (0, hooks_1.useTypedSelector)(
|
|
54
|
+
(state) => state.response.value
|
|
55
|
+
);
|
|
56
|
+
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
57
|
+
const responseStatusClass =
|
|
58
|
+
code &&
|
|
59
|
+
"openapi-response__dot " +
|
|
60
|
+
(parseInt(code) >= 400
|
|
61
|
+
? "openapi-response__dot--danger"
|
|
62
|
+
: parseInt(code) >= 200 && parseInt(code) < 300
|
|
63
|
+
? "openapi-response__dot--success"
|
|
64
|
+
: "openapi-response__dot--info");
|
|
65
|
+
if (!item.servers || hideSendButton) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
let prettyResponse = response;
|
|
69
|
+
if (prettyResponse) {
|
|
70
|
+
try {
|
|
71
|
+
prettyResponse = JSON.stringify(JSON.parse(response), null, 2);
|
|
72
|
+
} catch {
|
|
73
|
+
if (response.startsWith("<")) {
|
|
74
|
+
prettyResponse = formatXml(response);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return react_1.default.createElement(
|
|
79
|
+
"div",
|
|
80
|
+
{ className: "openapi-explorer__response-container" },
|
|
81
|
+
react_1.default.createElement(
|
|
82
|
+
"div",
|
|
83
|
+
{ className: "openapi-explorer__response-title-container" },
|
|
84
|
+
react_1.default.createElement(
|
|
85
|
+
"span",
|
|
86
|
+
{ className: "openapi-explorer__response-title" },
|
|
87
|
+
(0, Translate_1.translate)({
|
|
88
|
+
id: translationIds_1.OPENAPI_RESPONSE.TITLE,
|
|
89
|
+
message: "Response",
|
|
90
|
+
})
|
|
91
|
+
),
|
|
92
|
+
react_1.default.createElement(
|
|
93
|
+
"span",
|
|
94
|
+
{
|
|
95
|
+
className: "openapi-explorer__response-clear-btn",
|
|
96
|
+
onClick: () => {
|
|
97
|
+
dispatch((0, slice_1.clearResponse)());
|
|
98
|
+
dispatch((0, slice_1.clearCode)());
|
|
99
|
+
dispatch((0, slice_1.clearHeaders)());
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
(0, Translate_1.translate)({
|
|
103
|
+
id: translationIds_1.OPENAPI_RESPONSE.CLEAR,
|
|
104
|
+
message: "Clear",
|
|
105
|
+
})
|
|
106
|
+
)
|
|
107
|
+
),
|
|
108
|
+
react_1.default.createElement(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
style: {
|
|
112
|
+
backgroundColor:
|
|
113
|
+
code && prettyResponse !== "Fetching..."
|
|
114
|
+
? prismTheme.plain.backgroundColor
|
|
115
|
+
: "transparent",
|
|
116
|
+
paddingLeft: "1rem",
|
|
117
|
+
paddingTop: "1rem",
|
|
118
|
+
...((prettyResponse === "Fetching..." || !code) && {
|
|
119
|
+
paddingBottom: "1rem",
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
code && prettyResponse !== "Fetching..."
|
|
124
|
+
? react_1.default.createElement(
|
|
125
|
+
SchemaTabs_1.default,
|
|
126
|
+
{ lazy: true },
|
|
127
|
+
react_1.default.createElement(
|
|
128
|
+
TabItem_1.default,
|
|
129
|
+
{
|
|
130
|
+
label: ` ${code}`,
|
|
131
|
+
value: "body",
|
|
132
|
+
attributes: {
|
|
133
|
+
className: (0, clsx_1.default)(
|
|
134
|
+
"openapi-response__dot",
|
|
135
|
+
responseStatusClass
|
|
136
|
+
),
|
|
137
|
+
},
|
|
138
|
+
default: true,
|
|
139
|
+
},
|
|
140
|
+
react_1.default.createElement(
|
|
141
|
+
ApiCodeBlock_1.default,
|
|
142
|
+
{
|
|
143
|
+
className:
|
|
144
|
+
"openapi-explorer__code-block openapi-response__status-code",
|
|
145
|
+
language: response.startsWith("<") ? `xml` : `json`,
|
|
146
|
+
},
|
|
147
|
+
prettyResponse ||
|
|
148
|
+
react_1.default.createElement(
|
|
149
|
+
"p",
|
|
150
|
+
{
|
|
151
|
+
className:
|
|
152
|
+
"openapi-explorer__response-placeholder-message",
|
|
153
|
+
},
|
|
154
|
+
(0, Translate_1.translate)({
|
|
155
|
+
id: translationIds_1.OPENAPI_RESPONSE.PLACEHOLDER,
|
|
156
|
+
message:
|
|
157
|
+
"Click the <code>Send API Request</code> button above and see the response here!",
|
|
158
|
+
})
|
|
159
|
+
)
|
|
160
|
+
)
|
|
161
|
+
),
|
|
162
|
+
react_1.default.createElement(
|
|
163
|
+
TabItem_1.default,
|
|
164
|
+
{
|
|
165
|
+
label: (0, Translate_1.translate)({
|
|
166
|
+
id: translationIds_1.OPENAPI_RESPONSE.HEADERS_TAB,
|
|
167
|
+
message: "Headers",
|
|
168
|
+
}),
|
|
169
|
+
value: "headers",
|
|
170
|
+
},
|
|
171
|
+
react_1.default.createElement(
|
|
172
|
+
ApiCodeBlock_1.default,
|
|
173
|
+
{
|
|
174
|
+
className:
|
|
175
|
+
"openapi-explorer__code-block openapi-response__status-headers",
|
|
176
|
+
language: response.startsWith("<") ? `xml` : `json`,
|
|
177
|
+
},
|
|
178
|
+
JSON.stringify(headers, undefined, 2)
|
|
179
|
+
)
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
: prettyResponse === "Fetching..."
|
|
183
|
+
? react_1.default.createElement(
|
|
184
|
+
"div",
|
|
185
|
+
{ className: "openapi-explorer__loading-container" },
|
|
186
|
+
react_1.default.createElement(
|
|
187
|
+
"div",
|
|
188
|
+
{ className: "openapi-response__lds-ring" },
|
|
189
|
+
react_1.default.createElement("div", null),
|
|
190
|
+
react_1.default.createElement("div", null),
|
|
191
|
+
react_1.default.createElement("div", null),
|
|
192
|
+
react_1.default.createElement("div", null)
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
: react_1.default.createElement(
|
|
196
|
+
"p",
|
|
197
|
+
{ className: "openapi-explorer__response-placeholder-message" },
|
|
198
|
+
(0, Translate_1.translate)({
|
|
199
|
+
id: translationIds_1.OPENAPI_RESPONSE.PLACEHOLDER,
|
|
200
|
+
message:
|
|
201
|
+
"Click the <code>Send API Request</code> button above and see the response here!",
|
|
202
|
+
})
|
|
203
|
+
)
|
|
204
|
+
)
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
exports.default = Response;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
export interface State {
|
|
3
|
+
value?: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
headers?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const slice: import("@reduxjs/toolkit").Slice<State, {
|
|
8
|
+
setResponse: (state: import("immer").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
9
|
+
setCode: (state: import("immer").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
10
|
+
setHeaders: (state: import("immer").WritableDraft<State>, action: PayloadAction<string>) => void;
|
|
11
|
+
clearResponse: (state: import("immer").WritableDraft<State>) => void;
|
|
12
|
+
clearCode: (state: import("immer").WritableDraft<State>) => void;
|
|
13
|
+
clearHeaders: (state: import("immer").WritableDraft<State>) => void;
|
|
14
|
+
}, "response", "response", import("@reduxjs/toolkit").SliceSelectors<State>>;
|
|
15
|
+
export declare const setResponse: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "response/setResponse">, clearResponse: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"response/clearResponse">, setCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "response/setCode">, clearCode: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"response/clearCode">, setHeaders: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "response/setHeaders">, clearHeaders: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"response/clearHeaders">;
|
|
16
|
+
declare const _default: import("redux").Reducer<State>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
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.clearHeaders =
|
|
11
|
+
exports.setHeaders =
|
|
12
|
+
exports.clearCode =
|
|
13
|
+
exports.setCode =
|
|
14
|
+
exports.clearResponse =
|
|
15
|
+
exports.setResponse =
|
|
16
|
+
exports.slice =
|
|
17
|
+
void 0;
|
|
18
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
19
|
+
const initialState = {};
|
|
20
|
+
exports.slice = (0, toolkit_1.createSlice)({
|
|
21
|
+
name: "response",
|
|
22
|
+
initialState,
|
|
23
|
+
reducers: {
|
|
24
|
+
setResponse: (state, action) => {
|
|
25
|
+
state.value = action.payload;
|
|
26
|
+
},
|
|
27
|
+
setCode: (state, action) => {
|
|
28
|
+
state.code = action.payload;
|
|
29
|
+
},
|
|
30
|
+
setHeaders: (state, action) => {
|
|
31
|
+
state.headers = action.payload;
|
|
32
|
+
},
|
|
33
|
+
clearResponse: (state) => {
|
|
34
|
+
state.value = undefined;
|
|
35
|
+
},
|
|
36
|
+
clearCode: (state) => {
|
|
37
|
+
state.code = undefined;
|
|
38
|
+
},
|
|
39
|
+
clearHeaders: (state) => {
|
|
40
|
+
state.headers = undefined;
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
((_a = exports.slice.actions),
|
|
45
|
+
(exports.setResponse = _a.setResponse),
|
|
46
|
+
(exports.clearResponse = _a.clearResponse),
|
|
47
|
+
(exports.setCode = _a.setCode),
|
|
48
|
+
(exports.clearCode = _a.clearCode),
|
|
49
|
+
(exports.setHeaders = _a.setHeaders),
|
|
50
|
+
(exports.clearHeaders = _a.clearHeaders));
|
|
51
|
+
exports.default = exports.slice.reducer;
|