docusaurus-theme-openapi-docs 0.0.0-1054 → 0.0.0-1056
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 +6 -1
- package/lib/theme/ApiExplorer/Authorization/index.js +50 -9
- 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 +208 -69
- 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 +72 -9
- package/lib/theme/RequestSchema/index.js +18 -4
- package/lib/theme/ResponseExamples/index.js +23 -3
- package/lib/theme/ResponseSchema/index.js +7 -1
- package/lib/theme/Schema/index.js +29 -6
- package/lib/theme/SchemaItem/index.js +77 -10
- package/lib/theme/StatusCodes/index.js +11 -2
- package/lib/theme/translationIds.d.ts +83 -0
- package/lib/theme/translationIds.js +106 -0
- package/package.json +3 -3
- package/src/markdown/schema.ts +6 -1
- package/src/theme/ApiExplorer/Authorization/index.tsx +50 -9
- 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 +157 -69
- 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 +54 -9
- package/src/theme/RequestSchema/index.tsx +19 -4
- package/src/theme/ResponseExamples/index.tsx +23 -3
- package/src/theme/ResponseSchema/index.tsx +7 -1
- package/src/theme/Schema/index.tsx +34 -6
- package/src/theme/SchemaItem/index.tsx +58 -10
- package/src/theme/StatusCodes/index.tsx +13 -2
- package/src/theme/translationIds.ts +103 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -12,16 +12,26 @@ 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 Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
16
17
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
17
18
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
18
19
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
19
20
|
const clsx_1 = __importDefault(require("clsx"));
|
|
21
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
20
22
|
const schema_1 = require("../../markdown/schema");
|
|
21
23
|
const utils_1 = require("../../markdown/utils");
|
|
22
24
|
const getEnumDescriptionMarkdown = (enumDescriptions) => {
|
|
23
25
|
if (enumDescriptions?.length) {
|
|
24
|
-
|
|
26
|
+
const enumValue = (0, Translate_1.translate)({
|
|
27
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_VALUE,
|
|
28
|
+
message: "Enum Value",
|
|
29
|
+
});
|
|
30
|
+
const description = (0, Translate_1.translate)({
|
|
31
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_DESCRIPTION,
|
|
32
|
+
message: "Description",
|
|
33
|
+
});
|
|
34
|
+
return `| ${enumValue} | ${description} |
|
|
25
35
|
| ---- | ----- |
|
|
26
36
|
${enumDescriptions
|
|
27
37
|
.map((desc) => {
|
|
@@ -69,14 +79,20 @@ function ParamsItem({ param, ...rest }) {
|
|
|
69
79
|
react_1.default.createElement(
|
|
70
80
|
"span",
|
|
71
81
|
{ className: "openapi-schema__required" },
|
|
72
|
-
|
|
82
|
+
(0, Translate_1.translate)({
|
|
83
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
84
|
+
message: "required",
|
|
85
|
+
})
|
|
73
86
|
)
|
|
74
87
|
);
|
|
75
88
|
const renderDeprecated = (0, utils_1.guard)(deprecated, () =>
|
|
76
89
|
react_1.default.createElement(
|
|
77
90
|
"span",
|
|
78
91
|
{ className: "openapi-schema__deprecated" },
|
|
79
|
-
|
|
92
|
+
(0, Translate_1.translate)({
|
|
93
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEPRECATED,
|
|
94
|
+
message: "deprecated",
|
|
95
|
+
})
|
|
80
96
|
)
|
|
81
97
|
);
|
|
82
98
|
const renderQualifier = (0, utils_1.guard)(
|
|
@@ -103,7 +119,15 @@ function ParamsItem({ param, ...rest }) {
|
|
|
103
119
|
return react_1.default.createElement(
|
|
104
120
|
"div",
|
|
105
121
|
null,
|
|
106
|
-
react_1.default.createElement(
|
|
122
|
+
react_1.default.createElement(
|
|
123
|
+
"strong",
|
|
124
|
+
null,
|
|
125
|
+
(0, Translate_1.translate)({
|
|
126
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
127
|
+
message: "Default value:",
|
|
128
|
+
}),
|
|
129
|
+
" "
|
|
130
|
+
),
|
|
107
131
|
react_1.default.createElement(
|
|
108
132
|
"span",
|
|
109
133
|
null,
|
|
@@ -114,7 +138,15 @@ function ParamsItem({ param, ...rest }) {
|
|
|
114
138
|
return react_1.default.createElement(
|
|
115
139
|
"div",
|
|
116
140
|
null,
|
|
117
|
-
react_1.default.createElement(
|
|
141
|
+
react_1.default.createElement(
|
|
142
|
+
"strong",
|
|
143
|
+
null,
|
|
144
|
+
(0, Translate_1.translate)({
|
|
145
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
146
|
+
message: "Default value:",
|
|
147
|
+
}),
|
|
148
|
+
" "
|
|
149
|
+
),
|
|
118
150
|
react_1.default.createElement(
|
|
119
151
|
"span",
|
|
120
152
|
null,
|
|
@@ -134,7 +166,15 @@ function ParamsItem({ param, ...rest }) {
|
|
|
134
166
|
react_1.default.createElement(
|
|
135
167
|
"div",
|
|
136
168
|
null,
|
|
137
|
-
react_1.default.createElement(
|
|
169
|
+
react_1.default.createElement(
|
|
170
|
+
"strong",
|
|
171
|
+
null,
|
|
172
|
+
(0, Translate_1.translate)({
|
|
173
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXAMPLE,
|
|
174
|
+
message: "Example:",
|
|
175
|
+
}),
|
|
176
|
+
" "
|
|
177
|
+
),
|
|
138
178
|
example
|
|
139
179
|
)
|
|
140
180
|
);
|
|
@@ -143,7 +183,14 @@ function ParamsItem({ param, ...rest }) {
|
|
|
143
183
|
return react_1.default.createElement(
|
|
144
184
|
react_1.default.Fragment,
|
|
145
185
|
null,
|
|
146
|
-
react_1.default.createElement(
|
|
186
|
+
react_1.default.createElement(
|
|
187
|
+
"strong",
|
|
188
|
+
null,
|
|
189
|
+
(0, Translate_1.translate)({
|
|
190
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXAMPLES,
|
|
191
|
+
message: "Examples:",
|
|
192
|
+
})
|
|
193
|
+
),
|
|
147
194
|
react_1.default.createElement(
|
|
148
195
|
SchemaTabs_1.default,
|
|
149
196
|
null,
|
|
@@ -162,7 +209,15 @@ function ParamsItem({ param, ...rest }) {
|
|
|
162
209
|
react_1.default.createElement(
|
|
163
210
|
"p",
|
|
164
211
|
null,
|
|
165
|
-
react_1.default.createElement(
|
|
212
|
+
react_1.default.createElement(
|
|
213
|
+
"strong",
|
|
214
|
+
null,
|
|
215
|
+
(0, Translate_1.translate)({
|
|
216
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DESCRIPTION,
|
|
217
|
+
message: "Description:",
|
|
218
|
+
}),
|
|
219
|
+
" "
|
|
220
|
+
),
|
|
166
221
|
react_1.default.createElement(
|
|
167
222
|
"span",
|
|
168
223
|
null,
|
|
@@ -172,7 +227,15 @@ function ParamsItem({ param, ...rest }) {
|
|
|
172
227
|
react_1.default.createElement(
|
|
173
228
|
"p",
|
|
174
229
|
null,
|
|
175
|
-
react_1.default.createElement(
|
|
230
|
+
react_1.default.createElement(
|
|
231
|
+
"strong",
|
|
232
|
+
null,
|
|
233
|
+
(0, Translate_1.translate)({
|
|
234
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXAMPLE,
|
|
235
|
+
message: "Example:",
|
|
236
|
+
}),
|
|
237
|
+
" "
|
|
238
|
+
),
|
|
176
239
|
react_1.default.createElement(
|
|
177
240
|
"code",
|
|
178
241
|
null,
|
|
@@ -12,6 +12,8 @@ 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");
|
|
16
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
15
17
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
18
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
17
19
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
@@ -66,12 +68,18 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
66
68
|
className:
|
|
67
69
|
"openapi-markdown__details-summary-header-body",
|
|
68
70
|
},
|
|
69
|
-
|
|
71
|
+
(0, Translate_1.translate)({
|
|
72
|
+
id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
|
|
73
|
+
message: title,
|
|
74
|
+
}),
|
|
70
75
|
body.required === true &&
|
|
71
76
|
react_1.default.createElement(
|
|
72
77
|
"span",
|
|
73
78
|
{ className: "openapi-schema__required" },
|
|
74
|
-
|
|
79
|
+
(0, Translate_1.translate)({
|
|
80
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
81
|
+
message: "required",
|
|
82
|
+
})
|
|
75
83
|
)
|
|
76
84
|
)
|
|
77
85
|
)
|
|
@@ -133,7 +141,10 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
133
141
|
react_1.default.createElement(
|
|
134
142
|
"h3",
|
|
135
143
|
{ className: "openapi-markdown__details-summary-header-body" },
|
|
136
|
-
|
|
144
|
+
(0, Translate_1.translate)({
|
|
145
|
+
id: translationIds_1.OPENAPI_REQUEST.BODY_TITLE,
|
|
146
|
+
message: title,
|
|
147
|
+
}),
|
|
137
148
|
firstBody.type === "array" &&
|
|
138
149
|
react_1.default.createElement(
|
|
139
150
|
"span",
|
|
@@ -144,7 +155,10 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
144
155
|
react_1.default.createElement(
|
|
145
156
|
"strong",
|
|
146
157
|
{ className: "openapi-schema__required" },
|
|
147
|
-
|
|
158
|
+
(0, Translate_1.translate)({
|
|
159
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
160
|
+
message: "required",
|
|
161
|
+
})
|
|
148
162
|
)
|
|
149
163
|
)
|
|
150
164
|
)
|
|
@@ -17,9 +17,11 @@ exports.ExampleFromSchema =
|
|
|
17
17
|
void 0;
|
|
18
18
|
exports.json2xml = json2xml;
|
|
19
19
|
const react_1 = __importDefault(require("react"));
|
|
20
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
20
21
|
const CodeSamples_1 = __importDefault(require("@theme/CodeSamples"));
|
|
21
22
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
22
23
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
24
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
23
25
|
const createResponseExample_1 = require("docusaurus-plugin-openapi-docs/lib/openapi/createResponseExample");
|
|
24
26
|
const xml_formatter_1 = __importDefault(require("xml-formatter"));
|
|
25
27
|
function json2xml(o, tab) {
|
|
@@ -107,7 +109,13 @@ const ResponseExample = ({ responseExample, mimeType }) => {
|
|
|
107
109
|
// @ts-ignore
|
|
108
110
|
react_1.default.createElement(
|
|
109
111
|
TabItem_1.default,
|
|
110
|
-
{
|
|
112
|
+
{
|
|
113
|
+
label: (0, Translate_1.translate)({
|
|
114
|
+
id: translationIds_1.OPENAPI_RESPONSE_EXAMPLES.EXAMPLE,
|
|
115
|
+
message: "Example",
|
|
116
|
+
}),
|
|
117
|
+
value: "Example",
|
|
118
|
+
},
|
|
111
119
|
responseExample.summary &&
|
|
112
120
|
react_1.default.createElement(
|
|
113
121
|
Markdown_1.default,
|
|
@@ -163,7 +171,13 @@ const ExampleFromSchema = ({ schema, mimeType }) => {
|
|
|
163
171
|
// @ts-ignore
|
|
164
172
|
react_1.default.createElement(
|
|
165
173
|
TabItem_1.default,
|
|
166
|
-
{
|
|
174
|
+
{
|
|
175
|
+
label: (0, Translate_1.translate)({
|
|
176
|
+
id: translationIds_1.OPENAPI_RESPONSE_EXAMPLES.AUTO_EXAMPLE,
|
|
177
|
+
message: "Example (auto)",
|
|
178
|
+
}),
|
|
179
|
+
value: "Example (auto)",
|
|
180
|
+
},
|
|
167
181
|
react_1.default.createElement(CodeSamples_1.default, {
|
|
168
182
|
example: xmlExample,
|
|
169
183
|
language: "xml",
|
|
@@ -180,7 +194,13 @@ const ExampleFromSchema = ({ schema, mimeType }) => {
|
|
|
180
194
|
// @ts-ignore
|
|
181
195
|
react_1.default.createElement(
|
|
182
196
|
TabItem_1.default,
|
|
183
|
-
{
|
|
197
|
+
{
|
|
198
|
+
label: (0, Translate_1.translate)({
|
|
199
|
+
id: translationIds_1.OPENAPI_RESPONSE_EXAMPLES.AUTO_EXAMPLE,
|
|
200
|
+
message: "Example (auto)",
|
|
201
|
+
}),
|
|
202
|
+
value: "Example (auto)",
|
|
203
|
+
},
|
|
184
204
|
react_1.default.createElement(CodeSamples_1.default, {
|
|
185
205
|
example: JSON.stringify(responseExample, null, 2),
|
|
186
206
|
language: "json",
|
|
@@ -12,6 +12,8 @@ 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");
|
|
16
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
15
17
|
const BrowserOnly_1 = __importDefault(require("@docusaurus/BrowserOnly"));
|
|
16
18
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
17
19
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
@@ -84,7 +86,11 @@ const ResponseSchemaComponent = ({ title, body, style }) => {
|
|
|
84
86
|
react_1.default.createElement(
|
|
85
87
|
"span",
|
|
86
88
|
{ className: "openapi-schema__required" },
|
|
87
|
-
|
|
89
|
+
(0, Translate_1.translate)({
|
|
90
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM
|
|
91
|
+
.REQUIRED,
|
|
92
|
+
message: "required",
|
|
93
|
+
})
|
|
88
94
|
)
|
|
89
95
|
)
|
|
90
96
|
)
|
|
@@ -12,6 +12,8 @@ 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");
|
|
16
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
15
17
|
const ArrayBrackets_1 = require("@theme/ArrayBrackets");
|
|
16
18
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
17
19
|
const DiscriminatorTabs_1 = __importDefault(
|
|
@@ -77,25 +79,43 @@ const Summary = ({ name, schemaName, schema, required }) => {
|
|
|
77
79
|
react_1.default.createElement(
|
|
78
80
|
"span",
|
|
79
81
|
{ className: "openapi-schema__nullable" },
|
|
80
|
-
|
|
82
|
+
(0, Translate_1.translate)({
|
|
83
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.NULLABLE,
|
|
84
|
+
message: "nullable",
|
|
85
|
+
})
|
|
81
86
|
),
|
|
82
87
|
isRequired &&
|
|
83
88
|
react_1.default.createElement(
|
|
84
89
|
"span",
|
|
85
90
|
{ className: "openapi-schema__required" },
|
|
86
|
-
|
|
91
|
+
(0, Translate_1.translate)({
|
|
92
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
93
|
+
message: "required",
|
|
94
|
+
})
|
|
87
95
|
),
|
|
88
96
|
deprecated &&
|
|
89
97
|
react_1.default.createElement(
|
|
90
98
|
"span",
|
|
91
99
|
{ className: "openapi-schema__deprecated" },
|
|
92
|
-
|
|
100
|
+
(0, Translate_1.translate)({
|
|
101
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEPRECATED,
|
|
102
|
+
message: "deprecated",
|
|
103
|
+
})
|
|
93
104
|
)
|
|
94
105
|
)
|
|
95
106
|
);
|
|
96
107
|
};
|
|
97
108
|
const AnyOneOf = ({ schema, schemaType }) => {
|
|
98
|
-
const
|
|
109
|
+
const key = schema.oneOf ? "oneOf" : "anyOf";
|
|
110
|
+
const type = schema.oneOf
|
|
111
|
+
? (0, Translate_1.translate)({
|
|
112
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ONE_OF,
|
|
113
|
+
message: "oneOf",
|
|
114
|
+
})
|
|
115
|
+
: (0, Translate_1.translate)({
|
|
116
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ANY_OF,
|
|
117
|
+
message: "anyOf",
|
|
118
|
+
});
|
|
99
119
|
return react_1.default.createElement(
|
|
100
120
|
react_1.default.Fragment,
|
|
101
121
|
null,
|
|
@@ -107,7 +127,7 @@ const AnyOneOf = ({ schema, schemaType }) => {
|
|
|
107
127
|
react_1.default.createElement(
|
|
108
128
|
SchemaTabs_1.default,
|
|
109
129
|
null,
|
|
110
|
-
schema[
|
|
130
|
+
schema[key]?.map((anyOneSchema, index) => {
|
|
111
131
|
const label = anyOneSchema.title || anyOneSchema.type;
|
|
112
132
|
return (
|
|
113
133
|
// @ts-ignore
|
|
@@ -262,7 +282,10 @@ const PropertyDiscriminator = ({
|
|
|
262
282
|
react_1.default.createElement(
|
|
263
283
|
"span",
|
|
264
284
|
{ className: "openapi-schema__required" },
|
|
265
|
-
|
|
285
|
+
(0, Translate_1.translate)({
|
|
286
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
287
|
+
message: "required",
|
|
288
|
+
})
|
|
266
289
|
)
|
|
267
290
|
),
|
|
268
291
|
react_1.default.createElement(
|
|
@@ -15,6 +15,8 @@ exports.default = SchemaItem;
|
|
|
15
15
|
const react_1 = __importDefault(require("react"));
|
|
16
16
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
17
17
|
const clsx_1 = __importDefault(require("clsx"));
|
|
18
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
19
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
18
20
|
const utils_1 = require("../../markdown/utils");
|
|
19
21
|
const transformEnumDescriptions = (enumDescriptions) => {
|
|
20
22
|
if (enumDescriptions) {
|
|
@@ -24,7 +26,15 @@ const transformEnumDescriptions = (enumDescriptions) => {
|
|
|
24
26
|
};
|
|
25
27
|
const getEnumDescriptionMarkdown = (enumDescriptions) => {
|
|
26
28
|
if (enumDescriptions?.length) {
|
|
27
|
-
|
|
29
|
+
const enumValue = (0, Translate_1.translate)({
|
|
30
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_VALUE,
|
|
31
|
+
message: "Enum Value",
|
|
32
|
+
});
|
|
33
|
+
const description = (0, Translate_1.translate)({
|
|
34
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.ENUM_DESCRIPTION,
|
|
35
|
+
message: "Description",
|
|
36
|
+
});
|
|
37
|
+
return `| ${enumValue} | ${description} |
|
|
28
38
|
| ---- | ----- |
|
|
29
39
|
${enumDescriptions
|
|
30
40
|
.map((desc) => {
|
|
@@ -69,21 +79,30 @@ function SchemaItem(props) {
|
|
|
69
79
|
react_1.default.createElement(
|
|
70
80
|
"span",
|
|
71
81
|
{ className: "openapi-schema__required" },
|
|
72
|
-
|
|
82
|
+
(0, Translate_1.translate)({
|
|
83
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.REQUIRED,
|
|
84
|
+
message: "required",
|
|
85
|
+
})
|
|
73
86
|
)
|
|
74
87
|
);
|
|
75
88
|
const renderDeprecated = (0, utils_1.guard)(deprecated, () =>
|
|
76
89
|
react_1.default.createElement(
|
|
77
90
|
"span",
|
|
78
91
|
{ className: "openapi-schema__deprecated" },
|
|
79
|
-
|
|
92
|
+
(0, Translate_1.translate)({
|
|
93
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEPRECATED,
|
|
94
|
+
message: "deprecated",
|
|
95
|
+
})
|
|
80
96
|
)
|
|
81
97
|
);
|
|
82
98
|
const renderNullable = (0, utils_1.guard)(nullable, () =>
|
|
83
99
|
react_1.default.createElement(
|
|
84
100
|
"span",
|
|
85
101
|
{ className: "openapi-schema__nullable" },
|
|
86
|
-
|
|
102
|
+
(0, Translate_1.translate)({
|
|
103
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.NULLABLE,
|
|
104
|
+
message: "nullable",
|
|
105
|
+
})
|
|
87
106
|
)
|
|
88
107
|
);
|
|
89
108
|
const renderEnumDescriptions = (0, utils_1.guard)(
|
|
@@ -120,7 +139,15 @@ function SchemaItem(props) {
|
|
|
120
139
|
return react_1.default.createElement(
|
|
121
140
|
"div",
|
|
122
141
|
null,
|
|
123
|
-
react_1.default.createElement(
|
|
142
|
+
react_1.default.createElement(
|
|
143
|
+
"strong",
|
|
144
|
+
null,
|
|
145
|
+
(0, Translate_1.translate)({
|
|
146
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
147
|
+
message: "Default value:",
|
|
148
|
+
}),
|
|
149
|
+
" "
|
|
150
|
+
),
|
|
124
151
|
react_1.default.createElement(
|
|
125
152
|
"span",
|
|
126
153
|
null,
|
|
@@ -131,7 +158,15 @@ function SchemaItem(props) {
|
|
|
131
158
|
return react_1.default.createElement(
|
|
132
159
|
"div",
|
|
133
160
|
null,
|
|
134
|
-
react_1.default.createElement(
|
|
161
|
+
react_1.default.createElement(
|
|
162
|
+
"strong",
|
|
163
|
+
null,
|
|
164
|
+
(0, Translate_1.translate)({
|
|
165
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
166
|
+
message: "Default value:",
|
|
167
|
+
}),
|
|
168
|
+
" "
|
|
169
|
+
),
|
|
135
170
|
react_1.default.createElement(
|
|
136
171
|
"span",
|
|
137
172
|
null,
|
|
@@ -151,7 +186,15 @@ function SchemaItem(props) {
|
|
|
151
186
|
return react_1.default.createElement(
|
|
152
187
|
"div",
|
|
153
188
|
null,
|
|
154
|
-
react_1.default.createElement(
|
|
189
|
+
react_1.default.createElement(
|
|
190
|
+
"strong",
|
|
191
|
+
null,
|
|
192
|
+
(0, Translate_1.translate)({
|
|
193
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXAMPLE,
|
|
194
|
+
message: "Example:",
|
|
195
|
+
}),
|
|
196
|
+
" "
|
|
197
|
+
),
|
|
155
198
|
react_1.default.createElement(
|
|
156
199
|
"span",
|
|
157
200
|
null,
|
|
@@ -162,7 +205,15 @@ function SchemaItem(props) {
|
|
|
162
205
|
return react_1.default.createElement(
|
|
163
206
|
"div",
|
|
164
207
|
null,
|
|
165
|
-
react_1.default.createElement(
|
|
208
|
+
react_1.default.createElement(
|
|
209
|
+
"strong",
|
|
210
|
+
null,
|
|
211
|
+
(0, Translate_1.translate)({
|
|
212
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.EXAMPLE,
|
|
213
|
+
message: "Example:",
|
|
214
|
+
}),
|
|
215
|
+
" "
|
|
216
|
+
),
|
|
166
217
|
react_1.default.createElement(
|
|
167
218
|
"span",
|
|
168
219
|
null,
|
|
@@ -178,7 +229,15 @@ function SchemaItem(props) {
|
|
|
178
229
|
return react_1.default.createElement(
|
|
179
230
|
"div",
|
|
180
231
|
null,
|
|
181
|
-
react_1.default.createElement(
|
|
232
|
+
react_1.default.createElement(
|
|
233
|
+
"strong",
|
|
234
|
+
null,
|
|
235
|
+
(0, Translate_1.translate)({
|
|
236
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
|
|
237
|
+
message: "Constant value:",
|
|
238
|
+
}),
|
|
239
|
+
" "
|
|
240
|
+
),
|
|
182
241
|
react_1.default.createElement(
|
|
183
242
|
"span",
|
|
184
243
|
null,
|
|
@@ -189,7 +248,15 @@ function SchemaItem(props) {
|
|
|
189
248
|
return react_1.default.createElement(
|
|
190
249
|
"div",
|
|
191
250
|
null,
|
|
192
|
-
react_1.default.createElement(
|
|
251
|
+
react_1.default.createElement(
|
|
252
|
+
"strong",
|
|
253
|
+
null,
|
|
254
|
+
(0, Translate_1.translate)({
|
|
255
|
+
id: translationIds_1.OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
|
|
256
|
+
message: "Constant value:",
|
|
257
|
+
}),
|
|
258
|
+
" "
|
|
259
|
+
),
|
|
193
260
|
react_1.default.createElement(
|
|
194
261
|
"span",
|
|
195
262
|
null,
|
|
@@ -12,12 +12,14 @@ 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 ApiTabs_1 = __importDefault(require("@theme/ApiTabs"));
|
|
16
17
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
17
18
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
18
19
|
const ResponseHeaders_1 = __importDefault(require("@theme/ResponseHeaders"));
|
|
19
20
|
const ResponseSchema_1 = __importDefault(require("@theme/ResponseSchema"));
|
|
20
21
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
22
|
+
const translationIds_1 = require("@theme/translationIds");
|
|
21
23
|
const StatusCodes = ({ label, id, responses }) => {
|
|
22
24
|
if (!responses) return null;
|
|
23
25
|
const codes = Object.keys(responses);
|
|
@@ -61,7 +63,11 @@ const StatusCodes = ({ label, id, responses }) => {
|
|
|
61
63
|
react_1.default.createElement(
|
|
62
64
|
"strong",
|
|
63
65
|
null,
|
|
64
|
-
|
|
66
|
+
(0, Translate_1.translate)({
|
|
67
|
+
id: translationIds_1.OPENAPI_STATUS_CODES
|
|
68
|
+
.RESPONSE_HEADERS,
|
|
69
|
+
message: "Response Headers",
|
|
70
|
+
})
|
|
65
71
|
)
|
|
66
72
|
),
|
|
67
73
|
},
|
|
@@ -70,7 +76,10 @@ const StatusCodes = ({ label, id, responses }) => {
|
|
|
70
76
|
})
|
|
71
77
|
),
|
|
72
78
|
react_1.default.createElement(ResponseSchema_1.default, {
|
|
73
|
-
title:
|
|
79
|
+
title: (0, Translate_1.translate)({
|
|
80
|
+
id: translationIds_1.OPENAPI_STATUS_CODES.SCHEMA_TITLE,
|
|
81
|
+
message: "Schema",
|
|
82
|
+
}),
|
|
74
83
|
body: { content: response.content },
|
|
75
84
|
})
|
|
76
85
|
)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const OPENAPI_RESPONSE: {
|
|
2
|
+
TITLE: string;
|
|
3
|
+
CLEAR: string;
|
|
4
|
+
PLACEHOLDER: string;
|
|
5
|
+
HEADERS_TAB: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const OPENAPI_TABS: {
|
|
8
|
+
RESPONSES_LABEL: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const OPENAPI_REQUEST: {
|
|
11
|
+
BODY_TITLE: string;
|
|
12
|
+
ACCEPT_TITLE: string;
|
|
13
|
+
SEND_BUTTON: string;
|
|
14
|
+
REQUIRED_LABEL: string;
|
|
15
|
+
REQUEST_TITLE: string;
|
|
16
|
+
COLLAPSE_ALL: string;
|
|
17
|
+
EXPAND_ALL: string;
|
|
18
|
+
BASE_URL_TITLE: string;
|
|
19
|
+
AUTH_TITLE: string;
|
|
20
|
+
PARAMETERS_TITLE: string;
|
|
21
|
+
FETCHING_MESSAGE: string;
|
|
22
|
+
CONNECTION_FAILED: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const OPENAPI_SERVER: {
|
|
25
|
+
EDIT_BUTTON: string;
|
|
26
|
+
HIDE_BUTTON: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const OPENAPI_PARAM_OPTIONS: {
|
|
29
|
+
SHOW_OPTIONAL: string;
|
|
30
|
+
HIDE_OPTIONAL: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const OPENAPI_FORM_FILE_UPLOAD: {
|
|
33
|
+
CLEAR_BUTTON: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const OPENAPI_FORM: {
|
|
36
|
+
FIELD_REQUIRED: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const OPENAPI_AUTH: {
|
|
39
|
+
BEARER_TOKEN: string;
|
|
40
|
+
USERNAME: string;
|
|
41
|
+
PASSWORD: string;
|
|
42
|
+
SECURITY_SCHEME: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const OPENAPI_RESPONSE_EXAMPLES: {
|
|
45
|
+
EXAMPLE: string;
|
|
46
|
+
AUTO_EXAMPLE: string;
|
|
47
|
+
};
|
|
48
|
+
export declare const OPENAPI_BODY: {
|
|
49
|
+
EXAMPLE_FROM_SCHEMA: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const OPENAPI_STATUS_CODES: {
|
|
52
|
+
RESPONSE_HEADERS: string;
|
|
53
|
+
SCHEMA_TITLE: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const OPENAPI_SCHEMA_ITEM: {
|
|
56
|
+
REQUIRED: string;
|
|
57
|
+
DEPRECATED: string;
|
|
58
|
+
NULLABLE: string;
|
|
59
|
+
DEFAULT_VALUE: string;
|
|
60
|
+
EXAMPLE: string;
|
|
61
|
+
EXAMPLES: string;
|
|
62
|
+
DESCRIPTION: string;
|
|
63
|
+
CONSTANT_VALUE: string;
|
|
64
|
+
ENUM_VALUE: string;
|
|
65
|
+
ENUM_DESCRIPTION: string;
|
|
66
|
+
POSSIBLE_VALUES: string;
|
|
67
|
+
ONE_OF: string;
|
|
68
|
+
ANY_OF: string;
|
|
69
|
+
};
|
|
70
|
+
export declare const OPENAPI_PARAMS_DETAILS: {
|
|
71
|
+
PARAMETERS_TITLE: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const OPENAPI_SECURITY_SCHEMES: {
|
|
74
|
+
NAME: string;
|
|
75
|
+
TYPE: string;
|
|
76
|
+
SCOPES: string;
|
|
77
|
+
IN: string;
|
|
78
|
+
FLOWS: string;
|
|
79
|
+
DESCRIPTION: string;
|
|
80
|
+
SCHEME: string;
|
|
81
|
+
BEARER_FORMAT: string;
|
|
82
|
+
OPEN_ID_CONNECT_URL: string;
|
|
83
|
+
};
|