docusaurus-theme-openapi-docs 0.0.0-348 → 0.0.0-351
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +48 -0
- package/lib/markdown/createDescription.js +20 -0
- package/lib/markdown/schema.js +121 -0
- package/lib/markdown/utils.js +45 -0
- package/lib/postman-code-generators.d.ts +9 -0
- package/lib/react-magic-dropzone.d.ts +9 -0
- package/lib/theme/ApiDemoPanel/Accept/index.js +41 -0
- package/lib/theme/ApiDemoPanel/Accept/slice.js +32 -0
- package/lib/theme/ApiDemoPanel/Authorization/auth-types.js +32 -0
- package/lib/theme/ApiDemoPanel/Authorization/slice.js +137 -0
- package/lib/theme/ApiDemoPanel/Body/index.js +185 -0
- package/lib/theme/ApiDemoPanel/Body/slice.js +105 -0
- package/lib/theme/ApiDemoPanel/ContentType/index.js +41 -0
- package/lib/theme/ApiDemoPanel/ContentType/slice.js +32 -0
- package/lib/theme/ApiDemoPanel/Curl/index.js +235 -0
- package/lib/theme/ApiDemoPanel/Curl/styles.module.css +84 -0
- package/lib/theme/ApiDemoPanel/FloatingButton/index.js +32 -0
- package/lib/theme/ApiDemoPanel/FloatingButton/styles.module.css +26 -0
- package/lib/theme/ApiDemoPanel/FormFileUpload/index.js +96 -0
- package/lib/theme/ApiDemoPanel/FormFileUpload/styles.module.css +75 -0
- package/lib/theme/ApiDemoPanel/FormItem/index.js +35 -0
- package/lib/theme/ApiDemoPanel/FormItem/styles.module.css +7 -0
- package/lib/theme/ApiDemoPanel/FormMultiSelect/index.js +52 -0
- package/lib/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +38 -0
- package/lib/theme/ApiDemoPanel/FormSelect/index.js +39 -0
- package/lib/theme/ApiDemoPanel/FormSelect/styles.module.css +51 -0
- package/lib/theme/ApiDemoPanel/FormTextInput/index.js +30 -0
- package/lib/theme/ApiDemoPanel/FormTextInput/styles.module.css +21 -0
- package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +60 -0
- package/lib/theme/ApiDemoPanel/ParamOptions/index.js +248 -0
- package/lib/theme/ApiDemoPanel/ParamOptions/slice.js +35 -0
- package/lib/theme/ApiDemoPanel/ParamOptions/styles.module.css +180 -0
- package/lib/theme/ApiDemoPanel/Response/index.js +75 -0
- package/lib/theme/ApiDemoPanel/Response/slice.js +37 -0
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +69 -0
- package/lib/theme/ApiDemoPanel/Server/index.js +109 -0
- package/lib/theme/ApiDemoPanel/Server/slice.js +41 -0
- package/lib/theme/ApiDemoPanel/Server/styles.module.css +61 -0
- package/lib/theme/ApiDemoPanel/VSCode/index.js +252 -0
- package/lib/theme/ApiDemoPanel/VSCode/styles.module.css +19 -0
- package/lib/theme/ApiDemoPanel/buildPostmanRequest.js +332 -0
- package/lib/theme/ApiDemoPanel/hooks.js +20 -0
- package/lib/theme/ApiDemoPanel/index.js +132 -0
- package/lib/theme/ApiDemoPanel/persistanceMiddleware.js +44 -0
- package/lib/theme/ApiDemoPanel/postman-collection.d.ts +10 -0
- package/lib/theme/ApiDemoPanel/storage-utils.js +47 -0
- package/lib/theme/ApiDemoPanel/store.js +48 -0
- package/lib/theme/ApiDemoPanel/styles.module.css +44 -0
- package/lib/theme/ApiItem/index.js +160 -0
- package/lib/theme/ApiItem/styles.module.css +113 -0
- package/lib/theme/ApiTabs/index.js +258 -0
- package/lib/theme/ApiTabs/styles.module.css +118 -0
- package/lib/theme/ParamsItem/index.js +68 -0
- package/lib/theme/ParamsItem/styles.module.css +24 -0
- package/lib/theme/SchemaItem/index.js +58 -0
- package/lib/theme/SchemaItem/styles.module.css +24 -0
- package/lib/theme-classic.d.ts +8 -0
- package/lib/theme-openapi.d.ts +48 -0
- package/lib/theme-translations.d.ts +9 -0
- package/lib/types.js +1 -0
- package/lib-next/index.js +38 -0
- package/lib-next/markdown/createDescription.js +13 -0
- package/lib-next/markdown/schema.js +115 -0
- package/lib-next/markdown/utils.js +31 -0
- package/lib-next/postman-code-generators.d.ts +9 -0
- package/lib-next/react-magic-dropzone.d.ts +9 -0
- package/lib-next/theme/ApiDemoPanel/Accept/index.js +33 -0
- package/lib-next/theme/ApiDemoPanel/Accept/slice.js +19 -0
- package/lib-next/theme/ApiDemoPanel/Authorization/auth-types.js +22 -0
- package/lib-next/theme/ApiDemoPanel/Authorization/slice.js +101 -0
- package/lib-next/theme/ApiDemoPanel/Body/index.js +210 -0
- package/lib-next/theme/ApiDemoPanel/Body/slice.js +89 -0
- package/lib-next/theme/ApiDemoPanel/ContentType/index.js +33 -0
- package/lib-next/theme/ApiDemoPanel/ContentType/slice.js +19 -0
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +262 -0
- package/lib-next/theme/ApiDemoPanel/Curl/styles.module.css +84 -0
- package/lib-next/theme/ApiDemoPanel/FloatingButton/index.js +19 -0
- package/lib-next/theme/ApiDemoPanel/FloatingButton/styles.module.css +26 -0
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/index.js +112 -0
- package/lib-next/theme/ApiDemoPanel/FormFileUpload/styles.module.css +75 -0
- package/lib-next/theme/ApiDemoPanel/FormItem/index.js +29 -0
- package/lib-next/theme/ApiDemoPanel/FormItem/styles.module.css +7 -0
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/index.js +49 -0
- package/lib-next/theme/ApiDemoPanel/FormMultiSelect/styles.module.css +38 -0
- package/lib-next/theme/ApiDemoPanel/FormSelect/index.js +28 -0
- package/lib-next/theme/ApiDemoPanel/FormSelect/styles.module.css +51 -0
- package/lib-next/theme/ApiDemoPanel/FormTextInput/index.js +23 -0
- package/lib-next/theme/ApiDemoPanel/FormTextInput/styles.module.css +21 -0
- package/lib-next/theme/ApiDemoPanel/MethodEndpoint/index.js +53 -0
- package/lib-next/theme/ApiDemoPanel/ParamOptions/index.js +284 -0
- package/lib-next/theme/ApiDemoPanel/ParamOptions/slice.js +22 -0
- package/lib-next/theme/ApiDemoPanel/ParamOptions/styles.module.css +180 -0
- package/lib-next/theme/ApiDemoPanel/Response/index.js +65 -0
- package/lib-next/theme/ApiDemoPanel/Response/slice.js +22 -0
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +71 -0
- package/lib-next/theme/ApiDemoPanel/Server/index.js +114 -0
- package/lib-next/theme/ApiDemoPanel/Server/slice.js +25 -0
- package/lib-next/theme/ApiDemoPanel/Server/styles.module.css +61 -0
- package/lib-next/theme/ApiDemoPanel/VSCode/index.js +265 -0
- package/lib-next/theme/ApiDemoPanel/VSCode/styles.module.css +19 -0
- package/lib-next/theme/ApiDemoPanel/buildPostmanRequest.js +313 -0
- package/lib-next/theme/ApiDemoPanel/hooks.js +9 -0
- package/lib-next/theme/ApiDemoPanel/index.js +108 -0
- package/lib-next/theme/ApiDemoPanel/persistanceMiddleware.js +38 -0
- package/lib-next/theme/ApiDemoPanel/postman-collection.d.ts +10 -0
- package/lib-next/theme/ApiDemoPanel/storage-utils.js +35 -0
- package/lib-next/theme/ApiDemoPanel/store.js +30 -0
- package/lib-next/theme/ApiDemoPanel/styles.module.css +44 -0
- package/lib-next/theme/ApiItem/index.js +171 -0
- package/lib-next/theme/ApiItem/styles.module.css +113 -0
- package/lib-next/theme/ApiTabs/index.js +258 -0
- package/lib-next/theme/ApiTabs/styles.module.css +118 -0
- package/lib-next/theme/ParamsItem/index.js +68 -0
- package/lib-next/theme/ParamsItem/styles.module.css +24 -0
- package/lib-next/theme/SchemaItem/index.js +58 -0
- package/lib-next/theme/SchemaItem/styles.module.css +24 -0
- package/lib-next/theme-classic.d.ts +8 -0
- package/lib-next/theme-openapi.d.ts +48 -0
- package/lib-next/theme-translations.d.ts +9 -0
- package/lib-next/types.js +1 -0
- package/package.json +3 -3
- package/src/theme/ApiDemoPanel/SecuritySchemes/index.tsx +26 -3
- package/src/theme/ApiDemoPanel/buildPostmanRequest.ts +5 -1
- package/src/theme/ApiDemoPanel/Authorization/index.tsx +0 -211
- package/src/theme/ApiDemoPanel/Execute/index.tsx +0 -87
- package/src/theme/ApiDemoPanel/Execute/makeRequest.ts +0 -182
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.dropzone {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
border: 2px dashed var(--openapi-monaco-border-color);
|
|
7
|
+
/* border: 2px dashed var(--ifm-color-primary); */
|
|
8
|
+
background-color: var(--openapi-input-background);
|
|
9
|
+
|
|
10
|
+
width: 100%;
|
|
11
|
+
/* min-height: 120px; */
|
|
12
|
+
/* padding: 16px 11px; */
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
padding: var(--ifm-pre-padding);
|
|
15
|
+
font-size: var(--ifm-code-font-size);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dropzoneHover {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
border: 2px dashed var(--openapi-monaco-border-color);
|
|
24
|
+
background-color: var(--openapi-input-background);
|
|
25
|
+
width: 100%;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
padding: var(--ifm-pre-padding);
|
|
28
|
+
font-size: var(--ifm-code-font-size);
|
|
29
|
+
border: 2px dashed var(--ifm-color-primary);
|
|
30
|
+
|
|
31
|
+
background: linear-gradient(
|
|
32
|
+
var(--openapi-dropzone-hover-shim),
|
|
33
|
+
var(--openapi-dropzone-hover-shim)
|
|
34
|
+
),
|
|
35
|
+
linear-gradient(var(--ifm-color-primary), var(--ifm-color-primary));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dropzone:hover {
|
|
39
|
+
border: 2px dashed var(--ifm-color-primary);
|
|
40
|
+
background: linear-gradient(
|
|
41
|
+
var(--openapi-dropzone-hover-shim),
|
|
42
|
+
var(--openapi-dropzone-hover-shim)
|
|
43
|
+
),
|
|
44
|
+
linear-gradient(var(--ifm-color-primary), var(--ifm-color-primary));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.dropzoneContent {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
margin: var(--ifm-pre-padding) 0;
|
|
53
|
+
color: var(--openapi-dropzone-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dropzone:hover .dropzoneContent {
|
|
57
|
+
color: var(--ifm-pre-color);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dropzoneHover .dropzoneContent {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
flex-wrap: wrap;
|
|
65
|
+
margin: var(--ifm-pre-padding) 0;
|
|
66
|
+
color: var(--ifm-pre-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.filename {
|
|
70
|
+
margin: 0 calc(var(--ifm-pre-padding) * 1.5);
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
flex: 1;
|
|
75
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/* ============================================================================
|
|
15
|
+
* Copyright (c) Palo Alto Networks
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
* ========================================================================== */
|
|
20
|
+
function FormItem({
|
|
21
|
+
label,
|
|
22
|
+
type,
|
|
23
|
+
children
|
|
24
|
+
}) {
|
|
25
|
+
return <div className={_stylesModule.default.formItem}>
|
|
26
|
+
<code>{label}</code>
|
|
27
|
+
{type && <span style={{
|
|
28
|
+
opacity: 0.6
|
|
29
|
+
}}> — {type}</span>}
|
|
30
|
+
<div>{children}</div>
|
|
31
|
+
</div>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var _default = FormItem;
|
|
35
|
+
exports.default = _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/* ============================================================================
|
|
15
|
+
* Copyright (c) Palo Alto Networks
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
* ========================================================================== */
|
|
20
|
+
function FormMultiSelect({
|
|
21
|
+
value,
|
|
22
|
+
options,
|
|
23
|
+
onChange
|
|
24
|
+
}) {
|
|
25
|
+
if (options.length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let height;
|
|
30
|
+
|
|
31
|
+
if (options.length < 6) {
|
|
32
|
+
const selectPadding = 12 * 2;
|
|
33
|
+
const rawHeight = options.length * 29;
|
|
34
|
+
const innerMargins = 4 * options.length - 1;
|
|
35
|
+
const outerMargins = 4 * 2;
|
|
36
|
+
const mysteryScroll = 1;
|
|
37
|
+
height = rawHeight + innerMargins + outerMargins + selectPadding + mysteryScroll;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return <select style={{
|
|
41
|
+
height: height
|
|
42
|
+
}} className={_stylesModule.default.selectInput} value={value} onChange={onChange} size={Math.min(6, options.length + 1)} multiple>
|
|
43
|
+
{options.map(option => {
|
|
44
|
+
return <option key={option} value={option}>
|
|
45
|
+
{option}
|
|
46
|
+
</option>;
|
|
47
|
+
})}
|
|
48
|
+
</select>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var _default = FormMultiSelect;
|
|
52
|
+
exports.default = _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.inputBase {
|
|
2
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
3
|
+
/* height: 40px; */
|
|
4
|
+
background-color: var(--openapi-input-background);
|
|
5
|
+
border: none;
|
|
6
|
+
outline: none;
|
|
7
|
+
width: 100%;
|
|
8
|
+
font-size: var(--ifm-code-font-size);
|
|
9
|
+
color: var(--ifm-pre-color);
|
|
10
|
+
padding: 12px var(--ifm-pre-padding);
|
|
11
|
+
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
border: 2px solid transparent;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.selectInput {
|
|
17
|
+
composes: inputBase;
|
|
18
|
+
-moz-appearance: none;
|
|
19
|
+
-webkit-appearance: none;
|
|
20
|
+
appearance: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.selectInput option {
|
|
24
|
+
border-radius: 0.25rem;
|
|
25
|
+
color: var(--ifm-menu-color);
|
|
26
|
+
margin: 0.25rem 0;
|
|
27
|
+
padding: var(--ifm-menu-link-padding-vertical)
|
|
28
|
+
var(--ifm-menu-link-padding-horizontal);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.selectInput:focus option:checked {
|
|
32
|
+
/* background: #0f62fe linear-gradient(0deg, #0f62fe 0%, #0f62fe 100%); */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.selectInput:focus {
|
|
36
|
+
/* box-shadow: inset 0px 0px 0px 2px white; */
|
|
37
|
+
border: 2px solid var(--openapi-input-border);
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/* ============================================================================
|
|
15
|
+
* Copyright (c) Palo Alto Networks
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
* ========================================================================== */
|
|
20
|
+
function FormSelect({
|
|
21
|
+
value,
|
|
22
|
+
options,
|
|
23
|
+
onChange
|
|
24
|
+
}) {
|
|
25
|
+
if (!Array.isArray(options) || options.length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <select className={_stylesModule.default.selectInput} value={value} onChange={onChange}>
|
|
30
|
+
{options.map(option => {
|
|
31
|
+
return <option key={option} value={option}>
|
|
32
|
+
{option}
|
|
33
|
+
</option>;
|
|
34
|
+
})}
|
|
35
|
+
</select>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var _default = FormSelect;
|
|
39
|
+
exports.default = _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.inputBase {
|
|
2
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
3
|
+
/* height: 40px; */
|
|
4
|
+
background-color: var(--openapi-input-background);
|
|
5
|
+
border: none;
|
|
6
|
+
outline: none;
|
|
7
|
+
width: 100%;
|
|
8
|
+
font-size: var(--ifm-code-font-size);
|
|
9
|
+
color: var(--ifm-pre-color);
|
|
10
|
+
padding: 12px 48px 12px var(--ifm-pre-padding);
|
|
11
|
+
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html[data-theme="dark"] .selectInput {
|
|
16
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
17
|
+
/* height: 40px; */
|
|
18
|
+
background-color: var(--openapi-input-background);
|
|
19
|
+
border: none;
|
|
20
|
+
outline: none;
|
|
21
|
+
width: 100%;
|
|
22
|
+
font-size: var(--ifm-code-font-size);
|
|
23
|
+
color: var(--ifm-pre-color);
|
|
24
|
+
/* padding: 12px var(--ifm-pre-padding); */
|
|
25
|
+
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
-moz-appearance: none;
|
|
28
|
+
-webkit-appearance: none;
|
|
29
|
+
appearance: none;
|
|
30
|
+
|
|
31
|
+
background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" fill="white"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
|
|
32
|
+
background-repeat: no-repeat;
|
|
33
|
+
background-position: right var(--ifm-pre-padding) top 50%;
|
|
34
|
+
background-size: auto auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.selectInput {
|
|
38
|
+
composes: inputBase;
|
|
39
|
+
-moz-appearance: none;
|
|
40
|
+
-webkit-appearance: none;
|
|
41
|
+
appearance: none;
|
|
42
|
+
|
|
43
|
+
background-image: url('data:image/svg+xml;charset=US-ASCII,<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg>');
|
|
44
|
+
background-repeat: no-repeat;
|
|
45
|
+
background-position: right var(--ifm-pre-padding) top 50%;
|
|
46
|
+
background-size: auto auto;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.selectInput:focus {
|
|
50
|
+
box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
|
|
51
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/* ============================================================================
|
|
15
|
+
* Copyright (c) Palo Alto Networks
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
* ========================================================================== */
|
|
20
|
+
function FormTextInput({
|
|
21
|
+
value,
|
|
22
|
+
placeholder,
|
|
23
|
+
password,
|
|
24
|
+
onChange
|
|
25
|
+
}) {
|
|
26
|
+
return <input className={_stylesModule.default.input} type={password ? "password" : "text"} placeholder={placeholder} value={value} onChange={onChange} autoComplete="off" />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var _default = FormTextInput;
|
|
30
|
+
exports.default = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.inputBase {
|
|
2
|
+
margin-top: calc(var(--ifm-pre-padding) / 2);
|
|
3
|
+
/* height: 40px; */
|
|
4
|
+
background-color: var(--openapi-input-background);
|
|
5
|
+
border: none;
|
|
6
|
+
outline: none;
|
|
7
|
+
width: 100%;
|
|
8
|
+
font-size: var(--ifm-code-font-size);
|
|
9
|
+
color: var(--ifm-pre-color);
|
|
10
|
+
padding: 12px var(--ifm-pre-padding);
|
|
11
|
+
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.input {
|
|
16
|
+
composes: inputBase;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.input:focus {
|
|
20
|
+
box-shadow: inset 0px 0px 0px 2px var(--openapi-input-border);
|
|
21
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
/* ============================================================================
|
|
13
|
+
* Copyright (c) Palo Alto Networks
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
* ========================================================================== */
|
|
18
|
+
const methodStyle = {
|
|
19
|
+
borderRadius: "var(--ifm-global-radius)"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function colorForMethod(method) {
|
|
23
|
+
switch (method.toLowerCase()) {
|
|
24
|
+
case "get":
|
|
25
|
+
return "primary";
|
|
26
|
+
|
|
27
|
+
case "put":
|
|
28
|
+
return "warning";
|
|
29
|
+
|
|
30
|
+
case "patch":
|
|
31
|
+
return "warning";
|
|
32
|
+
|
|
33
|
+
case "post":
|
|
34
|
+
return "success";
|
|
35
|
+
|
|
36
|
+
case "delete":
|
|
37
|
+
return "danger";
|
|
38
|
+
|
|
39
|
+
default:
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function MethodEndpoint({
|
|
45
|
+
method,
|
|
46
|
+
path
|
|
47
|
+
}) {
|
|
48
|
+
return <pre style={{
|
|
49
|
+
background: "var(--openapi-card-background-color)",
|
|
50
|
+
borderRadius: "var(--openapi-card-border-radius)"
|
|
51
|
+
}}>
|
|
52
|
+
<span style={methodStyle} className={"badge badge--" + colorForMethod(method)}>
|
|
53
|
+
{method.toUpperCase()}
|
|
54
|
+
</span>{" "}
|
|
55
|
+
<span>{path.replace(/{([a-z0-9-_]+)}/gi, ":$1")}</span>
|
|
56
|
+
</pre>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var _default = MethodEndpoint;
|
|
60
|
+
exports.default = _default;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _toolkit = require("@reduxjs/toolkit");
|
|
11
|
+
|
|
12
|
+
var _hooks = require("../hooks");
|
|
13
|
+
|
|
14
|
+
var _FormItem = _interopRequireDefault(require("./../FormItem"));
|
|
15
|
+
|
|
16
|
+
var _FormMultiSelect = _interopRequireDefault(require("./../FormMultiSelect"));
|
|
17
|
+
|
|
18
|
+
var _FormSelect = _interopRequireDefault(require("./../FormSelect"));
|
|
19
|
+
|
|
20
|
+
var _FormTextInput = _interopRequireDefault(require("./../FormTextInput"));
|
|
21
|
+
|
|
22
|
+
var _slice = require("./slice");
|
|
23
|
+
|
|
24
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
+
|
|
32
|
+
/* ============================================================================
|
|
33
|
+
* Copyright (c) Palo Alto Networks
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
* ========================================================================== */
|
|
38
|
+
function ParamOption({
|
|
39
|
+
param
|
|
40
|
+
}) {
|
|
41
|
+
var _param$schema, _param$schema$items, _param$schema2, _param$schema3, _param$schema4;
|
|
42
|
+
|
|
43
|
+
if (((_param$schema = param.schema) === null || _param$schema === void 0 ? void 0 : _param$schema.type) === "array" && (_param$schema$items = param.schema.items) !== null && _param$schema$items !== void 0 && _param$schema$items.enum) {
|
|
44
|
+
return <ParamMultiSelectFormItem param={param} />;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (((_param$schema2 = param.schema) === null || _param$schema2 === void 0 ? void 0 : _param$schema2.type) === "array") {
|
|
48
|
+
return <ParamArrayFormItem param={param} />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if ((_param$schema3 = param.schema) !== null && _param$schema3 !== void 0 && _param$schema3.enum) {
|
|
52
|
+
return <ParamSelectFormItem param={param} />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (((_param$schema4 = param.schema) === null || _param$schema4 === void 0 ? void 0 : _param$schema4.type) === "boolean") {
|
|
56
|
+
return <ParamBooleanFormItem param={param} />;
|
|
57
|
+
} // integer, number, string, int32, int64, float, double, object, byte, binary,
|
|
58
|
+
// date-time, date, password
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
return <ParamTextFormItem param={param} />;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ParamOptionWrapper({
|
|
65
|
+
param
|
|
66
|
+
}) {
|
|
67
|
+
return <_FormItem.default label={param.name} type={param.in}>
|
|
68
|
+
<ParamOption param={param} />
|
|
69
|
+
</_FormItem.default>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function ParamOptions() {
|
|
73
|
+
const [showOptional, setShowOptional] = (0, _react.useState)(false);
|
|
74
|
+
const pathParams = (0, _hooks.useTypedSelector)(state => state.params.path);
|
|
75
|
+
const queryParams = (0, _hooks.useTypedSelector)(state => state.params.query);
|
|
76
|
+
const cookieParams = (0, _hooks.useTypedSelector)(state => state.params.cookie);
|
|
77
|
+
const headerParams = (0, _hooks.useTypedSelector)(state => state.params.header);
|
|
78
|
+
const allParams = [...pathParams, ...queryParams, ...cookieParams, ...headerParams];
|
|
79
|
+
const requiredParams = allParams.filter(p => p.required);
|
|
80
|
+
const optionalParams = allParams.filter(p => !p.required);
|
|
81
|
+
return <>
|
|
82
|
+
{
|
|
83
|
+
/* Required Parameters */
|
|
84
|
+
}
|
|
85
|
+
{requiredParams.map(param => <ParamOptionWrapper key={`${param.in}-${param.name}`} param={param} />)}
|
|
86
|
+
|
|
87
|
+
{
|
|
88
|
+
/* Optional Parameters */
|
|
89
|
+
}
|
|
90
|
+
{optionalParams.length > 0 && <>
|
|
91
|
+
<button className={_stylesModule.default.showMoreButton} onClick={() => setShowOptional(prev => !prev)}>
|
|
92
|
+
<span style={{
|
|
93
|
+
width: "1.5em",
|
|
94
|
+
display: "inline-block",
|
|
95
|
+
textAlign: "center"
|
|
96
|
+
}}>
|
|
97
|
+
<span className={showOptional ? _stylesModule.default.plusExpanded : _stylesModule.default.plus}>
|
|
98
|
+
<div>
|
|
99
|
+
<svg style={{
|
|
100
|
+
fill: "currentColor",
|
|
101
|
+
width: "10px",
|
|
102
|
+
height: "10px"
|
|
103
|
+
}} height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg">
|
|
104
|
+
<path 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" fillRule="evenodd"></path>
|
|
105
|
+
</svg>
|
|
106
|
+
</div>
|
|
107
|
+
</span>
|
|
108
|
+
</span>
|
|
109
|
+
{showOptional ? "Hide optional parameters" : "Show optional parameters"}
|
|
110
|
+
</button>
|
|
111
|
+
|
|
112
|
+
<div className={showOptional ? _stylesModule.default.showOptions : _stylesModule.default.hideOptions}>
|
|
113
|
+
{optionalParams.map(param => <ParamOptionWrapper key={`${param.in}-${param.name}`} param={param} />)}
|
|
114
|
+
</div>
|
|
115
|
+
</>}
|
|
116
|
+
</>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function ArrayItem({
|
|
120
|
+
param,
|
|
121
|
+
onChange
|
|
122
|
+
}) {
|
|
123
|
+
var _param$schema5, _param$schema5$items;
|
|
124
|
+
|
|
125
|
+
if (((_param$schema5 = param.schema) === null || _param$schema5 === void 0 ? void 0 : (_param$schema5$items = _param$schema5.items) === null || _param$schema5$items === void 0 ? void 0 : _param$schema5$items.type) === "boolean") {
|
|
126
|
+
return <_FormSelect.default options={["---", "true", "false"]} onChange={e => {
|
|
127
|
+
const val = e.target.value;
|
|
128
|
+
onChange(val === "---" ? undefined : val);
|
|
129
|
+
}} />;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return <_FormTextInput.default placeholder={param.description || param.name} onChange={e => {
|
|
133
|
+
onChange(e.target.value);
|
|
134
|
+
}} />;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function ParamArrayFormItem({
|
|
138
|
+
param
|
|
139
|
+
}) {
|
|
140
|
+
const [items, setItems] = (0, _react.useState)([]);
|
|
141
|
+
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
142
|
+
|
|
143
|
+
function handleAddItem() {
|
|
144
|
+
setItems(i => [...i, {
|
|
145
|
+
id: (0, _toolkit.nanoid)()
|
|
146
|
+
}]);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
(0, _react.useEffect)(() => {
|
|
150
|
+
const values = items.map(item => item.value).filter(item => !!item);
|
|
151
|
+
dispatch((0, _slice.setParam)({ ...param,
|
|
152
|
+
value: values.length > 0 ? values : undefined
|
|
153
|
+
})); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
154
|
+
}, [items]);
|
|
155
|
+
|
|
156
|
+
function handleDeleteItem(itemToDelete) {
|
|
157
|
+
return () => {
|
|
158
|
+
const newItems = items.filter(i => i.id !== itemToDelete.id);
|
|
159
|
+
setItems(newItems);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function handleChangeItem(itemToUpdate) {
|
|
164
|
+
return value => {
|
|
165
|
+
const newItems = items.map(i => {
|
|
166
|
+
if (i.id === itemToUpdate.id) {
|
|
167
|
+
return { ...i,
|
|
168
|
+
value: value
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return i;
|
|
173
|
+
});
|
|
174
|
+
setItems(newItems);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return <>
|
|
179
|
+
{items.map(item => <div key={item.id} style={{
|
|
180
|
+
display: "flex"
|
|
181
|
+
}}>
|
|
182
|
+
<ArrayItem param={param} onChange={handleChangeItem(item)} />
|
|
183
|
+
<button className={_stylesModule.default.buttonDelete} onClick={handleDeleteItem(item)}>
|
|
184
|
+
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true">
|
|
185
|
+
<path 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"></path>
|
|
186
|
+
<title>Delete</title>
|
|
187
|
+
</svg>
|
|
188
|
+
</button>
|
|
189
|
+
</div>)}
|
|
190
|
+
<button className={_stylesModule.default.buttonThin} onClick={handleAddItem}>
|
|
191
|
+
Add item
|
|
192
|
+
</button>
|
|
193
|
+
</>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function ParamSelectFormItem({
|
|
197
|
+
param
|
|
198
|
+
}) {
|
|
199
|
+
var _param$schema$enum, _param$schema6;
|
|
200
|
+
|
|
201
|
+
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
202
|
+
const options = (_param$schema$enum = (_param$schema6 = param.schema) === null || _param$schema6 === void 0 ? void 0 : _param$schema6.enum) !== null && _param$schema$enum !== void 0 ? _param$schema$enum : [];
|
|
203
|
+
return <_FormSelect.default options={["---", ...options]} onChange={e => {
|
|
204
|
+
const val = e.target.value;
|
|
205
|
+
dispatch((0, _slice.setParam)({ ...param,
|
|
206
|
+
value: val === "---" ? undefined : val
|
|
207
|
+
}));
|
|
208
|
+
}} />;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function ParamBooleanFormItem({
|
|
212
|
+
param
|
|
213
|
+
}) {
|
|
214
|
+
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
215
|
+
return <_FormSelect.default options={["---", "true", "false"]} onChange={e => {
|
|
216
|
+
const val = e.target.value;
|
|
217
|
+
dispatch((0, _slice.setParam)({ ...param,
|
|
218
|
+
value: val === "---" ? undefined : val
|
|
219
|
+
}));
|
|
220
|
+
}} />;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function ParamMultiSelectFormItem({
|
|
224
|
+
param
|
|
225
|
+
}) {
|
|
226
|
+
var _param$schema$items$e, _param$schema7, _param$schema7$items;
|
|
227
|
+
|
|
228
|
+
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
229
|
+
const options = (_param$schema$items$e = (_param$schema7 = param.schema) === null || _param$schema7 === void 0 ? void 0 : (_param$schema7$items = _param$schema7.items) === null || _param$schema7$items === void 0 ? void 0 : _param$schema7$items.enum) !== null && _param$schema$items$e !== void 0 ? _param$schema$items$e : [];
|
|
230
|
+
return <_FormMultiSelect.default options={options} onChange={e => {
|
|
231
|
+
const values = Array.prototype.filter.call(e.target.options, o => o.selected).map(o => o.value);
|
|
232
|
+
dispatch((0, _slice.setParam)({ ...param,
|
|
233
|
+
value: values.length > 0 ? values : undefined
|
|
234
|
+
}));
|
|
235
|
+
}} />;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function ParamTextFormItem({
|
|
239
|
+
param
|
|
240
|
+
}) {
|
|
241
|
+
const dispatch = (0, _hooks.useTypedDispatch)();
|
|
242
|
+
return <_FormTextInput.default placeholder={param.description || param.name} onChange={e => dispatch((0, _slice.setParam)({ ...param,
|
|
243
|
+
value: e.target.value
|
|
244
|
+
}))} />;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
var _default = ParamOptions;
|
|
248
|
+
exports.default = _default;
|