docusaurus-theme-openapi-docs 0.0.0-1294 → 0.0.0-1310
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/markdown/schema.js +4 -5
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +4 -2
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +9 -6
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/Authorization/index.js +9 -10
- package/lib/theme/ApiExplorer/Body/index.js +4 -5
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +1 -1
- package/lib/theme/ApiExplorer/CodeTabs/index.js +6 -5
- package/lib/theme/ApiExplorer/Export/index.js +9 -2
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +1 -2
- package/lib/theme/ApiExplorer/FormLabel/index.js +1 -2
- package/lib/theme/ApiExplorer/FormTextInput/index.js +1 -2
- package/lib/theme/ApiExplorer/LiveEditor/index.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +5 -3
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/index.js +2 -3
- package/lib/theme/ApiExplorer/Request/index.js +17 -18
- package/lib/theme/ApiExplorer/Response/index.js +7 -11
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +57 -50
- package/lib/theme/ApiExplorer/Server/index.js +2 -3
- package/lib/theme/ApiTabs/index.d.ts +1 -1
- package/lib/theme/ApiTabs/index.js +7 -7
- package/lib/theme/DiscriminatorTabs/index.d.ts +1 -1
- package/lib/theme/DiscriminatorTabs/index.js +6 -5
- package/lib/theme/Example/index.js +3 -4
- package/lib/theme/MimeTabs/index.d.ts +1 -1
- package/lib/theme/MimeTabs/index.js +6 -5
- package/lib/theme/OperationTabs/index.d.ts +1 -1
- package/lib/theme/OperationTabs/index.js +6 -5
- package/lib/theme/ParamsDetails/index.js +1 -2
- package/lib/theme/ParamsItem/index.js +7 -8
- package/lib/theme/RequestSchema/index.js +4 -6
- package/lib/theme/ResponseExamples/index.js +3 -4
- package/lib/theme/ResponseSchema/index.js +2 -3
- package/lib/theme/Schema/index.js +8 -9
- package/lib/theme/SchemaExpansion/index.js +4 -5
- package/lib/theme/SchemaItem/index.js +9 -10
- package/lib/theme/SchemaTabs/index.d.ts +1 -1
- package/lib/theme/SchemaTabs/index.js +6 -5
- package/lib/theme/StatusCodes/index.js +2 -4
- package/lib/theme/TabItem/index.d.ts +5 -0
- package/lib/theme/TabItem/index.js +51 -0
- package/lib/theme/TabItem/styles.module.css +3 -0
- package/lib/theme/Tabs/index.d.ts +5 -0
- package/lib/theme/Tabs/index.js +148 -0
- package/lib/theme/Tabs/styles.module.css +7 -0
- package/lib/theme/translationIds.d.ts +1 -99
- package/lib/theme/translationIds.js +0 -116
- package/lib/theme/utils/codeBlockUtils.d.ts +28 -0
- package/lib/theme/utils/codeBlockUtils.js +223 -0
- package/lib/theme/utils/reactUtils.d.ts +1 -0
- package/lib/theme/utils/reactUtils.js +23 -0
- package/lib/theme/utils/scrollUtils.d.ts +7 -0
- package/lib/theme/utils/scrollUtils.js +175 -0
- package/lib/theme/utils/tabsUtils.d.ts +47 -0
- package/lib/theme/utils/tabsUtils.js +299 -0
- package/lib/theme/utils/useCodeWordWrap.d.ts +8 -0
- package/lib/theme/utils/useCodeWordWrap.js +84 -0
- package/lib/theme/utils/useMutationObserver.d.ts +3 -0
- package/lib/theme/utils/useMutationObserver.js +34 -0
- package/package.json +4 -4
- package/src/markdown/schema.ts +4 -5
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +2 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +8 -7
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +1 -1
- package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +1 -1
- package/src/theme/ApiExplorer/Authorization/index.tsx +9 -10
- package/src/theme/ApiExplorer/Body/index.tsx +7 -5
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +5 -5
- package/src/theme/ApiExplorer/Export/index.tsx +6 -2
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +1 -2
- package/src/theme/ApiExplorer/FormLabel/index.tsx +1 -2
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +1 -2
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +5 -3
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +2 -3
- package/src/theme/ApiExplorer/Request/index.tsx +23 -18
- package/src/theme/ApiExplorer/Response/index.tsx +10 -8
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +60 -52
- package/src/theme/ApiExplorer/Server/index.tsx +8 -3
- package/src/theme/ApiTabs/index.tsx +8 -8
- package/src/theme/DiscriminatorTabs/index.tsx +6 -5
- package/src/theme/Example/index.tsx +3 -4
- package/src/theme/MimeTabs/index.tsx +9 -8
- package/src/theme/OperationTabs/index.tsx +5 -4
- package/src/theme/ParamsDetails/index.tsx +1 -2
- package/src/theme/ParamsItem/index.tsx +13 -8
- package/src/theme/RequestSchema/index.tsx +4 -5
- package/src/theme/ResponseExamples/index.tsx +3 -4
- package/src/theme/ResponseSchema/index.tsx +2 -3
- package/src/theme/Schema/index.tsx +8 -9
- package/src/theme/SchemaExpansion/index.tsx +4 -5
- package/src/theme/SchemaItem/index.tsx +18 -10
- package/src/theme/SchemaTabs/index.tsx +6 -5
- package/src/theme/StatusCodes/index.tsx +2 -3
- package/src/theme/TabItem/index.tsx +61 -0
- package/src/theme/TabItem/styles.module.css +3 -0
- package/src/theme/Tabs/index.tsx +164 -0
- package/src/theme/Tabs/styles.module.css +7 -0
- package/src/theme/translationIds.ts +37 -113
- package/src/theme/utils/codeBlockUtils.ts +296 -0
- package/src/theme/utils/reactUtils.ts +22 -0
- package/src/theme/utils/scrollUtils.tsx +153 -0
- package/src/theme/utils/tabsUtils.tsx +329 -0
- package/src/theme/utils/useCodeWordWrap.ts +110 -0
- package/src/theme/utils/useMutationObserver.ts +43 -0
- package/src/theme-classic.d.ts +0 -96
- package/tsconfig.tsbuildinfo +1 -1
package/lib/markdown/schema.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.getSchemaName = getSchemaName;
|
|
10
10
|
exports.getQualifierMessage = getQualifierMessage;
|
|
11
11
|
const Translate_1 = require("@docusaurus/Translate");
|
|
12
|
-
const translationIds_1 = require("../theme/translationIds");
|
|
13
12
|
/**
|
|
14
13
|
* Extracts enum values from a schema, including when wrapped in allOf.
|
|
15
14
|
*/
|
|
@@ -130,7 +129,7 @@ function getQualifierMessage(schema) {
|
|
|
130
129
|
return getQualifierMessage(schema.items);
|
|
131
130
|
}
|
|
132
131
|
let message = `**${(0, Translate_1.translate)({
|
|
133
|
-
id:
|
|
132
|
+
id: "theme.openapi.schemaItem.possibleValues",
|
|
134
133
|
message: "Possible values:",
|
|
135
134
|
})}** `;
|
|
136
135
|
let qualifierGroups = [];
|
|
@@ -146,11 +145,11 @@ function getQualifierMessage(schema) {
|
|
|
146
145
|
let minLength;
|
|
147
146
|
let maxLength;
|
|
148
147
|
const charactersMessage = (0, Translate_1.translate)({
|
|
149
|
-
id:
|
|
148
|
+
id: "theme.openapi.schemaItem.characters",
|
|
150
149
|
message: "characters",
|
|
151
150
|
});
|
|
152
151
|
const nonEmptyMessage = (0, Translate_1.translate)({
|
|
153
|
-
id:
|
|
152
|
+
id: "theme.openapi.schemaItem.nonEmpty",
|
|
154
153
|
message: "non-empty",
|
|
155
154
|
});
|
|
156
155
|
if (schema.minLength && schema.minLength > 1) {
|
|
@@ -211,7 +210,7 @@ function getQualifierMessage(schema) {
|
|
|
211
210
|
}
|
|
212
211
|
if (schema.pattern) {
|
|
213
212
|
const expressionMessage = (0, Translate_1.translate)({
|
|
214
|
-
id:
|
|
213
|
+
id: "theme.openapi.schemaItem.expression",
|
|
215
214
|
message: "Value must match regular expression",
|
|
216
215
|
});
|
|
217
216
|
qualifierGroups.push(`${expressionMessage} \`${schema.pattern}\``);
|
|
@@ -14,11 +14,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.default = CodeBlockContainer;
|
|
15
15
|
const react_1 = __importDefault(require("react"));
|
|
16
16
|
const theme_common_1 = require("@docusaurus/theme-common");
|
|
17
|
-
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
18
17
|
const clsx_1 = __importDefault(require("clsx"));
|
|
18
|
+
const codeBlockUtils_1 = require("@theme/utils/codeBlockUtils");
|
|
19
19
|
function CodeBlockContainer({ as: As, ...props }) {
|
|
20
20
|
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
21
|
-
const prismCssVariables = (0,
|
|
21
|
+
const prismCssVariables = (0, codeBlockUtils_1.getPrismCssVariables)(
|
|
22
|
+
prismTheme
|
|
23
|
+
);
|
|
22
24
|
return react_1.default.createElement(
|
|
23
25
|
As,
|
|
24
26
|
// Polymorphic components are hard to type, without `oneOf` generics
|
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.default = CodeBlockString;
|
|
15
15
|
const react_1 = __importDefault(require("react"));
|
|
16
16
|
const theme_common_1 = require("@docusaurus/theme-common");
|
|
17
|
-
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
18
17
|
const Container_1 = __importDefault(
|
|
19
18
|
require("@theme/ApiExplorer/ApiCodeBlock/Container")
|
|
20
19
|
);
|
|
@@ -30,6 +29,8 @@ const WordWrapButton_1 = __importDefault(
|
|
|
30
29
|
);
|
|
31
30
|
const clsx_1 = __importDefault(require("clsx"));
|
|
32
31
|
const prism_react_renderer_1 = require("prism-react-renderer");
|
|
32
|
+
const codeBlockUtils_1 = require("@theme/utils/codeBlockUtils");
|
|
33
|
+
const useCodeWordWrap_1 = require("@theme/utils/useCodeWordWrap");
|
|
33
34
|
function CodeBlockString({
|
|
34
35
|
children,
|
|
35
36
|
className: blockClassName = "",
|
|
@@ -43,21 +44,23 @@ function CodeBlockString({
|
|
|
43
44
|
} = (0, theme_common_1.useThemeConfig)();
|
|
44
45
|
const language =
|
|
45
46
|
languageProp ??
|
|
46
|
-
(0,
|
|
47
|
+
(0, codeBlockUtils_1.parseLanguage)(blockClassName) ??
|
|
47
48
|
defaultLanguage;
|
|
48
49
|
const prismTheme = (0, theme_common_1.usePrismTheme)();
|
|
49
|
-
const wordWrap = (0,
|
|
50
|
+
const wordWrap = (0, useCodeWordWrap_1.useCodeWordWrap)();
|
|
50
51
|
// We still parse the metastring in case we want to support more syntax in the
|
|
51
52
|
// future. Note that MDX doesn't strip quotes when parsing metastring:
|
|
52
53
|
// "title=\"xyz\"" => title: "\"xyz\""
|
|
53
|
-
const title =
|
|
54
|
-
|
|
54
|
+
const title =
|
|
55
|
+
(0, codeBlockUtils_1.parseCodeBlockTitle)(metastring) || titleProp;
|
|
56
|
+
const { lineClassNames, code } = (0, codeBlockUtils_1.parseLines)(children, {
|
|
55
57
|
metastring,
|
|
56
58
|
language,
|
|
57
59
|
magicComments,
|
|
58
60
|
});
|
|
59
61
|
const showLineNumbers =
|
|
60
|
-
showLineNumbersProp ??
|
|
62
|
+
showLineNumbersProp ??
|
|
63
|
+
(0, codeBlockUtils_1.containsLineNumbers)(metastring);
|
|
61
64
|
return react_1.default.createElement(
|
|
62
65
|
Container_1.default,
|
|
63
66
|
{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { LineProps } from "@
|
|
2
|
+
import type { Props as LineProps } from "@theme/CodeBlock/Line";
|
|
3
3
|
export default function CodeBlockLine({ line, classNames, showLineNumbers, getLineProps, getTokenProps, }: LineProps): React.JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CodeBlockProps } from "@
|
|
2
|
+
import type { Props as CodeBlockProps } from "@theme/CodeBlock";
|
|
3
3
|
export default function ApiCodeBlock({ children: rawChildren, ...props }: CodeBlockProps): React.JSX.Element;
|
|
@@ -19,7 +19,6 @@ const FormTextInput_1 = __importDefault(
|
|
|
19
19
|
require("@theme/ApiExplorer/FormTextInput")
|
|
20
20
|
);
|
|
21
21
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
22
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
23
22
|
const slice_1 = require("./slice");
|
|
24
23
|
function Authorization() {
|
|
25
24
|
const data = (0, hooks_1.useTypedSelector)((state) => state.auth.data);
|
|
@@ -42,7 +41,7 @@ function Authorization() {
|
|
|
42
41
|
null,
|
|
43
42
|
react_1.default.createElement(FormSelect_1.default, {
|
|
44
43
|
label: (0, Translate_1.translate)({
|
|
45
|
-
id:
|
|
44
|
+
id: "theme.openapi.auth.securityScheme",
|
|
46
45
|
message: "Security Scheme",
|
|
47
46
|
}),
|
|
48
47
|
options: optionKeys,
|
|
@@ -59,11 +58,11 @@ function Authorization() {
|
|
|
59
58
|
{ key: a.key + "-bearer" },
|
|
60
59
|
react_1.default.createElement(FormTextInput_1.default, {
|
|
61
60
|
label: (0, Translate_1.translate)({
|
|
62
|
-
id:
|
|
61
|
+
id: "theme.openapi.auth.bearerToken",
|
|
63
62
|
message: "Bearer Token",
|
|
64
63
|
}),
|
|
65
64
|
placeholder: (0, Translate_1.translate)({
|
|
66
|
-
id:
|
|
65
|
+
id: "theme.openapi.auth.bearerToken",
|
|
67
66
|
message: "Bearer Token",
|
|
68
67
|
}),
|
|
69
68
|
password: true,
|
|
@@ -87,11 +86,11 @@ function Authorization() {
|
|
|
87
86
|
{ key: a.key + "-oauth2" },
|
|
88
87
|
react_1.default.createElement(FormTextInput_1.default, {
|
|
89
88
|
label: (0, Translate_1.translate)({
|
|
90
|
-
id:
|
|
89
|
+
id: "theme.openapi.auth.bearerToken",
|
|
91
90
|
message: "Bearer Token",
|
|
92
91
|
}),
|
|
93
92
|
placeholder: (0, Translate_1.translate)({
|
|
94
|
-
id:
|
|
93
|
+
id: "theme.openapi.auth.bearerToken",
|
|
95
94
|
message: "Bearer Token",
|
|
96
95
|
}),
|
|
97
96
|
password: true,
|
|
@@ -118,11 +117,11 @@ function Authorization() {
|
|
|
118
117
|
null,
|
|
119
118
|
react_1.default.createElement(FormTextInput_1.default, {
|
|
120
119
|
label: (0, Translate_1.translate)({
|
|
121
|
-
id:
|
|
120
|
+
id: "theme.openapi.auth.username",
|
|
122
121
|
message: "Username",
|
|
123
122
|
}),
|
|
124
123
|
placeholder: (0, Translate_1.translate)({
|
|
125
|
-
id:
|
|
124
|
+
id: "theme.openapi.auth.username",
|
|
126
125
|
message: "Username",
|
|
127
126
|
}),
|
|
128
127
|
value: data[a.key].username ?? "",
|
|
@@ -143,11 +142,11 @@ function Authorization() {
|
|
|
143
142
|
null,
|
|
144
143
|
react_1.default.createElement(FormTextInput_1.default, {
|
|
145
144
|
label: (0, Translate_1.translate)({
|
|
146
|
-
id:
|
|
145
|
+
id: "theme.openapi.auth.password",
|
|
147
146
|
message: "Password",
|
|
148
147
|
}),
|
|
149
148
|
placeholder: (0, Translate_1.translate)({
|
|
150
|
-
id:
|
|
149
|
+
id: "theme.openapi.auth.password",
|
|
151
150
|
message: "Password",
|
|
152
151
|
}),
|
|
153
152
|
password: true,
|
|
@@ -79,7 +79,6 @@ const hooks_1 = require("@theme/ApiItem/hooks");
|
|
|
79
79
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
80
80
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
81
81
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
82
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
83
82
|
const createSchemaExample_1 = require("docusaurus-plugin-openapi-docs/lib/openapi/createSchemaExample");
|
|
84
83
|
const xml_formatter_1 = __importDefault(require("xml-formatter"));
|
|
85
84
|
const FormBodyItem_1 = __importDefault(require("./FormBodyItem"));
|
|
@@ -340,7 +339,7 @@ function Body({
|
|
|
340
339
|
placeholder:
|
|
341
340
|
schema.description ||
|
|
342
341
|
(0, Translate_1.translate)({
|
|
343
|
-
id:
|
|
342
|
+
id: "theme.openapi.request.body.title",
|
|
344
343
|
message: "Body",
|
|
345
344
|
}),
|
|
346
345
|
onChange: (file) => {
|
|
@@ -373,7 +372,7 @@ function Body({
|
|
|
373
372
|
TabItem_1.default,
|
|
374
373
|
{
|
|
375
374
|
label: (0, Translate_1.translate)({
|
|
376
|
-
id:
|
|
375
|
+
id: "theme.openapi.body.exampleFromSchema",
|
|
377
376
|
message: "Example (from schema)",
|
|
378
377
|
}),
|
|
379
378
|
value: "Example (from schema)",
|
|
@@ -465,7 +464,7 @@ function Body({
|
|
|
465
464
|
TabItem_1.default,
|
|
466
465
|
{
|
|
467
466
|
label: (0, Translate_1.translate)({
|
|
468
|
-
id:
|
|
467
|
+
id: "theme.openapi.body.exampleFromSchema",
|
|
469
468
|
message: "Example (from schema)",
|
|
470
469
|
}),
|
|
471
470
|
value: "Example (from schema)",
|
|
@@ -517,7 +516,7 @@ function Body({
|
|
|
517
516
|
TabItem_1.default,
|
|
518
517
|
{
|
|
519
518
|
label: (0, Translate_1.translate)({
|
|
520
|
-
id:
|
|
519
|
+
id: "theme.openapi.body.exampleFromSchema",
|
|
521
520
|
message: "Example (from schema)",
|
|
522
521
|
}),
|
|
523
522
|
value: "Example (from schema)",
|
|
@@ -69,9 +69,10 @@ var __importDefault =
|
|
|
69
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
70
|
exports.default = CodeTabs;
|
|
71
71
|
const react_1 = __importStar(require("react"));
|
|
72
|
-
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
73
72
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
74
73
|
const clsx_1 = __importDefault(require("clsx"));
|
|
74
|
+
const scrollUtils_1 = require("@theme/utils/scrollUtils");
|
|
75
|
+
const tabsUtils_1 = require("@theme/utils/tabsUtils");
|
|
75
76
|
function TabList({
|
|
76
77
|
action,
|
|
77
78
|
currentLanguage,
|
|
@@ -87,7 +88,7 @@ function TabList({
|
|
|
87
88
|
const tabRefs = (0, react_1.useRef)([]);
|
|
88
89
|
const tabsScrollContainerRef = (0, react_1.useRef)(null);
|
|
89
90
|
const { blockElementScrollPositionUntilNextRender } = (0,
|
|
90
|
-
|
|
91
|
+
scrollUtils_1.useScrollPositionBlocker)();
|
|
91
92
|
(0, react_1.useEffect)(() => {
|
|
92
93
|
const activeTab = tabRefs.current.find(
|
|
93
94
|
(tab) => tab?.getAttribute("aria-selected") === "true"
|
|
@@ -235,10 +236,10 @@ function TabContent({ lazy, children, selectedValue }) {
|
|
|
235
236
|
);
|
|
236
237
|
}
|
|
237
238
|
function TabsComponent(props) {
|
|
238
|
-
const tabs = (0,
|
|
239
|
+
const tabs = (0, tabsUtils_1.useTabsContextValue)(props);
|
|
239
240
|
const { className } = props;
|
|
240
241
|
return react_1.default.createElement(
|
|
241
|
-
|
|
242
|
+
tabsUtils_1.TabsProvider,
|
|
242
243
|
{ value: tabs },
|
|
243
244
|
react_1.default.createElement(
|
|
244
245
|
"div",
|
|
@@ -265,6 +266,6 @@ function CodeTabs(props) {
|
|
|
265
266
|
key: String(isBrowser),
|
|
266
267
|
...props,
|
|
267
268
|
},
|
|
268
|
-
(0,
|
|
269
|
+
(0, tabsUtils_1.sanitizeTabsChildren)(props.children)
|
|
269
270
|
);
|
|
270
271
|
}
|
|
@@ -12,6 +12,7 @@ var __importDefault =
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
15
16
|
const file_saver_1 = __importDefault(require("file-saver"));
|
|
16
17
|
const saveFile = (url) => {
|
|
17
18
|
let fileName;
|
|
@@ -30,7 +31,10 @@ function Export({ url, proxy }) {
|
|
|
30
31
|
react_1.default.createElement(
|
|
31
32
|
"button",
|
|
32
33
|
{ className: "export-button button button--sm button--secondary" },
|
|
33
|
-
|
|
34
|
+
(0, Translate_1.translate)({
|
|
35
|
+
id: "theme.openapi.export.button",
|
|
36
|
+
message: "Export",
|
|
37
|
+
})
|
|
34
38
|
),
|
|
35
39
|
react_1.default.createElement(
|
|
36
40
|
"ul",
|
|
@@ -48,7 +52,10 @@ function Export({ url, proxy }) {
|
|
|
48
52
|
className: "dropdown__link",
|
|
49
53
|
href: `${url}`,
|
|
50
54
|
},
|
|
51
|
-
|
|
55
|
+
(0, Translate_1.translate)({
|
|
56
|
+
id: "theme.openapi.export.openapiSpec",
|
|
57
|
+
message: "OpenAPI Spec",
|
|
58
|
+
})
|
|
52
59
|
)
|
|
53
60
|
)
|
|
54
61
|
)
|
|
@@ -72,7 +72,6 @@ const Translate_1 = require("@docusaurus/Translate");
|
|
|
72
72
|
const FloatingButton_1 = __importDefault(
|
|
73
73
|
require("@theme/ApiExplorer/FloatingButton")
|
|
74
74
|
);
|
|
75
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
76
75
|
const react_magic_dropzone_1 = __importDefault(require("react-magic-dropzone"));
|
|
77
76
|
function RenderPreview({ file }) {
|
|
78
77
|
switch (file.type) {
|
|
@@ -161,7 +160,7 @@ function FormFileUpload({ placeholder, onChange }) {
|
|
|
161
160
|
},
|
|
162
161
|
},
|
|
163
162
|
(0, Translate_1.translate)({
|
|
164
|
-
id:
|
|
163
|
+
id: "theme.openapi.formFileUpload.clearButton",
|
|
165
164
|
message: "Clear",
|
|
166
165
|
})
|
|
167
166
|
),
|
|
@@ -13,7 +13,6 @@ var __importDefault =
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
const react_1 = __importDefault(require("react"));
|
|
15
15
|
const Translate_1 = require("@docusaurus/Translate");
|
|
16
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
17
16
|
function FormLabel({ htmlFor, label, type, required }) {
|
|
18
17
|
return react_1.default.createElement(
|
|
19
18
|
react_1.default.Fragment,
|
|
@@ -41,7 +40,7 @@ function FormLabel({ htmlFor, label, type, required }) {
|
|
|
41
40
|
"span",
|
|
42
41
|
{ className: "openapi-schema__required" },
|
|
43
42
|
(0, Translate_1.translate)({
|
|
44
|
-
id:
|
|
43
|
+
id: "theme.openapi.schemaItem.required",
|
|
45
44
|
message: "required",
|
|
46
45
|
})
|
|
47
46
|
)
|
|
@@ -72,7 +72,6 @@ const react_1 = __importStar(require("react"));
|
|
|
72
72
|
const Translate_1 = require("@docusaurus/Translate");
|
|
73
73
|
const error_message_1 = require("@hookform/error-message");
|
|
74
74
|
const FormLabel_1 = __importDefault(require("@theme/ApiExplorer/FormLabel"));
|
|
75
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
76
75
|
const clsx_1 = __importDefault(require("clsx"));
|
|
77
76
|
const react_hook_form_1 = require("react-hook-form");
|
|
78
77
|
function FormTextInput({
|
|
@@ -108,7 +107,7 @@ function FormTextInput({
|
|
|
108
107
|
...register(paramName, {
|
|
109
108
|
required: isRequired
|
|
110
109
|
? (0, Translate_1.translate)({
|
|
111
|
-
id:
|
|
110
|
+
id: "theme.openapi.form.fieldRequired",
|
|
112
111
|
message: "This field is required",
|
|
113
112
|
})
|
|
114
113
|
: false,
|
|
@@ -72,7 +72,6 @@ const theme_common_1 = require("@docusaurus/theme-common");
|
|
|
72
72
|
const Translate_1 = require("@docusaurus/Translate");
|
|
73
73
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
74
74
|
const error_message_1 = require("@hookform/error-message");
|
|
75
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
76
75
|
const clsx_1 = __importDefault(require("clsx"));
|
|
77
76
|
const react_hook_form_1 = require("react-hook-form");
|
|
78
77
|
const react_live_1 = require("react-live");
|
|
@@ -144,7 +143,7 @@ function App({
|
|
|
144
143
|
required:
|
|
145
144
|
isRequired && !code
|
|
146
145
|
? (0, Translate_1.translate)({
|
|
147
|
-
id:
|
|
146
|
+
id: "theme.openapi.form.fieldRequired",
|
|
148
147
|
message: "This field is required",
|
|
149
148
|
})
|
|
150
149
|
: false,
|
|
@@ -79,7 +79,6 @@ const FormTextInput_1 = __importDefault(
|
|
|
79
79
|
);
|
|
80
80
|
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
81
81
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
82
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
83
82
|
const react_hook_form_1 = require("react-hook-form");
|
|
84
83
|
function ArrayItem({ param, onChange, initialValue }) {
|
|
85
84
|
const [value, setValue] = (0, react_1.useState)(initialValue || "");
|
|
@@ -171,7 +170,7 @@ function ParamArrayFormItem({ param, label, type, required }) {
|
|
|
171
170
|
rules: {
|
|
172
171
|
required: param.required
|
|
173
172
|
? (0, Translate_1.translate)({
|
|
174
|
-
id:
|
|
173
|
+
id: "theme.openapi.form.fieldRequired",
|
|
175
174
|
message: "This field is required",
|
|
176
175
|
})
|
|
177
176
|
: false,
|
|
@@ -219,7 +218,10 @@ function ParamArrayFormItem({ param, label, type, required }) {
|
|
|
219
218
|
react_1.default.createElement(
|
|
220
219
|
"button",
|
|
221
220
|
{ className: "openapi-explorer__thin-btn", onClick: handleAddItem },
|
|
222
|
-
|
|
221
|
+
(0, Translate_1.translate)({
|
|
222
|
+
id: "theme.openapi.paramArray.addItem",
|
|
223
|
+
message: "Add item",
|
|
224
|
+
})
|
|
223
225
|
)
|
|
224
226
|
),
|
|
225
227
|
}),
|
|
@@ -74,7 +74,6 @@ const error_message_1 = require("@hookform/error-message");
|
|
|
74
74
|
const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
75
75
|
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
76
76
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
77
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
78
77
|
const react_hook_form_1 = require("react-hook-form");
|
|
79
78
|
function ParamBooleanFormItem({ param, label, type, required }) {
|
|
80
79
|
const dispatch = (0, hooks_1.useTypedDispatch)();
|
|
@@ -106,7 +105,7 @@ function ParamBooleanFormItem({ param, label, type, required }) {
|
|
|
106
105
|
rules: {
|
|
107
106
|
required: param.required
|
|
108
107
|
? (0, Translate_1.translate)({
|
|
109
|
-
id:
|
|
108
|
+
id: "theme.openapi.form.fieldRequired",
|
|
110
109
|
message: "This field is required",
|
|
111
110
|
})
|
|
112
111
|
: false,
|
|
@@ -21,7 +21,6 @@ const FormMultiSelect_1 = __importDefault(
|
|
|
21
21
|
const ParamOptions_1 = require("@theme/ApiExplorer/ParamOptions");
|
|
22
22
|
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
23
23
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
24
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
25
24
|
const react_hook_form_1 = require("react-hook-form");
|
|
26
25
|
function ParamMultiSelectFormItem({ param, label, type, required }) {
|
|
27
26
|
const {
|
|
@@ -70,7 +69,7 @@ function ParamMultiSelectFormItem({ param, label, type, required }) {
|
|
|
70
69
|
rules: {
|
|
71
70
|
required: param.required
|
|
72
71
|
? (0, Translate_1.translate)({
|
|
73
|
-
id:
|
|
72
|
+
id: "theme.openapi.form.fieldRequired",
|
|
74
73
|
message: "This field is required",
|
|
75
74
|
})
|
|
76
75
|
: false,
|
|
@@ -75,7 +75,6 @@ const FormSelect_1 = __importDefault(require("@theme/ApiExplorer/FormSelect"));
|
|
|
75
75
|
const ParamOptions_1 = require("@theme/ApiExplorer/ParamOptions");
|
|
76
76
|
const slice_1 = require("@theme/ApiExplorer/ParamOptions/slice");
|
|
77
77
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
78
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
79
78
|
const react_hook_form_1 = require("react-hook-form");
|
|
80
79
|
function ParamSelectFormItem({ param, label, type, required }) {
|
|
81
80
|
const {
|
|
@@ -100,7 +99,7 @@ function ParamSelectFormItem({ param, label, type, required }) {
|
|
|
100
99
|
rules: {
|
|
101
100
|
required: param.required
|
|
102
101
|
? (0, Translate_1.translate)({
|
|
103
|
-
id:
|
|
102
|
+
id: "theme.openapi.form.fieldRequired",
|
|
104
103
|
message: "This field is required",
|
|
105
104
|
})
|
|
106
105
|
: false,
|
|
@@ -87,7 +87,6 @@ const ParamTextFormItem_1 = __importDefault(
|
|
|
87
87
|
require("@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem")
|
|
88
88
|
);
|
|
89
89
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
90
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
91
90
|
/**
|
|
92
91
|
* Extracts enum values from a schema, including when wrapped in allOf.
|
|
93
92
|
* This handles cases where an enum is referenced via allOf for composition.
|
|
@@ -254,11 +253,11 @@ function ParamOptions() {
|
|
|
254
253
|
),
|
|
255
254
|
showOptional
|
|
256
255
|
? (0, Translate_1.translate)({
|
|
257
|
-
id:
|
|
256
|
+
id: "theme.openapi.paramOptions.hideOptional",
|
|
258
257
|
message: "Hide optional parameters",
|
|
259
258
|
})
|
|
260
259
|
: (0, Translate_1.translate)({
|
|
261
|
-
id:
|
|
260
|
+
id: "theme.openapi.paramOptions.showOptional",
|
|
262
261
|
message: "Show optional parameters",
|
|
263
262
|
})
|
|
264
263
|
),
|
|
@@ -85,14 +85,13 @@ const buildPostmanRequest_1 = __importDefault(
|
|
|
85
85
|
const ContentType_1 = __importDefault(
|
|
86
86
|
require("@theme/ApiExplorer/ContentType")
|
|
87
87
|
);
|
|
88
|
+
const useResolvedEncoding_1 = require("@theme/ApiExplorer/EncodingSelection/useResolvedEncoding");
|
|
88
89
|
const ParamOptions_1 = __importDefault(
|
|
89
90
|
require("@theme/ApiExplorer/ParamOptions")
|
|
90
91
|
);
|
|
91
92
|
const slice_1 = require("@theme/ApiExplorer/Response/slice");
|
|
92
93
|
const Server_1 = __importDefault(require("@theme/ApiExplorer/Server"));
|
|
93
|
-
const useResolvedEncoding_1 = require("@theme/ApiExplorer/EncodingSelection/useResolvedEncoding");
|
|
94
94
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
95
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
96
95
|
const sdk = __importStar(require("postman-collection"));
|
|
97
96
|
const react_hook_form_1 = require("react-hook-form");
|
|
98
97
|
const makeRequest_1 = __importStar(require("./makeRequest"));
|
|
@@ -200,26 +199,26 @@ function Request({ item }) {
|
|
|
200
199
|
switch (errorType) {
|
|
201
200
|
case "timeout":
|
|
202
201
|
return (0, Translate_1.translate)({
|
|
203
|
-
id:
|
|
202
|
+
id: "theme.openapi.request.error.timeout",
|
|
204
203
|
message:
|
|
205
204
|
"The request timed out waiting for the server to respond. Please try again. If the issue persists, try using a different client (e.g., curl) with a longer timeout.",
|
|
206
205
|
});
|
|
207
206
|
case "network":
|
|
208
207
|
return (0, Translate_1.translate)({
|
|
209
|
-
id:
|
|
208
|
+
id: "theme.openapi.request.error.network",
|
|
210
209
|
message:
|
|
211
210
|
"Unable to reach the server. Please check your network connection and verify the server URL is correct. If the server is running, this may be a CORS issue.",
|
|
212
211
|
});
|
|
213
212
|
case "cors":
|
|
214
213
|
return (0, Translate_1.translate)({
|
|
215
|
-
id:
|
|
214
|
+
id: "theme.openapi.request.error.cors",
|
|
216
215
|
message:
|
|
217
216
|
"The request was blocked, possibly due to CORS restrictions. Ensure the server allows requests from this origin, or try using a proxy.",
|
|
218
217
|
});
|
|
219
218
|
case "unknown":
|
|
220
219
|
default:
|
|
221
220
|
return (0, Translate_1.translate)({
|
|
222
|
-
id:
|
|
221
|
+
id: "theme.openapi.request.error.unknown",
|
|
223
222
|
message:
|
|
224
223
|
"An unexpected error occurred while making the request. Please try again.",
|
|
225
224
|
});
|
|
@@ -229,7 +228,7 @@ function Request({ item }) {
|
|
|
229
228
|
dispatch(
|
|
230
229
|
(0, slice_1.setResponse)(
|
|
231
230
|
(0, Translate_1.translate)({
|
|
232
|
-
id:
|
|
231
|
+
id: "theme.openapi.request.fetchingMessage",
|
|
233
232
|
message: "Fetching...",
|
|
234
233
|
})
|
|
235
234
|
)
|
|
@@ -256,7 +255,7 @@ function Request({ item }) {
|
|
|
256
255
|
errorMessage = getErrorMessage(e.type);
|
|
257
256
|
} else {
|
|
258
257
|
errorMessage = (0, Translate_1.translate)({
|
|
259
|
-
id:
|
|
258
|
+
id: "theme.openapi.request.connectionFailed",
|
|
260
259
|
message: "Connection failed",
|
|
261
260
|
});
|
|
262
261
|
}
|
|
@@ -314,7 +313,7 @@ function Request({ item }) {
|
|
|
314
313
|
"span",
|
|
315
314
|
{ className: "openapi-explorer__request-title" },
|
|
316
315
|
(0, Translate_1.translate)({
|
|
317
|
-
id:
|
|
316
|
+
id: "theme.openapi.request.title",
|
|
318
317
|
message: "Request",
|
|
319
318
|
})
|
|
320
319
|
),
|
|
@@ -327,7 +326,7 @@ function Request({ item }) {
|
|
|
327
326
|
onClick: collapseAllDetails,
|
|
328
327
|
},
|
|
329
328
|
(0, Translate_1.translate)({
|
|
330
|
-
id:
|
|
329
|
+
id: "theme.openapi.request.collapseAll",
|
|
331
330
|
message: "Collapse all",
|
|
332
331
|
})
|
|
333
332
|
)
|
|
@@ -339,7 +338,7 @@ function Request({ item }) {
|
|
|
339
338
|
onClick: expandAllDetails,
|
|
340
339
|
},
|
|
341
340
|
(0, Translate_1.translate)({
|
|
342
|
-
id:
|
|
341
|
+
id: "theme.openapi.request.expandAll",
|
|
343
342
|
message: "Expand all",
|
|
344
343
|
})
|
|
345
344
|
)
|
|
@@ -366,7 +365,7 @@ function Request({ item }) {
|
|
|
366
365
|
},
|
|
367
366
|
},
|
|
368
367
|
(0, Translate_1.translate)({
|
|
369
|
-
id:
|
|
368
|
+
id: "theme.openapi.request.baseUrl.title",
|
|
370
369
|
message: "Base URL",
|
|
371
370
|
})
|
|
372
371
|
),
|
|
@@ -391,7 +390,7 @@ function Request({ item }) {
|
|
|
391
390
|
},
|
|
392
391
|
},
|
|
393
392
|
(0, Translate_1.translate)({
|
|
394
|
-
id:
|
|
393
|
+
id: "theme.openapi.request.auth.title",
|
|
395
394
|
message: "Auth",
|
|
396
395
|
})
|
|
397
396
|
),
|
|
@@ -415,7 +414,7 @@ function Request({ item }) {
|
|
|
415
414
|
},
|
|
416
415
|
},
|
|
417
416
|
(0, Translate_1.translate)({
|
|
418
|
-
id:
|
|
417
|
+
id: "theme.openapi.request.parameters.title",
|
|
419
418
|
message: "Parameters",
|
|
420
419
|
})
|
|
421
420
|
),
|
|
@@ -438,7 +437,7 @@ function Request({ item }) {
|
|
|
438
437
|
},
|
|
439
438
|
},
|
|
440
439
|
(0, Translate_1.translate)({
|
|
441
|
-
id:
|
|
440
|
+
id: "theme.openapi.request.body.title",
|
|
442
441
|
message: "Body",
|
|
443
442
|
}),
|
|
444
443
|
requestBodyRequired &&
|
|
@@ -447,7 +446,7 @@ function Request({ item }) {
|
|
|
447
446
|
{ className: "openapi-schema__required" },
|
|
448
447
|
"\u00A0",
|
|
449
448
|
(0, Translate_1.translate)({
|
|
450
|
-
id:
|
|
449
|
+
id: "theme.openapi.request.requiredLabel",
|
|
451
450
|
message: "required",
|
|
452
451
|
})
|
|
453
452
|
)
|
|
@@ -480,7 +479,7 @@ function Request({ item }) {
|
|
|
480
479
|
},
|
|
481
480
|
},
|
|
482
481
|
(0, Translate_1.translate)({
|
|
483
|
-
id:
|
|
482
|
+
id: "theme.openapi.request.accept.title",
|
|
484
483
|
message: "Accept",
|
|
485
484
|
})
|
|
486
485
|
),
|
|
@@ -492,7 +491,7 @@ function Request({ item }) {
|
|
|
492
491
|
"button",
|
|
493
492
|
{ className: "openapi-explorer__request-btn", type: "submit" },
|
|
494
493
|
(0, Translate_1.translate)({
|
|
495
|
-
id:
|
|
494
|
+
id: "theme.openapi.request.sendButton",
|
|
496
495
|
message: "Send API Request",
|
|
497
496
|
})
|
|
498
497
|
)
|