docusaurus-theme-openapi-docs 0.0.0-1054 → 0.0.0-1055
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/theme/ApiExplorer/Authorization/index.js +44 -8
- package/lib/theme/ApiExplorer/Body/index.js +16 -3
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +6 -1
- package/lib/theme/ApiExplorer/FormItem/index.js +6 -1
- package/lib/theme/ApiExplorer/FormTextInput/index.js +8 -1
- package/lib/theme/ApiExplorer/LiveEditor/index.js +9 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +10 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +10 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +10 -1
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +10 -1
- package/lib/theme/ApiExplorer/ParamOptions/index.js +11 -1
- package/lib/theme/ApiExplorer/Request/index.js +59 -12
- package/lib/theme/ApiExplorer/Response/index.js +27 -13
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +167 -19
- package/lib/theme/ApiExplorer/Server/index.js +16 -2
- package/lib/theme/ApiTabs/index.js +6 -1
- package/lib/theme/ParamsDetails/index.js +9 -1
- package/lib/theme/ParamsItem/index.js +63 -8
- package/lib/theme/RequestSchema/index.js +10 -2
- package/lib/theme/ResponseExamples/index.js +23 -3
- package/lib/theme/ResponseSchema/index.js +7 -1
- package/lib/theme/SchemaItem/index.js +68 -9
- package/lib/theme/StatusCodes/index.js +11 -2
- package/lib/theme/translationIds.d.ts +73 -0
- package/lib/theme/translationIds.js +96 -0
- package/package.json +3 -3
- package/src/theme/ApiExplorer/Authorization/index.tsx +44 -8
- package/src/theme/ApiExplorer/Body/index.tsx +15 -3
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +6 -1
- package/src/theme/ApiExplorer/FormItem/index.tsx +8 -1
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +8 -1
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +9 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +10 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +10 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +10 -1
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +10 -1
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +10 -2
- package/src/theme/ApiExplorer/Request/index.tsx +55 -12
- package/src/theme/ApiExplorer/Response/index.tsx +23 -7
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +117 -19
- package/src/theme/ApiExplorer/Server/index.tsx +10 -2
- package/src/theme/ApiTabs/index.tsx +6 -1
- package/src/theme/ParamsDetails/index.tsx +10 -1
- package/src/theme/ParamsItem/index.tsx +45 -8
- package/src/theme/RequestSchema/index.tsx +11 -2
- package/src/theme/ResponseExamples/index.tsx +23 -3
- package/src/theme/ResponseSchema/index.tsx +7 -1
- package/src/theme/SchemaItem/index.tsx +49 -9
- package/src/theme/StatusCodes/index.tsx +13 -2
- package/src/theme/translationIds.ts +93 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
10
11
|
import { ErrorMessage } from "@hookform/error-message";
|
|
11
12
|
import FormMultiSelect from "@theme/ApiExplorer/FormMultiSelect";
|
|
12
13
|
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
13
14
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
15
|
+
import { OPENAPI_FORM } from "@theme/translationIds";
|
|
14
16
|
import { Controller, useFormContext } from "react-hook-form";
|
|
15
17
|
|
|
16
18
|
export interface ParamProps {
|
|
@@ -61,7 +63,14 @@ export default function ParamMultiSelectFormItem({ param }: ParamProps) {
|
|
|
61
63
|
<>
|
|
62
64
|
<Controller
|
|
63
65
|
control={control}
|
|
64
|
-
rules={{
|
|
66
|
+
rules={{
|
|
67
|
+
required: param.required
|
|
68
|
+
? translate({
|
|
69
|
+
id: OPENAPI_FORM.FIELD_REQUIRED,
|
|
70
|
+
message: "This field is required",
|
|
71
|
+
})
|
|
72
|
+
: false,
|
|
73
|
+
}}
|
|
65
74
|
name="paramMultiSelect"
|
|
66
75
|
render={({ field: { onChange, name } }) => (
|
|
67
76
|
<FormMultiSelect
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
10
11
|
import { ErrorMessage } from "@hookform/error-message";
|
|
11
12
|
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
12
13
|
import { Param, setParam } from "@theme/ApiExplorer/ParamOptions/slice";
|
|
13
14
|
import { useTypedDispatch } from "@theme/ApiItem/hooks";
|
|
15
|
+
import { OPENAPI_FORM } from "@theme/translationIds";
|
|
14
16
|
import { Controller, useFormContext } from "react-hook-form";
|
|
15
17
|
|
|
16
18
|
export interface ParamProps {
|
|
@@ -33,7 +35,14 @@ export default function ParamSelectFormItem({ param }: ParamProps) {
|
|
|
33
35
|
<>
|
|
34
36
|
<Controller
|
|
35
37
|
control={control}
|
|
36
|
-
rules={{
|
|
38
|
+
rules={{
|
|
39
|
+
required: param.required
|
|
40
|
+
? translate({
|
|
41
|
+
id: OPENAPI_FORM.FIELD_REQUIRED,
|
|
42
|
+
message: "This field is required",
|
|
43
|
+
})
|
|
44
|
+
: false,
|
|
45
|
+
}}
|
|
37
46
|
name="paramSelect"
|
|
38
47
|
render={({ field: { onChange, name } }) => (
|
|
39
48
|
<FormSelect
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React, { useState } from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
10
11
|
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
11
12
|
import ParamArrayFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem";
|
|
12
13
|
import ParamBooleanFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem";
|
|
@@ -14,6 +15,7 @@ import ParamMultiSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormI
|
|
|
14
15
|
import ParamSelectFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem";
|
|
15
16
|
import ParamTextFormItem from "@theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem";
|
|
16
17
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
18
|
+
import { OPENAPI_PARAM_OPTIONS } from "@theme/translationIds";
|
|
17
19
|
|
|
18
20
|
import { Param } from "./slice";
|
|
19
21
|
|
|
@@ -119,8 +121,14 @@ function ParamOptions() {
|
|
|
119
121
|
</span>
|
|
120
122
|
</span>
|
|
121
123
|
{showOptional
|
|
122
|
-
?
|
|
123
|
-
|
|
124
|
+
? translate({
|
|
125
|
+
id: OPENAPI_PARAM_OPTIONS.HIDE_OPTIONAL,
|
|
126
|
+
message: "Hide optional parameters",
|
|
127
|
+
})
|
|
128
|
+
: translate({
|
|
129
|
+
id: OPENAPI_PARAM_OPTIONS.SHOW_OPTIONAL,
|
|
130
|
+
message: "Show optional parameters",
|
|
131
|
+
})}
|
|
124
132
|
</button>
|
|
125
133
|
|
|
126
134
|
<div
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React, { useState } from "react";
|
|
10
10
|
|
|
11
11
|
import { useDoc } from "@docusaurus/plugin-content-docs/client";
|
|
12
|
+
import { translate } from "@docusaurus/Translate";
|
|
12
13
|
import Accept from "@theme/ApiExplorer/Accept";
|
|
13
14
|
import Authorization from "@theme/ApiExplorer/Authorization";
|
|
14
15
|
import Body from "@theme/ApiExplorer/Body";
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
} from "@theme/ApiExplorer/Response/slice";
|
|
25
26
|
import Server from "@theme/ApiExplorer/Server";
|
|
26
27
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
28
|
+
import { OPENAPI_REQUEST } from "@theme/translationIds";
|
|
27
29
|
import { ParameterObject } from "docusaurus-plugin-openapi-docs/src/openapi/types";
|
|
28
30
|
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
29
31
|
import * as sdk from "postman-collection";
|
|
@@ -117,7 +119,14 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
117
119
|
};
|
|
118
120
|
|
|
119
121
|
const onSubmit = async (data) => {
|
|
120
|
-
dispatch(
|
|
122
|
+
dispatch(
|
|
123
|
+
setResponse(
|
|
124
|
+
translate({
|
|
125
|
+
id: OPENAPI_REQUEST.FETCHING_MESSAGE,
|
|
126
|
+
message: "Fetching...",
|
|
127
|
+
})
|
|
128
|
+
)
|
|
129
|
+
);
|
|
121
130
|
try {
|
|
122
131
|
await delay(1200);
|
|
123
132
|
const res = await makeRequest(postmanRequest, proxy, body);
|
|
@@ -128,7 +137,14 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
128
137
|
}
|
|
129
138
|
} catch (e) {
|
|
130
139
|
console.log(e);
|
|
131
|
-
dispatch(
|
|
140
|
+
dispatch(
|
|
141
|
+
setResponse(
|
|
142
|
+
translate({
|
|
143
|
+
id: OPENAPI_REQUEST.CONNECTION_FAILED,
|
|
144
|
+
message: "Connection failed",
|
|
145
|
+
})
|
|
146
|
+
)
|
|
147
|
+
);
|
|
132
148
|
dispatch(clearCode());
|
|
133
149
|
dispatch(clearHeaders());
|
|
134
150
|
}
|
|
@@ -178,20 +194,31 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
178
194
|
onSubmit={methods.handleSubmit(onSubmit)}
|
|
179
195
|
>
|
|
180
196
|
<div className="openapi-explorer__request-header-container">
|
|
181
|
-
<span className="openapi-explorer__request-title">
|
|
197
|
+
<span className="openapi-explorer__request-title">
|
|
198
|
+
{translate({
|
|
199
|
+
id: OPENAPI_REQUEST.REQUEST_TITLE,
|
|
200
|
+
message: "Request",
|
|
201
|
+
})}
|
|
202
|
+
</span>
|
|
182
203
|
{allDetailsExpanded ? (
|
|
183
204
|
<span
|
|
184
205
|
className="openapi-explorer__expand-details-btn"
|
|
185
206
|
onClick={collapseAllDetails}
|
|
186
207
|
>
|
|
187
|
-
|
|
208
|
+
{translate({
|
|
209
|
+
id: OPENAPI_REQUEST.COLLAPSE_ALL,
|
|
210
|
+
message: "Collapse all",
|
|
211
|
+
})}
|
|
188
212
|
</span>
|
|
189
213
|
) : (
|
|
190
214
|
<span
|
|
191
215
|
className="openapi-explorer__expand-details-btn"
|
|
192
216
|
onClick={expandAllDetails}
|
|
193
217
|
>
|
|
194
|
-
|
|
218
|
+
{translate({
|
|
219
|
+
id: OPENAPI_REQUEST.EXPAND_ALL,
|
|
220
|
+
message: "Expand all",
|
|
221
|
+
})}
|
|
195
222
|
</span>
|
|
196
223
|
)}
|
|
197
224
|
</div>
|
|
@@ -208,7 +235,10 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
208
235
|
setExpandServer(!expandServer);
|
|
209
236
|
}}
|
|
210
237
|
>
|
|
211
|
-
|
|
238
|
+
{translate({
|
|
239
|
+
id: OPENAPI_REQUEST.BASE_URL_TITLE,
|
|
240
|
+
message: "Base URL",
|
|
241
|
+
})}
|
|
212
242
|
</summary>
|
|
213
243
|
<Server />
|
|
214
244
|
</details>
|
|
@@ -225,7 +255,7 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
225
255
|
setExpandAuth(!expandAuth);
|
|
226
256
|
}}
|
|
227
257
|
>
|
|
228
|
-
Auth
|
|
258
|
+
{translate({ id: OPENAPI_REQUEST.AUTH_TITLE, message: "Auth" })}
|
|
229
259
|
</summary>
|
|
230
260
|
<Authorization />
|
|
231
261
|
</details>
|
|
@@ -244,7 +274,10 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
244
274
|
setExpandParams(!expandParams);
|
|
245
275
|
}}
|
|
246
276
|
>
|
|
247
|
-
|
|
277
|
+
{translate({
|
|
278
|
+
id: OPENAPI_REQUEST.PARAMETERS_TITLE,
|
|
279
|
+
message: "Parameters",
|
|
280
|
+
})}
|
|
248
281
|
</summary>
|
|
249
282
|
<ParamOptions />
|
|
250
283
|
</details>
|
|
@@ -261,10 +294,14 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
261
294
|
setExpandBody(!expandBody);
|
|
262
295
|
}}
|
|
263
296
|
>
|
|
264
|
-
Body
|
|
297
|
+
{translate({ id: OPENAPI_REQUEST.BODY_TITLE, message: "Body" })}
|
|
265
298
|
{requestBodyRequired && (
|
|
266
299
|
<span className="openapi-schema__required">
|
|
267
|
-
|
|
300
|
+
|
|
301
|
+
{translate({
|
|
302
|
+
id: OPENAPI_REQUEST.REQUIRED_LABEL,
|
|
303
|
+
message: "required",
|
|
304
|
+
})}
|
|
268
305
|
</span>
|
|
269
306
|
)}
|
|
270
307
|
</summary>
|
|
@@ -290,14 +327,20 @@ function Request({ item }: { item: ApiItem }) {
|
|
|
290
327
|
setExpandAccept(!expandAccept);
|
|
291
328
|
}}
|
|
292
329
|
>
|
|
293
|
-
|
|
330
|
+
{translate({
|
|
331
|
+
id: OPENAPI_REQUEST.ACCEPT_TITLE,
|
|
332
|
+
message: "Accept",
|
|
333
|
+
})}
|
|
294
334
|
</summary>
|
|
295
335
|
<Accept />
|
|
296
336
|
</details>
|
|
297
337
|
)}
|
|
298
338
|
{showRequestButton && item.method !== "event" && (
|
|
299
339
|
<button className="openapi-explorer__request-btn" type="submit">
|
|
300
|
-
|
|
340
|
+
{translate({
|
|
341
|
+
id: OPENAPI_REQUEST.SEND_BUTTON,
|
|
342
|
+
message: "Send API Request",
|
|
343
|
+
})}
|
|
301
344
|
</button>
|
|
302
345
|
)}
|
|
303
346
|
</div>
|
|
@@ -9,10 +9,12 @@ import React from "react";
|
|
|
9
9
|
|
|
10
10
|
import { useDoc } from "@docusaurus/plugin-content-docs/client";
|
|
11
11
|
import { usePrismTheme } from "@docusaurus/theme-common";
|
|
12
|
+
import { translate } from "@docusaurus/Translate";
|
|
12
13
|
import ApiCodeBlock from "@theme/ApiExplorer/ApiCodeBlock";
|
|
13
14
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
14
15
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
15
16
|
import TabItem from "@theme/TabItem";
|
|
17
|
+
import { OPENAPI_RESPONSE } from "@theme/translationIds";
|
|
16
18
|
import clsx from "clsx";
|
|
17
19
|
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
18
20
|
|
|
@@ -74,7 +76,9 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
74
76
|
return (
|
|
75
77
|
<div className="openapi-explorer__response-container">
|
|
76
78
|
<div className="openapi-explorer__response-title-container">
|
|
77
|
-
<span className="openapi-explorer__response-title">
|
|
79
|
+
<span className="openapi-explorer__response-title">
|
|
80
|
+
{translate({ id: OPENAPI_RESPONSE.TITLE, message: "Response" })}
|
|
81
|
+
</span>
|
|
78
82
|
<span
|
|
79
83
|
className="openapi-explorer__response-clear-btn"
|
|
80
84
|
onClick={() => {
|
|
@@ -83,7 +87,7 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
83
87
|
dispatch(clearHeaders());
|
|
84
88
|
}}
|
|
85
89
|
>
|
|
86
|
-
Clear
|
|
90
|
+
{translate({ id: OPENAPI_RESPONSE.CLEAR, message: "Clear" })}
|
|
87
91
|
</span>
|
|
88
92
|
</div>
|
|
89
93
|
<div
|
|
@@ -117,14 +121,23 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
117
121
|
>
|
|
118
122
|
{prettyResponse || (
|
|
119
123
|
<p className="openapi-explorer__response-placeholder-message">
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
{translate({
|
|
125
|
+
id: OPENAPI_RESPONSE.PLACEHOLDER,
|
|
126
|
+
message:
|
|
127
|
+
"Click the <code>Send API Request</code> button above and see the response here!",
|
|
128
|
+
})}
|
|
122
129
|
</p>
|
|
123
130
|
)}
|
|
124
131
|
</ApiCodeBlock>
|
|
125
132
|
</TabItem>
|
|
126
133
|
{/* @ts-ignore */}
|
|
127
|
-
<TabItem
|
|
134
|
+
<TabItem
|
|
135
|
+
label={translate({
|
|
136
|
+
id: OPENAPI_RESPONSE.HEADERS_TAB,
|
|
137
|
+
message: "Headers",
|
|
138
|
+
})}
|
|
139
|
+
value="headers"
|
|
140
|
+
>
|
|
128
141
|
{/* @ts-ignore */}
|
|
129
142
|
<ApiCodeBlock
|
|
130
143
|
className="openapi-explorer__code-block openapi-response__status-headers"
|
|
@@ -145,8 +158,11 @@ function Response({ item }: { item: ApiItem }) {
|
|
|
145
158
|
</div>
|
|
146
159
|
) : (
|
|
147
160
|
<p className="openapi-explorer__response-placeholder-message">
|
|
148
|
-
|
|
149
|
-
|
|
161
|
+
{translate({
|
|
162
|
+
id: OPENAPI_RESPONSE.PLACEHOLDER,
|
|
163
|
+
message:
|
|
164
|
+
"Click the <code>Send API Request</code> button above and see the response here!",
|
|
165
|
+
})}
|
|
150
166
|
</p>
|
|
151
167
|
)}
|
|
152
168
|
</div>
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
11
|
+
import { OPENAPI_SECURITY_SCHEMES } from "@theme/translationIds";
|
|
12
|
+
|
|
10
13
|
import Link from "@docusaurus/Link";
|
|
11
14
|
import { useTypedSelector } from "@theme/ApiItem/hooks";
|
|
12
15
|
|
|
@@ -48,16 +51,31 @@ function SecuritySchemes(props: any) {
|
|
|
48
51
|
}}
|
|
49
52
|
>
|
|
50
53
|
<span>
|
|
51
|
-
<strong>
|
|
54
|
+
<strong>
|
|
55
|
+
{translate({
|
|
56
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
57
|
+
message: "name:",
|
|
58
|
+
})}
|
|
59
|
+
</strong>{" "}
|
|
52
60
|
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
53
61
|
</span>
|
|
54
62
|
<span>
|
|
55
|
-
<strong>
|
|
63
|
+
<strong>
|
|
64
|
+
{translate({
|
|
65
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
66
|
+
message: "type:",
|
|
67
|
+
})}
|
|
68
|
+
</strong>{" "}
|
|
56
69
|
{type}
|
|
57
70
|
</span>
|
|
58
71
|
{scopes && scopes.length > 0 && (
|
|
59
72
|
<span>
|
|
60
|
-
<strong>
|
|
73
|
+
<strong>
|
|
74
|
+
{translate({
|
|
75
|
+
id: OPENAPI_SECURITY_SCHEMES.SCOPES,
|
|
76
|
+
message: "scopes:",
|
|
77
|
+
})}
|
|
78
|
+
</strong>{" "}
|
|
61
79
|
<code>
|
|
62
80
|
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
63
81
|
</code>
|
|
@@ -89,16 +107,31 @@ function SecuritySchemes(props: any) {
|
|
|
89
107
|
}}
|
|
90
108
|
>
|
|
91
109
|
<span>
|
|
92
|
-
<strong>
|
|
110
|
+
<strong>
|
|
111
|
+
{translate({
|
|
112
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
113
|
+
message: "name:",
|
|
114
|
+
})}
|
|
115
|
+
</strong>{" "}
|
|
93
116
|
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
94
117
|
</span>
|
|
95
118
|
<span>
|
|
96
|
-
<strong>
|
|
119
|
+
<strong>
|
|
120
|
+
{translate({
|
|
121
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
122
|
+
message: "type:",
|
|
123
|
+
})}
|
|
124
|
+
</strong>{" "}
|
|
97
125
|
{type}
|
|
98
126
|
</span>
|
|
99
127
|
{scopes && scopes.length > 0 && (
|
|
100
128
|
<span>
|
|
101
|
-
<strong>
|
|
129
|
+
<strong>
|
|
130
|
+
{translate({
|
|
131
|
+
id: OPENAPI_SECURITY_SCHEMES.SCOPES,
|
|
132
|
+
message: "scopes:",
|
|
133
|
+
})}
|
|
134
|
+
</strong>{" "}
|
|
102
135
|
<code>
|
|
103
136
|
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
104
137
|
</code>
|
|
@@ -128,15 +161,30 @@ function SecuritySchemes(props: any) {
|
|
|
128
161
|
}}
|
|
129
162
|
>
|
|
130
163
|
<span>
|
|
131
|
-
<strong>
|
|
164
|
+
<strong>
|
|
165
|
+
{translate({
|
|
166
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
167
|
+
message: "name:",
|
|
168
|
+
})}
|
|
169
|
+
</strong>{" "}
|
|
132
170
|
<Link to={infoAuthPath}>{auth.name ?? auth.key}</Link>
|
|
133
171
|
</span>
|
|
134
172
|
<span>
|
|
135
|
-
<strong>
|
|
173
|
+
<strong>
|
|
174
|
+
{translate({
|
|
175
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
176
|
+
message: "type:",
|
|
177
|
+
})}
|
|
178
|
+
</strong>{" "}
|
|
136
179
|
{auth.type}
|
|
137
180
|
</span>
|
|
138
181
|
<span>
|
|
139
|
-
<strong>
|
|
182
|
+
<strong>
|
|
183
|
+
{translate({
|
|
184
|
+
id: OPENAPI_SECURITY_SCHEMES.IN,
|
|
185
|
+
message: "in:",
|
|
186
|
+
})}
|
|
187
|
+
</strong>{" "}
|
|
140
188
|
{auth.in}
|
|
141
189
|
</span>
|
|
142
190
|
</pre>
|
|
@@ -156,16 +204,31 @@ function SecuritySchemes(props: any) {
|
|
|
156
204
|
}}
|
|
157
205
|
>
|
|
158
206
|
<span>
|
|
159
|
-
<strong>
|
|
207
|
+
<strong>
|
|
208
|
+
{translate({
|
|
209
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
210
|
+
message: "name:",
|
|
211
|
+
})}
|
|
212
|
+
</strong>{" "}
|
|
160
213
|
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
161
214
|
</span>
|
|
162
215
|
<span>
|
|
163
|
-
<strong>
|
|
216
|
+
<strong>
|
|
217
|
+
{translate({
|
|
218
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
219
|
+
message: "type:",
|
|
220
|
+
})}
|
|
221
|
+
</strong>{" "}
|
|
164
222
|
{type}
|
|
165
223
|
</span>
|
|
166
224
|
{scopes && scopes.length > 0 && (
|
|
167
225
|
<span>
|
|
168
|
-
<strong>
|
|
226
|
+
<strong>
|
|
227
|
+
{translate({
|
|
228
|
+
id: OPENAPI_SECURITY_SCHEMES.SCOPES,
|
|
229
|
+
message: "scopes:",
|
|
230
|
+
})}
|
|
231
|
+
</strong>{" "}
|
|
169
232
|
<code>
|
|
170
233
|
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
171
234
|
</code>
|
|
@@ -198,16 +261,31 @@ function SecuritySchemes(props: any) {
|
|
|
198
261
|
}}
|
|
199
262
|
>
|
|
200
263
|
<span>
|
|
201
|
-
<strong>
|
|
264
|
+
<strong>
|
|
265
|
+
{translate({
|
|
266
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
267
|
+
message: "name:",
|
|
268
|
+
})}
|
|
269
|
+
</strong>{" "}
|
|
202
270
|
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
203
271
|
</span>
|
|
204
272
|
<span>
|
|
205
|
-
<strong>
|
|
273
|
+
<strong>
|
|
274
|
+
{translate({
|
|
275
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
276
|
+
message: "type:",
|
|
277
|
+
})}
|
|
278
|
+
</strong>{" "}
|
|
206
279
|
{type}
|
|
207
280
|
</span>
|
|
208
281
|
{scopes && scopes.length > 0 && (
|
|
209
282
|
<span>
|
|
210
|
-
<strong>
|
|
283
|
+
<strong>
|
|
284
|
+
{translate({
|
|
285
|
+
id: OPENAPI_SECURITY_SCHEMES.SCOPES,
|
|
286
|
+
message: "scopes:",
|
|
287
|
+
})}
|
|
288
|
+
</strong>{" "}
|
|
211
289
|
<code>
|
|
212
290
|
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
213
291
|
</code>
|
|
@@ -226,7 +304,12 @@ function SecuritySchemes(props: any) {
|
|
|
226
304
|
{flows && (
|
|
227
305
|
<span>
|
|
228
306
|
<code>
|
|
229
|
-
<strong>
|
|
307
|
+
<strong>
|
|
308
|
+
{translate({
|
|
309
|
+
id: OPENAPI_SECURITY_SCHEMES.FLOWS,
|
|
310
|
+
message: "flows:",
|
|
311
|
+
})}
|
|
312
|
+
</strong>{" "}
|
|
230
313
|
{JSON.stringify(flows, null, 2)}
|
|
231
314
|
</code>
|
|
232
315
|
</span>
|
|
@@ -248,16 +331,31 @@ function SecuritySchemes(props: any) {
|
|
|
248
331
|
}}
|
|
249
332
|
>
|
|
250
333
|
<span>
|
|
251
|
-
<strong>
|
|
334
|
+
<strong>
|
|
335
|
+
{translate({
|
|
336
|
+
id: OPENAPI_SECURITY_SCHEMES.NAME,
|
|
337
|
+
message: "name:",
|
|
338
|
+
})}
|
|
339
|
+
</strong>{" "}
|
|
252
340
|
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
253
341
|
</span>
|
|
254
342
|
<span>
|
|
255
|
-
<strong>
|
|
343
|
+
<strong>
|
|
344
|
+
{translate({
|
|
345
|
+
id: OPENAPI_SECURITY_SCHEMES.TYPE,
|
|
346
|
+
message: "type:",
|
|
347
|
+
})}
|
|
348
|
+
</strong>{" "}
|
|
256
349
|
{type}
|
|
257
350
|
</span>
|
|
258
351
|
{scopes && scopes.length > 0 && (
|
|
259
352
|
<span>
|
|
260
|
-
<strong>
|
|
353
|
+
<strong>
|
|
354
|
+
{translate({
|
|
355
|
+
id: OPENAPI_SECURITY_SCHEMES.SCOPES,
|
|
356
|
+
message: "scopes:",
|
|
357
|
+
})}
|
|
358
|
+
</strong>{" "}
|
|
261
359
|
<code>
|
|
262
360
|
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
263
361
|
</code>
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
import React, { useState } from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
10
11
|
import FloatingButton from "@theme/ApiExplorer/FloatingButton";
|
|
11
12
|
import FormItem from "@theme/ApiExplorer/FormItem";
|
|
12
13
|
import FormSelect from "@theme/ApiExplorer/FormSelect";
|
|
13
14
|
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
|
|
14
15
|
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
|
|
16
|
+
import { OPENAPI_SERVER } from "@theme/translationIds";
|
|
15
17
|
|
|
16
18
|
import { setServer, setServerVariable } from "./slice";
|
|
17
19
|
|
|
@@ -57,7 +59,10 @@ function Server() {
|
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
return (
|
|
60
|
-
<FloatingButton
|
|
62
|
+
<FloatingButton
|
|
63
|
+
onClick={() => setIsEditing(true)}
|
|
64
|
+
label={translate({ id: OPENAPI_SERVER.EDIT_BUTTON, message: "Edit" })}
|
|
65
|
+
>
|
|
61
66
|
<FormItem>
|
|
62
67
|
<span className="openapi-explorer__server-url" title={url}>
|
|
63
68
|
{url}
|
|
@@ -68,7 +73,10 @@ function Server() {
|
|
|
68
73
|
}
|
|
69
74
|
return (
|
|
70
75
|
<div className="openapi-explorer__server-container">
|
|
71
|
-
<FloatingButton
|
|
76
|
+
<FloatingButton
|
|
77
|
+
onClick={() => setIsEditing(false)}
|
|
78
|
+
label={translate({ id: OPENAPI_SERVER.HIDE_BUTTON, message: "Hide" })}
|
|
79
|
+
>
|
|
72
80
|
<FormItem>
|
|
73
81
|
<FormSelect
|
|
74
82
|
options={options.map((s: any) => s.url)}
|
|
@@ -20,8 +20,10 @@ import {
|
|
|
20
20
|
useTabs,
|
|
21
21
|
} from "@docusaurus/theme-common/internal";
|
|
22
22
|
import { TabItemProps } from "@docusaurus/theme-common/lib/utils/tabsUtils";
|
|
23
|
+
import { translate } from "@docusaurus/Translate";
|
|
23
24
|
import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
24
25
|
import Heading from "@theme/Heading";
|
|
26
|
+
import { OPENAPI_TABS } from "@theme/translationIds";
|
|
25
27
|
import clsx from "clsx";
|
|
26
28
|
|
|
27
29
|
export interface TabListProps extends TabProps {
|
|
@@ -35,7 +37,10 @@ function TabList({
|
|
|
35
37
|
selectedValue,
|
|
36
38
|
selectValue,
|
|
37
39
|
tabValues,
|
|
38
|
-
label =
|
|
40
|
+
label = translate({
|
|
41
|
+
id: OPENAPI_TABS.RESPONSES_LABEL,
|
|
42
|
+
message: "Responses",
|
|
43
|
+
}),
|
|
39
44
|
id = "responses",
|
|
40
45
|
}: TabListProps & ReturnType<typeof useTabs>) {
|
|
41
46
|
const tabRefs: (HTMLLIElement | null)[] = [];
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
11
|
+
import { OPENAPI_PARAMS_DETAILS } from "@theme/translationIds";
|
|
12
|
+
|
|
10
13
|
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
14
|
import Details from "@theme/Details";
|
|
12
15
|
import ParamsItem from "@theme/ParamsItem";
|
|
@@ -31,7 +34,13 @@ const ParamsDetailsComponent: React.FC<Props> = ({ parameters }) => {
|
|
|
31
34
|
const summaryElement = (
|
|
32
35
|
<summary>
|
|
33
36
|
<h3 className="openapi-markdown__details-summary-header-params">
|
|
34
|
-
{
|
|
37
|
+
{translate(
|
|
38
|
+
{
|
|
39
|
+
id: OPENAPI_PARAMS_DETAILS.PARAMETERS_TITLE,
|
|
40
|
+
message: "{type} Parameters",
|
|
41
|
+
},
|
|
42
|
+
{ type: type.charAt(0).toUpperCase() + type.slice(1) }
|
|
43
|
+
)}
|
|
35
44
|
</h3>
|
|
36
45
|
</summary>
|
|
37
46
|
);
|