docusaurus-theme-openapi-docs 0.0.0-1294 → 0.0.0-1295
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/Authorization/index.js +9 -10
- package/lib/theme/ApiExplorer/Body/index.js +4 -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.js +1 -2
- package/lib/theme/Example/index.js +3 -4
- 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/StatusCodes/index.js +2 -4
- package/lib/theme/translationIds.d.ts +1 -99
- package/lib/theme/translationIds.js +0 -116
- package/package.json +3 -3
- package/src/markdown/schema.ts +4 -5
- package/src/theme/ApiExplorer/Authorization/index.tsx +9 -10
- package/src/theme/ApiExplorer/Body/index.tsx +7 -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 +1 -2
- package/src/theme/Example/index.tsx +3 -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/StatusCodes/index.tsx +2 -3
- package/src/theme/translationIds.ts +37 -113
|
@@ -13,7 +13,6 @@ import FormMultiSelect from "@theme/ApiExplorer/FormMultiSelect";
|
|
|
13
13
|
import { getSchemaEnum } from "@theme/ApiExplorer/ParamOptions";
|
|
14
14
|
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
15
15
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
16
|
-
import { OPENAPI_FORM } from "@theme/translationIds";
|
|
17
16
|
import { Controller, useFormContext } from "react-hook-form";
|
|
18
17
|
|
|
19
18
|
export interface ParamProps {
|
|
@@ -75,7 +74,7 @@ export default function ParamMultiSelectFormItem({
|
|
|
75
74
|
rules={{
|
|
76
75
|
required: param.required
|
|
77
76
|
? translate({
|
|
78
|
-
id:
|
|
77
|
+
id: "theme.openapi.form.fieldRequired",
|
|
79
78
|
message: "This field is required",
|
|
80
79
|
})
|
|
81
80
|
: false,
|
|
@@ -13,7 +13,6 @@ import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
|
13
13
|
import { getSchemaEnum } from "@theme/ApiExplorer/ParamOptions";
|
|
14
14
|
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
15
15
|
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
16
|
-
import { OPENAPI_FORM } from "@theme/translationIds";
|
|
17
16
|
import { Controller, useFormContext } from "react-hook-form";
|
|
18
17
|
|
|
19
18
|
export interface ParamProps {
|
|
@@ -58,7 +57,7 @@ export default function ParamSelectFormItem({
|
|
|
58
57
|
rules={{
|
|
59
58
|
required: param.required
|
|
60
59
|
? translate({
|
|
61
|
-
id:
|
|
60
|
+
id: "theme.openapi.form.fieldRequired",
|
|
62
61
|
message: "This field is required",
|
|
63
62
|
})
|
|
64
63
|
: false,
|
|
@@ -15,7 +15,6 @@ import ParamMultiSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormI
|
|
|
15
15
|
import ParamSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem";
|
|
16
16
|
import ParamTextFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem";
|
|
17
17
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
18
|
-
import { OPENAPI_PARAM_OPTIONS } from "@theme/translationIds";
|
|
19
18
|
|
|
20
19
|
import { Param } from "./slice";
|
|
21
20
|
|
|
@@ -207,11 +206,11 @@ function ParamOptions() {
|
|
|
207
206
|
</span>
|
|
208
207
|
{showOptional
|
|
209
208
|
? translate({
|
|
210
|
-
id:
|
|
209
|
+
id: "theme.openapi.paramOptions.hideOptional",
|
|
211
210
|
message: "Hide optional parameters",
|
|
212
211
|
})
|
|
213
212
|
: translate({
|
|
214
|
-
id:
|
|
213
|
+
id: "theme.openapi.paramOptions.showOptional",
|
|
215
214
|
message: "Show optional parameters",
|
|
216
215
|
})}
|
|
217
216
|
</button>
|
|
@@ -16,6 +16,7 @@ import Authorization from "@theme/ApiExplorer/Authorization";
|
|
|
16
16
|
import Body from "@theme/ApiExplorer/Body";
|
|
17
17
|
import buildPostmanRequest from "@theme/ApiExplorer/buildPostmanRequest";
|
|
18
18
|
import ContentType from "@theme/ApiExplorer/ContentType";
|
|
19
|
+
import { useResolvedEncoding } from "@theme/ApiExplorer/EncodingSelection/useResolvedEncoding";
|
|
19
20
|
import ParamOptions from "@theme/ApiExplorer/ParamOptions";
|
|
20
21
|
import {
|
|
21
22
|
setResponse,
|
|
@@ -25,9 +26,7 @@ import {
|
|
|
25
26
|
clearHeaders,
|
|
26
27
|
} from "@theme/ApiExplorer/Response/slice";
|
|
27
28
|
import Server from "@theme/ApiExplorer/Server";
|
|
28
|
-
import { useResolvedEncoding } from "@theme/ApiExplorer/EncodingSelection/useResolvedEncoding";
|
|
29
29
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
30
|
-
import { OPENAPI_REQUEST } from "@theme/translationIds";
|
|
31
30
|
import type { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
32
31
|
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
33
32
|
import type { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
|
|
@@ -137,26 +136,26 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
137
136
|
switch (errorType) {
|
|
138
137
|
case "timeout":
|
|
139
138
|
return translate({
|
|
140
|
-
id:
|
|
139
|
+
id: "theme.openapi.request.error.timeout",
|
|
141
140
|
message:
|
|
142
141
|
"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.",
|
|
143
142
|
});
|
|
144
143
|
case "network":
|
|
145
144
|
return translate({
|
|
146
|
-
id:
|
|
145
|
+
id: "theme.openapi.request.error.network",
|
|
147
146
|
message:
|
|
148
147
|
"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.",
|
|
149
148
|
});
|
|
150
149
|
case "cors":
|
|
151
150
|
return translate({
|
|
152
|
-
id:
|
|
151
|
+
id: "theme.openapi.request.error.cors",
|
|
153
152
|
message:
|
|
154
153
|
"The request was blocked, possibly due to CORS restrictions. Ensure the server allows requests from this origin, or try using a proxy.",
|
|
155
154
|
});
|
|
156
155
|
case "unknown":
|
|
157
156
|
default:
|
|
158
157
|
return translate({
|
|
159
|
-
id:
|
|
158
|
+
id: "theme.openapi.request.error.unknown",
|
|
160
159
|
message:
|
|
161
160
|
"An unexpected error occurred while making the request. Please try again.",
|
|
162
161
|
});
|
|
@@ -167,7 +166,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
167
166
|
dispatch(
|
|
168
167
|
setResponse(
|
|
169
168
|
translate({
|
|
170
|
-
id:
|
|
169
|
+
id: "theme.openapi.request.fetchingMessage",
|
|
171
170
|
message: "Fetching...",
|
|
172
171
|
})
|
|
173
172
|
)
|
|
@@ -195,7 +194,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
195
194
|
errorMessage = getErrorMessage(e.type);
|
|
196
195
|
} else {
|
|
197
196
|
errorMessage = translate({
|
|
198
|
-
id:
|
|
197
|
+
id: "theme.openapi.request.connectionFailed",
|
|
199
198
|
message: "Connection failed",
|
|
200
199
|
});
|
|
201
200
|
}
|
|
@@ -253,7 +252,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
253
252
|
<div className="openapi-explorer__request-header-container">
|
|
254
253
|
<span className="openapi-explorer__request-title">
|
|
255
254
|
{translate({
|
|
256
|
-
id:
|
|
255
|
+
id: "theme.openapi.request.title",
|
|
257
256
|
message: "Request",
|
|
258
257
|
})}
|
|
259
258
|
</span>
|
|
@@ -264,7 +263,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
264
263
|
onClick={collapseAllDetails}
|
|
265
264
|
>
|
|
266
265
|
{translate({
|
|
267
|
-
id:
|
|
266
|
+
id: "theme.openapi.request.collapseAll",
|
|
268
267
|
message: "Collapse all",
|
|
269
268
|
})}
|
|
270
269
|
</button>
|
|
@@ -275,7 +274,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
275
274
|
onClick={expandAllDetails}
|
|
276
275
|
>
|
|
277
276
|
{translate({
|
|
278
|
-
id:
|
|
277
|
+
id: "theme.openapi.request.expandAll",
|
|
279
278
|
message: "Expand all",
|
|
280
279
|
})}
|
|
281
280
|
</button>
|
|
@@ -296,7 +295,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
296
295
|
}}
|
|
297
296
|
>
|
|
298
297
|
{translate({
|
|
299
|
-
id:
|
|
298
|
+
id: "theme.openapi.request.baseUrl.title",
|
|
300
299
|
message: "Base URL",
|
|
301
300
|
})}
|
|
302
301
|
</summary>
|
|
@@ -315,7 +314,10 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
315
314
|
setExpandAuth(!expandAuth);
|
|
316
315
|
}}
|
|
317
316
|
>
|
|
318
|
-
{translate({
|
|
317
|
+
{translate({
|
|
318
|
+
id: "theme.openapi.request.auth.title",
|
|
319
|
+
message: "Auth",
|
|
320
|
+
})}
|
|
319
321
|
</summary>
|
|
320
322
|
<Authorization />
|
|
321
323
|
</details>
|
|
@@ -335,7 +337,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
335
337
|
}}
|
|
336
338
|
>
|
|
337
339
|
{translate({
|
|
338
|
-
id:
|
|
340
|
+
id: "theme.openapi.request.parameters.title",
|
|
339
341
|
message: "Parameters",
|
|
340
342
|
})}
|
|
341
343
|
</summary>
|
|
@@ -354,12 +356,15 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
354
356
|
setExpandBody(!expandBody);
|
|
355
357
|
}}
|
|
356
358
|
>
|
|
357
|
-
{translate({
|
|
359
|
+
{translate({
|
|
360
|
+
id: "theme.openapi.request.body.title",
|
|
361
|
+
message: "Body",
|
|
362
|
+
})}
|
|
358
363
|
{requestBodyRequired && (
|
|
359
364
|
<span className="openapi-schema__required">
|
|
360
365
|
|
|
361
366
|
{translate({
|
|
362
|
-
id:
|
|
367
|
+
id: "theme.openapi.request.requiredLabel",
|
|
363
368
|
message: "required",
|
|
364
369
|
})}
|
|
365
370
|
</span>
|
|
@@ -388,7 +393,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
388
393
|
}}
|
|
389
394
|
>
|
|
390
395
|
{translate({
|
|
391
|
-
id:
|
|
396
|
+
id: "theme.openapi.request.accept.title",
|
|
392
397
|
message: "Accept",
|
|
393
398
|
})}
|
|
394
399
|
</summary>
|
|
@@ -398,7 +403,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
398
403
|
{showRequestButton && item.method !== "event" && (
|
|
399
404
|
<button className="openapi-explorer__request-btn" type="submit">
|
|
400
405
|
{translate({
|
|
401
|
-
id:
|
|
406
|
+
id: "theme.openapi.request.sendButton",
|
|
402
407
|
message: "Send API Request",
|
|
403
408
|
})}
|
|
404
409
|
</button>
|
|
@@ -15,7 +15,6 @@ import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
|
|
|
15
15
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
16
16
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
17
17
|
import TabItem from "@theme/TabItem";
|
|
18
|
-
import { OPENAPI_REQUEST, OPENAPI_RESPONSE } from "@theme/translationIds";
|
|
19
18
|
import clsx from "clsx";
|
|
20
19
|
import type { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
21
20
|
import type { ThemeConfig } from "docusaurus-theme-openapi-docs/src/types";
|
|
@@ -134,7 +133,10 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
134
133
|
<div className="openapi-explorer__response-container">
|
|
135
134
|
<div className="openapi-explorer__response-title-container">
|
|
136
135
|
<span className="openapi-explorer__response-title">
|
|
137
|
-
{translate({
|
|
136
|
+
{translate({
|
|
137
|
+
id: "theme.openapi.response.title",
|
|
138
|
+
message: "Response",
|
|
139
|
+
})}
|
|
138
140
|
</span>
|
|
139
141
|
<button
|
|
140
142
|
type="button"
|
|
@@ -145,7 +147,7 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
145
147
|
dispatch(clearHeaders());
|
|
146
148
|
}}
|
|
147
149
|
>
|
|
148
|
-
{translate({ id:
|
|
150
|
+
{translate({ id: "theme.openapi.response.clear", message: "Clear" })}
|
|
149
151
|
</button>
|
|
150
152
|
</div>
|
|
151
153
|
<div
|
|
@@ -180,11 +182,11 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
180
182
|
{prettyResponse || (
|
|
181
183
|
<p className="openapi-explorer__response-placeholder-message">
|
|
182
184
|
<Translate
|
|
183
|
-
id={
|
|
185
|
+
id={"theme.openapi.response.placeholder"}
|
|
184
186
|
values={{
|
|
185
187
|
code: (
|
|
186
188
|
<code>
|
|
187
|
-
<Translate id={
|
|
189
|
+
<Translate id={"theme.openapi.request.sendButton"}>
|
|
188
190
|
Send API Request
|
|
189
191
|
</Translate>
|
|
190
192
|
</code>
|
|
@@ -202,7 +204,7 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
202
204
|
{/* @ts-ignore */}
|
|
203
205
|
<TabItem
|
|
204
206
|
label={translate({
|
|
205
|
-
id:
|
|
207
|
+
id: "theme.openapi.response.headersTab",
|
|
206
208
|
message: "Headers",
|
|
207
209
|
})}
|
|
208
210
|
value="headers"
|
|
@@ -228,11 +230,11 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
228
230
|
) : (
|
|
229
231
|
<p className="openapi-explorer__response-placeholder-message">
|
|
230
232
|
<Translate
|
|
231
|
-
id={
|
|
233
|
+
id={"theme.openapi.response.placeholder"}
|
|
232
234
|
values={{
|
|
233
235
|
code: (
|
|
234
236
|
<code>
|
|
235
|
-
<Translate id={
|
|
237
|
+
<Translate id={"theme.openapi.request.sendButton"}>
|
|
236
238
|
Send API Request
|
|
237
239
|
</Translate>
|
|
238
240
|
</code>
|
|
@@ -10,7 +10,6 @@ import React from "react";
|
|
|
10
10
|
import Link from "@docusaurus/Link";
|
|
11
11
|
import { translate } from "@docusaurus/Translate";
|
|
12
12
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
13
|
-
import { OPENAPI_SECURITY_SCHEMES } from "@theme/translationIds";
|
|
14
13
|
|
|
15
14
|
function SecuritySchemes(props: any) {
|
|
16
15
|
const options = useTypedSelector((state: any) => state.auth.options);
|
|
@@ -25,45 +24,54 @@ function SecuritySchemes(props: any) {
|
|
|
25
24
|
|
|
26
25
|
const selectedAuth = options[selected];
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
// Each label uses a static `translate()` call (literal id + message) so that
|
|
28
|
+
// `docusaurus write-translations` can statically extract it. A dynamic
|
|
29
|
+
// `translate({ id: someVar })` would be skipped by the extractor.
|
|
30
|
+
const renderRestLabel = (k: string): string => {
|
|
31
|
+
switch (k) {
|
|
32
|
+
case "description":
|
|
33
|
+
return translate({
|
|
34
|
+
id: "theme.openapi.securitySchemes.description",
|
|
35
|
+
message: "description:",
|
|
36
|
+
});
|
|
37
|
+
case "scheme":
|
|
38
|
+
return translate({
|
|
39
|
+
id: "theme.openapi.securitySchemes.scheme",
|
|
40
|
+
message: "scheme:",
|
|
41
|
+
});
|
|
42
|
+
case "bearerFormat":
|
|
43
|
+
return translate({
|
|
44
|
+
id: "theme.openapi.securitySchemes.bearerFormat",
|
|
45
|
+
message: "bearerFormat:",
|
|
46
|
+
});
|
|
47
|
+
case "openIdConnectUrl":
|
|
48
|
+
return translate({
|
|
49
|
+
id: "theme.openapi.securitySchemes.openIdConnectUrl",
|
|
50
|
+
message: "openIdConnectUrl:",
|
|
51
|
+
});
|
|
52
|
+
default:
|
|
53
|
+
return `${k}:`;
|
|
54
|
+
}
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
const renderRest = (rest: Record<string, any>) =>
|
|
48
|
-
Object.keys(rest).map((k) =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{typeof rest[k] === "object"
|
|
57
|
-
? JSON.stringify(rest[k], null, 2)
|
|
58
|
-
: String(rest[k])}
|
|
59
|
-
</span>
|
|
60
|
-
);
|
|
61
|
-
});
|
|
58
|
+
Object.keys(rest).map((k) => (
|
|
59
|
+
<span key={k}>
|
|
60
|
+
<strong>{renderRestLabel(k)} </strong>
|
|
61
|
+
{typeof rest[k] === "object"
|
|
62
|
+
? JSON.stringify(rest[k], null, 2)
|
|
63
|
+
: String(rest[k])}
|
|
64
|
+
</span>
|
|
65
|
+
));
|
|
62
66
|
return (
|
|
63
67
|
<details className="openapi-security__details" open={false}>
|
|
64
68
|
<summary className="openapi-security__summary-container">
|
|
65
69
|
<h4 className="openapi-security__summary-header">
|
|
66
|
-
|
|
70
|
+
{translate({
|
|
71
|
+
id: "theme.openapi.securitySchemes.authorization",
|
|
72
|
+
message: "Authorization:",
|
|
73
|
+
})}{" "}
|
|
74
|
+
{selectedAuth[0].name ?? selectedAuth[0].type}
|
|
67
75
|
</h4>
|
|
68
76
|
</summary>
|
|
69
77
|
{selectedAuth.map((auth: any) => {
|
|
@@ -87,7 +95,7 @@ function SecuritySchemes(props: any) {
|
|
|
87
95
|
<span>
|
|
88
96
|
<strong>
|
|
89
97
|
{translate({
|
|
90
|
-
id:
|
|
98
|
+
id: "theme.openapi.securitySchemes.name",
|
|
91
99
|
message: "name:",
|
|
92
100
|
})}
|
|
93
101
|
</strong>{" "}
|
|
@@ -96,7 +104,7 @@ function SecuritySchemes(props: any) {
|
|
|
96
104
|
<span>
|
|
97
105
|
<strong>
|
|
98
106
|
{translate({
|
|
99
|
-
id:
|
|
107
|
+
id: "theme.openapi.securitySchemes.type",
|
|
100
108
|
message: "type:",
|
|
101
109
|
})}
|
|
102
110
|
</strong>{" "}
|
|
@@ -106,7 +114,7 @@ function SecuritySchemes(props: any) {
|
|
|
106
114
|
<span>
|
|
107
115
|
<strong>
|
|
108
116
|
{translate({
|
|
109
|
-
id:
|
|
117
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
110
118
|
message: "scopes:",
|
|
111
119
|
})}
|
|
112
120
|
</strong>{" "}
|
|
@@ -134,7 +142,7 @@ function SecuritySchemes(props: any) {
|
|
|
134
142
|
<span>
|
|
135
143
|
<strong>
|
|
136
144
|
{translate({
|
|
137
|
-
id:
|
|
145
|
+
id: "theme.openapi.securitySchemes.name",
|
|
138
146
|
message: "name:",
|
|
139
147
|
})}
|
|
140
148
|
</strong>{" "}
|
|
@@ -143,7 +151,7 @@ function SecuritySchemes(props: any) {
|
|
|
143
151
|
<span>
|
|
144
152
|
<strong>
|
|
145
153
|
{translate({
|
|
146
|
-
id:
|
|
154
|
+
id: "theme.openapi.securitySchemes.type",
|
|
147
155
|
message: "type:",
|
|
148
156
|
})}
|
|
149
157
|
</strong>{" "}
|
|
@@ -153,7 +161,7 @@ function SecuritySchemes(props: any) {
|
|
|
153
161
|
<span>
|
|
154
162
|
<strong>
|
|
155
163
|
{translate({
|
|
156
|
-
id:
|
|
164
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
157
165
|
message: "scopes:",
|
|
158
166
|
})}
|
|
159
167
|
</strong>{" "}
|
|
@@ -179,7 +187,7 @@ function SecuritySchemes(props: any) {
|
|
|
179
187
|
<span>
|
|
180
188
|
<strong>
|
|
181
189
|
{translate({
|
|
182
|
-
id:
|
|
190
|
+
id: "theme.openapi.securitySchemes.name",
|
|
183
191
|
message: "name:",
|
|
184
192
|
})}
|
|
185
193
|
</strong>{" "}
|
|
@@ -188,7 +196,7 @@ function SecuritySchemes(props: any) {
|
|
|
188
196
|
<span>
|
|
189
197
|
<strong>
|
|
190
198
|
{translate({
|
|
191
|
-
id:
|
|
199
|
+
id: "theme.openapi.securitySchemes.type",
|
|
192
200
|
message: "type:",
|
|
193
201
|
})}
|
|
194
202
|
</strong>{" "}
|
|
@@ -197,7 +205,7 @@ function SecuritySchemes(props: any) {
|
|
|
197
205
|
<span>
|
|
198
206
|
<strong>
|
|
199
207
|
{translate({
|
|
200
|
-
id:
|
|
208
|
+
id: "theme.openapi.securitySchemes.in",
|
|
201
209
|
message: "in:",
|
|
202
210
|
})}
|
|
203
211
|
</strong>{" "}
|
|
@@ -222,7 +230,7 @@ function SecuritySchemes(props: any) {
|
|
|
222
230
|
<span>
|
|
223
231
|
<strong>
|
|
224
232
|
{translate({
|
|
225
|
-
id:
|
|
233
|
+
id: "theme.openapi.securitySchemes.name",
|
|
226
234
|
message: "name:",
|
|
227
235
|
})}
|
|
228
236
|
</strong>{" "}
|
|
@@ -231,7 +239,7 @@ function SecuritySchemes(props: any) {
|
|
|
231
239
|
<span>
|
|
232
240
|
<strong>
|
|
233
241
|
{translate({
|
|
234
|
-
id:
|
|
242
|
+
id: "theme.openapi.securitySchemes.type",
|
|
235
243
|
message: "type:",
|
|
236
244
|
})}
|
|
237
245
|
</strong>{" "}
|
|
@@ -241,7 +249,7 @@ function SecuritySchemes(props: any) {
|
|
|
241
249
|
<span>
|
|
242
250
|
<strong>
|
|
243
251
|
{translate({
|
|
244
|
-
id:
|
|
252
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
245
253
|
message: "scopes:",
|
|
246
254
|
})}
|
|
247
255
|
</strong>{" "}
|
|
@@ -270,7 +278,7 @@ function SecuritySchemes(props: any) {
|
|
|
270
278
|
<span>
|
|
271
279
|
<strong>
|
|
272
280
|
{translate({
|
|
273
|
-
id:
|
|
281
|
+
id: "theme.openapi.securitySchemes.name",
|
|
274
282
|
message: "name:",
|
|
275
283
|
})}
|
|
276
284
|
</strong>{" "}
|
|
@@ -279,7 +287,7 @@ function SecuritySchemes(props: any) {
|
|
|
279
287
|
<span>
|
|
280
288
|
<strong>
|
|
281
289
|
{translate({
|
|
282
|
-
id:
|
|
290
|
+
id: "theme.openapi.securitySchemes.type",
|
|
283
291
|
message: "type:",
|
|
284
292
|
})}
|
|
285
293
|
</strong>{" "}
|
|
@@ -289,7 +297,7 @@ function SecuritySchemes(props: any) {
|
|
|
289
297
|
<span>
|
|
290
298
|
<strong>
|
|
291
299
|
{translate({
|
|
292
|
-
id:
|
|
300
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
293
301
|
message: "scopes:",
|
|
294
302
|
})}
|
|
295
303
|
</strong>{" "}
|
|
@@ -304,7 +312,7 @@ function SecuritySchemes(props: any) {
|
|
|
304
312
|
<code>
|
|
305
313
|
<strong>
|
|
306
314
|
{translate({
|
|
307
|
-
id:
|
|
315
|
+
id: "theme.openapi.securitySchemes.flows",
|
|
308
316
|
message: "flows:",
|
|
309
317
|
})}
|
|
310
318
|
</strong>{" "}
|
|
@@ -331,7 +339,7 @@ function SecuritySchemes(props: any) {
|
|
|
331
339
|
<span>
|
|
332
340
|
<strong>
|
|
333
341
|
{translate({
|
|
334
|
-
id:
|
|
342
|
+
id: "theme.openapi.securitySchemes.name",
|
|
335
343
|
message: "name:",
|
|
336
344
|
})}
|
|
337
345
|
</strong>{" "}
|
|
@@ -340,7 +348,7 @@ function SecuritySchemes(props: any) {
|
|
|
340
348
|
<span>
|
|
341
349
|
<strong>
|
|
342
350
|
{translate({
|
|
343
|
-
id:
|
|
351
|
+
id: "theme.openapi.securitySchemes.type",
|
|
344
352
|
message: "type:",
|
|
345
353
|
})}
|
|
346
354
|
</strong>{" "}
|
|
@@ -350,7 +358,7 @@ function SecuritySchemes(props: any) {
|
|
|
350
358
|
<span>
|
|
351
359
|
<strong>
|
|
352
360
|
{translate({
|
|
353
|
-
id:
|
|
361
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
354
362
|
message: "scopes:",
|
|
355
363
|
})}
|
|
356
364
|
</strong>{" "}
|
|
@@ -13,7 +13,6 @@ import FormItem from "@theme/ApiExplorer/FormItem";
|
|
|
13
13
|
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
14
14
|
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
15
15
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
16
|
-
import { OPENAPI_SERVER } from "@theme/translationIds";
|
|
17
16
|
|
|
18
17
|
import { setServer, setServerVariable } from "./slice";
|
|
19
18
|
|
|
@@ -65,7 +64,10 @@ function Server({ labelId }: ServerProps) {
|
|
|
65
64
|
return (
|
|
66
65
|
<FloatingButton
|
|
67
66
|
onClick={() => setIsEditing(true)}
|
|
68
|
-
label={translate({
|
|
67
|
+
label={translate({
|
|
68
|
+
id: "theme.openapi.server.editButton",
|
|
69
|
+
message: "Edit",
|
|
70
|
+
})}
|
|
69
71
|
>
|
|
70
72
|
<FormItem>
|
|
71
73
|
<span className="openapi-explorer__server-url" title={url}>
|
|
@@ -79,7 +81,10 @@ function Server({ labelId }: ServerProps) {
|
|
|
79
81
|
<div className="openapi-explorer__server-container">
|
|
80
82
|
<FloatingButton
|
|
81
83
|
onClick={() => setIsEditing(false)}
|
|
82
|
-
label={translate({
|
|
84
|
+
label={translate({
|
|
85
|
+
id: "theme.openapi.server.hideButton",
|
|
86
|
+
message: "Hide",
|
|
87
|
+
})}
|
|
83
88
|
>
|
|
84
89
|
<FormItem>
|
|
85
90
|
<FormSelect
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
import { translate } from "@docusaurus/Translate";
|
|
25
25
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
26
26
|
import Heading from "@theme/Heading";
|
|
27
|
-
import { OPENAPI_TABS } from "@theme/translationIds";
|
|
28
27
|
import clsx from "clsx";
|
|
29
28
|
|
|
30
29
|
export interface TabListProps extends TabProps {
|
|
@@ -39,7 +38,7 @@ function TabList({
|
|
|
39
38
|
selectValue,
|
|
40
39
|
tabValues,
|
|
41
40
|
label = translate({
|
|
42
|
-
id:
|
|
41
|
+
id: "theme.openapi.tabs.responses.label",
|
|
43
42
|
message: "Responses",
|
|
44
43
|
}),
|
|
45
44
|
id = "responses",
|
|
@@ -11,7 +11,6 @@ import { translate } from "@docusaurus/Translate";
|
|
|
11
11
|
import { ExampleObject } from "@theme/ParamsItem";
|
|
12
12
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
13
13
|
import TabItem from "@theme/TabItem";
|
|
14
|
-
import { OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
|
|
15
14
|
|
|
16
15
|
const EXAMPLE_CLASS_NAME = "openapi-example";
|
|
17
16
|
const EXAMPLES_CLASS_NAME = "openapi-examples";
|
|
@@ -58,7 +57,7 @@ const renderExample = (example: ExampleType) => {
|
|
|
58
57
|
<div className={EXAMPLE_CLASS_NAME}>
|
|
59
58
|
<strong>
|
|
60
59
|
{translate({
|
|
61
|
-
id:
|
|
60
|
+
id: "theme.openapi.schemaItem.example",
|
|
62
61
|
message: "Example:",
|
|
63
62
|
})}{" "}
|
|
64
63
|
</strong>
|
|
@@ -121,7 +120,7 @@ export const renderExamplesRecord = (
|
|
|
121
120
|
<div className={EXAMPLES_CLASS_NAME}>
|
|
122
121
|
<strong>
|
|
123
122
|
{translate({
|
|
124
|
-
id:
|
|
123
|
+
id: "theme.openapi.schemaItem.examples",
|
|
125
124
|
message: "Examples:",
|
|
126
125
|
})}
|
|
127
126
|
</strong>
|
|
@@ -153,7 +152,7 @@ const renderExampleObject = (
|
|
|
153
152
|
<p>
|
|
154
153
|
<strong>
|
|
155
154
|
{translate({
|
|
156
|
-
id:
|
|
155
|
+
id: "theme.openapi.schemaItem.description",
|
|
157
156
|
message: "Description:",
|
|
158
157
|
})}{" "}
|
|
159
158
|
</strong>
|
|
@@ -12,7 +12,6 @@ import { translate } from "@docusaurus/Translate";
|
|
|
12
12
|
import Details from "@theme/Details";
|
|
13
13
|
import ParamsItem from "@theme/ParamsItem";
|
|
14
14
|
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
15
|
-
import { OPENAPI_PARAMS_DETAILS } from "@theme/translationIds";
|
|
16
15
|
|
|
17
16
|
interface Props {
|
|
18
17
|
parameters: any[];
|
|
@@ -35,7 +34,7 @@ const ParamsDetailsComponent: React.FC<Props> = ({ parameters }) => {
|
|
|
35
34
|
<h3 className="openapi-markdown__details-summary-header-params">
|
|
36
35
|
{translate(
|
|
37
36
|
{
|
|
38
|
-
id:
|
|
37
|
+
id: "theme.openapi.paramsDetails.parametersTitle",
|
|
39
38
|
message: "{type} Parameters",
|
|
40
39
|
},
|
|
41
40
|
{ type: type.charAt(0).toUpperCase() + type.slice(1) }
|